Changeset 5101 for LMDZ6/branches/Amaury_dev/libf/dyn3d
- Timestamp:
- Jul 23, 2024, 8:22:55 AM (6 months ago)
- Location:
- LMDZ6/branches/Amaury_dev/libf/dyn3d
- Files:
-
- 25 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/dyn3d/abort_gcm.F
r5099 r5101 37 37 38 38 #ifdef CPP_IOIPSL 39 callhistclo40 callrestclo39 CALL histclo 40 CALL restclo 41 41 #endif 42 callgetin_dump43 c callhistclo(2)44 c callhistclo(3)45 c callhistclo(4)46 c callhistclo(5)42 CALL getin_dump 43 c CALL histclo(2) 44 c CALL histclo(3) 45 c CALL histclo(4) 46 c CALL histclo(5) 47 47 write(lunout,*) 'Stopping in ', modname 48 48 write(lunout,*) 'Reason = ',message -
LMDZ6/branches/Amaury_dev/libf/dyn3d/addfi.F
r5099 r5101 6 6 S pdufi, pdvfi, pdhfi,pdqfi, pdpfi ) 7 7 8 USE infotrac, ONLY 9 USE control_mod, ONLY 8 USE infotrac, ONLY: nqtot 9 USE control_mod, ONLY: planet_type 10 10 IMPLICIT NONE 11 11 c -
LMDZ6/branches/Amaury_dev/libf/dyn3d/advtrac.f90
r5100 r5101 1 1 ! $Id$ 2 2 3 #define DEBUG_IO 4 #undef DEBUG_IO 5 SUBROUTINE advtrac(pbaru, pbarv, p, masse,q,iapptrac,teta, flxw, pk) 6 ! Auteur : F. Hourdin 7 8 ! Modif. P. Le Van (20/12/97) 9 ! F. Codron (10/99) 10 ! D. Le Croller (07/2001) 11 ! M.A Filiberti (04/2002) 12 13 USE infotrac, ONLY: nqtot, tracers, isoCheck 14 USE control_mod, ONLY: iapp_tracvl, day_step 15 USE comconst_mod, ONLY: dtvr 16 17 IMPLICIT NONE 18 19 include "dimensions.h" 20 include "paramet.h" 21 include "comdissip.h" 22 include "comgeom2.h" 23 include "description.h" 24 include "iniprint.h" 25 26 !--------------------------------------------------------------------------- 27 ! Arguments 28 !--------------------------------------------------------------------------- 29 INTEGER, INTENT(OUT) :: iapptrac 30 REAL, INTENT(IN) :: pbaru(ip1jmp1,llm) 31 REAL, INTENT(IN) :: pbarv(ip1jm, llm) 32 REAL, INTENT(INOUT) :: q(ip1jmp1,llm,nqtot) 33 REAL, INTENT(IN) :: masse(ip1jmp1,llm) 34 REAL, INTENT(IN) :: p(ip1jmp1,llmp1 ) 35 REAL, INTENT(IN) :: teta(ip1jmp1,llm) 36 REAL, INTENT(IN) :: pk(ip1jmp1,llm) 37 REAL, INTENT(OUT) :: flxw(ip1jmp1,llm) 38 !--------------------------------------------------------------------------- 39 ! Ajout PPM 40 !--------------------------------------------------------------------------- 41 REAL :: massebx(ip1jmp1,llm), masseby(ip1jm,llm) 42 !--------------------------------------------------------------------------- 43 ! Variables locales 44 !--------------------------------------------------------------------------- 45 INTEGER :: ij, l, iq, iadv 46 ! REAL(KIND=KIND(1.d0)) :: t_initial, t_final, tps_cpu 47 REAL :: zdp(ip1jmp1), zdpmin, zdpmax 48 INTEGER, SAVE :: iadvtr=0 49 REAL, DIMENSION(ip1jmp1,llm) :: pbaruc, pbarug, massem, wg 50 REAL, DIMENSION(ip1jm, llm) :: pbarvc, pbarvg 51 EXTERNAL minmax 52 SAVE massem, pbaruc, pbarvc 53 !--------------------------------------------------------------------------- 54 ! Rajouts pour PPM 55 !--------------------------------------------------------------------------- 56 INTEGER indice, n 57 REAL :: dtbon ! Pas de temps adaptatif pour que CFL<1 58 REAL :: CFLmaxz, aaa, bbb ! CFL maximum 59 REAL, DIMENSION(iim,jjp1,llm) :: unatppm, vnatppm, fluxwppm 60 REAL :: qppm(iim*jjp1,llm,nqtot) 61 REAL :: psppm(iim,jjp1) ! pression au sol 62 REAL, DIMENSION(llmp1) :: apppm, bpppm 63 LOGICAL, SAVE :: dum=.TRUE., fill=.TRUE. 64 65 INTEGER, SAVE :: countcfl=0 66 REAL, DIMENSION(ip1jmp1,llm) :: cflx, cflz 67 REAL, DIMENSION(ip1jm ,llm) :: cfly 68 REAL, DIMENSION(llm), SAVE :: cflxmax, cflymax, cflzmax 69 70 IF(iadvtr == 0) THEN 71 pbaruc(:,:)=0 72 pbarvc(:,:)=0 73 END IF 74 75 !--- Accumulation des flux de masse horizontaux 76 DO l=1,llm 77 DO ij = 1,ip1jmp1 78 pbaruc(ij,l) = pbaruc(ij,l) + pbaru(ij,l) 3 SUBROUTINE advtrac(pbaru, pbarv, p, masse, q, iapptrac, teta, flxw, pk) 4 ! Auteur : F. Hourdin 5 6 ! Modif. P. Le Van (20/12/97) 7 ! F. Codron (10/99) 8 ! D. Le Croller (07/2001) 9 ! M.A Filiberti (04/2002) 10 11 USE infotrac, ONLY: nqtot, tracers, isoCheck 12 USE control_mod, ONLY: iapp_tracvl, day_step 13 USE comconst_mod, ONLY: dtvr 14 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DEBUGIO 15 USE write_field, ONLY: int2str 16 17 IMPLICIT NONE 18 19 include "dimensions.h" 20 include "paramet.h" 21 include "comdissip.h" 22 include "comgeom2.h" 23 include "description.h" 24 include "iniprint.h" 25 26 !--------------------------------------------------------------------------- 27 ! Arguments 28 !--------------------------------------------------------------------------- 29 INTEGER, INTENT(OUT) :: iapptrac 30 REAL, INTENT(IN) :: pbaru(ip1jmp1, llm) 31 REAL, INTENT(IN) :: pbarv(ip1jm, llm) 32 REAL, INTENT(INOUT) :: q(ip1jmp1, llm, nqtot) 33 REAL, INTENT(IN) :: masse(ip1jmp1, llm) 34 REAL, INTENT(IN) :: p(ip1jmp1, llmp1) 35 REAL, INTENT(IN) :: teta(ip1jmp1, llm) 36 REAL, INTENT(IN) :: pk(ip1jmp1, llm) 37 REAL, INTENT(OUT) :: flxw(ip1jmp1, llm) 38 !--------------------------------------------------------------------------- 39 ! Ajout PPM 40 !--------------------------------------------------------------------------- 41 REAL :: massebx(ip1jmp1, llm), masseby(ip1jm, llm) 42 !--------------------------------------------------------------------------- 43 ! Variables locales 44 !--------------------------------------------------------------------------- 45 INTEGER :: ij, l, iq, iadv 46 ! REAL(KIND=KIND(1.d0)) :: t_initial, t_final, tps_cpu 47 REAL :: zdp(ip1jmp1), zdpmin, zdpmax 48 INTEGER, SAVE :: iadvtr = 0 49 REAL, DIMENSION(ip1jmp1, llm) :: pbaruc, pbarug, massem, wg 50 REAL, DIMENSION(ip1jm, llm) :: pbarvc, pbarvg 51 EXTERNAL minmax 52 SAVE massem, pbaruc, pbarvc 53 !--------------------------------------------------------------------------- 54 ! Rajouts pour PPM 55 !--------------------------------------------------------------------------- 56 INTEGER indice, n 57 REAL :: dtbon ! Pas de temps adaptatif pour que CFL<1 58 REAL :: CFLmaxz, aaa, bbb ! CFL maximum 59 REAL, DIMENSION(iim, jjp1, llm) :: unatppm, vnatppm, fluxwppm 60 REAL :: qppm(iim * jjp1, llm, nqtot) 61 REAL :: psppm(iim, jjp1) ! pression au sol 62 REAL, DIMENSION(llmp1) :: apppm, bpppm 63 LOGICAL, SAVE :: dum = .TRUE., fill = .TRUE. 64 65 INTEGER, SAVE :: countcfl = 0 66 REAL, DIMENSION(ip1jmp1, llm) :: cflx, cflz 67 REAL, DIMENSION(ip1jm, llm) :: cfly 68 REAL, DIMENSION(llm), SAVE :: cflxmax, cflymax, cflzmax 69 70 IF(iadvtr == 0) THEN 71 pbaruc(:, :) = 0 72 pbarvc(:, :) = 0 73 END IF 74 75 !--- Accumulation des flux de masse horizontaux 76 DO l = 1, llm 77 DO ij = 1, ip1jmp1 78 pbaruc(ij, l) = pbaruc(ij, l) + pbaru(ij, l) 79 END DO 80 DO ij = 1, ip1jm 81 pbarvc(ij, l) = pbarvc(ij, l) + pbarv(ij, l) 82 END DO 83 END DO 84 85 !--- Selection de la masse instantannee des mailles avant le transport. 86 IF(iadvtr == 0) THEN 87 CALL SCOPY(ip1jmp1 * llm, masse, 1, massem, 1) 88 ! CALL filtreg ( massem ,jjp1, llm,-2, 2, .TRUE., 1 ) 89 END IF 90 91 iadvtr = iadvtr + 1 92 iapptrac = iadvtr 93 94 !--- Test pour savoir si on advecte a ce pas de temps 95 IF(iadvtr /= iapp_tracvl) RETURN 96 97 ! .. Modif P.Le Van ( 20/12/97 ) .... 98 99 ! traitement des flux de masse avant advection. 100 ! 1. calcul de w 101 ! 2. groupement des mailles pres du pole. 102 103 CALL groupe(massem, pbaruc, pbarvc, pbarug, pbarvg, wg) 104 105 !--- Flux de masse diaganostiques traceurs 106 flxw = wg / REAL(iapp_tracvl) 107 108 !--- Test sur l'eventuelle creation de valeurs negatives de la masse 109 DO l = 1, llm - 1 110 DO ij = iip2 + 1, ip1jm 111 zdp(ij) = pbarug(ij - 1, l) - pbarug(ij, l) & 112 - pbarvg(ij - iip1, l) + pbarvg(ij, l) & 113 + wg(ij, l + 1) - wg(ij, l) 114 END DO 115 ! ym ---> pourquoi jjm-1 et non jjm ? a cause du pole ? 116 CALL SCOPY(jjm - 1, zdp(iip1 + iip1), iip1, zdp(iip2), iip1) 117 DO ij = iip2, ip1jm 118 zdp(ij) = zdp(ij) * dtvr / massem(ij, l) 119 END DO 120 121 CALL minmax (ip1jm - iip1, zdp(iip2), zdpmin, zdpmax) 122 123 IF(MAX(ABS(zdpmin), ABS(zdpmax)) > 0.5) & 124 WRITE(*, *)'WARNING DP/P l=', l, ' MIN:', zdpmin, ' MAX:', zdpmax 125 126 END DO 127 128 !------------------------------------------------------------------------- 129 ! Calcul des criteres CFL en X, Y et Z 130 !------------------------------------------------------------------------- 131 IF(countcfl == 0.) then 132 cflxmax(:) = 0. 133 cflymax(:) = 0. 134 cflzmax(:) = 0. 135 END IF 136 137 countcfl = countcfl + iapp_tracvl 138 cflx(:, :) = 0. 139 cfly(:, :) = 0. 140 cflz(:, :) = 0. 141 DO l = 1, llm 142 DO ij = iip2, ip1jm - 1 143 IF(pbarug(ij, l)>=0.) then 144 cflx(ij, l) = pbarug(ij, l) * dtvr / masse(ij, l) 145 ELSE 146 cflx(ij, l) = -pbarug(ij, l) * dtvr / masse(ij + 1, l) 147 END IF 148 END DO 149 END DO 150 151 DO l = 1, llm 152 DO ij = iip2, ip1jm - 1, iip1 153 cflx(ij + iip1, l) = cflx(ij, l) 154 END DO 155 END DO 156 157 DO l = 1, llm 158 DO ij = 1, ip1jm 159 IF(pbarvg(ij, l)>=0.) then 160 cfly(ij, l) = pbarvg(ij, l) * dtvr / masse(ij, l) 161 ELSE 162 cfly(ij, l) = -pbarvg(ij, l) * dtvr / masse(ij + iip1, l) 163 END IF 164 END DO 165 END DO 166 167 DO l = 2, llm 168 DO ij = 1, ip1jm 169 IF(wg(ij, l) >= 0.) THEN 170 cflz(ij, l) = wg(ij, l) * dtvr / masse(ij, l) 171 ELSE 172 cflz(ij, l) = -wg(ij, l) * dtvr / masse(ij, l - 1) 173 END IF 174 END DO 175 END DO 176 177 DO l = 1, llm 178 cflxmax(l) = max(cflxmax(l), maxval(cflx(:, l))) 179 cflymax(l) = max(cflymax(l), maxval(cfly(:, l))) 180 cflzmax(l) = max(cflzmax(l), maxval(cflz(:, l))) 181 END DO 182 183 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 184 ! Par defaut, on sort le diagnostic des CFL tous les jours. 185 ! Si on veut le sortir a chaque pas d'advection en cas de plantage 186 ! IF(countcfl==iapp_tracvl) then 187 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 188 IF(countcfl==day_step) then 189 DO l = 1, llm 190 WRITE(lunout, *) 'L, CFL[xyz]max:', l, cflxmax(l), cflymax(l), cflzmax(l) 191 END DO 192 countcfl = 0 193 END IF 194 195 !--------------------------------------------------------------------------- 196 ! Advection proprement dite (Modification Le Croller (07/2001) 197 !--------------------------------------------------------------------------- 198 199 !--------------------------------------------------------------------------- 200 ! Calcul des moyennes basees sur la masse 201 !--------------------------------------------------------------------------- 202 CALL massbar(massem, massebx, masseby) 203 204 IF (CPPKEY_DEBUGIO) THEN 205 CALL WriteField_u('massem', massem) 206 CALL WriteField_u('wg', wg) 207 CALL WriteField_u('pbarug', pbarug) 208 CALL WriteField_v('pbarvg', pbarvg) 209 CALL WriteField_u('p_tmp', p) 210 CALL WriteField_u('pk_tmp', pk) 211 CALL WriteField_u('teta_tmp', teta) 212 DO iq = 1, nqtot 213 CALL WriteField_u('q_adv' // trim(int2str(iq)), q(:, :, iq)) 214 END DO 215 END IF 216 217 IF(isoCheck) WRITE(*, *) 'advtrac 227' 218 CALL check_isotopes_seq(q, ip1jmp1, 'advtrac 162') 219 220 !------------------------------------------------------------------------- 221 ! Appel des sous programmes d'advection 222 !------------------------------------------------------------------------- 223 DO iq = 1, nqtot 224 ! CALL clock(t_initial) 225 IF(tracers(iq)%parent /= 'air') CYCLE 226 iadv = tracers(iq)%iadv 227 !----------------------------------------------------------------------- 228 SELECT CASE(iadv) 229 !----------------------------------------------------------------------- 230 CASE(0); CYCLE 231 !-------------------------------------------------------------------- 232 CASE(10) !--- Schema de Van Leer I MUSCL 233 !-------------------------------------------------------------------- 234 ! WRITE(*,*) 'advtrac 239: iq,q(1721,19,:)=',iq,q(1721,19,:) 235 CALL vlsplt(q, 2., massem, wg, pbarug, pbarvg, dtvr, iq) 236 237 !-------------------------------------------------------------------- 238 CASE(14) !--- Schema "pseuDO amont" + test sur humidite specifique 239 !--- pour la vapeur d'eau. F. Codron 240 !-------------------------------------------------------------------- 241 ! WRITE(*,*) 'advtrac 248: iq,q(1721,19,:)=',iq,q(1721,19,:) 242 CALL vlspltqs(q, 2., massem, wg, pbarug, pbarvg, dtvr, p, pk, teta, iq) 243 244 !-------------------------------------------------------------------- 245 CASE(12) !--- Schema de Frederic Hourdin 246 !-------------------------------------------------------------------- 247 CALL adaptdt(iadv, dtbon, n, pbarug, massem) ! pas de temps adaptatif 248 IF(n > 1) WRITE(*, *) 'WARNING horizontal dt=', dtbon, 'dtvr=', dtvr, 'n=', n 249 DO indice = 1, n 250 CALL advn(q(1, 1, iq), massem, wg, pbarug, pbarvg, dtbon, 1) 79 251 END DO 80 DO ij = 1,ip1jm 81 pbarvc(ij,l) = pbarvc(ij,l) + pbarv(ij,l) 252 253 !-------------------------------------------------------------------- 254 CASE(13) !--- Pas de temps adaptatif 255 !-------------------------------------------------------------------- 256 CALL adaptdt(iadv, dtbon, n, pbarug, massem) 257 IF(n > 1) WRITE(*, *) 'WARNING horizontal dt=', dtbon, 'dtvr=', dtvr, 'n=', n 258 DO indice = 1, n 259 CALL advn(q(1, 1, iq), massem, wg, pbarug, pbarvg, dtbon, 2) 82 260 END DO 83 END DO 84 85 !--- Selection de la masse instantannee des mailles avant le transport. 86 IF(iadvtr == 0) THEN 87 CALL SCOPY(ip1jmp1*llm,masse,1,massem,1) 88 ! CALL filtreg ( massem ,jjp1, llm,-2, 2, .TRUE., 1 ) 89 END IF 90 91 iadvtr = iadvtr+1 92 iapptrac = iadvtr 93 94 !--- Test pour savoir si on advecte a ce pas de temps 95 IF(iadvtr /= iapp_tracvl) RETURN 96 97 ! .. Modif P.Le Van ( 20/12/97 ) .... 98 99 ! traitement des flux de masse avant advection. 100 ! 1. calcul de w 101 ! 2. groupement des mailles pres du pole. 102 103 CALL groupe(massem, pbaruc, pbarvc, pbarug, pbarvg, wg) 104 105 !--- Flux de masse diaganostiques traceurs 106 flxw = wg / REAL(iapp_tracvl) 107 108 !--- Test sur l'eventuelle creation de valeurs negatives de la masse 109 DO l=1,llm-1 110 DO ij = iip2+1,ip1jm 111 zdp(ij) = pbarug(ij-1,l) - pbarug(ij,l) & 112 - pbarvg(ij-iip1,l) + pbarvg(ij,l) & 113 + wg(ij,l+1) - wg(ij,l) 261 262 !-------------------------------------------------------------------- 263 CASE(20) !--- Schema de pente SLOPES 264 !-------------------------------------------------------------------- 265 CALL pentes_ini (q(1, 1, iq), wg, massem, pbarug, pbarvg, 0) 266 267 !-------------------------------------------------------------------- 268 CASE(30) !--- Schema de Prather 269 !-------------------------------------------------------------------- 270 ! Pas de temps adaptatif 271 CALL adaptdt(iadv, dtbon, n, pbarug, massem) 272 IF(n > 1) WRITE(*, *) 'WARNING horizontal dt=', dtbon, 'dtvr=', dtvr, 'n=', n 273 CALL prather(q(1, 1, iq), wg, massem, pbarug, pbarvg, n, dtbon) 274 275 !-------------------------------------------------------------------- 276 CASE(11, 16, 17, 18) !--- Schemas PPM Lin et Rood 277 !-------------------------------------------------------------------- 278 ! Test sur le flux horizontal 279 CALL adaptdt(iadv, dtbon, n, pbarug, massem) ! pas de temps adaptatif 280 IF(n > 1) WRITE(*, *) 'WARNING horizontal dt=', dtbon, 'dtvr=', dtvr, 'n=', n 281 ! Test sur le flux vertical 282 CFLmaxz = 0. 283 DO l = 2, llm 284 DO ij = iip2, ip1jm 285 aaa = wg(ij, l) * dtvr / massem(ij, l) 286 CFLmaxz = max(CFLmaxz, aaa) 287 bbb = -wg(ij, l) * dtvr / massem(ij, l - 1) 288 CFLmaxz = max(CFLmaxz, bbb) 289 END DO 114 290 END DO 115 ! ym ---> pourquoi jjm-1 et non jjm ? a cause du pole ? 116 CALL SCOPY( jjm -1 ,zdp(iip1+iip1),iip1,zdp(iip2),iip1 ) 117 DO ij = iip2,ip1jm 118 zdp(ij)= zdp(ij)*dtvr/ massem(ij,l) 291 IF(CFLmaxz>=1) WRITE(*, *) 'WARNING vertical', 'CFLmaxz=', CFLmaxz 292 !---------------------------------------------------------------- 293 ! Ss-prg interface LMDZ.4->PPM3d (ss-prg de Lin) 294 !---------------------------------------------------------------- 295 CALL interpre(q(1, 1, iq), qppm(1, 1, iq), wg, fluxwppm, massem, & 296 apppm, bpppm, massebx, masseby, pbarug, pbarvg, & 297 unatppm, vnatppm, psppm) 298 299 !---------------------------------------------------------------- 300 DO indice = 1, n !--- VL (version PPM) horiz. et PPM vert. 301 !---------------------------------------------------------------- 302 SELECT CASE(iadv) 303 !---------------------------------------------------------- 304 CASE(11) 305 !---------------------------------------------------------- 306 CALL ppm3d(1, qppm(1, 1, iq), psppm, psppm, unatppm, vnatppm, fluxwppm, dtbon, & 307 2, 2, 2, 1, iim, jjp1, 2, llm, apppm, bpppm, 0.01, 6400000, fill, dum, 220.) 308 !---------------------------------------------------------- 309 CASE(16) !--- Monotonic PPM 310 !---------------------------------------------------------- 311 CALL ppm3d(1, qppm(1, 1, iq), psppm, psppm, unatppm, vnatppm, fluxwppm, dtbon, & 312 3, 3, 3, 1, iim, jjp1, 2, llm, apppm, bpppm, 0.01, 6400000, fill, dum, 220.) 313 !---------------------------------------------------------- 314 CASE(17) !--- Semi monotonic PPM 315 !---------------------------------------------------------- 316 CALL ppm3d(1, qppm(1, 1, iq), psppm, psppm, unatppm, vnatppm, fluxwppm, dtbon, & 317 4, 4, 4, 1, iim, jjp1, 2, llm, apppm, bpppm, 0.01, 6400000, fill, dum, 220.) 318 !---------------------------------------------------------- 319 CASE(18) !--- Positive Definite PPM 320 !---------------------------------------------------------- 321 CALL ppm3d(1, qppm(1, 1, iq), psppm, psppm, unatppm, vnatppm, fluxwppm, dtbon, & 322 5, 5, 5, 1, iim, jjp1, 2, llm, apppm, bpppm, 0.01, 6400000, fill, dum, 220.) 323 END SELECT 324 !---------------------------------------------------------------- 119 325 END DO 120 121 CALL minmax ( ip1jm-iip1, zdp(iip2), zdpmin,zdpmax ) 122 123 IF(MAX(ABS(zdpmin),ABS(zdpmax)) > 0.5) & 124 WRITE(*,*)'WARNING DP/P l=',l,' MIN:',zdpmin,' MAX:', zdpmax 125 126 END DO 127 128 !------------------------------------------------------------------------- 129 ! Calcul des criteres CFL en X, Y et Z 130 !------------------------------------------------------------------------- 131 IF(countcfl == 0. ) then 132 cflxmax(:)=0. 133 cflymax(:)=0. 134 cflzmax(:)=0. 135 END IF 136 137 countcfl=countcfl+iapp_tracvl 138 cflx(:,:)=0. 139 cfly(:,:)=0. 140 cflz(:,:)=0. 141 DO l=1,llm 142 DO ij=iip2,ip1jm-1 143 IF(pbarug(ij,l)>=0.) then 144 cflx(ij,l)=pbarug(ij,l)*dtvr/masse(ij,l) 145 ELSE 146 cflx(ij,l)=-pbarug(ij,l)*dtvr/masse(ij+1,l) 147 END IF 148 END DO 149 END DO 150 151 DO l=1,llm 152 DO ij=iip2,ip1jm-1,iip1 153 cflx(ij+iip1,l)=cflx(ij,l) 154 END DO 155 END DO 156 157 DO l=1,llm 158 DO ij=1,ip1jm 159 IF(pbarvg(ij,l)>=0.) then 160 cfly(ij,l)=pbarvg(ij,l)*dtvr/masse(ij,l) 161 ELSE 162 cfly(ij,l)=-pbarvg(ij,l)*dtvr/masse(ij+iip1,l) 163 END IF 164 END DO 165 END DO 166 167 DO l=2,llm 168 DO ij=1,ip1jm 169 IF(wg(ij,l) >= 0.) THEN 170 cflz(ij,l)=wg(ij,l)*dtvr/masse(ij,l) 171 ELSE 172 cflz(ij,l)=-wg(ij,l)*dtvr/masse(ij,l-1) 173 END IF 174 END DO 175 END DO 176 177 DO l=1,llm 178 cflxmax(l)=max(cflxmax(l),maxval(cflx(:,l))) 179 cflymax(l)=max(cflymax(l),maxval(cfly(:,l))) 180 cflzmax(l)=max(cflzmax(l),maxval(cflz(:,l))) 181 END DO 182 183 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 184 ! Par defaut, on sort le diagnostic des CFL tous les jours. 185 ! Si on veut le sortir a chaque pas d'advection en cas de plantage 186 ! IF(countcfl==iapp_tracvl) then 187 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 188 IF(countcfl==day_step) then 189 DO l=1,llm 190 WRITE(lunout,*) 'L, CFL[xyz]max:', l, cflxmax(l), cflymax(l), cflzmax(l) 191 END DO 192 countcfl=0 193 END IF 194 195 !--------------------------------------------------------------------------- 196 ! Advection proprement dite (Modification Le Croller (07/2001) 197 !--------------------------------------------------------------------------- 198 199 !--------------------------------------------------------------------------- 200 ! Calcul des moyennes basees sur la masse 201 !--------------------------------------------------------------------------- 202 CALL massbar(massem,massebx,masseby) 203 204 #ifdef DEBUG_IO 205 CALL WriteField_u('massem',massem) 206 CALL WriteField_u('wg',wg) 207 CALL WriteField_u('pbarug',pbarug) 208 CALL WriteField_v('pbarvg',pbarvg) 209 CALL WriteField_u('p_tmp',p) 210 CALL WriteField_u('pk_tmp',pk) 211 CALL WriteField_u('teta_tmp',teta) 212 DO iq=1,nqtot 213 CALL WriteField_u('q_adv'//trim(int2str(iq)),q(:,:,iq)) 214 END DO 215 #endif 216 217 IF(isoCheck) WRITE(*,*) 'advtrac 227' 218 CALL check_isotopes_seq(q,ip1jmp1,'advtrac 162') 219 220 !------------------------------------------------------------------------- 221 ! Appel des sous programmes d'advection 222 !------------------------------------------------------------------------- 223 DO iq = 1, nqtot 224 ! CALL clock(t_initial) 225 IF(tracers(iq)%parent /= 'air') CYCLE 226 iadv = tracers(iq)%iadv 227 !----------------------------------------------------------------------- 228 SELECT CASE(iadv) 229 !----------------------------------------------------------------------- 230 CASE(0); CYCLE 231 !-------------------------------------------------------------------- 232 CASE(10) !--- Schema de Van Leer I MUSCL 233 !-------------------------------------------------------------------- 234 ! WRITE(*,*) 'advtrac 239: iq,q(1721,19,:)=',iq,q(1721,19,:) 235 CALL vlsplt(q,2.,massem,wg,pbarug,pbarvg,dtvr,iq) 236 237 !-------------------------------------------------------------------- 238 CASE(14) !--- Schema "pseuDO amont" + test sur humidite specifique 239 !--- pour la vapeur d'eau. F. Codron 240 !-------------------------------------------------------------------- 241 ! WRITE(*,*) 'advtrac 248: iq,q(1721,19,:)=',iq,q(1721,19,:) 242 CALL vlspltqs(q,2.,massem,wg,pbarug,pbarvg,dtvr,p,pk,teta,iq) 243 244 !-------------------------------------------------------------------- 245 CASE(12) !--- Schema de Frederic Hourdin 246 !-------------------------------------------------------------------- 247 CALL adaptdt(iadv,dtbon,n,pbarug,massem) ! pas de temps adaptatif 248 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 249 DO indice=1,n 250 CALL advn(q(1,1,iq),massem,wg,pbarug,pbarvg,dtbon,1) 251 END DO 252 253 !-------------------------------------------------------------------- 254 CASE(13) !--- Pas de temps adaptatif 255 !-------------------------------------------------------------------- 256 CALL adaptdt(iadv,dtbon,n,pbarug,massem) 257 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 258 DO indice=1,n 259 CALL advn(q(1,1,iq),massem,wg,pbarug,pbarvg,dtbon,2) 260 END DO 261 262 !-------------------------------------------------------------------- 263 CASE(20) !--- Schema de pente SLOPES 264 !-------------------------------------------------------------------- 265 CALL pentes_ini (q(1,1,iq),wg,massem,pbarug,pbarvg,0) 266 267 !-------------------------------------------------------------------- 268 CASE(30) !--- Schema de Prather 269 !-------------------------------------------------------------------- 270 ! Pas de temps adaptatif 271 CALL adaptdt(iadv,dtbon,n,pbarug,massem) 272 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 273 CALL prather(q(1,1,iq),wg,massem,pbarug,pbarvg,n,dtbon) 274 275 !-------------------------------------------------------------------- 276 CASE(11,16,17,18) !--- Schemas PPM Lin et Rood 277 !-------------------------------------------------------------------- 278 ! Test sur le flux horizontal 279 CALL adaptdt(iadv,dtbon,n,pbarug,massem) ! pas de temps adaptatif 280 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 281 ! Test sur le flux vertical 282 CFLmaxz=0. 283 DO l=2,llm 284 DO ij=iip2,ip1jm 285 aaa=wg(ij,l)*dtvr/massem(ij,l) 286 CFLmaxz=max(CFLmaxz,aaa) 287 bbb=-wg(ij,l)*dtvr/massem(ij,l-1) 288 CFLmaxz=max(CFLmaxz,bbb) 289 END DO 290 END DO 291 IF(CFLmaxz>=1) WRITE(*,*) 'WARNING vertical','CFLmaxz=', CFLmaxz 292 !---------------------------------------------------------------- 293 ! Ss-prg interface LMDZ.4->PPM3d (ss-prg de Lin) 294 !---------------------------------------------------------------- 295 CALL interpre(q(1,1,iq),qppm(1,1,iq),wg,fluxwppm,massem, & 296 apppm,bpppm,massebx,masseby,pbarug,pbarvg, & 297 unatppm,vnatppm,psppm) 298 299 !---------------------------------------------------------------- 300 DO indice=1,n !--- VL (version PPM) horiz. et PPM vert. 301 !---------------------------------------------------------------- 302 SELECT CASE(iadv) 303 !---------------------------------------------------------- 304 CASE(11) 305 !---------------------------------------------------------- 306 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 307 2,2,2,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000,fill,dum,220.) 308 !---------------------------------------------------------- 309 CASE(16) !--- Monotonic PPM 310 !---------------------------------------------------------- 311 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 312 3,3,3,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000,fill,dum,220.) 313 !---------------------------------------------------------- 314 CASE(17) !--- Semi monotonic PPM 315 !---------------------------------------------------------- 316 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 317 4,4,4,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000, fill,dum,220.) 318 !---------------------------------------------------------- 319 CASE(18) !--- Positive Definite PPM 320 !---------------------------------------------------------- 321 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 322 5,5,5,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000,fill,dum,220.) 323 END SELECT 324 !---------------------------------------------------------------- 325 END DO 326 !---------------------------------------------------------------- 327 ! Ss-prg interface PPM3d-LMDZ.4 328 !---------------------------------------------------------------- 329 CALL interpost(q(1,1,iq),qppm(1,1,iq)) 326 !---------------------------------------------------------------- 327 ! Ss-prg interface PPM3d-LMDZ.4 328 !---------------------------------------------------------------- 329 CALL interpost(q(1, 1, iq), qppm(1, 1, iq)) 330 330 !---------------------------------------------------------------------- 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 IF(isoCheck) WRITE(*,*) 'advtrac 402'347 CALL check_isotopes_seq(q,ip1jmp1,'advtrac 397')348 349 350 351 352 iadvtr=0331 END SELECT 332 !---------------------------------------------------------------------- 333 334 !---------------------------------------------------------------------- 335 ! On impose une seule valeur du traceur au pole Sud j=jjm+1=jjp1 et Nord j=1 336 !---------------------------------------------------------------------- 337 ! CALL traceurpole(q(1,1,iq),massem) 338 339 !--- Calcul du temps cpu pour un schema donne 340 ! CALL clock(t_final) 341 !ym tps_cpu=t_final-t_initial 342 !ym cpuadv(iq)=cpuadv(iq)+tps_cpu 343 344 END DO 345 346 IF(isoCheck) WRITE(*, *) 'advtrac 402' 347 CALL check_isotopes_seq(q, ip1jmp1, 'advtrac 397') 348 349 !------------------------------------------------------------------------- 350 ! on reinitialise a zero les flux de masse cumules 351 !------------------------------------------------------------------------- 352 iadvtr = 0 353 353 354 354 END SUBROUTINE advtrac -
LMDZ6/branches/Amaury_dev/libf/dyn3d/bilan_dyn.F
r5099 r5101 185 185 WRITE(lunout,*)'dt_app=',dt_app 186 186 WRITE(lunout,*)'dt_cum=',dt_cum 187 callabort_gcm('bilan_dyn','stopped',1)187 CALL abort_gcm('bilan_dyn','stopped',1) 188 188 endif 189 189 190 190 if (i_sortie==1) then 191 191 file='dynzon' 192 callinigrads(ifile,1192 CALL inigrads(ifile,1 193 193 s ,0.,180./pi,0.,0.,jjm,rlatv,-90.,90.,180./pi 194 194 s ,llm,presnivs,1. … … 226 226 rlatg=rlatv*180./pi 227 227 228 callhistbeg(infile, 1, rlong, jjm, rlatg,228 CALL histbeg(infile, 1, rlong, jjm, rlatg, 229 229 . 1, 1, 1, jjm, 230 230 . tau0, zjulian, dt_cum, thoriid, fileid) … … 233 233 C Appel a histvert pour la grille verticale 234 234 C 235 callhistvert(fileid, 'presnivs', 'Niveaux sigma','mb',235 CALL histvert(fileid, 'presnivs', 'Niveaux sigma','mb', 236 236 . llm, presnivs, zvertiid) 237 237 C … … 258 258 . WRITE(lunout,*)'var ',itr,iQ 259 259 . ,znom(itr,iQ),znoml(itr,iQ),zunites(itr,iQ) 260 callhistdef(fileid,znom(itr,iQ),znoml(itr,iQ),260 CALL histdef(fileid,znom(itr,iQ),znoml(itr,iQ), 261 261 . zunites(itr,iQ),1,jjm,thoriid,llm,1,llm,zvertiid, 262 262 . 32,'ave(X)',dt_cum,dt_cum) … … 264 264 c Declarations pour les fonctions de courant 265 265 c print*,'2HISTDEF' 266 callhistdef(fileid,'psi'//nom(iQ)266 CALL histdef(fileid,'psi'//nom(iQ) 267 267 . ,'stream fn. '//znoml(itot,iQ), 268 268 . zunites(itot,iQ),1,jjm,thoriid,llm,1,llm,zvertiid, … … 273 273 c Declarations pour les champs de transport d'air 274 274 c print*,'3HISTDEF' 275 callhistdef(fileid, 'masse', 'masse',275 CALL histdef(fileid, 'masse', 'masse', 276 276 . 'kg', 1, jjm, thoriid, llm, 1, llm, zvertiid, 277 277 . 32, 'ave(X)', dt_cum, dt_cum) 278 callhistdef(fileid, 'v', 'v',278 CALL histdef(fileid, 'v', 'v', 279 279 . 'm/s', 1, jjm, thoriid, llm, 1, llm, zvertiid, 280 280 . 32, 'ave(X)', dt_cum, dt_cum) 281 281 c Declarations pour les fonctions de courant 282 282 c print*,'4HISTDEF' 283 callhistdef(fileid,'psi','stream fn. MMC ','mega t/s',283 CALL histdef(fileid,'psi','stream fn. MMC ','mega t/s', 284 284 . 1,jjm,thoriid,llm,1,llm,zvertiid, 285 285 . 32,'ave(X)',dt_cum,dt_cum) … … 290 290 do iQ=1,nQ 291 291 do itr=2,ntr 292 callhistdef(fileid,'a'//znom(itr,iQ),znoml(itr,iQ),292 CALL histdef(fileid,'a'//znom(itr,iQ),znoml(itr,iQ), 293 293 . zunites(itr,iQ),1,jjm,thoriid,1,1,1,-99, 294 294 . 32,'ave(X)',dt_cum,dt_cum) … … 391 391 392 392 c convergence horizontale 393 callconvflu(flux_uQ_cum,flux_vQ_cum,llm*nQ,dQ)393 CALL convflu(flux_uQ_cum,flux_vQ_cum,llm*nQ,dQ) 394 394 395 395 c calcul de la vitesse verticale 396 callconvmas(flux_u_cum,flux_v_cum,convm)396 CALL convmas(flux_u_cum,flux_v_cum,convm) 397 397 CALL vitvert(convm,w) 398 398 … … 447 447 zv=0. 448 448 zmasse=0. 449 callmassbar(masse_cum,massebx,masseby)449 CALL massbar(masse_cum,massebx,masseby) 450 450 do l=1,llm 451 451 do j=1,jjm … … 537 537 do iQ=1,nQ 538 538 do itr=1,ntr 539 callhistwrite(fileid,znom(itr,iQ),itau,zvQ(:,:,itr,iQ)539 CALL histwrite(fileid,znom(itr,iQ),itau,zvQ(:,:,itr,iQ) 540 540 s ,jjm*llm,ndex3d) 541 541 enddo 542 callhistwrite(fileid,'psi'//nom(iQ),itau,psiQ(:,1:llm,iQ)542 CALL histwrite(fileid,'psi'//nom(iQ),itau,psiQ(:,1:llm,iQ) 543 543 s ,jjm*llm,ndex3d) 544 544 enddo 545 545 546 callhistwrite(fileid,'masse',itau,zmasse546 CALL histwrite(fileid,'masse',itau,zmasse 547 547 s ,jjm*llm,ndex3d) 548 callhistwrite(fileid,'v',itau,zv548 CALL histwrite(fileid,'v',itau,zv 549 549 s ,jjm*llm,ndex3d) 550 550 psi=psi*1.e-9 551 callhistwrite(fileid,'psi',itau,psi(:,1:llm),jjm*llm,ndex3d)551 CALL histwrite(fileid,'psi',itau,psi(:,1:llm),jjm*llm,ndex3d) 552 552 553 553 endif … … 569 569 enddo 570 570 zavQ(:,itr,iQ)=zavQ(:,itr,iQ)/zamasse(:) 571 callhistwrite(fileid,'a'//znom(itr,iQ),itau,zavQ(:,itr,iQ)571 CALL histwrite(fileid,'a'//znom(itr,iQ),itau,zavQ(:,itr,iQ) 572 572 s ,jjm*llm,ndex3d) 573 573 enddo -
LMDZ6/branches/Amaury_dev/libf/dyn3d/caladvtrac.F
r5099 r5101 8 8 * flxw, pk) 9 9 c 10 USE infotrac, ONLY 11 USE control_mod, ONLY 10 USE infotrac, ONLY: nqtot 11 USE control_mod, ONLY: iapp_tracvl,planet_type 12 12 USE comconst_mod, ONLY: dtvr 13 13 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/caldyn.F
r5099 r5101 83 83 CALL massbar ( masse, massebx , masseby ) 84 84 ! compute XY-average of mass, massebxy() 85 callmassbarxy( masse, massebxy )85 CALL massbarxy( masse, massebxy ) 86 86 ! compute mass fluxes pbaru() and pbarv() 87 87 CALL flumass ( massebx, masseby , vcont, ucont ,pbaru, pbarv ) -
LMDZ6/branches/Amaury_dev/libf/dyn3d/conf_gcm.F90
r5082 r5101 11 11 use ioipsl_getincom 12 12 #endif 13 USE infotrac, ONLY 13 USE infotrac, ONLY: type_trac 14 14 use assert_m, only: assert 15 15 USE comconst_mod, ONLY: dissip_deltaz, dissip_factz, dissip_zref, & … … 315 315 CALL getin('maxlatfilter',maxlatfilter) 316 316 if (maxlatfilter > 90) & 317 callabort_gcm("conf_gcm", 'maxlatfilter should be <=90', 1)317 CALL abort_gcm("conf_gcm", 'maxlatfilter should be <=90', 1) 318 318 319 319 … … 329 329 CALL getin('iflag_top_bound',iflag_top_bound) 330 330 IF (iflag_top_bound < 0 .or. iflag_top_bound > 2) & 331 callabort_gcm("conf_gcm", 'iflag_top_bound must be 0, 1 or 2', 1)331 CALL abort_gcm("conf_gcm", 'iflag_top_bound must be 0, 1 or 2', 1) 332 332 333 333 ! mode_top_bound : fields towards which sponge relaxation will be done: … … 749 749 dzoomx = 0.2 750 750 CALL getin('dzoomx',dzoomx) 751 callassert(dzoomx < 1, "conf_gcm: dzoomx must be < 1")751 CALL assert(dzoomx < 1, "conf_gcm: dzoomx must be < 1") 752 752 753 753 !Config Key = dzoomy … … 758 758 dzoomy = 0.2 759 759 CALL getin('dzoomy',dzoomy) 760 callassert(dzoomy < 1, "conf_gcm: dzoomy must be < 1")760 CALL assert(dzoomy < 1, "conf_gcm: dzoomy must be < 1") 761 761 762 762 !Config Key = taux … … 836 836 vert_prof_dissip = merge(1, 0, ok_strato .and. llm==39) 837 837 CALL getin('vert_prof_dissip', vert_prof_dissip) 838 callassert(vert_prof_dissip == 0 .or. vert_prof_dissip == 1, &838 CALL assert(vert_prof_dissip == 0 .or. vert_prof_dissip == 1, & 839 839 "bad value for vert_prof_dissip") 840 840 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/dynetat0.F90
r5100 r5101 8 8 USE infotrac, ONLY: nqtot, tracers, niso, iqIsoPha, iH2O, isoName 9 9 USE strings_mod, ONLY: maxlen, msg, strStack, real2str, int2str 10 USE netcdf, ONLY: nf90_open, nf90_nowrite, NF90_INQ_VARID, &10 USE netcdf, ONLY: nf90_open, nf90_nowrite, nf90_inq_varid, & 11 11 nf90_close, nf90_get_var, nf90_noerr 12 12 USE readTracFiles_mod, ONLY: new2oldH2O, newHNO3, oldHNO3, getKey … … 116 116 CALL get_var2("aire" ,aire) 117 117 var="temps" 118 IF( NF90_INQ_VARID(fID,var,vID)/=nf90_noerr) THEN118 IF(nf90_inq_varid(fID,var,vID)/=nf90_noerr) THEN 119 119 CALL msg('missing field <temps> ; trying with <Time>', modname) 120 120 var="Time" 121 CALL err( NF90_INQ_VARID(fID,var,vID),"inq",var)121 CALL err(nf90_inq_varid(fID,var,vID),"inq",var) 122 122 END IF 123 123 CALL err(nf90_get_var(fID,vID,time),"get",var) … … 132 132 ll=.FALSE. 133 133 #ifdef REPROBUS 134 ll = NF90_INQ_VARID(fID, 'HNO3tot', vID) /= nf90_noerr !--- DETECT OLD REPRO start.nc FILE134 ll = nf90_inq_varid(fID, 'HNO3tot', vID) /= nf90_noerr !--- DETECT OLD REPRO start.nc FILE 135 135 #endif 136 136 DO iq=1,nqtot … … 145 145 END IF 146 146 !-------------------------------------------------------------------------------------------------------------------------- 147 IF( NF90_INQ_VARID(fID, var, vID) == nf90_noerr .AND. .NOT.lSkip) THEN !=== REGULAR CASE: AVAILABLE VARIABLE147 IF(nf90_inq_varid(fID, var, vID) == nf90_noerr .AND. .NOT.lSkip) THEN !=== REGULAR CASE: AVAILABLE VARIABLE 148 148 CALL err(nf90_get_var(fID,vID,q(:,:,:,iq)),"get",var) 149 149 !-------------------------------------------------------------------------------------------------------------------------- 150 ELSE IF( NF90_INQ_VARID(fID, oldVar, vID) == nf90_noerr) THEN !=== TRY WITH ALTERNATE NAME150 ELSE IF(nf90_inq_varid(fID, oldVar, vID) == nf90_noerr) THEN !=== TRY WITH ALTERNATE NAME 151 151 CALL msg('Tracer <'//TRIM(var)//'> is missing => initialized to <'//TRIM(oldVar)//'>', modname) 152 152 CALL err(nf90_get_var(fID,vID,q(:,:,:,iq)),"get",oldVar) … … 208 208 CHARACTER(LEN=*), INTENT(IN) :: var 209 209 REAL, INTENT(OUT) :: v(:) 210 CALL err( NF90_INQ_VARID(fID,var,vID),"inq",var)210 CALL err(nf90_inq_varid(fID,var,vID),"inq",var) 211 211 CALL err(nf90_get_var(fID,vID,v),"get",var) 212 212 END SUBROUTINE get_var1 … … 216 216 CHARACTER(LEN=*), INTENT(IN) :: var 217 217 REAL, INTENT(OUT) :: v(:,:) 218 CALL err( NF90_INQ_VARID(fID,var,vID),"inq",var)218 CALL err(nf90_inq_varid(fID,var,vID),"inq",var) 219 219 CALL err(nf90_get_var(fID,vID,v),"get",var) 220 220 END SUBROUTINE get_var2 … … 224 224 CHARACTER(LEN=*), INTENT(IN) :: var 225 225 REAL, INTENT(OUT) :: v(:,:,:) 226 CALL err( NF90_INQ_VARID(fID,var,vID),"inq",var)226 CALL err(nf90_inq_varid(fID,var,vID),"inq",var) 227 227 CALL err(nf90_get_var(fID,vID,v),"get",var) 228 228 END SUBROUTINE get_var3 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/dynredem.F90
r5100 r5101 9 9 USE strings_mod, ONLY: maxlen 10 10 USE infotrac, ONLY: nqtot, tracers 11 USE netcdf, ONLY: nf90_create, nf90_def_dim, NF90_INQ_VARID, nf90_global, &11 USE netcdf, ONLY: nf90_create, nf90_def_dim, nf90_inq_varid, nf90_global, & 12 12 nf90_close, nf90_put_att, nf90_unlimited, nf90_clobber, & 13 13 nf90_64bit_offset … … 169 169 USE infotrac, ONLY: nqtot, tracers, type_trac 170 170 USE control_mod 171 USE netcdf, ONLY: nf90_open, nf90_nowrite, nf90_get_var, NF90_INQ_VARID, &172 nf90_close, NF90_WRITE, nf90_put_var, nf90_noerr171 USE netcdf, ONLY: nf90_open, nf90_nowrite, nf90_get_var, nf90_inq_varid, & 172 nf90_close, nf90_write, nf90_put_var, nf90_noerr 173 173 USE dynredem_mod, ONLY: dynredem_write_u, dynredem_write_v, dynredem_read_u, & 174 174 err, modname, fil, msg … … 202 202 203 203 modname='dynredem1'; fil=fichnom 204 CALL err(nf90_open(fil, NF90_WRITE,nid),"open",fil)204 CALL err(nf90_open(fil,nf90_write,nid),"open",fil) 205 205 206 206 !--- Write/extend time coordinate 207 207 nb = nb + 1 208 208 var="temps" 209 CALL err( NF90_INQ_VARID(nid,var,vID),"inq",var)209 CALL err(nf90_inq_varid(nid,var,vID),"inq",var) 210 210 CALL err(nf90_put_var(nid,vID,[time]),"put",var) 211 211 WRITE(lunout,*)TRIM(modname)//": Saving for ", nb, time … … 213 213 !--- Rewrite control table (itaufin undefined in dynredem0) 214 214 var="controle" 215 CALL err( NF90_INQ_VARID(nid,var,vID),"inq",var)215 CALL err(nf90_inq_varid(nid,var,vID),"inq",var) 216 216 CALL err(nf90_get_var(nid,vID,tab_cntrl),"get",var) 217 217 tab_cntrl(31)=DBLE(itau_dyn + itaufin) 218 CALL err( NF90_INQ_VARID(nid,var,vID),"inq",var)218 CALL err(nf90_inq_varid(nid,var,vID),"inq",var) 219 219 CALL err(nf90_put_var(nid,vID,tab_cntrl),"put",var) 220 220 … … 235 235 IF(lread_inca) THEN !--- Possibly read from "start_trac.nc" 236 236 fil="start_trac.nc" 237 ierr= NF90_INQ_VARID(nid_trac,var,vID_trac)237 ierr=nf90_inq_varid(nid_trac,var,vID_trac) 238 238 dum='inq'; IF(ierr==nf90_noerr) dum='fnd' 239 239 WRITE(lunout,*)msg(dum,var) -
LMDZ6/branches/Amaury_dev/libf/dyn3d/dynredem_mod.F90
r5100 r5101 31 31 !=============================================================================== 32 32 start(:)=[1,1,1,1]; count(:)=[iip1,jjp1,ll,1] 33 CALL err( NF90_INQ_VARID(ncid,id,nvarid),"inq",id)33 CALL err(nf90_inq_varid(ncid,id,nvarid),"inq",id) 34 34 CALL err(nf90_put_var(ncid,nvarid,var,start,count),"put",id) 35 35 … … 54 54 !=============================================================================== 55 55 start(:)=[1,1,1,1]; count(:)=[iip1,jjm,ll,1] 56 CALL err( NF90_INQ_VARID(ncid,id,nvarid),"inq",id)56 CALL err(nf90_inq_varid(ncid,id,nvarid),"inq",id) 57 57 CALL err(nf90_put_var(ncid,nvarid,var,start,count),"put",id) 58 58 … … 77 77 !=============================================================================== 78 78 start(:)=[1,1,1,1]; count(:)=[iip1,jjp1,ll,1] 79 CALL err( NF90_INQ_VARID(ncid,id,nvarid),"inq",id)79 CALL err(nf90_inq_varid(ncid,id,nvarid),"inq",id) 80 80 CALL err(nf90_get_var(ncid,nvarid,var,start,count),"get",id) 81 81 … … 121 121 CALL err(nf90_enddef(ncid)) 122 122 CALL err(nf90_put_var(ncid,nvarid,v),"put",var) 123 CALL err( NF90_REDEF(ncid))123 CALL err(nf90_redef(ncid)) 124 124 125 125 END SUBROUTINE put_var1 … … 144 144 CALL err(nf90_enddef(ncid)) 145 145 CALL err(nf90_put_var(ncid,nvarid,v),"put",var) 146 CALL err( NF90_REDEF(ncid))146 CALL err(nf90_redef(ncid)) 147 147 148 148 END SUBROUTINE put_var2 … … 188 188 IF(ierr==nf90_noerr) RETURN 189 189 IF(.NOT.PRESENT(typ)) THEN 190 CALL ABORT_gcm(modname, NF90_STRERROR(ierr),ierr)190 CALL ABORT_gcm(modname,nf90_strerror(ierr),ierr) 191 191 ELSE 192 192 CALL ABORT_gcm(modname,msg(typ,nam),ierr) -
LMDZ6/branches/Amaury_dev/libf/dyn3d/fluxstokenc.F
r5099 r5101 62 62 63 63 ndex(1) = 0 64 callhistwrite(fluxid, 'phis', 1, phis, iip1*jjp1, ndex)65 callhistwrite(fluxid, 'aire', 1, aire, iip1*jjp1, ndex)64 CALL histwrite(fluxid, 'phis', 1, phis, iip1*jjp1, ndex) 65 CALL histwrite(fluxid, 'aire', 1, aire, iip1*jjp1, ndex) 66 66 67 67 ndex(1) = 0 68 68 nscal = 1 69 69 tst(1) = time_step 70 callhistwrite(fluxdid, 'dtvr', 1, tst, nscal, ndex)70 CALL histwrite(fluxdid, 'dtvr', 1, tst, nscal, ndex) 71 71 ist(1)=istdyn 72 callhistwrite(fluxdid, 'istdyn', 1, ist, nscal, ndex)72 CALL histwrite(fluxdid, 'istdyn', 1, ist, nscal, ndex) 73 73 istp(1)= istphy 74 callhistwrite(fluxdid, 'istphy', 1, istp, nscal, ndex)74 CALL histwrite(fluxdid, 'istphy', 1, istp, nscal, ndex) 75 75 76 76 first = .false. … … 140 140 write(lunout,*)'ITAU auquel on stoke les fluxmasses',itau 141 141 142 callhistwrite(fluxid, 'masse', itau, massem,142 CALL histwrite(fluxid, 'masse', itau, massem, 143 143 . iip1*jjp1*llm, ndex) 144 144 145 callhistwrite(fluxid, 'pbaru', itau, pbarug,145 CALL histwrite(fluxid, 'pbaru', itau, pbarug, 146 146 . iip1*jjp1*llm, ndex) 147 147 148 callhistwrite(fluxvid, 'pbarv', itau, pbarvg,148 CALL histwrite(fluxvid, 'pbarv', itau, pbarvg, 149 149 . iip1*jjm*llm, ndex) 150 150 151 call histwrite(fluxid, 'w' ,itau, wg,151 CALL histwrite(fluxid, 'w' ,itau, wg, 152 152 . iip1*jjp1*llm, ndex) 153 153 154 call histwrite(fluxid, 'teta' ,itau, tetac,154 CALL histwrite(fluxid, 'teta' ,itau, tetac, 155 155 . iip1*jjp1*llm, ndex) 156 156 157 call histwrite(fluxid, 'phi' ,itau, phic,157 CALL histwrite(fluxid, 'phi' ,itau, phic, 158 158 . iip1*jjp1*llm, ndex) 159 159 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/friction.F
r5099 r5101 52 52 IF (firstcall) THEN 53 53 ! set friction type 54 callgetin("friction_type",friction_type)54 CALL getin("friction_type",friction_type) 55 55 if ((friction_type<0).or.(friction_type>1)) then 56 56 abort_message="wrong friction type" 57 57 write(lunout,*)'Friction: wrong friction type',friction_type 58 callabort_gcm(modname,abort_message,42)58 CALL abort_gcm(modname,abort_message,42) 59 59 endif 60 60 firstcall=.false. -
LMDZ6/branches/Amaury_dev/libf/dyn3d/gcm.F90
r5099 r5101 143 143 CALL conf_gcm( 99, .TRUE.) 144 144 145 if (mod(iphysiq, iperiod) /= 0) callabort_gcm("conf_gcm", &145 if (mod(iphysiq, iperiod) /= 0) CALL abort_gcm("conf_gcm", & 146 146 "iphysiq must be a multiple of iperiod", 1) 147 147 148 148 use_filtre_fft=.FALSE. 149 149 CALL getin('use_filtre_fft',use_filtre_fft) 150 IF (use_filtre_fft) callabort_gcm("gcm", 'FFT filter is not available in ' &150 IF (use_filtre_fft) CALL abort_gcm("gcm", 'FFT filter is not available in ' & 151 151 // 'the sequential version of the dynamics.', 1) 152 152 … … 166 166 !#ifdef CPP_PHYS 167 167 ! CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) 168 ! ! callInitComgeomphy ! now done in iniphysiq168 ! ! CALL InitComgeomphy ! now done in iniphysiq 169 169 !#endif 170 170 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 177 177 #ifdef CPP_IOIPSL 178 178 if (calend == 'earth_360d') then 179 callioconf_calendar('360_day')179 CALL ioconf_calendar('360_day') 180 180 write(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' 181 181 else if (calend == 'earth_365d') then 182 callioconf_calendar('noleap')182 CALL ioconf_calendar('noleap') 183 183 write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' 184 184 else if (calend == 'gregorian') then 185 callioconf_calendar('gregorian')185 CALL ioconf_calendar('gregorian') 186 186 write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' 187 187 else 188 188 abort_message = 'Mauvais choix de calendrier' 189 callabort_gcm(modname,abort_message,1)189 CALL abort_gcm(modname,abort_message,1) 190 190 endif 191 191 #endif … … 203 203 ! Choix du nombre de traceurs et du schema pour l'advection 204 204 ! dans fichier traceur.def, par default ou via INCA 205 callinit_infotrac205 CALL init_infotrac 206 206 207 207 ! Allocation de la tableau q : champs advectes … … 253 253 abort_message = & 254 254 'Il faut choisir un nb de pas par jour multiple de iperiod' 255 callabort_gcm(modname,abort_message,1)255 CALL abort_gcm(modname,abort_message,1) 256 256 ENDIF 257 257 … … 259 259 abort_message = & 260 260 'Il faut choisir un nb de pas par jour multiple de iphysiq' 261 callabort_gcm(modname,abort_message,1)261 CALL abort_gcm(modname,abort_message,1) 262 262 ENDIF 263 263 … … 277 277 start_time = starttime 278 278 ELSE 279 callabort_gcm("gcm", "'Je m''arrete'", 1)279 CALL abort_gcm("gcm", "'Je m''arrete'", 1) 280 280 ENDIF 281 281 ENDIF … … 328 328 mois = 1 329 329 heure = 0. 330 callymds2ju(annee_ref, mois, day_ref, heure, jD_ref)330 CALL ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) 331 331 jH_ref = jD_ref - int(jD_ref) 332 332 jD_ref = int(jD_ref) 333 333 334 callioconf_startdate(INT(jD_ref), jH_ref)334 CALL ioconf_startdate(INT(jD_ref), jH_ref) 335 335 336 336 write(lunout,*)'DEBUG' 337 337 write(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref' 338 338 write(lunout,*)annee_ref, mois, day_ref, heure, jD_ref 339 callju2ymds(jD_ref+jH_ref,an, mois, jour, heure)339 CALL ju2ymds(jD_ref+jH_ref,an, mois, jour, heure) 340 340 write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure' 341 341 write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure … … 392 392 393 393 #ifdef CPP_IOIPSL 394 callju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure)394 CALL ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure) 395 395 write (lunout,301)jour, mois, an 396 callju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure)396 CALL ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure) 397 397 write (lunout,302)jour, mois, an 398 398 301 FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4) -
LMDZ6/branches/Amaury_dev/libf/dyn3d/getparam.F90
r5099 r5101 49 49 50 50 ret_val=def_val 51 callgetin(TARGET,ret_val)51 CALL getin(TARGET,ret_val) 52 52 53 53 write(out_eff,*) '######################################' … … 72 72 73 73 ret_val=def_val 74 callgetin(TARGET,ret_val)74 CALL getin(TARGET,ret_val) 75 75 76 76 write(out_eff,*) '######################################' … … 96 96 97 97 ret_val=def_val 98 callgetin(TARGET,ret_val)98 CALL getin(TARGET,ret_val) 99 99 100 100 write(out_eff,*) '######################################' -
LMDZ6/branches/Amaury_dev/libf/dyn3d/groupe.F
r5099 r5101 60 60 c Champs 1D 61 61 62 callconvflu(pbaru,pbarv,llm,zconvm)62 CALL convflu(pbaru,pbarv,llm,zconvm) 63 63 64 callscopy(ijp1llm,zconvm,1,zconvmm,1)65 callscopy(ijmllm,pbarv,1,pbarvm,1)64 CALL scopy(ijp1llm,zconvm,1,zconvmm,1) 65 CALL scopy(ijmllm,pbarv,1,pbarvm,1) 66 66 67 67 if (groupe_ok) then 68 callgroupeun(jjp1,llm,zconvmm)69 callgroupeun(jjm,llm,pbarvm)68 CALL groupeun(jjp1,llm,zconvmm) 69 CALL groupeun(jjm,llm,pbarvm) 70 70 71 71 c Champs 3D -
LMDZ6/branches/Amaury_dev/libf/dyn3d/guide_mod.F90
r5100 r5101 89 89 ! Lecture des parametres: 90 90 ! --------------------------------------------- 91 callini_getparam("nudging_parameters_out.txt")91 CALL ini_getparam("nudging_parameters_out.txt") 92 92 ! Variables guidees 93 93 CALL getpar('guide_u',.true.,guide_u,'guidage de u') … … 102 102 CALL getpar('guide_zon',.false.,guide_zon,'guidage moy zonale') 103 103 if (guide_zon .and. abs(grossismx - 1.) > 0.01) & 104 callabort_gcm("guide_init", &104 CALL abort_gcm("guide_init", & 105 105 "zonal nudging requires grid regular in longitude", 1) 106 106 … … 166 166 CALL getpar('guide_2D',.false.,guide_2D,'fichier guidage lat-P') 167 167 168 callfin_getparam168 CALL fin_getparam 169 169 170 170 ! --------------------------------------------- … … 400 400 ! Calcul des constantes de rappel 401 401 factt=dtvr*iperiod/daysec 402 calltau2alpha(3,iip1,jjm ,factt,tau_min_v,tau_max_v,alpha_v)403 calltau2alpha(2,iip1,jjp1,factt,tau_min_u,tau_max_u,alpha_u)404 calltau2alpha(1,iip1,jjp1,factt,tau_min_T,tau_max_T,alpha_T)405 calltau2alpha(1,iip1,jjp1,factt,tau_min_P,tau_max_P,alpha_P)406 calltau2alpha(1,iip1,jjp1,factt,tau_min_Q,tau_max_Q,alpha_Q)402 CALL tau2alpha(3,iip1,jjm ,factt,tau_min_v,tau_max_v,alpha_v) 403 CALL tau2alpha(2,iip1,jjp1,factt,tau_min_u,tau_max_u,alpha_u) 404 CALL tau2alpha(1,iip1,jjp1,factt,tau_min_T,tau_max_T,alpha_T) 405 CALL tau2alpha(1,iip1,jjp1,factt,tau_min_P,tau_max_P,alpha_P) 406 CALL tau2alpha(1,iip1,jjp1,factt,tau_min_Q,tau_max_Q,alpha_Q) 407 407 ! correction de rappel dans couche limite 408 408 if (guide_BL) then … … 503 503 CALL pression(ip1jmp1,ap,bp,ps,p) 504 504 if (pressure_exner) then 505 callexner_hyb(ip1jmp1,ps,p,pks,pk)505 CALL exner_hyb(ip1jmp1,ps,p,pks,pk) 506 506 else 507 callexner_milieu(ip1jmp1,ps,p,pks,pk)507 CALL exner_milieu(ip1jmp1,ps,p,pks,pk) 508 508 endif 509 509 unskap=1./kappa … … 782 782 enddo 783 783 enddo 784 callmassbar(pext, pbarx, pbary )784 CALL massbar(pext, pbarx, pbary ) 785 785 do l=1,llm 786 786 do j=1,jjp1 … … 1699 1699 ierr=nf90_def_var(nid,"au",nf90_float,(/id_lonu,id_latu/),vid_au) 1700 1700 ierr=nf90_def_var(nid,"av",nf90_float,(/id_lonv,id_latv/),vid_av) 1701 callnf95_def_var(nid, "alpha_T", nf90_float, (/id_lonv, id_latu/), &1701 CALL nf95_def_var(nid, "alpha_T", nf90_float, (/id_lonv, id_latu/), & 1702 1702 varid_alpha_t) 1703 callnf95_def_var(nid, "alpha_q", nf90_float, (/id_lonv, id_latu/), &1703 CALL nf95_def_var(nid, "alpha_q", nf90_float, (/id_lonv, id_latu/), & 1704 1704 varid_alpha_q) 1705 1705 … … 1716 1716 ierr = nf90_put_var(nid,vid_au,alpha_u) 1717 1717 ierr = nf90_put_var(nid,vid_av,alpha_v) 1718 callnf95_put_var(nid, varid_alpha_t, alpha_t)1719 callnf95_put_var(nid, varid_alpha_q, alpha_q)1718 CALL nf95_put_var(nid, varid_alpha_t, alpha_t) 1719 CALL nf95_put_var(nid, varid_alpha_q, alpha_q) 1720 1720 ! -------------------------------------------------------------------- 1721 1721 ! Création des variables sauvegardées -
LMDZ6/branches/Amaury_dev/libf/dyn3d/iniacademic.F90
r5100 r5101 22 22 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 23 23 USE readTracFiles_mod, ONLY: addPhase 24 use netcdf, only : nf90_nowrite,nf90_open,nf90_noerr,NF90_INQ_VARID,nf90_close,nf90_get_var24 use netcdf, ONLY: nf90_nowrite,nf90_open,nf90_noerr,nf90_inq_varid,nf90_close,nf90_get_var 25 25 26 26 ! Author: Frederic Hourdin original: 15/01/93 … … 89 89 write(lunout,*) "You most likely want an aquaplanet initialisation", & 90 90 " (iflag_phys >= 100)" 91 callabort_gcm(modname,"incompatible iflag_phys==1 and read_start==.false.",1)91 CALL abort_gcm(modname,"incompatible iflag_phys==1 and read_start==.false.",1) 92 92 endif 93 93 … … 97 97 98 98 ! initialize planet radius, rotation rate,... 99 callconf_planete99 CALL conf_planete 100 100 101 101 time_0=0. … … 142 142 ierr = nf90_open ('relief_in.nc', nf90_nowrite,nid_relief) 143 143 if (ierr==nf90_noerr) THEN 144 ierr= NF90_INQ_VARID(nid_relief,'RELIEF',varid)144 ierr=nf90_inq_varid(nid_relief,'RELIEF',varid) 145 145 if (ierr==nf90_noerr) THEN 146 146 ierr=nf90_get_var(nid_relief,varid,relief(1:iim,1:jjp1)) … … 172 172 CALL exner_hyb( ip1jmp1, ps, p, pks, pk) 173 173 else 174 callexner_milieu(ip1jmp1,ps,p,pks,pk)174 CALL exner_milieu(ip1jmp1,ps,p,pks,pk) 175 175 endif 176 176 CALL massdair(p,masse) … … 299 299 ! winds 300 300 if (ok_geost) then 301 callugeostr(phi,ucov)301 CALL ugeostr(phi,ucov) 302 302 else 303 303 ucov(:,:)=0. … … 343 343 endif ! of if (planet_type=="earth") 344 344 345 callcheck_isotopes_seq(q,1,ip1jmp1,'iniacademic_loc')345 CALL check_isotopes_seq(q,1,ip1jmp1,'iniacademic_loc') 346 346 347 347 ! add random perturbation to temperature -
LMDZ6/branches/Amaury_dev/libf/dyn3d/integrd.F
r5099 r5101 7 7 & ) 8 8 9 use control_mod, only: planet_type9 use control_mod, ONLY: planet_type 10 10 use comconst_mod, only: pi 11 11 USE logic_mod, ONLY: leapf … … 106 106 write(lunout,*) " lon = ",rlonv(i)*180./pi, " deg", 107 107 & " lat = ",rlatu(j)*180./pi, " deg" 108 callabort_gcm("integrd", "", 1)108 CALL abort_gcm("integrd", "", 1) 109 109 ENDIF 110 110 ENDDO -
LMDZ6/branches/Amaury_dev/libf/dyn3d/interp_horiz.F
r5086 r5101 65 65 66 66 67 calliniinterp_horiz (imo,jmo,imn,jmn ,kllm,67 CALL iniinterp_horiz (imo,jmo,imn,jmn ,kllm, 68 68 & rlonuo,rlatvo,rlonun,rlatvn, 69 69 & ktotal,iik,jjk,jk,ik,intersec,airen) -
LMDZ6/branches/Amaury_dev/libf/dyn3d/leapfrog.F
r5099 r5101 12 12 #endif 13 13 USE infotrac, ONLY: nqtot, isoCheck 14 USE guide_mod, ONLY 14 USE guide_mod, ONLY: guide_main 15 15 USE write_field, ONLY: writefield 16 16 USE control_mod, ONLY: nday, day_step, planet_type, offline, … … 239 239 jH_cur = jH_cur - int(jH_cur) 240 240 241 callcheck_isotopes_seq(q,ip1jmp1,'leapfrog 321')241 CALL check_isotopes_seq(q,ip1jmp1,'leapfrog 321') 242 242 243 243 #ifdef CPP_IOIPSL 244 244 if (ok_guide) then 245 callguide_main(itau,ucov,vcov,teta,q,masse,ps)245 CALL guide_main(itau,ucov,vcov,teta,q,masse,ps) 246 246 endif 247 247 #endif … … 271 271 ! CALL filtreg ( finvmaold ,jjp1, llm, -2,2, .TRUE., 1 ) 272 272 273 callcheck_isotopes_seq(q,ip1jmp1,'leapfrog 400')273 CALL check_isotopes_seq(q,ip1jmp1,'leapfrog 400') 274 274 275 275 2 CONTINUE ! Matsuno backward or leapfrog step begins here … … 322 322 323 323 324 callcheck_isotopes_seq(q,ip1jmp1,'leapfrog 589')324 CALL check_isotopes_seq(q,ip1jmp1,'leapfrog 589') 325 325 326 326 c----------------------------------------------------------------------- … … 341 341 c ------------------------------------------------------------- 342 342 343 callcheck_isotopes_seq(q,ip1jmp1,343 CALL check_isotopes_seq(q,ip1jmp1, 344 344 & 'leapfrog 686: avant caladvtrac') 345 345 … … 371 371 372 372 CALL msg('720', modname, isoCheck) 373 callcheck_isotopes_seq(q,ip1jmp1,'leapfrog 756')373 CALL check_isotopes_seq(q,ip1jmp1,'leapfrog 756') 374 374 375 375 CALL integrd ( nqtot,vcovm1,ucovm1,tetam1,psm1,massem1 , … … 378 378 379 379 CALL msg('724', modname, isoCheck) 380 callcheck_isotopes_seq(q,ip1jmp1,'leapfrog 762')380 CALL check_isotopes_seq(q,ip1jmp1,'leapfrog 762') 381 381 382 382 c .P.Le Van (26/04/94 ajout de finvpold dans l'appel d'integrd) … … 429 429 jH_cur = jH_cur - int(jH_cur) 430 430 ! write(lunout,*)'itau, jD_cur = ', itau, jD_cur, jH_cur 431 ! callju2ymds(jD_cur+jH_cur, an, mois, jour, secondes)431 ! CALL ju2ymds(jD_cur+jH_cur, an, mois, jour, secondes) 432 432 ! write(lunout,*)'current date = ',an, mois, jour, secondes 433 433 … … 514 514 endif 515 515 516 callfriction(ucov,vcov,dtvr)516 CALL friction(ucov,vcov,dtvr) 517 517 518 518 ! Sponge layer (if any) … … 542 542 CALL massdair(p,masse) 543 543 544 callcheck_isotopes_seq(q,ip1jmp1,'leapfrog 1196')544 CALL check_isotopes_seq(q,ip1jmp1,'leapfrog 1196') 545 545 546 546 c----------------------------------------------------------------------- … … 552 552 553 553 c calcul de l'energie cinetique avant dissipation 554 callcovcont(llm,ucov,vcov,ucont,vcont)555 callenercin(vcov,ucov,vcont,ucont,ecin0)554 CALL covcont(llm,ucov,vcov,ucont,vcont) 555 CALL enercin(vcov,ucov,vcont,ucont,ecin0) 556 556 557 557 c dissipation … … 566 566 C On rajoute la tendance due a la transform. Ec -> E therm. cree 567 567 C lors de la dissipation 568 callcovcont(llm,ucov,vcov,ucont,vcont)569 callenercin(vcov,ucov,vcont,ucont,ecin)568 CALL covcont(llm,ucov,vcov,ucont,vcont) 569 CALL enercin(vcov,ucov,vcont,ucont,ecin) 570 570 dtetaecdt= (ecin0-ecin)/ pk 571 571 c teta=teta+dtetaecdt … … 616 616 c IF( lafin ) then 617 617 c abort_message = 'Simulation finished' 618 c callabort_gcm(modname,abort_message,0)618 c CALL abort_gcm(modname,abort_message,0) 619 619 c ENDIF 620 620 … … 627 627 c preparation du pas d'integration suivant ...... 628 628 629 callcheck_isotopes_seq(q,ip1jmp1,'leapfrog 1509')629 CALL check_isotopes_seq(q,ip1jmp1,'leapfrog 1509') 630 630 631 631 IF ( .NOT.purmats ) THEN … … 658 658 abort_message = 'Simulation finished' 659 659 660 callabort_gcm(modname,abort_message,0)660 CALL abort_gcm(modname,abort_message,0) 661 661 ENDIF 662 662 c----------------------------------------------------------------------- … … 689 689 ENDIF ! of IF((MOD(itau,iperiod).EQ.0).OR.(itau.EQ.itaufin)) 690 690 691 callcheck_isotopes_seq(q,ip1jmp1,'leapfrog 1584')691 CALL check_isotopes_seq(q,ip1jmp1,'leapfrog 1584') 692 692 693 693 c----------------------------------------------------------------------- … … 706 706 #ifdef CPP_IOIPSL 707 707 if (ok_dyn_ins) then 708 ! write(lunout,*) "leapfrog: callwritehist, itau=",itau708 ! write(lunout,*) "leapfrog: CALL writehist, itau=",itau 709 709 CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis) 710 ! callWriteField('ucov',reshape(ucov,(/iip1,jmp1,llm/)))711 ! callWriteField('vcov',reshape(vcov,(/iip1,jjm,llm/)))712 ! callWriteField('teta',reshape(teta,(/iip1,jmp1,llm/)))713 ! callWriteField('ps',reshape(ps,(/iip1,jmp1/)))714 ! callWriteField('masse',reshape(masse,(/iip1,jmp1,llm/)))710 ! CALL WriteField('ucov',reshape(ucov,(/iip1,jmp1,llm/))) 711 ! CALL WriteField('vcov',reshape(vcov,(/iip1,jjm,llm/))) 712 ! CALL WriteField('teta',reshape(teta,(/iip1,jmp1,llm/))) 713 ! CALL WriteField('ps',reshape(ps,(/iip1,jmp1/))) 714 ! CALL WriteField('masse',reshape(masse,(/iip1,jmp1,llm/))) 715 715 endif ! of if (ok_dyn_ins) 716 716 #endif … … 774 774 ELSE ! of IF (.not.purmats) 775 775 776 callcheck_isotopes_seq(q,ip1jmp1,'leapfrog 1664')776 CALL check_isotopes_seq(q,ip1jmp1,'leapfrog 1664') 777 777 778 778 c ........................................................ … … 793 793 IF( itau == itaufinp1 ) then 794 794 abort_message = 'Simulation finished' 795 callabort_gcm(modname,abort_message,0)795 CALL abort_gcm(modname,abort_message,0) 796 796 ENDIF 797 797 GO TO 2 … … 799 799 ELSE ! of IF(forward) i.e. backward step 800 800 801 callcheck_isotopes_seq(q,ip1jmp1,'leapfrog 1698')801 CALL check_isotopes_seq(q,ip1jmp1,'leapfrog 1698') 802 802 803 803 IF(MOD(itau,iperiod)==0 .OR. itau==itaufin) THEN … … 836 836 #ifdef CPP_IOIPSL 837 837 if (ok_dyn_ins) then 838 ! write(lunout,*) "leapfrog: callwritehist (b)",838 ! write(lunout,*) "leapfrog: CALL writehist (b)", 839 839 ! & itau,iecri 840 840 CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis) -
LMDZ6/branches/Amaury_dev/libf/dyn3d/qminimum.F
r5099 r5101 58 58 c 59 59 60 call check_isotopes_seq(q,ip1jmp1,'qminimum 52')60 CALL check_isotopes_seq(q,ip1jmp1,'qminimum 52') 61 61 62 62 zx_defau_diag(:,:,:)=0.0 … … 158 158 enddo !do k=2,llm 159 159 160 callcheck_isotopes_seq(q,ip1jmp1,'qminimum 168')160 CALL check_isotopes_seq(q,ip1jmp1,'qminimum 168') 161 161 162 162 … … 185 185 enddo !do k=2,llm 186 186 187 callcheck_isotopes_seq(q,ip1jmp1,'qminimum 197')187 CALL check_isotopes_seq(q,ip1jmp1,'qminimum 197') 188 188 189 189 endif !if (niso > 0) then -
LMDZ6/branches/Amaury_dev/libf/dyn3d/replay3d.F90
r5099 r5101 8 8 9 9 10 USE comvert_mod, only: preff, pa10 USE comvert_mod, ONLY: preff, pa 11 11 USE inigeomphy_mod, ONLY: inigeomphy 12 12 … … 18 18 USE logic_mod, ONLY: ecripar, iflag_phys, read_start 19 19 20 USE serre_mod, ONLY 20 USE serre_mod, ONLY: clon,clat,transx,transy,alphax,alphay,pxo,pyo, & 21 21 grossismx, grossismy, dzoomx, dzoomy,taux,tauy 22 22 USE mod_const_mpi, ONLY: comm_lmdz … … 101 101 CALL conf_gcm( 99, .TRUE.) 102 102 103 if (mod(iphysiq, iperiod) /= 0) callabort_gcm("conf_gcm", &103 if (mod(iphysiq, iperiod) /= 0) CALL abort_gcm("conf_gcm", & 104 104 "iphysiq must be a multiple of iperiod", 1) 105 105 … … 139 139 mois = 1 140 140 heure = 0. 141 ! callymds2ju(annee_ref, mois, day_ref, heure, jD_ref)141 ! CALL ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) 142 142 jH_ref = jD_ref - int(jD_ref) 143 143 jD_ref = int(jD_ref) … … 170 170 ! Initialisation de la parametrisation 171 171 !--------------------------------------------------------------------- 172 callcall_ini_replay172 CALL call_ini_replay 173 173 174 174 !--------------------------------------------------------------------- … … 177 177 DO it=1,ntime 178 178 print*,'Pas de temps ',it,klon,klev 179 callcall_param_replay(klon,klev)179 CALL call_param_replay(klon,klev) 180 180 ENDDO 181 181 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/vlsplt.F
r5098 r5101 78 78 79 79 cprint*,'Entree vlx1' 80 c callminmaxq(zq,qmin,qmax,'avant vlx ')81 callvlx(zq,pente_max,zm,mu,iq)80 c CALL minmaxq(zq,qmin,qmax,'avant vlx ') 81 CALL vlx(zq,pente_max,zm,mu,iq) 82 82 cprint*,'Sortie vlx1' 83 c callminmaxq(zq,qmin,qmax,'apres vlx1 ')83 c CALL minmaxq(zq,qmin,qmax,'apres vlx1 ') 84 84 85 85 c print*,'Entree vly1' 86 86 87 callvly(zq,pente_max,zm,mv,iq)88 c callminmaxq(zq,qmin,qmax,'apres vly1 ')87 CALL vly(zq,pente_max,zm,mv,iq) 88 c CALL minmaxq(zq,qmin,qmax,'apres vly1 ') 89 89 cprint*,'Sortie vly1' 90 callvlz(zq,pente_max,zm,mw,iq)91 c callminmaxq(zq,qmin,qmax,'apres vlz ')92 93 94 callvly(zq,pente_max,zm,mv,iq)95 c callminmaxq(zq,qmin,qmax,'apres vly ')96 97 98 callvlx(zq,pente_max,zm,mu,iq)99 c callminmaxq(zq,qmin,qmax,'apres vlx2 ')90 CALL vlz(zq,pente_max,zm,mw,iq) 91 c CALL minmaxq(zq,qmin,qmax,'apres vlz ') 92 93 94 CALL vly(zq,pente_max,zm,mv,iq) 95 c CALL minmaxq(zq,qmin,qmax,'apres vly ') 96 97 98 CALL vlx(zq,pente_max,zm,mu,iq) 99 c CALL minmaxq(zq,qmin,qmax,'apres vlx2 ') 100 100 101 101 … … 124 124 END 125 125 RECURSIVE SUBROUTINE vlx(q,pente_max,masse,u_m,iq) 126 USE infotrac, ONLY 126 USE infotrac, ONLY: nqtot,tracers, ! CRisi 127 127 & min_qParent,min_qMass,min_ratio ! MVals et CRisi 128 128 … … 414 414 do ifils=1,tracers(iq)%nqChildren 415 415 iq2=tracers(iq)%iqDescen(ifils) 416 callvlx(Ratio,pente_max,masseq,u_mq,iq2)416 CALL vlx(Ratio,pente_max,masseq,u_mq,iq2) 417 417 enddo 418 418 ! end CRisi … … 459 459 END 460 460 RECURSIVE SUBROUTINE vly(q,pente_max,masse,masse_adv_v,iq) 461 USE infotrac, ONLY 461 USE infotrac, ONLY: nqtot,tracers, ! CRisi 462 462 & min_qParent,min_qMass,min_ratio ! MVals et CRisi 463 463 c … … 739 739 do ifils=1,tracers(iq)%nqDescen 740 740 iq2=tracers(iq)%iqDescen(ifils) 741 callvly(Ratio,pente_max,masseq,qbyv,iq2)741 CALL vly(Ratio,pente_max,masseq,qbyv,iq2) 742 742 enddo 743 743 … … 822 822 END 823 823 RECURSIVE SUBROUTINE vlz(q,pente_max,masse,w,iq) 824 USE infotrac, ONLY : nqtot,tracers, ! CRisi824 USE infotrac, ONLY: nqtot,tracers, ! CRisi 825 825 & min_qParent,min_qMass,min_ratio ! MVals et CRisi 826 826 c … … 945 945 do ifils=1,tracers(iq)%nqChildren 946 946 iq2=tracers(iq)%iqDescen(ifils) 947 callvlz(Ratio,pente_max,masseq,wq,iq2)947 CALL vlz(Ratio,pente_max,masseq,wq,iq2) 948 948 enddo 949 949 ! end CRisi … … 1017 1017 integer ismin,ismax 1018 1018 1019 callscopy (ip1jmp1*llm,zq,1,zzq,1)1019 CALL scopy (ip1jmp1*llm,zq,1,zzq,1) 1020 1020 1021 1021 ijlmin=ismin(ijp1llm,zq,1) -
LMDZ6/branches/Amaury_dev/libf/dyn3d/vlspltqs.F
r5098 r5101 127 127 enddo 128 128 129 c callminmaxq(zq,qmin,qmax,'avant vlxqs ')130 callvlxqs(zq,pente_max,zm,mu,qsat,iq)131 132 c callminmaxq(zq,qmin,qmax,'avant vlyqs ')133 134 callvlyqs(zq,pente_max,zm,mv,qsat,iq)135 136 c callminmaxq(zq,qmin,qmax,'avant vlz ')137 138 callvlz(zq,pente_max,zm,mw,iq)139 140 c callminmaxq(zq,qmin,qmax,'avant vlyqs ')141 c callminmaxq(zm,qmin,qmax,'M avant vlyqs ')142 143 callvlyqs(zq,pente_max,zm,mv,qsat,iq)144 145 c callminmaxq(zq,qmin,qmax,'avant vlxqs ')146 c callminmaxq(zm,qmin,qmax,'M avant vlxqs ')147 148 callvlxqs(zq,pente_max,zm,mu,qsat,iq)149 150 c callminmaxq(zq,qmin,qmax,'apres vlxqs ')151 c callminmaxq(zm,qmin,qmax,'M apres vlxqs ')129 c CALL minmaxq(zq,qmin,qmax,'avant vlxqs ') 130 CALL vlxqs(zq,pente_max,zm,mu,qsat,iq) 131 132 c CALL minmaxq(zq,qmin,qmax,'avant vlyqs ') 133 134 CALL vlyqs(zq,pente_max,zm,mv,qsat,iq) 135 136 c CALL minmaxq(zq,qmin,qmax,'avant vlz ') 137 138 CALL vlz(zq,pente_max,zm,mw,iq) 139 140 c CALL minmaxq(zq,qmin,qmax,'avant vlyqs ') 141 c CALL minmaxq(zm,qmin,qmax,'M avant vlyqs ') 142 143 CALL vlyqs(zq,pente_max,zm,mv,qsat,iq) 144 145 c CALL minmaxq(zq,qmin,qmax,'avant vlxqs ') 146 c CALL minmaxq(zm,qmin,qmax,'M avant vlxqs ') 147 148 CALL vlxqs(zq,pente_max,zm,mu,qsat,iq) 149 150 c CALL minmaxq(zq,qmin,qmax,'apres vlxqs ') 151 c CALL minmaxq(zm,qmin,qmax,'M apres vlxqs ') 152 152 153 153 … … 177 177 END 178 178 SUBROUTINE vlxqs(q,pente_max,masse,u_m,qsat,iq) 179 USE infotrac, ONLY 179 USE infotrac, ONLY: nqtot,tracers ! CRisi 180 180 181 181 c … … 471 471 do ifils=1,tracers(iq)%nqChildren 472 472 iq2=tracers(iq)%iqDescen(ifils) 473 callvlx(Ratio,pente_max,masseq,u_mq,iq2)473 CALL vlx(Ratio,pente_max,masseq,u_mq,iq2) 474 474 enddo 475 475 ! end CRisi … … 514 514 END 515 515 SUBROUTINE vlyqs(q,pente_max,masse,masse_adv_v,qsat,iq) 516 USE infotrac, ONLY 516 USE infotrac, ONLY: nqtot,tracers ! CRisi 517 517 c 518 518 c Auteurs: P.Le Van, F.Hourdin, F.Forget … … 779 779 iq2=tracers(iq)%iqDescen(ifils) 780 780 !write(*,*) 'vlyqs 783: appel rec de vly, iq2=',iq2 781 callvly(Ratio,pente_max,masseq,qbyv,iq2)781 CALL vly(Ratio,pente_max,masseq,qbyv,iq2) 782 782 enddo 783 783 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/wrgrads.F
r5099 r5101 107 107 write(unit(if),'(a12)') 'UNDEF 1.0E30' 108 108 write(unit(if),'(a5,1x,a40)') 'TITLE ',title(if) 109 callformcoord(unit(if),im,xd(iii,if),1.,.false.,'XDEF')110 callformcoord(unit(if),jm,yd(iji,if),1.,.true.,'YDEF')111 callformcoord(unit(if),lm,zd(1,if),1.,.false.,'ZDEF')109 CALL formcoord(unit(if),im,xd(iii,if),1.,.false.,'XDEF') 110 CALL formcoord(unit(if),jm,yd(iji,if),1.,.true.,'YDEF') 111 CALL formcoord(unit(if),lm,zd(1,if),1.,.false.,'ZDEF') 112 112 write(unit(if),'(a4,i10,a30)') 113 113 & 'TDEF ',itime(if),' LINEAR 02JAN1987 1MO ' -
LMDZ6/branches/Amaury_dev/libf/dyn3d/write_paramLMDZ_dyn.h
r5099 r5101 241 241 c 242 242 if (ok_sync) then 243 callhistsync(nid_ctesGCM)243 CALL histsync(nid_ctesGCM) 244 244 endif 245 245 c
Note: See TracChangeset
for help on using the changeset viewer.