Changeset 175 for trunk/LMDZ.TITAN/libf/phytitan
- Timestamp:
- Jun 28, 2011, 12:56:50 PM (14 years ago)
- Location:
- trunk/LMDZ.TITAN/libf/phytitan
- Files:
-
- 22 added
- 2 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/phytitan/clesphys.h
r104 r175 11 11 INTEGER nbapp_rad, nbapp_chim, iflag_con, iflag_ajs 12 12 REAL ecritphy 13 INTEGER lev_histmth, lev_histday 13 14 REAL solaire 15 16 ! Parametres pour PBL: 14 17 REAL z0, lmixmin 15 REAL ksta , inertie18 REAL ksta 16 19 LOGICAL ok_kzmin 17 INTEGER lev_histmth, lev_histday 20 21 ! Parametres surface: 22 REAL inertie 23 24 ! Parametres Chimie: 18 25 logical chimi,ylellouch,hcnrad 19 26 integer vchim,aerprod,htoh2 20 integer microfi,cutoff 21 real tx,tcorrect 27 28 ! Parametres Microphysique: 29 integer microfi,cutoff,clouds 30 real tx,tcorrect,p_prodaer 31 real xnuf 22 32 23 33 24 COMMON/clesphys/cycle_diurne, soil_model, & 25 & ok_orodr, ok_orolf, ok_gw_nonoro, nbapp_rad, nbapp_chim & 26 & , ecritphy & 27 & , iflag_con, iflag_ajs, solaire, z0, lmixmin, ksta & 28 & , ok_kzmin, lev_histmth, lev_histday & 29 & , inertie, chimi,vchim,aerprod,htoh2,ylellouch,hcnrad & 30 & , microfi,cutoff,tx,tcorrect 34 COMMON/clesphys_i/ & 35 & nbapp_rad, nbapp_chim, iflag_con, iflag_ajs, & 36 & lev_histmth, lev_histday, vchim,aerprod,htoh2, & 37 & microfi,cutoff,clouds 31 38 39 COMMON/clesphys_r/ & 40 & ecritphy, solaire, z0, lmixmin, ksta, inertie, & 41 & tx,tcorrect,p_prodaer,xnuf 42 43 COMMON/clesphys_l/cycle_diurne, soil_model, & 44 & ok_orodr, ok_orolf, ok_gw_nonoro, ok_kzmin, & 45 & chimi,ylellouch,hcnrad 46 -
trunk/LMDZ.TITAN/libf/phytitan/conf_phys.F90
r97 r175 367 367 368 368 ! 369 !Config Key = p_prodaer 370 !Config Desc = pressure level for aerosol production (in Pa) 371 !Config Def = 1. 372 !Config Help = 373 ! 374 p_prodaer = 1. 375 call getin('p_prodaer',p_prodaer) 376 ! 369 377 !Config Key = cutoff 370 378 !Config Desc = … … 375 383 call getin('cutoff',cutoff) 376 384 385 ! 386 !Config Key = clouds 387 !Config Desc = activation des nuages 388 !Config Def = 1 389 !Config Help = 390 ! 391 clouds = 1 392 call getin('clouds',clouds) 393 if (microfi.ne.1) clouds = 0 ! On ne fait pas de nuages sans microphysique ! 394 395 ! 396 !Config Key = xnuf 397 !Config Desc = fraction nuageuse 398 !Config Def = 0.5 399 !Config Help = 400 ! 401 xnuf = 0.5 402 call getin('xnuf',xnuf) 403 xnuf = amax1(xnuf,0.1) ! On garde au minimum 10% de nuages. 404 if (clouds.eq.0) xnuf = 0. ! Si il n'y pas de nuages, on ne met pas de fraction 405 ! nuageuse -> permet de retomber sur le TR habituel. 377 406 ! 378 407 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 448 477 write(numout,*)' tx = ', tx 449 478 write(numout,*)' tcorrect = ', tcorrect 479 write(numout,*)' p_prodaer = ', p_prodaer 450 480 write(numout,*)' cutoff = ', cutoff 481 write(numout,*)' clouds = ', clouds 482 write(numout,*)' xnuf = ', xnuf 451 483 write(numout,*)' lev_histmth = ',lev_histmth 452 484 write(numout,*)' lev_histday = ',lev_histday -
trunk/LMDZ.TITAN/libf/phytitan/cooling.F
r121 r175 1 SUBROUTINE COOLING(N L,PRESS,TEMP,Z,Q0,lwnet,pfluxi)1 SUBROUTINE COOLING(NG,NL,PRESS,TEMP,Z,Q0,lwnet,pfluxi,icld) 2 2 3 3 c======================================================================= … … 66 66 c ---------- 67 67 68 INTEGER N L69 REAL PRESS( ngrid,nl),TEMP(ngrid,nl)70 REAL Z( ngrid,nl),Q0(ngrid,nl-1)71 REAL lwnet( ngrid,nl),UBARI272 real pfluxi( ngrid)68 INTEGER NG,NL,icld 69 REAL PRESS(NG,NL),TEMP(NG,NL) 70 REAL Z(NG,NL),Q0(NG,NL-1) 71 REAL lwnet(NG,NL),UBARI2 72 real pfluxi(NG) 73 73 74 74 … … 77 77 78 78 C DTAU IS PASSED EN-MASS, SO ITS DEMENSIONS ARE CRITICAL 79 COMMON /IRTAUS/ DTAUI(ngrid,NLAYER,NSPECI) 80 REAL dtaui 79 REAL dtaui(ngrid,NLAYER,NSPECI) 80 REAL dtauip(ngrid,NLAYER,NSPECI) 81 COMMON /IRTAUS/ dtaui,dtauip 81 82 82 83 c Local: … … 88 89 REAL DW,WAVEN,TJ,BSURF,QOUT,QIN,eff_g,COLDEN 89 90 90 INTEGER ig,K,J, NLEVEL,I,L91 INTEGER ig,K,J,I,L 91 92 92 93 c EXTERNAL PLNCK … … 139 140 UBARI2=1./1.66 140 141 UBARI2=UBARI 141 NLEVEL=NL142 142 143 143 C ZERO THE NET FLUXES … … 161 161 B0 = 0. 162 162 163 DO J=1,NL EVEL-1164 DO ig=1, ngrid163 DO J=1,NL-1 164 DO ig=1,NG 165 165 TJ=TEMP(ig,J) 166 166 … … 182 182 ENDDO 183 183 184 DO ig=1,ngrid 185 zz4=EXP(-DTAUI(ig,J,K)/UBARI2) 186 EM(ig,J)=zz4 187 ENDDO 184 IF (ICLD.EQ.1) THEN 185 DO ig=1,NG 186 zz4=EXP(-DTAUI(ig,J,K)/UBARI2) 187 EM(ig,J)=zz4 188 ENDDO 189 ELSE 190 DO ig=1,NG 191 zz4=EXP(-DTAUIP(ig,J,K)/UBARI2) 192 EM(ig,J)=zz4 193 ENDDO 194 ENDIF 188 195 ENDDO 189 196 … … 197 204 FUPIS=0. 198 205 199 DO 2220 J=1,NL EVEL-1200 DO 2230 ig=1, ngrid206 DO 2220 J=1,NL-1 207 DO 2230 ig=1,NG 201 208 FDI(ig,J+1) = FDI(ig,J)*EM(ig,J) + 2.*RPI*UBARI* 202 209 & B0(ig,J)*(1.-EM(ig,J)) … … 218 225 C UPWARD FLUXES: SURFACE EMISSIONS 219 226 220 DO 2310 ig=1, ngrid227 DO 2310 ig=1,NG 221 228 PLNCK=0. 222 229 DO I=-2,2,1 223 230 WAVNUM=WAVEN + I*zz1 224 zz2=EXP(-1.4388 * WAVNUM/TEMP(ig,NL EVEL))231 zz2=EXP(-1.4388 * WAVNUM/TEMP(ig,NL)) 225 232 zz3=WAVNUM*WAVNUM*WAVNUM 226 233 PLNCK=PLNCK+1.191E-5* zz3*zz2/(1.-zz2) 227 234 ENDDO 228 c BSURF=PLNCK( WAVEN, TEMP(ig,NL EVEL), DW)235 c BSURF=PLNCK( WAVEN, TEMP(ig,NL), DW) 229 236 BSURF=.2*PLNCK 230 FUPI(ig,NL EVEL)=BSURF * 2.*RPI*UBARI + RSFI*FDI(ig,NLEVEL)231 FUPIS(ig,NL EVEL,K)=BSURF*2.*RPI*UBARI+RSFI*FDIS(ig,NLEVEL,K)237 FUPI(ig,NL)=BSURF * 2.*RPI*UBARI + RSFI*FDI(ig,NL) 238 FUPIS(ig,NL,K)=BSURF*2.*RPI*UBARI+RSFI*FDIS(ig,NL,K) 232 239 2310 CONTINUE 233 240 c write(*,*) 234 c write(*,*) 'cooling : FUPI/NL EVEL=' ,235 c & ((FUPI(i,l),l=nl,nl),i=1, ngrid)236 c write(*,*) 237 c write(*,*) 'cooling : FDI/NL EVEL=' ,238 c & ((FDI(i,l),l=nl,nl),i=1, ngrid)239 240 DO 2320 J=NL EVEL-1,1,-1241 DO 2330 ig=1, ngrid241 c write(*,*) 'cooling : FUPI/NL =' , 242 c & ((FUPI(i,l),l=nl,nl),i=1,NG) 243 c write(*,*) 244 c write(*,*) 'cooling : FDI/NL =' , 245 c & ((FDI(i,l),l=nl,nl),i=1,NG) 246 247 DO 2320 J=NL-1,1,-1 248 DO 2330 ig=1,NG 242 249 FUPI(ig,J) = FUPI(ig,J+1)*EM(ig,J) + 2.*RPI*UBARI* 243 250 & B0(ig,J)*(1.-EM(ig,J)) … … 258 265 c compute the downward IR flux at the surface: 259 266 c 260 DO 3520 ig=1, ngrid261 pfluxi(ig)=pfluxi(ig)+ DWNI(K)*FDI(ig,NL EVEL)267 DO 3520 ig=1,NG 268 pfluxi(ig)=pfluxi(ig)+ DWNI(K)*FDI(ig,NL) 262 269 3520 CONTINUE 263 270 264 271 c compute the net IR flux, (+) upward: 265 272 c 266 DO J=1,NL EVEL267 DO ig=1, ngrid273 DO J=1,NL 274 DO ig=1,NG 268 275 lwnet(ig,J)= lwnet(ig,J)+ DWNI(K)*(FUPI(ig,J)-FDI(ig,J)) 269 276 ENDDO 270 277 ENDDO 271 278 272 DO 3210 J=1,NL EVEL-1273 DO 3220 ig=1, ngrid279 DO 3210 J=1,NL-1 280 DO 3220 ig=1,NG 274 281 QOUT=FUPI(ig,J) + FDI(ig,J+1) ! OUT OF LAYER 275 282 QIN =FDI(ig,J) + FUPI(ig,J+1) ! INTO LAYER … … 297 304 298 305 c convertion erg/cm2 -> J/m2 299 DO 3550 ig=1, ngrid306 DO 3550 ig=1,NG 300 307 pfluxi(ig) = 1.e-3*pfluxi(ig) 301 308 lwnet(ig,:) = 1.e-3*lwnet(ig,:) … … 307 314 C COMPUTE THE BASELINE COOLING RATE 308 315 309 DO 3000 J=1,NL EVEL-1316 DO 3000 J=1,NL-1 310 317 C TURN THE Q'S INTO TIMESCALES..... 311 DO 3300 ig=1, ngrid318 DO 3300 ig=1,NG 312 319 eff_g = RG*(RA/(RA+Z(ig,J)))**2 ! 10% DIFF AT 1 MBAR 313 320 COLDEN = RHOP*(PRESS(ig,J+1)-PRESS(ig,J))/eff_g -
trunk/LMDZ.TITAN/libf/phytitan/effg.F
r3 r175 1 1 FUNCTION EFFG(Z) 2 DATA G/1.35/ 3 DATA RPLANT/2575./ 4 EFFG = G * (RPLANT/(RPLANT + Z ) )**2 2 #include "YOMCST.h" 3 EFFG = RG * (RA/(RA + Z ) )**2 5 4 RETURN 6 5 END -
trunk/LMDZ.TITAN/libf/phytitan/heating.F
r104 r175 1 SUBROUTINE heating(dist,rmu0,fract,sol_htg,swnet )1 SUBROUTINE heating(dist,rmu0,fract,sol_htg,swnet,icld) 2 2 3 3 … … 16 16 c rmu0-----input-R- cosinus de l'angle zenithal 17 17 c fract----input-R- duree d'ensoleillement normalisee 18 c icld-----input-I- calcul avec nuages. 18 19 c p(klon,nl) pressure (level) 19 20 c … … 46 47 47 48 real dist, rmu0(klon), fract(klon) 49 integer icld 48 50 49 51 real sol_htg(klon,klev) … … 96 98 ubar0=rmu0(ig) 97 99 98 CALL sfluxv(iprint,ig,dist ) ! #3100 CALL sfluxv(iprint,ig,dist,icld) ! #3 99 101 100 102 fnetv(ig,:) = fnetv(ig,:) *fract(ig) ! >0 vers le haut -
trunk/LMDZ.TITAN/libf/phytitan/ini_histday.h
r106 r175 1 !2 ! $Header: /home/cvsroot/LMDZ4/libf/phylmd/ini_histday.h,v 1.2 2005/01/27 10:06:12 fairhead Exp $3 !4 1 IF (ok_journe) THEN 5 2 c … … 104 101 . "ave(X)", zsto,zout) 105 102 c 106 ENDIF !lev_histday.GE.2107 c108 c-------------------------------------------------------109 IF(lev_histday.GE.3) THEN110 c111 103 cccccccccccccccccc Tracers 112 104 c 113 105 if (iflag_trac.eq.1) THEN 114 if (microfi.eq.1) then 115 DO iq=1,nmicro 116 CALL histdef(nid_day, tname(iq), ttext(iq), "n/m2", 117 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 118 . "ave(X)", zsto,zout) 119 ENDDO 106 if (microfi.ge.1) then 107 c DO iq=1,nmicro 108 c CALL histdef(nid_day, tname(iq), ttext(iq), "n/m2", 109 c . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 110 c . "ave(X)", zsto,zout) 111 c ENDDO 112 CALL histdef(nid_day, "qaer","nb tot aer" , "n/m2", 113 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 114 . "ave(X)", zsto,zout) 115 CALL histdef(nid_day, "qnoy","nb tot noy" , "n/m2", 116 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 117 . "ave(X)", zsto,zout) 118 CALL histdef(nid_day, "qgl1","V tot gl1" , "m3/m2", 119 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 120 . "ave(X)", zsto,zout) 121 CALL histdef(nid_day, "qgl2","V tot gl2" , "m3/m2", 122 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 123 . "ave(X)", zsto,zout) 124 CALL histdef(nid_day, "qgl3","V tot gl3" , "m3/m2", 125 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 126 . "ave(X)", zsto,zout) 127 c-------------- 128 c ----- SATURATION ESP NUAGES 129 if (clouds.eq.1) then 130 CALL histdef(nid_day,"ch4sat", "saturation CH4", "--", 131 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 132 . "ave(X)", zsto,zout) 133 CALL histdef(nid_day,"c2h6sat", "saturation C2H6", "--", 134 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 135 . "ave(X)", zsto,zout) 136 CALL histdef(nid_day,"c2h2sat", "saturation C2H2", "--", 137 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 138 . "ave(X)", zsto,zout) 139 c -------------- 140 c ----- RESERVOIR DE SURFACE 141 CALL histdef(nid_day, "reserv", "Reservoir surface","m", 142 . iim,jjmp1,nhori, 1,1,1, -99, 32, 143 . "ave(X)", zsto,zout) 144 c -------------- 145 c ----- PRECIPITATIONS (precipitations cumulatives) 146 CALL histdef(nid_day,"prech4","Precip CH4","m", 147 . iim,jjmp1,nhori, 1,1,1, -99, 32, 148 . "ave(X)", zsto,zout) 149 CALL histdef(nid_day,"prec2h6","Precip C2H6", 150 . "m",iim,jjmp1,nhori, 1,1,1, -99, 32, 151 . "ave(X)", zsto,zout) 152 CALL histdef(nid_day,"prec2h2","Precip C2H2", 153 . "m",iim,jjmp1,nhori, 1,1,1, -99, 32, 154 . "ave(X)", zsto,zout) 155 c -------------- 156 c ----- FLUX GLACE 157 CALL histdef(nid_day,"flxgl1", "flux gl CH4", 158 . "kg/m2/s",iim,jjmp1,nhori, klev,1,klev,nvert, 32, 159 . "ave(X)", zsto,zout) 160 CALL histdef(nid_day,"flxgl2", "flux gl C2H6", 161 . "kg/m2/s",iim,jjmp1,nhori, klev,1,klev,nvert, 32, 162 . "ave(X)", zsto,zout) 163 CALL histdef(nid_day,"flxgl3", "flux gl C2H2", 164 . "kg/m2/s",iim,jjmp1,nhori, klev,1,klev,nvert, 32, 165 . "ave(X)", zsto,zout) 166 c -------------- 167 c ----- RAYON DES GOUTTES 168 CALL histdef(nid_day,"rcldbar", "rayon moyen goutte", 169 . "m",iim,jjmp1,nhori, klev,1,klev,nvert, 32, 170 . "ave(X)", zsto,zout) 171 endif 120 172 endif 173 c -------------- 174 c ----- TRACEURS CHIMIQUES 121 175 if (nmicro.lt.nqmax) then 122 176 DO iq=nmicro+1,nqmax … … 128 182 endif 129 183 c 184 ENDIF !lev_histday.GE.2 185 c 186 c------------------------------------------------------- 187 IF(lev_histday.GE.3) THEN 188 c 130 189 cccccccccccccccccc Radiative transfer 131 190 c … … 154 213 . 32, "ave(X)", zsto1,zout) 155 214 c 215 c -------------- 216 c ----- OPACITE BRUME 156 217 DO k=7,NSPECV,10 157 218 write(str1,'(i2.2)') k … … 161 222 ENDDO 162 223 c 224 DO k=8,NSPECI,10 225 write(str1,'(i2.2)') k 226 CALL histdef(nid_day,"thi"//str1,"Haze Opa IR", 227 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 228 . "ave(X)",zsto1,zout) 229 ENDDO 230 c 231 c -------------- 232 c ----- EXTINCTION BRUME 163 233 DO k=7,NSPECV,10 164 234 write(str1,'(i2.2)') k … … 168 238 ENDDO 169 239 c 240 DO k=8,NSPECI,10 241 write(str1,'(i2.2)') k 242 CALL histdef(nid_day,"khi"//str1,"Haze ext IR ", 243 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 244 . "ave(X)",zsto1,zout) 245 ENDDO 246 c 247 c -------------- 248 c ----- OPACITE GAZ 170 249 DO k=7,NSPECV,10 171 250 write(str1,'(i2.2)') k 172 CALL histdef(nid_day,"tgv"//str1,"Haze Opa Vis", 173 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 174 . "ave(X)",zsto1,zout) 175 ENDDO 176 c 251 CALL histdef(nid_day,"tgv"//str1,"Gas Opa Vis", 252 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 253 . "ave(X)",zsto1,zout) 254 ENDDO 255 c 256 DO k=8,NSPECI,10 257 write(str1,'(i2.2)') k 258 CALL histdef(nid_day,"tgi"//str1,"Gas Opa IR", 259 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 260 . "ave(X)",zsto1,zout) 261 ENDDO 262 c 263 c -------------- 264 c ----- EXTINCTION GAZ 177 265 DO k=7,NSPECV,10 178 266 write(str1,'(i2.2)') k 179 CALL histdef(nid_day,"kgv"//str1," Hazeext Vis ",267 CALL histdef(nid_day,"kgv"//str1,"Gas ext Vis ", 180 268 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 181 269 . "ave(X)",zsto1,zout) … … 184 272 DO k=8,NSPECI,10 185 273 write(str1,'(i2.2)') k 186 CALL histdef(nid_day,"thi"//str1,"Haze Opa IR", 187 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 188 . "ave(X)",zsto1,zout) 189 ENDDO 190 c 191 DO k=8,NSPECI,10 192 write(str1,'(i2.2)') k 193 CALL histdef(nid_day,"khi"//str1,"Haze ext IR ", 194 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 195 . "ave(X)",zsto1,zout) 196 ENDDO 197 c 198 DO k=8,NSPECI,10 199 write(str1,'(i2.2)') k 200 CALL histdef(nid_day,"tgi"//str1,"Haze Opa IR", 201 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 202 . "ave(X)",zsto1,zout) 203 ENDDO 204 c 205 DO k=8,NSPECI,10 206 write(str1,'(i2.2)') k 207 CALL histdef(nid_day,"kgi"//str1,"Haze ext IR ", 208 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 209 . "ave(X)",zsto1,zout) 210 ENDDO 274 CALL histdef(nid_day,"kgi"//str1,"Gas ext IR ", 275 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 276 . "ave(X)",zsto1,zout) 277 ENDDO 278 c 279 c -------------- 280 c ----- OPACITE NUAGES 281 if (clouds.eq.1) then 282 CALL histdef(nid_day,"tcld","Cld Opa proxy", 283 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 284 . "ave(X)",zsto,zout) 285 c 286 c -------------- 287 c ----- EXTINCTION NUAGES 288 CALL histdef(nid_day,"kcld","Cld Ext proxy", 289 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 290 . "ave(X)",zsto,zout) 291 endif 211 292 c 212 293 ENDIF !lev_histday.GE.3 -
trunk/LMDZ.TITAN/libf/phytitan/ini_histins.h
r107 r175 1 !2 ! $Header: /home/cvsroot/LMDZ4/libf/phylmd/ini_histins.h,v 1.1.1.1 2004/05/19 12:53:08 lmdzadmin Exp $3 !4 1 IF (ok_instan) THEN 5 2 c … … 112 109 c 113 110 if (iflag_trac.eq.1) THEN 114 if (microfi. eq.1) then111 if (microfi.ge.1) then 115 112 DO iq=1,nmicro 116 113 CALL histdef(nid_ins, tname(iq), ttext(iq), "n/m2", 117 114 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 118 . "ins (X)", zsto,zout)115 . "inst(X)", zsto,zout) 119 116 ENDDO 120 117 endif … … 123 120 CALL histdef(nid_ins, tname(iq), ttext(iq), "ppm", 124 121 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 125 . "ins (X)", zsto,zout)122 . "inst(X)", zsto,zout) 126 123 ENDDO 127 124 endif … … 154 151 . 32, "inst(X)", zsto,zout) 155 152 c 153 c -------------- 154 c ----- OPACITE BRUME 156 155 DO k=7,NSPECV,10 157 156 write(str1,'(i2.2)') k … … 161 160 ENDDO 162 161 c 162 DO k=8,NSPECI,10 163 write(str1,'(i2.2)') k 164 CALL histdef(nid_ins,"thi"//str1,"Haze Opa IR", 165 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 166 . "ins(X)",zsto,zout) 167 ENDDO 168 c 169 c -------------- 170 c ----- EXTINCTION BRUME 163 171 DO k=7,NSPECV,10 164 172 write(str1,'(i2.2)') k … … 168 176 ENDDO 169 177 c 178 DO k=8,NSPECI,10 179 write(str1,'(i2.2)') k 180 CALL histdef(nid_ins,"khi"//str1,"Haze ext IR ", 181 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 182 . "ins(X)",zsto,zout) 183 ENDDO 184 c 185 c -------------- 186 c ----- OPACITE GAZ 170 187 DO k=7,NSPECV,10 171 188 write(str1,'(i2.2)') k … … 175 192 ENDDO 176 193 c 194 DO k=8,NSPECI,10 195 write(str1,'(i2.2)') k 196 CALL histdef(nid_ins,"tgi"//str1,"Haze Opa IR", 197 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 198 . "ins(X)",zsto,zout) 199 ENDDO 200 c 201 c -------------- 202 c ----- EXTINCTION GAZ 177 203 DO k=7,NSPECV,10 178 204 write(str1,'(i2.2)') k 179 205 CALL histdef(nid_ins,"kgv"//str1,"Haze ext Vis ", 180 206 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 181 . "ins(X)",zsto,zout)182 ENDDO183 c184 DO k=8,NSPECI,10185 write(str1,'(i2.2)') k186 CALL histdef(nid_ins,"thi"//str1,"Haze Opa IR",187 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32,188 . "ins(X)",zsto,zout)189 ENDDO190 c191 DO k=8,NSPECI,10192 write(str1,'(i2.2)') k193 CALL histdef(nid_ins,"khi"//str1,"Haze ext IR ",194 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32,195 . "ins(X)",zsto,zout)196 ENDDO197 c198 DO k=8,NSPECI,10199 write(str1,'(i2.2)') k200 CALL histdef(nid_ins,"tgi"//str1,"Haze Opa IR",201 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32,202 207 . "ins(X)",zsto,zout) 203 208 ENDDO -
trunk/LMDZ.TITAN/libf/phytitan/ini_histmth.h
r106 r175 105 105 . "ave(X)", zsto1,zout) 106 106 c 107 cccccccccccccccccc Tracers 108 c 107 109 if (iflag_trac.eq.1) THEN 108 c if (microfi.eq.1) then 109 c DO iq=1,nmicro 110 c CALL histdef(nid_mth, tname(iq), ttext(iq), "n/m2", 111 c . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 112 c . "ave(X)", zsto,zout) 113 c ENDDO 114 c endif 115 if (nmicro.lt.nqmax) then 110 if (microfi.ge.1) then 111 c DO iq=1,nmicro 112 c CALL histdef(nid_mth, tname(iq), ttext(iq), "n/m2", 113 c . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 114 c . "ave(X)", zsto,zout) 115 c ENDDO 116 CALL histdef(nid_mth, "qaer","nb tot aer" , "n/m2", 117 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 118 . "ave(X)", zsto,zout) 119 CALL histdef(nid_mth, "qnoy","nb tot noy" , "n/m2", 120 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 121 . "ave(X)", zsto,zout) 122 CALL histdef(nid_mth, "qgl1","V tot gl1" , "m3/m2", 123 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 124 . "ave(X)", zsto,zout) 125 CALL histdef(nid_mth, "qgl2","V tot gl2" , "m3/m2", 126 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 127 . "ave(X)", zsto,zout) 128 CALL histdef(nid_mth, "qgl3","V tot gl3" , "m3/m2", 129 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 130 . "ave(X)", zsto,zout) 131 c-------------- 132 c ----- SATURATION ESP NUAGES 133 if (clouds.eq.1) then 134 CALL histdef(nid_mth,"ch4sat", "saturation CH4", "--", 135 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 136 . "ave(X)", zsto,zout) 137 CALL histdef(nid_mth,"c2h6sat", "saturation C2H6", "--", 138 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 139 . "ave(X)", zsto,zout) 140 CALL histdef(nid_mth,"c2h2sat", "saturation C2H2", "--", 141 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 142 . "ave(X)", zsto,zout) 143 c -------------- 144 c ----- RESERVOIR DE SURFACE 145 CALL histdef(nid_mth, "reserv", "Reservoir surface","m", 146 . iim,jjmp1,nhori, 1,1,1, -99, 32, 147 . "ave(X)", zsto,zout) 148 c -------------- 149 c ----- PRECIPITATIONS (precipitations cumulatives) 150 CALL histdef(nid_mth,"prech4","Precip CH4","m", 151 . iim,jjmp1,nhori, 1,1,1, -99, 32, 152 . "ave(X)", zsto,zout) 153 CALL histdef(nid_mth,"prec2h6","Precip C2H6", 154 . "m",iim,jjmp1,nhori, 1,1,1, -99, 32, 155 . "ave(X)", zsto,zout) 156 CALL histdef(nid_mth,"prec2h2","Precip C2H2", 157 . "m",iim,jjmp1,nhori, 1,1,1, -99, 32, 158 . "ave(X)", zsto,zout) 159 CALL histdef(nid_mth,"prenoy","Precip NOY", 160 . "m",iim,jjmp1,nhori, 1,1,1, -99, 32, 161 . "ave(X)", zsto,zout) 162 CALL histdef(nid_mth,"preaer","Precip AER", 163 . "m",iim,jjmp1,nhori, 1,1,1, -99, 32, 164 . "ave(X)", zsto,zout) 165 c -------------- 166 c ----- FLUX GLACE 167 CALL histdef(nid_mth,"flxgl1", "flux gl CH4", 168 . "kg/m2/s",iim,jjmp1,nhori, klev,1,klev,nvert, 32, 169 . "ave(X)", zsto,zout) 170 CALL histdef(nid_mth,"flxgl2", "flux gl C2H6", 171 . "kg/m2/s",iim,jjmp1,nhori, klev,1,klev,nvert, 32, 172 . "ave(X)", zsto,zout) 173 CALL histdef(nid_mth,"flxgl3", "flux gl C2H2", 174 . "kg/m2/s",iim,jjmp1,nhori, klev,1,klev,nvert, 32, 175 . "ave(X)", zsto,zout) 176 c -------------- 177 c ----- RAYON DES GOUTTES 178 CALL histdef(nid_mth,"rcldbar", "rayon moyen goutte", 179 . "m",iim,jjmp1,nhori, klev,1,klev,nvert, 32, 180 . "ave(X)", zsto,zout) 181 endif 182 endif 183 c -------------- 184 c ----- TRACEURS CHIMIQUES 185 if (nmicro.lt.nqmax) then 116 186 DO iq=nmicro+1,nqmax 117 187 CALL histdef(nid_mth, tname(iq), ttext(iq), "ppm", … … 125 195 c . "ave(X)", zsto,zout) 126 196 c ENDDO 127 197 endif 128 198 endif 129 199 c … … 159 229 . 32, "ave(X)", zsto1,zout) 160 230 c 231 c -------------- 232 c ----- OPACITE BRUME 161 233 DO k=7,NSPECV,10 162 234 write(str1,'(i2.2)') k … … 166 238 ENDDO 167 239 c 240 DO k=8,NSPECI,10 241 write(str1,'(i2.2)') k 242 CALL histdef(nid_mth,"thi"//str1,"Haze Opa IR", 243 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 244 . "ave(X)",zsto1,zout) 245 ENDDO 246 c 247 c -------------- 248 c ----- EXTINCTION BRUME 168 249 DO k=7,NSPECV,10 169 250 write(str1,'(i2.2)') k … … 173 254 ENDDO 174 255 c 256 DO k=8,NSPECI,10 257 write(str1,'(i2.2)') k 258 CALL histdef(nid_mth,"khi"//str1,"Haze ext IR ", 259 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 260 . "ave(X)",zsto1,zout) 261 ENDDO 262 c 263 c -------------- 264 c ----- OPACITE GAZ 175 265 DO k=7,NSPECV,10 176 266 write(str1,'(i2.2)') k 177 CALL histdef(nid_mth,"tgv"//str1,"Haze Opa Vis", 178 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 179 . "ave(X)",zsto1,zout) 180 ENDDO 181 c 267 CALL histdef(nid_mth,"tgv"//str1,"Gas Opa Vis", 268 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 269 . "ave(X)",zsto1,zout) 270 ENDDO 271 c 272 DO k=8,NSPECI,10 273 write(str1,'(i2.2)') k 274 CALL histdef(nid_mth,"tgi"//str1,"Haze Opa IR", 275 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 276 . "ave(X)",zsto1,zout) 277 ENDDO 278 c 279 c -------------- 280 c ----- EXTINCTION GAZ 182 281 DO k=7,NSPECV,10 183 282 write(str1,'(i2.2)') k 184 CALL histdef(nid_mth,"kgv"//str1," Hazeext Vis ",283 CALL histdef(nid_mth,"kgv"//str1,"Gas ext Vis ", 185 284 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 186 285 . "ave(X)",zsto1,zout) … … 189 288 DO k=8,NSPECI,10 190 289 write(str1,'(i2.2)') k 191 CALL histdef(nid_mth,"thi"//str1,"Haze Opa IR", 192 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 193 . "ave(X)",zsto1,zout) 194 ENDDO 195 c 196 DO k=8,NSPECI,10 197 write(str1,'(i2.2)') k 198 CALL histdef(nid_mth,"khi"//str1,"Haze ext IR ", 199 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 200 . "ave(X)",zsto1,zout) 201 ENDDO 202 c 203 DO k=8,NSPECI,10 204 write(str1,'(i2.2)') k 205 CALL histdef(nid_mth,"tgi"//str1,"Haze Opa IR", 206 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 207 . "ave(X)",zsto1,zout) 208 ENDDO 209 c 210 DO k=8,NSPECI,10 211 write(str1,'(i2.2)') k 212 CALL histdef(nid_mth,"kgi"//str1,"Haze ext IR ", 213 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 214 . "ave(X)",zsto1,zout) 215 ENDDO 290 CALL histdef(nid_mth,"kgi"//str1,"Gas ext IR ", 291 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 292 . "ave(X)",zsto1,zout) 293 ENDDO 294 c 295 c -------------- 296 c ----- OPACITE NUAGES 297 if (clouds.eq.1) then 298 CALL histdef(nid_mth,"tcld","Cld Opa proxy", 299 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 300 . "ave(X)",zsto,zout) 301 c 302 c -------------- 303 c ----- EXTINCTION NUAGES 304 CALL histdef(nid_mth,"kcld","Cld Ext proxy", 305 . "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32, 306 . "ave(X)",zsto,zout) 307 endif 308 c 309 c -------------- 310 c ----- OCCURENCE NUAGES 311 do k=1,12 312 write(str1,'(i2.2)') k 313 CALL histdef(nid_mth,"occcld"//str1,"occ cld", 314 . "--",iim,jjmp1,nhori,klev,1,klev,nvert,32, 315 . "ave(X)",zsto,zout) 316 enddo 216 317 c 217 318 ENDIF !lev_histmth.GE.3 -
trunk/LMDZ.TITAN/libf/phytitan/microtab.h
r3 r175 1 *-------------------------------------------------------------------2 *INCLUDE microtab.h3 * 1 !------------------------------------------------------------------- 2 ! INCLUDE microtab.h 3 ! 4 4 REAL wco,df_GP 5 INTEGER nz,nrad, nztop5 INTEGER nz,nrad,imono,nztop,ntype 6 6 7 parameter(nz=llm,nrad=10,nztop=1) !VERSION X 7 parameter(nz=llm,ntype=5,nrad=10,imono=5,nztop=1) !VERSION X 8 ! parameter(nz=llm,ntype=1,nrad=10,imono=5,nztop=1) !VERSION X 8 9 9 10 parameter(wco=177.,df_GP=2.) !FOR FRACTAL PARTCICLES 10 cparameter(wco=1.E+6,df_GP=3.) !FOR SPHERE PARTICLES11 ! parameter(wco=1.E+6,df_GP=3.) !FOR SPHERE PARTICLES 11 12 12 13 real rf(nrad),df(nrad),zf,aknc 13 14 common/frac/rf,df,zf,aknc 14 15 15 *********************************************************************16 *tcorrect, tx, microfi, cutoff: definis dans physiq.def (clesphys.h)17 *------------16 !******************************************************************** 17 ! tcorrect, tx, microfi, cutoff: definis dans physiq.def (clesphys.h) 18 !------------ 18 19 ! WARNING: tx=production rate 19 20 ! tcorrect is readjustment factor: =1 is continiuty 20 21 ! =X is q()*X 21 *------------22 *(*1): si microfi=1, optcv et optci sont appeles a chaque appels de la23 *physique pour reactualiser les TAU's. De meme, pg2.F est24 *active a chaque appel de la physique....25 *si microfi=0., optcv et optci, ainsi que pg2, ne sont appele qu'une26 *fois au debut, comme dans la version originale....27 *------------28 *dans optci et optcv:29 *si cutoff=1, brume coupee facon Pascal -> T ok au sol et dans la strato30 *-> T tropopause mauvaise31 *-> albedo ok32 *si cutoff=2, brume coupee sous 100mbar -> T ok sol/tropopause/strato33 *-> mais albedo mauvais22 !------------ 23 !(*1): si microfi=1, optcv et optci sont appeles a chaque appels de la 24 ! physique pour reactualiser les TAU's. De meme, pg2.F est 25 ! active a chaque appel de la physique.... 26 ! si microfi=0., optcv et optci, ainsi que pg2, ne sont appele qu'une 27 ! fois au debut, comme dans la version originale.... 28 !------------ 29 ! dans optci et optcv: 30 ! si cutoff=1, brume coupee facon Pascal -> T ok au sol et dans la strato 31 ! -> T tropopause mauvaise 32 ! -> albedo ok 33 ! si cutoff=2, brume coupee sous 100mbar -> T ok sol/tropopause/strato 34 ! -> mais albedo mauvais 34 35 -
trunk/LMDZ.TITAN/libf/phytitan/optci.F
r130 r175 32 32 & , REALI(NSPECI), XIMGI(NSPECI), REALV(NSPECV), XIMGV(NSPECV) 33 33 34 COMMON /CLOUD/ RADCLD(NLAYER), XNCLD(NLAYER) 35 & , RCLDI(NSPECI), XICLDI(NSPECI), RCLDV(NSPECV), XICLDV(NSPECV) 34 COMMON /CLOUD/ 35 & RCLDI(NSPECI), XICLDI(NSPECI) 36 & , RCLDV(NSPECV), XICLDV(NSPECV) 37 & , RCLDI2(NSPECI), XICLDI2(NSPECI) 38 & , RCLDV2(NSPECV), XICLDV2(NSPECV) 36 39 37 40 COMMON /TAUS/ TAUHI(ngrid,NSPECI),TAUCI(ngrid,NSPECI), … … 41 44 42 45 COMMON /TAUD/ TAUHID(ngrid,NLAYER,NSPECI) 46 & ,TAUCID(ngrid,NLAYER,NSPECI) 43 47 & ,TAUGID(ngrid,NLAYER,NSPECI) 44 48 & ,TAUHVD(ngrid,NLAYER,NSPECV) 49 & ,TAUCVD(ngrid,NLAYER,NSPECV) 45 50 & ,TAUGVD(ngrid,NLAYER,NSPECV) 46 51 … … 50 55 & ,WBARI(ngrid,NLAYER,NSPECI) 51 56 & ,COSBI(ngrid,NLAYER,NSPECI) 57 & ,DTAUIP(ngrid,NLAYER,NSPECI) 58 & ,TAUIP(ngrid,NLEVEL,NSPECI) 59 & ,WBARIP(ngrid,NLAYER,NSPECI) 60 & ,COSBIP(ngrid,NLAYER,NSPECI) 52 61 53 62 COMMON /SPECTI/ BWNI(NSPC1I), WNOI(NSPECI), 54 63 & DWNI(NSPECI), WLNI(NSPECI) 64 65 REAL DTAUP(ngrid,NLAYER,NSPECI),DTAUPP(ngrid,NLAYER,NSPECI) 66 COMMON /IRTAUS/ DTAUP,DTAUPP 55 67 56 68 COMMON /PLANT/ CSUBP,RSFI,RSFV,F0PI … … 58 70 COMMON /CONST/RGAS,RHOP,PI,SIGMA 59 71 COMMON /part/v,rayon,vrat,dr,dv 72 73 c-----Rayons nuages et "composition" de la goutte 74 c sur la grille ... 75 integer ncount(ngrid,NLAYER) 76 real rmcbar(ngrid,NLAYER) 77 real xfbar(ngrid,NLAYER,4) 78 COMMON/rnuabar/ncount,rmcbar,xfbar 60 79 61 80 DIMENSION PROD(NLEVEL) … … 78 97 data iopti,iwarning,seulmtunpt/0,0,0/ 79 98 80 real zqaer_1pt(NLAYER,nrad) 81 real TAUHID_1pt(NLAYER,NSPECI) 82 real TAUGID_1pt(NLAYER,NSPECI) 83 real TAUHI_1pt(NSPECI),TAUCI_1pt(NSPECI) 84 real TAUGI_1pt(NSPECI) 85 real DTAUI_1pt(NLAYER,NSPECI),TAUI_1pt(NLEVEL,NSPECI) 86 real WBARI_1pt(NLAYER,NSPECI) 87 real COSBI_1pt(NLAYER,NSPECI) 99 real zqaer_1pt(NLAYER,2*nrad) 100 #include "optci_1pt.h" 101 88 102 character*100 dummy 89 103 real dummy2,dummy3 … … 128 142 c il faut quand meme qu on lise la look-up table de dim nrad=10 129 143 c et si microfi=1, on doit avoir nmicro=nrad (dans microtab.h) 130 if ((nmicro.ne.nrad).and.(microfi.eq.1)) then 131 print*,"nmicro.ne.nrad",nmicro,nrad 132 print*,"PROBLEME pour zqaer_1pt dans optci !!" 133 stop 144 c 145 c Nouvelle verif pour nuages : 146 c La condition ci-dessus n'est plus realisable ! 147 c nmicro comprend maintenant aussi des glaces 148 c Donc on teste juste que nmicro soit > 2*nrad (ou nrad si on ne fait pas de nuages) 149 if (microfi.ge.1) then 150 if ((clouds.eq.1).and.(nmicro.lt.2*nrad)) then 151 print*,"OPTCI :" 152 print*,"clouds = 1 MAIS nmicro < 2*nrad" 153 print*,"Probleme pour zqaer_1pt dans optci." 154 stop 155 endif 156 if ((clouds.eq.0).and.(nmicro.lt.nrad)) then 157 print*,"OPTCI :" 158 print*,"nmicro < nrad" 159 print*,"Probleme pour zqaer_1pt dans optci." 160 stop 161 endif 134 162 endif 135 163 136 137 164 DO 420 K=1,NSPECI 138 165 C LETS USE THE THOLIN OPTICAL CONSTANTS FOR THE HAZE. … … 141 168 XIMGI(K)=TNI*FHIR 142 169 C SET UP THE OPTICAL CONSTANTS FOR THE CLOUD 143 RCLDI(K)=1.27 144 XICLDI(K)=REFLIQ(WNOI(K)) 170 CALL LIQCH4(WLNI(K),TNR,TNI) 171 RCLDI(K)=TNR 172 XICLDI(K)=TNI 173 CALL LIQC2H6(WLNI(K),TNR,TNI) 174 RCLDI2(K)=TNR 175 XICLDI2(K)=TNI 145 176 420 CONTINUE 146 177 … … 197 228 c endif 198 229 199 if (microfi.eq.1) then 200 do iq=1,nrad 201 do j=1,NLAYER 202 zqaer_1pt(j,iq)=qaer(ig,j,iq) 203 enddo 204 enddo 230 if (microfi.ge.1) then 231 do iq=1,2*nrad 232 c si on ne fait pas de nuages on ne copie que les nrad premieres valeurs. 233 if (clouds.eq.0.and.iq.gt.nrad) then 234 zqaer_1pt(:,iq)=0. 235 else 236 do j=1,NLAYER 237 zqaer_1pt(j,iq)=qaer(ig,j,iq) 238 enddo 239 endif 240 enddo 205 241 else 206 242 if (ig.eq.1) then 243 zqaer_1pt = 0. 207 244 c initialisation zqaer_1pt a partir d une look-up table (uniforme en ig) 208 245 c boucle sur nrad=10 (dans microtab.h) … … 217 254 c ici, les tableaux definissant la structure des aerosols sont 218 255 c remplis: rf,df(nq),rayon(nq,)v(nq)...... 219 call rdf()256 call rdf() 220 257 endif 221 258 endif … … 229 266 230 267 if (seulmtunpt.eq.0) then 231 call optci_1pt(zqaer_1pt,iopti, 232 . COSBI_1pt,DTAUI_1pt,TAUHI_1pt,TAUHID_1pt,TAUCI_1pt, 233 . TAUGI_1pt,TAUGID_1pt,WBARI_1pt,TAUI_1pt,IPRINT) 268 call optci_1pt2(zqaer_1pt,rmcbar(ig,:),xfbar(ig,:,:), 269 & iopti,IPRINT) 234 270 iopti = 1 235 271 endif … … 241 277 endif 242 278 243 COSBI(ig,:,:) = COSBI_1pt(:,:) 244 WBARI(ig,:,:) = WBARI_1pt(:,:) 245 DTAUI(ig,:,:) = DTAUI_1pt(:,:) 246 TAUHI(ig,:) = TAUHI_1pt(:) 247 TAUCI(ig,:) = TAUCI_1pt(:) 248 TAUGI(ig,:) = TAUGI_1pt(:) 249 TAUI(ig,:,:) = TAUI_1pt(:,:) 250 TAUHID(ig,:,:) = TAUHID_1pt(:,:) 251 TAUGID(ig,:,:) = TAUGID_1pt(:,:) 279 COSBI(ig,:,:) = COSBI_1pt(:,:) 280 WBARI(ig,:,:) = WBARI_1pt(:,:) 281 DTAUI(ig,:,:) = DTAUI_1pt(:,:) 282 TAUI(ig,:,:) = TAUI_1pt(:,:) 283 284 COSBIP(ig,:,:) = COSBIP_1pt(:,:) 285 WBARIP(ig,:,:) = WBARIP_1pt(:,:) 286 DTAUIP(ig,:,:) = DTAUIP_1pt(:,:) 287 TAUIP(ig,:,:) = TAUIP_1pt(:,:) 288 289 TAUHI(ig,:) = TAUHI_1pt(:) 290 TAUCI(ig,:) = TAUCI_1pt(:) 291 TAUGI(ig,:) = TAUGI_1pt(:) 292 293 TAUHID(ig,:,:) = TAUHID_1pt(:,:) 294 TAUCID(ig,:,:) = TAUCID_1pt(:,:) 295 TAUGID(ig,:,:) = TAUGID_1pt(:,:) 252 296 253 297 c************************************************************************ … … 256 300 c************************************************************************ 257 301 c************************************************************************ 302 C THIS ROUTINE HAS ALREADY SET THE DTAUI(J,K) VALUES BUT MUST BE PASSED 303 DO 225 IG=1,klon 304 DO 220 J=1,NLAYER 305 DO 230 K=1,NSPECI 306 DTAUP(IG,J,K)=DTAUI(IG,J,K) 307 DTAUPP(IG,J,K)=DTAUIP(IG,J,K) 308 230 CONTINUE 309 220 CONTINUE 310 225 CONTINUE 258 311 259 312 print*, 'FIN OPTCI' -
trunk/LMDZ.TITAN/libf/phytitan/optci_1pt.F
r130 r175 1 SUBROUTINE optci_1pt(zqaer_1pt,iopti, 2 . COSBI_1pt,DTAUI_1pt,TAUHI_1pt,TAUHID_1pt,TAUCI_1pt, 3 . TAUGI_1pt,TAUGID_1pt,WBARI_1pt,TAUI_1pt,IPRINT) 1 SUBROUTINE optci_1pt(zqaer_1pt,rcdb,xfrb,iopti,IPRINT) 4 2 use dimphy 5 3 #include "dimensions.h" … … 16 14 C iopti: premier appel, on ne calcule qu'une fois les QM et QF 17 15 * nrad dans microtab.h 18 real zqaer_1pt(NLAYER,nrad) 19 real TAUHID_1pt(NLAYER,NSPECI) 20 real TAUGID_1pt(NLAYER,NSPECI) 21 real TAUHI_1pt(NSPECI),TAUCI_1pt(NSPECI) 22 real TAUGI_1pt(NSPECI) 23 real DTAUI_1pt(NLAYER,NSPECI),TAUI_1pt(NLEVEL,NSPECI) 24 real WBARI_1pt(NLAYER,NSPECI) 25 real COSBI_1pt(NLAYER,NSPECI) 16 real zqaer_1pt(NLAYER,2*nrad) 17 #include "optci_1pt.h" 26 18 c --------- 27 19 … … 37 29 & , REALI(NSPECI), XIMGI(NSPECI), REALV(NSPECV), XIMGV(NSPECV) 38 30 39 COMMON /CLOUD/ RADCLD(NLAYER), XNCLD(NLAYER) 40 & , RCLDI(NSPECI), XICLDI(NSPECI), RCLDV(NSPECV), XICLDV(NSPECV) 31 COMMON /CLOUD/ 32 & RCLDI(NSPECI), XICLDI(NSPECI) 33 & , RCLDV(NSPECV), XICLDV(NSPECV) 34 & , RCLDI2(NSPECI), XICLDI2(NSPECI) 35 & , RCLDV2(NSPECV), XICLDV2(NSPECV) 41 36 42 37 COMMON /SPECTI/ BWNI(NSPC1I), WNOI(NSPECI), … … 57 52 REAL QM1(nrad,NSPECI),QM2(nrad,NSPECI) 58 53 REAL QM3(nrad,NSPECI),QM4(nrad,NSPECI) 54 REAL QC1(nrad,NSPECI),QC2(nrad,NSPECI) 55 REAL QC3(nrad,NSPECI),QC4(nrad,NSPECI) 59 56 real emu 60 57 REAL TAEROSM1(NSPECI),TAEROSCATM1(NSPECI),DELTAZM1(NSPECI) 61 58 59 c ---- nuages 60 REAL TNUAGE,TNUAGESCAT 61 REAL rcdb(nlayer),xfrb(nlayer,4) 62 62 63 save qf1,qf2,qf3,qf4,qm1,qm2,qm3,qm4 63 64 … … 192 193 if (iopti.eq.0) then 193 194 194 CALL OPTFRAC(XMONO,10000./WNOI(K)195 & ,QEXT,QSCT,QABS,QBAR)196 197 198 cCALL CFFFV11(1.e-2/WNOI(K),REALI(K),XIMGI(K),RF(inq),2.199 c& ,XMONO,QSCT,QEXT,QABS,QBAR)195 c CALL OPTFRAC(XMONO,10000./WNOI(K) 196 c & ,QEXT,QSCT,QABS,QBAR) 197 198 199 CALL CFFFV11(1.e-2/WNOI(K),REALI(K),XIMGI(K),RF(inq),2. 200 & ,XMONO,QSCT,QEXT,QABS,QBAR) 200 201 201 202 … … 213 214 214 215 IF(TAEROS.LT.1.e-10) TAEROS=1.e-10 215 216 216 ENDIF 217 217 ENDDO ! FIN DE LA BOUCLE SUR nrad … … 279 279 280 280 C NEXT COMPUTE TAU CLOUD 281 TAUCLD=0.0 282 CBARC =0.0 283 IF ( XNCLD(J) .GT. 0..and .taufac.gt.0.) THEN 284 print*,'Appel a xmie avec radcld=',radcld(j) 285 CALL XMIE(RADCLD(J),RCLDI(K),XICLDI(K), 286 & QEXTC,QSCTC,QABSC,CBARC,WNOI(K)) 287 TAUCLD=QEXTC*XNCLD(J) 281 IF (clouds.eq.0) THEN 282 TNUAGE=0. 283 TNUAGESCAT=0. 284 CNBAR=0. 285 ELSE 286 TNUAGE=0. 287 TNUAGESCAT=0. 288 CNBAR=0. 289 QEXTC=0. 290 QSCTC=0. 291 QABSC=0. 292 CBARC=0. 293 294 DO inq=1,nrad !BOUCLE SUR LES NQMX TAILLE D"AEROSOLS 295 QC1(inq,K)=0. 296 QC2(inq,K)=0. 297 QC3(inq,K)=0. 298 QC4(inq,K)=0. 299 ENDDO 300 301 ** OPTICAL CONSTANT : MIXING RULES 302 303 IF (rcdb(nlayer+1-J).gt.1.1e-10) THEN 304 305 XNR=xfrb(nlayer+1-J,1) *REALI(K) 306 & +xfrb(nlayer+1-J,2) *RCLDI(K) 307 & +xfrb(nlayer+1-J,3) *RCLDI2(K) 308 & +xfrb(nlayer+1-J,4) *RCLDI2(K) 309 310 XNI=xfrb(nlayer+1-J,1) *XIMGI(K) 311 & +xfrb(nlayer+1-J,2) *XICLDI(K) 312 & +xfrb(nlayer+1-J,3) *XICLDI2(K) 313 & +xfrb(nlayer+1-J,4) *XICLDI2(K) 314 315 ** OPTICAL CONSTANT : LIQUID DROP = THOLIN 316 317 IF(xfrb(nlayer+1-J,1).ge.0.1) THEN 318 XNI=XIMGI(K) 319 XNR=REALI(K) 320 ENDIF 321 322 IF (XNI.gt.1.e-10 .and. XNR.gt.1.00) THEN 323 CALL CMIE(1.E-2/WNOI(K),XNR,XNI, 324 & rcdb(nlayer+1-J), 325 & QEXTC,QSCTC,QABSC,CBARC) 326 ELSE 327 PRINT*,' WARNING XNR/XNI in optci: ',XNR,XNI 328 QEXTC=0. 329 QSCTC=0. 330 QABSC=0. 331 CBARC=0. 332 ENDIF 333 ELSE 334 QEXTC=0. 335 QSCTC=0. 336 QABSC=0. 337 CBARC=0. 288 338 ENDIF 339 340 DO inq=1,nrad !BOUCLE SUR LES NQMX TAILLE D"AEROSOLS 341 QC1(inq,K)=QEXTC/xnuf 342 QC2(inq,K)=QSCTC/xnuf 343 QC3(inq,K)=QABSC/xnuf 344 QC4(inq,K)=CBARC 345 TNUAGE=QC1(inq,K)*zqaer_1pt(nlayer+1-J,inq+nrad)*1.e-4 346 & +TNUAGE 347 TNUAGESCAT=QC2(inq,K)*zqaer_1pt(nlayer+1-J,inq+nrad)*1.e-4 348 & +TNUAGESCAT 349 CNBAR=QC4(inq,K)*QC2(inq,K) 350 & *zqaer_1pt(nlayer+1-J,inq+nrad)*1.e-4+CNBAR 351 ENDDO 352 353 IF(TNUAGESCAT.EQ.0.) THEN 354 CNBAR=0. 355 ELSE 356 CNBAR=CNBAR/TNUAGESCAT 357 ENDIF 358 ENDIF ! Cond CLD 289 359 290 360 … … 329 399 C 330 400 331 IF (TAEROS + TAUCLD .GT. 0.) THEN 332 COSBI_1pt(J,K)=(CBAR*TAEROSCAT + CBARC*TAUCLD ) 333 & /(TAEROSCAT + TAUCLD) 401 DTAUI_1pt(J,K)=TAUGAS+TAEROS+TNUAGE 402 DTAUIP_1pt(J,K)=TAUGAS+TAEROS 403 404 TAUHI_1pt(K)=TAUHI_1pt(K) + TAEROS 405 TAUHID_1pt(J,K)=TAUHI_1pt(K) 406 407 TAUGI_1pt(K)=TAUGI_1pt(K) + TAUGAS 408 TAUGID_1pt(J,K)=TAUGI_1pt(K) 409 410 TAUCI_1pt(K)=TAUCI_1pt(K) + TNUAGE 411 TAUCID_1pt(J,K)=TAUCI_1pt(K) 412 413 C ??FLAG? SERIOUS PROBLEM WITH THE CODE HERE! 414 415 TLIMIT=1.E-16 416 417 418 IF (TAEROSCAT + TNUAGESCAT .GT. 0.) THEN 419 COSBI_1pt(J,K)=(CBAR*TAEROSCAT + CNBAR*TNUAGESCAT ) 420 & /(TAEROSCAT + TNUAGESCAT) 334 421 ELSE 335 422 COSBI_1pt(J,K)=0.0 336 423 ENDIF 337 424 338 DTAUI_1pt(J,K)=TAUGAS+TAEROS+TAUCLD 339 340 TAUHI_1pt(K)=TAUHI_1pt(K) + TAEROS 341 TAUHID_1pt(J,K)=TAUHI_1pt(K) 342 343 TAUGI_1pt(K)=TAUGI_1pt(K) + TAUGAS 344 TAUGID_1pt(J,K)=TAUGI_1pt(K) 345 346 TAUCI_1pt(K)=TAUCI_1pt(K) + TAUCLD 347 348 c if (ig.eq.1) then 349 c if (k.eq.NSPECI/2.or.k.eq.1.or.k.eq.NSPECI) then 350 c print*,'@IR',K,J,DTAUI_1pt(J,K),TAUGAS,TAEROS,TAUCLD 351 c endif 352 c endif 353 354 355 C ??FLAG? SERIOUS PROBLEM WITH THE CODE HERE! 356 357 TLIMIT=1.E-16 358 359 IF (DTAUI_1pt(J,K) .GT. TLIMIT) THEN 360 361 c***************** ECHANGE 362 c WBARI(J,K)=(QSCT*XNUMB(J) + QSCTC*XNCLD(J)) 363 c**************** 364 CFC WBARI_1pt(J,K)=(TAEROSCAT + QSCTC*XNCLD(J)) 365 c**************** 366 WBARI_1pt(J,K)=TAEROSCAT 367 & /DTAUI_1pt(J,K) 368 c if(iwarning.eq.0) 369 c s print*,'WARNING!!! dans optci xncld non initialise' 370 c iwarning=1 371 425 IF (TAEROSCAT .GT. 0.) THEN 426 COSBIP_1pt(J,K)=(CBAR*TAEROSCAT) 427 & /(TAEROSCAT) 372 428 ELSE 373 429 COSBIP_1pt(J,K)=0.0 430 ENDIF 431 432 *--------- 433 434 IF (DTAUI_1pt(J,K) .GT. TLIMIT) THEN 435 WBARI_1pt(J,K)=(TAEROSCAT+TNUAGESCAT) /DTAUI_1pt(J,K) 436 ELSE 374 437 WBARI_1pt(J,K)=0.0 375 c PRINT*,'gaz ',taugas,'aerosols',taeros,'nuages',taucld376 c WRITE (6,999) J,K,DTAUI_1pt(J,K)377 999 FORMAT (' WARNING TAU MINIMUM AT J,K,DTAU:',2I3,1PE10.3)378 438 DTAUI_1pt(J,K)=TLIMIT 379 380 439 ENDIF 440 441 IF (DTAUIP_1pt(J,K) .GT. TLIMIT) THEN 442 WBARIP_1pt(J,K)=(TAEROSCAT) /DTAUIP_1pt(J,K) 443 ELSE 444 WBARIP_1pt(J,K)=0.0 445 DTAUIP_1pt(J,K)=TLIMIT 446 ENDIF 447 381 448 382 449 c IF (IPRINT .GT. 9) … … 397 464 DO 119 K=1,NSPECI 398 465 TAUI_1pt(1,K)=0.0 466 TAUIP_1pt(1,K)=0.0 399 467 DO 119 J=1,NLAYER 400 468 TAUI_1pt(J+1,K)=TAUI_1pt(J,K)+DTAUI_1pt(J,K) 469 TAUIP_1pt(J+1,K)=TAUIP_1pt(J,K)+DTAUIP_1pt(J,K) 401 470 119 CONTINUE 402 471 -
trunk/LMDZ.TITAN/libf/phytitan/optcv.F
r119 r175 31 31 & , REALI(NSPECI), XIMGI(NSPECI), REALV(NSPECV), XIMGV(NSPECV) 32 32 33 COMMON /CLOUD/ RADCLD(NLAYER), XNCLD(NLAYER)34 & ,RCLDI(NSPECI), XICLDI(NSPECI)33 COMMON /CLOUD/ 34 & RCLDI(NSPECI), XICLDI(NSPECI) 35 35 & , RCLDV(NSPECV), XICLDV(NSPECV) 36 & , RCLDI2(NSPECI), XICLDI2(NSPECI) 37 & , RCLDV2(NSPECV), XICLDV2(NSPECV) 36 38 37 39 COMMON /TAUS/ TAUHI(ngrid,NSPECI), TAUCI(ngrid,NSPECI) … … 41 43 42 44 COMMON /TAUD/ TAUHID(ngrid,NLAYER,NSPECI) 45 & ,TAUCID(ngrid,NLAYER,NSPECI) 43 46 & ,TAUGID(ngrid,NLAYER,NSPECI) 44 47 & ,TAUHVD(ngrid,NLAYER,NSPECV) 48 & ,TAUCVD(ngrid,NLAYER,NSPECV) 45 49 & ,TAUGVD(ngrid,NLAYER,NSPECV) 46 50 … … 49 53 & ,WBARV(ngrid,NLAYER,NSPECV,4) 50 54 & ,COSBV(ngrid,NLAYER,NSPECV,4) 55 & ,DTAUVP(ngrid,NLAYER,NSPECV,4) 56 & ,TAUVP(ngrid,NLEVEL,NSPECV,4) 57 & ,WBARVP(ngrid,NLAYER,NSPECV,4) 58 & ,COSBVP(ngrid,NLAYER,NSPECV,4) 51 59 52 60 COMMON /SPECTV/ BWNV(NSPC1V),WNOV(NSPECV) … … 57 65 COMMON /CONST/ RGAS,RHOP,PI,SIGMA 58 66 COMMON /part/ v(nrad),rayon(nrad),vrat,dr(nrad),dv(nrad) 67 68 c-----Rayons nuages et "composition" de la goutte 69 c sur la grille ... 70 integer ncount(ngrid,NLAYER) 71 real rmcbar(ngrid,NLAYER) 72 real xfbar(ngrid,NLAYER,4) 73 COMMON/rnuabar/ncount,rmcbar,xfbar 59 74 60 75 REAL xv1(klev,NSPECV) … … 74 89 data ioptv,iwarning,seulmtunpt/0,0,0/ 75 90 76 real zqaer_1pt(NLAYER,nrad) 77 real TAUHVD_1pt(NLAYER,NSPECV) 78 real TAUGVD_1pt(NLAYER,NSPECV) 79 real TAUHV_1pt(NSPECV),TAUCV_1pt(NSPECV) 80 real TAURV_1pt(NSPECV),TAUGV_1pt(NSPECV) 81 real DTAUV_1pt(NLAYER,NSPECV,4),TAUV_1pt(NLEVEL,NSPECV,4) 82 real WBARV_1pt(NLAYER,NSPECV,4) 83 real COSBV_1pt(NLAYER,NSPECV,4) 91 real zqaer_1pt(NLAYER,2*nrad) 92 #include "optcv_1pt.h" 93 84 94 character*100 dummy 85 95 real dummy2,dummy3 … … 87 97 C* 88 98 C THIS SUBROUTINE SETS THE OPTICAL CONSTANTS IN THE VISIBLE 89 C IT CALCU ALTES FOR EACH LAYER, FOR EACH SPECRAL INTERVAL IN THE VIS99 C IT CALCULATES FOR EACH LAYER, FOR EACH SPECRAL INTERVAL IN THE VIS 90 100 C LAYER: WBAR, DTAU, COSBAR 91 101 C LEVEL: TAU … … 95 105 print*,'ATTENTION, TAU UNIFORME DANS OPTCV' 96 106 97 c do nng=2,klon98 c do i=1,klev99 c do j=1,nqtot100 c sum=sum+qaer(nng,i,j)*rayon(j)**3.*1.3333*3.1415*1000.101 c enddo102 c enddo103 c enddo104 c print*,sum/(klon-1),'SOMME COLONNE/OPTCV'105 106 107 107 C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 108 108 c INITIALISATIONS UNE SEULE FOIS … … 114 114 c il faut quand meme qu'on lise la look-up table de dim nrad=10 115 115 c et si microfi=1, on doit avoir nmicro=nrad (dans microtab.h) 116 if ((nmicro.ne.nrad).and.(microfi.eq.1)) then 117 print*,"nmicro.ne.nrad",nmicro,nrad 118 print*,"PROBLEME pour zqaer_1pt dans optcv !!" 119 stop 116 c 117 c Nouvelle verif pour nuages : 118 c La condition ci-dessus n'est plus realisable ! 119 c nmicro comprend maintenant aussi des glaces 120 c Donc on teste juste que nmicro soit > 2*nrad (ou nrad si on ne fait pas de nuages) 121 if (microfi.ge.1) then 122 if ((clouds.eq.1).and.(nmicro.lt.2*nrad)) then 123 print*,"OPTCV :" 124 print*,"clouds = 1 MAIS nmicro < 2*nrad" 125 print*,"Probleme pour zqaer_1pt dans optcv." 126 stop 127 endif 128 if ((clouds.eq.0).and.(nmicro.lt.nrad)) then 129 print*,"OPTCV :" 130 print*,"nmicro < nrad" 131 print*,"Probleme pour zqaer_1pt dans optcv." 132 stop 133 endif 120 134 endif 121 122 135 123 136 DO 130 K=1,NSPECV … … 130 143 C XIMGV(K)=FITEDN(WLNV(K)) 131 144 C THE CLOUD IS CLEAR IN THE VISIBLE 132 RCLDV(K)=1.27 133 XICLDV(K)=1.E-7 145 CALL LIQCH4(WLNV(K),TNR,TNI) 146 RCLDV(K)=TNR 147 XICLDV(K)=TNI 148 CALL LIQC2H6(WLNV(K),TNR,TNI) 149 RCLDV2(K)=TNR 150 XICLDV2(K)=TNI 134 151 130 CONTINUE 135 152 C … … 150 167 DO 101 ig=1,klon !c! BOUCLE SUR GRILLE HORIZONTALE 151 168 152 if (microfi.eq.1) then 153 do iq=1,nrad 154 do j=1,NLAYER 155 zqaer_1pt(j,iq)=qaer(ig,j,iq) 156 enddo 157 enddo 169 if (microfi.ge.1) then 170 do iq=1,2*nrad 171 if (clouds.eq.0.and.iq.gt.nrad) then 172 zqaer_1pt(:,iq)=0. 173 else 174 do j=1,NLAYER 175 zqaer_1pt(j,iq)=qaer(ig,j,iq) 176 enddo 177 endif 178 enddo 158 179 else 159 180 if (ig.eq.1) then … … 181 202 c if ((microfi.eq.0).or.(ig.eq.klon/2)) iout=1 182 203 if (seulmtunpt.eq.0) then 183 call optcv_1pt(zqaer_1pt,ioptv, 184 . COSBV_1pt,DTAUV_1pt,TAUHV_1pt,TAUHVD_1pt,TAUCV_1pt, 185 . TAURV_1pt,TAUGV_1pt,TAUGVD_1pt,WBARV_1pt,TAUV_1pt,iout) 204 call optcv_1pt2(zqaer_1pt,rmcbar(ig,:),xfbar(ig,:,:), 205 & ioptv,IPRINT) 186 206 ioptv = 1 187 207 endif 188 208 189 209 c Pas de microphysique, ni de composition variable: un seul passage 190 c dans optc i_1pt.210 c dans optcv_1pt. 191 211 if ((microfi.eq.0).and.(ylellouch)) then 192 212 seulmtunpt = 1 193 213 endif 194 214 195 COSBV(ig,:,:,:)= COSBV_1pt(:,:,:) 196 WBARV(ig,:,:,:)= WBARV_1pt(:,:,:) 197 DTAUV(ig,:,:,:)= DTAUV_1pt(:,:,:) 198 TAUHV(ig,:) = TAUHV_1pt(:) 199 TAUCV(ig,:) = TAUCV_1pt(:) 200 TAURV(ig,:) = TAURV_1pt(:) 201 TAUGV(ig,:) = TAUGV_1pt(:) 202 TAUV(ig,:,:,:) = TAUV_1pt(:,:,:) 203 TAUHVD(ig,:,:) = TAUHVD_1pt(:,:) 204 TAUGVD(ig,:,:) = TAUGVD_1pt(:,:) 215 COSBV(ig,:,:,:)= COSBV_1pt(:,:,:) 216 WBARV(ig,:,:,:)= WBARV_1pt(:,:,:) 217 DTAUV(ig,:,:,:)= DTAUV_1pt(:,:,:) 218 TAUV(ig,:,:,:) = TAUV_1pt(:,:,:) 219 220 COSBVP(ig,:,:,:)= COSBVP_1pt(:,:,:) 221 WBARVP(ig,:,:,:)= WBARVP_1pt(:,:,:) 222 DTAUVP(ig,:,:,:)= DTAUVP_1pt(:,:,:) 223 TAUVP(ig,:,:,:) = TAUVP_1pt(:,:,:) 224 225 TAUHV(ig,:) = TAUHV_1pt(:) 226 TAUCV(ig,:) = TAUCV_1pt(:) 227 TAURV(ig,:) = TAURV_1pt(:) 228 TAUGV(ig,:) = TAUGV_1pt(:) 229 230 TAUHVD(ig,:,:) = TAUHVD_1pt(:,:) 231 TAUCVD(ig,:,:) = TAUCVD_1pt(:,:) 232 TAUGVD(ig,:,:) = TAUGVD_1pt(:,:) 205 233 206 234 101 CONTINUE -
trunk/LMDZ.TITAN/libf/phytitan/optcv_1pt.F
r102 r175 1 SUBROUTINE optcv_1pt(zqaer_1pt,ioptv, 2 . COSBV_1pt,DTAUV_1pt,TAUHV_1pt,TAUHVD_1pt,TAUCV_1pt, 3 . TAURV_1pt,TAUGV_1pt,TAUGVD_1pt,WBARV_1pt,TAUV_1pt,IPRINT) 1 SUBROUTINE optcv_1pt(zqaer_1pt,rcdb,xfrb,ioptv,IPRINT) 4 2 5 3 … … 17 15 C ioptv: premier appel, on ne calcule qu'une fois les QM et QF 18 16 * nrad dans microtab.h 19 real zqaer_1pt(NLAYER,nrad) 20 real TAUHVD_1pt(NLAYER,NSPECV) 21 real TAUGVD_1pt(NLAYER,NSPECV) 22 real TAUHV_1pt(NSPECV),TAUCV_1pt(NSPECV) 23 real TAURV_1pt(NSPECV),TAUGV_1pt(NSPECV) 24 real DTAUV_1pt(NLAYER,NSPECV,4),TAUV_1pt(NLEVEL,NSPECV,4) 25 real WBARV_1pt(NLAYER,NSPECV,4) 26 real COSBV_1pt(NLAYER,NSPECV,4) 17 real zqaer_1pt(NLAYER,2*nrad) 18 #include "optcv_1pt.h" 27 19 c --------- 28 20 … … 38 30 & , REALI(NSPECI), XIMGI(NSPECI), REALV(NSPECV), XIMGV(NSPECV) 39 31 40 COMMON /CLOUD/ RADCLD(NLAYER), XNCLD(NLAYER)41 & ,RCLDI(NSPECI), XICLDI(NSPECI)32 COMMON /CLOUD/ 33 & RCLDI(NSPECI), XICLDI(NSPECI) 42 34 & , RCLDV(NSPECV), XICLDV(NSPECV) 35 & , RCLDI2(NSPECI), XICLDI2(NSPECI) 36 & , RCLDV2(NSPECV), XICLDV2(NSPECV) 43 37 44 38 COMMON /SPECTV/ BWNV(NSPC1V),WNOV(NSPECV) … … 55 49 REAL QM1(nrad,NSPECV),QM2(nrad,NSPECV) 56 50 REAL QM3(nrad,NSPECV),QM4(nrad,NSPECV) 51 REAL QC1(nrad,NSPECV),QC2(nrad,NSPECV) 52 REAL QC3(nrad,NSPECV),QC4(nrad,NSPECV) 53 54 c---- NUAGES 55 real TNUABS,TNUSCAT 56 real rcdb(NLAYER) 57 real xfrb(NLAYER,4) 57 58 58 59 save qf1,qf2,qf3,qf4,qm1,qm2,qm3,qm4 59 60 61 integer ilat,jalt 62 common/toto/ilat,jalt 63 60 64 C* 61 65 C THIS SUBROUTINE SETS THE OPTICAL CONSTANTS IN THE VISIBLE … … 77 81 78 82 DO 100 J=1,NLAYER !a! BOUCLE SUR L"ALTITUDE 79 83 jalt=j 80 84 C #1: HAZE 81 85 c--------------------------- … … 149 153 if(ioptv.eq.0.and.J.eq.1) then 150 154 151 CALL OPTFRAC(XMONO,10000./WNOV(K)152 & ,QEXT,QSCT,QABS,QBAR)153 154 cCALL CFFFV11(1.e-2/WNOV(K),REALV(K),XIMGV(K),RF(inq),2.155 c& ,XMONO,QSCT,QEXT,QABS,QBAR)155 c CALL OPTFRAC(XMONO,10000./WNOV(K) 156 c & ,QEXT,QSCT,QABS,QBAR) 157 158 CALL CFFFV11(1.e-2/WNOV(K),REALV(K),XIMGV(K),RF(inq),2. 159 & ,XMONO,QSCT,QEXT,QABS,QBAR) 156 160 157 161 … … 215 219 IF (TAEROSCAT.le.0.) CBAR=0. 216 220 217 if (IPRINT.eq.1) then218 if (k.eq.NSPECV/2) then219 print*,'@VI',K,J,TAEROS,TAEROSCAT,CBAR220 print*,'@ ',K,J,QF1(1,K),QF2(1,K),zqaer_1pt(NLAYER+1-J,1)221 print*,'@ ',K,J,QF1(3,K),QF2(3,K),zqaer_1pt(NLAYER+1-J,3)222 print*,'@ ',K,J,QF1(5,K),QF2(5,K),zqaer_1pt(NLAYER+1-J,5)223 print*,'@ ',K,J,QF1(7,K),QF2(7,K),zqaer_1pt(NLAYER+1-J,7)224 print*,'@ ',K,J,QF1(9,K),QF2(9,K),zqaer_1pt(NLAYER+1-J,9)225 print*226 endif227 endif228 229 221 c if (IPRINT.eq.1) then 222 c if (k.eq.NSPECV/2) then 223 c write(*,1699) '@VI',K,J,TAEROS,TAEROSCAT,CBAR 224 c write(*,1699) '@ ',K,J,QF1(1,K),QF2(1,K),zqaer_1pt(NLAYER+1-J,1) 225 c write(*,1699) '@ ',K,J,QF1(3,K),QF2(3,K),zqaer_1pt(NLAYER+1-J,3) 226 c write(*,1699) '@ ',K,J,QF1(5,K),QF2(5,K),zqaer_1pt(NLAYER+1-J,5) 227 c write(*,1699) '@ ',K,J,QF1(7,K),QF2(7,K),zqaer_1pt(NLAYER+1-J,7) 228 c write(*,1699) '@ ',K,J,QF1(9,K),QF2(9,K),zqaer_1pt(NLAYER+1-J,9) 229 c print* 230 c endif 231 c endif 232 233 1699 FORMAT(a3,2I3,3(ES15.7,1X)) 230 234 231 235 c*********** EN TRAVAUX *************************** … … 280 284 C NEXT COMPUTE TAU CLOUD 281 285 282 TAUCLD=0.0 283 CBARC =0.0 284 QEXTC =0.0 285 QSCTC =0.0 286 c XNCLD(J)=0. 287 IF ( XNCLD(J) .GT. 0. .and .taufac.gt.0.) THEN 288 CALL XMIE(RADCLD(J),RCLDV(K),XICLDV(K), 289 & QEXTC,QSCTC,QABSC,CBARC,WNOV(K)) 290 TAUCLD=QEXTC*XNCLD(J) 291 ENDIF 292 C 293 TAURV_1pt(K)=TAURV_1pt(K)+TAURAY 294 TAUGVD_1pt(J,K)=TAURV_1pt(K) 295 296 TAUHV_1pt(K)=TAUHV_1pt(K)+TAEROS ! INTEGRATED Quant. 297 TAUHVD_1pt(J,K)=TAUHV_1pt(K) 298 299 TAUCV_1pt(K)=TAUCV_1pt(K)+TAUCLD 286 IF (clouds.eq.0) THEN 287 CNBAR=0. 288 TNUSCAT=0. 289 TNUABS=0. 290 TBNUABS=0. 291 ELSE 292 CNBAR=0. 293 TNUSCAT=0. 294 TNUABS=0. 295 TBNUABS=0. 296 QEXTC=0. 297 QSCTC=0. 298 QABSC=0. 299 CBARC=0. 300 301 do inq=1,nrad 302 QC1(INQ,k)=0. 303 QC2(INQ,k)=0. 304 QC3(INQ,k)=0. 305 QC4(INQ,k)=0. 306 enddo 307 308 IF (rcdb(nlayer+1-J).gt.1.1e-10) THEN 309 310 ** OPTICAL CONSTANT : MIXING RULES 311 312 XNR=xfrb(nlayer+1-J,1)*REALV(K) ! 313 & +xfrb(nlayer+1-J,2)*RCLDV(K) ! 314 & +xfrb(nlayer+1-J,3)*RCLDV2(K) ! 315 & +xfrb(nlayer+1-J,4)*RCLDV2(K) ! 316 317 XNI=xfrb(nlayer+1-J,1)*XIMGV(K) 318 & +xfrb(nlayer+1-J,2)*XICLDV(K) 319 & +xfrb(nlayer+1-J,3)*XICLDV2(K) 320 & +xfrb(nlayer+1-J,4)*XICLDV2(K) 321 322 ** OPTICAL CONSTANT : LIQUID DROP = THOLIN 323 IF(xfrb(nlayer+1-J,1).ge.0.01) THEN 324 XNI=XIMGV(K) 325 XNR=REALV(K) 326 ENDIF 327 328 IF (XNI.gt.1.e-10 .and. XNR.gt.1.00) THEN 329 CALL CMIE(1.E-2/WNOV(K),XNR,XNI, 330 & rcdb(nlayer+1-J), 331 & QEXTC,QSCTC,QABSC,CBARC) 332 ELSE 333 PRINT*,' WARNING XNR/XNI in optcv: ',XNR,XNI 334 QEXTC=0. 335 QSCTC=0. 336 QABSC=0. 337 CBARC=0. 338 STOP 339 ENDIF 340 ELSE 341 QEXTC=0. 342 QSCTC=0. 343 QABSC=0. 344 CBARC=0. 345 ENDIF 346 347 DO inq=1,nrad 348 349 QC1(INQ,k)=QEXTC/xnuf 350 QC2(INQ,k)=QSCTC/xnuf 351 QC3(INQ,k)=QABSC/xnuf 352 QC4(INQ,k)=CBARC 353 354 TNUABS=QC1(inq,K)*zqaer_1pt(NLAYER+1-J,inq+nrad)*1.e-4 355 & +TNUABS 356 357 TNUSCAT=QC2(inq,K)*zqaer_1pt(NLAYER+1-J,inq+nrad)*1.e-4 358 & +TNUSCAT 359 360 CNBAR=QC4(inq,K)*QC2(inq,K)* 361 & zqaer_1pt(NLAYER+1-J,inq+nrad)*1.e-4 + CNBAR 362 363 ENDDO 364 365 IF(TNUSCAT.EQ.0) CNBAR=0. 366 IF(TNUSCAT.NE.0.) CNBAR=CNBAR/TNUSCAT 367 368 369 ENDIF ! Cond. CLD 370 371 TAURV_1pt(K)=TAURV_1pt(K)+TAURAY 372 TAUGVD_1pt(J,K)=TAURV_1pt(K) 373 374 TAUHV_1pt(K)=TAUHV_1pt(K)+TAEROS ! INTEGRATED Quant. 375 TAUHVD_1pt(J,K)=TAUHV_1pt(K) 376 377 TAUCV_1pt(K)=TAUCV_1pt(K)+TNUABS 378 TAUCVD_1pt(J,K)=TAUCV_1pt(K) 379 300 380 301 381 C #4: TAUGAS … … 311 391 312 392 313 C COMPUTE THE AVERAGE COSBAR AND WBAR 314 C&& 315 316 c CBAR=MIN(1.0,1.05*CBAR) ! THE HAZE FORWARD SCATTERING 5%(WHY?) 317 COSBV_1pt(J,K,NT)=(CBAR*TAEROSCAT + CBARC*TAUCLD) 318 & /(TAEROSCAT+TAUCLD+TAURAY) !CBAR_RAY=0. 319 c print*,'CBV',J,K,NT,CBAR,TAEROSCAT,CBARC,TAUCLD 320 321 DTAUV_1pt(J,K,NT)=TAUGAS+TAEROS+TAURAY+TAUCLD !TOTAL TAU_EXT 322 TAUGV_1pt(K)=TAUGV_1pt(K)+TAUGAS*ATERM(NT,K) !TAU_ABS_METH INTEG. 323 324 C WE LET W RAYLEIGH BE .999 OR W=1 WHEN ONLY RAYLEIGH=PROBLEM FOR TRID 325 c WE HAVE ASSUMED ABOVE THAT COSBAR FOR RAYLEIGH IS ZERO. 326 if (IPRINT.eq.1) then 327 if (k.eq.NSPECV/2) then 328 print*,'@VI',K,J,DTAUV_1pt(J,K,1),TAUGAS,TAEROS,TAUCLD 329 endif 330 endif 331 332 333 c***************** ECHANGE 334 c WBARV(J,K,NT)=(QSCT*XNUMB(J)+TAURAY*0.9999999 + QSCTC*XNCLD(J) ) 335 c**************** 336 WBARV_1pt(J,K,NT)=(TAEROSCAT+TAURAY*0.9999999 + QSCTC*XNCLD(J) ) 337 c WBARV_1pt(J,K,NT)=(TAEROSCAT+TAURAY*0.9999999 ) 338 & /(TAUGAS+TAEROS+TAURAY+TAUCLD) 339 c**************** 340 IF((TAEROS+TAUCLD+TAURAY+TAUCLD).le.0.) WBARV_1pt(J,K,NT)=0. 341 IF((TAEROS+TAUCLD+TAURAY).le.0.) COSBV_1pt(J,K,NT)=0. 342 343 c print*,'WBV',J,K,NT,TAEROSCAT,TAURAY,QSCTC*XNCLD(J) 344 c print*,'WBV',J,K,NT,TAEROS,TAUGAS,TAURAY,TAUCLD 345 c print*,Z(j),J,K,NT,TAUV(1,j,K,NT),WBARV(1,j,K,NT),COSBV(1,j,K,NT) 393 * COSBV ET COSBVP 394 *----------------- 395 396 IF(TAEROSCAT+TNUSCAT+TAURAY .ne. 0.) THEN 397 COSBV_1pt(J,K,NT)=(CBAR*TAEROSCAT + CNBAR*TNUSCAT) 398 & /(TAEROSCAT+TNUSCAT+TAURAY) !CBAR_RAY=0. 399 ELSE 400 COSBV_1pt(J,K,NT)=0. 401 ENDIF 402 403 IF(TAEROSCAT+TAURAY .ne. 0.) THEN 404 COSBVP_1pt(J,K,NT)=(CBAR*TAEROSCAT) 405 & /(TAEROSCAT+TAURAY) !CBAR_RAY=0. 406 ELSE 407 COSBVP_1pt(J,K,NT)=0. 408 ENDIF 409 410 * DTAUV ET DTAUVP 411 *----------------- 412 413 DTAUV_1pt(J,K,NT) =TAUGAS+TAEROS+TAURAY+TNUABS !TAU_ABS_METH 414 DTAUVP_1pt(J,K,NT)=TAUGAS+TAEROS+TAURAY !TAU_ABS_METH 415 416 TAUGV_1pt(K)=TAUGV_1pt(K)+TAUGAS*ATERM(NT,K) !INTEG. 417 418 * WBARV ET WBARVP 419 *----------------- 420 421 IF(TAUGAS+TAEROS+TAURAY+TNUABS .ne. 0.) THEN 422 WBARV_1pt(J,K,NT)=(TAEROSCAT+TAURAY*0.9999999 + TNUSCAT) 423 & /(TAUGAS+TAEROS+TAURAY+TNUABS) 424 ELSE 425 WBARV_1pt(J,K,NT)=0. 426 ENDIF 427 428 IF(TAUGAS+TAEROS+TAURAY .ne. 0.) THEN 429 WBARVP_1pt(J,K,NT)=(TAEROSCAT+TAURAY*0.9999999 ) 430 & /(TAUGAS+TAEROS+TAURAY) 431 ELSE 432 WBARVP_1pt(J,K,NT)=0. 433 ENDIF 346 434 347 435 909 CONTINUE … … 358 446 DO 119 NT=1,NTERM(K) 359 447 TAUV_1pt(1,K,NT)=0.0 448 TAUVP_1pt(1,K,NT)=0.0 360 449 DO 119 J=1,NLAYER 361 450 TAUV_1pt(J+1,K,NT)=TAUV_1pt(J,K,NT)+DTAUV_1pt(J,K,NT) 451 TAUVP_1pt(J+1,K,NT)=TAUVP_1pt(J,K,NT)+DTAUVP_1pt(J,K,NT) 362 452 119 CONTINUE 363 453 -
trunk/LMDZ.TITAN/libf/phytitan/phyetat0.F
r102 r175 7 7 . rlat,rlon, tsol,tsoil, 8 8 . albe, solsw, sollw, 9 . fder,radsol, 9 . fder,radsol,resch4, 10 10 . tabcntr0, 11 11 . t_ancien,ancien_ok) … … 25 25 REAL dtime 26 26 INTEGER radpas,chimpas 27 REAL rlat(klon), rlon(klon) 27 REAL rlat(klon), rlon(klon) ! in degrees 28 28 REAL tsol(klon) 29 29 REAL tsoil(klon,nsoilmx) … … 40 40 LOGICAL ancien_ok 41 41 42 REAL resch4(klon) 43 INTEGER ig0 44 42 45 REAL xmin, xmax 43 46 c … … 329 332 ENDIF 330 333 ENDIF 334 c Par defaut on cree 2 bandes de methane au pole Nord et au pole Sud 335 c (entre 75 et 85 degres de latitude) de 2 metres. 336 c Les poles sont sec ! 337 resch4(1) = 0. ! pole nord = 1 point 338 DO ig0=2,klon 339 if ((rlat(ig0).ge.75..and.rlat(ig0).le.85.).or. 340 & (rlat(ig0).ge.-85.and.rlat(ig0).le.-75.)) then 341 resch4(ig0) = 2. 342 else 343 resch4(ig0) = 0. 344 endif 345 ENDDO 346 resch4(klon) = 0. ! pole sud = 1 point 347 348 ierr = NF_INQ_VARID (nid, "RESCH4", nvarid) 349 IF (ierr.NE.NF_NOERR) THEN 350 PRINT*, "phyetat0: Le champ <RESCH4> est absent" 351 PRINT*, "Pas de reservoir de methane mais je continue..." 352 PRINT*, "Pour info, je met 2 metres de methane sur 2 bandes" 353 PRINT*, "comprises entre 75 et 85 degres de latitude dans " 354 PRINT*, "chaque hemisphere." 355 ELSE 356 #ifdef NC_DOUBLE 357 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, resch4) 358 #else 359 ierr = NF_GET_VAR_REAL(nid, nvarid,resch4) 360 #endif 361 IF (ierr.NE.NF_NOERR) THEN 362 PRINT*, "phyetat0: Lecture echouee pour <reservoir>" 363 CALL abort 364 ENDIF 365 ENDIF 331 366 c 332 367 c Fermer le fichier: -
trunk/LMDZ.TITAN/libf/phytitan/phyredem.F
r102 r175 7 7 . albedo, 8 8 . solsw, sollw,fder, 9 . radsol, 9 . radsol,resch4, 10 10 . t_ancien) 11 11 … … 34 34 real fder(klon) 35 35 REAL radsol(klon) 36 real resch4(klon) 36 37 REAL t_ancien(klon,klev) 37 38 c … … 243 244 ierr = NF_REDEF (nid) 244 245 #ifdef NC_DOUBLE 246 ierr = NF_DEF_VAR (nid, "RESCH4", NF_DOUBLE, 1, idim2,nvarid) 247 #else 248 ierr = NF_DEF_VAR (nid, "RESCH4", NF_FLOAT, 1, idim2,nvarid) 249 #endif 250 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 26, 251 . "Reservoir CH4 a la surface") 252 ierr = NF_ENDDEF(nid) 253 #ifdef NC_DOUBLE 254 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,resch4) 255 #else 256 ierr = NF_PUT_VAR_REAL (nid,nvarid,resch4) 257 #endif 258 c 259 ierr = NF_REDEF (nid) 260 #ifdef NC_DOUBLE 245 261 ierr = NF_DEF_VAR (nid, "TANCIEN", NF_DOUBLE, 1, idim3,nvarid) 246 262 #else -
trunk/LMDZ.TITAN/libf/phytitan/physiq.F
r152 r175 79 79 #include "logic.h" 80 80 #include "comorbit.h" 81 #include "microtab.h" 82 #include "diagmuphy.h" 83 #include "itemps.h" 81 84 c====================================================================== 82 85 LOGICAL ok_mensuel ! sortir le fichier mensuel … … 395 398 c Recuperation des TAU du TR 396 399 REAL t_tauhvd(klon,klev),t_khvd(klon,klev) 400 REAL t_tcld(klon,klev),t_kcld(klon,klev) 401 REAL t_kcvd(klon,klev) 397 402 c ASTUCE POUR EVITER klon... EN ATTENDANT MIEUX 398 403 INTEGER ngrid … … 401 406 PARAMETER (NSPECV=24,NSPECI=46,NLAYER=llm) 402 407 REAL TAUHID(ngrid,NLAYER,NSPECI) 408 & ,TAUCID(ngrid,NLAYER,NSPECI) 403 409 & ,TAUGID(ngrid,NLAYER,NSPECI) 404 410 & ,TAUHVD(ngrid,NLAYER,NSPECV) 411 & ,TAUCVD(ngrid,NLAYER,NSPECV) 405 412 & ,TAUGVD(ngrid,NLAYER,NSPECV) 406 413 407 COMMON /TAUD/ TAUHID,TAUGID,TAUHVD,TAUGVD 414 COMMON /TAUD/ TAUHID,TAUCID,TAUGID,TAUHVD,TAUCVD,TAUGVD 415 * common relatifs au nuages 416 real rmcbar(ngrid,NLAYER),xfbar(ngrid,NLAYER,4) 417 integer ncount(ngrid,NLAYER) 418 COMMON/rnuabar/ncount,rmcbar,xfbar 419 420 REAL ch4(klon,jjm+1),dch4(jjm+1) 421 INTEGER ig0 422 integer ich4 423 common/ch4ind/ich4 424 425 c flux de chaleur latente d'evaporation CH4 426 REAL fclat(klon) 427 c reservoir de surface 428 REAL,save,allocatable :: reservoir(:) 408 429 409 430 c Declaration des constantes et des fonctions thermodynamiques … … 446 467 allocate(solsw(klon),sollw(klon),sollwdown(klon)) 447 468 allocate(source(klon,nqmax)) 469 allocate(reservoir(klon)) 448 470 449 471 CALL suphec ! initialiser constantes et parametres phys. … … 458 480 c Initialiser les compteurs: 459 481 c 460 itap = 0 461 itaprad = 0 462 itapchim = 0 482 itap = 0 483 itaprad = 0 484 itapchim = 0 485 ncount(:,:) = 0 463 486 464 487 c … … 469 492 . rlatd,rlond,ftsol,ftsoil, 470 493 . falbe, solsw, sollw, 471 . dlw,radsol, 494 . dlw,radsol,reservoir, 472 495 c . zmea,zstd,zsig,zgam,zthe,zpic,zval, 473 496 . tabcntr0, … … 575 598 c Verifications: 576 599 c 577 if ((nmicro.eq.0).and.(microfi.eq.1)) then 578 print*,"MICROPHYSIQUE ONLINE, MAIS NMICRO=0..." 579 stop 580 endif 600 IF ((nmicro.eq.0).and.(microfi.eq.1)) THEN 601 abort_message="MICROPHYSIQUE ONLINE, MAIS NMICRO=0..." 602 call abort_gcm(modname,abort_message,1) 603 ENDIF 604 IF (microfi.lt.1.and.clouds.eq.1) THEN 605 write(lunout,*)"microfi.lt.1.and.clouds.eq.1" 606 abort_message = 607 & "Impossible de faire des nuages sans microphysique..." 608 call abort_gcm(modname,abort_message,1) 609 ENDIF 581 610 IF (nlon .NE. klon) THEN 582 611 WRITE(lunout,*)'nlon et klon ne sont pas coherents', nlon, … … 650 679 ENDDO 651 680 681 rmcbar = 0. 682 xfbar = 0. 652 683 653 684 ENDIF ! debut 654 685 c==================================================================== 655 686 c====================================================================== 687 688 c Creer un reservoir de surface infini 689 c 690 reservoir(:) = 2. 656 691 657 692 c Mettre a zero des variables de sortie (pour securite) … … 1061 1096 1062 1097 if (iflag_trac.eq.1) then 1098 c call begintime(tt0) 1063 1099 call phytrac (debut,lafin, 1064 1100 . nqmax,nmicro,dtime,appel_chim,dtimechim, 1065 1101 . paprs,pplay,delp,t,rmu0,fract,pdecli,zls, 1066 . tr_seri,qaer,d_tr_mph,d_tr_kim) 1067 1068 if (microfi.eq.1) then 1102 . yu1,yv1,zzlev,zzlay,ftsol, 1103 . tr_seri,qaer,d_tr_mph,d_tr_kim, 1104 . fclat,reservoir) 1105 1106 c call endtime(tt0,tt1) 1107 c ttphytra=ttphytra+tt1 1108 1109 c ----- ICI on ajuste radsol en tenant compte du flux de chaleur latente 1110 c d'evaporation du reservoir. 1111 c NOTE : c'est pas tres elegant mais ca permet d'eviter d'aller 1112 c toucher a clmain. 1113 if (clouds.eq.1) then 1114 radsol(:) = radsol(:)+fclat(:) !test pas de flx de chaleur latente 1115 endif 1116 1117 if (microfi.ge.1) then 1069 1118 tr_seri(:,:,1:nmicro) = tr_seri(:,:,1:nmicro) 1070 1119 . + d_tr_mph(:,:,1:nmicro)*dtime 1071 1120 endif 1121 c PAS ELEGANT mais je n'ai pas trouve d'autres solutions : 1122 c Il semblerait qu'il y ait un probleme lorsque les tendances de traceurs 1123 c retourne des traceurs nuls et il y a parfois des valeurs negatives qui trainent. 1124 c Pour ne diffuser le probleme, on force les valeurs negatives a ZERO. 1125 DO iq=1,nmicro 1126 DO i=1,klon 1127 DO l=1,klev 1128 if (tr_seri(i,l,iq).lt.0.) then 1129 tr_seri(i,l,iq) = 0. 1130 endif 1131 ENDDO 1132 ENDDO 1133 ENDDO 1134 1135 c condensation: 1136 c NE PAS OUBLIER LA CONDENSATION DES NUAGES !!!! 1137 if ((clouds.eq.1.or.(chimi)).and.nqmax.gt.nmicro) then 1138 tr_seri(:,:,nmicro+1:nqmax) = tr_seri(:,:,nmicro+1:nqmax) 1139 . + d_tr_mph(:,:,nmicro+1:nqmax)*dtime 1140 endif 1072 1141 if ((chimi).and.(nqmax.gt.nmicro)) then 1073 1142 c chimie: 1074 1143 tr_seri(:,:,:) = tr_seri(:,:,:) + d_tr_kim(:,:,:)*dtime 1075 c condensation:1076 tr_seri(:,:,nmicro+1:nqmax) = tr_seri(:,:,nmicro+1:nqmax)1077 . + d_tr_mph(:,:,nmicro+1:nqmax)*dtime1078 1144 endif 1079 1145 1080 1146 endif 1147 1148 c ch4=0. 1149 c do l=1,llm 1150 c ch4(1,l) = tr_seri(1,l,ich4) 1151 c do j=2,jjm 1152 c ig0=1+(j-2)*iim 1153 c do i=1,iim 1154 c ch4(j,l)= ch4(j,l) + tr_seri(ig0+i,l,ich4)/iim 1155 c enddo 1156 c enddo 1157 c ch4(jjm+1,l) = tr_seri(klon,l,ich4) 1158 c enddo 1159 c do j=1,jjm+1 1160 c write(501,*) j,ch4(j,1) 1161 c enddo 1162 c do l=1,llm 1163 c write(502,'(I3,49(ES24.17,1X))') l, 1164 c & (ch4(j,l),j=1,jjm+1) 1165 c enddo 1166 c write(501,*) "" 1167 c write(502,*) "" 1081 1168 1082 1169 c------------------ … … 1107 1194 c print*,"sollw avant radlwsw=",sollw(klon/2) 1108 1195 c print*,"avant radlwsw" 1196 1197 c ---------------- 1198 c Calcul du rayon moyen des gouttes et des fractions volumique pour le TR 1199 c ---------------- 1200 IF (clouds.eq.1) THEN 1201 DO i=1,klon 1202 DO j=1,klev 1203 rmcbar(i,j)=rmcbar(i,j)/MAX(FLOAT(ncount(i,j)),1.) 1204 xfbar(i,j,:)=xfbar(i,j,:)/MAX(FLOAT(ncount(i,j)),1.) 1205 ENDDO 1206 ENDDO 1207 ENDIF 1208 1209 c call begintime(tt0) 1109 1210 CALL radlwsw 1110 1211 e (dist, rmu0, fract, dtimerad, zzlev, … … 1115 1216 s sollwdown, 1116 1217 s lwnet, swnet) 1218 c call endtime(tt0,tt1) 1219 c ttrad=ttrad+tt1 1220 1117 1221 c print*,"apres radlwsw" 1222 c mise a zero du rayon moyen des gouttes et des fractions volumique 1223 IF (clouds.eq.1) THEN 1224 rmcbar(:,:) = 0. 1225 xfbar(:,:,:) = 0. 1226 ncount(:,:) = 0 1227 ENDIF 1118 1228 1119 1229 c print*,"radsol apres radlwsw=",radsol(klon/2) … … 1122 1232 itaprad = 0 1123 1233 DO k = 1, klev 1124 DO i = 1, klon1234 DO i = 1, klon 1125 1235 dtrad(i,k) = heat(i,k)-cool(i,k) !K/s 1126 ENDDO1236 ENDDO 1127 1237 ENDDO 1128 1238 c print*,"heat (K/s) =",heat(klon/2,:) … … 1426 1536 ENDDO 1427 1537 c 1428 c incrementation de la tendance (repassee en extensif) sur qaer pour sorties1429 if (microfi.eq.1) then1430 do iq=1,nmicro1431 DO l=1,llm1432 DO i = 1, klon1433 qaer(i,l,iq) = qaer(i,l,iq) +1434 . (d_tr_mph(i,l,iq)*delp(i,l)/RG)*dtime1435 ENDDO1436 ENDDO1437 enddo1438 endif ! microfi1439 1538 c============================================================= 1440 1539 c Ecriture des sorties … … 1502 1601 . falbe, 1503 1602 . solsw, sollw,dlw, 1504 . radsol, 1603 . radsol,reservoir, 1505 1604 c . zmea,zstd,zsig,zgam,zthe,zpic,zval, 1506 1605 . t_ancien) -
trunk/LMDZ.TITAN/libf/phytitan/phytrac.F
r104 r175 2 2 . nqmax,nmicro,ptimestep,appkim,dtkim, 3 3 . pplev,pplay,delp,ptemp,pmu0,pfract,pdecli, 4 . lonsol,tr_seri,qaer,d_tr_mph,d_tr_kim) 4 . lonsol, 5 . pu,pv,pzlev,pzlay,ftsol, 6 . tr_seri,qaer,d_tr_mph,d_tr_kim, 7 . fclat,reservoir) 5 8 6 9 c====================================================================== … … 24 27 c pdecli-------input-R-declinaison en radian 25 28 c lonsol-------input-R-longitude solaire en radian 29 c pu-----------input-R-vitesse dans la direction X (de O a E) en m/s (1ere couche) 30 c pv-----------input-R-vitesse Y (de S a N) en m/s (1ere couche) 31 c pzlev--------input-R-altitude pour chaque inter-couche (en m) 32 c pzlay--------input-R-altitude pour chaque couche (en m) 33 c ftsol--------input-R-temperature au sol (en K) 26 34 c tr_seri------input-R-mass mixing ratio traceurs (kg/kg) 27 35 c d_tr_mph----output-R-tendance microphysique de "qx" (kg/kg/s) 28 36 c d_tr_kim----output-R-tendance chimique de "qx" (kg/kg/s) 37 c fclat--------output-R-flux de chaleur latente d'evaporation du reservoir CH4 (J/m2/s) 38 c reservoir----outpur-R-un reservoir de surface !!! (m) 29 39 c====================================================================== 30 40 USE infotrac … … 34 44 #include "clesphys.h" 35 45 #include "YOMCST.h" 46 #include "microtab.h" 47 #include "varmuphy.h" 48 #include "diagmuphy.h" 49 #include "itemps.h" 36 50 37 51 c====================================================================== … … 44 58 REAL ptemp(klon,klev) 45 59 REAL pmu0(klon), pfract(klon), pdecli, lonsol 60 REAL pu(klon),pv(klon) 61 REAL pzlev(klon,klev+1),pzlay(klon,klev) 62 REAL ftsol(klon) 46 63 REAL tr_seri(klon,klev,nqmax) 47 64 REAL qaer(klon,klev,nqmax) 48 65 REAL d_tr_mph(klon,klev,nqmax),d_tr_kim(klon,klev,nqmax) 66 REAL fclat(klon) 67 REAL reservoir(klon) 49 68 50 69 c====================================================================== 51 70 c Local variables 71 REAL qaer0(klon,klev,nqmax) 72 73 c ASTUCE POUR EVITER klon... EN ATTENDANT MIEUX 74 INTEGER ngrid,NLAYER 75 PARAMETER (ngrid=(jjm-1)*iim+2) ! = klon 76 PARAMETER (NLAYER=llm) ! = klev 77 * common relatifs au nuages 78 real rmcbar(ngrid,NLAYER),xfbar(ngrid,NLAYER,4) 79 integer ncount(ngrid,NLAYER) 80 COMMON/rnuabar/ncount,rmcbar,xfbar 81 82 REAL rcloud(klon,klev,nrad),xfrac(klon,klev,4) 83 84 REAL vcl,nuc,xgsn,xmsn,xesn,xasn 85 86 87 ReAL gaz1(klon,klev),gaz2(klon,klev),gaz3(klon,klev) 88 89 REAL socccld 52 90 53 91 c grandeurs en moyennes zonales 54 REAL zplev(jjm+1,klev+1),zplay(jjm+1,klev) 92 REAL zplev(jjm+1,klev+1),zplay(jjm+1,klev),ztsol(jjm+1) 93 REAL zzlev(jjm+1,klev+1),zzlay(jjm+1,klev) 55 94 REAL ztemp(jjm+1,klev),zmu0(jjm+1),zfract(jjm+1) 56 95 real temp_eq(klev),press_eq(klev) 57 96 REAL zqaer(jjm+1,klev,nqmax) ! et non nmicro... Permet nmicro=0. 58 97 REAL zqaer0(jjm+1,klev,nqmax) 59 REAL pdqmfi(jjm+1,klev,nqmax)98 REAL zdqmufi(jjm+1,klev,nqmax) 60 99 REAL ychim(jjm+1,klev,nqmax-nmicro) 100 REAL zgaz1(jjm+1,klev),zgaz2(jjm+1,klev),zgaz3(jjm+1,klev) 101 REAL zgaz10(jjm+1,klev),zgaz20(jjm+1,klev),zgaz30(jjm+1,klev) 61 102 c La saturation n est calculee qu une seule fois: sauvegarde qysat 62 103 c La chimie n est pas calculee tous les pas, il faut donc … … 65 106 66 107 character*10 nomqy(nqmax-nmicro+1) 67 integer i,j, l,iq,ig0108 integer i,j,k,l,iq,ig0 68 109 110 REAL zprec(jjm+1,5),zsolesp(jjm+1,klev+1,3), 111 & zflxesp_i(jjm+1,klev,3) 112 REAL ztau_drop(jjm+1,klev),ztau_aer(jjm+1,klev,nrad) 113 c 114 c indice des esp chimiques utilisees dans la microfi 115 integer icldch4,icldc2h6,icldc2h2 116 save icldch4,icldc2h6,icldc2h2 117 118 real fte,ftm,Lvch4 119 120 REAL tmp,ex,kmin,kmax,dqsq 121 REAL dqch4 122 c REAL ch4(jjm+1),ch4b(jjm+1),dch4(jjm+1),ch4c(jjm+1,llm) 123 c integer ich4 124 c common/ch4ind/ich4 125 69 126 c====================================================================== 70 127 c====================================================================== … … 72 129 if (firstcall) then 73 130 allocate(qysat(klev,nqmax-nmicro),pdyfi(jjm+1,klev,nqmax-nmicro)) 131 132 c -------- Quelques verifications au demarrage sur les tailles des tableaux. 133 IF (microfi.ge.1) then 134 c Faire de la microphysique sans traceurs... bon courage ! 135 if (nmicro.le.0) then 136 print*,"aLeRtE cRiTiQuE !!!" 137 print*,"Vous faites de la microphysique sans traceurs" 138 print*,"microphysique..." 139 print*,"Je m'arrete et vous laisse reflechir !" 140 stop 141 endif 142 c Nombre de traceurs incompatibles avec la microphysique. 143 if (nmicro.ne.ntype*nrad) then 144 print*,"aLeRtE cRiTiQuE !!!" 145 print*,"Nb trac imcompatible avec la microphysique." 146 print*,nmicro,ntype*nrad 147 stop 148 endif 149 ENDIF 150 74 151 endif 152 153 c RAZ des sorties : les moyennes se font directement dans IOIPSL : 154 c 155 flxesp_i(:,:,:) = 0. 156 tau_drop(:,:) = 0. 157 tau_aer(:,:,:) = 0. 158 solesp(:,:,:) = 0. 159 prec(:,:) = 0. 75 160 76 161 c----------------------------------------------------------------------- … … 80 165 c print*,'CONVERSION 2D ET CHANGEMENT UNITES (PHYTRAC)' 81 166 82 zplev = 0.0 83 zplay = 0.0 84 ztemp = 0.0 85 zqaer = 0.0 86 ychim = 0.0 87 zmu0 = 0.0 88 zfract= 0.0 89 167 c ------------------- 168 c Gestion de la temperature et de la pression : 169 c soit la chimie est active, soit la microphysique se fait en 2D. 170 IF (chimi.or.microfi.eq.1) THEN 171 172 zplev = 0.0 173 zplay = 0.0 174 zzlev = 0.0 175 zzlay = 0.0 176 ztemp = 0.0 177 zqaer = 0.0 178 ychim = 0.0 179 zmu0 = 0.0 180 zfract= 0.0 181 zgaz1 = 0.0 182 zgaz2 = 0.0 183 zgaz3 = 0.0 184 zprec = 0.0 185 zflxesp_i = 0.0 186 ztau_drop = 0.0 187 ztau_aer = 0.0 188 zsolesp = 0.0 189 90 190 do l=1,llm+1 91 191 zplev(1,l) = pplev(1,l) 192 zzlev(1,l) = pzlev(1,l) 92 193 do j=2,jjm 93 194 ig0=1+(j-2)*iim 94 195 do i=1,iim 95 196 zplev(j,l) = zplev(j,l) + pplev(ig0+i,l)/iim 197 zzlev(j,l) = zzlev(j,l) + pzlev(ig0+i,l)/iim 96 198 enddo 97 199 enddo 98 200 zplev(jjm+1,l) = pplev(klon,l) 201 zzlev(jjm+1,l) = pzlev(klon,l) 99 202 enddo 100 203 … … 102 205 ztemp(1,l) = ptemp(1,l) 103 206 zplay(1,l) = pplay(1,l) 207 zzlay(1,l) = pzlay(1,l) 104 208 do j=2,jjm 105 209 ig0=1+(j-2)*iim … … 107 211 ztemp(j,l) = ztemp(j,l) + ptemp(ig0+i,l)/iim 108 212 zplay(j,l) = zplay(j,l) + pplay(ig0+i,l)/iim 213 zzlay(j,l) = zzlay(j,l) + pzlay(ig0+i,l)/iim 109 214 enddo 110 215 enddo 111 216 ztemp(jjm+1,l) = ptemp(klon,l) 112 217 zplay(jjm+1,l) = pplay(klon,l) 218 zzlay(jjm+1,l) = pzlay(klon,l) 113 219 temp_eq = ztemp((jjm+1)/2,:) 114 220 press_eq = zplay((jjm+1)/2,:)/100. ! en mbar 115 221 enddo 222 223 ENDIF ! chimi or microfi=1 224 225 c ----------------------------- 226 c Gestion des variables de la microphysique : 227 c 228 c ------------------- 229 if (microfi.ge.1) then 230 231 c Traceurs microphysiques: passage en extensif: n/kg --> n/m^2 (2D ou 3D passage obligatoire) 232 DO iq=1,nmicro 233 c print*,tname(iq) 234 DO l=1,llm 235 DO i = 1, klon 236 qaer(i,l,iq) = tr_seri(i,l,iq)*delp(i,l)/RG 237 ENDDO 238 ENDDO 239 ENDDO 240 c copie du tableau de traceur : 241 qaer0(:,:,:)=qaer(:,:,:) 242 c 243 c ------------------- 244 c Extraction des gaz pour les nuages 245 c 246 c recuperation des indices des gaz qui nous interesse 247 if (firstcall) then 248 if (clouds.eq.1) then 249 icldch4=-1 250 icldc2h6=-1 251 icldc2h2=-1 252 do i=1,nqmax 253 if (tname(i).eq."CH4") then 254 icldch4=i 255 c ich4=i 256 elseif (tname(i).eq."C2H6") then 257 icldc2h6=i 258 elseif (tname(i).eq."C2H2") then 259 icldc2h2=i 260 endif 261 enddo 262 if (icldch4 .eq.-1 .or. 263 & icldc2h6.eq.-1 .or. 264 & icldc2h2.eq.-1 ) then 265 print*, "Sacrebleu !!!" 266 print*, "Vous voulez faire des nuages sans gaz." 267 print*, "Mais vous etes inconscient. Je vais m'arreter la" 268 print*, "pour vous laisser reflechir au probleme" 269 STOP 270 endif 271 endif ! clouds=1 272 endif ! firstcall 273 274 c Saturation et fraction molaire CLOUD 275 c Calcul des saturations pour les esp chimique de la muphy des nuages. 276 c On le fait ici pour les sortir dans physiq.F sans avoir a surcharger la routine. 277 c Elles passent ensuite dans un common pour passer dans les I/O. 278 c 279 c------------------------------------------- 280 IF (clouds.eq.1) THEN 281 DO l=1,llm 282 DO i = 1, klon 283 call ch4sat(ptemp(i,l),pplay(i,l),tmp) !tmp en kg/kg ! 284 satch4(i,l) = tr_seri(i,l,icldch4)/(tmp*28./16.) 285 286 call c2h6sat(ptemp(i,l),pplay(i,l),tmp) 287 satc2h6(i,l) =tr_seri(i,l,icldc2h6)/(tmp*28./30.) 288 289 call c2h2sat(ptemp(i,l),pplay(i,l),tmp) 290 satc2h2(i,l) =tr_seri(i,l,icldc2h2)/(tmp*28./26.) 291 292 ENDDO 293 ENDDO 294 295 c Copie des gaz (en 3D) <== UNIQUEMENT SI ON FAIT DES NUAGES 296 gaz1(:,:) = tr_seri(:,:,icldch4) 297 gaz2(:,:) = tr_seri(:,:,icldc2h6) 298 gaz3(:,:) = tr_seri(:,:,icldc2h2) 299 300 ENDIF ! clouds=1 301 302 endif ! microfi.ge.1 303 304 c ------------------- 305 c Si microfi = 1 on est en 2D : 306 c conversion des inputs de muphys 307 IF (microfi.eq.1) THEN 116 308 117 309 zmu0(1) = pmu0(1) … … 126 318 zmu0(jjm+1) = pmu0(klon) 127 319 zfract(jjm+1) = pfract(klon) 128 129 c TRACEURS MICROPHYSIQUES 130 131 if (microfi.eq.1) then 132 133 do iq=1,nmicro 134 c print*,tname(iq) 135 136 c Traceurs microphysiques: passage en extensif: n/kg --> n/m^2 137 DO l=1,llm 138 DO i = 1, klon 139 qaer(i,l,iq) = tr_seri(i,l,iq)*delp(i,l)/RG 140 ENDDO 141 ENDDO 142 320 c 321 c traceurs 3D --> 2D 322 c 323 do iq=1,nqmax 143 324 do l=1,llm 144 325 zqaer(1,l,iq) = qaer(1,l,iq) … … 152 333 enddo 153 334 enddo 154 155 endif ! microfi 335 c copie du tableau de traceur 336 zqaer0(:,:,:) = zqaer(:,:,:) 337 c 338 c gaz 3D --> 2D <=== UNIQUEMENT SI ON FAIT DES NUAGES. 339 c 340 if (clouds.eq.1) then 341 do l=1,llm 342 zgaz1(1,l) = gaz1(1,l) 343 zgaz2(1,l) = gaz2(1,l) 344 zgaz3(1,l) = gaz3(1,l) 345 do j=2,jjm 346 ig0=1+(j-2)*iim 347 do i=1,iim 348 zgaz1(j,l) = zgaz1(j,l) + gaz1(ig0+i,l)/iim 349 zgaz2(j,l) = zgaz2(j,l) + gaz2(ig0+i,l)/iim 350 zgaz3(j,l) = zgaz3(j,l) + gaz3(ig0+i,l)/iim 351 enddo 352 enddo 353 zgaz1(jjm+1,l) = gaz1(klon,l) 354 zgaz2(jjm+1,l) = gaz2(klon,l) 355 zgaz3(jjm+1,l) = gaz3(klon,l) 356 enddo 357 358 zgaz10=zgaz1 359 zgaz20=zgaz2 360 zgaz30=zgaz3 361 endif ! clouds=1 362 363 endif ! microfi=1 156 364 157 365 c AUTRES TRACEURS … … 170 378 ychim(jjm+1,l,iq-nmicro) = tr_seri(klon,l,iq) 171 379 enddo 172 nomqy(iq-nmicro) = tname(iq) 173 380 nomqy(iq-nmicro) = tname(iq) 174 381 c print*,iq-nmicro,nomqy(iq-nmicro) 175 176 382 enddo 177 383 nomqy(nqmax-nmicro+1) = "HV" … … 190 396 191 397 c----------------------------------------------------------------------- 192 c Appel de la microphysique 398 c Appel de la microphysique en 2D/3D !!!!!! 193 399 c -------------------------- 194 400 195 pdqmfi = 0.196 zqaer0 = zqaer197 198 401 IF(firstcall) THEN 199 402 print*,'MICROPHYSIQUE ',MICROFI 200 403 ENDIF 201 404 202 IF(MICROFI.eq.1) THEN 203 204 IF(firstcall) THEN 205 print*,'OH! On passe dans la microphysique' 405 c call begintime(tt0) 406 IF (MICROFI.eq.0) THEN 407 c PAS DE MICROPHYSIQUE : 408 c On appelle juste rdf pour creer la grille de rayons. 409 IF (firstcall) THEN 410 print*,'MICROPHYSIQUE OFF-LINE',MICROFI 411 call rdf() 206 412 ENDIF 207 208 CALL pg2(zplev,ztemp,zqaer,pdqmfi ! tendances 2D, /s 209 & ,nmicro,ptimestep,zmu0,zfract,lastcall) 210 413 c NOTES : 414 c L'appel de rdf ne sert a rien ici mis a part pour le TR. Si cet 415 c appel a deja lieu dans le TR inutile de le refaire ici. 416 c Je ne sais pas exactement comment marche les modules en F90 417 c Mais je recopie les valeurs du common/part/ de rdf pour 418 c les mettre dans un common interne a la microphysique (voir varmuphy.h) 419 c DONC J'AI BESOIN D'AVOIR ACCES A L'ANCIEN COMMON !!! 420 c 421 ELSEIF (MICROFI.eq.1) THEN 422 c MICROPHYSIQUE 2D : 423 c Les input/output comportent le prefixe z pour 2D :) 424 zdqmufi = 0. ! ne sert que pour chimi pour condensation 425 call muphys(jjm+1, 426 & zplev,zplay,zzlev,zzlay, 427 & ztemp,zqaer,zgaz1,zgaz2,zgaz3, 428 & nmicro,ptimestep, 429 & zmu0,zfract, 430 c -------- sorties diagnostiques 431 & zflxesp_i, 432 & ztau_drop,ztau_aer, 433 & zsolesp,zprec) 211 434 ELSE 212 213 IF(firstcall) THEN 214 print*,'MICROPHYSIQUE OFF-LINE',MICROFI 215 if (nmicro.gt.0) then 216 CALL pg2(zplev,ztemp,zqaer,pdqmfi 217 & ,nmicro,ptimestep,zmu0,zfract,lastcall) 218 endif 219 ENDIF 220 435 c MICROPHYSIQUE 3D : 436 c Les input sont des champs 3D directement ! 437 call muphys(klon, 438 & pplev,pplay,pzlev,pzlay, 439 & ptemp,qaer,gaz1,gaz2,gaz3, 440 & nmicro,ptimestep, 441 & pmu0,pfract, 442 c ------ sorties diagnostiques 443 & flxesp_i, 444 & tau_drop,tau_aer, 445 & solesp,prec) 446 c 447 c NOTES : 448 c Ici toutes nos sorties sont des champs 3D...(meme les diagnostiques) 449 c On a rien a faire mis a part copier les dq dans les d_tr 450 c 221 451 ENDIF 222 223 zqaer = zqaer+pdqmfi*ptimestep 224 pdqmfi = (zqaer-zqaer0)/ptimestep 452 c call endtime(tt0,tt1) 453 c ttmuphys=ttmuphys+tt1 454 455 c----------------------------------------------------------------------- 456 c Mise a jour des sorties de muphys 457 c ------------- 458 c En 2D on copie les sorties de muphys de la grille LATxALT 459 c sur la grille complete. 460 IF (microfi.eq.1) THEN 461 c precipitations 462 DO l=1,5 463 prec(1,l) = zprec(1,l) 464 ig0 = 2 465 DO j=2,jjm 466 DO i = 1, iim 467 prec(ig0,l) = zprec(j,l) 468 ig0 = ig0 + 1 469 ENDDO 470 ENDDO 471 prec(ig0,l) = zprec(jjm+1,l) 472 ENDDO 473 c taux sedimentation 474 DO l=1,llm 475 c taux sed goutte 476 IF (clouds.eq.1) THEN 477 tau_drop(1,l) = ztau_drop(1,l) 478 ig0 = 2 479 DO j=2,jjm 480 DO i = 1, iim 481 tau_drop(ig0,l) = ztau_drop(j,l) 482 ig0 = ig0 + 1 483 ENDDO 484 ENDDO 485 tau_drop(ig0,l) = ztau_drop(jjm+1,l) 486 ENDIF 487 c taux sed aer 488 DO iq=1,nrad 489 tau_aer(1,l,iq) = ztau_aer(1,l,iq) 490 ig0 = 2 491 DO j=2,jjm 492 DO i = 1, iim 493 tau_aer(ig0,l,iq) = ztau_aer(j,l,iq) 494 ig0 = ig0 + 1 495 ENDDO 496 ENDDO 497 tau_aer(ig0,l,iq) = ztau_aer(jjm+1,l,iq) 498 ENDDO 499 ENDDO 500 c flux glace / production glace 501 IF (clouds.eq.1) THEN 502 DO iq=1,3 503 DO l=1,llm+1 504 if (l.le.llm) flxesp_i(1,l,iq) = zflxesp_i(1,l,iq) 505 solesp(1,l,iq) = zsolesp(1,l,iq) 506 ig0 = 2 507 DO j=2,jjm 508 DO i = 1, iim 509 if (l.le.llm) flxesp_i(ig0,l,iq)=zflxesp_i(1,l,iq) 510 solesp(ig0,l,iq) = zsolesp(1,l,iq) 511 ig0 = ig0 + 1 512 ENDDO 513 ENDDO 514 if (l.le.llm) flxesp_i(ig0,l,iq)=zflxesp_i(jjm+1,l,iq) 515 solesp(ig0,l,iq) = zsolesp(jjm+1,l,iq) 516 ENDDO 517 ENDDO 518 ENDIF 519 ENDIF 225 520 521 c----------------------------------------------------------------------- 522 c Gestion des sources 523 c ------------- 524 c 525 IF (clouds.eq.1) THEN 526 IF (microfi.eq.1) THEN 527 c On repasse les gaz en 3D si on a fait de la microphysique en 2D 528 DO l=1,llm 529 gaz1(1,l) = zgaz1(1,l) 530 gaz2(1,l) = zgaz2(1,l) 531 gaz3(1,l) = zgaz3(1,l) 532 ig0 = 2 533 DO j=2,jjm 534 DO i = 1, iim 535 gaz1(ig0,l) = zgaz1(j,l)* gaz1(ig0,l) /zgaz10(j,l) 536 gaz2(ig0,l) = zgaz2(j,l)* gaz2(ig0,l) /zgaz20(j,l) 537 gaz3(ig0,l) = zgaz3(j,l)* gaz3(ig0,l) /zgaz30(j,l) 538 ig0 = ig0 + 1 539 ENDDO 540 ENDDO 541 gaz1(ig0,l) = zgaz1(jjm+1,l) 542 gaz2(ig0,l) = zgaz2(jjm+1,l) 543 gaz3(ig0,l) = zgaz3(jjm+1,l) 544 ENDDO 545 ENDIF 546 c Mise a jour du reservoir de CH4 (ie : seul le CH4 remplit le reservoir) 547 DO i=1,klon 548 reservoir(i) = reservoir(i)+prec(i,1) 549 ENDDO 550 c Calcul des sources : 551 c ch4=0. 552 c ch4(1) = gaz1(1,1) 553 c do j=2,jjm 554 c ig0=1+(j-2)*iim 555 c do i=1,iim 556 c ch4(j)= ch4(j) + gaz1(ig0+i,1)/iim 557 c enddo 558 c enddo 559 c ch4(jjm+1) = gaz1(ig0,1) 560 561 CALL sources(klon,klev,ptimestep,z0, 562 & pu,pv,pplev,pzlay,pzlev, 563 & gaz1,gaz2,gaz3, 564 & ftsol,solesp,reservoir) 565 566 c ch4b=0. 567 c ch4b(1) = gaz1(1,1) 568 c do j=2,jjm 569 c ig0=1+(j-2)*iim 570 c do i=1,iim 571 c ch4b(j)= ch4b(j) + gaz1(ig0+i,1)/iim 572 c enddo 573 c enddo 574 c ch4b(jjm+1) = gaz1(ig0,1) 575 c do j=1,jjm+1 576 c write(499,*) j,ch4(j),ch4b(j) 577 c enddo 578 c write(499,*) "" 579 ENDIF 226 580 c----------------------------------------------------------------------- 227 581 c Condensation 228 582 c ------------- 229 583 230 if((chimi).and.(nqmax.gt.nmicro)) then231 232 c tendance (en /s) passee sur pdqmfi(nmicro+1 a nqmax)584 IF ((chimi).and.(nqmax.gt.nmicro)) then 585 586 c tendance (en /s) passee sur zdqmufi(nmicro+1 a nqmax) 233 587 c print*,'Condensation' 234 588 … … 237 591 do j=1,jjm+1 238 592 if (ychim(j,l,iq).gt.qysat(l,iq)) then 239 pdqmfi(j,l,nmicro+iq)= (-ychim(j,l,iq)+qysat(l,iq)) !delta y240 . / ptimestep ! / dt593 zdqmufi(j,l,nmicro+iq)= (-ychim(j,l,iq)+qysat(l,iq)) !delta y 594 . / ptimestep ! / dt 241 595 endif 242 596 enddo … … 249 603 c eventuellement, modif initiale de la compo 250 604 c 251 c tendance (en /s) passee sur pdqmfi(nmicro+1 a nqmax)605 c tendance (en /s) passee sur zdqmufi(nmicro+1 a nqmax) 252 606 c 253 607 c if (firstcall .and. chimi .and.(nqmax.gt.nmicro)) then … … 260 614 c do j=1,jjm+1 261 615 c if (ychim(j,l,iq).le.0.015) then 262 c pdqmfi(j,l,nmicro+iq)= (-ychim(j,l,iq)+0.015) !delta y616 c zdqmufi(j,l,nmicro+iq)= (-ychim(j,l,iq)+0.015) !delta y 263 617 c . / ptimestep ! / dt 264 618 c endif … … 278 632 c do j=1,jjm+1 279 633 c if (ychim(j,l,iq).gt.1.e-5) then 280 c pdqmfi(j,l,nmicro+iq)= (-ychim(j,l,iq)+1.e-5) !delta y634 c zdqmufi(j,l,nmicro+iq)= (-ychim(j,l,iq)+1.e-5) !delta y 281 635 c . / ptimestep ! / dt 282 636 c endif … … 288 642 c do j=1,jjm+1 289 643 c if (ychim(j,l,iq).gt.3.e-5) then 290 c pdqmfi(j,l,nmicro+iq)= (-ychim(j,l,iq)+3.e-5) !delta y644 c zdqmufi(j,l,nmicro+iq)= (-ychim(j,l,iq)+3.e-5) !delta y 291 645 c . / ptimestep ! / dt 292 646 c endif … … 298 652 c endif 299 653 c!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 654 655 c ----- commentaire de fin (mise a jour des profil de fraction molaire) 300 656 301 657 c----------------------------------------------------------------------- … … 326 682 327 683 c TRACEURS MICROPHYSIQUES 328 329 if (microfi.eq.1) then 330 331 DO iq=1,nmicro 332 DO l=1,llm 333 d_tr_mph(1,l,iq) = pdqmfi(1,l,iq) 334 ig0 = 2 335 DO j=2,jjm 684 c 685 c ---> pas de microphysique 686 IF (microfi.eq.0) THEN 687 DO iq=1,nmicro 688 d_tr_mph(:,:,iq)=0. 689 ENDDO 690 ENDIF 691 c ---> microphysique 2D 692 IF (microfi.eq.1) THEN 693 c on repasse le champ de traceurs en 3D (pas les tendances) 694 DO iq=1,nmicro 695 DO l=1,llm 696 qaer(1,l,iq) = zqaer(1,l,iq) 697 ig0 = 2 698 DO j=2,jjm 336 699 DO i = 1, iim 337 d_tr_mph(ig0,l,iq) = pdqmfi(j,l,iq) 338 & *qaer(ig0,l,iq)/zqaer0(j,l,iq) 339 ig0 = ig0 + 1 700 c un petit patch : 701 c Si la moyenne zonale au depart est "nulle" : 702 c On a quand meme le droit de produire des traceurs dans la cellule. 703 c On considere donc que la valeur de sortie 3D correspond a la valeur de sortie 2D. 704 c Cela permet aussi entre autre d'eviter les NaN pour les traceurs des nuages ! 705 c (au dessus de la tropo pas de nuages donc qaer(nrad+1:ntype*nrad) = 0 !!!) 706 IF (zqaer0(j,l,iq).lt.1e-100) THEN 707 qaer(ig0,l,iq) = zqaer(j,l,iq) 708 ELSE 709 qaer(ig0,l,iq) = zqaer(j,l,iq) * 710 & qaer0(ig0,l,iq)/zqaer0(j,l,iq) 711 ENDIF 712 ig0 = ig0 + 1 340 713 ENDDO 341 ENDDO 342 d_tr_mph(ig0,l,iq) = pdqmfi(jjm+1,l,iq) 343 ENDDO 344 ENDDO 345 346 do iq=1,nmicro 347 DO l=1,llm 348 DO i = 1, klon 714 ENDDO 715 qaer(ig0,l,iq) = zqaer(jjm+1,l,iq) 716 ENDDO 717 ENDDO 718 c La tendances correspond a (qaer-qaer0)/ptimestep 719 DO iq=1,nmicro 720 DO i=1,klon 721 DO l=1,llm 722 d_tr_mph(i,l,iq) = (qaer(i,l,iq)-qaer0(i,l,iq))/ 723 & ptimestep 724 ENDDO 725 ENDDO 726 ENDDO 727 c ---> microphysique 3D 728 ELSEIF(microfi.gt.1) THEN 729 DO iq=1,nmicro 730 DO l=1,llm 731 DO i = 1, klon 732 d_tr_mph(i,l,iq)=(qaer(i,l,iq)-qaer0(i,l,iq))/ptimestep 733 ENDDO 734 ENDDO 735 ENDDO 736 737 do iq=1,nmicro 738 DO l=1,llm 739 DO i = 1, klon 349 740 c Traceurs microphysiques: passage en intensif: n/m^2 --> n/kg 350 d_tr_mph(i,l,iq) = d_tr_mph(i,l,iq)*RG/delp(i,l) 741 d_tr_mph(i,l,iq) = d_tr_mph(i,l,iq)*RG/delp(i,l) 742 ENDDO 351 743 ENDDO 352 ENDDO 353 enddo 354 355 endif ! microfi 744 enddo 745 746 ENDIF ! microfi 356 747 357 748 c AUTRES TRACEURS … … 360 751 c on passe de pdyfi (tendance chimique en /s calculee quand chimie appelee) 361 752 c a d_tr_kim (tendance chimique 3D en /s, passee a physiq) 362 c et de pdqmfi a d_tr_mph (tendance condensation 3D en /s passee a physiq)753 c et de zdqmufi a d_tr_mph (tendance condensation 3D en /s passee a physiq) 363 754 364 755 DO iq=nmicro+1,nqmax 365 756 DO l=1,llm 366 757 d_tr_kim(1,l,iq) = pdyfi(1,l,iq-nmicro) 367 d_tr_mph(1,l,iq) = pdqmfi(1,l,iq)758 d_tr_mph(1,l,iq) = zdqmufi(1,l,iq) 368 759 ig0 = 2 369 760 DO j=2,jjm … … 371 762 d_tr_kim(ig0,l,iq) = pdyfi(j,l,iq-nmicro) 372 763 & *tr_seri(ig0,l,iq)/ychim(j,l,iq-nmicro) 373 d_tr_mph(ig0,l,iq) = pdqmfi(j,l,iq)764 d_tr_mph(ig0,l,iq) = zdqmufi(j,l,iq) 374 765 & *tr_seri(ig0,l,iq)/ychim(j,l,iq-nmicro) 375 766 ig0 = ig0 + 1 … … 377 768 ENDDO 378 769 d_tr_kim(ig0,l,iq) = pdyfi(jjm+1,l,iq-nmicro) 379 d_tr_mph(ig0,l,iq) = pdqmfi(jjm+1,l,iq)770 d_tr_mph(ig0,l,iq) = zdqmufi(jjm+1,l,iq) 380 771 ENDDO 381 772 ENDDO 382 773 383 774 endif ! chimi 775 776 c-------------------------------------------------- 777 c CONDENSATION VIA MICROFI 778 c---------------------- 779 c La microphysique avec nuages doit se faire obligatoirement en 3D. 780 c Rien n'empeche de faire la chimie en 2D. Cependant pour prendre en compte la 781 c condensation due a la microfi (en 3D) on recalcule la tendance finale pour 782 c les especes concernees (CH4, C2H6 pour le moment). 783 IF (microfi.ge.1.and.clouds.eq.1) THEN 784 DO i=1,klon 785 DO l=1,klev 786 c condensation CH4 787 d_tr_mph(i,l,icldch4)=(gaz1(i,l)-tr_seri(i,l,icldch4)) 788 & /ptimestep 789 c condensation C2H6 790 d_tr_mph(i,l,icldc2h6)=(gaz2(i,l)-tr_seri(i,l,icldc2h6)) 791 & /ptimestep 792 c condensation C2H2 793 d_tr_mph(i,l,icldc2h2)=(gaz3(i,l)-tr_seri(i,l,icldc2h2)) 794 & /ptimestep 795 ENDDO 796 ENDDO 797 ENDIF 798 c ch4c=0. 799 c do l=1,llm 800 c ch4c(1,l) = tr_seri(1,l,icldch4) 801 c do j=2,jjm 802 c ig0=1+(j-2)*iim 803 c do i=1,iim 804 c ch4c(j,l)= ch4c(j,l)+tr_seri(ig0+i,l,icldch4)/iim 805 c enddo 806 c enddo 807 c ch4c(jjm+1,l) = tr_seri(klon,l,icldch4) 808 c enddo 809 c do l=1,llm 810 c write(500,*) pplay(25,l),ch4c(25,l) 811 c enddo 812 c write(500,*) "" 813 814 815 c-------------------------------------------------- 816 c MISE A JOUR CH4 : (pour refixer la fraction 817 c molaire) 818 c-------------------------------------------------- 819 c IF (firstcall) THEN 820 c do i=1,klon 821 c do j=1,llm 822 c call ch4sat(ptemp(i,j),pplay(i,j),tmp) !tmp en kg/kg ! 823 c tmp=0.95*0.85*tmp*28./16. 824 c if (pplay(i,j).lt.20000.) then 825 c dqch4 = 1.4e-2 826 c else 827 c dqch4 = tmp 828 c endif 829 c d_tr_mph(i,j,icldch4)=(-tr_seri(i,j,icldch4)+dqch4)/ 830 c & ptimestep 831 c enddo 832 c enddo 833 c 834 c ENDIF 835 836 c-------------------------------------------------- 837 c CALCUL DU FLUX DE CHALEUR LATENTE D'EVAPORATION 838 c DU METHANE 839 c-------------------------------------------------- 840 IF (clouds.eq.1) THEN 841 DO i=1,klon 842 fte= (1.-ftsol(i)/305.5) 843 ftm= (1.-ftsol(i)/190.5) 844 if(ftm.le.1.e-3) ftm=1.e-3 845 if(fte.le.1.e-3) fte=1.e-3 846 Lvch4 =8.314*190.4* 847 & (7.08*ftm**0.354+10.95*1.1e-2*ftm**0.456) 848 & /mch4 849 ! solcxhy en m3/m2 {ok} 850 ! 425 en kg/m3 851 ! Lv en J/kg {ok} 852 ! ptimestep en s {ok} 853 fclat(i)=(solesp(i,klev+1,1)*Lvch4*rhoi_ch4) ! en J/m2/s 854 ENDDO 855 ENDIF 856 857 c-------------------------------------------------- 858 c GESTION DES RAYONS DE GOUTTES POUR TR 859 c-------------------------------------------------- 860 IF (clouds.eq.1) THEN 861 862 c Calcul du rayon des gouttes par bin ... 863 c---------------------------------------- 864 DO i=1,klon 865 DO j=1,klev 866 DO iq=1,nrad 867 * Rayon minimum selon la quantité de noyaux 868 IF (qaer(i,j,iq+nrad) .le. 1.e-5) THEN 869 rcloud(i,j,iq) = 1.e-10 870 ELSE 871 rcloud(i,j,iq)= 872 & ((qaer(i,j,iq+2*nrad)/qaer(i,j,iq+nrad)+ 873 & qaer(i,j,iq+3*nrad)/qaer(i,j,iq+nrad) + 874 & v_e(iq))*0.75/3.1415926353)**(1./3.) 875 ENDIF 876 ENDDO 877 ENDDO 878 ENDDO 879 880 c .... et de leur rayon moyen total (tt bins confondu) 881 c------------------------------------------------------ 882 DO i=1,klon 883 socccld=0. 884 DO j=klev,1,-1 !de haut en bas pour le calcul des opacites 885 vcl=0. 886 nuc=0. 887 xgsn=0. 888 xmsn=0. 889 xesn=0. 890 xasn=0. 891 DO iq=1,nrad 892 vcl=vcl+qaer(i,j,iq+2*nrad)+ 893 & qaer(i,j,iq+3*nrad)+ 894 & qaer(i,j,iq+4*nrad)+ 895 & v_e(iq)*qaer(i,j,iq+nrad) ! volume des gouttes 896 nuc=nuc+qaer(i,j,iq+nrad) ! nombre de noyaux 897 xgsn=xgsn+qaer(i,j,iq+nrad)*v_e(iq) ! volume de noyaux 898 xmsn=xmsn+qaer(i,j,iq+2*nrad) ! volume de methane 899 xesn=xesn+qaer(i,j,iq+3*nrad) ! volume d' ethane 900 xasn=xasn+qaer(i,j,iq+4*nrad) ! volume d' acethylene 901 ENDDO 902 IF (nuc .le. 1.e-5) THEN 903 rmcloud(i,j)=1.0e-10 904 xfrac(i,j,:)=0. 905 ELSE 906 IF(xgsn/vcl.lt.0. .or. xgsn/vcl.gt.1.001) 907 & print*, 'PB AVEC XFRAC:', i,j,xgsn,vcl 908 rmcloud(i,j)= ! rayon moyen des gouttes 909 & (vcl/nuc*0.75/3.1415926353)**(1./3.) 910 xfrac(i,j,1)=xgsn/vcl ! fraction volumique noyau/goutte 911 xfrac(i,j,2)=xmsn/vcl ! fraction volumique CH4/goutte 912 xfrac(i,j,3)=xesn/vcl ! fraction volumique C2H6/goutte 913 xfrac(i,j,4)=xasn/vcl ! fraction volumique C2H2/goutte 914 c calcul du rayon moyen (moyenne temporelle) 915 rmcbar(i,j)=rmcbar(i,j)+rmcloud(i,j) 916 xfbar(i,j,:)=xfbar(i,j,:)+xfrac(i,j,:) 917 ncount(i,j) = ncount(i,j)+1 918 ENDIF 919 socccld=socccld+3.1415926*(rmcloud(i,j)**2.)*nuc 920 occcld(i,j)=socccld 921 ENDDO 922 ENDDO 923 c 924 c OCCCLD 925 c Calcul le nombre d'occurence d'un nuage 926 c d'opacité comprise en kmin et kmax 927 c k kmin kmax 928 c 1 0.0000000 0.10000000 929 c 2 0.10000000 0.17782794 930 c 3 0.17782794 0.31622776 931 c 4 0.31622776 0.56234139 932 c 5 0.56234139 1.0000000 933 c 6 1.0000000 1.7782795 934 c 7 1.7782795 3.1622777 935 c 8 3.1622777 5.6234136 936 c 9 5.6234136 10.000000 937 c 10 10.000000 17.782795 938 c 11 17.782795 31.622778 939 c 12 31.622778 100000.00 940 c 941 DO i=1,klon 942 DO j=1,klev 943 DO k=1,12 944 ex=10.**(0.25) 945 kmin=0. 946 kmax=1.e5 947 if(k.ne.1) kmin=0.1*ex**(k-2) 948 if(k.ne.12) kmax=0.1*ex**(k-1) 949 if(occcld(i,j).ge.kmin .and. occcld(i,j).lt.kmax) 950 & occcld_m(i,j,k)=1. 951 ENDDO 952 ENDDO 953 ENDDO 954 ENDIF ! fin condition clouds => pas besoin de calculer des rayons 384 955 385 956 RETURN -
trunk/LMDZ.TITAN/libf/phytitan/radlwsw.F
r121 r175 59 59 real solsw(klon), sollw(klon) 60 60 real sollwdown(klon) 61 REAL swnet(klon,k flev+1),lwnet(klon,kflev+1)61 REAL swnet(klon,klev+1),lwnet(klon,klev+1) 62 62 c 63 63 c LOCAL VARIABLES … … 65 65 real zp(klon,klev+1),zt(klon,klev+1),zz(klon,klev+1) 66 66 real zq(klon,klev,nq) 67 real zheat(klon,klev), zcool(klon,klev) 68 REAL zswnet(klon,kflev+1),zlwnet(klon,kflev+1) 69 67 real zheatc(klon,klev), zcoolc(klon,klev) 68 real zheatp(klon,klev), zcoolp(klon,klev) 69 REAL zswnetc(klon,klev+1),zlwnetp(klon,klev+1) 70 REAL zswnetp(klon,klev+1),zlwnetc(klon,klev+1) 71 REAL zsollwdownc(klon),zsollwdownp(klon) 72 INTEGER icld 73 70 74 71 75 c ======================================= … … 123 127 print*,'On calcule le rayonnement SW' 124 128 125 CALL heating(dist,rmu0,fract,zheat,zswnet) 129 IF (clouds.eq.1) THEN 130 ICLD = 1 ! colonne avec nuages 131 CALL heating(dist,rmu0,fract,zheatc,zswnetc,icld) 132 ELSE 133 zheatc = 0. 134 zswnetc = 0. 135 ENDIF 136 ICLD = 0 ! colonne sans nuages 137 CALL heating(dist,rmu0,fract,zheatp,zswnetp,icld) 126 138 127 139 c inversion de l'axe vertical 128 do l=1,klev 129 do i=1,klon 130 heat(i,l)=zheat(i,klev+1-l) 131 enddo 132 enddo 133 do l=1,klev+1 134 do i=1,klon 135 swnet(i,l)=zswnet(i,klev+2-l) 136 enddo 137 enddo 140 do l=1,klev 141 do i=1,klon 142 heat(i,l)=zheatc(i,klev+1-l)*xnuf + 143 & zheatp(i,klev+1-l)*(1.-xnuf) 144 enddo 145 enddo 146 do l=1,klev+1 147 do i=1,klon 148 swnet(i,l)=zswnetc(i,klev+2-l)*xnuf + 149 & zswnetp(i,klev+2-l)*(1.-xnuf) 150 enddo 151 enddo 138 152 139 153 solsw = swnet(:,1) … … 146 160 print*,'On calcule le rayonnement LW' 147 161 148 CALL cooling(klev+1,zp,zt,zz,zcool,zlwnet,sollwdown) 162 IF (clouds.eq.1) THEN 163 ICLD = 1 164 CALL cooling(klon,klev+1,zp,zt,zz,zcoolc,zlwnetc,zsollwdownc, 165 & icld) 166 ELSE 167 zcoolc = 0. 168 zlwnetc = 0. 169 zsollwdownc = 0. 170 ENDIF 171 ICLD = 0 172 CALL cooling(klon,klev+1,zp,zt,zz,zcoolp,zlwnetp,zsollwdownp, 173 & icld) 149 174 150 175 c inversion de l'axe vertical 151 do l=1,klev 152 do i=1,klon 153 cool(i,l)=zcool(i,klev+1-l) 154 enddo 155 enddo 156 do l=1,klev+1 157 do i=1,klon 158 lwnet(i,l)=zlwnet(i,klev+2-l) 159 enddo 160 enddo 176 do l=1,klev 177 do i=1,klon 178 cool(i,l)=zcoolc(i,klev+1-l)*xnuf + 179 & zcoolp(i,klev+1-l)*(1.-xnuf) 180 enddo 181 enddo 182 do l=1,klev+1 183 do i=1,klon 184 lwnet(i,l)=zlwnetc(i,klev+2-l)*xnuf + 185 & zlwnetp(i,klev+2-l)*(1.-xnuf) 186 enddo 187 enddo 188 189 do i=1,klon 190 sollwdown(i)=zsollwdownc(i)*xnuf + 191 & zsollwdownp(i)*(1.-xnuf) 192 enddo 161 193 162 194 sollw = -lwnet(:,1) -
trunk/LMDZ.TITAN/libf/phytitan/radtitan.F
r106 r175 81 81 c --------------------------------------------- 82 82 83 REAL DTAUP(ngrid,NLAYER,NSPECI)84 REAL UBARI,UBARV,UBAR085 83 REAL DZED(NLAYER) 86 84 REAL Z(NLEVEL),PRESS(NLEVEL),DEN(NLEVEL),TEMP(NLEVEL) 87 REAL DTDP(NLAYER),CONVEQ88 85 REAL CH4(NLEVEL),XN2(NLEVEL),H2(NLEVEL),AR(NLEVEL) 89 86 REAL XMU(NLEVEL),GAS1(NLAYER),COLDEN(NLAYER) 90 87 REAL C2H2(NLAYER),C2H6(NLAYER),HCN(NLAYER) 91 REAL SOLARF(NSPECV),PEXPON(NSPECV),ATERM(4,NSPECV)92 INTEGER NTERM(NSPECV)93 REAL BTERM(4,NSPECV)94 REAL RADIUS(NLAYER), XNUMB(NLAYER),REALI(NSPECI), XIMGI(NSPECI)95 REAL REALV(NSPECV), XIMGV(NSPECV)96 REAL RADCLD(NLAYER), XNCLD(NLAYER),RCLDI(NSPECI), XICLDI(NSPECI)97 REAL RCLDV(NSPECV), XICLDV(NSPECV)98 REAL TAUHI(ngrid,NSPECI),TAUCI(ngrid,NSPECI)99 REAL TAUGI(ngrid,NSPECI), TAUGV(ngrid,NSPECV)100 REAL TAURV(ngrid,NSPECV),TAUHV(ngrid,NSPECV)101 REAL TAUCV(ngrid,NSPECV)102 c103 REAL DTAUI(ngrid,NLAYER,NSPECI)104 REAL TAUI(ngrid,NLEVEL,NSPECI)105 REAL WBARI(ngrid,NLAYER,NSPECI)106 REAL COSBI(ngrid,NLAYER,NSPECI)107 REAL BWNI(NSPC1I),WNOI(NSPECI)108 REAL WLNI(NSPECI),DWNI(NSPECI)109 c110 REAL DTAUV(ngrid,NLAYER,NSPECV,4)111 REAL TAUV(ngrid,NLEVEL,NSPECV,4)112 REAL WBARV(ngrid,NLAYER,NSPECV,4)113 REAL COSBV(ngrid,NLAYER,NSPECV,4)114 REAL BWNV(NSPC1V), WNOV(NSPECV),DWNV(NSPECV), WLNV(NSPECV)115 REAL FNETV(ngrid,NLEVEL),FUPV(ngrid,NLEVEL,NSPECV)116 REAL FDV(ngrid,NLEVEL,NSPECV),FMNETV(ngrid,NLEVEL)117 REAL FMUPV(NLEVEL),FMDV(NLEVEL)118 REAL FNET(ngrid,NLEVEL),FMNET(ngrid,NLEVEL)119 REAL THEAT(ngrid,NLAYER)120 REAL CSUBP,RSFI,RSFV,F0PI121 88 REAL RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON 122 REAL RGAS,RHOP,PII,SIGMA 123 REAL TIDAL 124 125 COMMON /IRTAUS/ DTAUP 89 REAL RGAS,RHOP,PI,SIGMA 126 90 127 91 COMMON /VERTICAL/ DZED … … 129 93 COMMON /ATM/ Z,PRESS 130 94 & ,DEN,TEMP 131 132 COMMON /LAPSE/ DTDP,CONVEQ133 COMMON /UBARED/ UBARI,UBARV,UBAR0134 135 95 136 96 … … 143 103 COMMON /STRAT2/ HCN 144 104 145 COMMON /VISGAS/ SOLARF,NTERM146 & ,PEXPON,ATERM147 & ,BTERM148 149 COMMON /AERSOL/ RADIUS, XNUMB150 & ,REALI, XIMGI151 & ,REALV, XIMGV152 153 COMMON /CLOUD/ RADCLD, XNCLD154 & , RCLDI, XICLDI155 & , RCLDV, XICLDV156 157 COMMON /TAUS/ TAUHI,TAUCI,158 & TAUGI, TAUGV,159 & TAURV,TAUHV,160 & TAUCV161 162 * INFRARED CHARACTERISTICS163 *------------------------------164 165 166 COMMON /SPECTI/ BWNI,WNOI167 & ,DWNI,WLNI168 169 COMMON /OPTICI/ DTAUI,170 & TAUI,171 & WBARI,172 & COSBI173 174 175 176 * VISIBLE CHARACTERISTICS177 *------------------------------178 179 180 181 COMMON /OPTICV/ DTAUV182 & ,TAUV183 & ,WBARV184 & ,COSBV185 186 COMMON /SPECTV/ BWNV, WNOV187 & ,DWNV, WLNV188 189 COMMON /FLUXvV/ FNETV,190 & FUPV,191 & FDV,192 & FMNETV193 194 COMMON /FLUX/ FNET, FMNET195 & ,THEAT196 197 198 COMMON /PLANT/ CSUBP,RSFI,RSFV,F0PI199 105 COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON 200 COMMON /CONST/RGAS,RHOP,PII,SIGMA 201 COMMON /IO/ TIDAL 202 203 * nrad dans microtab.h 204 REAL volume(nrad),rayon(nrad),vrat, 205 & drayon(nrad),dvolume(nrad) 206 207 common/part/volume,rayon,vrat, 208 & drayon,dvolume 106 COMMON /CONST/RGAS,RHOP,PI,SIGMA 107 209 108 c----------------------------------------------------------------------- 210 109 c 1. Initialisations: … … 368 267 print*,'On sort de optci' 369 268 370 C THIS ROUTINE HAS ALREADY SET THE DTAUI(J,K) VALUES BUT MUST BE PASSED371 DO 225 IG=1,klon372 DO 220 J=1,NLAYER373 DO 230 K=1,NSPECI374 DTAUP(IG,J,K)=DTAUI(IG,J,K)375 230 CONTINUE376 220 CONTINUE377 225 CONTINUE378 379 269 C NOW, THIS COMPUTATION IS DONE FOR EACH VALUE OF klon 380 270 C INFRARED. AND THEN IN THE VISIBLE. … … 397 287 c on ne recalcule pas optci si microfi=0 et compo lellouch 398 288 c ----------------------------- 399 IF ((MICROFI. eq.1).or.(.not.ylellouch)) THEN289 IF ((MICROFI.ge.1).or.(.not.ylellouch)) THEN 400 290 IF(notfirstcall) THEN !F au 1er appel T aux autres appels!! 401 291 print*,'aerosol/gas/cloud properties' 402 292 CALL OPTCI(ycomp,qaer,nmicro,IPRINT) ! #1 403 DO IG=1,klon404 DO J=1,NLAYER405 DO K=1,NSPECI406 DTAUP(IG,J,K)=DTAUI(IG,J,K)407 ENDDO408 ENDDO409 ENDDO410 293 ENDIF 411 294 ENDIF … … 413 296 c ni optcv si microfi=0 414 297 415 IF (MICROFI. eq.1) THEN298 IF (MICROFI.ge.1) THEN 416 299 IF(notfirstcall) THEN !F au 1er appel T aux autres appels!! 417 300 print*,'aerosol/gas/cloud properties' -
trunk/LMDZ.TITAN/libf/phytitan/sfluxv.F
r104 r175 1 SUBROUTINE SFLUXV(IPRINT,IG,dist_sol )1 SUBROUTINE SFLUXV(IPRINT,IG,dist_sol,icld) 2 2 3 3 use dimphy … … 10 10 PARAMETER (ngrid=(jjm-1)*iim+2) ! = klon 11 11 c 12 INTEGER NLAYER,NLEVEL,NSPECV,NSPC1V 12 INTEGER NLAYER,NLEVEL,NSPECV,NSPC1V,icld 13 13 PARAMETER (NLAYER=llm,NLEVEL=NLAYER+1) 14 14 PARAMETER (NSPECV=24,NSPC1V=25) … … 24 24 & ,WBARV(ngrid,NLAYER,NSPECV,4) 25 25 & ,COSBV(ngrid,NLAYER,NSPECV,4) 26 & ,DTAUVP(ngrid,NLAYER,NSPECV,4) 27 & ,TAUVP(ngrid,NLEVEL,NSPECV,4) 28 & ,WBARVP(ngrid,NLAYER,NSPECV,4) 29 & ,COSBVP(ngrid,NLAYER,NSPECV,4) 26 30 REAL BWNV(NSPC1V),WNOV(NSPECV) 27 31 & ,DWNV(NSPECV),WLNV(NSPECV) … … 43 47 & ,WBARV 44 48 & ,COSBV 49 & ,DTAUVP 50 & ,TAUVP 51 & ,WBARVP 52 & ,COSBVP 45 53 46 54 COMMON /SPECTV/ BWNV,WNOV … … 86 94 C LOOP OVER THE NTERMS BEGINING HERE 87 95 DO 912 NT=1,NTERM(K) 88 BSURF=0.+ RSFV*UBAR0*F0PI*EXP(-TAUV(ig,NLEVEL,K,NT)/UBAR0) 96 IF (ICLD.eq.1) THEN 97 BSURF=0.+ RSFV*UBAR0*F0PI*EXP(-TAUV(ig,NLEVEL,K,NT)/UBAR0) 98 ELSE 99 BSURF=0.+ RSFV*UBAR0*F0PI*EXP(-TAUVP(ig,NLEVEL,K,NT)/UBAR0) 100 ENDIF 89 101 C 90 102 C* WE CAN NOW SOLVE FOR THE COEFFICIENTS OF THE TWO STREAM … … 99 111 C USE DT0,T0,WB0,CO0 INSTEAD OF DTAUV(ig,1,K,NT)..etc... 100 112 101 DO J=1,NLAYER 102 DT0(J)=DTAUV(ig,J,K,NT) 103 T0(J) =TAUV(ig,J,K,NT) 104 WB0(J)=WBARV(ig,J,K,NT) 105 CO0(J)=COSBV(ig,J,K,NT) 106 ENDDO 113 IF (ICLD.EQ.1) THEN 114 DO J=1,NLAYER 115 DT0(J)=DTAUV(ig,J,K,NT) 116 T0(J) =TAUV(ig,J,K,NT) 117 WB0(J)=WBARV(ig,J,K,NT) 118 CO0(J)=COSBV(ig,J,K,NT) 119 ENDDO 120 T0(NLEVEL)=TAUV(ig,NLEVEL,K,NT) 121 ELSE 122 DO J=1,NLAYER 123 DT0(J)=DTAUVP(ig,J,K,NT) 124 T0(J) =TAUVP(ig,J,K,NT) 125 WB0(J)=WBARVP(ig,J,K,NT) 126 CO0(J)=COSBVP(ig,J,K,NT) 127 ENDDO 128 T0(NLEVEL)=TAUVP(ig,NLEVEL,K,NT) 107 129 108 T0(NLEVEL)=TAUV(ig,NLEVEL,K,NT)130 ENDIF 109 131 110 132 c PRINT*,'entree gfluxv #: ',ig,K -
trunk/LMDZ.TITAN/libf/phytitan/write_histday.h
r110 r175 94 94 . iim*jjmp1*klev,ndex3d) 95 95 c 96 ENDIF !lev_histday.GE.297 c98 c-------------------------------------------------------99 IF(lev_histday.GE.3) THEN100 c101 96 cccccccccccccccccc Tracers 102 97 c 103 98 if (iflag_trac.eq.1) THEN 104 if (microfi.eq.1) then 105 DO iq=1,nmicro 106 CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qaer(1,1,iq), zx_tmp_3d) 107 CALL histwrite(nid_day,tname(iq),itau_w,zx_tmp_3d, 108 . iim*jjmp1*klev,ndex3d) 109 ENDDO 99 if (microfi.ge.1) then 100 c DO iq=1,nmicro 101 c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qaer(1,1,iq), zx_tmp_3d) 102 c CALL histwrite(nid_day,tname(iq),itau_w,zx_tmp_3d, 103 c . iim*jjmp1*klev,ndex3d) 104 c ENDDO 105 c ------- NB AER TOT 106 do i=1,klon 107 do j=1,klev 108 zx_tmp_fi3d(i,j)= SUM(qaer(i,j,1:nrad)) 109 enddo 110 enddo 111 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 112 CALL histwrite(nid_day,"qaer",itau_w,zx_tmp_3d, 113 . iim*jjmp1*klev,ndex3d) 114 c ------- NB NOY TOT 115 do i=1,klon 116 do j=1,klev 117 zx_tmp_fi3d(i,j)= SUM(qaer(i,j,nrad+1:2*nrad)) 118 enddo 119 enddo 120 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 121 CALL histwrite(nid_day,"qnoy",itau_w,zx_tmp_3d, 122 . iim*jjmp1*klev,ndex3d) 123 c ------- V GLA1 TOT 124 do i=1,klon 125 do j=1,klev 126 zx_tmp_fi3d(i,j)= SUM(qaer(i,j,2*nrad+1:3*nrad)) 127 enddo 128 enddo 129 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 130 CALL histwrite(nid_day,"qgl1",itau_w,zx_tmp_3d, 131 . iim*jjmp1*klev,ndex3d) 132 c ------- V GLA2 TOT 133 do i=1,klon 134 do j=1,klev 135 zx_tmp_fi3d(i,j)= SUM(qaer(i,j,3*nrad+1:4*nrad)) 136 enddo 137 enddo 138 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 139 CALL histwrite(nid_day,"qgl2",itau_w,zx_tmp_3d, 140 . iim*jjmp1*klev,ndex3d) 141 c ------- V GLA3 TOT 142 do i=1,klon 143 do j=1,klev 144 zx_tmp_fi3d(i,j)= SUM(qaer(i,j,4*nrad+1:5*nrad)) 145 enddo 146 enddo 147 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 148 CALL histwrite(nid_day,"qgl3",itau_w,zx_tmp_3d, 149 . iim*jjmp1*klev,ndex3d) 150 c -------------- 151 c ----- SATURATION ESP NUAGES 152 if (clouds.eq.1) then 153 154 CALL gr_fi_ecrit(klev,klon,iim,jjmp1, satch4,zx_tmp_3d) 155 CALL histwrite(nid_day,"ch4sat", itau_w, zx_tmp_3d, 156 . iim*jjmp1*klev,ndex3d) 157 158 CALL gr_fi_ecrit(klev,klon,iim,jjmp1, satc2h6,zx_tmp_3d) 159 CALL histwrite(nid_day,"c2h6sat", itau_w, zx_tmp_3d, 160 . iim*jjmp1*klev,ndex3d) 161 162 CALL gr_fi_ecrit(klev,klon,iim,jjmp1, satc2h2,zx_tmp_3d) 163 CALL histwrite(nid_day,"c2h2sat", itau_w, zx_tmp_3d, 164 . iim*jjmp1*klev,ndex3d) 165 c -------------- 166 c ----- RESERVOIR DE SURFACE 167 CALL gr_fi_ecrit(1, klon,iim,jjmp1,reservoir,zx_tmp_2d) 168 CALL histwrite(nid_day,"reserv",itau_w,zx_tmp_2d, 169 . iim*jjmp1,ndex2d) 170 c -------------- 171 c ----- PRECIPITATIONS 172 c ----- CH4 173 CALL gr_fi_ecrit(1, klon,iim,jjmp1,prec(:,1),zx_tmp_2d) 174 CALL histwrite(nid_day,"prech4",itau_w,zx_tmp_2d, 175 . iim*jjmp1,ndex2d) 176 c ----- C2H6 177 CALL gr_fi_ecrit(1, klon,iim,jjmp1,prec(:,2),zx_tmp_2d) 178 CALL histwrite(nid_day,"prec2h6",itau_w,zx_tmp_2d, 179 . iim*jjmp1,ndex2d) 180 c ----- C2H2 181 CALL gr_fi_ecrit(1, klon,iim,jjmp1,prec(:,3),zx_tmp_2d) 182 CALL histwrite(nid_day,"prec2h2",itau_w,zx_tmp_2d, 183 . iim*jjmp1,ndex2d) 184 c 185 c -------------- 186 c ----- FLUX GLACE 187 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,flxesp_i(1,1,1),zx_tmp_3d) 188 CALL histwrite(nid_day,"flxgl1", itau_w, zx_tmp_3d, 189 . iim*jjmp1*klev,ndex3d) 190 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,flxesp_i(1,1,2),zx_tmp_3d) 191 CALL histwrite(nid_day,"flxgl2", itau_w, zx_tmp_3d, 192 . iim*jjmp1*klev,ndex3d) 193 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,flxesp_i(1,1,3),zx_tmp_3d) 194 CALL histwrite(nid_day,"flxgl3", itau_w, zx_tmp_3d, 195 . iim*jjmp1*klev,ndex3d) 196 c 197 c -------------- 198 c ----- RAYON MOYEN GOUTTE 199 CALL gr_fi_ecrit(klev,klon,iim,jjmp1, rmcloud,zx_tmp_3d) 200 CALL histwrite(nid_day,"rcldbar", itau_w, zx_tmp_3d, 201 . iim*jjmp1*klev,ndex3d) 202 c 203 endif 110 204 endif 205 c 206 c -------------- 207 c ----- TRACEURS CHIMIQUES 111 208 if (nmicro.lt.nqmax) then 112 209 DO iq=nmicro+1,nqmax … … 118 215 endif 119 216 c 217 ENDIF !lev_histday.GE.2 218 c 219 c------------------------------------------------------- 220 IF(lev_histday.GE.3) THEN 221 c 120 222 cccccccccccccccccc Radiative transfer 121 223 c … … 143 245 . iim*jjmp1*klev,ndex3d) 144 246 c 145 c 3D adding Tau and k (31/08/10)146 c 247 c -------------- 248 c ----- OPACITE BRUME 147 249 do k=7,NSPECV,10 148 250 do i=1,klon … … 158 260 enddo ! fin boucle NSPECV 159 261 262 do k=8,NSPECI,10 263 do i=1,klon 264 do l=1,klev 265 t_tauhvd(i,l)=TAUHID(i,klev-l+1,k) 266 enddo 267 enddo 268 write(str1,'(i2.2)') k 269 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 270 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 271 CALL histwrite(nid_day,"thi"//str1,itau_w,zx_tmp_3d, 272 . iim*jjmp1*klev,ndex3d) 273 enddo ! fin boucle NSPECI 274 c 275 c -------------- 276 c ----- EXTINCTION BRUME 160 277 do k=7,NSPECV,10 161 278 do i=1,klon 162 279 do l=1,klev 163 if(l.ne.klev) 164 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k) 165 s -TAUHVD(i,klev-l+1-1,k) 166 280 if(l.ne.klev) 281 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k) 282 s -TAUHVD(i,klev-l+1-1,k) 167 283 if(l.eq.klev) 168 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k)284 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k) 169 285 170 286 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) … … 178 294 enddo ! fin boucle NSPECV 179 295 296 do k=8,NSPECI,10 297 do i=1,klon 298 do l=1,klev 299 if(l.ne.klev) 300 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 301 s -TAUHID(i,klev-l+1-1,k) 302 if(l.eq.klev) 303 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 304 305 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) 306 enddo 307 enddo 308 write(str1,'(i2.2)') k 309 zx_tmp_fi3d(1:klon,1:klev)=t_khvd(1:klon,1:klev) 310 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 311 CALL histwrite(nid_day,"khi"//str1,itau_w,zx_tmp_3d, 312 . iim*jjmp1*klev,ndex3d) 313 enddo ! fin boucle NSPECI 314 c 315 c -------------- 316 c ----- OPACITE GAZ 180 317 do k=7,NSPECV,10 181 318 do i=1,klon … … 191 328 enddo ! fin boucle NSPECV 192 329 330 do k=8,NSPECI,10 331 do i=1,klon 332 do l=1,klev 333 t_tauhvd(i,l)=TAUGID(i,klev-l+1,k) 334 enddo 335 enddo 336 write(str1,'(i2.2)') k 337 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 338 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 339 CALL histwrite(nid_day,"tgi"//str1,itau_w,zx_tmp_3d, 340 . iim*jjmp1*klev,ndex3d) 341 enddo ! fin boucle NSPECI 342 c 343 c -------------- 344 c ----- EXTINCTION GAZ 193 345 do k=7,NSPECV,10 194 346 do i=1,klon 195 347 do l=1,klev 196 if(l.ne.klev) 197 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k) 198 s -TAUGVD(i,klev-l+1-1,k) 199 348 if(l.ne.klev) 349 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k) 350 s -TAUGVD(i,klev-l+1-1,k) 200 351 if(l.eq.klev) 201 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k)352 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k) 202 353 203 354 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) … … 214 365 do i=1,klon 215 366 do l=1,klev 216 t_tauhvd(i,l)=TAUHID(i,klev-l+1,k) 217 enddo 218 enddo 219 write(str1,'(i2.2)') k 220 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 221 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 222 CALL histwrite(nid_day,"thi"//str1,itau_w,zx_tmp_3d, 367 if(l.ne.klev) 368 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 369 s -TAUGID(i,klev-l+1-1,k) 370 371 if(l.eq.klev) 372 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 373 374 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) 375 enddo 376 enddo 377 write(str1,'(i2.2)') k 378 zx_tmp_fi3d(1:klon,1:klev)=t_khvd(1:klon,1:klev) 379 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 380 CALL histwrite(nid_day,"kgi"//str1,itau_w,zx_tmp_3d, 223 381 . iim*jjmp1*klev,ndex3d) 224 382 enddo ! fin boucle NSPECI 225 383 226 do k=8,NSPECI,10 227 do i=1,klon 228 do l=1,klev 229 if(l.ne.klev) 230 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 231 s -TAUHID(i,klev-l+1-1,k) 232 233 if(l.eq.klev) 234 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 235 236 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) 237 enddo 238 enddo 239 write(str1,'(i2.2)') k 240 zx_tmp_fi3d(1:klon,1:klev)=t_khvd(1:klon,1:klev) 241 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 242 CALL histwrite(nid_day,"khi"//str1,itau_w,zx_tmp_3d, 243 . iim*jjmp1*klev,ndex3d) 244 enddo ! fin boucle NSPECI 245 246 do k=8,NSPECI,10 247 do i=1,klon 248 do l=1,klev 249 t_tauhvd(i,l)=TAUGID(i,klev-l+1,k) 250 enddo 251 enddo 252 write(str1,'(i2.2)') k 253 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 254 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 255 CALL histwrite(nid_day,"tgi"//str1,itau_w,zx_tmp_3d, 256 . iim*jjmp1*klev,ndex3d) 257 enddo ! fin boucle NSPECI 258 259 do k=8,NSPECI,10 260 do i=1,klon 261 do l=1,klev 262 if(l.ne.klev) 263 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 264 s -TAUGID(i,klev-l+1-1,k) 265 266 if(l.eq.klev) 267 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 268 269 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) 270 enddo 271 enddo 272 write(str1,'(i2.2)') k 273 zx_tmp_fi3d(1:klon,1:klev)=t_khvd(1:klon,1:klev) 274 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 275 CALL histwrite(nid_day,"kgi"//str1,itau_w,zx_tmp_3d, 276 . iim*jjmp1*klev,ndex3d) 277 enddo ! fin boucle NSPECI 278 384 c -------------- 385 c ----- OPACITE NUAGES (ATTENTION PROXY) 386 if (clouds.eq.1) then 387 zx_tmp_fi3d(1:klon,1:klev)=occcld(1:klon,1:klev) 388 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 389 CALL histwrite(nid_day,"tcld",itau_w,zx_tmp_3d, 390 . iim*jjmp1*klev,ndex3d) 391 c -------------- 392 c ----- EXTINCTION NUAGES (ATTENTION PROXY) 393 do i=1,klon 394 t_kcld(i,klev)=occcld(i,klev) 395 . /(zzlev(i,klev+1)-zzlev(i,klev)) 396 do j=klev-1,1,-1 397 t_kcld(i,j)=(occcld(i,j)-occcld(i,j+1)) 398 . /(zzlev(i,j+1)-zzlev(i,j)) 399 enddo 400 enddo 401 zx_tmp_fi3d(1:klon,1:klev)=t_kcld(1:klon,1:klev) 402 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 403 CALL histwrite(nid_day,"kcld",itau_w,zx_tmp_3d, 404 . iim*jjmp1*klev,ndex3d) 405 endif 406 c 279 407 ENDIF !lev_histday.GE.3 280 408 c -
trunk/LMDZ.TITAN/libf/phytitan/write_histins.h
r110 r175 143 143 . iim*jjmp1*klev,ndex3d) 144 144 c 145 c 3D adding Tau and k (31/08/10)146 c 145 c -------------- 146 c ----- OPACITE BRUME 147 147 do k=7,NSPECV,10 148 148 do i=1,klon … … 158 158 enddo ! fin boucle NSPECV 159 159 160 do k=8,NSPECI,10 161 do i=1,klon 162 do l=1,klev 163 t_tauhvd(i,l)=TAUHID(i,klev-l+1,k) 164 enddo 165 enddo 166 write(str1,'(i2.2)') k 167 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 168 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 169 CALL histwrite(nid_ins,"thi"//str1,itau_w,zx_tmp_3d, 170 . iim*jjmp1*klev,ndex3d) 171 enddo ! fin boucle NSPECI 172 c -------------- 173 c ----- EXTINCTION BRUME 160 174 do k=7,NSPECV,10 161 175 do i=1,klon 162 176 do l=1,klev 163 if(l.ne.klev)164 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k)165 s -TAUHVD(i,klev-l+1-1,k)177 if(l.ne.klev) 178 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k) 179 s -TAUHVD(i,klev-l+1-1,k) 166 180 167 181 if(l.eq.klev) 168 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k)182 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k) 169 183 170 184 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) … … 178 192 enddo ! fin boucle NSPECV 179 193 194 do k=8,NSPECI,10 195 do i=1,klon 196 do l=1,klev 197 if(l.ne.klev) 198 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 199 s -TAUHID(i,klev-l+1-1,k) 200 201 if(l.eq.klev) 202 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 203 204 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) 205 enddo 206 enddo 207 write(str1,'(i2.2)') k 208 zx_tmp_fi3d(1:klon,1:klev)=t_khvd(1:klon,1:klev) 209 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 210 CALL histwrite(nid_ins,"khi"//str1,itau_w,zx_tmp_3d, 211 . iim*jjmp1*klev,ndex3d) 212 enddo ! fin boucle NSPECI 213 c -------------- 214 c ----- OPACITE GAZ 180 215 do k=7,NSPECV,10 181 216 do i=1,klon … … 191 226 enddo ! fin boucle NSPECV 192 227 228 do k=8,NSPECI,10 229 do i=1,klon 230 do l=1,klev 231 t_tauhvd(i,l)=TAUGID(i,klev-l+1,k) 232 enddo 233 enddo 234 write(str1,'(i2.2)') k 235 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 236 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 237 CALL histwrite(nid_ins,"tgi"//str1,itau_w,zx_tmp_3d, 238 . iim*jjmp1*klev,ndex3d) 239 enddo ! fin boucle NSPECI 240 c -------------- 241 c ----- EXTINCTION GAZ 193 242 do k=7,NSPECV,10 194 243 do i=1,klon 195 244 do l=1,klev 196 if(l.ne.klev)197 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k)198 s -TAUGVD(i,klev-l+1-1,k)245 if(l.ne.klev) 246 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k) 247 s -TAUGVD(i,klev-l+1-1,k) 199 248 200 249 if(l.eq.klev) 201 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k)250 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k) 202 251 203 252 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) … … 214 263 do i=1,klon 215 264 do l=1,klev 216 t_tauhvd(i,l)=TAUHID(i,klev-l+1,k) 217 enddo 218 enddo 219 write(str1,'(i2.2)') k 220 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 221 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 222 CALL histwrite(nid_ins,"thi"//str1,itau_w,zx_tmp_3d, 223 . iim*jjmp1*klev,ndex3d) 224 enddo ! fin boucle NSPECI 225 226 do k=8,NSPECI,10 227 do i=1,klon 228 do l=1,klev 229 if(l.ne.klev) 230 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 231 s -TAUHID(i,klev-l+1-1,k) 265 if(l.ne.klev) 266 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 267 s -TAUGID(i,klev-l+1-1,k) 232 268 233 269 if(l.eq.klev) 234 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 235 236 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) 237 enddo 238 enddo 239 write(str1,'(i2.2)') k 240 zx_tmp_fi3d(1:klon,1:klev)=t_khvd(1:klon,1:klev) 241 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 242 CALL histwrite(nid_ins,"khi"//str1,itau_w,zx_tmp_3d, 243 . iim*jjmp1*klev,ndex3d) 244 enddo ! fin boucle NSPECI 245 246 do k=8,NSPECI,10 247 do i=1,klon 248 do l=1,klev 249 t_tauhvd(i,l)=TAUGID(i,klev-l+1,k) 250 enddo 251 enddo 252 write(str1,'(i2.2)') k 253 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 254 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 255 CALL histwrite(nid_ins,"tgi"//str1,itau_w,zx_tmp_3d, 256 . iim*jjmp1*klev,ndex3d) 257 enddo ! fin boucle NSPECI 258 259 do k=8,NSPECI,10 260 do i=1,klon 261 do l=1,klev 262 if(l.ne.klev) 263 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 264 s -TAUGID(i,klev-l+1-1,k) 265 266 if(l.eq.klev) 267 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 270 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 268 271 269 272 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) -
trunk/LMDZ.TITAN/libf/phytitan/write_histmth.h
r119 r175 92 92 CALL histwrite(nid_mth,"tops",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) 93 93 c 94 cccccccccccccccccc Tracers 95 c 94 96 if (iflag_trac.eq.1) THEN 95 c if (microfi.eq.1) then97 if (microfi.ge.1) then 96 98 c DO iq=1,nmicro 97 99 c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qaer(1,1,iq), zx_tmp_3d) … … 99 101 c . iim*jjmp1*klev,ndex3d) 100 102 c ENDDO 101 c endif 103 c ------- NB AER TOT 104 do i=1,klon 105 do j=1,klev 106 zx_tmp_fi3d(i,j)= SUM(qaer(i,j,1:nrad)) 107 enddo 108 enddo 109 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 110 CALL histwrite(nid_mth,"qaer",itau_w,zx_tmp_3d, 111 . iim*jjmp1*klev,ndex3d) 112 c ------- NB NOY TOT 113 do i=1,klon 114 do j=1,klev 115 zx_tmp_fi3d(i,j)= SUM(qaer(i,j,nrad+1:2*nrad)) 116 enddo 117 enddo 118 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 119 CALL histwrite(nid_mth,"qnoy",itau_w,zx_tmp_3d, 120 . iim*jjmp1*klev,ndex3d) 121 c ------- V GLA1 TOT 122 do i=1,klon 123 do j=1,klev 124 zx_tmp_fi3d(i,j)= SUM(qaer(i,j,2*nrad+1:3*nrad)) 125 enddo 126 enddo 127 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 128 CALL histwrite(nid_mth,"qgl1",itau_w,zx_tmp_3d, 129 . iim*jjmp1*klev,ndex3d) 130 c ------- V GLA2 TOT 131 do i=1,klon 132 do j=1,klev 133 zx_tmp_fi3d(i,j)= SUM(qaer(i,j,3*nrad+1:4*nrad)) 134 enddo 135 enddo 136 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 137 CALL histwrite(nid_mth,"qgl2",itau_w,zx_tmp_3d, 138 . iim*jjmp1*klev,ndex3d) 139 c ------- V GLA3 TOT 140 do i=1,klon 141 do j=1,klev 142 zx_tmp_fi3d(i,j)= SUM(qaer(i,j,4*nrad+1:5*nrad)) 143 enddo 144 enddo 145 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 146 CALL histwrite(nid_mth,"qgl3",itau_w,zx_tmp_3d, 147 . iim*jjmp1*klev,ndex3d) 148 c -------------- 149 c ----- SATURATION ESP NUAGES 150 if (clouds.eq.1) then 151 152 CALL gr_fi_ecrit(klev,klon,iim,jjmp1, satch4,zx_tmp_3d) 153 CALL histwrite(nid_mth,"ch4sat", itau_w, zx_tmp_3d, 154 . iim*jjmp1*klev,ndex3d) 155 156 CALL gr_fi_ecrit(klev,klon,iim,jjmp1, satc2h6,zx_tmp_3d) 157 CALL histwrite(nid_mth,"c2h6sat", itau_w, zx_tmp_3d, 158 . iim*jjmp1*klev,ndex3d) 159 160 CALL gr_fi_ecrit(klev,klon,iim,jjmp1, satc2h2,zx_tmp_3d) 161 CALL histwrite(nid_mth,"c2h2sat", itau_w, zx_tmp_3d, 162 . iim*jjmp1*klev,ndex3d) 163 c -------------- 164 c ----- RESERVOIR DE SURFACE 165 CALL gr_fi_ecrit(1, klon,iim,jjmp1,reservoir,zx_tmp_2d) 166 CALL histwrite(nid_mth,"reserv",itau_w,zx_tmp_2d, 167 . iim*jjmp1,ndex2d) 168 c -------------- 169 c ----- PRECIPITATIONS 170 c ----- CH4 171 CALL gr_fi_ecrit(1, klon,iim,jjmp1,prec(:,1),zx_tmp_2d) 172 CALL histwrite(nid_mth,"prech4",itau_w,zx_tmp_2d, 173 . iim*jjmp1,ndex2d) 174 c ----- C2H6 175 CALL gr_fi_ecrit(1, klon,iim,jjmp1,prec(:,2),zx_tmp_2d) 176 CALL histwrite(nid_mth,"prec2h6",itau_w,zx_tmp_2d, 177 . iim*jjmp1,ndex2d) 178 c ----- C2H2 179 CALL gr_fi_ecrit(1, klon,iim,jjmp1,prec(:,3),zx_tmp_2d) 180 CALL histwrite(nid_mth,"prec2h2",itau_w,zx_tmp_2d, 181 . iim*jjmp1,ndex2d) 182 c 183 c -------------- 184 c ----- FLUX GLACE 185 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,flxesp_i(1,1,1),zx_tmp_3d) 186 CALL histwrite(nid_mth,"flxgl1", itau_w, zx_tmp_3d, 187 . iim*jjmp1*klev,ndex3d) 188 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,flxesp_i(1,1,2),zx_tmp_3d) 189 CALL histwrite(nid_mth,"flxgl2", itau_w, zx_tmp_3d, 190 . iim*jjmp1*klev,ndex3d) 191 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,flxesp_i(1,1,3),zx_tmp_3d) 192 CALL histwrite(nid_mth,"flxgl3", itau_w, zx_tmp_3d, 193 . iim*jjmp1*klev,ndex3d) 194 c 195 c -------------- 196 c ----- RAYON MOYEN GOUTTE 197 CALL gr_fi_ecrit(klev,klon,iim,jjmp1, rmcloud,zx_tmp_3d) 198 CALL histwrite(nid_mth,"rcldbar", itau_w, zx_tmp_3d, 199 . iim*jjmp1*klev,ndex3d) 200 c 201 endif 202 endif 203 c 204 c -------------- 205 c ----- TRACEURS CHIMIQUES 102 206 if (nmicro.lt.nqmax) then 103 207 DO iq=nmicro+1,nqmax … … 145 249 . iim*jjmp1*klev,ndex3d) 146 250 c 147 c 3D adding Tau and k (31/08/10)148 c 251 c -------------- 252 c ----- OPACITE BRUME 149 253 do k=7,NSPECV,10 150 254 do i=1,klon … … 160 264 enddo ! fin boucle NSPECV 161 265 266 do k=8,NSPECI,10 267 do i=1,klon 268 do l=1,klev 269 t_tauhvd(i,l)=TAUHID(i,klev-l+1,k) 270 enddo 271 enddo 272 write(str1,'(i2.2)') k 273 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 274 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 275 CALL histwrite(nid_mth,"thi"//str1,itau_w,zx_tmp_3d, 276 . iim*jjmp1*klev,ndex3d) 277 enddo ! fin boucle NSPECI 278 c 279 c -------------- 280 c ----- EXTINCTION BRUME 162 281 do k=7,NSPECV,10 163 282 do i=1,klon 164 283 do l=1,klev 165 if(l.ne.klev) 166 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k) 167 s -TAUHVD(i,klev-l+1-1,k) 168 284 if(l.ne.klev) 285 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k) 286 s -TAUHVD(i,klev-l+1-1,k) 169 287 if(l.eq.klev) 170 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k)288 s t_khvd(i,l)=TAUHVD(i,klev-l+1,k) 171 289 172 290 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) … … 180 298 enddo ! fin boucle NSPECV 181 299 300 do k=8,NSPECI,10 301 do i=1,klon 302 do l=1,klev 303 if(l.ne.klev) 304 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 305 s -TAUHID(i,klev-l+1-1,k) 306 if(l.eq.klev) 307 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 308 309 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) 310 enddo 311 enddo 312 write(str1,'(i2.2)') k 313 zx_tmp_fi3d(1:klon,1:klev)=t_khvd(1:klon,1:klev) 314 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 315 CALL histwrite(nid_mth,"khi"//str1,itau_w,zx_tmp_3d, 316 . iim*jjmp1*klev,ndex3d) 317 enddo ! fin boucle NSPECI 318 c 319 c -------------- 320 c ----- OPACITE GAZ 182 321 do k=7,NSPECV,10 183 322 do i=1,klon … … 193 332 enddo ! fin boucle NSPECV 194 333 334 do k=8,NSPECI,10 335 do i=1,klon 336 do l=1,klev 337 t_tauhvd(i,l)=TAUGID(i,klev-l+1,k) 338 enddo 339 enddo 340 write(str1,'(i2.2)') k 341 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 342 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 343 CALL histwrite(nid_mth,"tgi"//str1,itau_w,zx_tmp_3d, 344 . iim*jjmp1*klev,ndex3d) 345 enddo ! fin boucle NSPECI 346 c 347 c -------------- 348 c ----- EXTINCTION GAZ 195 349 do k=7,NSPECV,10 196 350 do i=1,klon 197 351 do l=1,klev 198 if(l.ne.klev) 199 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k) 200 s -TAUGVD(i,klev-l+1-1,k) 201 352 if(l.ne.klev) 353 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k) 354 s -TAUGVD(i,klev-l+1-1,k) 202 355 if(l.eq.klev) 203 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k)356 s t_khvd(i,l)=TAUGVD(i,klev-l+1,k) 204 357 205 358 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) … … 216 369 do i=1,klon 217 370 do l=1,klev 218 t_tauhvd(i,l)=TAUHID(i,klev-l+1,k) 219 enddo 220 enddo 221 write(str1,'(i2.2)') k 222 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 223 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 224 CALL histwrite(nid_mth,"thi"//str1,itau_w,zx_tmp_3d, 371 if(l.ne.klev) 372 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 373 s -TAUGID(i,klev-l+1-1,k) 374 375 if(l.eq.klev) 376 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 377 378 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) 379 enddo 380 enddo 381 write(str1,'(i2.2)') k 382 zx_tmp_fi3d(1:klon,1:klev)=t_khvd(1:klon,1:klev) 383 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 384 CALL histwrite(nid_mth,"kgi"//str1,itau_w,zx_tmp_3d, 225 385 . iim*jjmp1*klev,ndex3d) 226 386 enddo ! fin boucle NSPECI 227 387 228 do k=8,NSPECI,10 229 do i=1,klon 230 do l=1,klev 231 if(l.ne.klev) 232 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 233 s -TAUHID(i,klev-l+1-1,k) 234 235 if(l.eq.klev) 236 s t_khvd(i,l)=TAUHID(i,klev-l+1,k) 237 238 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) 239 enddo 240 enddo 241 write(str1,'(i2.2)') k 242 zx_tmp_fi3d(1:klon,1:klev)=t_khvd(1:klon,1:klev) 243 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 244 CALL histwrite(nid_mth,"khi"//str1,itau_w,zx_tmp_3d, 245 . iim*jjmp1*klev,ndex3d) 246 enddo ! fin boucle NSPECI 247 248 do k=8,NSPECI,10 249 do i=1,klon 250 do l=1,klev 251 t_tauhvd(i,l)=TAUGID(i,klev-l+1,k) 252 enddo 253 enddo 254 write(str1,'(i2.2)') k 255 zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev) 256 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 257 CALL histwrite(nid_mth,"tgi"//str1,itau_w,zx_tmp_3d, 258 . iim*jjmp1*klev,ndex3d) 259 enddo ! fin boucle NSPECI 260 261 do k=8,NSPECI,10 262 do i=1,klon 263 do l=1,klev 264 if(l.ne.klev) 265 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 266 s -TAUGID(i,klev-l+1-1,k) 267 268 if(l.eq.klev) 269 s t_khvd(i,l)=TAUGID(i,klev-l+1,k) 270 271 t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l)) 272 enddo 273 enddo 274 write(str1,'(i2.2)') k 275 zx_tmp_fi3d(1:klon,1:klev)=t_khvd(1:klon,1:klev) 276 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 277 CALL histwrite(nid_mth,"kgi"//str1,itau_w,zx_tmp_3d, 278 . iim*jjmp1*klev,ndex3d) 279 enddo ! fin boucle NSPECI 280 388 c -------------- 389 c ----- OPACITE NUAGES (ATTENTION PROXY) 390 if (clouds.eq.1) then 391 zx_tmp_fi3d(1:klon,1:klev)=occcld(1:klon,1:klev) 392 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 393 CALL histwrite(nid_mth,"tcld",itau_w,zx_tmp_3d, 394 . iim*jjmp1*klev,ndex3d) 395 c -------------- 396 c ----- EXTINCTION NUAGES (ATTENTION PROXY) 397 do i=1,klon 398 t_kcld(i,klev)=occcld(i,klev) 399 . /(zzlev(i,klev+1)-zzlev(i,klev)) 400 do j=klev-1,1,-1 401 t_kcld(i,j)=(occcld(i,j)-occcld(i,j+1)) 402 . /(zzlev(i,j+1)-zzlev(i,j)) 403 enddo 404 enddo 405 zx_tmp_fi3d(1:klon,1:klev)=t_kcld(1:klon,1:klev) 406 CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) 407 CALL histwrite(nid_mth,"kcld",itau_w,zx_tmp_3d, 408 . iim*jjmp1*klev,ndex3d) 409 c 410 c -------------- 411 c ----- OCCURENCE NUAGES 412 do k=1,12 413 write(str1,'(i2.2)') k 414 zx_tmp_fi3d(1:klon,1:klev)=occcld_m(1:klon,1:klev,k) 415 CALL histwrite(nid_mth,"occcld"//str1,itau_w,zx_tmp_3d, 416 . iim*jjmp1*klev,ndex3d) 417 enddo 418 c 419 endif 420 c 281 421 ENDIF !lev_histmth.GE.3 282 422 c
Note: See TracChangeset
for help on using the changeset viewer.