Changeset 4056
- Timestamp:
- Jan 12, 2022, 10:54:09 PM (3 years ago)
- Location:
- LMDZ6/trunk/libf
- Files:
-
- 2 added
- 29 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dyn3d/advtrac.F90
r4050 r4056 1 1 ! $Id$ 2 2 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, nqperes,ok_iso_verif 12 USE control_mod, ONLY: iapp_tracvl, day_step 13 USE comconst_mod, ONLY: dtvr 14 15 IMPLICIT NONE 16 ! 17 include "dimensions.h" 18 include "paramet.h" 19 include "comdissip.h" 20 include "comgeom2.h" 21 include "description.h" 22 include "iniprint.h" 23 24 !------------------------------------------------------------------- 25 ! Arguments 26 !------------------------------------------------------------------- 27 INTEGER,INTENT(OUT) :: iapptrac 28 REAL,INTENT(IN) :: pbaru(ip1jmp1,llm) 29 REAL,INTENT(IN) :: pbarv(ip1jm,llm) 30 REAL,INTENT(INOUT) :: q(ip1jmp1,llm,nqtot) 31 REAL,INTENT(IN) :: masse(ip1jmp1,llm) 32 REAL,INTENT(IN) :: p( ip1jmp1,llmp1 ) 33 REAL,INTENT(IN) :: teta(ip1jmp1,llm) 34 REAL,INTENT(IN) :: pk(ip1jmp1,llm) 35 REAL,INTENT(OUT) :: flxw(ip1jmp1,llm) 36 !------------------------------------------------------------------- 37 ! Ajout PPM 38 !-------------------------------------------------------- 39 REAL massebx(ip1jmp1,llm),masseby(ip1jm,llm) 40 !------------------------------------------------------------- 41 ! Variables locales 42 !------------------------------------------------------------- 43 44 REAL pbaruc(ip1jmp1,llm),pbarvc(ip1jm,llm) 45 REAL massem(ip1jmp1,llm),zdp(ip1jmp1) 46 REAL pbarug(ip1jmp1,llm),pbarvg(ip1jm,llm),wg(ip1jmp1,llm) 47 REAL (kind=kind(1.d0)) :: t_initial, t_final, tps_cpu 48 INTEGER iadvtr 49 INTEGER ij,l,iq,iiq 50 REAL zdpmin, zdpmax 51 EXTERNAL minmax 52 SAVE iadvtr, massem, pbaruc, pbarvc 53 DATA iadvtr/0/ 54 !---------------------------------------------------------- 55 ! Rajouts pour PPM 56 !---------------------------------------------------------- 57 INTEGER indice,n 58 REAL dtbon ! Pas de temps adaptatif pour que CFL<1 59 REAL CFLmaxz,aaa,bbb ! CFL maximum 60 REAL psppm(iim,jjp1) ! pression au sol 61 REAL unatppm(iim,jjp1,llm),vnatppm(iim,jjp1,llm) 62 REAL qppm(iim*jjp1,llm,nqtot) 63 REAL fluxwppm(iim,jjp1,llm) 64 REAL apppm(llmp1), bpppm(llmp1) 65 LOGICAL dum,fill 66 DATA fill/.true./ 67 DATA dum/.true./ 68 69 integer,save :: countcfl=0 70 real cflx(ip1jmp1,llm) 71 real cfly(ip1jm,llm) 72 real cflz(ip1jmp1,llm) 73 real, save :: cflxmax(llm),cflymax(llm),cflzmax(llm) 74 INTEGER :: iadv 75 76 IF(iadvtr.EQ.0) THEN 77 pbaruc(:,:)=0 78 pbarvc(:,:)=0 79 ENDIF 80 81 ! accumulation des flux de masse horizontaux 82 DO l=1,llm 83 DO ij = 1,ip1jmp1 84 pbaruc(ij,l) = pbaruc(ij,l) + pbaru(ij,l) 85 ENDDO 86 DO ij = 1,ip1jm 87 pbarvc(ij,l) = pbarvc(ij,l) + pbarv(ij,l) 88 ENDDO 89 ENDDO 90 91 ! selection de la masse instantannee des mailles avant le transport. 92 IF(iadvtr.EQ.0) THEN 93 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,ok_iso_verif 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, iiq, 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 94 87 CALL SCOPY(ip1jmp1*llm,masse,1,massem,1) 95 !cc CALL filtreg ( massem ,jjp1, llm,-2, 2, .TRUE., 1 ) 96 ! 97 ENDIF 98 99 iadvtr = iadvtr+1 100 iapptrac = iadvtr 101 102 103 ! Test pour savoir si on advecte a ce pas de temps 104 IF ( iadvtr.EQ.iapp_tracvl ) THEN 105 106 !c .. Modif P.Le Van ( 20/12/97 ) .... 107 !c 108 109 ! traitement des flux de masse avant advection. 110 ! 1. calcul de w 111 ! 2. groupement des mailles pres du pole. 112 113 CALL groupe( massem, pbaruc,pbarvc, pbarug,pbarvg,wg ) 114 115 ! ... Flux de masse diaganostiques traceurs 116 flxw = wg / REAL(iapp_tracvl) 117 118 ! test sur l'eventuelle creation de valeurs negatives de la masse 119 DO l=1,llm-1 120 DO ij = iip2+1,ip1jm 121 zdp(ij) = pbarug(ij-1,l) - pbarug(ij,l) & 122 - pbarvg(ij-iip1,l) + pbarvg(ij,l) & 123 + wg(ij,l+1) - wg(ij,l) 124 ENDDO 125 CALL SCOPY( jjm -1 ,zdp(iip1+iip1),iip1,zdp(iip2),iip1 ) 126 DO ij = iip2,ip1jm 127 zdp(ij)= zdp(ij)*dtvr/ massem(ij,l) 128 ENDDO 129 130 131 CALL minmax ( ip1jm-iip1, zdp(iip2), zdpmin,zdpmax ) 132 133 IF(MAX(ABS(zdpmin),ABS(zdpmax)).GT.0.5) THEN 134 PRINT*,'WARNING DP/P l=',l,' MIN:',zdpmin, & 135 ' MAX:', zdpmax 136 ENDIF 137 138 ENDDO 139 140 141 !------------------------------------------------------------------- 142 ! Calcul des criteres CFL en X, Y et Z 143 !------------------------------------------------------------------- 144 145 if (countcfl == 0. ) then 146 cflxmax(:)=0. 147 cflymax(:)=0. 148 cflzmax(:)=0. 149 endif 150 151 countcfl=countcfl+iapp_tracvl 152 cflx(:,:)=0. 153 cfly(:,:)=0. 154 cflz(:,:)=0. 155 do l=1,llm 156 do ij=iip2,ip1jm-1 157 if (pbarug(ij,l)>=0.) then 158 cflx(ij,l)=pbarug(ij,l)*dtvr/masse(ij,l) 159 else 160 cflx(ij,l)=-pbarug(ij,l)*dtvr/masse(ij+1,l) 161 endif 162 enddo 163 enddo 164 do l=1,llm 165 do ij=iip2,ip1jm-1,iip1 166 cflx(ij+iip1,l)=cflx(ij,l) 167 enddo 168 enddo 169 170 do l=1,llm 171 do ij=1,ip1jm 172 if (pbarvg(ij,l)>=0.) then 173 cfly(ij,l)=pbarvg(ij,l)*dtvr/masse(ij,l) 174 else 175 cfly(ij,l)=-pbarvg(ij,l)*dtvr/masse(ij+iip1,l) 176 endif 177 enddo 178 enddo 179 180 do l=2,llm 181 do ij=1,ip1jm 182 if (wg(ij,l)>=0.) then 183 cflz(ij,l)=wg(ij,l)*dtvr/masse(ij,l) 184 else 185 cflz(ij,l)=-wg(ij,l)*dtvr/masse(ij,l-1) 186 endif 187 enddo 188 enddo 189 190 do l=1,llm 191 cflxmax(l)=max(cflxmax(l),maxval(cflx(:,l))) 192 cflymax(l)=max(cflymax(l),maxval(cfly(:,l))) 193 cflzmax(l)=max(cflzmax(l),maxval(cflz(:,l))) 194 enddo 195 196 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 197 ! Par defaut, on sort le diagnostic des CFL tous les jours. 198 ! Si on veut le sortir a chaque pas d'advection en cas de plantage 199 ! if (countcfl==iapp_tracvl) then 200 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 201 if (countcfl==day_step) then 202 do l=1,llm 203 write(lunout,*) 'L, CFL[xyz]max:', l, cflxmax(l), cflymax(l), & 204 cflzmax(l) 205 enddo 206 countcfl=0 207 endif 208 209 !------------------------------------------------------------------- 210 ! Advection proprement dite (Modification Le Croller (07/2001) 211 !------------------------------------------------------------------- 212 213 !---------------------------------------------------- 214 ! Calcul des moyennes basées sur la masse 215 !---------------------------------------------------- 216 call massbar(massem,massebx,masseby) 217 218 !----------------------------------------------------------- 219 ! Appel des sous programmes d'advection 220 !----------------------------------------------------------- 221 222 if (ok_iso_verif) then 223 write(*,*) 'advtrac 227' 224 call check_isotopes_seq(q,ip1jmp1,'advtrac 162') 225 endif !if (ok_iso_verif) then 226 227 do iq=1,nqperes 228 ! call clock(t_initial) 229 iadv = tracers(iq)%iadv 230 SELECT CASE(iadv) 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 #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(ok_iso_verif) THEN 218 WRITE(*,*) 'advtrac 227' 219 CALL check_isotopes_seq(q,ip1jmp1,'advtrac 162') 220 END IF 221 222 !------------------------------------------------------------------------- 223 ! Appel des sous programmes d'advection 224 !------------------------------------------------------------------------- 225 DO iq = 1, nqtot 226 ! CALL clock(t_initial) 227 IF(tracers(iq)%parent /= 'air') CYCLE 228 iadv = tracers(iq)%iadv 229 !----------------------------------------------------------------------- 230 SELECT CASE(iadv) 231 !----------------------------------------------------------------------- 231 232 CASE(0); CYCLE 232 CASE(10) 233 ! ---------------------------------------------------------------- 234 ! Schema de Van Leer I MUSCL 235 ! ---------------------------------------------------------------- 236 ! CRisi: on fait passer tout q pour avoir acces aux fils 237 238 !write(*,*) 'advtrac 239: iq,q(1721,19,:)=',iq,q(1721,19,:) 239 call vlsplt(q,2.,massem,wg,pbarug,pbarvg,dtvr,iq) 240 241 CASE(14) 242 ! ---------------------------------------------------------------- 243 ! Schema "pseudo amont" + test sur humidite specifique 244 ! pour la vapeur d'eau. F. Codron 245 ! ---------------------------------------------------------------- 246 ! 247 !write(*,*) 'advtrac 248: iq,q(1721,19,:)=',iq,q(1721,19,:) 248 CALL vlspltqs( q, 2., massem, wg , & 249 pbarug,pbarvg,dtvr,p,pk,teta,iq) 250 251 CASE(12) 252 ! ---------------------------------------------------------------- 253 ! Schema de Frederic Hourdin 254 ! ---------------------------------------------------------------- 255 ! Pas de temps adaptatif 256 call adaptdt(iadv,dtbon,n,pbarug,massem) 257 if (n.GT.1) then 258 write(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=', & 259 dtvr,'n=',n 260 endif 261 do indice=1,n 262 call advn(q(1,1,iq),massem,wg,pbarug,pbarvg,dtbon,1) 263 end do 264 CASE(13) 265 ! Pas de temps adaptatif 266 call adaptdt(iadv,dtbon,n,pbarug,massem) 267 if (n.GT.1) then 268 write(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=', & 269 dtvr,'n=',n 270 endif 271 do indice=1,n 272 call advn(q(1,1,iq),massem,wg,pbarug,pbarvg,dtbon,2) 273 end do 274 CASE(20) 275 ! ---------------------------------------------------------------- 276 ! Schema de pente SLOPES 277 ! ---------------------------------------------------------------- 278 call pentes_ini (q(1,1,iq),wg,massem,pbarug,pbarvg,0) 279 280 CASE(30) 281 ! ---------------------------------------------------------------- 282 ! Schema de Prather 283 ! ---------------------------------------------------------------- 284 ! Pas de temps adaptatif 285 call adaptdt(iadv,dtbon,n,pbarug,massem) 286 if (n.GT.1) then 287 write(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=', & 288 dtvr,'n=',n 289 endif 290 call prather(q(1,1,iq),wg,massem,pbarug,pbarvg, & 291 n,dtbon) 292 293 CASE(11,16,17,18) 294 ! ---------------------------------------------------------------- 295 ! Schemas PPM Lin et Rood 296 ! ---------------------------------------------------------------- 297 298 ! Test sur le flux horizontal 299 ! Pas de temps adaptatif 300 call adaptdt(iadv,dtbon,n,pbarug,massem) 301 if (n.GT.1) then 302 write(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=', & 303 dtvr,'n=',n 304 endif 305 ! Test sur le flux vertical 306 CFLmaxz=0. 307 do l=2,llm 308 do ij=iip2,ip1jm 309 aaa=wg(ij,l)*dtvr/massem(ij,l) 310 CFLmaxz=max(CFLmaxz,aaa) 311 bbb=-wg(ij,l)*dtvr/massem(ij,l-1) 312 CFLmaxz=max(CFLmaxz,bbb) 313 enddo 314 enddo 315 if (CFLmaxz.GE.1) then 316 write(*,*) 'WARNING vertical','CFLmaxz=', CFLmaxz 317 endif 318 319 !----------------------------------------------------------- 320 ! Ss-prg interface LMDZ.4->PPM3d (ss-prg de Lin) 321 !----------------------------------------------------------- 322 323 call interpre(q(1,1,iq),qppm(1,1,iq),wg,fluxwppm,massem, & 324 apppm,bpppm,massebx,masseby,pbarug,pbarvg, & 325 unatppm,vnatppm,psppm) 326 327 do indice=1,n 328 !---------------------------------------------------------------- 329 ! VL (version PPM) horiz. et PPM vert. 330 !---------------------------------------------------------------- 331 SELECT CASE(iadv) 332 CASE(11) 333 call ppm3d(1,qppm(1,1,iq), & 334 psppm,psppm, & 335 unatppm,vnatppm,fluxwppm,dtbon,2,2,2,1, & 336 iim,jjp1,2,llm,apppm,bpppm,0.01,6400000, & 337 fill,dum,220.) 338 339 CASE(16) 340 !------------------------------------------------------------- 341 ! Monotonic PPM 342 !------------------------------------------------------------- 343 call ppm3d(1,qppm(1,1,iq), & 344 psppm,psppm, & 345 unatppm,vnatppm,fluxwppm,dtbon,3,3,3,1, & 346 iim,jjp1,2,llm,apppm,bpppm,0.01,6400000, & 347 fill,dum,220.) 348 !------------------------------------------------------------- 349 350 CASE(17) 351 !------------------------------------------------------------- 352 ! Semi Monotonic PPM 353 !------------------------------------------------------------- 354 call ppm3d(1,qppm(1,1,iq), & 355 psppm,psppm, & 356 unatppm,vnatppm,fluxwppm,dtbon,4,4,4,1, & 357 iim,jjp1,2,llm,apppm,bpppm,0.01,6400000, & 358 fill,dum,220.) 359 !------------------------------------------------------------- 360 361 CASE(18) 362 !------------------------------------------------------------- 363 ! Positive Definite PPM 364 !------------------------------------------------------------- 365 call ppm3d(1,qppm(1,1,iq), & 366 psppm,psppm, & 367 unatppm,vnatppm,fluxwppm,dtbon,5,5,5,1, & 368 iim,jjp1,2,llm,apppm,bpppm,0.01,6400000, & 369 fill,dum,220.) 370 !------------------------------------------------------------- 371 END SELECT 372 enddo 373 !----------------------------------------------------------------- 374 ! Ss-prg interface PPM3d-LMDZ.4 375 !----------------------------------------------------------------- 376 call interpost(q(1,1,iq),qppm(1,1,iq)) 377 END SELECT 378 !---------------------------------------------------------------------- 379 380 !----------------------------------------------------------------- 381 ! On impose une seule valeur du traceur au pôle Sud j=jjm+1=jjp1 382 ! et Nord j=1 383 !----------------------------------------------------------------- 384 385 ! call traceurpole(q(1,1,iq),massem) 386 387 ! calcul du temps cpu pour un schema donne 388 389 ! call clock(t_final) 390 !ym tps_cpu=t_final-t_initial 391 !ym cpuadv(iq)=cpuadv(iq)+tps_cpu 392 393 end DO 394 395 if (ok_iso_verif) then 396 write(*,*) 'advtrac 402' 397 call check_isotopes_seq(q,ip1jmp1,'advtrac 397') 398 endif !if (ok_iso_verif) then 399 400 !------------------------------------------------------------------ 401 ! on reinitialise a zero les flux de masse cumules 402 !--------------------------------------------------- 403 iadvtr=0 404 405 ENDIF ! if iadvtr.EQ.iapp_tracvl 233 !-------------------------------------------------------------------- 234 CASE(10) !--- Schema de Van Leer I MUSCL 235 !-------------------------------------------------------------------- 236 ! WRITE(*,*) 'advtrac 239: iq,q(1721,19,:)=',iq,q(1721,19,:) 237 CALL vlsplt(q,2.,massem,wg,pbarug,pbarvg,dtvr,iq) 238 239 !-------------------------------------------------------------------- 240 CASE(14) !--- Schema "pseuDO amont" + test sur humidite specifique 241 !--- pour la vapeur d'eau. F. Codron 242 !-------------------------------------------------------------------- 243 ! WRITE(*,*) 'advtrac 248: iq,q(1721,19,:)=',iq,q(1721,19,:) 244 CALL vlspltqs(q,2.,massem,wg,pbarug,pbarvg,dtvr,p,pk,teta,iq) 245 246 !-------------------------------------------------------------------- 247 CASE(12) !--- Schema de Frederic Hourdin 248 !-------------------------------------------------------------------- 249 CALL adaptdt(iadv,dtbon,n,pbarug,massem) ! pas de temps adaptatif 250 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 251 DO indice=1,n 252 CALL advn(q(1,1,iq),massem,wg,pbarug,pbarvg,dtbon,1) 253 END DO 254 255 !-------------------------------------------------------------------- 256 CASE(13) !--- Pas de temps adaptatif 257 !-------------------------------------------------------------------- 258 CALL adaptdt(iadv,dtbon,n,pbarug,massem) 259 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 260 DO indice=1,n 261 CALL advn(q(1,1,iq),massem,wg,pbarug,pbarvg,dtbon,2) 262 END DO 263 264 !-------------------------------------------------------------------- 265 CASE(20) !--- Schema de pente SLOPES 266 !-------------------------------------------------------------------- 267 CALL pentes_ini (q(1,1,iq),wg,massem,pbarug,pbarvg,0) 268 269 !-------------------------------------------------------------------- 270 CASE(30) !--- Schema de Prather 271 !-------------------------------------------------------------------- 272 ! Pas de temps adaptatif 273 CALL adaptdt(iadv,dtbon,n,pbarug,massem) 274 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 275 CALL prather(q(1,1,iq),wg,massem,pbarug,pbarvg,n,dtbon) 276 277 !-------------------------------------------------------------------- 278 CASE(11,16,17,18) !--- Schemas PPM Lin et Rood 279 !-------------------------------------------------------------------- 280 ! Test sur le flux horizontal 281 CALL adaptdt(iadv,dtbon,n,pbarug,massem) ! pas de temps adaptatif 282 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 283 ! Test sur le flux vertical 284 CFLmaxz=0. 285 DO l=2,llm 286 DO ij=iip2,ip1jm 287 aaa=wg(ij,l)*dtvr/massem(ij,l) 288 CFLmaxz=max(CFLmaxz,aaa) 289 bbb=-wg(ij,l)*dtvr/massem(ij,l-1) 290 CFLmaxz=max(CFLmaxz,bbb) 291 END DO 292 END DO 293 IF(CFLmaxz.GE.1) WRITE(*,*) 'WARNING vertical','CFLmaxz=', CFLmaxz 294 !---------------------------------------------------------------- 295 ! Ss-prg interface LMDZ.4->PPM3d (ss-prg de Lin) 296 !---------------------------------------------------------------- 297 CALL interpre(q(1,1,iq),qppm(1,1,iq),wg,fluxwppm,massem, & 298 apppm,bpppm,massebx,masseby,pbarug,pbarvg, & 299 unatppm,vnatppm,psppm) 300 301 !---------------------------------------------------------------- 302 DO indice=1,n !--- VL (version PPM) horiz. et PPM vert. 303 !---------------------------------------------------------------- 304 SELECT CASE(iadv) 305 !---------------------------------------------------------- 306 CASE(11) 307 !---------------------------------------------------------- 308 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 309 2,2,2,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000,fill,dum,220.) 310 !---------------------------------------------------------- 311 CASE(16) !--- Monotonic PPM 312 !---------------------------------------------------------- 313 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 314 3,3,3,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000,fill,dum,220.) 315 !---------------------------------------------------------- 316 CASE(17) !--- Semi monotonic PPM 317 !---------------------------------------------------------- 318 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 319 4,4,4,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000, fill,dum,220.) 320 !---------------------------------------------------------- 321 CASE(18) !--- Positive Definite PPM 322 !---------------------------------------------------------- 323 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 324 5,5,5,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000,fill,dum,220.) 325 END SELECT 326 !---------------------------------------------------------------- 327 END DO 328 !---------------------------------------------------------------- 329 ! Ss-prg interface PPM3d-LMDZ.4 330 !---------------------------------------------------------------- 331 CALL interpost(q(1,1,iq),qppm(1,1,iq)) 332 !---------------------------------------------------------------------- 333 END SELECT 334 !---------------------------------------------------------------------- 335 336 !---------------------------------------------------------------------- 337 ! On impose une seule valeur du traceur au pole Sud j=jjm+1=jjp1 et Nord j=1 338 !---------------------------------------------------------------------- 339 ! CALL traceurpole(q(1,1,iq),massem) 340 341 !--- Calcul du temps cpu pour un schema donne 342 ! CALL clock(t_final) 343 !ym tps_cpu=t_final-t_initial 344 !ym cpuadv(iq)=cpuadv(iq)+tps_cpu 345 346 END DO 347 348 IF(ok_iso_verif) then 349 WRITE(*,*) 'advtrac 402' 350 CALL check_isotopes_seq(q,ip1jmp1,'advtrac 397') 351 END IF 352 353 !------------------------------------------------------------------------- 354 ! on reinitialise a zero les flux de masse cumules 355 !------------------------------------------------------------------------- 356 iadvtr=0 406 357 407 358 END SUBROUTINE advtrac -
LMDZ6/trunk/libf/dyn3d/iniacademic.F90
r4052 r4056 5 5 6 6 USE filtreg_mod, ONLY: inifilr 7 USE infotrac, ONLY: nqtot, niso_possibles,ok_isotopes,ok_iso_verif,tnat,alpha_ideal, &8 & iqiso,iso_indnum, tracers7 USE infotrac, ONLY: nqtot, niso_possibles, ok_isotopes, ok_iso_verif, tnat, alpha_ideal, & 8 iqiso, tracers, iso_indnum 9 9 USE control_mod, ONLY: day_step,planet_type 10 use exner_hyb_m, only: exner_hyb 11 use exner_milieu_m, only: exner_milieu 10 12 #ifdef CPP_IOIPSL 11 13 USE IOIPSL, ONLY: getin … … 15 17 #endif 16 18 USE Write_Field 17 use exner_hyb_m, only: exner_hyb18 use exner_milieu_m, only: exner_milieu19 19 USE comconst_mod, ONLY: cpp, kappa, g, daysec, dtvr, pi, im, jm 20 20 USE logic_mod, ONLY: iflag_phys, read_start … … 62 62 real tetastrat ! potential temperature in the stratosphere, in K 63 63 real tetajl(jjp1,llm) 64 INTEGER i,j,l,lsup,ij, iq 64 INTEGER i,j,l,lsup,ij, iq, iName, iZone, iPhase, iqParent 65 65 66 66 REAL teta0,ttp,delt_y,delt_z,eps ! Constantes pour profil de T … … 71 71 72 72 real zz,ran1 73 integer idum , iqParent, iName, iZone, iPhase73 integer idum 74 74 75 75 REAL zdtvr … … 77 77 character(len=*),parameter :: modname="iniacademic" 78 78 character(len=80) :: abort_message 79 80 79 81 80 ! Sanity check: verify that options selected by user are not incompatible … … 131 130 ps(:)=preff 132 131 endif 132 133 133 ! ground geopotential 134 134 phis(:)=0. 135 135 CALL pression ( ip1jmp1, ap, bp, ps, p ) 136 136 137 if (pressure_exner) then 137 138 CALL exner_hyb( ip1jmp1, ps, p, pks, pk) … … 194 195 CALL getin('tetanoise',tetanoise) 195 196 196 197 197 ! 2. Initialize fields towards which to relax 198 198 ! Friction … … 247 247 IF (.NOT. read_start) THEN 248 248 ! bulk initialization of temperature 249 250 249 IF (iflag_phys>10000) THEN 251 250 ! Particular case to impose a constant temperature T0=0.01*iflag_physx … … 254 253 teta(:,:)=tetarappel(:,:) 255 254 ENDIF 256 257 255 ! geopotential 258 256 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) … … 287 285 iName = tracers(iq)%iso_iName 288 286 if (.NOT.ok_isotopes .OR. iName <= 0) CYCLE 289 iZone = tracers(iq)%iso_iZone290 iPhase = tracers(iq)%iso_iPhase287 iZone = tracers(iq)%iso_iZone 288 iPhase = tracers(iq)%iso_iPhase 291 289 iqParent = tracers(iq)%iqParent 292 290 if (iZone == 0) q(:,:,iq) = q(:,:,iqParent)*tnat(iName) & … … 298 296 endif ! of if (planet_type=="earth") 299 297 300 if (ok_iso_verif) then 301 call check_isotopes_seq(q,1,ip1jmp1,'iniacademic_loc') 302 endif !if (ok_iso_verif) then 298 if (ok_iso_verif) call check_isotopes_seq(q,1,ip1jmp1,'iniacademic_loc') 303 299 304 300 ! add random perturbation to temperature -
LMDZ6/trunk/libf/dyn3d_common/infotrac.F90
r4052 r4056 14 14 INTEGER, SAVE :: nbtr 15 15 16 ! CRisi: on retranche les isotopes des traceurs habituels 17 ! On fait un tableaux d'indices des traceurs qui passeront dans phytrac 16 ! Nombre de traceurs passes a phytrac 18 17 INTEGER, SAVE :: nqtottr 19 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: itr_indice20 21 ! CRisi: nb traceurs peres= directement advectes par l'air22 INTEGER, SAVE :: nqperes23 24 ! ThL: nb traceurs INCA25 INTEGER, SAVE :: nqINCA26 18 27 19 ! ThL: nb traceurs CO2 … … 31 23 TYPE(trac_type), TARGET, SAVE, ALLOCATABLE :: tracers(:) !=== TRACERS DESCRIPTORS VECTOR 32 24 TYPE(isot_type), TARGET, SAVE, ALLOCATABLE :: isotopes(:) !=== ISOTOPES PARAMETERS VECTOR 33 34 ! niadv : vector keeping the coorspondance between all tracers(nqtot) treated in the35 ! dynamic part of the code and the tracers (nbtr+2) used in the physics part of the code.36 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: niadv ! equivalent dyn / physique37 25 38 26 REAL :: qperemin,masseqmin,ratiomin ! MVals et CRisi … … 59 47 INTEGER,SAVE :: niso,ntraceurs_zone,ntraciso 60 48 61 #ifdef CPP_StratAer62 !--CK/OB for stratospheric aerosols63 INTEGER, SAVE :: nbtr_bin64 INTEGER, SAVE :: nbtr_sulgas65 INTEGER, SAVE :: id_OCS_strat66 INTEGER, SAVE :: id_SO2_strat67 INTEGER, SAVE :: id_H2SO4_strat68 INTEGER, SAVE :: id_BIN01_strat69 INTEGER, SAVE :: id_TEST_strat70 #endif71 72 49 CONTAINS 73 50 … … 120 97 LOGICAL :: continu,nouveau_traceurdef 121 98 INTEGER :: IOstatus ! gestion de la retrocompatibilite de traceur.def 122 CHARACTER(len=maxlen) :: tchaine 99 CHARACTER(len=maxlen) :: tchaine, msg1 123 100 INTEGER, ALLOCATABLE :: iqfils(:,:) 101 INTEGER :: nqINCA 124 102 125 103 character(len=*),parameter :: modname="infotrac_init" … … 142 120 descrq(30)='PRA' 143 121 144 145 ! Coherence test between parameter type_trac, config_inca and preprocessing keys 146 IF (type_trac=='inca') THEN 147 WRITE(lunout,*) 'You have chosen to couple with INCA chemistry model : type_trac=', & 148 type_trac,' config_inca=',config_inca 149 IF (config_inca/='aero' .AND. config_inca/='aeNP' .AND. config_inca/='chem') THEN 150 WRITE(lunout,*) 'Incoherence between type_trac and config_inca. Model stops. Modify run.def' 151 CALL abort_gcm('infotrac_init','Incoherence between type_trac and config_inca',1) 152 ENDIF 122 !--- MESSAGE ABOUT THE CHOSEN CONFIGURATION 123 WRITE(lunout,*)'type_trac='//TRIM(type_trac) 124 msg1 = 'For type_trac = "'//TRIM(type_trac)//'":' 125 SELECT CASE(type_trac) 126 CASE('inca'); WRITE(lunout,*)TRIM(msg1)//' coupling with INCA chemistry model, config_inca='//config_inca 127 CASE('inco'); WRITE(lunout,*)TRIM(msg1)//' coupling jointly with INCA and CO2 cycle' 128 CASE('repr'); WRITE(lunout,*)TRIM(msg1)//' coupling with REPROBUS chemistry model' 129 CASE('co2i'); WRITE(lunout,*)TRIM(msg1)//' you have chosen to run with CO2 cycle' 130 CASE('coag'); WRITE(lunout,*)TRIM(msg1)//' tracers are treated for COAGULATION tests' 131 CASE('lmdz'); WRITE(lunout,*)TRIM(msg1)//' tracers are treated in LMDZ only' 132 CASE DEFAULT 133 CALL abort_gcm(modname,'type_trac='//TRIM(type_trac)//' not possible yet.',1) 134 END SELECT 135 136 !--- COHERENCE TEST BETWEEN "type_trac", "config_inca" AND PREPROCESSING KEYS 137 SELECT CASE(type_trac) 138 CASE('inca','inco'); IF(ALL(['aero', 'aeNP', 'chem']/=config_inca)) & 139 CALL abort_gcm(modname, 'Incoherence between type_trac and config_inca. Please modify "run.def"',1) 153 140 #ifndef INCA 154 WRITE(lunout,*) 'To run this option you must add cpp key INCA and compile with INCA code' 155 CALL abort_gcm('infotrac_init','You must compile with cpp key INCA',1) 141 CALL abort_gcm(modname, 'You must add cpp key INCA and compile with INCA code',1) 156 142 #endif 157 ELSE IF (type_trac=='repr') THEN 158 WRITE(lunout,*) 'You have chosen to couple with REPROBUS chemestry model : type_trac=', type_trac 143 CASE('repr') 159 144 #ifndef REPROBUS 160 WRITE(lunout,*) 'To run this option you must add cpp key REPROBUS and compile with REPRPBUS code' 161 CALL abort_gcm('infotrac_init','You must compile with cpp key REPROBUS',1) 145 CALL abort_gcm(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code',1) 162 146 #endif 163 ELSE IF (type_trac == 'co2i') THEN 164 WRITE(lunout,*) 'You have chosen to run with CO2 cycle: type_trac=', type_trac 165 ELSE IF (type_trac == 'coag') THEN 166 WRITE(lunout,*) 'Tracers are treated for COAGULATION tests : type_trac=', type_trac 147 CASE('coag') 167 148 #ifndef CPP_StratAer 168 WRITE(lunout,*) 'To run this option you must add cpp key StratAer and compile with StratAer code' 169 CALL abort_gcm('infotrac_init','You must compile with cpp key StratAer',1) 149 CALL abort_gcm(modname, 'You must add cpp key StratAer and compile with StratAer code',1) 170 150 #endif 171 ELSE IF (type_trac == 'lmdz') THEN 172 WRITE(lunout,*) 'Tracers are treated in LMDZ only : type_trac=', type_trac 173 ELSE IF (type_trac == 'inco') THEN ! ThL 174 WRITE(lunout,*) 'Using jointly INCA and CO2 cycle: type_trac =', type_trac 175 IF (config_inca/='aero' .AND. config_inca/='aeNP' .AND. config_inca/='chem') THEN 176 WRITE(lunout,*) 'Incoherence between type_trac and config_inca. Model stops. Modify run.def' 177 CALL abort_gcm('infotrac_init','Incoherence between type_trac and config_inca',1) 178 ENDIF 179 #ifndef INCA 180 WRITE(lunout,*) 'To run this option you must add cpp key INCA and compilewith INCA code' 181 CALL abort_gcm('infotrac_init','You must compile with cpp key INCA',1) 182 #endif 183 ELSE 184 WRITE(lunout,*) 'type_trac=',type_trac,' not possible. Model stops' 185 CALL abort_gcm('infotrac_init','bad parameter',1) 186 ENDIF 187 188 ! Test if config_inca is other then none for run without INCA 189 IF (type_trac/='inca' .AND. type_trac/='inco' .AND. config_inca/='none') THEN 190 WRITE(lunout,*) 'config_inca will now be changed to none as you do not couple with INCA model' 191 config_inca='none' 192 ENDIF 151 END SELECT 152 153 !--- Disable "config_inca" option for a run without INCA if it differs from "none" 154 IF (ALL(['inca', 'inco', 'none'] /= config_inca)) THEN 155 WRITE(lunout,*)'setting config_inca="none" as you do not couple with INCA model' 156 config_inca = 'none' 157 END IF 193 158 194 159 !----------------------------------------------------------------------- … … 198 163 ! 199 164 !----------------------------------------------------------------------- 200 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag' .OR. type_trac == 'co2i') THEN 201 IF (type_trac=='co2i') THEN 202 nqCO2 = 1 203 ELSE 204 nqCO2 = 0 205 ENDIF 206 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 207 IF(ierr.EQ.0) THEN 208 WRITE(lunout,*) trim(modname),': Open traceur.def : ok' 209 READ(90,*) nqtrue 210 write(lunout,*) 'nqtrue=',nqtrue 211 ELSE 212 WRITE(lunout,*) trim(modname),': Failed opening traceur.def' 213 CALL abort_gcm(modname,"file traceur.def not found!",1) 214 ENDIF 215 !jyg< 216 !! if ( planet_type=='earth') then 217 !! ! For Earth, water vapour & liquid tracers are not in the physics 218 !! nbtr=nqtrue-2 219 !! else 220 !! ! Other planets (for now); we have the same number of tracers 221 !! ! in the dynamics than in the physics 222 !! nbtr=nqtrue 223 !! endif 224 !>jyg 225 ELSE ! type_trac=inca or inco 226 IF (type_trac=='inco') THEN 227 nqCO2 = 1 228 ELSE 229 nqCO2 = 0 230 ENDIF 231 !jyg< 232 ! The traceur.def file is used to define the number "nqo" of water phases 233 ! present in the simulation. Default : nqo = 2. 234 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 235 IF(ierr.EQ.0) THEN 236 WRITE(lunout,*) trim(modname),': Open traceur.def : ok' 237 READ(90,*) nqo 238 ELSE 239 WRITE(lunout,*) trim(modname),': Failed opening traceur.def' 240 CALL abort_gcm(modname,"file traceur.def not found!",1) 241 ENDIF 242 IF (nqo /= 2 .AND. nqo /= 3 ) THEN 243 IF (nqo == 4 .AND. type_trac=='inco') THEN ! ThL 244 WRITE(lunout,*) trim(modname),': you are coupling with INCA, and also using CO2i.' 245 nqo = 3 ! A ameliorier... je force 3 traceurs eau... ThL 246 WRITE(lunout,*) trim(modname),': nqo = ',nqo 247 ELSE 248 WRITE(lunout,*) trim(modname),': nqo=',nqo, ' is not allowed. Only 2 or 3 water phases allowed' 249 CALL abort_gcm('infotrac_init','Bad number of water phases',1) 250 ENDIF 251 ENDIF 252 ! nbtr has been read from INCA by init_const_lmdz() in gcm.F 165 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 166 IF(ierr.EQ.0) THEN 167 WRITE(lunout,*) trim(modname),': Open traceur.def : ok' 168 ELSE 169 WRITE(lunout,*) trim(modname),': Failed opening traceur.def' 170 CALL abort_gcm(modname,"file traceur.def not found!",1) 171 ENDIF 172 nqCO2 = 0; IF(type_trac == 'inco') nqCO2 = 1 173 SELECT CASE(type_trac) 174 CASE('lmdz','repr','coag','co2i'); READ(90,*) nqtrue 175 CASE('inca','inco'); READ(90,*) nqo 176 ! The traceur.def file is used to define the number "nqo" of water phases 177 ! present in the simulation. Default : nqo = 2. 178 IF (nqo == 4 .AND. type_trac=='inco') nqo = 3 179 IF(ALL([2,3] /= nqo)) THEN 180 WRITE(lunout,*) trim(modname),': nqo=',nqo, ' is not allowed. Only 2 or 3 water phases allowed' 181 CALL abort_gcm('infotrac_init','Bad number of water phases',1) 182 END IF 183 ! nbtr has been read from INCA by init_const_lmdz() in gcm.F 253 184 #ifdef INCA 254 CALL Init_chem_inca_trac(nqINCA)185 CALL Init_chem_inca_trac(nqINCA) 255 186 #else 256 nqINCA=0187 nqINCA=0 257 188 #endif 258 nbtr=nqINCA+nqCO2259 nqtrue=nbtr+nqo260 WRITE(lunout,*) trim(modname),': nqo= ',nqo261 WRITE(lunout,*) trim(modname),': nbtr= ',nbtr262 WRITE(lunout,*) trim(modname),': nqtrue = ',nqtrue263 WRITE(lunout,*) trim(modname),': nqCO2 = ',nqCO2264 WRITE(lunout,*) trim(modname),': nqINCA = ',nqINCA265 ALLOCATE(hadv_inca(nqINCA), vadv_inca(nqINCA), conv_flg_inca(nqINCA), pbl_flg_inca(nqINCA), solsym_inca(nqINCA))266 END IF ! type_trac 'inca' ou 'inco'189 nbtr=nqINCA+nqCO2 190 nqtrue=nbtr+nqo 191 WRITE(lunout,*) trim(modname),': nqo = ',nqo 192 WRITE(lunout,*) trim(modname),': nbtr = ',nbtr 193 WRITE(lunout,*) trim(modname),': nqtrue = ',nqtrue 194 WRITE(lunout,*) trim(modname),': nqCO2 = ',nqCO2 195 WRITE(lunout,*) trim(modname),': nqINCA = ',nqINCA 196 ALLOCATE(hadv_inca(nqINCA), vadv_inca(nqINCA), conv_flg_inca(nqINCA), pbl_flg_inca(nqINCA), solsym_inca(nqINCA)) 197 END SELECT 267 198 !>jyg 268 199 … … 306 237 ! Get choice of advection schema from file tracer.def or from INCA 307 238 !--------------------------------------------------------------------- 308 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag' .OR. type_trac == 'co2i') THEN 309 310 ! Continue to read tracer.def 311 DO iq=1,nqtrue 312 313 write(*,*) 'infotrac 237: iq=',iq 314 ! CRisi: ajout du nom du fluide transporteur 315 ! mais rester retro compatible 316 READ(90,'(I2,X,I2,X,A)',IOSTAT=IOstatus) hadv(iq),vadv(iq),tchaine 317 write(lunout,*) 'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq) 318 write(lunout,*) 'tchaine=',trim(tchaine) 319 write(*,*) 'infotrac 238: IOstatus=',IOstatus 320 if (IOstatus.ne.0) then 321 CALL abort_gcm('infotrac_init','Pb dans la lecture de traceur.def',1) 322 endif 323 ! Y-a-t-il 1 ou 2 noms de traceurs? -> On regarde s'il y a un 324 ! espace ou pas au milieu de la chaine. 325 continu=.true. 326 nouveau_traceurdef=.false. 327 iiq=1 328 do while (continu) 329 if (tchaine(iiq:iiq).eq.' ') then 330 nouveau_traceurdef=.true. 331 continu=.false. 332 else if (iiq.lt.LEN_TRIM(tchaine)) then 333 iiq=iiq+1 334 else 335 continu=.false. 336 endif 337 enddo 338 write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef 339 if (nouveau_traceurdef) then 340 write(lunout,*) 'C''est la nouvelle version de traceur.def' 341 tnom_0(iq)=TRIM(tchaine(1:iiq-1)) 342 tnom_transp(iq)=TRIM(tchaine(iiq+1:)) 343 else 344 write(lunout,*) 'C''est l''ancienne version de traceur.def' 345 write(lunout,*) 'On suppose que les traceurs sont tous d''air' 346 tnom_0(iq)=tchaine 347 tnom_transp(iq) = 'air' 348 endif 349 write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>' 350 write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>' 351 352 ENDDO!DO iq=1,nqtrue 353 354 CLOSE(90) 239 IF (ANY(['lmdz', 'repr', 'coag', 'co2i'] == type_trac)) THEN 240 241 ! Continue to read tracer.def 242 DO iq=1,nqtrue 243 244 write(*,*) 'infotrac 237: iq=',iq 245 ! CRisi: ajout du nom du fluide transporteur 246 ! mais rester retro compatible 247 READ(90,'(I2,X,I2,X,A)',IOSTAT=IOstatus) hadv(iq),vadv(iq),tchaine 248 write(lunout,*) 'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq) 249 write(lunout,*) 'tchaine=',trim(tchaine) 250 write(*,*) 'infotrac 238: IOstatus=',IOstatus 251 if (IOstatus.ne.0) CALL abort_gcm('infotrac_init','Pb dans la lecture de traceur.def',1) 252 ! Y-a-t-il 1 ou 2 noms de traceurs separes par un espace ? 253 iiq = INDEX(tchaine(1:LEN_TRIM(tchaine)),' ') 254 nouveau_traceurdef=iiq/=0 255 write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef 256 if (nouveau_traceurdef) then 257 IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def" 258 tnom_0 (iq) = tchaine(1:iiq-1) 259 tnom_transp(iq) = tchaine(iiq+1:) 260 else 261 IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def: traceurs d'air uniquement" 262 tnom_0 (iq) = tchaine 263 tnom_transp(iq) = 'air' 264 endif 265 write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>' 266 write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>' 267 ENDDO!DO iq=1,nqtrue 268 269 CLOSE(90) 355 270 356 271 WRITE(lunout,*) trim(modname),': Valeur de traceur.def :' … … 362 277 IF ( planet_type=='earth') THEN 363 278 !CR: nombre de traceurs de l eau 364 IF (tnom_0(3) == 'H2Oi') THEN 365 nqo=3 366 ELSE 367 nqo=2 368 ENDIF 279 nqo=2; IF (tnom_0(3) == 'H2Oi') nqo=3 369 280 ! For Earth, water vapour & liquid tracers are not in the physics 370 281 nbtr=nqtrue-nqo … … 375 286 ENDIF 376 287 377 #ifdef CPP_StratAer 378 IF (type_trac == 'coag') THEN 379 nbtr_bin=0 380 nbtr_sulgas=0 381 DO iq=1,nqtrue 382 IF (tnom_0(iq)(1:3)=='BIN') THEN !check if tracer name contains 'BIN' 383 nbtr_bin=nbtr_bin+1 384 ENDIF 385 IF (tnom_0(iq)(1:3)=='GAS') THEN !check if tracer name contains 'GAS' 386 nbtr_sulgas=nbtr_sulgas+1 387 ENDIF 388 ENDDO 389 print*,'nbtr_bin=',nbtr_bin 390 print*,'nbtr_sulgas=',nbtr_sulgas 391 DO iq=1,nqtrue 392 IF (tnom_0(iq)=='GASOCS') THEN 393 id_OCS_strat=iq-nqo 394 ENDIF 395 IF (tnom_0(iq)=='GASSO2') THEN 396 id_SO2_strat=iq-nqo 397 ENDIF 398 IF (tnom_0(iq)=='GASH2SO4') THEN 399 id_H2SO4_strat=iq-nqo 400 ENDIF 401 IF (tnom_0(iq)=='BIN01') THEN 402 id_BIN01_strat=iq-nqo 403 ENDIF 404 IF (tnom_0(iq)=='GASTEST') THEN 405 id_TEST_strat=iq-nqo 406 ENDIF 407 ENDDO 408 print*,'id_OCS_strat =',id_OCS_strat 409 print*,'id_SO2_strat =',id_SO2_strat 410 print*,'id_H2SO4_strat=',id_H2SO4_strat 411 print*,'id_BIN01_strat=',id_BIN01_strat 412 ENDIF 288 ENDIF 289 !jyg< 290 ! 291 292 ! Transfert number of tracers to Reprobus 293 #ifdef REPROBUS 294 IF (type_trac == 'repr') CALL Init_chem_rep_trac(nbtr,nqo,tnom_0) 413 295 #endif 414 415 ENDIF ! (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac = 'coag' .OR. type_trac = 'co2i')416 !jyg<417 !418 419 ! Transfert number of tracers to Reprobus420 IF (type_trac == 'repr') THEN421 #ifdef REPROBUS422 CALL Init_chem_rep_trac(nbtr,nqo,tnom_0)423 #endif424 ENDIF425 296 ! 426 297 ! Allocate variables depending on nbtr … … 432 303 IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN ! config_inca='aero' ou 'chem' 433 304 !>jyg 434 ! le module de chimie fournit les noms des traceurs 435 ! et les schemas d'advection associes. excepte pour ceux lus 436 ! dans traceur.def 437 438 DO iq=1,nqo+nqCO2 439 440 write(*,*) 'infotrac 237: iq=',iq 441 ! CRisi: ajout du nom du fluide transporteur 442 ! mais rester retro compatible 443 READ(90,'(I2,X,I2,X,A)',IOSTAT=IOstatus) hadv(iq),vadv(iq),tchaine 444 write(lunout,*) 'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq) 445 write(lunout,*) 'tchaine=',trim(tchaine) 446 write(*,*) 'infotrac 238: IOstatus=',IOstatus 447 if (IOstatus.ne.0) then 448 CALL abort_gcm('infotrac_init','Pb dans la lecture de traceur.def',1) 449 endif 450 ! Y-a-t-il 1 ou 2 noms de traceurs? -> On regarde s'il y a un 451 ! espace ou pas au milieu de la chaine. 452 continu=.true. 453 nouveau_traceurdef=.false. 454 iiq=1 455 456 do while (continu) 457 if (tchaine(iiq:iiq).eq.' ') then 458 nouveau_traceurdef=.true. 459 continu=.false. 460 else if (iiq.lt.LEN_TRIM(tchaine)) then 461 iiq=iiq+1 462 else 463 continu=.false. 464 endif 465 enddo 466 467 write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef 468 469 if (nouveau_traceurdef) then 470 write(lunout,*) 'C''est la nouvelle version de traceur.def' 471 tnom_0(iq)=tchaine(1:iiq-1) 472 tnom_transp(iq)=tchaine(iiq+1:) 473 else 474 write(lunout,*) 'C''est l''ancienne version de traceur.def' 475 write(lunout,*) 'On suppose que les traceurs sont tous d''air' 476 tnom_0(iq)=tchaine 477 tnom_transp(iq) = 'air' 478 endif 479 480 write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>' 481 write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>' 482 483 ENDDO !DO iq=1,nqo 484 CLOSE(90) 485 486 305 ! le module de chimie fournit les noms des traceurs et les schemas d'advection associes. 306 ! excepte pour ceux lus dans traceur.def 307 487 308 #ifdef INCA 488 CALL init_transport( & 489 hadv_inca, & 490 vadv_inca, & 491 conv_flg_inca, & 492 pbl_flg_inca, & 493 solsym_inca) 494 495 conv_flg(1+nqCO2:nbtr) = conv_flg_inca 496 pbl_flg(1+nqCO2:nbtr) = pbl_flg_inca 497 solsym(1+nqCO2:nbtr) = solsym_inca 498 499 IF (type_trac == 'inco') THEN 500 conv_flg(1:nqCO2) = 1 501 pbl_flg(1:nqCO2) = 1 502 solsym(1:nqCO2) = 'CO2' 503 ENDIF 309 CALL init_transport(hadv_inca, vadv_inca, conv_flg_inca, pbl_flg_inca, solsym_inca) 310 ! DC passive CO2 tracer is at index 1: H2O was removed ; nqCO2/=0 in "inco" case only 311 conv_flg(1:nqCO2) = 1; conv_flg(1+nqCO2:nbtr) = conv_flg_inca 312 pbl_flg(1:nqCO2) = 1; pbl_flg(1+nqCO2:nbtr) = pbl_flg_inca 313 solsym(1:nqCO2) = 'CO2'; solsym(1+nqCO2:nbtr) = solsym_inca 504 314 #endif 505 315 506 !jyg< 507 DO iq = nqo+nqCO2+1, nqtrue 508 hadv(iq) = hadv_inca(iq-nqo-nqCO2) 509 vadv(iq) = vadv_inca(iq-nqo-nqCO2) 510 tnom_0(iq)=solsym_inca(iq-nqo-nqCO2) 511 tnom_transp(iq) = 'air' 316 itr = 0 317 DO iq = 1, nqtot 318 IF(iq > nqo+nqCO2) THEN 319 itr = itr+1 320 hadv (iq) = hadv_inca (itr) 321 vadv (iq) = vadv_inca (itr) 322 tnom_0(iq) = solsym_inca(itr) 323 tnom_transp(iq) = 'air' 324 CYCLE 325 END IF 326 write(*,*) 'infotrac 237: iq=',iq 327 ! CRisi: ajout du nom du fluide transporteur en restant retro-compatible 328 READ(90,'(I2,X,I2,X,A)',IOSTAT=IOstatus) hadv(iq),vadv(iq),tchaine 329 write(lunout,*) 'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq) 330 write(lunout,*) 'tchaine=',trim(tchaine) 331 write(*,*) 'infotrac 238: IOstatus=',IOstatus 332 if (IOstatus.ne.0) CALL abort_gcm('infotrac_init','Pb dans la lecture de traceur.def',1) 333 ! Y-a-t-il 1 ou 2 noms de traceurs separes par un espace ? 334 iiq = INDEX(tchaine(1:LEN_TRIM(tchaine)),' ') 335 nouveau_traceurdef=iiq/=0 336 write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef 337 if (nouveau_traceurdef) then 338 IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def" 339 tnom_0 (iq) = tchaine(1:iiq-1) 340 tnom_transp(iq) = tchaine(iiq+1:) 341 else 342 IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def: traceurs d'air uniquement" 343 tnom_0 (iq) = tchaine 344 tnom_transp(iq) = 'air' 345 endif 346 write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>' 347 write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>' 512 348 END DO 513 349 CLOSE(90) 514 350 ENDIF ! (type_trac == 'inca' or 'inco') 515 351 … … 554 390 ! 555 391 ALLOCATE(tracers(nqtot)) 556 ALLOCATE(niadv(nqtot))557 392 558 393 !----------------------------------------------------------------------- … … 604 439 END DO 605 440 606 ! 607 ! Find vector keeping the correspodence between true and total tracers 608 ! 609 niadv(:)=0 610 iiq=0 441 WRITE(lunout,*) trim(modname),': Information stored in infotrac :' 442 WRITE(lunout,*) trim(modname),': iadv name long_name :' 443 611 444 DO iq=1,nqtot 612 IF(tracers(iq)%iadv.GE.0) THEN 613 ! True tracer 614 iiq=iiq+1 615 niadv(iiq)=iq 616 ENDIF 617 END DO 618 619 620 WRITE(lunout,*) trim(modname),': Information stored in infotrac :' 621 WRITE(lunout,*) trim(modname),': iadv niadv name long_name :' 622 623 DO iq=1,nqtot 624 WRITE(lunout,*) tracers(iq)%iadv,niadv(iq), ' ',trim(tracers(iq)%name),' ',trim(tracers(iq)%longName) 445 WRITE(lunout,*) tracers(iq)%iadv,' ',trim(tracers(iq)%name),' ',trim(tracers(iq)%longName) 625 446 END DO 626 447 … … 645 466 ! + verifier que tous les peres sont ecrits en premieres positions 646 467 ALLOCATE(iqfils(nqtot,nqtot)) 647 nqperes=0648 468 iqfils(:,:)=0 649 469 tracers(:)%iqParent=0 … … 652 472 ! ceci est un traceur pere 653 473 WRITE(lunout,*) 'Le traceur',iq,', appele ',trim(tnom_0(iq)),', est un pere' 654 nqperes=nqperes+1655 474 tracers(iq)%iqParent=0 656 475 else !if (tnom_transp(iq) == 'air') then … … 682 501 endif !if (tnom_transp(iq) == 'air') then 683 502 enddo !DO iq=1,nqtot 684 WRITE(lunout,*) 'infotrac: nq peres=',nqperes503 WRITE(lunout,*) 'infotrac: nqGen0=',COUNT(tracers(:)%parent == 'air') 685 504 WRITE(lunout,*) 'nqChilds=',tracers(:)%nqChilds 686 505 WRITE(lunout,*) 'iqParent=',tracers(:)%iqParent … … 738 557 tracers(:)%isH2Ofamily = [(tracers(iq)%gen0Name(1:3) == 'H2O', iq=1, nqtot)] 739 558 740 741 559 ! detecter quels sont les traceurs isotopiques parmi des traceurs 742 560 call infotrac_isoinit(tnom_0,nqtrue) … … 754 572 write(lunout,*) 'infotrac 704: nqtottr,nqtot,nqo=',nqtottr,nqtot,nqo 755 573 ! Rq: nqtottr n'est pas forcement egal a nbtr dans le cas ou new_iq /= nqtrue 756 ALLOCATE (itr_indice(nqtottr)) 757 itr_indice(:)=0 758 itr=0 759 do iq=nqo+1, nqtot 760 if (tracers(iq)%iso_iName.eq.0) then 761 itr=itr+1 762 write(*,*) 'itr=',itr 763 itr_indice(itr)=iq 764 endif !if (tracers(iq)%iso_iName.eq.0) then 765 enddo 766 if (itr.ne.nqtottr) then 574 if (COUNT(tracers(:)%iso_iName == 0) /= nqtottr) & 767 575 CALL abort_gcm('infotrac_init','pb dans le calcul de nqtottr',1) 768 endif769 write(lunout,*) 'itr_indice=',itr_indice770 576 ! endif !if (ntraciso.gt.0) then 771 577 -
LMDZ6/trunk/libf/dyn3dmem/advtrac_loc.F90
r4055 r4056 1 ! 2 ! $Id$ 3 ! 4 c 5 c 1 6 2 #define DEBUG_IO 7 3 #undef DEBUG_IO 8 SUBROUTINE advtrac_loc(pbarug,pbarvg ,wg, 9 * p, massem,q,teta, 10 * pk ) 11 12 c Auteur : F. Hourdin 13 c 14 c Modif. P. Le Van (20/12/97) 15 c F. Codron (10/99) 16 c D. Le Croller (07/2001) 17 c M.A Filiberti (04/2002) 18 c 19 USE parallel_lmdz 20 USE Write_Field_loc 21 USE Write_Field 22 USE Bands 23 USE mod_hallo 24 USE Vampir 25 USE times 26 USE infotrac, ONLY: nqtot, tracers, ok_iso_verif 27 USE control_mod, ONLY: iapp_tracvl, day_step, planet_type 28 USE advtrac_mod, ONLY: finmasse 29 USE comconst_mod, ONLY: dtvr 30 IMPLICIT NONE 31 c 32 include "dimensions.h" 33 include "paramet.h" 34 include "comdissip.h" 35 include "comgeom2.h" 36 include "description.h" 37 38 c------------------------------------------------------------------- 39 c Arguments 40 c------------------------------------------------------------------- 41 c Ajout PPM 42 c-------------------------------------------------------- 43 REAL massebx(ijb_u:ije_u,llm),masseby(ijb_v:ije_v,llm) 44 c-------------------------------------------------------- 45 INTEGER iapptrac 46 REAL pbarug(ijb_u:ije_u,llm),pbarvg(ijb_v:ije_v,llm) 47 REAL wg(ijb_u:ije_u,llm) 48 REAL q(ijb_u:ije_u,llm,nqtot),massem(ijb_u:ije_u,llm) 49 REAL p( ijb_u:ije_u,llmp1 ),teta(ijb_u:ije_u,llm) 50 REAL pk(ijb_u:ije_u,llm) 51 52 c------------------------------------------------------------- 53 c Variables locales 54 c------------------------------------------------------------- 55 56 REAL zdp(ijb_u:ije_u) 57 REAL (kind=kind(1.d0)) :: t_initial, t_final, tps_cpu 58 INTEGER,SAVE :: iadvtr=0 59 c$OMP THREADPRIVATE(iadvtr) 60 INTEGER ij,l,iq,iiq 61 REAL zdpmin, zdpmax 62 c---------------------------------------------------------- 63 c Rajouts pour PPM 64 c---------------------------------------------------------- 65 INTEGER indice,n 66 REAL dtbon ! Pas de temps adaptatif pour que CFL<1 67 REAL CFLmaxz,aaa,bbb ! CFL maximum 68 REAL psppm(iim,jjb_u:jje_u) ! pression au sol 69 REAL unatppm(iim,jjb_u:jje_u,llm),vnatppm(iim,jjb_u:jje_u,llm) 70 REAL qppm(iim*jjnb_u,llm,nqtot) 71 REAL fluxwppm(iim,jjb_u:jje_u,llm) 72 REAL apppm(llmp1), bpppm(llmp1) 73 LOGICAL dum,fill 74 DATA fill/.true./ 75 DATA dum/.true./ 76 integer ijb,ije,ijbu,ijbv,ijeu,ijev,j, iadv 77 type(Request),SAVE :: testRequest 4 SUBROUTINE advtrac_loc(pbarug, pbarvg, wg, p, massem, q, teta, pk) 5 ! Auteur : F. Hourdin 6 ! 7 ! Modif. P. Le Van (20/12/97) 8 ! F. Codron (10/99) 9 ! D. Le Croller (07/2001) 10 ! M.A Filiberti (04/2002) 11 ! 12 USE infotrac, ONLY: nqtot, tracers,ok_iso_verif 13 USE control_mod, ONLY: iapp_tracvl, day_step, planet_type 14 USE comconst_mod, ONLY: dtvr 15 USE parallel_lmdz 16 USE Write_Field_loc 17 USE Write_Field 18 USE Bands 19 USE mod_hallo 20 USE Vampir 21 USE times 22 USE advtrac_mod, ONLY: finmasse 23 24 IMPLICIT NONE 25 ! 26 include "dimensions.h" 27 include "paramet.h" 28 include "comdissip.h" 29 include "comgeom2.h" 30 include "description.h" 31 ! include "iniprint.h" 32 33 !--------------------------------------------------------------------------- 34 ! Arguments 35 !--------------------------------------------------------------------------- 36 REAL, INTENT(IN) :: pbarug(ijb_u:ije_u,llm) 37 REAL, INTENT(IN) :: pbarvg(ijb_v:ije_v,llm) 38 REAL, INTENT(IN) :: wg(ijb_u:ije_u,llm) 39 REAL, INTENT(IN) :: p(ijb_u:ije_u,llmp1) 40 REAL, INTENT(IN) :: massem(ijb_u:ije_u,llm) 41 REAL, INTENT(INOUT) :: q(ijb_u:ije_u,llm,nqtot) 42 REAL, INTENT(IN) :: teta(ijb_u:ije_u,llm) 43 REAL, INTENT(IN) :: pk(ijb_u:ije_u,llm) 44 !--------------------------------------------------------------------------- 45 ! Ajout PPM 46 !--------------------------------------------------------------------------- 47 REAL :: massebx(ijb_u:ije_u,llm), masseby(ijb_v:ije_v,llm) 48 !--------------------------------------------------------------------------- 49 ! Variables locales 50 !--------------------------------------------------------------------------- 51 INTEGER :: ij, l, iq, iiq, iadv 52 REAL(KIND=KIND(1.d0)) :: t_initial, t_final, tps_cpu 53 REAL :: zdp(ijb_u:ije_u), zdpmin, zdpmax 54 INTEGER, SAVE :: iadvtr=0 55 !$OMP THREADPRIVATE(iadvtr) 56 EXTERNAL minmax 57 58 !--------------------------------------------------------------------------- 59 ! Rajouts pour PPM 60 !--------------------------------------------------------------------------- 61 INTEGER :: indice, n 62 REAL :: dtbon ! Pas de temps adaptatif pour que CFL<1 63 REAL :: CFLmaxz, aaa, bbb ! CFL maximum 64 REAL, DIMENSION(iim,jjb_u:jje_u,llm) :: unatppm, vnatppm, fluxwppm 65 REAL :: qppm(iim*jjnb_u,llm,nqtot) 66 REAL :: psppm(iim,jjb_u:jje_u) ! pression au sol 67 REAL, DIMENSION(llmp1) :: apppm, bpppm 68 LOGICAL, SAVE :: dum=.TRUE., fill=.TRUE. 69 INTEGER :: ijb, ije, ijbu, ijbv, ijeu, ijev, j 70 TYPE(Request),SAVE :: testRequest 78 71 !$OMP THREADPRIVATE(testRequest) 79 72 80 c test sur l''eventuelle creation de valeurs negatives de la masse 81 ijb=ij_begin 82 ije=ij_end 83 if (pole_nord) ijb=ij_begin+iip1 84 if (pole_sud) ije=ij_end-iip1 85 86 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 87 DO l=1,llm-1 88 DO ij = ijb+1,ije 89 zdp(ij) = pbarug(ij-1,l) - pbarug(ij,l) 90 s - pbarvg(ij-iip1,l) + pbarvg(ij,l) 91 s + wg(ij,l+1) - wg(ij,l) 92 ENDDO 93 94 c CALL SCOPY( jjm -1 ,zdp(iip1+iip1),iip1,zdp(iip2),iip1 ) 95 c ym ---> pourquoi jjm-1 et non jjm ? a cause du pole ? 96 97 do ij=ijb,ije-iip1+1,iip1 98 zdp(ij)=zdp(ij+iip1-1) 99 enddo 100 101 DO ij = ijb,ije 102 zdp(ij)= zdp(ij)*dtvr/ massem(ij,l) 103 ENDDO 104 105 106 c CALL minmax ( ip1jm-iip1, zdp(iip2), zdpmin,zdpmax ) 107 c ym ---> eventuellement a revoir 108 CALL minmax ( ije-ijb+1, zdp(ijb), zdpmin,zdpmax ) 109 110 IF(MAX(ABS(zdpmin),ABS(zdpmax)).GT.0.5) THEN 111 PRINT*,'WARNING DP/P l=',l,' MIN:',zdpmin, 112 s ' MAX:', zdpmax 113 ENDIF 114 115 ENDDO 116 c$OMP END DO NOWAIT 117 118 c------------------------------------------------------------------- 119 c Advection proprement dite (Modification Le Croller (07/2001) 120 c------------------------------------------------------------------- 121 122 c---------------------------------------------------- 123 c Calcul des moyennes basées sur la masse 124 c---------------------------------------------------- 125 126 cym ----> Normalement, inutile pour les schémas classiques 127 cym ----> Revérifier lors de la parallélisation des autres schemas 128 129 cym call massbar_p(massem,massebx,masseby) 73 ! Test sur l'eventuelle creation de valeurs negatives de la masse 74 ijb = ij_begin; IF(pole_nord) ijb = ij_begin+iip1 75 ije = ij_end; IF(pole_sud) ije = ij_end-iip1 76 77 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 78 DO l=1,llm-1 79 DO ij = ijb+1,ije 80 zdp(ij) = pbarug(ij-1,l) - pbarug(ij,l) & 81 - pbarvg(ij-iip1,l) + pbarvg(ij,l) & 82 + wg(ij,l+1) - wg(ij,l) 83 END DO 84 ! ym ---> pourquoi jjm-1 et non jjm ? a cause du pole ? 85 ! CALL SCOPY( jjm -1 ,zdp(iip1+iip1),iip1,zdp(iip2),iip1 ) 86 DO ij = ijb,ije-iip1+1,iip1 87 zdp(ij)=zdp(ij+iip1-1) 88 END DO 89 DO ij = ijb,ije 90 zdp(ij)= zdp(ij)*dtvr/ massem(ij,l) 91 END DO 92 ! CALL minmax ( ip1jm-iip1, zdp(iip2), zdpmin,zdpmax ) 93 ! ym ---> eventuellement a revoir 94 CALL minmax( ije-ijb+1, zdp(ijb), zdpmin,zdpmax ) 95 IF(MAX(ABS(zdpmin),ABS(zdpmax)) >0.5) & 96 WRITE(*,*)'WARNING DP/P l=',l,' MIN:',zdpmin,' MAX:', zdpmax 97 END DO 98 !$OMP END DO NOWAIT 99 100 !--------------------------------------------------------------------------- 101 ! Advection proprement dite (Modification Le Croller (07/2001) 102 !--------------------------------------------------------------------------- 103 104 !--------------------------------------------------------------------------- 105 ! Calcul des moyennes basees sur la masse 106 !--------------------------------------------------------------------------- 107 !ym CALL massbar_p(massem,massebx,masseby) 108 !ym ----> Normalement, inutile pour les schémas classiques 109 !ym ----> Revérifier lors de la parallélisation des autres schemas 130 110 131 111 #ifdef DEBUG_IO 132 CALL WriteField_u('massem',massem) 133 CALL WriteField_u('wg',wg) 134 CALL WriteField_u('pbarug',pbarug) 135 CALL WriteField_v('pbarvg',pbarvg) 136 CALL WriteField_u('p_tmp',p) 137 CALL WriteField_u('pk_tmp',pk) 138 CALL WriteField_u('teta_tmp',teta) 139 do j=1,nqtot 140 call WriteField_u('q_adv'//trim(int2str(j)), 141 . q(:,:,j)) 142 enddo 112 CALL WriteField_u('massem',massem) 113 CALL WriteField_u('wg',wg) 114 CALL WriteField_u('pbarug',pbarug) 115 CALL WriteField_v('pbarvg',pbarvg) 116 CALL WriteField_u('p_tmp',p) 117 CALL WriteField_u('pk_tmp',pk) 118 CALL WriteField_u('teta_tmp',teta) 119 DO iq=1,nqtot 120 CALL WriteField_u('q_adv'//trim(int2str(iq)),q(:,:,iq)) 121 END DO 143 122 #endif 144 123 145 124 ! 146 ! call Register_Hallo_v(pbarvg,llm,1,1,1,1,TestRequest) 147 ! 148 ! call SendRequest(TestRequest) 149 !c$OMP BARRIER 150 ! call WaitRequest(TestRequest) 151 c$OMP BARRIER 125 ! CALL Register_Hallo_v(pbarvg,llm,1,1,1,1,TestRequest) 126 ! CALL SendRequest(TestRequest) 127 !!$OMP BARRIER 128 ! CALL WaitRequest(TestRequest) 129 !$OMP BARRIER 152 130 153 !write(*,*) 'advtrac 157: appel de vlspltgen_loc' 154 call vlspltgen_loc( q, 2., massem, wg,pbarug,pbarvg,dtvr,p, 155 * pk,teta ) 131 ! WRITE(*,*) 'advtrac 157: appel de vlspltgen_loc' 132 CALL vlspltgen_loc(q, tracers(:)%iadv, 2., massem, wg, pbarug, pbarvg, dtvr, p, pk, teta ) 156 133 157 134 #ifdef DEBUG_IO 158 do j=1,nqtot 159 call WriteField_u('q_adv'//trim(int2str(j)), 160 . q(:,:,j)) 161 enddo 135 DO iq = 1, nqtot 136 CALL WriteField_u('q_adv'//trim(int2str(iq)),q(:,:,iq)) 137 END DO 162 138 #endif 163 139 164 GOTO 1234 165 c----------------------------------------------------------- 166 c Appel des sous programmes d'advection 167 c----------------------------------------------------------- 168 do iq=1,nqtot 169 c call clock(t_initial) 170 iadv = tracers(iq)%iadv 171 SELECT CASE(iadv) 172 CASE(0); CYCLE 173 CASE(10) 174 c ---------------------------------------------------------------- 175 c Schema de Van Leer I MUSCL 176 c ---------------------------------------------------------------- 177 178 !LF call vlsplt_p(q(1,1,iq),2.,massem,wg,pbarug,pbarvg,dtvr) 179 180 CASE(14) 181 c ---------------------------------------------------------------- 182 c Schema "pseudo amont" + test sur humidite specifique 183 C pour la vapeur d'eau. F. Codron 184 c ---------------------------------------------------------------- 185 c 186 cym stop 'advtrac : appel à vlspltqs :schema non parallelise' 187 !LF CALL vlspltqs_p( q(1,1,1), 2., massem, wg , 188 !LF * pbarug,pbarvg,dtvr,p,pk,teta ) 189 CASE(12) 190 c ---------------------------------------------------------------- 191 c Schema de Frederic Hourdin 192 c ---------------------------------------------------------------- 193 stop 'advtrac : schema non parallelise' 194 c Pas de temps adaptatif 195 call adaptdt(iadv,dtbon,n,pbarug,massem) 196 if (n.GT.1) then 197 write(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=', 198 s dtvr,'n=',n 199 endif 200 do indice=1,n 201 call advn(q(1,1,iq),massem,wg,pbarug,pbarvg,dtbon,1) 202 end do 203 CASE(13) 204 stop 'advtrac : schema non parallelise' 205 c Pas de temps adaptatif 206 call adaptdt(iadv,dtbon,n,pbarug,massem) 207 if (n.GT.1) then 208 write(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=', 209 s dtvr,'n=',n 210 endif 211 do indice=1,n 212 call advn(q(1,1,iq),massem,wg,pbarug,pbarvg,dtbon,2) 213 end do 214 CASE(20) 215 c ---------------------------------------------------------------- 216 c Schema de pente SLOPES 217 c ---------------------------------------------------------------- 218 stop 'advtrac : schema non parallelise' 219 220 call pentes_ini (q(1,1,iq),wg,massem,pbarug,pbarvg,0) 221 222 CASE(30) 223 c ---------------------------------------------------------------- 224 c Schema de Prather 225 c ---------------------------------------------------------------- 226 stop 'advtrac : schema non parallelise' 227 c Pas de temps adaptatif 228 call adaptdt(iadv,dtbon,n,pbarug,massem) 229 if (n.GT.1) then 230 write(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=', 231 s dtvr,'n=',n 232 endif 233 call prather(q(1,1,iq),wg,massem,pbarug,pbarvg, 234 s n,dtbon) 235 CASE(11,16,17,18) 236 c ---------------------------------------------------------------- 237 c Schemas PPM Lin et Rood 238 c ---------------------------------------------------------------- 239 240 stop 'advtrac : schema non parallelise' 241 242 c Test sur le flux horizontal 243 c Pas de temps adaptatif 244 call adaptdt(iadv,dtbon,n,pbarug,massem) 245 if (n.GT.1) then 246 write(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=', 247 s dtvr,'n=',n 248 endif 249 c Test sur le flux vertical 250 CFLmaxz=0. 251 do l=2,llm 252 do ij=iip2,ip1jm 253 aaa=wg(ij,l)*dtvr/massem(ij,l) 254 CFLmaxz=max(CFLmaxz,aaa) 255 bbb=-wg(ij,l)*dtvr/massem(ij,l-1) 256 CFLmaxz=max(CFLmaxz,bbb) 257 enddo 258 enddo 259 if (CFLmaxz.GE.1) then 260 write(*,*) 'WARNING vertical','CFLmaxz=', CFLmaxz 261 endif 262 263 c----------------------------------------------------------- 264 c Ss-prg interface LMDZ.4->PPM3d 265 c----------------------------------------------------------- 266 267 call interpre(q(1,1,iq),qppm(1,1,iq),wg,fluxwppm,massem, 268 s apppm,bpppm,massebx,masseby,pbarug,pbarvg, 269 s unatppm,vnatppm,psppm) 270 271 do indice=1,n 272 c--------------------------------------------------------------------- 273 c VL (version PPM) horiz. et PPM vert. 274 c--------------------------------------------------------------------- 275 SELECT CASE(iadv) 276 CASE(11) 277 c Ss-prg PPM3d de Lin 278 call ppm3d(1,qppm(1,1,iq), 279 s psppm,psppm, 280 s unatppm,vnatppm,fluxwppm,dtbon,2,2,2,1, 281 s iim,jjp1,2,llm,apppm,bpppm,0.01,6400000, 282 s fill,dum,220.) 283 284 CASE(16) 285 c---------------------------------------------------------------------- 286 c Monotonic PPM 287 c---------------------------------------------------------------------- 288 c Ss-prg PPM3d de Lin 289 call ppm3d(1,qppm(1,1,iq), 290 s psppm,psppm, 291 s unatppm,vnatppm,fluxwppm,dtbon,3,3,3,1, 292 s iim,jjp1,2,llm,apppm,bpppm,0.01,6400000, 293 s fill,dum,220.) 294 c--------------------------------------------------------------------- 295 296 CASE(17) 297 c--------------------------------------------------------------------- 298 c Semi Monotonic PPM 299 c--------------------------------------------------------------------- 300 c Ss-prg PPM3d de Lin 301 call ppm3d(1,qppm(1,1,iq), 302 s psppm,psppm, 303 s unatppm,vnatppm,fluxwppm,dtbon,4,4,4,1, 304 s iim,jjp1,2,llm,apppm,bpppm,0.01,6400000, 305 s fill,dum,220.) 306 c--------------------------------------------------------------------- 307 308 CASE(18) 309 c--------------------------------------------------------------------- 310 c Positive Definite PPM 311 c--------------------------------------------------------------------- 312 c Ss-prg PPM3d de Lin 313 call ppm3d(1,qppm(1,1,iq), 314 s psppm,psppm, 315 s unatppm,vnatppm,fluxwppm,dtbon,5,5,5,1, 316 s iim,jjp1,2,llm,apppm,bpppm,0.01,6400000, 317 s fill,dum,220.) 318 c--------------------------------------------------------------------- 319 END SELECT 320 enddo 321 c----------------------------------------------------------------- 322 c Ss-prg interface PPM3d-LMDZ.4 323 c----------------------------------------------------------------- 324 call interpost(q(1,1,iq),qppm(1,1,iq)) 325 END SELECT 326 c---------------------------------------------------------------------- 327 328 c----------------------------------------------------------------- 329 c On impose une seule valeur du traceur au pôle Sud j=jjm+1=jjp1 330 c et Nord j=1 331 c----------------------------------------------------------------- 332 333 c call traceurpole(q(1,1,iq),massem) 334 335 c calcul du temps cpu pour un schema donne 336 337 338 end DO 339 340 1234 CONTINUE 341 c$OMP BARRIER 342 343 if (planet_type=="earth") then 344 140 GOTO 1234 141 !------------------------------------------------------------------------- 142 ! Appel des sous programmes d'advection 143 !------------------------------------------------------------------------- 144 DO iq = 1, nqtot 145 ! CALL clock(t_initial) 146 IF(tracers(iq)%parent /= 'air') CYCLE 147 iadv = tracers(iq)%iadv 148 !----------------------------------------------------------------------- 149 SELECT CASE(iadv) 150 !----------------------------------------------------------------------- 151 CASE(0); CYCLE 152 !-------------------------------------------------------------------- 153 CASE(10) !--- Schema de Van Leer I MUSCL 154 !-------------------------------------------------------------------- 155 ! WRITE(*,*) 'advtrac 239: iq,q(1721,19,:)=',iq,q(1721,19,:) 156 !LF CALL vlsplt_p(q(1,1,iq),2.,massem,wg,pbarug,pbarvg,dtvr) 157 158 !-------------------------------------------------------------------- 159 CASE(14) !--- Schema "pseuDO amont" + test sur humidite specifique 160 !--- pour la vapeur d'eau. F. Codron 161 !-------------------------------------------------------------------- 162 ! WRITE(*,*) 'advtrac 248: iq,q(1721,19,:)=',iq,q(1721,19,:) 163 STOP 'advtrac : appel a vlspltqs :schema non parallelise' 164 !LF CALL vlspltqs_p(q(1,1,1),2.,massem,wg,pbarug,pbarvg,dtvr,p,pk,teta ) 165 166 !-------------------------------------------------------------------- 167 CASE(12) !--- Schema de Frederic Hourdin 168 !-------------------------------------------------------------------- 169 CALL adaptdt(iadv,dtbon,n,pbarug,massem) ! pas de temps adaptatif 170 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 171 DO indice=1,n 172 CALL advn(q(1,1,iq),massem,wg,pbarug,pbarvg,dtbon,1) 173 END DO 174 175 !-------------------------------------------------------------------- 176 CASE(13) !--- Pas de temps adaptatif 177 !-------------------------------------------------------------------- 178 STOP 'advtrac : schema non parallelise' 179 CALL adaptdt(iadv,dtbon,n,pbarug,massem) 180 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 181 DO indice=1,n 182 CALL advn(q(1,1,iq),massem,wg,pbarug,pbarvg,dtbon,2) 183 END DO 184 185 !-------------------------------------------------------------------- 186 CASE(20) !--- Schema de pente SLOPES 187 !-------------------------------------------------------------------- 188 STOP 'advtrac : schema non parallelise' 189 CALL pentes_ini (q(1,1,iq),wg,massem,pbarug,pbarvg,0) 190 191 !-------------------------------------------------------------------- 192 CASE(30) !--- Schema de Prather 193 !-------------------------------------------------------------------- 194 STOP 'advtrac : schema non parallelise' 195 ! Pas de temps adaptatif 196 CALL adaptdt(iadv,dtbon,n,pbarug,massem) 197 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 198 CALL prather(q(1,1,iq),wg,massem,pbarug,pbarvg,n,dtbon) 199 200 !-------------------------------------------------------------------- 201 CASE(11,16,17,18) !--- Schemas PPM Lin et Rood 202 !-------------------------------------------------------------------- 203 STOP 'advtrac : schema non parallelise' 204 ! Test sur le flux horizontal 205 CALL adaptdt(iadv,dtbon,n,pbarug,massem) ! pas de temps adaptatif 206 IF(n > 1) WRITE(*,*) 'WARNING horizontal dt=',dtbon,'dtvr=',dtvr,'n=',n 207 ! Test sur le flux vertical 208 CFLmaxz=0. 209 DO l=2,llm 210 DO ij=iip2,ip1jm 211 aaa=wg(ij,l)*dtvr/massem(ij,l) 212 CFLmaxz=max(CFLmaxz,aaa) 213 bbb=-wg(ij,l)*dtvr/massem(ij,l-1) 214 CFLmaxz=max(CFLmaxz,bbb) 215 END DO 216 END DO 217 IF(CFLmaxz.GE.1) WRITE(*,*) 'WARNING vertical','CFLmaxz=', CFLmaxz 218 !---------------------------------------------------------------- 219 ! Ss-prg interface LMDZ.4->PPM3d (ss-prg de Lin) 220 !---------------------------------------------------------------- 221 CALL interpre(q(1,1,iq),qppm(1,1,iq),wg,fluxwppm,massem, & 222 apppm,bpppm,massebx,masseby,pbarug,pbarvg, & 223 unatppm,vnatppm,psppm) 224 225 !---------------------------------------------------------------- 226 DO indice=1,n !--- VL (version PPM) horiz. et PPM vert. 227 !---------------------------------------------------------------- 228 SELECT CASE(iadv) 229 !---------------------------------------------------------- 230 CASE(11) 231 !---------------------------------------------------------- 232 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 233 2,2,2,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000,fill,dum,220.) 234 !---------------------------------------------------------- 235 CASE(16) !--- Monotonic PPM 236 !---------------------------------------------------------- 237 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 238 3,3,3,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000,fill,dum,220.) 239 !---------------------------------------------------------- 240 CASE(17) !--- Semi monotonic PPM 241 !---------------------------------------------------------- 242 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 243 4,4,4,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000, fill,dum,220.) 244 !---------------------------------------------------------- 245 CASE(18) !--- Positive Definite PPM 246 !---------------------------------------------------------- 247 CALL ppm3d(1,qppm(1,1,iq),psppm,psppm,unatppm,vnatppm,fluxwppm,dtbon, & 248 5,5,5,1,iim,jjp1,2,llm,apppm,bpppm,0.01,6400000,fill,dum,220.) 249 END SELECT 250 !---------------------------------------------------------------- 251 END DO 252 !---------------------------------------------------------------- 253 ! Ss-prg interface PPM3d-LMDZ.4 254 !---------------------------------------------------------------- 255 CALL interpost(q(1,1,iq),qppm(1,1,iq)) 256 !---------------------------------------------------------------------- 257 END SELECT 258 !---------------------------------------------------------------------- 259 260 !---------------------------------------------------------------------- 261 ! On impose une seule valeur du traceur au pôle Sud j=jjm+1=jjp1 et Nord j=1 262 !---------------------------------------------------------------------- 263 ! CALL traceurpole(q(1,1,iq),massem) 264 265 !--- Calcul du temps cpu pour un schema donne 266 ! CALL clock(t_final) 267 !ym tps_cpu=t_final-t_initial 268 !ym cpuadv(iq)=cpuadv(iq)+tps_cpu 269 270 END DO 271 272 1234 CONTINUE 273 !$OMP BARRIER 274 IF(planet_type=="earth") THEN 345 275 ijb=ij_begin 346 276 ije=ij_end 347 348 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 349 DO l = 1, llm 277 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 278 DO l = 1, llm 350 279 DO ij = ijb, ije 351 finmasse(ij,l) = p(ij,l) - p(ij,l+1) 352 ENDDO 353 ENDDO 354 c$OMP END DO 355 356 ! CRisi: on passe nqtot et non nq 357 CALL qminimum_loc( q, nqtot, finmasse ) 358 359 endif ! of if (planet_type=="earth") 360 361 RETURN 362 END 363 280 finmasse(ij,l) = p(ij,l) - p(ij,l+1) 281 END DO 282 END DO 283 !$OMP END DO 284 285 CALL qminimum_loc( q, nqtot, finmasse ) 286 287 END IF ! of if (planet_type=="earth") 288 289 END SUBROUTINE advtrac_loc 290 -
LMDZ6/trunk/libf/dyn3dmem/call_calfis_mod.F90
r4050 r4056 113 113 TYPE(Request),SAVE :: Request_physic 114 114 !$OMP THREADPRIVATE(Request_physic ) 115 INTEGER :: ijb,ije,l, j115 INTEGER :: ijb,ije,l,iq 116 116 117 117 … … 122 122 CALL WriteField_u('pfi',p) 123 123 CALL WriteField_u('pkfi',pk) 124 DO j=1,nqtot125 CALL WriteField_u('qfi'//trim(int2str( j)),q(:,:,j))124 DO iq=1,nqtot 125 CALL WriteField_u('qfi'//trim(int2str(iq)),q(:,:,iq)) 126 126 ENDDO 127 127 #endif … … 223 223 CALL WriteField_u('pfi',p) 224 224 CALL WriteField_u('pkfi',pk) 225 DO j=1,nqtot226 CALL WriteField_u('qfi'//trim(int2str( j)),q(:,:,j))225 DO iq=1,nqtot 226 CALL WriteField_u('qfi'//trim(int2str(iq)),q(:,:,iq)) 227 227 ENDDO 228 228 #endif … … 267 267 CALL Register_Hallo_u(dpfi,1,1,0,0,1,Request_physic) 268 268 269 DO j=1,nqtot270 CALL Register_Hallo_u(dqfi(:,:, j),llm,1,0,0,1,Request_physic)269 DO iq=1,nqtot 270 CALL Register_Hallo_u(dqfi(:,:,iq),llm,1,0,0,1,Request_physic) 271 271 ENDDO 272 272 … … 305 305 CALL WriteField_u('dtetafi',dtetafi) 306 306 CALL WriteField_u('dpfi',dpfi) 307 DO j=1,nqtot308 CALL WriteField_u('dqfi'//trim(int2str( j)),dqfi(:,:,j))307 DO iq=1,nqtot 308 CALL WriteField_u('dqfi'//trim(int2str(iq)),dqfi(:,:,iq)) 309 309 ENDDO 310 310 #endif … … 319 319 CALL WriteField_u('tetafi',teta) 320 320 CALL WriteField_u('psfi',ps) 321 DO j=1,nqtot322 CALL WriteField_u('qfi'//trim(int2str( j)),q(:,:,j))321 DO iq=1,nqtot 322 CALL WriteField_u('qfi'//trim(int2str(iq)),q(:,:,iq)) 323 323 ENDDO 324 324 #endif … … 329 329 CALL WriteField_u('tetafi',teta) 330 330 CALL WriteField_u('psfi',ps) 331 DO j=1,nqtot332 CALL WriteField_u('qfi'//trim(int2str( j)),q(:,:,j))331 DO iq=1,nqtot 332 CALL WriteField_u('qfi'//trim(int2str(iq)),q(:,:,iq)) 333 333 ENDDO 334 334 #endif … … 354 354 CALL WriteField_u('tetafi',teta) 355 355 CALL WriteField_u('psfi',ps) 356 DO j=1,nqtot357 CALL WriteField_u('qfi'//trim(int2str( j)),q(:,:,j))356 DO iq=1,nqtot 357 CALL WriteField_u('qfi'//trim(int2str(iq)),q(:,:,iq)) 358 358 ENDDO 359 359 #endif … … 401 401 CALL WriteField_u('tetafi',teta_dyn) 402 402 CALL WriteField_u('psfi',ps_dyn) 403 DO j=1,nqtot404 CALL WriteField_u('qfi'//trim(int2str( j)),q_dyn(:,:,j))403 DO iq=1,nqtot 404 CALL WriteField_u('qfi'//trim(int2str(iq)),q_dyn(:,:,iq)) 405 405 ENDDO 406 406 #endif -
LMDZ6/trunk/libf/dyn3dmem/iniacademic_loc.F90
r4052 r4056 5 5 6 6 USE filtreg_mod, ONLY: inifilr 7 USE infotrac, ONLY: nqtot, niso_possibles, ok_isotopes, ok_iso_verif, tnat, alpha_ideal, & 8 iqiso, tracers, iso_indnum 9 USE control_mod, ONLY: day_step,planet_type 7 10 use exner_hyb_m, only: exner_hyb 8 11 use exner_milieu_m, only: exner_milieu 9 USE infotrac, ONLY: nqtot, niso_possibles, ok_isotopes, ok_iso_verif, tnat, alpha_ideal, &10 iqiso, tracers, iso_indnum11 USE control_mod, ONLY: day_step,planet_type12 12 USE parallel_lmdz, ONLY: ijb_u, ije_u, ijb_v, ije_v 13 13 #ifdef CPP_IOIPSL … … 23 23 USE temps_mod, ONLY: annee_ref, day_ini, day_ref 24 24 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 25 26 25 27 26 ! Author: Frederic Hourdin original: 15/01/93 … … 112 111 ztot0 = 0. 113 112 stot0 = 0. 114 ang0 = 0. 113 ang0 = 0. 115 114 116 115 if (llm == 1) then … … 143 142 ps_glo(:)=preff 144 143 endif 145 144 146 145 ! ground geopotential 147 146 phis_glo(:)=0. 148 149 147 CALL pression ( ip1jmp1, ap, bp, ps_glo, p ) 150 148 if (pressure_exner) then … … 155 153 CALL massdair(p,masse_glo) 156 154 ENDIF 157 158 155 159 156 if (llm == 1) then … … 281 278 if (planet_type=="earth") then 282 279 ! Earth: first two tracers will be water 283 284 280 do iq=1,nqtot 285 281 q(ijb_u:ije_u,:,iq)=0. 286 ! IF(tracers(iq)%name == 'H2O'// Phases_sep//'g') q(ijb_u:ije_u,:,iq)=1.e-10282 ! IF(tracers(iq)%name == 'H2O'//phases_sep//'g') q(ijb_u:ije_u,:,iq)=1.e-10 287 283 ! IF(tracers(iq)%name == 'H2O'//phases_sep//'l') q(ijb_u:ije_u,:,iq)=1.e-15 288 if(tracers(iq)%name == 'H2Ov') q(ijb_u:ije_u,:,iq)=1.e-10289 if(tracers(iq)%name == 'H2Ol') q(ijb_u:ije_u,:,iq)=1.e-15284 IF(tracers(iq)%name == 'H2Ov') q(ijb_u:ije_u,:,iq)=1.e-10 285 IF(tracers(iq)%name == 'H2Ol') q(ijb_u:ije_u,:,iq)=1.e-15 290 286 291 287 ! CRisi: init des isotopes … … 293 289 iName = tracers(iq)%iso_iName 294 290 if (.NOT.ok_isotopes .OR. iName <= 0) CYCLE 295 iZone = tracers(iq)%iso_iZone296 iPhase = tracers(iq)%iso_iPhase291 iZone = tracers(iq)%iso_iZone 292 iPhase = tracers(iq)%iso_iPhase 297 293 iqParent = tracers(iq)%iqParent 298 294 if (iZone == 0) q(ijb_u:ije_u,:,iq) = q(ijb_u:ije_u,:,iqParent)*tnat(iName) & … … 304 300 endif ! of if (planet_type=="earth") 305 301 306 if (ok_iso_verif) then 307 call check_isotopes(q,ijb_u,ije_u,'iniacademic_loc') 308 endif !if (ok_iso_verif) then 302 if (ok_iso_verif) call check_isotopes(q,ijb_u,ije_u,'iniacademic_loc') 309 303 310 304 ! add random perturbation to temperature -
LMDZ6/trunk/libf/dyn3dmem/leapfrog_loc.F
r3947 r4056 664 664 call WriteField_u('pkf',pkf) 665 665 call WriteField_u('phis',phis) 666 do j=1,nqtot667 call WriteField_u('q'//trim(int2str( j)),668 . q(:,:, j))666 do iq=1,nqtot 667 call WriteField_u('q'//trim(int2str(iq)), 668 . q(:,:,iq)) 669 669 enddo 670 670 endif -
LMDZ6/trunk/libf/dyn3dmem/vlspltgen_loc.F
r4052 r4056 28 28 USE VAMPIR 29 29 ! CRisi: on rajoute variables utiles d'infotrac 30 USE infotrac, ONLY : nqtot, nqperes,tracers,ok_iso_verif30 USE infotrac, ONLY : nqtot, tracers,ok_iso_verif 31 31 USE vlspltgen_mod 32 32 USE comconst_mod, ONLY: cpp … … 196 196 197 197 c$OMP BARRIER 198 ! DO iq=1,nqtot 199 DO iq=1,nqperes ! CRisi: on ne boucle que sur les pères= ceux qui sont transportés directement par l'air 200 !write(*,*) 'vlspltgen 192: iq,iadv=',iq,tracers(iq)%iadv 198 DO iq=1,nqtot 199 ! CRisi: on ne boucle que sur les pères= ceux qui sont transportés directement par l'air 200 IF(tracers(iq)%parent /= 'air') CYCLE 201 !write(*,*) 'vlspltgen 192: iq,iadv=',iq,tracers(iq)%iadv 201 202 #ifdef DEBUG_IO 202 CALL WriteField_u('zq',zq(:,:,iq))203 CALL WriteField_u('zm',zm(:,:,iq))203 CALL WriteField_u('zq',zq(:,:,iq)) 204 CALL WriteField_u('zm',zm(:,:,iq)) 204 205 #endif 205 206 SELECT CASE(tracers(iq)%iadv) … … 264 265 END SELECT 265 266 266 enddo !DO iq=1,nq peres267 enddo !DO iq=1,nqtot 267 268 268 269 … … 288 289 endif !if (ok_iso_verif) then 289 290 290 do iq=1,nqperes 291 do iq=1,nqtot 292 IF(tracers(iq)%parent /= 'air') CYCLE 291 293 !write(*,*) 'vlspltgen 279: iq=',iq 292 294 … … 328 330 if (ok_iso_verif) then 329 331 call check_isotopes(zq,ij_begin,ij_end,'vlspltgen_loc 326') 330 endif !if (ok_iso_verif) then331 if (ok_iso_verif) then332 332 ijb=ij_begin-2*iip1 333 333 ije=ij_end+2*iip1 … … 337 337 endif !if (ok_iso_verif) then 338 338 339 do iq=1,nqperes 339 do iq = 1, nqtot 340 IF(tracers(iq)%parent /= 'air') CYCLE 340 341 !write(*,*) 'vlspltgen 321: iq=',iq 341 342 #ifdef DEBUG_IO … … 358 359 endif !if (ok_iso_verif) then 359 360 360 do iq=1,nqperes 361 do iq = 1, nqtot 362 IF(tracers(iq)%parent /= 'air') CYCLE 361 363 !write(*,*) 'vlspltgen 349: iq=',iq 362 364 #ifdef DEBUG_IO … … 419 421 420 422 c$OMP BARRIER 421 do iq=1,nqperes 423 do iq=1,nqtot 424 IF(tracers(iq)%parent /= 'air') CYCLE 422 425 !write(*,*) 'vlspltgen 409: iq=',iq 423 426 … … 462 465 endif !if (ok_iso_verif) then 463 466 464 do iq=1,nqperes 467 do iq=1,nqtot 468 IF(tracers(iq)%parent /= 'air') CYCLE 465 469 !write(*,*) 'vlspltgen 449: iq=',iq 466 470 #ifdef DEBUG_IO … … 475 479 END SELECT 476 480 477 enddo !do iq=1,nq peres481 enddo !do iq=1,nqtot 478 482 479 483 if (ok_iso_verif) then … … 481 485 endif !if (ok_iso_verif) then 482 486 483 do iq=1,nqperes 487 do iq=1,nqtot 488 IF(tracers(iq)%parent /= 'air') CYCLE 484 489 !write(*,*) 'vlspltgen 477: iq=',iq 485 490 #ifdef DEBUG_IO … … 496 501 END SELECT 497 502 498 enddo !do iq=1,nq peres503 enddo !do iq=1,nqtot 499 504 500 505 !write(*,*) 'vlspltgen 550: apres derniere serie de call vlx' -
LMDZ6/trunk/libf/dynphy_lonlat/calfis.F
r4046 r4056 29 29 c Auteur : P. Le Van, F. Hourdin 30 30 c ......... 31 USE infotrac, ONLY: nqtot, niadv,tracers31 USE infotrac, ONLY: nqtot, tracers 32 32 USE control_mod, ONLY: planet_type, nsplit_phys 33 33 #ifdef CPP_PHYS … … 135 135 c ----------------- 136 136 137 INTEGER i,j,l,ig0,ig,iq,i iq137 INTEGER i,j,l,ig0,ig,iq,itr 138 138 REAL zpsrf(ngridmx) 139 139 REAL zplev(ngridmx,llm+1),zplay(ngridmx,llm) … … 281 281 c --------------- 282 282 c 283 itr=0 283 284 DO iq=1,nqtot 284 iiq=niadv(iq) 285 IF(.NOT.tracers(iq)%isAdvected) CYCLE 286 itr = itr + 1 285 287 DO l=1,llm 286 zqfi(1,l,i q) = pq(1,1,l,iiq)287 ig0 = 2288 zqfi(1,l,itr) = pq(1,1,l,iq) 289 ig0 = 2 288 290 DO j=2,jjm 289 291 DO i = 1, iim 290 zqfi(ig0,l,i q) = pq(i,j,l,iiq)292 zqfi(ig0,l,itr) = pq(i,j,l,iq) 291 293 ig0 = ig0 + 1 292 294 ENDDO 293 295 ENDDO 294 zqfi(ig0,l,i q) = pq(1,jjp1,l,iiq)296 zqfi(ig0,l,itr) = pq(1,jjp1,l,iq) 295 297 ENDDO 296 298 ENDDO … … 481 483 lafin_split=lafin.and.isplit==nsplit_phys 482 484 485 ! if (planet_type=="earth") then 483 486 CALL call_physiq(ngridmx,llm,nqtot,tracers(:)%name, 484 487 & debut_split,lafin_split, … … 490 493 & flxwfi,pducov, 491 494 & zdufi,zdvfi,zdtfi,zdqfi,zdpsrf) 492 493 ! if (planet_type=="earth") then494 !495 ! CALL physiq (ngridmx,496 ! . llm,497 ! . debut_split,498 ! . lafin_split,499 ! . jD_cur,500 ! . jH_cur_split,501 ! . zdt_split,502 ! . zplev,503 ! . zplay,504 ! . zphi,505 ! . zphis,506 ! . presnivs,507 ! . zufi,508 ! . zvfi, zrfi,509 ! . ztfi,510 ! . zqfi,511 ! . flxwfi,512 ! . zdufi,513 ! . zdvfi,514 ! . zdtfi,515 ! . zdqfi,516 ! . zdpsrf,517 ! . pducov)518 495 ! 519 496 ! else if ( planet_type=="generic" ) then … … 622 599 pdqfi(:,:,:,:)=0. 623 600 C 601 itr = 0 624 602 DO iq=1,nqtot 625 iiq=niadv(iq) 603 IF(.NOT.tracers(iq)%isAdvected) CYCLE 604 itr = itr + 1 626 605 DO l=1,llm 627 606 DO i=1,iip1 628 pdqfi(i,1,l,i iq) = zdqfi(1,l,iq)629 pdqfi(i,jjp1,l,i iq) = zdqfi(ngridmx,l,iq)607 pdqfi(i,1,l,iq) = zdqfi(1,l,itr) 608 pdqfi(i,jjp1,l,iq) = zdqfi(ngridmx,l,itr) 630 609 ENDDO 631 610 DO j=2,jjm 632 611 ig0=1+(j-2)*iim 633 612 DO i=1,iim 634 pdqfi(i,j,l,i iq) = zdqfi(ig0+i,l,iq)613 pdqfi(i,j,l,iq) = zdqfi(ig0+i,l,itr) 635 614 ENDDO 636 pdqfi(iip1,j,l,i iq) = pdqfi(1,j,l,iq)615 pdqfi(iip1,j,l,iq) = pdqfi(1,j,l,itr) 637 616 ENDDO 638 617 ENDDO -
LMDZ6/trunk/libf/dynphy_lonlat/calfis_loc.F
r4046 r4056 45 45 USE Times 46 46 #endif 47 USE infotrac, ONLY: nqtot, niadv,tracers47 USE infotrac, ONLY: nqtot, tracers 48 48 USE control_mod, ONLY: planet_type, nsplit_phys 49 49 #ifdef CPP_PHYS … … 154 154 c ----------------- 155 155 156 INTEGER i,j,l,ig0,ig,iq,i iq156 INTEGER i,j,l,ig0,ig,iq,itr 157 157 REAL,ALLOCATABLE,SAVE :: zpsrf(:) 158 158 REAL,ALLOCATABLE,SAVE :: zplev(:,:),zplay(:,:) … … 366 366 c 367 367 368 itr = 0 368 369 DO iq=1,nqtot 369 iiq=niadv(iq) 370 IF(.NOT.tracers(iq)%isAdvected) CYCLE 371 itr = itr + 1 370 372 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 371 373 DO l=1,llm … … 375 377 i=index_i(ig0) 376 378 j=index_j(ig0) 377 zqfi(ig0,l,i q) = pq(i,j,l,iiq)379 zqfi(ig0,l,itr) = pq(i,j,l,iq) 378 380 enddo 379 381 ENDDO … … 1069 1071 C 1070 1072 !cdir NODEP 1073 itr = 0 1071 1074 DO iq=1,nqtot 1072 iiq=niadv(iq) 1075 IF(.NOT.tracers(iq)%isAdvected) CYCLE 1076 itr = itr + 1 1073 1077 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 1074 1078 DO l=1,llm … … 1079 1083 i=index_i(ig0) 1080 1084 j=index_j(ig0) 1081 pdqfi(i,j,l,i iq) = zdqfi(ig0,l,iq)1082 if (i==1) pdqfi(iip1,j,l,i iq) = zdqfi(ig0,l,iq)1085 pdqfi(i,j,l,iq) = zdqfi(ig0,l,itr) 1086 if (i==1) pdqfi(iip1,j,l,iq) = zdqfi(ig0,l,itr) 1083 1087 ENDDO 1084 1088 1085 1089 IF (is_north_pole_dyn) then 1086 1090 DO i=1,iip1 1087 pdqfi(i,1,l,i iq) = zdqfi(1,l,iq)1091 pdqfi(i,1,l,iq) = zdqfi(1,l,itr) 1088 1092 ENDDO 1089 1093 ENDIF … … 1091 1095 IF (is_south_pole_dyn) then 1092 1096 DO i=1,iip1 1093 pdqfi(i,jjp1,l,i iq) = zdqfi(klon,l,iq)1097 pdqfi(i,jjp1,l,iq) = zdqfi(klon,l,itr) 1094 1098 ENDDO 1095 1099 ENDIF -
LMDZ6/trunk/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90
r4050 r4056 17 17 USE vertical_layers_mod, ONLY : init_vertical_layers 18 18 USE infotrac, ONLY: nqtot,nqo,nbtr,nqCO2,tracers,type_trac,& 19 niadv,conv_flg,pbl_flg,solsym,&19 conv_flg,pbl_flg,solsym,& 20 20 ok_isotopes,ok_iso_verif,ok_isotrac,& 21 21 ok_init_iso,niso_possibles,tnat,& 22 22 alpha_ideal,use_iso,iqiso,iso_indnum,& 23 23 indnum_fn_num,index_trac,& 24 niso,ntraceurs_zone,ntraciso,nqtottr ,itr_indice24 niso,ntraceurs_zone,ntraciso,nqtottr 25 25 #ifdef CPP_StratAer 26 USE infotrac , ONLY: nbtr_bin, nbtr_sulgas, id_OCS_strat, &26 USE infotrac_phy, ONLY: nbtr_bin, nbtr_sulgas, id_OCS_strat, & 27 27 id_SO2_strat, id_H2SO4_strat, id_BIN01_strat 28 28 … … 145 145 ! Initialize tracer names, numbers, etc. for physics 146 146 CALL init_infotrac_phy(nqtot,nqo,nbtr,nqtottr,nqCO2,tracers,type_trac,& 147 niadv,conv_flg,pbl_flg,solsym,&147 conv_flg,pbl_flg,solsym,& 148 148 ok_isotopes,ok_iso_verif,ok_isotrac,& 149 149 ok_init_iso,niso_possibles,tnat,& 150 150 alpha_ideal,use_iso,iqiso,iso_indnum,& 151 151 indnum_fn_num,index_trac,& 152 niso,ntraceurs_zone,ntraciso,itr_indice & 153 #ifdef CPP_StratAer 154 ,nbtr_bin,nbtr_sulgas& 155 ,id_OCS_strat,id_SO2_strat,id_H2SO4_strat,id_BIN01_strat& 156 #endif 157 ) 152 niso,ntraceurs_zone,ntraciso) 158 153 159 154 ! Initializations for Reprobus -
LMDZ6/trunk/libf/phylmd/Dust/phys_output_write_spl_mod.F90
r3805 r4056 381 381 USE pbl_surface_mod, ONLY: snow 382 382 USE indice_sol_mod, ONLY: nbsrf 383 USE infotrac, ONLY: nqtot, n qo, nbtr, type_trac383 USE infotrac, ONLY: nqtot, nbtr, type_trac 384 384 USE geometry_mod, ONLY: cell_area 385 385 USE surface_data, ONLY: type_ocean, version_ocean, ok_veget, landice_opt … … 430 430 INTEGER, PARAMETER :: jjmp1=jjm+1-1/jjm 431 431 INTEGER :: itau_w 432 INTEGER :: i, iinit, iinitend=1, iff, iq, nsrf, k, ll, naero432 INTEGER :: i, iinit, iinitend=1, iff, iq, itr, nsrf, k, ll, naero 433 433 REAL, DIMENSION (klon) :: zx_tmp_fi2d 434 434 REAL, DIMENSION (klon,klev) :: zx_tmp_fi3d, zpt_conv … … 1610 1610 #endif 1611 1611 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1612 IF (nqtot.GE.nqo+1) THEN 1613 !AS: type_trac = 'lmdz' par defaut dans libf/dyn3d/conf_gcm.F90 1614 !Changé par inca, repr(obus), coag(ulation), co2i(nteractif), PAS par SPLA 1615 !Cet "if" est donc inutile : IF (type_trac == 'lmdz' .OR. type_trac == 'repr') THEN 1616 DO iq=nqo+1,nqtot 1617 CALL histwrite_phy(o_trac(iq-nqo), tr_seri(:,:,iq-nqo)) 1618 CALL histwrite_phy(o_dtr_vdf(iq-nqo),d_tr_cl(:,:,iq-nqo)) 1619 CALL histwrite_phy(o_dtr_the(iq-nqo),d_tr_th(:,:,iq-nqo)) 1620 CALL histwrite_phy(o_dtr_con(iq-nqo),d_tr_cv(:,:,iq-nqo)) 1621 CALL histwrite_phy(o_dtr_lessi_impa(iq-nqo),d_tr_lessi_impa(:,:,iq-nqo)) 1622 CALL histwrite_phy(o_dtr_lessi_nucl(iq-nqo),d_tr_lessi_nucl(:,:,iq-nqo)) 1623 CALL histwrite_phy(o_dtr_insc(iq-nqo),d_tr_insc(:,:,iq-nqo)) 1624 CALL histwrite_phy(o_dtr_bcscav(iq-nqo),d_tr_bcscav(:,:,iq-nqo)) 1625 CALL histwrite_phy(o_dtr_evapls(iq-nqo),d_tr_evapls(:,:,iq-nqo)) 1626 CALL histwrite_phy(o_dtr_ls(iq-nqo),d_tr_ls(:,:,iq-nqo)) 1627 ! CALL histwrite_phy(o_dtr_dyn(iq-nqo),d_tr_dyn(:,:,iq-nqo)) 1628 ! CALL histwrite_phy(o_dtr_cl(iq-nqo),d_tr_cl(:,:,iq-nqo)) 1629 CALL histwrite_phy(o_dtr_trsp(iq-nqo),d_tr_trsp(:,:,iq-nqo)) 1630 CALL histwrite_phy(o_dtr_sscav(iq-nqo),d_tr_sscav(:,:,iq-nqo)) 1631 CALL histwrite_phy(o_dtr_sat(iq-nqo),d_tr_sat(:,:,iq-nqo)) 1632 CALL histwrite_phy(o_dtr_uscav(iq-nqo),d_tr_uscav(:,:,iq-nqo)) 1612 itr = 0 1613 DO iq = 1, nqtot 1614 IF(tracers(iq)%isH2Ofamily) CYCLE 1615 itr = itr+1 1616 CALL histwrite_phy(o_trac(itr), tr_seri(:,:,itr)) 1617 CALL histwrite_phy(o_dtr_vdf(itr),d_tr_cl(:,:,itr)) 1618 CALL histwrite_phy(o_dtr_the(itr),d_tr_th(:,:,itr)) 1619 CALL histwrite_phy(o_dtr_con(itr),d_tr_cv(:,:,itr)) 1620 CALL histwrite_phy(o_dtr_lessi_impa(itr),d_tr_lessi_impa(:,:,itr)) 1621 CALL histwrite_phy(o_dtr_lessi_nucl(itr),d_tr_lessi_nucl(:,:,itr)) 1622 CALL histwrite_phy(o_dtr_insc(itr),d_tr_insc(:,:,itr)) 1623 CALL histwrite_phy(o_dtr_bcscav(itr),d_tr_bcscav(:,:,itr)) 1624 CALL histwrite_phy(o_dtr_evapls(itr),d_tr_evapls(:,:,itr)) 1625 CALL histwrite_phy(o_dtr_ls(itr),d_tr_ls(:,:,itr)) 1626 ! CALL histwrite_phy(o_dtr_dyn(itr),d_tr_dyn(:,:,itr)) 1627 ! CALL histwrite_phy(o_dtr_cl(itr),d_tr_cl(:,:,itr)) 1628 CALL histwrite_phy(o_dtr_trsp(itr),d_tr_trsp(:,:,itr)) 1629 CALL histwrite_phy(o_dtr_sscav(itr),d_tr_sscav(:,:,itr)) 1630 CALL histwrite_phy(o_dtr_sat(itr),d_tr_sat(:,:,itr)) 1631 CALL histwrite_phy(o_dtr_uscav(itr),d_tr_uscav(:,:,itr)) 1633 1632 zx_tmp_fi2d=0. 1634 1633 IF (vars_defined) THEN 1635 1634 DO k=1,klev 1636 zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,i q-nqo)1635 zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,itr) 1637 1636 ENDDO 1638 1637 ENDIF 1639 CALL histwrite_phy(o_trac_cum(i q-nqo), zx_tmp_fi2d)1638 CALL histwrite_phy(o_trac_cum(itr), zx_tmp_fi2d) 1640 1639 ENDDO 1641 !ENDIF1642 ENDIF1643 1640 1644 1641 IF (.NOT.vars_defined) THEN -
LMDZ6/trunk/libf/phylmd/Dust/phytracr_spl_mod.F90
r4046 r4056 1104 1104 REAL, intent(in) :: rlon(klon) ! longitudes pour chaque point 1105 1105 ! 1106 INTEGER i, k, i t, j, ig1106 INTEGER i, k, iq, itr, j, ig 1107 1107 ! 1108 1108 ! DEFINITION OF DIAGNOSTIC VARIABLES … … 1260 1260 1261 1261 #ifdef IOPHYS_DUST 1262 do it=1,nbtr 1263 write(str2,'(i2.2)') it 1264 call iophys_ecrit('TRA'//str2,klev,'SOURCE','',tr_seri(:,:,it)) 1262 itr = 0 1263 DO iq = 1, nqtot 1264 IF(tracers(iq)%isH2Ofamily) CYCLE 1265 itr = itr+1 1266 write(str2,'(i2.2)') itr 1267 call iophys_ecrit('TRA'//str2,klev,'SOURCE','',tr_seri(:,:,itr)) 1265 1268 enddo 1266 1269 #endif … … 1414 1417 id_codu=-1 1415 1418 id_scdu=-1 1416 !print *,nbtr 1417 do it=1,nbtr 1418 print *, it, tracers(it+nqo)%name 1419 SELECT CASE(tracers(it+nqo)%name) 1420 CASE('PREC'); id_prec=it 1421 CASE('FINE'); id_fine=it 1422 CASE('COSS'); id_coss=it 1423 CASE('CODU'); id_codu=it 1424 CASE('SCDU'); id_scdu=it 1425 END SELECT 1426 enddo 1427 ! check consistency with dust emission scheme: 1428 if (ok_chimeredust) then 1419 itr = 0 1420 do iq=1,nqtot 1421 IF(tracers(iq)%isH2Ofamily) CYCLE 1422 itr = itr+1 1423 print *, itr, TRIM(tracers(iq)%name) 1424 SELECT CASE(tracers(iq)%name) 1425 CASE('PREC'); id_prec=itr 1426 CASE('FINE'); id_fine=itr 1427 CASE('COSS'); id_coss=itr 1428 CASE('CODU'); id_codu=itr 1429 CASE('SCDU'); id_scdu=itr 1430 END SELECT 1431 enddo 1432 ! check consistency with dust emission scheme: 1433 if (ok_chimeredust) then 1429 1434 if (.not.( id_scdu>0 .and. id_codu>0 .and. id_fine>0)) then 1430 1435 call abort_gcm('phytracr_mod', 'pb in ok_chimdust 0',1) 1431 1436 endif 1432 else1437 else 1433 1438 if (id_scdu>0) then 1434 1439 call abort_gcm('phytracr_mod', 'pb in ok_chimdust 1 SCDU',1) … … 1560 1565 ! JE before put in zero 1561 1566 IF (lminmax) THEN 1562 DO it =1,nbtr1563 CALL checknanqfi(tr_seri(:,:,it ),qmin,qmax,'nan init phytracr')1564 ENDDO 1565 DO it =1,nbtr1566 CALL minmaxqfi2(tr_seri(:,:,it ),qmin,qmax,'minmax init phytracr')1567 DO itr=1,nbtr 1568 CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan init phytracr') 1569 ENDDO 1570 DO itr=1,nbtr 1571 CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'minmax init phytracr') 1567 1572 ENDDO 1568 1573 CALL minmaxsource(source_tr,qmin,qmax,'maxsource init phytracr') -
LMDZ6/trunk/libf/phylmd/Dust/splaeropt_5wv_rrtm.F90
r4046 r4056 9 9 USE DIMPHY 10 10 USE aero_mod 11 USE infotrac_phy 11 USE infotrac_phy, ONLY: nqtot, nbtr, tracers 12 12 USE phys_local_var_mod, ONLY: od550aer,od865aer,ec550aer,od550lt1aer 13 13 ! … … 34 34 LOGICAL :: soluble 35 35 36 INTEGER :: i, k, m, i tr, irh, aerindex36 INTEGER :: i, k, m, iq, itr, irh, aerindex 37 37 INTEGER :: spsol, spinsol, la 38 38 INTEGER :: RH_num(klon,klev) … … 112 112 ENDDO 113 113 114 DO itr=1,nbtr !--loop over tracers 115 SELECT CASE(tracers(itr+nqo)%name) 114 itr = 0 115 DO iq = 1, nqtot 116 IF(tracers(iq)%isH2Ofamily) CYCLE 117 itr = itr+1 118 SELECT CASE(tracers(iq)%name) 116 119 CASE('PREC'); CYCLE !--precursor 117 120 CASE('FINE'); soluble=.TRUE.; spsol=1; aerindex=1 !--fine mode accumulation mode … … 119 122 CASE('CODU'); soluble=.FALSE.; spsol=1; aerindex=3 !--coarse mode dust 120 123 CASE('SCDU'); soluble=.FALSE.; spsol=2; aerindex=4 !--super coarse mode dust 121 CASE DEFAULT; CALL abort_physic(modname,'I cannot do aerosol optics for '//tracers(i tr+nqo)%name,1)124 CASE DEFAULT; CALL abort_physic(modname,'I cannot do aerosol optics for '//tracers(iq)%name,1) 122 125 END SELECT 123 126 -
LMDZ6/trunk/libf/phylmd/Dust/splaeropt_6bands_rrtm.F90
r4046 r4056 8 8 USE dimphy 9 9 USE aero_mod 10 USE infotrac_phy 10 USE infotrac_phy, ONLY: nqtot, nbtr, tracers 11 11 USE phys_local_var_mod, ONLY: abs550aer 12 12 … … 35 35 ! 36 36 LOGICAL :: soluble 37 INTEGER :: i, k, irh, i tr, inu37 INTEGER :: i, k, irh, iq, itr, inu 38 38 INTEGER :: aerindex, spsol, spinsol 39 39 INTEGER :: RH_num(klon,klev) … … 165 165 cg_ae(:,:,:,:)=0. 166 166 167 DO itr=1,nbtr !--loop over tracers 168 SELECT CASE(tracers(itr+nqo)%name) 167 itr = 0 168 DO iq = 1, nqtot 169 IF(tracers(iq)%isH2Ofamily) CYCLE 170 itr = itr+1 171 SELECT CASE(tracers(iq)%name) 169 172 CASE('PREC'); CYCLE !--precursor 170 173 CASE('FINE'); soluble=.TRUE.; spsol=1; aerindex=1 !--fine mode accumulation mode … … 172 175 CASE('CODU'); soluble=.FALSE.; spsol=1; aerindex=3 !--coarse mode dust 173 176 CASE('SCDU'); soluble=.FALSE.; spsol=2; aerindex=4 !--super coarse mode dust 174 CASE DEFAULT; CALL abort_physic(modname,'I cannot do aerosol optics for '//tracers(i tr+nqo)%name,1)177 CASE DEFAULT; CALL abort_physic(modname,'I cannot do aerosol optics for '//tracers(iq)%name,1) 175 178 END SELECT 176 179 -
LMDZ6/trunk/libf/phylmd/Dust/splaeropt_lw_rrtm.F90
r4046 r4056 10 10 USE dimphy 11 11 USE aero_mod 12 USE infotrac_phy 12 USE infotrac_phy, ONLY: nqtot, nbtr, tracers 13 13 USE phys_state_var_mod, ONLY : tau_aero_lw_rrtm 14 14 USE YOERAD, ONLY : NLW … … 30 30 INTEGER, PARAMETER :: naero=naero_soluble+naero_insoluble 31 31 ! 32 INTEGER inu, itr, spinsol32 INTEGER inu, itr, iq, spinsol 33 33 CHARACTER*20 modname 34 34 ! … … 54 54 tau_aero_lw_rrtm = 0.0 55 55 ! 56 DO itr=1,nbtr 57 SELECT CASE(tracers(itr+nqo)%name) 58 CASE('PREC','FINE''COSS'); CYCLE !--precursor or fine/coarde accumulation mode 56 57 itr = 0 58 DO iq = 1, nqtot 59 IF(tracers(iq)%isH2Ofamily) CYCLE 60 itr = itr+1 61 SELECT CASE(tracers(iq)%name) 62 CASE('PREC','FINE','COSS'); CYCLE !--precursor or fine/coarde accumulation mode 59 63 CASE('CODU'); spinsol=1 !--coarse mode dust 60 64 CASE('SCDU'); spinsol=2 !--super coarse mode dust 61 CASE DEFAULT; CALL abort_physic(modname,'I cannot do aerosol optics for '//tracers(i tr+nqo)%name,1)65 CASE DEFAULT; CALL abort_physic(modname,'I cannot do aerosol optics for '//tracers(iq)%name,1) 62 66 END SELECT 63 67 ! -
LMDZ6/trunk/libf/phylmd/Dust/splaerosol_optic_rrtm.F90
r4046 r4056 13 13 USE dimphy 14 14 USE aero_mod 15 USE infotrac_phy 15 USE infotrac_phy, ONLY: nbtr, nqtot, tracers 16 16 USE YOMCST, ONLY: RD, RG 17 17 … … 40 40 REAL, DIMENSION(klon,klev,nwave,naero_tot), INTENT(OUT) :: tau3d_aero 41 41 42 INTEGER i, k, i tr42 INTEGER i, k, iq, itr 43 43 REAL, DIMENSION(klon,klev) :: zdm, zdh 44 44 REAL zrho, pdel … … 50 50 mass_solu_aero_pi(:,:) = 0.0 51 51 ! 52 DO itr=1,nbtr 53 IF (tracers(itr+nqo)%name=='FINE') THEN 52 itr = 0 53 DO iq = 1, nqtot 54 IF(tracers(iq)%isH2Ofamily) CYCLE 55 itr = itr+1 56 IF(tracers(iq)%name/='FINE') THEN 54 57 mass_solu_aero(:,:) = tr_seri(:,:,itr) 55 58 mass_solu_aero_pi(:,:) = tr_seri(:,:,itr) -
LMDZ6/trunk/libf/phylmd/infotrac_phy.F90
r4052 r4056 26 26 !$OMP THREADPRIVATE(nqtottr) 27 27 28 ! ThL : number of CO2 tracers 28 ! ThL : number of CO2 tracers ModThL 29 29 INTEGER, SAVE :: nqCO2 30 30 !$OMP THREADPRIVATE(nqCO2) 31 31 32 32 #ifdef CPP_StratAer 33 ! nbtr_bin: number of aerosol bins for StratAer model 34 ! nbtr_sulgas: number of sulfur gases for StratAer model 35 INTEGER, SAVE :: nbtr_bin, nbtr_sulgas 36 !$OMP THREADPRIVATE(nbtr_bin,nbtr_sulgas) 37 INTEGER, SAVE :: id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat 38 !$OMP THREADPRIVATE(id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat) 33 !=== SPECIFIC TO STRATOSPHERIC AEROSOLS (CK/OB) 34 INTEGER, SAVE :: nbtr_bin, nbtr_sulgas !--- number of aerosols bins and sulfur gases for StratAer model 35 !$OMP THREADPRIVATE(nbtr_bin, nbtr_sulgas) 36 INTEGER, SAVE :: id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat 37 !$OMP THREADPRIVATE(id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat) 39 38 #endif 40 41 ! CRisi: nb traceurs pères= directement advectés par l'air42 INTEGER, SAVE :: nqperes43 !$OMP THREADPRIVATE(nqperes)44 39 45 40 ! Tracers parameters 46 41 TYPE(trac_type), TARGET, ALLOCATABLE, SAVE :: tracers(:) 47 42 !$OMP THREADPRIVATE(tracers) 48 49 ! niadv : vector keeping the coorspondance between all tracers(nqtot) treated in the50 ! dynamic part of the code and the tracers (nbtr+2) used in the physics part of the code.51 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: niadv ! equivalent dyn / physique52 !$OMP THREADPRIVATE(niadv)53 43 54 44 ! conv_flg(it)=0 : convection desactivated for tracer number it … … 85 75 !$OMP THREADPRIVATE(niso,ntraceurs_zone,ntraciso) 86 76 87 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: itr_indice ! numéro iq entre 1 et nqtot qui correspond au traceur itr entre 1 et nqtottr88 !$OMP THREADPRIVATE(itr_indice)89 90 77 CONTAINS 91 78 92 79 SUBROUTINE init_infotrac_phy(nqtot_,nqo_,nbtr_,nqtottr_,nqCO2_,tracers_,type_trac_,& 93 niadv_,conv_flg_,pbl_flg_,solsym_,&80 conv_flg_,pbl_flg_,solsym_,& 94 81 ok_isotopes_,ok_iso_verif_,ok_isotrac_,& 95 82 ok_init_iso_,niso_possibles_,tnat_,& 96 83 alpha_ideal_,use_iso_,iqiso_,iso_indnum_,& 97 84 indnum_fn_num_,index_trac_,& 98 niso_,ntraceurs_zone_,ntraciso_,itr_indice_& 99 #ifdef CPP_StratAer 100 ,nbtr_bin_,nbtr_sulgas_& 101 ,id_OCS_strat_,id_SO2_strat_,id_H2SO4_strat_,id_BIN01_strat_& 102 #endif 103 ) 85 niso_,ntraceurs_zone_,ntraciso_) 104 86 105 87 ! transfer information on tracers from dynamics to physics … … 112 94 INTEGER,INTENT(IN) :: nqtottr_ 113 95 INTEGER,INTENT(IN) :: nqCO2_ 114 #ifdef CPP_StratAer115 INTEGER,INTENT(IN) :: nbtr_bin_116 INTEGER,INTENT(IN) :: nbtr_sulgas_117 INTEGER,INTENT(IN) :: id_OCS_strat_118 INTEGER,INTENT(IN) :: id_SO2_strat_119 INTEGER,INTENT(IN) :: id_H2SO4_strat_120 INTEGER,INTENT(IN) :: id_BIN01_strat_121 #endif122 96 TYPE(trac_type), INTENT(IN) :: tracers_(nqtot_) ! tracers descriptors 123 97 CHARACTER(len=*),INTENT(IN) :: type_trac_ 124 INTEGER,INTENT(IN) :: niadv_ (nqtot_) ! equivalent dyn / physique125 98 INTEGER,INTENT(IN) :: conv_flg_(nbtr_) 126 99 INTEGER,INTENT(IN) :: pbl_flg_(nbtr_) … … 142 115 INTEGER,INTENT(IN) :: ntraceurs_zone_ 143 116 INTEGER,INTENT(IN) :: ntraciso_ 144 INTEGER,INTENT(IN) :: itr_indice_(nqtottr_) 145 146 CHARACTER(LEN=30) :: modname="init_infotrac_phy" 117 118 INTEGER :: iq, itr 119 CHARACTER(LEN=maxlen), ALLOCATABLE :: tnames(:) 120 CHARACTER(LEN=maxlen) :: modname="init_infotrac_phy" 147 121 148 122 nqtot=nqtot_ … … 153 127 ALLOCATE(tracers(nqtot)); tracers(:) = tracers_(:) 154 128 #ifdef CPP_StratAer 155 nbtr_bin=nbtr_bin_ 156 nbtr_sulgas=nbtr_sulgas_ 157 id_OCS_strat=id_OCS_strat_ 158 id_SO2_strat=id_SO2_strat_ 159 id_H2SO4_strat=id_H2SO4_strat_ 160 id_BIN01_strat=id_BIN01_strat_ 129 IF (type_trac == 'coag') THEN 130 nbtr_bin = COUNT([(tracers(iq)%name(1:3)=='BIN', iq=1, nqtot)]) 131 nbtr_sulgas = COUNT([(tracers(iq)%name(1:3)=='GAS', iq=1, nqtot)]) 132 tnames = PACK(tracers(:)%name, MASK=.NOT.tracers(:)%isH2Ofamily) 133 id_BIN01_strat = strIdx(tnames, 'BIN01' ) 134 id_OCS_strat = strIdx(tnames, 'GASOSC' ) 135 id_SO2_strat = strIdx(tnames, 'GASSO2' ) 136 id_H2SO4_strat = strIdx(tnames, 'GASH2SO4') 137 id_TEST_strat = strIdx(tnames, 'GASTEST' ) 138 WRITE(lunout,*)'nbtr_bin =', nbtr_bin 139 WRITE(lunout,*)'nbtr_sulgas =', nbtr_sulgas 140 WRITE(lunout,*)'id_BIN01_strat =', id_BIN01_strat 141 WRITE(lunout,*)'id_OCS_strat =', id_OCS_strat 142 WRITE(lunout,*)'id_SO2_strat =', id_SO2_strat 143 WRITE(lunout,*)'id_H2SO4_strat =', id_H2SO4_strat 144 WRITE(lunout,*)'id_TEST_strat =', id_TEST_strat 145 END IF 161 146 #endif 162 147 type_trac = type_trac_ 163 ALLOCATE(niadv(nqtot))164 niadv(:)=niadv_(:)165 148 ALLOCATE(conv_flg(nbtr)) 166 149 conv_flg(:)=conv_flg_(:) … … 207 190 ENDIF ! of IF(ok_isotopes) 208 191 209 ALLOCATE(itr_indice(nqtottr)) 210 itr_indice(:)=itr_indice_(:) 211 192 WRITE(*,*) 'infotrac_phy 207: nqtottr=',nqtottr 193 WRITE(*,*) 'ntraciso,niso=',ntraciso,niso 194 #ifdef ISOVERIF 195 ! DC: the "1" will be replaced by iH2O (H2O isotopes group index) 196 WRITE(*,*) 'iso_iName=',PACK(tracers(:)%iso_iName, MASK=tracers(:)%iso_iGroup==1) 197 #endif 198 212 199 END SUBROUTINE init_infotrac_phy 213 200 -
LMDZ6/trunk/libf/phylmd/init_be.F90
r2351 r4056 5 5 6 6 USE dimphy 7 USE infotrac_phy, ONLY : nbtr8 7 USE indice_sol_mod 9 8 USE geometry_mod, ONLY : longitude, latitude -
LMDZ6/trunk/libf/phylmd/phyetat0.F90
r4046 r4056 21 21 ale_wake, ale_bl_stat, ds_ns, dt_ns, delta_sst, delta_sal, ratqs_inter 22 22 !FC 23 USE geometry_mod, ONLY: longitude_deg, latitude_deg24 USE iostart, ONLY: close_startphy, get_field, get_var, open_startphy25 USE infotrac_phy, only: nbtr, nqo, type_trac, tracers, niadv26 USE traclmdz_mod, ONLY: traclmdz_from_restart27 USE carbon_cycle_mod, ONLY 28 USE indice_sol_mod, only: nbsrf, is_ter, epsfra, is_lic, is_oce, is_sic29 USE ocean_slab_mod, ONLY: nslay, tslab, seaice, tice, ocean_slab_init23 USE geometry_mod, ONLY: longitude_deg, latitude_deg 24 USE iostart, ONLY: close_startphy, get_field, get_var, open_startphy 25 USE infotrac_phy, ONLY: nqtot, nbtr, type_trac, tracers 26 USE traclmdz_mod, ONLY: traclmdz_from_restart 27 USE carbon_cycle_mod, ONLY: carbon_cycle_tr, carbon_cycle_cpl, co2_send 28 USE indice_sol_mod, ONLY: nbsrf, is_ter, epsfra, is_lic, is_oce, is_sic 29 USE ocean_slab_mod, ONLY: nslay, tslab, seaice, tice, ocean_slab_init 30 30 USE time_phylmdz_mod, ONLY: init_iteration, pdtphys, itau_phy 31 31 #ifdef CPP_XIOS … … 75 75 INTEGER length 76 76 PARAMETER (length=100) 77 INTEGER it, i iq, isw77 INTEGER it, iq, isw 78 78 REAL tab_cntrl(length), tabcntr0(length) 79 79 CHARACTER*7 str7 … … 448 448 449 449 IF (type_trac == 'lmdz') THEN 450 DO it=1, nbtr 451 !! iiq=niadv(it+2) ! jyg 452 iiq=niadv(it+nqo) ! jyg 453 found=phyetat0_get(1,trs(:,it),"trs_"//TRIM(tracers(iiq)%name), & 454 "Surf trac"//TRIM(tracers(iiq)%name),0.) 455 ENDDO 450 it = 0 451 DO iq = 1, nqtot 452 IF(.NOT.tracers(iq)%isAdvected .OR. tracers(iq)%isH2Ofamily) CYCLE 453 it = it+1 454 found=phyetat0_get(1,trs(:,it),"trs_"//TRIM(tracers(iq)%name), & 455 "Surf trac"//TRIM(tracers(iq)%name),0.) 456 END DO 456 457 CALL traclmdz_from_restart(trs) 457 458 ENDIF 458 459 460 !--OB now this is for co2i - ThL: and therefore also for inco 459 461 IF (type_trac == 'co2i' .OR. type_trac == 'inco') THEN 460 462 IF (carbon_cycle_cpl) THEN … … 598 600 CALL get_field(name, field, found) 599 601 IF (.NOT. found) THEN 600 WRITE(lunout,*) "phyetat0: Le champ <", name,"> est absent"602 WRITE(lunout,*) "phyetat0: Le champ <",TRIM(name),"> est absent" 601 603 WRITE(lunout,*) "Depart legerement fausse. Mais je continue" 602 604 field(:,:)=default -
LMDZ6/trunk/libf/phylmd/phyredem.F90
r4046 r4056 35 35 USE iostart, ONLY: open_restartphy, close_restartphy, enddef_restartphy, put_field, put_var 36 36 USE traclmdz_mod, ONLY : traclmdz_to_restart 37 USE infotrac_phy, ONLY: type_trac, n iadv, tracers, nbtr, nqo37 USE infotrac_phy, ONLY: type_trac, nqtot, tracers, nbtr 38 38 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send 39 39 USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic, epsfra … … 70 70 CHARACTER (len=2) :: str2 71 71 CHARACTER (len=256) :: nam, lnam 72 INTEGER :: it, i iq, pass72 INTEGER :: it, iq, pass 73 73 74 74 !====================================================================== … … 326 326 IF (type_trac == 'lmdz') THEN 327 327 CALL traclmdz_to_restart(trs) 328 DO it=1, nbtr 329 !! iiq=niadv(it+2) ! jyg 330 iiq=niadv(it+nqo) ! jyg 331 CALL put_field(pass,"trs_"//tracers(iiq)%name, "", trs(:, it)) 328 it = 0 329 DO iq = 1, nqtot 330 IF(.NOT.tracers(iq)%isAdvected .OR. tracers(iq)%isH2Ofamily) CYCLE 331 it = it+1 332 CALL put_field(pass,"trs_"//tracers(iq)%name, "", trs(:, it)) 332 333 END DO 333 334 END IF … … 391 392 392 393 IMPLICIT NONE 393 INTEGER, INTENT(IN) 394 INTEGER, INTENT(IN) :: pass 394 395 CHARACTER(LEN=*), INTENT(IN) :: nam, lnam 395 396 REAL, INTENT(IN) :: field(:,:) -
LMDZ6/trunk/libf/phylmd/phys_output_mod.F90
r4046 r4056 35 35 USE iophy 36 36 USE dimphy 37 USE infotrac_phy, ONLY: nqtot, nqo, niadv, tracers, type_trac 38 USE strings_mod, ONLY: maxlen 37 USE infotrac_phy, ONLY: nqtot, tracers, type_trac, niso, ntraciso, maxlen 39 38 USE ioipsl 40 39 USE phys_cal_mod, only : hour, calend … … 96 95 CHARACTER(LEN=4), DIMENSION(nlevSTD) :: clevSTD 97 96 REAL, DIMENSION(nlevSTD) :: rlevSTD 98 INTEGER :: nsrf, k, iq, i iq, iff, i, j, ilev, jq97 INTEGER :: nsrf, k, iq, iff, i, j, ilev, itr, ixt, iiso, izone 99 98 INTEGER :: naero 100 99 LOGICAL :: ok_veget … … 115 114 LOGICAL, DIMENSION(nfiles) :: phys_out_filestations 116 115 117 CHARACTER(LEN=50) :: outiso118 CHARACTER(LEN=20) :: unit119 116 CHARACTER(LEN=maxlen) :: tnam, lnam, dn 120 117 INTEGER :: flag(nfiles) … … 122 119 !!!!!!!!!! stockage dans une region limitee pour chaque fichier !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 123 120 ! entre [phys_out_lonmin,phys_out_lonmax] et [phys_out_latmin,phys_out_latmax] 124 125 LOGICAL, DIMENSION(nfiles), SAVE :: phys_out_regfkey = (/ .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., & 126 .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /) 127 REAL, DIMENSION(nfiles), SAVE :: phys_out_lonmin = (/ -180., -180., -180., -180., -180., & 128 -180., -180., -180., -180., -180. /) 129 REAL, DIMENSION(nfiles), SAVE :: phys_out_lonmax = (/ 180., 180., 180., 180., 180., & 130 180., 180., 180., 180., 180. /) 131 REAL, DIMENSION(nfiles), SAVE :: phys_out_latmin = (/ -90., -90., -90., -90., -90., & 132 -90., -90., -90., -90., -90. /) 133 REAL, DIMENSION(nfiles), SAVE :: phys_out_latmax = (/ 90., 90., 90., 90., 90., & 134 90., 90., 90., 90., 90. /) 121 LOGICAL, DIMENSION(nfiles), SAVE :: & 122 phys_out_regfkey = [.FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE.] 123 REAL, DIMENSION(nfiles), SAVE :: & 124 phys_out_lonmin = [ -180., -180., -180., -180., -180., -180., -180., -180., -180., -180.], & 125 phys_out_lonmax = [ 180., 180., 180., 180., 180., 180., 180., 180., 180., 180.], & 126 phys_out_latmin = [ -90., -90., -90., -90., -90., -90., -90., -90., -90., -90.], & 127 phys_out_latmax = [ 90., 90., 90., 90., 90., 90., 90., 90., 90., 90.] 135 128 REAL, DIMENSION(klev,2) :: Ahyb_bounds, Bhyb_bounds 136 129 REAL, DIMENSION(klev+1) :: lev_index … … 169 162 ALLOCATE(o_dtr_dry(nqtot),o_dtr_vdf(nqtot)) 170 163 171 levmax = (/ klev, klev, klev, klev, klev, klev, nlevSTD, nlevSTD, nlevSTD, klev /)164 levmax = [klev, klev, klev, klev, klev, klev, nlevSTD, nlevSTD, nlevSTD, klev] 172 165 173 166 phys_out_filenames(1) = 'histmth' … … 366 359 CALL wxios_add_vaxis("bnds", 2, (/1.,2./)) 367 360 368 361 CALL wxios_add_vaxis("Alt", & 369 362 levmax(iff) - levmin(iff) + 1, pseudoalt) 370 363 371 IF (NSW.EQ.6) THEN 372 ! 373 !wl1_sun: minimum bound of wavelength (in um) 374 ! 375 wl1_sun(1)=0.180 376 wl1_sun(2)=0.250 377 wl1_sun(3)=0.440 378 wl1_sun(4)=0.690 379 wl1_sun(5)=1.190 380 wl1_sun(6)=2.380 381 ! 382 !wl2_sun: maximum bound of wavelength (in um) 383 ! 384 wl2_sun(1)=0.250 385 wl2_sun(2)=0.440 386 wl2_sun(3)=0.690 387 wl2_sun(4)=1.190 388 wl2_sun(5)=2.380 389 wl2_sun(6)=4.000 390 ! 391 ELSE IF(NSW.EQ.2) THEN 392 ! 393 !wl1_sun: minimum bound of wavelength (in um) 394 ! 395 wl1_sun(1)=0.250 396 wl1_sun(2)=0.690 397 ! 398 !wl2_sun: maximum bound of wavelength (in um) 399 ! 400 wl2_sun(1)=0.690 401 wl2_sun(2)=4.000 402 ENDIF 364 ! wl1_sun/wl2_sun: minimum/maximum bound of wavelength (in um) 365 SELECT CASE(NSW) 366 CASE(6) 367 wl1_sun(1:6) = [0.180, 0.250, 0.440, 0.690, 1.190, 2.380] 368 wl2_sun(1:6) = [0.250, 0.440, 0.690, 1.190, 2.380, 4.000] 369 CASE(2) 370 wl1_sun(1:2) = [0.250, 0.690] 371 wl2_sun(1:2) = [0.690, 4.000] 372 END SELECT 403 373 404 374 DO ISW=1, NSW … … 498 468 ENDIF ! clef_files 499 469 500 IF (nqtot>=nqo+1) THEN501 ! 502 DO iq=nqo+1,nqtot503 i iq=niadv(iq); jq = iq-nqo504 dn = 'd'//TRIM(tracers(i iq)%name)//'_'470 itr = 0 471 DO iq = 1, nqtot 472 IF(.NOT.tracers(iq)%isAdvected .OR. tracers(iq)%isH2Ofamily) CYCLE 473 itr = itr + 1 474 dn = 'd'//TRIM(tracers(iq)%name)//'_' 505 475 506 476 flag = [1, 5, 5, 5, 10, 10, 11, 11, 11, 11] 507 lnam = 'Tracer '//TRIM(tracers(iiq)%longName) 508 tnam = TRIM(tracers(iiq)%name); o_trac (jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 477 lnam = 'Tracer '//TRIM(tracers(iq)%longName) 478 tnam = TRIM(tracers(iq)%name); o_trac (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 479 509 480 flag = [4, 7, 7, 7, 10, 10, 11, 11, 11, 11] 510 lnam = 'Tendance tracer '//TRIM(tracers(i iq)%longName)511 tnam = TRIM(dn)//'vdf'; o_dtr_vdf ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])481 lnam = 'Tendance tracer '//TRIM(tracers(iq)%longName) 482 tnam = TRIM(dn)//'vdf'; o_dtr_vdf (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 512 483 513 484 flag = [5, 7, 7, 7, 10, 10, 11, 11, 11, 11] 514 tnam = TRIM(dn)//'the'; o_dtr_the ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])515 tnam = TRIM(dn)//'con'; o_dtr_con ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])485 tnam = TRIM(dn)//'the'; o_dtr_the (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 486 tnam = TRIM(dn)//'con'; o_dtr_con (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 516 487 517 488 flag = [7, 7, 7, 7, 10, 10, 11, 11, 11, 11] 518 tnam = TRIM(dn)//'lessi_impa'; o_dtr_lessi_impa( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])519 tnam = TRIM(dn)//'lessi_nucl'; o_dtr_lessi_nucl( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])520 tnam = TRIM(dn)//'insc'; o_dtr_insc ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])521 tnam = TRIM(dn)//'bcscav'; o_dtr_bcscav ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])522 tnam = TRIM(dn)//'evapls'; o_dtr_evapls ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])523 tnam = TRIM(dn)//'ls'; o_dtr_ls ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])524 tnam = TRIM(dn)//'trsp'; o_dtr_trsp ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])525 tnam = TRIM(dn)//'sscav'; o_dtr_sscav ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])526 tnam = TRIM(dn)//'sat'; o_dtr_sat ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])527 tnam = TRIM(dn)//'uscav'; o_dtr_uscav ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])528 529 lnam = 'tracer tendency dry deposition'//TRIM(tracers(i iq)%longName)530 tnam = 'cum'//TRIM(dn)//'dry'; o_dtr_dry ( jq) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])489 tnam = TRIM(dn)//'lessi_impa'; o_dtr_lessi_impa(itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 490 tnam = TRIM(dn)//'lessi_nucl'; o_dtr_lessi_nucl(itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 491 tnam = TRIM(dn)//'insc'; o_dtr_insc (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 492 tnam = TRIM(dn)//'bcscav'; o_dtr_bcscav (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 493 tnam = TRIM(dn)//'evapls'; o_dtr_evapls (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 494 tnam = TRIM(dn)//'ls'; o_dtr_ls (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 495 tnam = TRIM(dn)//'trsp'; o_dtr_trsp (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 496 tnam = TRIM(dn)//'sscav'; o_dtr_sscav (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 497 tnam = TRIM(dn)//'sat'; o_dtr_sat (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 498 tnam = TRIM(dn)//'uscav'; o_dtr_uscav (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 499 500 lnam = 'tracer tendency dry deposition'//TRIM(tracers(iq)%longName) 501 tnam = 'cum'//TRIM(dn)//'dry'; o_dtr_dry (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 531 502 532 503 flag = [1, 4, 10, 10, 10, 10, 11, 11, 11, 11] 533 lnam = 'Cumulated tracer '//TRIM(tracers(i iq)%longName)534 tnam = 'cum'//TRIM(tracers(i iq)%name); o_trac_cum(jq)= ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])504 lnam = 'Cumulated tracer '//TRIM(tracers(iq)%longName) 505 tnam = 'cum'//TRIM(tracers(iq)%name); o_trac_cum(itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 535 506 ENDDO 536 ENDIF537 507 538 508 ENDDO ! iff … … 555 525 ENDIF 556 526 557 ! DO iq=nqo+1,nqtot 558 ! iiq=niadv(iq) 559 ! dn = 'd'//TRIM(tracers(iiq)%name)//'_' 560 ! WRITE(*,'(a,i1,a,10i3)')'trac(',iiq,')%flag = ',o_trac(iiq)%flag 561 ! WRITE(*,'(a,i1,a)')'trac(',iiq,')%tnam = '//TRIM(o_trac(iiq)%name) 562 ! WRITE(*,'(a,i1,a)')'trac(',iiq,')%lnam = '//TRIM(o_trac(iiq)%description) 527 ! DO iq=1,nqtot 528 ! IF(.NOT.tracers(iq)%isAdvected .OR. tracers(iq)%isH2Ofamily) CYCLE 529 ! WRITE(*,'(a,i1,a,10i3)')'trac(',iq,')%flag = ',o_trac(iq)%flag 530 ! WRITE(*,'(a,i1,a)')'trac(',iq,')%name = '//TRIM(o_trac(iq)%name) 531 ! WRITE(*,'(a,i1,a)')'trac(',iq,')%description = '//TRIM(o_trac(iq)%description) 563 532 ! END DO 564 533 -
LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90
r4046 r4056 25 25 26 26 USE dimphy, ONLY: klon, klev, klevp1 27 USE infotrac_phy, ONLY: nbtr, nqtot, nqo, type_trac, tracers, ni adv27 USE infotrac_phy, ONLY: nbtr, nqtot, nqo, type_trac, tracers, niso, ntraciso, maxlen 28 28 USE strings_mod, ONLY: maxlen 29 29 USE mod_phys_lmdz_para, ONLY: is_north_pole_phy,is_south_pole_phy … … 198 198 o_map_emis_Anv, o_map_pcld_Anv, o_map_tcld_Anv, & 199 199 o_map_ntot, o_map_hc,o_map_hist,o_map_Cb,o_map_ThCi,o_map_Anv, & 200 #ifdef ISO 201 ! Isotopes 202 o_xtprecip,o_xtplul,o_xtpluc,o_xtovap,o_xtoliq,o_xtcond, & 203 o_xtevap,o_dxtdyn,o_dxtldyn,o_dxtcon,o_dxtlsc,o_dxteva, & 204 o_dxtajs,o_dxtvdf,o_dxtthe, o_dxtch4, & 205 o_dxtprod_nucl,o_dxtcosmo,o_dxtdecroiss, & 206 #endif 207 ! Tropopause 200 208 o_alt_tropo, & 201 ! Tropopause202 209 o_p_tropopause, o_z_tropopause, o_t_tropopause, & 203 210 o_col_O3_strato, o_col_O3_tropo, & … … 254 261 rhlevSTD, O3STD, O3daySTD, uvSTD, vqSTD, vTSTD, wqSTD, vphiSTD, & 255 262 wTSTD, u2STD, v2STD, T2STD, missing_val_nf90, delta_sal, ds_ns, & 263 #ifdef ISO 264 xtrain_con, xtsnow_con, xtrain_fall, xtsnow_fall, & 265 #endif 256 266 dt_ns, delta_sst 257 267 … … 320 330 east_gwstress, west_gwstress, & 321 331 d_q_ch4, pmfd, pmfu, ref_liq, ref_ice, rhwriteSTD, & 332 #ifdef ISO 333 xtrain_lsc, xtsnow_lsc, xt_seri, xtl_seri,xts_seri,xtevap, & 334 d_xt_dyn,d_xtl_dyn,d_xt_con,d_xt_vdf,d_xt_ajsb, & 335 d_xt_lsc,d_xt_eva,d_xt_ch4, & 336 d_xt_ajs, d_xt_ajsb, & 337 d_xt_prod_nucl,d_xt_cosmo,d_xt_decroiss, & 338 #endif 322 339 ep, epmax_diag, & ! epmax_cape 323 340 p_tropopause, t_tropopause, z_tropopause … … 367 384 USE pbl_surface_mod, ONLY: snow 368 385 USE indice_sol_mod, ONLY: nbsrf 386 #ifdef ISO 387 USE isotopes_mod, ONLY: iso_HTO 388 #endif 369 389 USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg 370 390 USE surface_data, ONLY: type_ocean, version_ocean, ok_veget, landice_opt … … 419 439 ! Local 420 440 INTEGER :: itau_w 421 INTEGER :: i, iinit, iinitend=1, iff, iq, iiq,nsrf, k, ll, naero441 INTEGER :: i, iinit, iinitend=1, iff, iq, nsrf, k, ll, naero 422 442 REAL, DIMENSION (klon) :: zx_tmp_fi2d, zpt_conv2d, wind100m 423 443 REAL, DIMENSION (klon,klev) :: zx_tmp_fi3d, zpt_conv … … 439 459 #endif 440 460 REAL, PARAMETER :: un_jour=86400. 441 INTEGER ISW461 INTEGER :: ISW, itr, ixt, it 442 462 CHARACTER*1 ch1 443 463 CHARACTER(LEN=maxlen) :: varname, dn … … 452 472 REAL,DIMENSION(klon,klev) :: z, dz 453 473 REAL,DIMENSION(klon) :: zrho, zt 454 455 INTEGER :: nqup456 457 474 458 475 ! On calcul le nouveau tau: … … 511 528 CALL xios_get_handle("fields_strataer_trac_3D", group_handle) 512 529 ! On boucle sur les traceurs pour les ajouter au groupe puis fixer les attributs 513 DO iq =nqo+1, nqtot514 iiq=niadv(iq)515 dn = 'd'//TRIM(tracers(i iq)%name)//'_'516 WRITE (lunout,*) 'XIOS var=', nqo, iq, nqtot, tracers(i iq)%name530 DO iq = 1, nqtot 531 IF(.NOT.tracers(iq)%isAdvected .OR. tracers(iq)%isH2Ofamily) CYCLE 532 dn = 'd'//TRIM(tracers(iq)%name)//'_' 533 WRITE (lunout,*) 'XIOS var=', nqo, iq, nqtot, tracers(iq)%name 517 534 518 535 unt = "kg kg-1" 519 varname=trim(tracers(i iq)%name)536 varname=trim(tracers(iq)%name) 520 537 CALL xios_add_child(group_handle, child, varname) 521 538 CALL xios_set_attr(child, name=varname, unit=unt) … … 561 578 CALL xios_add_child(group_handle, child, varname) 562 579 CALL xios_set_attr(child, name=varname, unit=unt) 563 END DO580 END DO 564 581 !On ajoute les variables 2D traceurs par l interface fortran 565 582 CALL xios_get_handle("fields_strataer_trac_2D", group_handle) 566 583 ! On boucle sur les traceurs pour les ajouter au groupe puis fixer les attributs 567 DO iq =nqo+1, nqtot568 iiq=niadv(iq)584 DO iq = 1, nqtot 585 IF(.NOT.tracers(iq)%isAdvected .OR. tracers(iq)%isH2Ofamily) CYCLE 569 586 570 587 unt = "kg m-2" 571 varname='cum'//trim(tracers(i iq)%name)588 varname='cum'//trim(tracers(iq)%name) 572 589 WRITE (lunout,*) 'XIOS var=', iq, nqtot, varname 573 590 CALL xios_add_child(group_handle, child, varname) … … 575 592 576 593 unt = "kg m-2 s-1" 577 varname='cumd'//trim(tracers(i iq)%name)//'_dry'594 varname='cumd'//trim(tracers(iq)%name)//'_dry' 578 595 CALL xios_add_child(group_handle, child, varname) 579 596 CALL xios_set_attr(child, name=varname, unit=unt) … … 611 628 ENDIf 612 629 CALL histwrite_phy(o_aire, zx_tmp_fi2d) 630 613 631 IF (vars_defined) THEN 614 632 DO i=1, klon … … 2408 2426 IF (iflag_phytrac == 1 ) then 2409 2427 IF (type_trac == 'lmdz' .OR. type_trac == 'coag') THEN 2410 DO iq=nqo+1, nqtot 2428 itr = 0 2429 DO iq = 1, nqtot 2430 IF(tracers(iq)%isH2Ofamily) CYCLE 2431 itr = itr + 1 2432 ! write(*,*) 'phys_output_write_mod 2337: itr=',itr 2411 2433 !--3D fields 2412 CALL histwrite_phy(o_trac(i q-nqo), tr_seri(:,:,iq-nqo))2413 CALL histwrite_phy(o_dtr_vdf(i q-nqo),d_tr_cl(:,:,iq-nqo))2414 CALL histwrite_phy(o_dtr_the(i q-nqo),d_tr_th(:,:,iq-nqo))2415 CALL histwrite_phy(o_dtr_con(i q-nqo),d_tr_cv(:,:,iq-nqo))2416 CALL histwrite_phy(o_dtr_lessi_impa(i q-nqo),d_tr_lessi_impa(:,:,iq-nqo))2417 CALL histwrite_phy(o_dtr_lessi_nucl(i q-nqo),d_tr_lessi_nucl(:,:,iq-nqo))2418 CALL histwrite_phy(o_dtr_insc(i q-nqo),d_tr_insc(:,:,iq-nqo))2419 CALL histwrite_phy(o_dtr_bcscav(i q-nqo),d_tr_bcscav(:,:,iq-nqo))2420 CALL histwrite_phy(o_dtr_evapls(i q-nqo),d_tr_evapls(:,:,iq-nqo))2421 CALL histwrite_phy(o_dtr_ls(i q-nqo),d_tr_ls(:,:,iq-nqo))2422 CALL histwrite_phy(o_dtr_trsp(i q-nqo),d_tr_trsp(:,:,iq-nqo))2423 CALL histwrite_phy(o_dtr_sscav(i q-nqo),d_tr_sscav(:,:,iq-nqo))2424 CALL histwrite_phy(o_dtr_sat(i q-nqo),d_tr_sat(:,:,iq-nqo))2425 CALL histwrite_phy(o_dtr_uscav(i q-nqo),d_tr_uscav(:,:,iq-nqo))2434 CALL histwrite_phy(o_trac(itr), tr_seri(:,:,itr)) 2435 CALL histwrite_phy(o_dtr_vdf(itr),d_tr_cl(:,:,itr)) 2436 CALL histwrite_phy(o_dtr_the(itr),d_tr_th(:,:,itr)) 2437 CALL histwrite_phy(o_dtr_con(itr),d_tr_cv(:,:,itr)) 2438 CALL histwrite_phy(o_dtr_lessi_impa(itr),d_tr_lessi_impa(:,:,itr)) 2439 CALL histwrite_phy(o_dtr_lessi_nucl(itr),d_tr_lessi_nucl(:,:,itr)) 2440 CALL histwrite_phy(o_dtr_insc(itr),d_tr_insc(:,:,itr)) 2441 CALL histwrite_phy(o_dtr_bcscav(itr),d_tr_bcscav(:,:,itr)) 2442 CALL histwrite_phy(o_dtr_evapls(itr),d_tr_evapls(:,:,itr)) 2443 CALL histwrite_phy(o_dtr_ls(itr),d_tr_ls(:,:,itr)) 2444 CALL histwrite_phy(o_dtr_trsp(itr),d_tr_trsp(:,:,itr)) 2445 CALL histwrite_phy(o_dtr_sscav(itr),d_tr_sscav(:,:,itr)) 2446 CALL histwrite_phy(o_dtr_sat(itr),d_tr_sat(:,:,itr)) 2447 CALL histwrite_phy(o_dtr_uscav(itr),d_tr_uscav(:,:,itr)) 2426 2448 !--2D fields 2427 CALL histwrite_phy(o_dtr_dry(i q-nqo), flux_tr_dry(:,iq-nqo))2449 CALL histwrite_phy(o_dtr_dry(itr), flux_tr_dry(:,itr)) 2428 2450 zx_tmp_fi2d=0. 2429 2451 IF (vars_defined) THEN 2430 2452 DO k=1,klev 2431 zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,i q-nqo)2453 zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,itr) 2432 2454 ENDDO 2433 2455 ENDIF 2434 CALL histwrite_phy(o_trac_cum(i q-nqo), zx_tmp_fi2d)2456 CALL histwrite_phy(o_trac_cum(itr), zx_tmp_fi2d) 2435 2457 ENDDO !--iq 2436 2458 ENDIF !--type_trac 2437 2459 ! 2438 2460 IF (type_trac == 'co2i') THEN 2439 DO iq=nqo+1, nqtot 2461 itr = 0 2462 DO iq = 1, nqtot 2463 IF(tracers(iq)%isH2Ofamily) CYCLE 2464 itr = itr + 1 2465 ! write(*,*) 'phys_output_write_mod 2370: itr=',itr 2440 2466 !--3D fields 2441 CALL histwrite_phy(o_trac(i q-nqo), tr_seri(:,:,iq-nqo))2442 CALL histwrite_phy(o_dtr_vdf(i q-nqo),d_tr_cl(:,:,iq-nqo))2443 CALL histwrite_phy(o_dtr_the(i q-nqo),d_tr_th(:,:,iq-nqo))2444 CALL histwrite_phy(o_dtr_con(i q-nqo),d_tr_cv(:,:,iq-nqo))2467 CALL histwrite_phy(o_trac(itr), tr_seri(:,:,itr)) 2468 CALL histwrite_phy(o_dtr_vdf(itr),d_tr_cl(:,:,itr)) 2469 CALL histwrite_phy(o_dtr_the(itr),d_tr_th(:,:,itr)) 2470 CALL histwrite_phy(o_dtr_con(itr),d_tr_cv(:,:,itr)) 2445 2471 !--2D fields 2446 2472 !--CO2 burden … … 2448 2474 IF (vars_defined) THEN 2449 2475 DO k=1,klev 2450 zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,i q-nqo)2476 zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,itr) 2451 2477 ENDDO 2452 2478 ENDIF 2453 CALL histwrite_phy(o_trac_cum(i q-nqo), zx_tmp_fi2d)2479 CALL histwrite_phy(o_trac_cum(itr), zx_tmp_fi2d) 2454 2480 ENDDO !--iq 2455 2481 !--CO2 net fluxes … … 2463 2489 2464 2490 IF (type_trac == 'inco') THEN 2465 nqup = nqo+1 2466 DO iq=nqo+1, nqup 2491 DO iq = 1, nqtot 2492 IF(tracers(iq)%isH2Ofamily .OR. .NOT.tracers(iq)%isAdvected) CYCLE 2493 itr = itr+1 2494 IF(tracers(iq)%component /= 'co2i') CYCLE 2467 2495 !--3D fields 2468 CALL histwrite_phy(o_trac (iq-nqo), tr_seri(:,:,iq-nqo))2469 CALL histwrite_phy(o_dtr_vdf(i q-nqo),d_tr_cl(:,:,iq-nqo))2470 CALL histwrite_phy(o_dtr_the(i q-nqo),d_tr_th(:,:,iq-nqo))2471 CALL histwrite_phy(o_dtr_con(i q-nqo),d_tr_cv(:,:,iq-nqo))2496 CALL histwrite_phy(o_trac (itr),tr_seri(:,:,itr)) 2497 CALL histwrite_phy(o_dtr_vdf(itr),d_tr_cl(:,:,itr)) 2498 CALL histwrite_phy(o_dtr_the(itr),d_tr_th(:,:,itr)) 2499 CALL histwrite_phy(o_dtr_con(itr),d_tr_cv(:,:,itr)) 2472 2500 !--2D fields 2473 2501 !--CO2 burden … … 2475 2503 IF (vars_defined) THEN 2476 2504 DO k=1,klev 2477 zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,i q-nqo)2505 zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,itr) 2478 2506 ENDDO 2479 2507 ENDIF 2480 CALL histwrite_phy(o_trac_cum(i q-nqo), zx_tmp_fi2d)2508 CALL histwrite_phy(o_trac_cum(itr), zx_tmp_fi2d) 2481 2509 ENDDO !--iq 2482 2510 !--CO2 net fluxes … … 2504 2532 end if 2505 2533 2534 #ifdef ISO 2535 do ixt=1,ntraciso 2536 ! write(*,*) 'ixt' 2537 IF (vars_defined) zx_tmp_fi2d(:) = xtrain_fall(ixt,:) + xtsnow_fall(ixt,:) 2538 CALL histwrite_phy(o_xtprecip(ixt), zx_tmp_fi2d) 2539 2540 IF (vars_defined) zx_tmp_fi2d(:) = xtrain_lsc(ixt,:) + xtsnow_lsc(ixt,:) 2541 CALL histwrite_phy(o_xtplul(ixt), zx_tmp_fi2d) 2542 2543 IF (vars_defined) zx_tmp_fi2d(:) = xtrain_con(ixt,:) + xtsnow_con(ixt,:) 2544 CALL histwrite_phy(o_xtpluc(ixt), zx_tmp_fi2d) 2545 CALL histwrite_phy(o_xtevap(ixt), xtevap(ixt,:)) 2546 CALL histwrite_phy(o_xtovap(ixt), xt_seri(ixt,:,:)) 2547 CALL histwrite_phy(o_xtoliq(ixt), xtl_seri(ixt,:,:)) 2548 2549 IF (vars_defined) zx_tmp_fi3d(:,:)=xtl_seri(ixt,:,:)+xts_seri(ixt,:,:) 2550 CALL histwrite_phy(o_xtcond(ixt), zx_tmp_fi3d) 2551 CALL histwrite_phy(o_dxtdyn(ixt), d_xt_dyn(ixt,:,:)) 2552 CALL histwrite_phy(o_dxtldyn(ixt), d_xtl_dyn(ixt,:,:)) 2553 2554 IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_con(ixt,:,:)/pdtphys 2555 CALL histwrite_phy(o_dxtcon(ixt), zx_tmp_fi3d) 2556 2557 IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_lsc(ixt,:,:)/pdtphys 2558 CALL histwrite_phy(o_dxtlsc(ixt), zx_tmp_fi3d) 2559 2560 IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_eva(ixt,:,:)/pdtphys 2561 CALL histwrite_phy(o_dxteva(ixt), zx_tmp_fi3d) 2562 2563 IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_vdf(ixt,:,:)/pdtphys 2564 CALL histwrite_phy(o_dxtvdf(ixt), zx_tmp_fi3d) 2565 2566 IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_ajsb(ixt,:,:)/pdtphys 2567 CALL histwrite_phy(o_dxtajs(ixt), zx_tmp_fi3d) 2568 2569 IF (vars_defined) zx_tmp_fi3d(:,:)=(d_xt_ajs(ixt,:,:)-d_xt_ajsb(ixt,:,:))/pdtphys 2570 CALL histwrite_phy(o_dxtthe(ixt), zx_tmp_fi3d) 2571 2572 IF (ok_qch4) THEN 2573 IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_ch4(ixt,:,:)/pdtphys 2574 CALL histwrite_phy(o_dxtch4(ixt), zx_tmp_fi3d) 2575 END IF 2576 2577 IF (ixt == iso_HTO) THEN 2578 IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_prod_nucl(ixt,:,:)/pdtphys 2579 CALL histwrite_phy(o_dxtprod_nucl(ixt), zx_tmp_fi3d) 2580 2581 IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_cosmo(ixt,:,:)/pdtphys 2582 CALL histwrite_phy(o_dxtcosmo(ixt), zx_tmp_fi3d) 2583 2584 IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_decroiss(ixt,:,:)/pdtphys 2585 CALL histwrite_phy(o_dxtdecroiss(ixt), zx_tmp_fi3d) 2586 END IF 2587 2588 !write(*,*) 'phys_output_write_mod 2531' 2589 enddo !do ixt=1,ntraciso 2590 #endif 2591 2506 2592 IF (.NOT.vars_defined) THEN 2507 2593 !$OMP MASTER -
LMDZ6/trunk/libf/phylmd/physiq_mod.F90
r4009 r4056 39 39 USE ioipsl_getin_p_mod, ONLY : getin_p 40 40 USE indice_sol_mod 41 USE infotrac_phy, ONLY: nqtot, nbtr, nqo, type_trac, nqCO2 41 USE infotrac_phy, ONLY: nqtot, nbtr, nqo, tracers, type_trac, nqCO2 42 USE readTracFiles_mod, ONLY: phases_sep 43 USE strings_mod, ONLY: strIdx 42 44 USE iophy 43 45 USE limit_read_mod, ONLY : init_limit_read … … 146 148 ! 147 149 d_t_vdf,d_q_vdf,d_u_vdf,d_v_vdf,d_t_diss, & 150 d_t_vdf_x, d_t_vdf_w, & 151 d_q_vdf_x, d_q_vdf_w, & 148 152 d_ts, & 149 153 ! … … 218 222 zxfluxlat_x, zxfluxlat_w, & 219 223 ! 220 d_t_vdf_x, d_t_vdf_w, &221 d_q_vdf_x, d_q_vdf_w, &222 224 pbl_tke_input, tke_dissip, l_mix, wprime,& 223 225 t_therm, q_therm, u_therm, v_therm, & … … 356 358 LOGICAL, SAVE :: ok_volcan ! pour activer les diagnostics volcaniques 357 359 !$OMP THREADPRIVATE(ok_volcan) 358 INTEGER, SAVE :: flag_volc_surfstrat ! pour imposer le cool/heat rate à la surf ou dans la strato360 INTEGER, SAVE :: flag_volc_surfstrat ! pour imposer le cool/heat rate à la surf/strato 359 361 !$OMP THREADPRIVATE(flag_volc_surfstrat) 360 362 LOGICAL ok_cvl ! pour activer le nouveau driver pour convection KE … … 854 856 real zqsat(klon,klev) 855 857 ! 856 INTEGER i, k, iq, j, nsrf, ll, l 858 INTEGER i, k, iq, j, nsrf, ll, l, itr 857 859 ! 858 860 REAL t_coup … … 1035 1037 1036 1038 CHARACTER (LEN=20) :: modname='physiq_mod' 1037 CHARACTER*80 message,abort_message1039 CHARACTER*80 abort_message 1038 1040 LOGICAL, SAVE :: ok_sync, ok_sync_omp 1039 1041 !$OMP THREADPRIVATE(ok_sync) … … 1363 1365 iflag_phytrac = 1 1364 1366 ENDIF 1365 #endif 1367 #endif 1366 1368 nvm_lmdz = 13 1367 1369 CALL getin_p('NVM',nvm_lmdz) … … 2230 2232 2231 2233 tke0(:,:)=pbl_tke(:,:,is_ave) 2232 !CR:Nombre de traceurs de l'eau: nqo 2233 ! IF (nqtot.GE.3) THEN 2234 IF (nqtot.GE.(nqo+1)) THEN 2235 ! DO iq = 3, nqtot 2236 DO iq = nqo+1, nqtot 2234 IF (nqtot > nqo) THEN 2235 ! water isotopes are not included in tr_seri 2236 itr = 0 2237 DO iq = 1, nqtot 2238 IF(tracers(iq)%isH2Ofamily) CYCLE 2239 itr = itr+1 2237 2240 DO k = 1, klev 2238 2241 DO i = 1, klon 2239 ! tr_seri(i,k,iq-2) = qx(i,k,iq) 2240 tr_seri(i,k,iq-nqo) = qx(i,k,iq) 2242 tr_seri(i,k,itr) = qx(i,k,iq) 2241 2243 ENDDO 2242 2244 ENDDO 2243 2245 ENDDO 2244 2246 ELSE 2245 DO k = 1, klev 2246 DO i = 1, klon 2247 tr_seri(i,k,1) = 0.0 2248 ENDDO 2249 ENDDO 2247 ! DC: make sure the final "1" index was meant for 1st H2O phase (vapor) !!! 2248 ! tr_seri(:,:,strIdx(tracers(:)%name,'H2O'//phases_sep//'g')) = 0.0 2249 tr_seri(:,:,strIdx(tracers(:)%name,'H2Ov')) = 0.0 2250 2250 ENDIF 2251 2251 ! … … 2254 2254 IF (debut) THEN 2255 2255 WRITE(lunout,*)' WARNING: tr_ancien initialised to tr_seri' 2256 DO iq = nqo+1, nqtot 2257 tr_ancien(:,:,iq-nqo)=tr_seri(:,:,iq-nqo) 2258 ENDDO 2256 itr = 0 2257 do iq = 1, nqtot 2258 IF(tracers(iq)%isH2Ofamily) CYCLE 2259 itr = itr+1 2260 tr_ancien(:,:,itr)=tr_seri(:,:,itr) 2261 enddo 2259 2262 ENDIF 2260 2263 ! … … 2287 2290 d_qs_dyn2d(:)=(zx_tmp_fi2d(:)-prsw_ancien(:))/phys_tstep 2288 2291 ! !! RomP >>> td dyn traceur 2289 IF (nqtot.GT.nqo) THEN ! jyg 2290 DO iq = nqo+1, nqtot ! jyg 2291 d_tr_dyn(:,:,iq-nqo)=(tr_seri(:,:,iq-nqo)-tr_ancien(:,:,iq-nqo))/phys_tstep ! jyg 2292 ENDDO 2293 ENDIF 2292 IF (nqtot > nqo) d_tr_dyn(:,:,:)=(tr_seri(:,:,:)-tr_ancien(:,:,:))/phys_tstep 2294 2293 ! !! RomP <<< 2295 2294 ELSE … … 2304 2303 d_qs_dyn2d(:) = 0.0 2305 2304 ! !! RomP >>> td dyn traceur 2306 IF (nqtot.GT.nqo) THEN ! jyg 2307 DO iq = nqo+1, nqtot ! jyg 2308 d_tr_dyn(:,:,iq-nqo)= 0.0 ! jyg 2309 ENDDO 2310 ENDIF 2305 IF (nqtot > nqo) d_tr_dyn(:,:,:)= 0.0 2311 2306 ! !! RomP <<< 2312 2307 ancien_ok = .TRUE. … … 2589 2584 debut, lafin, & 2590 2585 longitude_deg, latitude_deg, rugoro, zrmu0, & 2591 2586 sollwdown, cldt, & 2592 2587 rain_fall, snow_fall, solsw, solswfdiff, sollw, & 2593 2588 gustiness, & … … 2857 2852 ENDDO 2858 2853 ELSE 2859 t_w(:,:) = t_seri(:,:)2854 t_w(:,:) = t_seri(:,:) 2860 2855 q_w(:,:) = q_seri(:,:) 2861 2856 t_x(:,:) = t_seri(:,:) … … 3073 3068 3074 3069 DO i = 1, klon 3075 ema_pcb(i) = paprs(i,ibas_con(i)) 3070 ! C Risi modif: pour éviter pb de dépassement d'indice dans les cas 3071 ! où i n'est pas un point convectif et donc ibas_con(i)=0 3072 ! c'est un pb indépendant des isotopes 3073 if (ibas_con(i) > 0) then 3074 ema_pcb(i) = paprs(i,ibas_con(i)) 3075 else 3076 ema_pcb(i) = 0.0 3077 endif 3076 3078 ENDDO 3077 3079 DO i = 1, klon … … 3504 3506 wprime_ave(:,:)=0. 3505 3507 3506 3507 3508 DO nsrf = 1, nbsrf 3508 3509 DO i = 1, klon … … 3512 3513 ENDDO 3513 3514 ENDDO 3514 3515 3515 3516 3516 CALL calcratqs(klon,klev,prt_level,lunout, & … … 3530 3530 print *,'itap, ->fisrtilp ',itap 3531 3531 ENDIF 3532 ! 3532 3533 3533 3534 picefra(:,:)=0. … … 3556 3557 iflag_ice_thermo) 3557 3558 ENDIF 3559 ! 3558 3560 WHERE (rain_lsc < 0) rain_lsc = 0. 3559 3561 WHERE (snow_lsc < 0) snow_lsc = 0. … … 4267 4269 4268 4270 #ifndef CPP_XIOS 4269 4271 !--OB 30/05/2016 modified 21/10/2016 4272 !--here we return swaero_diag and dryaod_diag to FALSE 4273 !--and histdef will switch it back to TRUE if necessary 4274 !--this is necessary to get the right swaero at first step 4275 !--but only in the case of no XIOS as XIOS is covered elsewhere 4276 IF (debut) swaerofree_diag = .FALSE. 4277 IF (debut) swaero_diag = .FALSE. 4278 IF (debut) dryaod_diag = .FALSE. 4279 !--IM 15/09/2017 here we return ok_4xCO2atm to FALSE 4280 !--as for swaero_diag, see above 4281 IF (debut) ok_4xCO2atm = .FALSE. 4282 4283 ! 4270 4284 !IM 2eme calcul radiatif pour le cas perturbe ou au moins un 4271 4285 !IM des taux doit etre different du taux actuel … … 5052 5066 ENDDO 5053 5067 ! 5054 !CR: nb de traceurs eau: nqo5055 ! IF (nqtot.GE.3) THEN5056 IF (nqtot.GE.(nqo+1)) THEN5057 ! DO iq = 3, nqtot5058 DO iq = nqo+1, nqtot5068 IF (nqtot > nqo+1) THEN 5069 itr = 0 5070 DO iq = 1, nqtot 5071 IF(tracers(iq)%isH2Ofamily) CYCLE 5072 itr = itr+1 5059 5073 DO k = 1, klev 5060 5074 DO i = 1, klon 5061 ! d_qx(i,k,iq) = ( tr_seri(i,k,iq-2) - qx(i,k,iq) ) / phys_tstep 5062 d_qx(i,k,iq) = ( tr_seri(i,k,iq-nqo) - qx(i,k,iq) ) / phys_tstep 5075 d_qx(i,k,iq) = ( tr_seri(i,k,itr) - qx(i,k,iq) ) / phys_tstep 5063 5076 ENDDO 5064 5077 ENDDO … … 5101 5114 CALL water_int(klon,klev,qs_ancien,zmasse,prsw_ancien) 5102 5115 ! !! RomP >>> 5103 !CR: nb de traceurs eau: nqo 5104 IF (nqtot.GT.nqo) THEN 5105 DO iq = nqo+1, nqtot 5106 tr_ancien(:,:,iq-nqo) = tr_seri(:,:,iq-nqo) 5107 ENDDO 5108 ENDIF 5116 IF (nqtot > nqo) tr_ancien(:,:,:) = tr_seri(:,:,:) 5109 5117 ! !! RomP <<< 5110 5118 !========================================================================== -
LMDZ6/trunk/libf/phylmd/phytrac_mod.F90
r4012 r4056 56 56 SUBROUTINE phytrac_init() 57 57 USE dimphy 58 USE infotrac_phy, ONLY: nbtr, nqCO2,type_trac58 USE infotrac_phy, ONLY: nbtr, type_trac 59 59 USE tracco2i_mod, ONLY: tracco2i_init 60 60 IMPLICIT NONE … … 145 145 USE phys_local_var_mod, ONLY: budg_dep_dry_h2so4, budg_dep_wet_h2so4 146 146 USE phys_local_var_mod, ONLY: budg_dep_dry_part, budg_dep_wet_part 147 USE infotrac , ONLY: nbtr_sulgas, id_OCS_strat, id_SO2_strat, id_H2SO4_strat147 USE infotrac_phy, ONLY: nbtr_sulgas, id_OCS_strat, id_SO2_strat, id_H2SO4_strat 148 148 USE aerophys 149 149 #endif … … 508 508 iflag_con_trac= 1 509 509 CASE('inco') 510 source(:,1:nqCO2) = 0. ! from CO2i 511 source(:,nqCO2+1:nbtr)=init_source(:,:) ! from INCA 512 aerosol(1:nqCO2) = .FALSE. ! from CO2i 513 CALL tracinca_init(aerosol(nqCO2+1:nbtr),lessivage) ! from INCA 514 pbl_flg(1:nqCO2) = 1 ! From CO2iModThL515 iflag_the_trac = 1! From CO2i516 iflag_vdf_trac = 1! From CO2i517 iflag_con_trac = 1! From CO2i510 source(:,1:nqCO2) = 0. ! from CO2i ModThL 511 source(:,nqCO2+1:nbtr)=init_source(:,:) ! from INCA ModThL 512 aerosol(1:nqCO2) = .FALSE. ! from CO2i ModThL 513 CALL tracinca_init(aerosol(nqCO2+1:nbtr),lessivage) ! from INCA ModThL 514 pbl_flg(1:nqCO2) = 1 ! From CO2i ModThL 515 iflag_the_trac = 1 ! From CO2i 516 iflag_vdf_trac = 1 ! From CO2i 517 iflag_con_trac = 1 ! From CO2i 518 518 #ifdef CPP_StratAer 519 519 CASE('coag') -
LMDZ6/trunk/libf/phylmd/traclmdz_mod.F90
r4050 r4056 67 67 68 68 USE dimphy 69 USE infotrac_phy, ONLY: nbtr , tracers, niadv, solsym69 USE infotrac_phy, ONLY: nbtr 70 70 71 71 ! Input argument … … 89 89 ! Initialization of the tracers should be done here only for those not found in the restart file. 90 90 USE dimphy 91 USE infotrac_phy, ONLY: nbtr, nq o, tracers, pbl_flg, conv_flg, niadv91 USE infotrac_phy, ONLY: nbtr, nqtot, tracers, pbl_flg, conv_flg 92 92 USE regr_pr_comb_coefoz_m, ONLY: alloc_coefoz 93 93 USE press_coefoz_m, ONLY: press_coefoz … … 114 114 115 115 ! Local variables 116 INTEGER :: ierr, it, i iq, i, k116 INTEGER :: ierr, it, iq, i, k 117 117 REAL, DIMENSION(klon_glo,klev) :: varglo ! variable temporaire sur la grille global 118 118 REAL, DIMENSION(klev) :: mintmp, maxtmp … … 173 173 id_rn=0; id_pb=0; id_aga=0; id_be=0; id_o3=0 174 174 id_pcsat=0; id_pcocsat=0; id_pcq=0; id_pcs0=0; id_pcos0=0; id_pcq0=0 175 DO it=1,nbtr 176 !! iiq=niadv(it+2) ! jyg 177 iiq=niadv(it+nqo) ! jyg 178 SELECT CASE(strLower(tracers(iiq)%name)) 175 it = 0 176 DO iq = 1, nqtot 177 IF(.NOT.tracers(iq)%isAdvected .OR. tracers(iq)%isH2Ofamily) CYCLE 178 it = it+1 179 SELECT CASE(strLower(tracers(iq)%name)) 179 180 CASE("rn"); id_rn = it ! radon 180 181 CASE("pb"); id_pb = it ! plomb … … 189 190 CASE("pcq0"); id_pcq0 = it 190 191 CASE DEFAULT 191 WRITE(lunout,*) 'This is an unknown tracer in LMDZ : ', trim(tracers(i iq)%name)192 WRITE(lunout,*) 'This is an unknown tracer in LMDZ : ', trim(tracers(iq)%name) 192 193 END SELECT 193 194 194 SELECT CASE(strLower(tracers(i iq)%name))195 SELECT CASE(strLower(tracers(iq)%name)) 195 196 CASE("pb") !--- RomP >>> profil initial de PB210 196 197 OPEN(ilesfil2,file='prof.pb210',status='old',iostat=irr2) … … 259 260 ! Check if all tracers have restart values 260 261 ! ---------------------------------------------- 261 DO it=1,nbtr 262 !! iiq=niadv(it+2) ! jyg 263 iiq=niadv(it+nqo) ! jyg 262 it = 0 263 DO iq = 1, nqtot 264 IF(.NOT.tracers(iq)%isAdvected .OR. tracers(iq)%isH2Ofamily) CYCLE 265 it = it+1 264 266 ! Test if tracer is zero everywhere. 265 267 ! Done by master process MPI and master thread OpenMP … … 282 284 IF (zero) THEN 283 285 ! The tracer was not found in restart file or it was equal zero everywhere. 284 WRITE(lunout,*) "The tracer ",trim(tracers(i iq)%name)," will be initialized"286 WRITE(lunout,*) "The tracer ",trim(tracers(iq)%name)," will be initialized" 285 287 IF (it==id_pcsat .OR. it==id_pcq .OR. & 286 288 it==id_pcs0 .OR. it==id_pcq0) THEN -
LMDZ6/trunk/libf/phylmdiso/phyetat0.F90
r4050 r4056 29 29 ale_wake, ale_bl_stat, ds_ns, dt_ns, delta_sst, delta_sal, ratqs_inter 30 30 !FC 31 USE geometry_mod, ONLY : longitude_deg, latitude_deg 32 USE iostart, ONLY : close_startphy, get_field, get_var, open_startphy 33 USE infotrac_phy, only: nbtr, nqo, type_trac, tracers, niadv, & 34 itr_indice ! C Risi 35 USE traclmdz_mod, ONLY : traclmdz_from_restart 36 USE carbon_cycle_mod, ONLY : carbon_cycle_tr, carbon_cycle_cpl, co2_send 37 USE indice_sol_mod, only: nbsrf, is_ter, epsfra, is_lic, is_oce, is_sic 38 USE ocean_slab_mod, ONLY: nslay, tslab, seaice, tice, ocean_slab_init 31 USE geometry_mod, ONLY: longitude_deg, latitude_deg 32 USE iostart, ONLY: close_startphy, get_field, get_var, open_startphy 33 USE infotrac_phy, ONLY: nqtot, nbtr, type_trac, tracers 34 USE traclmdz_mod, ONLY: traclmdz_from_restart 35 USE carbon_cycle_mod, ONLY: carbon_cycle_tr, carbon_cycle_cpl, co2_send 36 USE indice_sol_mod, ONLY: nbsrf, is_ter, epsfra, is_lic, is_oce, is_sic 37 USE ocean_slab_mod, ONLY: nslay, tslab, seaice, tice, ocean_slab_init 39 38 USE time_phylmdz_mod, ONLY: init_iteration, pdtphys, itau_phy 40 39 #ifdef CPP_XIOS … … 92 91 INTEGER length 93 92 PARAMETER (length=100) 94 INTEGER it, i iq, isw93 INTEGER it, iq, isw 95 94 REAL tab_cntrl(length), tabcntr0(length) 96 95 CHARACTER*7 str7 … … 104 103 REAL Rland_ice(niso,klon) 105 104 #endif 106 INTEGER iq107 105 ! FH1D 108 106 ! real iolat(jjm+1) … … 471 469 472 470 IF (type_trac == 'lmdz') THEN 473 DO it=1, nbtr 474 !! iiq=niadv(it+2) ! jyg 475 ! iiq=niadv(it+nqo) C Risi: on efface pour remplacer 476 iq=itr_indice(it) 477 iiq=niadv(iq) ! jyg 478 found=phyetat0_get(1,trs(:,it),"trs_"//TRIM(tracers(iiq)%name), & 479 "Surf trac"//TRIM(tracers(iiq)%name),0.) 480 ENDDO 471 it = 0 472 DO iq = 1, nqtot 473 IF(.NOT.tracers(iq)%isAdvected .OR. tracers(iq)%isH2Ofamily) CYCLE 474 it = it+1 475 found=phyetat0_get(1,trs(:,it),"trs_"//TRIM(tracers(iq)%name), & 476 "Surf trac"//TRIM(tracers(iq)%name),0.) 477 END DO 481 478 CALL traclmdz_from_restart(trs) 482 479 ENDIF … … 656 653 CALL get_field(name, field, found) 657 654 IF (.NOT. found) THEN 658 WRITE(lunout,*) "phyetat0: Le champ <", name,"> est absent"655 WRITE(lunout,*) "phyetat0: Le champ <",TRIM(name),"> est absent" 659 656 WRITE(lunout,*) "Depart legerement fausse. Mais je continue" 660 657 field(:,:)=default -
LMDZ6/trunk/libf/phylmdiso/phyredem.F90
r4046 r4056 23 23 wake_delta_pbl_tke, zmax0, f0, sig1, w01, & 24 24 wake_deltat, wake_deltaq, wake_s, wake_dens, & 25 awake_dens, cv_gen, & 25 26 wake_cstar, & 26 27 wake_pe, wake_fip, fm_therm, entr_therm, & … … 38 39 USE iostart, ONLY: open_restartphy, close_restartphy, enddef_restartphy, put_field, put_var 39 40 USE traclmdz_mod, ONLY : traclmdz_to_restart 40 USE infotrac_phy, ONLY: type_trac, n iadv, tracers, nbtr, nqo,itr_indice41 USE infotrac_phy, ONLY: type_trac, nqtot, tracers, nbtr, niso, ntraciso 41 42 #ifdef ISO 42 USE infotrac_phy, ONLY: itr_indice,niso,ntraciso43 43 #ifdef ISOVERIF 44 44 USE isotopes_verif_mod … … 74 74 REAL Rland_ice(niso,klon) 75 75 #endif 76 INTEGER iq ! C Risi77 76 78 77 INTEGER nid, nvarid, idim1, idim2, idim3 … … 85 84 CHARACTER (len=2) :: str2 86 85 CHARACTER (len=256) :: nam, lnam 87 INTEGER :: it, i iq, pass86 INTEGER :: it, iq, pass 88 87 89 88 !====================================================================== … … 185 184 CALL put_field_srf1(pass,"TS","Temperature",ftsol(:,:)) 186 185 187 !! CALL put_field_srf1(pass,"DELTA_TS","w-x surface temperature difference", delta_tsurf(:,:)) 188 CALL put_field_srf1(pass,"DELTATS","w-x surface temperature difference", delta_tsurf(:,:))189 190 ! CALL put_field_srf1(pass,"BETA_S","Aridity factor", beta_aridity(:,:))191 CALL put_field_srf1(pass,"BETAS","Aridity factor", beta_aridity(:,:))186 IF (iflag_pbl>1 .AND. iflag_wake>=1 .AND. iflag_pbl_split >=1) then 187 CALL put_field_srf1(pass, "DELTATS", & 188 "w-x surface temperature difference", delta_tsurf(:,:)) 189 CALL put_field_srf1(pass, "BETAS", "Aridity factor", beta_aridity(:,:)) 190 end IF 192 191 ! End surface variables 193 192 … … 313 312 CALL put_field(pass,"WAKE_DENS", "Wake num. /unit area", wake_dens) 314 313 314 CALL put_field(pass,"AWAKE_DENS", "Active Wake num. /unit area", awake_dens) 315 316 CALL put_field(pass,"CV_GEN", "CB birth rate", cv_gen) 317 315 318 CALL put_field(pass,"WAKE_CSTAR", "WAKE_CSTAR", wake_cstar) 316 319 … … 345 348 IF (type_trac == 'lmdz') THEN 346 349 CALL traclmdz_to_restart(trs) 347 DO it=1, nbtr 348 !! iiq=niadv(it+2) ! jyg 349 !iiq=niadv(it+nqo) ! C Risi: on efface pour remplacer: 350 iq=itr_indice(it) ! jyg 351 iiq=niadv(iq) ! jyg 352 CALL put_field(pass,"trs_"//tracers(iiq)%name, "", trs(:, it)) 350 it = 0 351 DO iq = 1, nqtot 352 IF(.NOT.tracers(iq)%isAdvected .OR. tracers(iq)%isH2Ofamily) CYCLE 353 it = it+1 354 CALL put_field(pass,"trs_"//tracers(iq)%name, "", trs(:, it)) 353 355 END DO 356 END IF 357 358 IF (type_trac == 'co2i' .OR. type_trac == 'inco') THEN 354 359 IF (carbon_cycle_cpl) THEN 355 360 IF (.NOT. ALLOCATED(co2_send)) THEN … … 417 422 418 423 IMPLICIT NONE 419 INTEGER, INTENT(IN) 424 INTEGER, INTENT(IN) :: pass 420 425 CHARACTER(LEN=*), INTENT(IN) :: nam, lnam 421 426 REAL, INTENT(IN) :: field(:,:) … … 519 524 CHARACTER*7 str7 520 525 CHARACTER*2 str2 521 CHARACTER*50 striso_sortie526 CHARACTER*50 outiso 522 527 integer lnblnk 523 528 #ifdef ISOTRAC … … 564 569 565 570 if (ixt.le.niso) then 566 striso_sortie=striso(ixt)571 outiso=striso(ixt) 567 572 else 568 573 #ifdef ISOTRAC 569 574 iiso=index_iso(ixt) 570 575 izone=index_zone(ixt) 571 striso_sortie=striso(iiso)//strtrac(izone)576 outiso=striso(iiso)//strtrac(izone) 572 577 #else 573 578 write(*,*) 'phyredem 546: ixt,ntraciso=', ixt,ntraciso … … 575 580 #endif 576 581 endif !if (ixt.le.niso) then 577 write(*,*) 'phyredem 550: ixt, striso_sortie=',ixt,striso_sortie(1:lnblnk(striso_sortie))582 write(*,*) 'phyredem 550: ixt,outiso=',ixt,TRIM(outiso) 578 583 579 584 iso_tmp_lonsrf(:,:)=fxtevap(ixt,:,:) 580 CALL put_field_srf1(pass,"XTEVAP"//striso_sortie(1:lnblnk(striso_sortie)), & 581 & "Evaporation de surface",iso_tmp_lonsrf) 585 CALL put_field_srf1(pass, "XTEVAP"//TRIM(outiso), "Evaporation de surface",iso_tmp_lonsrf) 582 586 583 587 iso_tmp_lonsrf(:,:)=xtsnow(ixt,:,:) 584 CALL put_field_srf1(pass,"XTSNOW"//striso_sortie(1:lnblnk(striso_sortie)), & 585 & "NEIGE",iso_tmp_lonsrf) 588 CALL put_field_srf1(pass, "XTSNOW"//TRIM(outiso), "NEIGE", iso_tmp_lonsrf) 586 589 587 590 iso_tmp(:)=xtrain_fall(ixt,:) 588 CALL put_field(pass,"xtrain_f"//striso_sortie(1:lnblnk(striso_sortie)), & 589 & "precipitation liquide",iso_tmp) 591 CALL put_field(pass, "xtrain_f"//TRIM(outiso), "precipitation liquide",iso_tmp) 590 592 591 593 iso_tmp(:)=xtsnow_fall(ixt,:) 592 CALL put_field(pass,"xtsnow_f"//striso_sortie(1:lnblnk(striso_sortie)), & 593 & "precipitation solide",iso_tmp) 594 CALL put_field(pass, "xtsnow_f"//TRIM(outiso), "precipitation solide",iso_tmp) 594 595 595 596 iso_tmp_lonlev(:,:)=xt_ancien(ixt,:,:) 596 CALL put_field(pass,"XTANCIEN"//striso_sortie(1:lnblnk(striso_sortie)), & 597 & "QANCIEN",iso_tmp_lonlev) 597 CALL put_field(pass, "XTANCIEN"//TRIM(outiso), "QANCIEN", iso_tmp_lonlev) 598 598 599 599 iso_tmp_lonlev(:,:)=xtl_ancien(ixt,:,:) 600 CALL put_field(pass,"XTLANCIEN"//striso_sortie(1:lnblnk(striso_sortie)), & 601 & "QLANCIEN",iso_tmp_lonlev) 600 CALL put_field(pass, "XTLANCIEN"//TRIM(outiso), "QLANCIEN", iso_tmp_lonlev) 602 601 603 602 iso_tmp_lonlev(:,:)=xts_ancien(ixt,:,:) 604 CALL put_field(pass,"XTSANCIEN"//striso_sortie(1:lnblnk(striso_sortie)), & 605 & "QSANCIEN",iso_tmp_lonlev) 603 CALL put_field(pass, "XTSANCIEN"//TRIM(outiso), "QSANCIEN", iso_tmp_lonlev) 606 604 607 605 iso_tmp_lonlev(:,:)=wake_deltaxt(ixt,:,:) 608 CALL put_field(pass,"WAKE_DELTAXT"//striso_sortie(1:lnblnk(striso_sortie)), & 609 & "WAKE_DELTAQ",iso_tmp_lonlev) 606 CALL put_field(pass,"WAKE_DELTAXT"//TRIM(outiso), "WAKE_DELTAQ", iso_tmp_lonlev) 610 607 611 608 iso_tmp(:)=xtrun_off_lic_0(ixt,:) 612 CALL put_field(pass,"XTRUNOFFLIC0"//striso_sortie(1:lnblnk(striso_sortie)), & 613 & "Runofflic0",iso_tmp) 609 CALL put_field(pass,"XTRUNOFFLIC0"//TRIM(outiso), "Runofflic0", iso_tmp) 614 610 615 611 iso_tmp_lonlev(:,:)=wake_deltaxt(ixt,:,:) 616 CALL put_field(pass,"WAKE_DELTAXT"//striso_sortie(1:lnblnk(striso_sortie)), & 617 & "WAKE_DELTAXT",iso_tmp_lonlev) 612 CALL put_field(pass,"WAKE_DELTAXT"//TRIM(outiso), "WAKE_DELTAXT",iso_tmp_lonlev) 618 613 619 614 ! variables seulement pour niso: … … 621 616 622 617 iso_tmp(:)=xtsol(ixt,:) 623 CALL put_field(pass,"XTSOL"//striso_sortie(1:lnblnk(striso_sortie)), & 624 & "Eau dans le sol (mm)",iso_tmp) 618 CALL put_field(pass, "XTSOL"//TRIM(outiso), "Eau dans le sol (mm)",iso_tmp) 625 619 626 620 iso_tmp(:)=Rland_ice(ixt,:) 627 CALL put_field(pass,"Rland_ice"//striso_sortie(1:lnblnk(striso_sortie)), & 628 & "ratio land ice",iso_tmp) 621 CALL put_field(pass, "Rland_ice"//TRIM(outiso), "ratio land ice", iso_tmp) 629 622 630 623 endif ! if (ixt.le.niso) then -
LMDZ6/trunk/libf/phylmdiso/phys_output_mod.F90
r4050 r4056 35 35 USE iophy 36 36 USE dimphy 37 USE infotrac_phy, ONLY: nqtot, nqo, niadv, tracers, type_trac, maxlen, & 38 nqtottr,itr_indice ! C Risi 37 USE infotrac_phy, ONLY: nqtot, tracers, type_trac, niso, ntraciso, maxlen 39 38 USE ioipsl 40 39 USE phys_cal_mod, only : hour, calend … … 52 51 #endif 53 52 #ifdef ISO 54 USE infotrac_phy,ONLY: niso, ntraciso55 53 USE isotopes_mod, ONLY: striso,iso_HTO 56 54 #ifdef ISOTRAC … … 103 101 CHARACTER(LEN=4), DIMENSION(nlevSTD) :: clevSTD 104 102 REAL, DIMENSION(nlevSTD) :: rlevSTD 105 INTEGER :: nsrf, k, iq, iiq, iff, i, j, ilev 106 INTEGER :: itr ! C Risi 103 INTEGER :: nsrf, k, iq, iff, i, j, ilev, itr, ixt, iiso, izone 107 104 INTEGER :: naero 108 105 LOGICAL :: ok_veget … … 124 121 125 122 #ifdef ISO 126 INTEGER :: ixt,iiso,izone127 123 CHARACTER(LEN=LEN(striso)) :: outiso 128 124 CHARACTER(LEN=20) :: unit … … 133 129 !!!!!!!!!! stockage dans une region limitee pour chaque fichier !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 134 130 ! entre [phys_out_lonmin,phys_out_lonmax] et [phys_out_latmin,phys_out_latmax] 135 136 LOGICAL, DIMENSION(nfiles), SAVE :: phys_out_regfkey = (/ .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., & 137 .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /) 138 REAL, DIMENSION(nfiles), SAVE :: phys_out_lonmin = (/ -180., -180., -180., -180., -180., & 139 -180., -180., -180., -180., -180. /) 140 REAL, DIMENSION(nfiles), SAVE :: phys_out_lonmax = (/ 180., 180., 180., 180., 180., & 141 180., 180., 180., 180., 180. /) 142 REAL, DIMENSION(nfiles), SAVE :: phys_out_latmin = (/ -90., -90., -90., -90., -90., & 143 -90., -90., -90., -90., -90. /) 144 REAL, DIMENSION(nfiles), SAVE :: phys_out_latmax = (/ 90., 90., 90., 90., 90., & 145 90., 90., 90., 90., 90. /) 131 LOGICAL, DIMENSION(nfiles), SAVE :: & 132 phys_out_regfkey = [.FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE.] 133 REAL, DIMENSION(nfiles), SAVE :: & 134 phys_out_lonmin = [ -180., -180., -180., -180., -180., -180., -180., -180., -180., -180.], & 135 phys_out_lonmax = [ 180., 180., 180., 180., 180., 180., 180., 180., 180., 180.], & 136 phys_out_latmin = [ -90., -90., -90., -90., -90., -90., -90., -90., -90., -90.], & 137 phys_out_latmax = [ 90., 90., 90., 90., 90., 90., 90., 90., 90., 90.] 146 138 REAL, DIMENSION(klev,2) :: Ahyb_bounds, Bhyb_bounds 147 139 REAL, DIMENSION(klev+1) :: lev_index … … 401 393 CALL wxios_add_vaxis("bnds", 2, (/1.,2./)) 402 394 403 395 CALL wxios_add_vaxis("Alt", & 404 396 levmax(iff) - levmin(iff) + 1, pseudoalt) 405 397 406 IF (NSW.EQ.6) THEN 407 ! 408 !wl1_sun: minimum bound of wavelength (in um) 409 ! 410 wl1_sun(1)=0.180 411 wl1_sun(2)=0.250 412 wl1_sun(3)=0.440 413 wl1_sun(4)=0.690 414 wl1_sun(5)=1.190 415 wl1_sun(6)=2.380 416 ! 417 !wl2_sun: maximum bound of wavelength (in um) 418 ! 419 wl2_sun(1)=0.250 420 wl2_sun(2)=0.440 421 wl2_sun(3)=0.690 422 wl2_sun(4)=1.190 423 wl2_sun(5)=2.380 424 wl2_sun(6)=4.000 425 ! 426 ELSE IF(NSW.EQ.2) THEN 427 ! 428 !wl1_sun: minimum bound of wavelength (in um) 429 ! 430 wl1_sun(1)=0.250 431 wl1_sun(2)=0.690 432 ! 433 !wl2_sun: maximum bound of wavelength (in um) 434 ! 435 wl2_sun(1)=0.690 436 wl2_sun(2)=4.000 437 ENDIF 398 ! wl1_sun/wl2_sun: minimum/maximum bound of wavelength (in um) 399 SELECT CASE(NSW) 400 CASE(6) 401 wl1_sun(1:6) = [0.180, 0.250, 0.440, 0.690, 1.190, 2.380] 402 wl2_sun(1:6) = [0.250, 0.440, 0.690, 1.190, 2.380, 4.000] 403 CASE(2) 404 wl1_sun(1:2) = [0.250, 0.690] 405 wl2_sun(1:2) = [0.690, 4.000] 406 END SELECT 438 407 439 408 DO ISW=1, NSW … … 533 502 ENDIF ! clef_files 534 503 535 write(lunout,*) 'phys_output_mid 496: nqtottr=',nqtottr 536 write(lunout,*) 'itr_indice=',itr_indice 537 ! IF (nqtot>=nqo+1) THEN 538 ! 539 !DO iq=nqo+1,nqtot 540 ! C Risi: on modifie la boucle 541 DO itr=1,nqtottr ! C Risi 542 iq=itr_indice(itr) ! C Risi 543 write(*,*) 'phys_output_mid 503: itr=',itr 544 545 iiq=niadv(iq) 546 dn = 'd'//TRIM(tracers(iiq)%name)//'_' 504 itr = 0 505 DO iq = 1, nqtot 506 IF(.NOT.tracers(iq)%isAdvected .OR. tracers(iq)%isH2Ofamily) CYCLE 507 itr = itr + 1 508 dn = 'd'//TRIM(tracers(iq)%name)//'_' 547 509 548 510 flag = [1, 5, 5, 5, 10, 10, 11, 11, 11, 11] 549 lnam = 'Tracer '//TRIM(tracers(i iq)%longName)550 tnam = TRIM(tracers(i iq)%name);o_trac (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])511 lnam = 'Tracer '//TRIM(tracers(iq)%longName) 512 tnam = TRIM(tracers(iq)%name); o_trac (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 551 513 552 514 flag = [4, 7, 7, 7, 10, 10, 11, 11, 11, 11] 553 lnam = 'Tendance tracer '//TRIM(tracers(i iq)%longName)515 lnam = 'Tendance tracer '//TRIM(tracers(iq)%longName) 554 516 tnam = TRIM(dn)//'vdf'; o_dtr_vdf (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 555 517 … … 570 532 tnam = TRIM(dn)//'uscav'; o_dtr_uscav (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 571 533 572 lnam = 'tracer tendency dry deposition'//TRIM(tracers(i iq)%longName)534 lnam = 'tracer tendency dry deposition'//TRIM(tracers(iq)%longName) 573 535 tnam = 'cum'//TRIM(dn)//'dry'; o_dtr_dry (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 574 536 575 537 flag = [1, 4, 10, 10, 10, 10, 11, 11, 11, 11] 576 lnam = 'Cumulated tracer '//TRIM(tracers(i iq)%longName)577 tnam = 'cum'//TRIM(tracers(i iq)%name); o_trac_cum(itr)= ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])538 lnam = 'Cumulated tracer '//TRIM(tracers(iq)%longName) 539 tnam = 'cum'//TRIM(tracers(iq)%name); o_trac_cum(itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) 578 540 ENDDO 579 541 580 542 ENDDO ! iff 581 543 582 write(*,*) 'phys_output_mid 589'583 544 #ifdef ISO 545 write(*,*) 'phys_output_mid 589' 584 546 do ixt=1,ntraciso 585 if (ixt .le.niso) then547 if (ixt <= niso) then 586 548 outiso=striso(ixt) 587 549 else … … 630 592 END IF 631 593 enddo !do ixt=1,niso 632 #endif 633 write(*,*) 'phys_output_mid 596' 594 write(*,*) 'phys_output_mid 596' 595 #endif 634 596 635 597 -
LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90
r4050 r4056 39 39 USE ioipsl_getin_p_mod, ONLY : getin_p 40 40 USE indice_sol_mod 41 USE infotrac_phy, ONLY: nqtot, nbtr, nqo, t ype_trac,ok_isotopes, &42 nqtottr,itr_indice ! C Risi43 41 USE infotrac_phy, ONLY: nqtot, nbtr, nqo, tracers, type_trac, nqCO2, ok_isotopes 42 USE readTracFiles_mod, ONLY: phases_sep 43 USE strings_mod, ONLY: strIdx 44 44 USE iophy 45 45 USE limit_read_mod, ONLY : init_limit_read … … 61 61 USE phys_output_mod 62 62 USE phys_output_ctrlout_mod 63 USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level 63 USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level, & 64 alert_first_call, call_alert, prt_alerte 64 65 USE readaerosol_mod, ONLY : init_aero_fromfile 65 66 USE readaerosolstrato_m, ONLY : init_readaerosolstrato … … 123 124 #ifdef ISO 124 125 USE infotrac_phy, ONLY: & 125 iqiso,iso_indnum,tracers,ok_isotrac, & 126 niso,ntraciso,nqtottr,itr_indice ! ajout C Risi pour isos 126 iqiso,iso_indnum,ok_isotrac,niso, ntraciso 127 127 USE isotopes_mod, ONLY: iso_eau,iso_HDO,iso_O18,iso_O17,iso_HTO, & 128 128 & bidouille_anti_divergence,ok_bidouille_wake, & … … 188 188 ! 189 189 d_t_vdf,d_q_vdf,d_u_vdf,d_v_vdf,d_t_diss, & 190 d_t_vdf_ w,d_q_vdf_w, &191 d_ t_vdf_x,d_q_vdf_x, &190 d_t_vdf_x, d_t_vdf_w, & 191 d_q_vdf_x, d_q_vdf_w, & 192 192 d_ts, & 193 193 ! … … 262 262 zxfluxlat_x, zxfluxlat_w, & 263 263 ! 264 d_t_vdf_x, d_t_vdf_w, &265 d_q_vdf_x, d_q_vdf_w, &266 264 pbl_tke_input, tke_dissip, l_mix, wprime,& 267 265 t_therm, q_therm, u_therm, v_therm, & … … 939 937 real zqsat(klon,klev) 940 938 ! 941 INTEGER i, k, iq, j, nsrf, ll, l 942 INTEGER itr ! C Risi 939 INTEGER i, k, iq, j, nsrf, ll, l, itr 943 940 #ifdef ISO 944 941 real zxt_apres(ntraciso,klon) … … 1133 1130 !JLD REAL zstophy, zout 1134 1131 1135 CHARACTER *20 modname1132 CHARACTER (LEN=20) :: modname='physiq_mod' 1136 1133 CHARACTER*80 abort_message 1137 1134 LOGICAL, SAVE :: ok_sync, ok_sync_omp … … 1306 1303 pi = 4. * ATAN(1.) 1307 1304 1305 ! set-up call to alerte function 1306 call_alert = (alert_first_call .AND. is_master) 1307 1308 1308 ! Ehouarn: set value of jjmp1 since it is no longer a "fixed parameter" 1309 1309 jjmp1=nbp_lat … … 1424 1424 forall (k=1: nbp_lev) zmasse(:, k) = (paprs(:, k)-paprs(:, k+1)) / rg 1425 1425 1426 modname = 'physiq'1427 1426 1428 1427 IF (debut) THEN … … 1853 1852 1854 1853 CALL iniradia(klon,klev,paprs(1,1:klev+1)) 1855 1856 ! Initialisation des champs dans phytrac* qui sont utilisés par phys_output_write* 1854 ! 1855 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1856 ! Initialisation des champs dans phytrac* qui sont utilises par phys_output_write* 1857 ! 1858 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1859 1857 1860 #ifdef CPP_Dust 1858 1861 ! Quand on utilise SPLA, on force iflag_phytrac=1 … … 1899 1902 ENDDO 1900 1903 ENDDO 1901 1904 ELSE 1902 1905 pbl_tke(:,:,is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ?? 1903 1906 !>jyg … … 1949 1952 CALL abort_physic(modname,abort_message,1) 1950 1953 ENDIF 1954 1955 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1956 ! Initialisation pour la convection de K.E. et pour les poches froides 1957 ! 1958 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1959 1951 1960 WRITE(lunout,*)"Clef pour la convection, iflag_con=", iflag_con 1952 WRITE(lunout,*)"Clef pour le driver de la convection, ok_cvl=", & 1953 ok_cvl 1961 WRITE(lunout,*)"Clef pour le driver de la convection, ok_cvl=", ok_cvl 1954 1962 ! 1955 1963 !KE43 … … 2004 2012 d_deltaxt_ajs_cv(:,:,:) = 0. 2005 2013 #endif 2006 ENDIF 2014 ENDIF ! (iflag_wake>=1) 2007 2015 2008 2016 ! do i = 1,klon … … 2015 2023 ! ALLOCATE(lonGCM(0), latGCM(0)) 2016 2024 ! ALLOCATE(iGCM(0), jGCM(0)) 2017 ENDIF 2018 2025 ENDIF ! (iflag_con.GE.3) 2026 ! 2019 2027 DO i=1,klon 2020 2028 rugoro(i) = f_rugoro * MAX(1.0e-05, zstd(i)*zsig(i)/2.0) … … 2085 2093 !$OMP BARRIER 2086 2094 missing_val=missing_val_omp 2095 ! 2096 ! Now we activate some double radiation call flags only if some 2097 ! diagnostics are requested, otherwise there is no point in doing this 2098 IF (is_master) THEN 2099 !--setting up swaero_diag to TRUE in XIOS case 2100 IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. & 2101 xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. & 2102 xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR. & 2103 (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. & 2104 xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0")))) & 2105 !!!--for now these fields are not in the XML files so they are omitted 2106 !!! xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) & 2107 swaero_diag=.TRUE. 2108 2109 !--setting up swaerofree_diag to TRUE in XIOS case 2110 IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. & 2111 xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR. & 2112 xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. & 2113 xios_field_is_active("LWupTOAcleanclr")) & 2114 swaerofree_diag=.TRUE. 2115 2116 !--setting up dryaod_diag to TRUE in XIOS case 2117 DO naero = 1, naero_tot-1 2118 IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE. 2119 ENDDO 2120 ! 2121 !--setting up ok_4xCO2atm to TRUE in XIOS case 2122 IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. & 2123 xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. & 2124 xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. & 2125 xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. & 2126 xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. & 2127 xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) & 2128 ok_4xCO2atm=.TRUE. 2129 ENDIF 2130 !$OMP BARRIER 2131 CALL bcast(swaero_diag) 2132 CALL bcast(swaerofree_diag) 2133 CALL bcast(dryaod_diag) 2134 CALL bcast(ok_4xCO2atm) 2087 2135 #endif 2088 2089 2136 ! 2090 2137 CALL printflag( tabcntr0,radpas,ok_journe, & 2091 2138 ok_instan, ok_region ) 2092 2139 ! 2093 2140 ! 2094 !2095 2141 ! Prescrire l'ozone dans l'atmosphere 2096 !2097 2142 ! 2098 2143 !c DO i = 1, klon … … 2150 2195 #endif 2151 2196 ENDIF 2197 ! 2152 2198 IF (type_trac == 'repr') THEN 2153 2199 #ifdef REPROBUS … … 2198 2244 SFRWL(6)=3.02191470E-02 2199 2245 END SELECT 2200 2201 2202 2246 !albedo SB <<< 2203 2247 … … 2331 2375 ! RomP <<< 2332 2376 ENDIF 2333 2334 2377 ! 2335 2378 ! Ne pas affecter les valeurs entrees de u, v, h, et q … … 2408 2451 2409 2452 tke0(:,:)=pbl_tke(:,:,is_ave) 2410 !C Risi:Nombre de traceurs de l'eau: nqo 2411 ! IF (nqtot.GE.3) THEN 2412 IF (nqtot.GE.(nqo+1)) THEN 2413 ! DO iq = 3, nqtot 2414 ! DO iq = nqo+1, nqtot 2415 ! CR: on modifie directement le code ici. 2416 ! les isotopes ne sont pas dispatchés dans tr_seri, il faut les enlever. 2417 ! on a prévu pour ça un tableau d'indice dans infotrac 2418 #ifdef ISOVERIF 2419 write(*,*) 'physiq 1971: nqtottr=',nqtottr 2420 #endif 2421 do itr=1,nqtottr 2422 iq=itr_indice(itr) 2453 IF (nqtot > nqo) THEN 2454 ! water isotopes are not included in tr_seri 2455 itr = 0 2456 DO iq = 1, nqtot 2457 IF(tracers(iq)%isH2Ofamily) CYCLE 2458 itr = itr+1 2423 2459 !#ifdef ISOVERIF 2424 2460 ! write(*,*) 'physiq 1973: itr,iq=',itr,iq … … 2427 2463 DO k = 1, klev 2428 2464 DO i = 1, klon 2429 tr_seri(i,k,itr) = qx(i,k,iq) ! modif C Risi2465 tr_seri(i,k,itr) = qx(i,k,iq) 2430 2466 ENDDO 2431 ENDDO !DO k = 1, klev2432 !write(*,*) 'physiq 1980'2433 enddo !do itr=1,nqtottr2434 2435 ELSE !IF (nqtot.GE.(nqo+1)) THEN2436 DO k = 1, klev2437 DO i = 1, klon2438 tr_seri(i,k,1) = 0.02439 2467 ENDDO 2440 2468 ENDDO 2441 ENDIF !IF (nqtot.GE.(nqo+1)) THEN 2469 ELSE 2470 ! DC: make sure the final "1" index was meant for 1st H2O phase (vapor) !!! 2471 ! tr_seri(:,:,strIdx(tracers(:)%name,'H2O'//phases_sep//'g')) = 0.0 2472 tr_seri(:,:,strIdx(tracers(:)%name,'H2Ov')) = 0.0 2473 ENDIF 2442 2474 ! 2443 2475 ! Temporary solutions adressing ticket #104 and the non initialisation of tr_ancien … … 2445 2477 IF (debut) THEN 2446 2478 WRITE(lunout,*)' WARNING: tr_ancien initialised to tr_seri' 2447 ! DO iq = nqo+1, nqtot 2448 ! tr_ancien(:,:,iq-nqo)=tr_seri(:,:,iq-nqo) 2449 ! ENDDO 2450 ! modif CRisi: 2451 do itr=1,nqtottr 2479 itr = 0 2480 do iq = 1, nqtot 2481 IF(tracers(iq)%isH2Ofamily) CYCLE 2482 itr = itr+1 2452 2483 tr_ancien(:,:,itr)=tr_seri(:,:,itr) 2453 2484 enddo … … 2519 2550 d_qs_dyn2d(:)=(zx_tmp_fi2d(:)-prsw_ancien(:))/phys_tstep 2520 2551 ! !! RomP >>> td dyn traceur 2521 IF (nqtot.GT.nqo) THEN ! jyg 2522 ! DO iq = nqo+1, nqtot ! jyg 2523 DO itr=1,nqtottr ! C Risi modif directe 2524 d_tr_dyn(:,:,itr)=(tr_seri(:,:,itr)-tr_ancien(:,:,itr))/phys_tstep ! jyg 2525 ENDDO 2526 ENDIF 2552 IF (nqtot > nqo) d_tr_dyn(:,:,:)=(tr_seri(:,:,:)-tr_ancien(:,:,:))/phys_tstep 2527 2553 ! !! RomP <<< 2528 2554 … … 2627 2653 2628 2654 ! !! RomP >>> td dyn traceur 2629 IF (nqtot.GT.nqo) THEN ! jyg 2630 ! DO iq = nqo+1, nqtot ! jyg 2631 ! d_tr_dyn(:,:,iq-nqo)= 0.0 ! jyg 2632 ! Modif C Risi: 2633 DO itr=1,nqtottr 2634 d_tr_dyn(:,:,itr)= 0.0 2635 ENDDO 2636 ENDIF 2655 IF (nqtot > nqo) d_tr_dyn(:,:,:)= 0.0 2637 2656 ! !! RomP <<< 2638 2657 ancien_ok = .TRUE. … … 3363 3382 ENDDO 3364 3383 ENDDO 3365 ELSE !IF (iflag_wake>=1) THEN3384 ELSE 3366 3385 t_w(:,:) = t_seri(:,:) 3367 3386 q_w(:,:) = q_seri(:,:) … … 3752 3771 ! où i n'est pas un point convectif et donc ibas_con(i)=0 3753 3772 ! c'est un pb indépendant des isotopes 3754 if (ibas_con(i).gt.0) then 3755 ema_pcb(i) = paprs(i,ibas_con(i)) 3756 else ! if (ibas_con(i).gt.0) then 3757 ema_pcb(i) = 0.0 3758 endif ! if (ibas_con(i).gt.0) then 3759 3773 if (ibas_con(i) > 0) then 3774 ema_pcb(i) = paprs(i,ibas_con(i)) 3775 else 3776 ema_pcb(i) = 0.0 3777 endif 3760 3778 ENDDO 3761 3779 DO i = 1, klon … … 4484 4502 ENDDO 4485 4503 4486 CALL calcratqs(klon,klev,prt_level,lunout, &4504 CALL calcratqs(klon,klev,prt_level,lunout, & 4487 4505 iflag_ratqs,iflag_con,iflag_cld_th,pdtphys, & 4488 4506 ratqsbas,ratqshaut,ratqsp0, ratqsdp, & … … 4492 4510 pbl_tke(:,:,is_ave),tke_dissip_ave,l_mix_ave,wprime_ave,t2m,q2m,fm_therm, & 4493 4511 ratqs,ratqsc,ratqs_inter) 4494 4495 4512 4496 4513 ! … … 5608 5625 ZLWFT0_i, ZFLDN0, ZFLUP0, & 5609 5626 ZSWFT0_i, ZFSDN0, ZFSUP0) 5610 endif!ok_4xCO2atm5627 ENDIF !ok_4xCO2atm 5611 5628 ENDIF ! aerosol_couple 5612 5629 itaprad = 0 … … 6485 6502 #endif 6486 6503 ! #ifdef ISO 6487 ! 6488 !CR: nb de traceurs eau: nqo 6489 ! IF (nqtot.GE.3) THEN 6490 IF (nqtot.GE.(nqo+1)) THEN 6491 ! DO iq = 3, nqtot 6492 ! DO iq = nqo+1, nqtot ! modif C Risi 6493 do itr=1,nqtottr 6494 iq=itr_indice(itr) 6495 DO k = 1, klev 6496 DO i = 1, klon 6497 ! d_qx(i,k,iq) = ( tr_seri(i,k,iq-2) - qx(i,k,iq) ) / phys_tstep 6498 d_qx(i,k,iq) = ( tr_seri(i,k,iq-nqo) - qx(i,k,iq) ) / phys_tstep 6499 ENDDO 6504 ! DC: All iterations are cycled if nqtot==nqo, so no nqtot>nqo condition required 6505 itr = 0 6506 DO iq = 1, nqtot 6507 IF(tracers(iq)%isH2Ofamily) CYCLE 6508 itr = itr+1 6509 DO k = 1, klev 6510 DO i = 1, klon 6511 d_qx(i,k,iq) = ( tr_seri(i,k,itr) - qx(i,k,iq) ) / phys_tstep 6500 6512 ENDDO 6501 ENDDO ! !do itr=1,nqtottr6502 END IF6513 ENDDO 6514 ENDDO 6503 6515 ! 6504 6516 !IM rajout diagnostiques bilan KP pour analyse MJO par Jun-Ichi Yano … … 6558 6570 CALL water_int(klon,klev,qs_ancien,zmasse,prsw_ancien) 6559 6571 ! !! RomP >>> 6560 !CR: nb de traceurs eau: nqo 6561 IF (nqtot.GT.nqo) THEN 6562 ! DO iq = nqo+1, nqtot ! modif C Risi 6563 do itr=1,nqtottr 6564 tr_ancien(:,:,itr) = tr_seri(:,:,itr) 6565 ENDDO 6566 ENDIF 6572 IF (nqtot > nqo) tr_ancien(:,:,:) = tr_seri(:,:,:) 6567 6573 ! !! RomP <<< 6568 6574 !========================================================================== … … 6795 6801 ! ISO 6796 6802 6803 ! Disabling calls to the prt_alerte function 6804 alert_first_call = .FALSE. 6805 6797 6806 IF (lafin) THEN 6798 6807 itau_phy = itau_phy + itap
Note: See TracChangeset
for help on using the changeset viewer.