Changeset 358 for trunk/LMDZ.MARS/libf/phymars
- Timestamp:
- Nov 7, 2011, 6:39:24 PM (13 years ago)
- Location:
- trunk/LMDZ.MARS/libf/phymars
- Files:
-
- 5 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/aeropacity.F
r222 r358 1 1 SUBROUTINE aeropacity(ngrid,nlayer,nq,zday,pplay,pplev,ls, 2 & pq, ccn,tauref,tau,aerosol,reffrad,nueffrad,2 & pq,tauscaling,tauref,tau,aerosol,reffrad,nueffrad, 3 3 & QREFvis3d,QREFir3d,omegaREFvis3d,omegaREFir3d) 4 4 … … 93 93 REAL taudusttmp(ngridmx)! Temporary dust opacity 94 94 ! used before scaling 95 REAL tauscaling(ngridmx) ! Scaling factor for qdust and Ndust 95 96 REAL taudustvis(ngridmx) ! Dust opacity after scaling 96 97 REAL taudusttes(ngridmx) ! Dust opacity at IR ref. wav. as … … 102 103 ! Qabs instead of Qext 103 104 ! (direct comparison with TES) 104 REAL qdust(ngridmx,nlayermx) ! True dust mass mixing ratio 105 REAL ccn(ngridmx,nlayermx) ! Cloud condensation nuclei 106 ! (particules kg-1) 107 REAL qtot(ngridmx) ! Dust column (kg m-2) 108 109 c CCN reduction factor 110 REAL, PARAMETER :: ccn_factor = 4.5 !! comme TESTS_JB // 1. avant 111 112 c 105 113 106 c local saved variables 114 107 c --------------------- … … 194 187 ! otherwise default value read from starfi.nc file will be used) 195 188 call getin("tauvis",tauvis) 196 197 ! Some information about the water cycle198 IF (water) THEN199 write(*,*) "water_param CCN reduc. fac. ", ccn_factor200 ENDIF201 189 202 190 firstcall=.false. … … 424 412 c ----------------------------------------------------------------- 425 413 414 c Temporary scaling factor 426 415 taudusttmp(1:ngrid)=0. 427 416 DO iaer=1,naerdust … … 434 423 ENDDO 435 424 ENDDO 425 426 c Saved scaling factor 427 DO ig=1,ngrid 428 tauscaling(ig) = tauref(ig) * 429 & pplev(ig,1) / 700.E0 / taudusttmp(ig) 430 ENDDO 431 432 c Opacity computation 436 433 DO iaer=1,naerdust 437 434 DO l=1,nlayer … … 446 443 ENDDO 447 444 ENDDO 448 449 c -----------------------------------------------------------------450 c Computing the number of condensation nuclei451 c -----------------------------------------------------------------452 DO iaer = 1, naerkind ! Loop on aerosol kind453 c --------------------------------------------454 aerkind2: SELECT CASE (name_iaer(iaer))455 c==================================================================456 CASE("dust_conrath") aerkind2 ! Typical dust profile457 c==================================================================458 DO l=1,nlayer459 DO ig=1,ngrid460 ccn(ig,l) = max(aerosol(ig,l,iaer) /461 & pi / QREFvis3d(ig,l,iaer) *462 & (1.+nueffrad(ig,l,iaer))**3. /463 & reffrad(ig,l,iaer)**2. * g /464 & (pplev(ig,l)-pplev(ig,l+1)),1e-30)465 ENDDO466 ENDDO467 c==================================================================468 CASE("dust_doubleq") aerkind2!Two-moment scheme for dust469 c (transport of mass and number mixing ratio)470 c==================================================================471 qtot(1:ngridmx) = 0.472 DO l=1,nlayer473 DO ig=1,ngrid474 qdust(ig,l) = pq(ig,l,igcm_dust_mass) * tauref(ig) *475 & pplev(ig,1) / 700.E0 / taudusttmp(ig)476 qtot(ig) = qtot(ig) + qdust(ig,l) *477 & (pplev(ig,l)-pplev(ig,l+1)) / g478 ccn(ig,l) = max( ( ref_r0 /479 & reffrad(ig,l,iaer) )**3. *480 & r3n_q * qdust(ig,l) ,1e-30)481 ENDDO482 ENDDO483 c==================================================================484 END SELECT aerkind2485 c -----------------------------------486 ENDDO ! iaer (loop on aerosol kind)487 488 489 c -----------------------------------------------------------------490 c -----------------------------------------------------------------491 c Reduce number of nuclei492 ! TEMPORAIRE : r�duction du nombre de nuclei FF 04/200493 ! reduction facteur 3494 ! ccn(ig,l) = ccn(ig,l) / 27.495 ! reduction facteur 2496 ! ccn(ig,l) = ccn(ig,l) / 8.497 c -----------------------------------------------------------------498 DO l=1,nlayer499 DO ig=1,ngrid500 ccn(ig,l) = ccn(ig,l) / ccn_factor501 ENDDO502 ENDDO503 c -----------------------------------------------------------------504 c -----------------------------------------------------------------505 506 445 507 446 c ----------------------------------------------------------------- … … 548 487 & 'm2.kg-1',3,dsodust) 549 488 ENDIF 550 c CALL WRITEDIAGFI(ngridmx,'ccn','Cond. nuclei',551 c & 'part kg-1',3,ccn)552 489 ELSE 553 CALL writeg1d(ngrid,nlayer,dsodust,'dsodust','m2.kg-1') 554 ENDIF 490 CALL WRITEDIAGFI(ngrid,"dsodust","dsodust","m2.kg-1",1, 491 & dsodust) 492 ENDIF ! of IF (ngrid.NE.1) 555 493 c ----------------------------------------------------------------- 556 494 return -
trunk/LMDZ.MARS/libf/phymars/callkeys.h
r284 r358 12 12 & ,callg2d,linear,rayleigh,tracer,active,doubleq,submicron & 13 13 & ,lifting,callddevil,scavenging,sedimentation,activice,water & 14 & ,caps,photochem,calltherm,outptherm,callrichsl,callslope 14 & ,microphys,caps,photochem,calltherm,outptherm,callrichsl & 15 & ,callslope 15 16 16 17 COMMON/callkeys_i/iradia,iaervar,iddist,ilwd,ilwb,ilwn,ncouche & … … 48 49 integer dustbin 49 50 logical active,doubleq,submicron,lifting,callddevil,scavenging 50 logical sedimentation,activice,water, caps51 logical sedimentation,activice,water,microphys,caps 51 52 logical photochem 52 53 integer nqchem_min -
trunk/LMDZ.MARS/libf/phymars/callradite.F
r353 r358 2 2 $ emis,mu0,pplev,pplay,pt,tsurf,fract,dist_sol,igout, 3 3 $ dtlw,dtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxtop_sw, 4 & tauref,tau,aerosol,tauscaling,rdust,rice,nuice,co2ice) 4 5 & tauref,tau,aerosol,ccn,rdust,rice,nuice,co2ice) 5 6 … … 160 161 161 162 REAL pq(ngrid,nlayer,nq) 162 REAL ccn(ngridmx,nlayermx) ! Cloud condensation nuclei163 ! (particules kg-1)163 REAL tauscaling(ngridmx) ! Conversion factor for 164 ! qdust and Ndust 164 165 REAL albedo(ngrid,2),emis(ngrid) 165 166 REAL ls,zday … … 395 396 c Computing aerosol optical depth in each layer: 396 397 CALL aeropacity(ngrid,nlayer,nq,zday,pplay,pplev,ls, 397 & pq, ccn,tauref,tau,aerosol,reffrad,nueffrad,398 & pq,tauscaling,tauref,tau,aerosol,reffrad,nueffrad, 398 399 & QREFvis3d,QREFir3d,omegaREFvis3d,omegaREFir3d) 399 400 -
trunk/LMDZ.MARS/libf/phymars/callsedim.F
r82 r358 1 1 SUBROUTINE callsedim(ngrid,nlay, ptimestep, 2 $ pplev,zlev, pt, rdust, rice, 2 & pplev,zlev, pt, rdust, rice, 3 & rsedcloud,rhocloud, 3 4 & pq, pdqfi, pdqsed,pdqs_sed,nq) 4 5 IMPLICIT NONE … … 59 60 real epaisseur (ngridmx,nlayermx) ! Layer thickness (m) 60 61 real wq(ngridmx,nlayermx+1) ! displaced tracer mass (kg.m-2) 61 real r0(ngridmx,nlayermx) ! geometric mean doubleq radius (m) 62 real r0(ngridmx,nlayermx) ! geometric mean radius used for 63 ! sedimentation (m) 64 real r0dust(ngridmx,nlayermx) ! geometric mean radius used for 65 ! dust (m) 66 real r0ccn(ngridmx,nlayermx) ! geometric mean radius used for 67 ! CCNs (m) 62 68 c Sedimentation radius of water ice 63 real rfall(ngridmx,nlayermx) 64 c Sedimentation effective variance of water ice 65 REAL, PARAMETER :: nuice_sed = 0.45 !! TESTS_JB !! 0.1 avant 69 real rsedcloud(ngridmx,nlayermx) 70 c Cloud density (kg.m-3) 71 real rhocloud(ngridmx,nlayermx) 72 66 73 67 74 c Discrete size distributions (doubleq) … … 89 96 save rr 90 97 integer radpower 98 real sigma0 91 99 92 100 c 3) Other local variables used in doubleq 93 101 94 real reff(ngridmx,nlayermx,2) ! for diagnostic only95 102 INTEGER idust_mass ! index of tracer containing dust mass 96 103 ! mix. ratio 97 104 INTEGER idust_number ! index of tracer containing dust number 98 105 ! mix. ratio 106 INTEGER iccn_mass ! index of tracer containing CCN mass 107 ! mix. ratio 108 INTEGER iccn_number ! index of tracer containing CCN number 109 ! mix. ratio 99 110 SAVE idust_mass,idust_number 111 SAVE iccn_mass,iccn_number 100 112 101 113 c Firstcall: … … 160 172 ENDIF !of if (doubleq) 161 173 174 IF (scavenging) THEN 175 iccn_mass=0 176 iccn_number=0 177 do iq=1,nq 178 if (noms(iq).eq."ccn_mass") then 179 iccn_mass=iq 180 endif 181 if (noms(iq).eq."ccn_number") then 182 iccn_number=iq 183 endif 184 enddo 185 ! check that we did find the tracers 186 if ((iccn_mass.eq.0).or.(iccn_number.eq.0)) then 187 write(*,*) 'callsedim: error! could not identify' 188 write(*,*) ' tracers for ccn mass and number mixing' 189 write(*,*) ' ratio and scavenging is activated!' 190 stop 191 endif 192 ENDIF !of if (scavenging) 193 162 194 IF (water) THEN 163 195 write(*,*) "water_param nueff Sedimentation:", nuice_sed … … 199 231 200 232 c ================================================================= 233 c Compute the geometric mean radius used for sedimentation 234 235 if (doubleq) then 236 do l=1,nlay 237 do ig=1, ngrid 238 r0dust(ig,l) = 239 & CBRT(r3n_q*zqi(ig,l,idust_mass)/ 240 & max(zqi(ig,l,idust_number),0.01)) 241 r0dust(ig,l)=min(max(r0dust(ig,l),1.e-10),500.e-6) 242 end do 243 end do 244 endif 245 if (scavenging) then 246 do l=1,nlay 247 do ig=1, ngrid 248 r0ccn(ig,l) = rsedcloud(ig,l)/(1.+nuice_sed)**4.5 249 end do 250 end do 251 endif 252 253 c ================================================================= 201 254 do iq=1,nq 202 255 if(radius(iq).gt.1.e-9) then ! no sedim for gaz … … 205 258 c DOUBLEQ CASE 206 259 c ----------------------------------------------------------------- 207 if ( doubleq.and.260 if ((doubleq.and. 208 261 & ((iq.eq.idust_mass).or. 209 & (iq.eq.idust_number))) then 262 & (iq.eq.idust_number))).or. 263 & (scavenging.and. 264 & ((iq.eq.iccn_mass).or. 265 & (iq.eq.iccn_number)))) then 210 266 211 267 c Computing size distribution: 212 268 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 213 269 214 do l=1,nlay 215 do ig=1, ngrid 216 r0(ig,l)= 217 & CBRT(r3n_q*zqi(ig,l,idust_mass)/ 218 & max(zqi(ig,l,idust_number),0.01)) 219 r0(ig,l)=min(max(r0(ig,l),1.e-10),500.e-6) 270 if ((iq.eq.idust_mass).or.(iq.eq.idust_number)) then 271 do l=1,nlay 272 do ig=1, ngrid 273 r0(ig,l)=r0dust(ig,l) 274 end do 220 275 end do 221 end do 276 sigma0 = varian 277 else 278 do l=1,nlay 279 do ig=1, ngrid 280 r0(ig,l)=r0ccn(ig,l) 281 end do 282 end do 283 sigma0 = sqrt(log(1.+nuice_sed)) 284 endif 222 285 223 286 c Computing mass mixing ratio for each particle size 224 287 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 225 IF ( iq.EQ.idust_mass) then288 IF ((iq.EQ.idust_mass).or.(iq.EQ.iccn_mass)) then 226 289 radpower = 2 227 290 ELSE … … 237 300 qr(ig,l,ir)=0.5*(rr(2,ir)-rr(1,ir))* 238 301 & (rr(1,ir)**radpower)* 239 & exp(-(log(rr(1,ir)/r0(ig,l)))**2/(2* varian**2))302 & exp(-(log(rr(1,ir)/r0(ig,l)))**2/(2*sigma0**2)) 240 303 do iint=2,ninter-1 241 304 qr(ig,l,ir)=qr(ig,l,ir) + … … 243 306 & (rr(iint,ir)**radpower)* 244 307 & exp(-(log(rr(iint,ir)/r0(ig,l)))**2/ 245 & (2* varian**2))308 & (2*sigma0**2)) 246 309 end do 247 310 qr(ig,l,ir)=qr(ig,l,ir) + … … 249 312 & (rr(ninter,ir)**radpower)* 250 313 & exp(-(log(rr(ninter,ir)/r0(ig,l)))**2/ 251 & (2* varian**2))314 & (2*sigma0**2)) 252 315 253 316 c **************** old method (not recommended!) 254 317 c qr(ig,l,ir)=(rd(ir)**(5-3*iq))* 255 c & exp( -(log(rd(ir)/r0(ig,l)))**2 / (2* varian**2) )318 c & exp( -(log(rd(ir)/r0(ig,l)))**2 / (2*sigma0**2) ) 256 319 c ****************************** 257 320 … … 272 335 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 273 336 274 c call zerophys(ngridmx*nlayermx,zqi(1,1,iq))275 337 zqi(1:ngrid,1:nlay,iq) = 0. 276 c call zerophys(ngridmx,pdqs_sed(1,iq))277 338 pdqs_sed(1:ngrid,iq) = 0. 278 339 279 340 do ir=1,nr 280 call newsedim(ngrid,nlay,1,ptimestep, 281 & pplev,masse,epaisseur,pt,rd(ir),rho_dust,qr(1,1,ir), 282 & wq,0.5) 341 IF ((iq.EQ.idust_mass).or.(iq.EQ.idust_number)) then 342 call newsedim(ngrid,nlay,1,1,ptimestep, 343 & pplev,masse,epaisseur,pt,rd(ir),rho_dust,qr(1,1,ir), 344 & wq,0.5) 345 ELSE 346 call newsedim(ngrid,nlay,1,ngrid*nlay,ptimestep, 347 & pplev,masse,epaisseur,pt,rd(ir),rhocloud,qr(1,1,ir), 348 & wq,1.0) 349 ENDIF 283 350 284 351 c Tendencies … … 298 365 c ----------------------------------------------------------------- 299 366 else if (water.and.(iq.eq.igcm_h2o_ice)) then 300 c if (doubleq) then 301 c do l=1,nlay 302 c do ig=1,ngrid 303 c rfall(ig,l)=max( rice(ig,l),rdust(ig,l) ) 304 c rfall(ig,l)=min(rfall(ig,l),1.e-4) 305 c enddo 306 c enddo ! of do l=1,nlay 307 c else 308 do l=1,nlay 309 do ig=1,ngrid 310 c For water cycle, a typical dust size is assumed: 311 c r(z)=r0*exp(-z/H) with r0=0.8 micron and H=18 km. 312 c rfall(ig,l)=max( rice(ig,l)*1.5,rdust(ig,l) ) 313 rfall(ig,l)=max( rice(ig,l)*(1.+nuice_sed)**3., 314 & rdust(ig,l) ) 315 c modif FranckMM pour ameliorer cycle H2O: rfall= 20 microns 316 c mars commente pour l'instant rfall(ig,l)=20.e-6 317 rfall(ig,l)=min(rfall(ig,l),1.e-4) 318 enddo 319 enddo ! of do l=1,nlay 320 c endif 321 call newsedim(ngrid,nlay,ngrid*nlay,ptimestep, 322 & pplev,masse,epaisseur,pt,rfall,rho_q(iq),zqi(1,1,iq), 323 & wq,1.0) 367 if (microphys) then 368 call newsedim(ngrid,nlay,ngrid*nlay,ngrid*nlay,ptimestep, 369 & pplev,masse,epaisseur,pt,rsedcloud,rhocloud,zqi(1,1,iq), 370 & wq,1.0) 371 else 372 call newsedim(ngrid,nlay,ngrid*nlay,1,ptimestep, 373 & pplev,masse,epaisseur,pt,rsedcloud,rho_q(iq),zqi(1,1,iq), 374 & wq,1.0) 375 endif ! of if (microphys) 324 376 c Tendencies 325 377 c ~~~~~~~~~~ … … 331 383 c ----------------------------------------------------------------- 332 384 else 333 call newsedim(ngrid,nlay,1, ptimestep,385 call newsedim(ngrid,nlay,1,1,ptimestep, 334 386 & pplev,masse,epaisseur,pt,radius(iq),rho_q(iq), 335 387 & zqi(1,1,iq),wq,1.0) … … 342 394 c ----------------------------------------------------------------- 343 395 396 c Compute the final tendency: 397 c --------------------------- 344 398 DO l = 1, nlay 345 399 DO ig=1,ngrid … … 353 407 enddo ! of do iq=1,nq 354 408 409 c Update the dust particle size "rdust" 410 c ------------------------------------- 411 DO l = 1, nlay 412 DO ig=1,ngrid 413 rdust(ig,l)= 414 & CBRT(r3n_q*zqi(ig,l,idust_mass)/ 415 & max(zqi(ig,l,idust_number),0.01)) 416 rdust(ig,l)=min(max(rdust(ig,l),1.e-10),500.e-6) 417 ENDDO 418 ENDDO 419 355 420 RETURN 356 421 END -
trunk/LMDZ.MARS/libf/phymars/growthrate.F
r120 r358 1 subroutine growthrate(timestep,t,p,ph2o,psat,seq,r,Cste) 1 subroutine growthrate(timestep,temp,pmid,ph2o,psat, 2 & seq,rcrystal,growth) 2 3 3 4 IMPLICIT NONE … … 7 8 c Determination of the water ice crystal growth rate 8 9 c 10 c Authors: F. Montmessin 11 c Adapted for the LMD/GCM by J.-B. Madeleine (October 2011) 12 c 9 13 c======================================================================= 10 14 … … 13 17 c ------------- 14 18 19 #include "dimensions.h" 20 #include "dimphys.h" 21 #include "comcstfi.h" 22 #include "tracer.h" 23 #include "microphys.h" 24 15 25 c 16 26 c arguments: … … 18 28 19 29 REAL timestep 20 REAL t ! temperature in the middle of the layer (K) 21 REAL p ! pressure in the middle of the layer (K) 22 REAL*8 ph2o ! water vapor partial pressure (Pa) 23 REAL*8 psat ! water vapor saturation pressure (Pa) 24 REAL r ! crystal radius before condensation (m) 25 REAL*8 seq ! Equilibrium saturation ratio 26 ! REAL dr ! crystal radius variation (m) 27 REAL*8 Cste 30 REAL temp ! temperature in the middle of the layer (K) 31 REAL pmid ! pressure in the middle of the layer (K) 32 REAL*8 ph2o ! water vapor partial pressure (Pa) 33 REAL*8 psat ! water vapor saturation pressure (Pa) 34 REAL rcrystal ! crystal radius before condensation (m) 35 REAL*8 seq ! Equilibrium saturation ratio 36 REAL*8 growth 28 37 29 38 c local: 30 39 c ------ 31 40 32 REAL*8 molco2,molh2o33 REAL*8 Mco2,Mh2o,rho_i,sigh2o34 REAL*8 nav,rgp,kbz,pi,To35 36 c Effective gas molecular radius (m)37 data molco2/2.2d-10/ ! CO238 c Effective gas molecular radius (m)39 data molh2o/1.2d-10/ ! H2O40 c Molecular weight of CO241 data Mco2/44.d-3/ ! kg.mol-142 c Molecular weight of H2O43 data Mh2o/18.d-3/ ! kg.mol-144 c surface tension of ice/vapor45 data sigh2o/0.12/ ! N.m46 c Ice density47 data rho_i/917./ ! kg.m-3 also defined in initcld.f48 c Avogadro number49 data nav/6.023d23/50 c Perfect gas constant51 data rgp/8.3143/52 c Boltzman constant53 data kbz/1.381d-23/54 c pi number55 data pi/3.141592654/56 c Reference temperature, T=273,15 K57 data To/273.15/58 59 41 REAL*8 k,Lv 60 42 REAL*8 knudsen ! Knudsen number (gas mean free path/particle radius) 61 REAL*8 a ,Dv,lambda ! Intermediate computations for growth rate43 REAL*8 afactor,Dv,lambda ! Intermediate computations for growth rate 62 44 REAL*8 Rk,Rd 63 45 … … 70 52 71 53 c - Equilibrium saturation accounting for KeLvin Effect 72 seq=exp(2*sigh2o*Mh2o/(rho_i*rgp*t*r)) 54 c seq=exp(2*sigh2o*mh2o/(rho_ice*rgp*t*r)) 55 c (already computed in improvedcloud.F) 73 56 74 57 c - Thermal conductibility of CO2 75 k = (0.17913 * t - 13.9789) * 4.184e-458 k = (0.17913 * temp - 13.9789) * 4.184e-4 76 59 c - Latent heat of h2o (J.kg-1) 77 Lv = (2834.3 - 0.28 * (t -To) - 0.004 * (t-To)**2 ) * 1.e+360 Lv = (2834.3 - 0.28 * (temp-To) - 0.004 * (temp-To)**2 ) * 1.e+3 78 61 79 62 c - Constant to compute gas mean free path 80 63 c l= (T/P)*a, with a = ( 0.707*8.31/(4*pi*molrad**2 * avogadro)) 81 a = 0.707*rgp/(4 * pi* molco2**2 * nav)64 afactor = 0.707*rgp/(4 * pi* molco2**2 * nav) 82 65 83 66 c - Compute Dv, water vapor diffusion coefficient … … 85 68 c the nature of which depending on the Knudsen number. 86 69 87 Dv = 1./3. * sqrt( 8*kbz*t /(pi*Mh2o/nav) )* kbz * t/88 & ( pi * p * (molco2+molh2o)**2 * sqrt(1.+Mh2o/Mco2) )70 Dv = 1./3. * sqrt( 8*kbz*temp/(pi*mh2o/nav) )* kbz * temp / 71 & ( pi * pmid * (molco2+molh2o)**2 * sqrt(1.+mh2o/mco2) ) 89 72 90 knudsen = t / p * a / r73 knudsen = temp / pmid * afactor / rcrystal 91 74 lambda = (1.333+0.71/knudsen) / (1.+1./knudsen) 92 75 Dv = Dv / (1. + lambda * knudsen) 93 76 94 77 c - Compute Rk 95 Rk = Lv**2 * rho_i * Mh2o / (k*rgp*t**2.)78 Rk = Lv**2 * rho_ice * mh2o / (k*rgp*temp**2.) 96 79 c - Compute Rd 97 Rd = rgp * t *rho_i / (Dv*psat*Mh2o)80 Rd = rgp * temp *rho_ice / (Dv*psat*mh2o) 98 81 99 c - Compute Cste=rdr/dt, then r(t+1)= sqrt(r(t)**2.+2.*Cste*dt)100 Cste= 1. / (seq*Rk+Rd)101 c Cste= (ph2o/psat-seq) / (seq*Rk+Rd)102 c rf = sqrt( max( r**2.+2.* Cste*timestep , 0. ) )82 c - Compute growth=rdr/dt, then r(t+1)= sqrt(r(t)**2.+2.*growth*dt) 83 growth = 1. / (seq*Rk+Rd) 84 c growth = (ph2o/psat-seq) / (seq*Rk+Rd) 85 c rf = sqrt( max( r**2.+2.*growth*timestep , 0. ) ) 103 86 c dr = rf-r 104 87 -
trunk/LMDZ.MARS/libf/phymars/inifis.F
r288 r358 61 61 #include "datafile.h" 62 62 #include "slope.h" 63 #include "microphys.h" 63 64 #ifdef MESOSCALE 64 65 #include "comsoil.h" !!MESOSCALE -- needed to fill volcapa … … 304 305 ! TRACERS: 305 306 307 ! dustbin 306 308 write(*,*)"Transported dust ? (if >0, use 'dustbin' dust bins)" 307 309 dustbin=0 ! default value 308 310 call getin("dustbin",dustbin) 309 311 write(*,*)" dustbin = ",dustbin 310 312 ! active 311 313 write(*,*)"Radiatively active dust ? (matters if dustbin>0)" 312 314 active=.false. ! default value … … 321 323 stop 322 324 endif 323 325 ! doubleq 324 326 write(*,*)"use mass and number mixing ratios to predict", 325 327 & " dust size ?" … … 327 329 call getin("doubleq",doubleq) 328 330 write(*,*)" doubleq = ",doubleq 329 331 ! submicron 330 332 submicron=.false. ! default value 331 333 call getin("submicron",submicron) … … 345 347 stop 346 348 endif 347 349 ! lifting 348 350 write(*,*)"dust lifted by GCM surface winds ?" 349 351 lifting=.false. ! default value … … 358 360 stop 359 361 endif 360 362 ! callddevil 361 363 write(*,*)" dust lifted by dust devils ?" 362 364 callddevil=.false. !default value 363 365 call getin("callddevil",callddevil) 364 366 write(*,*)" callddevil = ",callddevil 365 366 367 367 368 ! Test of incompatibility: … … 372 373 stop 373 374 endif 374 375 write(*,*)"Dust scavenging by CO2 snowfall ?" 376 scavenging=.false. ! default value 377 call getin("scavenging",scavenging) 378 write(*,*)" scavenging = ",scavenging 379 380 381 ! Test of incompatibility: 382 ! if scavenging is used, then dustbin should be > 0 383 384 if (scavenging.and.(dustbin.lt.1)) then 385 print*,'if scavenging is used, then dustbin should > 0' 386 stop 387 endif 388 375 ! sedimentation 389 376 write(*,*) "Gravitationnal sedimentation ?" 390 377 sedimentation=.true. ! default value 391 378 call getin("sedimentation",sedimentation) 392 379 write(*,*) " sedimentation = ",sedimentation 393 380 ! activice 394 381 write(*,*) "Radiatively active transported atmospheric ", 395 382 & "water ice ?" … … 397 384 call getin("activice",activice) 398 385 write(*,*) " activice = ",activice 399 386 ! water 400 387 write(*,*) "Compute water cycle ?" 401 388 water=.false. ! default value … … 412 399 if (water.and..not.tracer) then 413 400 print*,'if water is used, tracer should be used too' 401 stop 402 endif 403 ! microphys 404 write(*,*)"Microphysical scheme for water-ice clouds?" 405 microphys=.false. ! default value 406 call getin("microphys",microphys) 407 write(*,*)" microphys = ",microphys 408 409 ! microphysical parameter contact 410 write(*,*) "water contact parameter ?" 411 mteta = 0.95 412 call getin("mteta",mteta) 413 write(*,*) "mteta = ", mteta 414 415 ! scavenging 416 write(*,*)"Dust scavenging by H2O/CO2 snowfall ?" 417 scavenging=.false. ! default value 418 call getin("scavenging",scavenging) 419 write(*,*)" scavenging = ",scavenging 420 421 422 ! Test of incompatibility: 423 ! if scavenging is used, then dustbin should be > 0 424 425 if (scavenging.and.(dustbin.lt.1)) then 426 print*,'if scavenging is used, then dustbin should > 0' 427 stop 428 endif 429 if ((microphys.and..not.doubleq).or. 430 & (microphys.and..not.active).or. 431 & (microphys.and..not.scavenging).or. 432 & (microphys.and..not.water)) then 433 print*,'if microphys is used, then doubleq,' 434 print*,'active, water and scavenging must all be used!' 435 stop 436 endif 437 if ((scavenging.and..not.doubleq).or. 438 & (scavenging.and..not.active).or. 439 & (scavenging.and..not.water).or. 440 & (scavenging.and..not.microphys)) then 441 print*,'if scavenging is used, then doubleq,' 442 print*,'active, water and microphys must all be used!' 414 443 stop 415 444 endif … … 425 454 write(*,*) " caps = ",caps 426 455 427 456 ! albedo_h2o_ice 428 457 write(*,*) "water ice albedo ?" 429 458 albedo_h2o_ice=0.45 430 459 call getin("albedo_h2o_ice",albedo_h2o_ice) 431 460 write(*,*) " albedo_h2o_ice = ",albedo_h2o_ice 432 461 ! inert_h2o_ice 433 462 write(*,*) "water ice thermal inertia ?" 434 463 inert_h2o_ice=2400 ! (J.m^-2.K^-1.s^-1/2) 435 464 call getin("inert_h2o_ice",inert_h2o_ice) 436 465 write(*,*) " inert_h2o_ice = ",inert_h2o_ice 437 466 ! frost_albedo_threshold 438 467 write(*,*) "frost thickness threshold for albedo ?" 439 468 frost_albedo_threshold=0.005 ! 5.4 mic (i.e 0.005 kg.m-2) -
trunk/LMDZ.MARS/libf/phymars/initracer.F
r324 r358 213 213 igcm_dust_mass=0 214 214 igcm_dust_number=0 215 igcm_ccn_mass=0 216 igcm_ccn_number=0 215 217 igcm_dust_submicron=0 216 218 igcm_h2o_vap=0 … … 271 273 enddo 272 274 endif ! of if (doubleq) 275 if (scavenging) then 276 do iq=1,nqmx 277 if (noms(iq).eq."ccn_mass") then 278 igcm_ccn_mass=iq 279 count=count+1 280 endif 281 if (noms(iq).eq."ccn_number") then 282 igcm_ccn_number=iq 283 count=count+1 284 endif 285 enddo 286 endif ! of if (scavenging) 273 287 if (submicron) then 274 288 do iq=1,nqmx … … 481 495 rho_ice=920. ! Water ice density (kg.m-3) 482 496 nuice_ref=0.1 ! Effective variance nueff of the 483 ! water-ice size distributions 497 ! water-ice size distribution 498 nuice_sed=0.45 ! Sedimentation effective variance 499 ! of the water-ice size distribution 484 500 485 501 if (doubleq) then … … 530 546 write(*,*) "initracer: doubleq_param alpha_lift:", 531 547 & alpha_lift(igcm_dust_mass) 532 533 548 else 534 549 … … 549 564 endif 550 565 end if ! (doubleq) 566 567 568 c Scavenging of dust particles by H2O clouds: 569 c ------------------------------------------ 570 c Initialize the two tracers used for the CCNs 571 if (water.AND.doubleq.AND.scavenging) then 572 radius(igcm_ccn_mass) = radius(igcm_dust_mass) 573 alpha_lift(igcm_ccn_mass) = 1e-30 574 alpha_devil(igcm_ccn_mass) = 1e-30 575 rho_q(igcm_ccn_mass) = rho_dust 576 577 radius(igcm_ccn_number) = radius(igcm_ccn_mass) 578 alpha_lift(igcm_ccn_number) = alpha_lift(igcm_ccn_mass) 579 alpha_devil(igcm_ccn_number) = alpha_devil(igcm_ccn_mass) 580 rho_q(igcm_ccn_number) = rho_q(igcm_ccn_mass) 581 endif ! of if (water.AND.doubleq.AND.scavenging) 551 582 552 583 c Submicron dust mode: … … 670 701 endif 671 702 703 if (scavenging) then 704 ! verify that we indeed have ccn_mass and ccn_number tracers 705 if (igcm_ccn_mass.eq.0) then 706 write(*,*) "initracer: error !!" 707 write(*,*) " cannot use scavenging option without ", 708 & "a ccn_mass tracer !" 709 stop 710 endif 711 if (igcm_ccn_number.eq.0) then 712 write(*,*) "initracer: error !!" 713 write(*,*) " cannot use scavenging option without ", 714 & "a ccn_number tracer !" 715 stop 716 endif 717 endif ! of if (scavenging) 718 672 719 if (photochem .or. callthermos) then 673 720 ! verify that we indeed have the chemistry tracers -
trunk/LMDZ.MARS/libf/phymars/newsedim.F
r147 r358 1 SUBROUTINE newsedim(ngrid,nlay,naersize, ptimestep,1 SUBROUTINE newsedim(ngrid,nlay,naersize,nrhosize,ptimestep, 2 2 & pplev,masse,epaisseur,pt,rd,rho,pqi,wq,beta) 3 3 IMPLICIT NONE … … 21 21 c ---------- 22 22 23 INTEGER,INTENT(IN) :: ngrid,nlay,naersize 23 INTEGER,INTENT(IN) :: ngrid,nlay,naersize,nrhosize 24 24 REAL,INTENT(IN) :: ptimestep ! pas de temps physique (s) 25 25 REAL,INTENT(IN) :: pplev(ngrid,nlay+1) ! pression aux inter-couches (Pa) … … 28 28 real,intent(in) :: epaisseur (ngrid,nlay) ! epaisseur d'une couche (m) 29 29 real,intent(in) :: rd(naersize) ! particle radius (m) 30 real,intent(in) :: rho ! particle density (kg.m-3)30 real,intent(in) :: rho(nrhosize) ! particle density (kg.m-3) 31 31 32 32 … … 44 44 45 45 INTEGER l,ig, k, i 46 REAL rfall 46 REAL rfall,rhofall 47 47 48 48 LOGICAL,SAVE :: firstcall=.true. … … 109 109 do l=1,nlay 110 110 do ig=1, ngrid 111 c radius 111 112 if (naersize.eq.1) then 112 113 rfall=rd(1) … … 115 116 rfall=rd(i) 116 117 endif 117 vstokes(ig,l) = b * rho * rfall**2 * 118 c density 119 if (nrhosize.eq.1) then 120 rhofall=rho(1) 121 else 122 i=ngrid*(l-1)+ig 123 rhofall=rho(i) 124 endif 125 c vstokes 126 vstokes(ig,l) = b * rhofall * rfall**2 * 118 127 & (1 + 1.333* ( a*pt(ig,l)/pplev(ig,l) )/rfall) 119 128 -
trunk/LMDZ.MARS/libf/phymars/physiq.F
r353 r358 198 198 REAL nuice(ngridmx,nlayermx) ! Estimated effective variance 199 199 ! of the size distribution 200 real rsedcloud(ngridmx,nlayermx) ! Cloud sedimentation radius 201 real rhocloud(ngridmx,nlayermx) ! Cloud density (kg.m-3) 200 202 REAL surfdust(ngridmx,nlayermx) ! dust surface area (micron2/cm3, if photochemistry) 201 203 REAL surfice(ngridmx,nlayermx) ! ice surface area (micron2/cm3, if photochemistry) … … 231 233 REAL fluxtop_sw(ngridmx,2) !Outgoing SW (solar) flux to space (W.m-2) 232 234 REAL tauref(ngridmx) ! Reference column optical depth at 700 Pa 233 ! (used if active=F)234 235 REAL tau(ngridmx,naerkind) ! Column dust optical depth at each point 235 236 REAL zls ! solar longitude (rad) … … 294 295 character*5 str5 295 296 real zdtdif(ngridmx,nlayermx), zdtadj(ngridmx,nlayermx) 296 REAL ccn(ngridmx,nlayermx) ! Cloud condensation nuclei 297 ! (particules kg-1) 298 SAVE ccn !! in case iradia != 1 297 REAL tauscaling(ngridmx) ! Convertion factor for qdust and Ndust 298 SAVE tauscaling ! in case iradia NE 1 299 299 real rdust(ngridmx,nlayermx) ! dust geometric mean radius (m) 300 real qtot1,qtot2 ! total aerosol mass301 300 integer igmin, lmin 302 301 logical tdiag … … 316 315 REAL Qabsice ! Water ice absorption coefficient 317 316 317 c Test 1d scavenging 318 real h2o_tot 319 real ccndust_mass(nlayermx) 320 real ccndust_number(nlayermx) 318 321 319 322 REAL time_phys … … 548 551 $ emis,mu0,pplev,pplay,pt,tsurf,fract,dist_sol,igout, 549 552 $ zdtlw,zdtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxtop_sw, 550 & tauref,tau,aerosol, ccn,rdust,rice,nuice,co2ice)553 & tauref,tau,aerosol,tauscaling,rdust,rice,nuice,co2ice) 551 554 552 555 c Outputs for basic check (middle of domain) … … 920 923 & pplev,pplay,pdpsrf,zzlev,zzlay, pt,pdt, 921 924 & pq,pdq,zdqcloud,zdqscloud,zdtcloud, 922 & nq,naerkind,tau, 923 & ccn,rdust,rice,nuice, 924 & surfdust,surfice) 925 925 & nq,tau,tauscaling,rdust,rice,nuice, 926 & rsedcloud,rhocloud) 926 927 if (activice) then 927 928 c Temperature variation due to latent heat release … … 935 936 ! increment water vapour and ice atmospheric tracers tendencies 936 937 IF (water) THEN 937 938 DO l=1,nlayer 938 939 DO ig=1,ngrid 939 pdq(ig,l,igcm_h2o_vap)=pdq(ig,l,igcm_h2o_vap)+ 940 & zdqcloud(ig,l,igcm_h2o_vap) 941 pdq(ig,l,igcm_h2o_ice)=pdq(ig,l,igcm_h2o_ice)+ 942 & zdqcloud(ig,l,igcm_h2o_ice) 940 pdq(ig,l,igcm_h2o_vap)= 941 & pdq(ig,l,igcm_h2o_vap)+ 942 & zdqcloud(ig,l,igcm_h2o_vap) 943 pdq(ig,l,igcm_h2o_ice)= 944 & pdq(ig,l,igcm_h2o_ice)+ 945 & zdqcloud(ig,l,igcm_h2o_ice) 946 IF (scavenging) THEN 947 pdq(ig,l,igcm_ccn_mass)= 948 & pdq(ig,l,igcm_ccn_mass)+ 949 & zdqcloud(ig,l,igcm_ccn_mass) 950 pdq(ig,l,igcm_ccn_number)= 951 & pdq(ig,l,igcm_ccn_number)+ 952 & zdqcloud(ig,l,igcm_ccn_number) 953 !!!!!!!!!!!!!!!!!!!!! We need to check that we have Nccn > 0 954 !!!!!!!!!!!!!!!!!!!!! This is due to single preicions roiunding problems 955 if (((pq(ig,l,igcm_ccn_number) + 956 & pdq(ig,l,igcm_ccn_number)*ptimestep)) .le. 0) 957 & then 958 pdq(ig,l,igcm_ccn_number) = 959 & - pq(ig,l,igcm_ccn_number)/ptimestep 960 endif 961 !!!!!!!!!!!!!!!!!!!!! 962 !!!!!!!!!!!!!!!!!!!!! 963 pdq(ig,l,igcm_dust_mass)= 964 & pdq(ig,l,igcm_dust_mass)+ 965 & zdqcloud(ig,l,igcm_dust_mass) 966 pdq(ig,l,igcm_dust_number)= 967 & pdq(ig,l,igcm_dust_number)+ 968 & zdqcloud(ig,l,igcm_dust_number) 969 ENDIF 943 970 ENDDO 944 971 ENDDO … … 960 987 c -------------- 961 988 IF (photochem .or. thermochem) then 989 PRINT*, 'SURFDUST,SURFICE TO BE IMPLEMENTED. YAAAAAARG.' 962 990 call calchim(ptimestep,pplay,pplev,pt,pdt,dist_sol,mu0, 963 991 $ zzlev,zzlay,zday,pq,pdq,zdqchim,zdqschim, … … 1040 1068 call callsedim(ngrid,nlayer, ptimestep, 1041 1069 & pplev,zzlev, pt, rdust, rice, 1070 & rsedcloud,rhocloud, 1042 1071 & pq, pdq, zdqsed, zdqssed,nq) 1043 1072 … … 1378 1407 & "surface h2o_ice","kg/m2", 1379 1408 & 2,qsurf(1,igcm_h2o_ice)) 1380 1409 c call wstats(ngrid,'albedo', 1410 c & 'albedo', 1411 c & '',2,albedo(1:ngridmx,1)) 1381 1412 call wstats(ngrid,"mtot", 1382 1413 & "total mass of water vapor","kg/m2", … … 1588 1619 & 'total mass of water ice', 1589 1620 & 'kg/m2',2,icetot) 1590 c vmr=zq(1:ngridmx,1:nlayermx,igcm_h2o_ice) 1591 c & *mugaz/mmol(igcm_h2o_ice) 1592 c call WRITEDIAGFI(ngridmx,'vmr_h2oice','h2o ice vmr', 1593 c & 'mol/mol',3,vmr) 1621 vmr=zq(1:ngridmx,1:nlayermx,igcm_h2o_ice) 1622 & *mugaz/mmol(igcm_h2o_ice) 1623 call WRITEDIAGFI(ngridmx,'vmr_h2oice','h2o ice vmr', 1624 & 'mol/mol',3,vmr) 1625 vmr=zq(1:ngridmx,1:nlayermx,igcm_h2o_vap) 1626 & *mugaz/mmol(igcm_h2o_vap) 1627 call WRITEDIAGFI(ngridmx,'vmr_h2ovap','h2o vap vmr', 1628 & 'mol/mol',3,vmr) 1594 1629 CALL WRITEDIAGFI(ngridmx,'reffice', 1595 1630 & 'Mean reff', 1596 1631 & 'm',2,rave) 1597 ccall WRITEDIAGFI(ngridmx,'rice','Ice particle size',1598 c& 'm',3,rice)1632 call WRITEDIAGFI(ngridmx,'rice','Ice particle size', 1633 & 'm',3,rice) 1599 1634 c If activice is true, tauTES is computed in aeropacity.F; 1600 1635 if (.not.activice) then … … 1611 1646 if (watercaptag(ig)) watercapflag(ig) = 1 1612 1647 enddo 1613 1614 1615 1648 c CALL WRITEDIAGFI(ngridmx,'watercaptag', 1649 c & 'Ice water caps', 1650 c & '',2,watercapflag) 1616 1651 endif 1617 1618 1619 1652 c CALL WRITEDIAGFI(ngridmx,'albedo', 1653 c & 'albedo', 1654 c & '',2,albedo(1:ngridmx,1)) 1620 1655 endif !(water) 1621 1656 … … 1647 1682 c call WRITEDIAGFI(ngridmx,'tau','taudust','SI',2,tau(1,1)) 1648 1683 if (doubleq) then 1649 ccall WRITEDIAGFI(ngridmx,'qsurf','qsurf',1650 c& 'kg.m-2',2,qsurf(1,1))1651 ccall WRITEDIAGFI(ngridmx,'Nsurf','N particles',1652 c& 'N.m-2',2,qsurf(1,2))1684 call WRITEDIAGFI(ngridmx,'qsurf','qsurf', 1685 & 'kg.m-2',2,qsurf(1,1)) 1686 call WRITEDIAGFI(ngridmx,'Nsurf','N particles', 1687 & 'N.m-2',2,qsurf(1,2)) 1653 1688 c call WRITEDIAGFI(ngridmx,'dqsdev','ddevil lift', 1654 1689 c & 'kg.m-2.s-1',2,zdqsdev(1,1)) 1655 ccall WRITEDIAGFI(ngridmx,'dqssed','sedimentation',1656 c& 'kg.m-2.s-1',2,zdqssed(1,1))1690 call WRITEDIAGFI(ngridmx,'dqssed','sedimentation', 1691 & 'kg.m-2.s-1',2,zdqssed(1,1)) 1657 1692 call WRITEDIAGFI(ngridmx,'reffdust','reffdust', 1658 1693 & 'm',3,rdust*ref_r0) 1659 1694 call WRITEDIAGFI(ngridmx,'dustq','Dust mass mr', 1660 1695 & 'kg/kg',3,pq(1,1,igcm_dust_mass)) 1661 ccall WRITEDIAGFI(ngridmx,'dustN','Dust number',1662 c& 'part/kg',3,pq(1,1,igcm_dust_number))1696 call WRITEDIAGFI(ngridmx,'dustN','Dust number', 1697 & 'part/kg',3,pq(1,1,igcm_dust_number)) 1663 1698 #ifdef MESOINI 1664 1699 call WRITEDIAGFI(ngridmx,'dustN','Dust number', … … 1674 1709 end do 1675 1710 endif ! (doubleq) 1711 1712 if (scavenging) then 1713 call WRITEDIAGFI(ngridmx,'ccnq','CCN mass mr', 1714 & 'kg/kg',3,pq(1,1,igcm_ccn_mass)) 1715 call WRITEDIAGFI(ngridmx,'ccnN','CCN number', 1716 & 'part/kg',3,pq(1,1,igcm_ccn_number)) 1717 endif ! (scavenging) 1718 1676 1719 c if (submicron) then 1677 1720 c call WRITEDIAGFI(ngridmx,'dustsubm','subm mass mr', … … 1868 1911 call WRITEDIAGFI(ngrid,"pplay","Pressure","Pa",1,zplay) 1869 1912 call WRITEDIAGFI(ngrid,"pplev","Pressure","Pa",1,zplev) 1913 call WRITEDIAGFI(ngrid,"rho","rho","kg.m-3",1,rho) 1870 1914 ! or output in diagfi.nc (for testphys1d) 1871 1915 call WRITEDIAGFI(ngridmx,'ps','Surface pressure','Pa',0,ps) 1872 1916 call WRITEDIAGFI(ngridmx,'temp','Temperature', 1873 1917 & 'K',1,zt) 1874 1918 1875 1919 if(tracer) then 1876 1920 c CALL writeg1d(ngrid,1,tau,'tau','SI') … … 1880 1924 & trim(noms(iq)),'kg/kg',1,zq(1,1,iq)) 1881 1925 end do 1926 if (doubleq) then 1927 call WRITEDIAGFI(ngridmx,'rdust','rdust', 1928 & 'm',1,rdust) 1929 endif 1882 1930 end if 1931 1932 cccccccccccccccccccccc scavenging outputs 1D TN ccccccccccccccccccc 1933 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 1934 1935 CALL WRITEDIAGFI(ngridmx,'tauTESap', 1936 & 'tau abs 825 cm-1', 1937 & '',1,tauTES) 1938 1939 h2o_tot = qsurf(1,igcm_h2o_ice) 1940 do l=1,nlayer 1941 h2o_tot = h2o_tot + 1942 & (zq(ig,l,igcm_h2o_vap) + zq(ig,l,igcm_h2o_ice)) 1943 & * (pplev(ig,l) - pplev(ig,l+1)) / g 1944 ccndust_mass(l) = 1945 & pq(1,l,igcm_dust_mass)+pq(1,l,igcm_ccn_mass) 1946 ccndust_number(l) = 1947 & pq(1,l,igcm_dust_number)+pq(1,l,igcm_ccn_number) 1948 1949 end do 1950 1951 call WRITEDIAGFI(ngrid,'ccn+dust_mass','CCN+Dust mass', 1952 & 'kg/kg',1,ccndust_mass) 1953 call WRITEDIAGFI(ngrid,'ccn+dust_number', 1954 & 'CCN+Dust number','part/kg',1,ccndust_number) 1955 call WRITEDIAGFI(ngridmx,'h2o_ice_s', 1956 & 'surface h2o_ice', 1957 & 'kg.m-2',0,qsurf(1,igcm_h2o_ice)) 1958 call WRITEDIAGFI(ngrid,'h2otot', 1959 & 'total water mass','kg.m-2',0,h2o_tot) 1960 1961 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 1962 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 1963 1883 1964 1884 1965 zlocal(1)=-log(pplay(1,1)/pplev(1,1))* Rnew(1,1)*zt(1,1)/g -
trunk/LMDZ.MARS/libf/phymars/testphys1d.F
r283 r358 312 312 close(91) 313 313 endif ! of if (txt.eq."dust_number") 314 ! NB: some more initializations (chemistry) is done later 315 ! CCN MASS 316 if (txt.eq."ccn_mass") then 317 !look for a "profile_ccn_mass" input file 318 open(91,file='profile_ccn_mass',status='old', 319 & form='formatted',iostat=ierr) 320 if (ierr.eq.0) then 321 read(91,*) qsurf(iq) 322 do ilayer=1,nlayermx 323 read(91,*) q(ilayer,iq) 324 enddo 325 else 326 write(*,*) "No profile_ccn_mass file!" 327 endif 328 close(91) 329 endif ! of if (txt.eq."ccn_mass") 330 ! CCN NUMBER 331 if (txt.eq."ccn_number") then 332 !look for a "profile_ccn_number" input file 333 open(91,file='profile_ccn_number',status='old', 334 & form='formatted',iostat=ierr) 335 if (ierr.eq.0) then 336 read(91,*) qsurf(iq) 337 do ilayer=1,nlayermx 338 read(91,*) q(ilayer,iq) 339 enddo 340 else 341 write(*,*) "No profile_ccn_number file!" 342 endif 343 close(91) 344 endif ! of if (txt.eq."ccn_number") 314 345 enddo ! of do iq=1,nqmx 315 ! NB: some more initializations (chemistry) is done later316 346 317 347 else … … 323 353 enddo 324 354 endif ! of if (tracer) 355 356 !write(*,*) "testphys1d q", q(1,:) 357 !write(*,*) "testphys1d qsurf", qsurf 325 358 326 359 c Date et heure locale du debut du run … … 613 646 c appel de la physique 614 647 c -------------------- 648 ! write(*,*) "testphys1d avant q", q(1,:) 615 649 CALL physiq (1,llm,nqmx, 616 650 , firstcall,lastcall, … … 621 655 C - sorties 622 656 s du, dv, dtemp, dq,dpsurf,tracerdyn) 657 ! write(*,*) "testphys1d apres q", q(1,:) 658 623 659 624 660 c evolution du vent : modele 1D -
trunk/LMDZ.MARS/libf/phymars/tracer.h
r324 r358 14 14 real rho_ice ! Water ice density (kg.m-3) 15 15 real nuice_ref ! Effective variance of the water ice dist. 16 real nuice_sed ! Sedimentation effective variance of the water ice dist. 16 17 real ref_r0 ! for computing reff=ref_r0*r0 (in log.n. distribution) 17 18 … … 27 28 integer :: igcm_dust_number ! dust number mixing ratio 28 29 ! (transported dust) 30 integer :: igcm_ccn_mass ! CCN mass mixing ratio 31 integer :: igcm_ccn_number ! CCN number mixing ratio 29 32 integer :: igcm_dust_submicron ! submicron dust mixing ratio 30 33 ! (transported dust) … … 69 72 ! split them in groups (reals, integers and characters) 70 73 COMMON/tracer/radius,rho_q,alpha_lift,alpha_devil,mmol, & 71 & varian,r3n_q,rho_dust,rho_ice,nuice_ref,ref_r0,dryness 74 & varian,r3n_q,rho_dust,rho_ice,nuice_ref,nuice_sed, & 75 & ref_r0,dryness 72 76 COMMON/tracer2/ & 73 & igcm_dustbin,igcm_dust_mass,igcm_dust_number,igcm_dust_submicron,& 77 & igcm_dustbin,igcm_dust_mass,igcm_dust_number, & 78 & igcm_ccn_mass,igcm_ccn_number,igcm_dust_submicron, & 74 79 & igcm_h2o_vap,igcm_h2o_ice,igcm_co2,igcm_co,igcm_o,igcm_o1d, & 75 80 & igcm_o2,igcm_o3,igcm_h,igcm_h2,igcm_oh,igcm_ho2,igcm_h2o2, & -
trunk/LMDZ.MARS/libf/phymars/updatereffrad.F
r38 r358 47 47 REAL pq(ngrid,nlayer,nqmx) 48 48 real rdust(ngridmx,nlayermx) ! Dust geometric mean radius (m) 49 real reffdust(ngridmx,nlayermx) ! Dust effective radius (m)50 real nueffdust(ngridmx,nlayermx) ! Dust effective variance51 49 52 50 c Outputs: … … 78 76 EXTERNAL CBRT 79 77 78 real nueffdust(ngridmx,nlayermx) ! Dust effective variance 79 80 80 c Local saved variables: 81 81 c --------------------- 82 82 83 83 c================================================================== 84 c 1. Radius used in the physical subroutines85 c (but not in the rad. transfer)86 c==================================================================87 84 88 c 1.1 Dust particles 89 c ------------------ 85 IF (firstcall) THEN 86 c At firstcall, rdust and rice are not known; therefore 87 c they need to be computed below. 90 88 91 IF (doubleq.AND.active) THEN 92 DO l=1,nlayer 93 DO ig=1, ngrid 94 reffdust(ig,l) = ref_r0 * 95 & CBRT(r3n_q*pq(ig,l,igcm_dust_mass)/ 96 & max(pq(ig,l,igcm_dust_number),0.01)) 97 reffdust(ig,l)=min(max(reffdust(ig,l),1.e-10),500.e-6) 98 nueffdust(ig,l) = exp(varian**2.)-1. 89 c 1.1 Dust particles 90 c ------------------ 91 IF (doubleq.AND.active) THEN 92 DO l=1,nlayer 93 DO ig=1, ngrid 94 rdust(ig,l) = 95 & CBRT(r3n_q*pq(ig,l,igcm_dust_mass)/ 96 & max(pq(ig,l,igcm_dust_number),0.01)) 97 rdust(ig,l)=min(max(rdust(ig,l),1.e-10),500.e-6) 98 nueffdust(ig,l) = exp(varian**2.)-1. 99 ENDDO 100 ENDDO 101 ELSE 102 DO l=1,nlayer 103 DO ig=1, ngrid 104 rdust(ig,l) = 0.8E-6 105 nueffdust(ig,l) = 0.3 106 ENDDO 99 107 ENDDO 100 ENDDO 101 ELSE 102 DO l=1,nlayer 103 DO ig=1, ngrid 104 reffdust(ig,l) = 1.5E-6 105 nueffdust(ig,l) = 0.3 108 ENDIF 109 c 1.2 Water-ice particles 110 c ----------------------- 111 IF (water.AND.activice) THEN 112 DO l=1,nlayer 113 DO ig=1,ngrid 114 rice(ig,l) = max( CBRT( 115 & (pq(ig,l,igcm_h2o_ice)/rho_ice + 116 & ccn0*(4./3.)*pi*rdust(ig,l)**3.) / 117 & (ccn0*4./3.*pi)),rdust(ig,l) ) 118 nuice(ig,l) = nuice_ref 119 ENDDO 106 120 ENDDO 107 ENDDO 108 ENDIF 109 110 DO l=1,nlayer 111 DO ig=1, ngrid 112 c Geometric mean radius = Effective radius / (1+nueff)^5/2 113 rdust(ig,l) = reffdust(ig,l)/(1.+nueffdust(ig,l))**2.5 114 ENDDO 115 ENDDO 116 117 c 1.2 Water-ice particles 118 c ----------------------- 119 120 IF (firstcall.AND.water.AND.activice) THEN 121 DO l=1,nlayer 122 DO ig=1,ngrid 123 rice(ig,l) = max( CBRT( 124 & (pq(ig,l,igcm_h2o_ice)/rho_ice + 125 & ccn0*(4./3.)*pi*rdust(ig,l)**3.) / 126 & (ccn0*4./3.*pi)),rdust(ig,l) ) 127 nuice(ig,l) = nuice_ref 128 ENDDO 129 ENDDO 121 ENDIF ! of if (water.AND.activice) 130 122 firstcall = .false. 131 ENDIF 123 ENDIF ! of if firstcall 132 124 133 125 c================================================================== … … 142 134 DO l=1,nlayer 143 135 DO ig=1,ngrid 144 reffrad(ig,l,iaer) = reffdust(ig,l) 136 reffrad(ig,l,iaer) = rdust(ig,l) * 137 & (1.e0 + nueffdust(ig,l))**2.5 145 138 nueffrad(ig,l,iaer) = nueffdust(ig,l) 146 139 ENDDO … … 151 144 DO l=1,nlayer 152 145 DO ig=1,ngrid 153 reffrad(ig,l,iaer) = r effdust(ig,l)146 reffrad(ig,l,iaer) = rdust(ig,l) * ref_r0 154 147 nueffrad(ig,l,iaer) = nueffdust(ig,l) 155 148 ENDDO … … 169 162 DO l=1,nlayer 170 163 DO ig=1,ngrid 164 c About reffice, do not confuse the mass mean radius 165 c (rayon moyen massique) and the number median radius 166 c (or geometric mean radius, rayon moyen géométrique). 167 c rice is a mass mean radius, whereas rdust 168 c is a geometric mean radius: 169 c number median rad = mass mean rad x exp(-1.5 sigma0^2) 170 c (Montmessin et al. 2004 paragraph 30). Therefore: 171 171 reffrad(ig,l,iaer)=rice(ig,l)*(1.+nuice_ref) 172 172 nueffrad(ig,l,iaer)=nuice_ref -
trunk/LMDZ.MARS/libf/phymars/watercloud.F
r334 r358 2 2 & pplev,pplay,pdpsrf,pzlev,pzlay,pt,pdt, 3 3 & pq,pdq,pdqcloud,pdqscloud,pdtcloud, 4 & nq,naersize,tau, 5 & ccn,rdust,rice,nuice, 6 & surfdust,surfice) 4 & nq,tau,tauscaling,rdust,rice,nuice, 5 & rsedcloud,rhocloud) 7 6 IMPLICIT NONE 8 7 9 8 c======================================================================= 10 c Treatment of saturation of water vapor 9 c Water-ice cloud formation 10 c 11 c Includes two different schemes: 12 c - A simplified scheme (see simpleclouds.F) 13 c - An improved microphysical scheme (see improvedclouds.F) 11 14 c 15 c Authors: Franck Montmessin, Francois Forget, Ehouarn Millour, 16 c J.-B. Madeleine 12 17 c 13 c Modif de zq si saturation dans l'atmosphere 14 c si zq(ig,l)> zqsat(ig,l) -> zq(ig,l)=zqsat(ig,l) 15 c Le test est effectue de bas en haut. L'eau condensee 16 c (si saturation) est remise dans la couche en dessous. 17 c L'eau condensee dans la couche du bas est deposee a la surface 18 c 19 c Modification: Franck Montmessin water ice scheme 20 c Francois Forget : change nuclei density & outputs 21 c Ehouarn Millour: sept.2008, tracers are now handled 22 c by name (and not fixed index) 23 c 18 c 2004 - Oct. 2011 24 19 c======================================================================= 25 20 … … 34 29 #include "tracer.h" 35 30 #include "comgeomfi.h" 31 #include "dimradmars.h" 36 32 37 33 c Inputs: … … 39 35 40 36 INTEGER ngrid,nlay 37 integer nq ! nombre de traceurs 41 38 REAL ptimestep ! pas de temps physique (s) 42 39 REAL pplev(ngrid,nlay+1) ! pression aux inter-couches (Pa) … … 51 48 real pdq(ngrid,nlay,nq) ! tendance avant condensation (kg/kg.s-1) 52 49 53 integer nq ! nombre de traceurs 54 integer naersize ! nombre de traceurs radiativement actifs (=naerkind) 55 REAL tau(ngridmx,naersize) 56 REAL ccn(ngridmx,nlayermx) ! Cloud condensation nuclei 57 ! (particules kg-1) 50 REAL tau(ngridmx,naerkind) ! Column dust optical depth at each point 51 REAL tauscaling(ngridmx) ! Convertion factor for dust amount 58 52 real rdust(ngridmx,nlayermx) ! Dust geometric mean radius (m) 59 53 … … 70 64 REAL nuice(ngrid,nlay) ! Estimated effective variance 71 65 ! of the size distribution 72 73 REAL surfdust(ngrid,nlay) ! dust surface area (micron2/cm3, if photochemistry) 74 REAL surfice(ngrid,nlay) ! ice surface area (micron2/cm3, if photochemistry) 66 real rsedcloud(ngridmx,nlayermx) ! Cloud sedimentation radius 67 real rhocloud(ngridmx,nlayermx) ! Cloud density (kg.m-3) 75 68 76 69 c local: 77 70 c ------ 78 71 79 REAL CBRT80 EXTERNAL CBRT81 72 INTEGER ig,l 82 83 84 REAL zq(ngridmx,nlayermx,nqmx) ! local value of tracers85 REAL zq0(ngridmx,nlayermx,nqmx) ! local initial value of tracers86 REAL zqsat(ngridmx,nlayermx) ! saturation87 REAL zt(ngridmx,nlayermx) ! local value of temperature88 89 REAL masse (ngridmx,nlayermx)90 REAL epaisseur (ngridmx,nlayermx)91 REAL npart(ngridmx,nlayermx) ! Cloud condensation nuclei (#.cm-3)92 ! REAL rfinal ! Ice crystal radius after condensation(m)93 REAL*8 seq ! Equilibrium saturation ration (accounting for curvature effect)94 REAL*8 dzq ! masse de glace echangee (kg/kg)95 REAL lw !Latent heat of sublimation (J.kg-1)96 REAL,PARAMETER :: To=273.15 ! reference temperature, T=273.15 K97 98 REAL Ctot99 REAL*8 ph2o,satu100 REAL*8 gr,Cste,up,dwn,newvap101 102 73 LOGICAL,SAVE :: firstcall=.true. 103 ! To use more refined microphysics, set improved to .true.104 LOGICAL,PARAMETER :: improved=.true.105 106 c Pour diagnostique :107 c ~~~~~~~~~~~~~~~~~108 c REAL icetot(ngridmx) ! Total mass of water ice (kg/m2)109 c REAL rave(ngridmx) ! Mean crystal radius in a column (m)110 111 ! indexes of water vapour, water ice and dust tracers:112 INTEGER,SAVE :: i_h2o=0 ! water vapour113 INTEGER,SAVE :: i_ice=0 ! water ice114 74 115 75 c ** un petit test de coherence … … 131 91 endif 132 92 133 i_h2o=igcm_h2o_vap 134 i_ice=igcm_h2o_ice 135 136 write(*,*) "watercloud: i_h2o=",i_h2o 137 write(*,*) " i_ice=",i_ice 93 write(*,*) "watercloud: igcm_h2o_vap=",igcm_h2o_vap 94 write(*,*) " igcm_h2o_ice=",igcm_h2o_ice 138 95 139 96 firstcall=.false. 140 97 ENDIF ! of IF (firstcall) 141 98 99 c Main call to the different cloud schemes: 100 IF (microphys) THEN 101 CALL improvedclouds(ngrid,nlay,ptimestep, 102 & pplay,pt,pdt, 103 & pq,pdq,pdqcloud,pdqscloud,pdtcloud, 104 & nq,tauscaling,rdust,rice,nuice, 105 & rsedcloud,rhocloud) 106 ELSE 107 CALL simpleclouds(ngrid,nlay,ptimestep, 108 & pplev,pplay,pzlev,pzlay,pt,pdt, 109 & pq,pdq,pdqcloud,pdqscloud,pdtcloud, 110 & nq,tau,rice,nuice,rsedcloud) 111 ENDIF 142 112 143 c----------------------------------------------------------------------- 144 c 1. initialisation 145 c ----------------- 113 c A correction if a lot of subliming CO2 fills the 1st layer FF04/2005 114 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 115 c Then that should not affect the ice particle radius 116 do ig=1,ngridmx 117 if(pdpsrf(ig)*ptimestep.gt.0.9*(pplev(ig,1)-pplev(ig,2)))then 118 if(pdpsrf(ig)*ptimestep.gt.0.9*(pplev(ig,1)-pplev(ig,3))) 119 & rice(ig,2)=rice(ig,3) 120 rice(ig,1)=rice(ig,2) 121 end if 122 end do 146 123 147 c On "update" la valeur de q(nqmx) (water vapor) et temperature. 148 c On effectue qqes calculs preliminaires sur les couches : 149 c masse (kg.m-2), epaisseur(m). 124 c======================================================================= 150 125 151 do l=1,nlay 152 do ig=1,ngrid 153 zq(ig,l,i_h2o)=pq(ig,l,i_h2o)+pdq(ig,l,i_h2o)*ptimestep 154 zq(ig,l,i_h2o)=max(zq(ig,l,i_h2o),1.E-30) ! FF 12/2004 155 zq0(ig,l,i_h2o)=zq(ig,l,i_h2o) 156 zt(ig,l)=pt(ig,l)+ pdt(ig,l)*ptimestep 157 masse(ig,l)=(pplev(ig,l) - pplev(ig,l+1)) /g 158 epaisseur(ig,l)= pzlev(ig,l+1) - pzlev(ig,l) 126 !!!!!!!!!! FOR PHOTOCHEMISTRY, REIMPLEMENT output of surfdust/surfice 127 !! if (photochem) then 128 !!c computation of dust and ice surface area (micron2/cm3) 129 !!c for heterogeneous chemistry 130 !! 131 !! do l = 1,nlay 132 !! do ig = 1,ngrid 133 !!c 134 !!c npart: number density of ccn in #/cm3 135 !!c 136 !! npart(ig,l) = 1.e-6*ccn(ig,l) 137 !! $ *masse(ig,l)/epaisseur(ig,l) 138 !!c 139 !!c dust and ice surface area 140 !!c 141 !! surfdust(ig,l) = npart(ig,l)*4.*pi*1.e12*rdust(ig,l)**2 142 !!c 143 !! if (rice(ig,l) .ge. rdust(ig,l)) then 144 !! surfice(ig,l) = npart(ig,l)*4.*pi*1.e12*rice(ig,l)**2 145 !! surfdust(ig,l) = 0. 146 !! else 147 !! surfice(ig,l) = 0. 148 !! end if 149 !! end do ! of do ig=1,ngrid 150 !! end do ! of do l=1,nlay 151 !! end if ! of photochem 159 152 160 zq(ig,l,i_ice)=pq(ig,l,i_ice)+pdq(ig,l,i_ice)*ptimestep161 zq(ig,l,i_ice)=max(zq(ig,l,i_ice),0.) ! FF 12/2004162 zq0(ig,l,i_ice)=zq(ig,l,i_ice)163 164 c This typical profile is not used anymore; rdust is165 c set up in updatereffrad.F.166 c rdust(ig,l)= max(.8e-6*exp(-pzlay(ig,l)/18000.),1.e-9)167 enddo168 enddo169 170 do l=1,nlay171 do ig=1,ngrid172 c Calcul du rayon moyen des particules de glace.173 c Hypothese : Dans une couche, la glace presente se174 c repartit uniformement autour du nbre de poussieres175 c dont le rayon moyen est prescrit par rdust.176 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~177 rice(ig,l)=CBRT( ( zq(ig,l,i_ice)/rho_ice+178 & ccn(ig,l)*(4./3.)*pi*rdust(ig,l)**3. )179 & / (ccn(ig,l)*4./3.*pi) )180 rice(ig,l)=max(rice(ig,l),rdust(ig,l))181 c Effective variance of the size distribution182 nuice(ig,l)=nuice_ref183 enddo ! of do ig=1,ngrid184 enddo ! of dol=1,nlay185 186 if (photochem) then187 c computation of dust and ice surface area (micron2/cm3)188 c for heterogeneous chemistry189 190 do l = 1,nlay191 do ig = 1,ngrid192 c193 c npart: number density of ccn in #/cm3194 c195 npart(ig,l) = 1.e-6*ccn(ig,l)196 $ *masse(ig,l)/epaisseur(ig,l)197 c198 c dust and ice surface area199 c200 surfdust(ig,l) = npart(ig,l)*4.*pi*1.e12*rdust(ig,l)**2201 c202 if (rice(ig,l) .ge. rdust(ig,l)) then203 surfice(ig,l) = npart(ig,l)*4.*pi*1.e12*rice(ig,l)**2204 surfdust(ig,l) = 0.205 else206 surfice(ig,l) = 0.207 end if208 end do ! of do ig=1,ngrid209 end do ! of do l=1,nlay210 end if ! of photochem211 c212 pdqscloud(1:ngrid,1:nq)=0213 pdqcloud(1:ngrid,1:nlay,1:nq)=0214 pdtcloud(1:ngrid,1:nlay)=0215 216 c icetot(1:ngrid)=0217 c rave(1:ngrid)=0218 219 c ----------------------------------------------220 c221 c222 c Rapport de melange a saturation dans la couche l : -------223 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~224 225 call watersat(ngridmx*nlayermx,zt,pplay,zqsat)226 227 c taux de condensation (kg/kg/s-1) dans les differentes couches228 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~229 230 c Iceparty is not used anymore: water=>iceparty (JBM).231 c if(iceparty) then232 233 do l=1,nlay234 do ig=1,ngrid235 236 IF (improved) then237 c Improved microphysics scheme238 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~239 Ctot = zq(ig,l,i_h2o) + zq(ig,l,i_ice)240 ph2o = zq(ig,l,i_h2o) * 44. / 18. * pplay(ig,l)241 satu = zq(ig,l,i_h2o) / zqsat(ig,l)242 243 call growthrate(ptimestep,zt(ig,l),pplay(ig,l),244 & ph2o,ph2o/satu,seq,rice(ig,l),gr)245 Cste = ptimestep * 4. * pi * rice(ig,l)246 * * rho_ice * ccn(ig,l)247 up = zq(ig,l,i_h2o) + Cste * gr * seq248 dwn = 1. + Cste * gr / zqsat(ig,l)249 newvap = min(up/dwn,Ctot)250 251 gr = gr * ( newvap/zqsat(ig,l) - seq )252 dzq = min( max( Cste * gr,-zq(ig,l,i_ice) )253 * , zq(ig,l,i_h2o) )254 255 c Nucleation (sat ratio must be larger than a critical value)256 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~257 if (satu.gt.1.) then258 if (satu.le.1.4.and.zq(ig,l,i_ice).lt.1.e-8)259 * dzq = 0.260 endif261 262 ELSE263 c Old version264 c ~~~~~~~~~~~265 if (zq(ig,l,i_h2o).ge.zqsat(ig,l))then ! Condensation266 dzq=zq(ig,l,i_h2o)-zqsat(ig,l)267 elseif(zq(ig,l,i_h2o).lt.zqsat(ig,l))then ! Sublimation268 dzq=-min(zqsat(ig,l)-zq(ig,l,i_h2o),zq(ig,l,i_ice))269 endif270 271 ENDIF ! of IF (improved)272 273 c Water Mass change274 c ~~~~~~~~~~~~~~~~~275 zq(ig,l,i_ice)=zq(ig,l,i_ice)+dzq276 zq(ig,l,i_h2o)=zq(ig,l,i_h2o)-dzq277 278 rice(ig,l)=max( CBRT ( (zq(ig,l,i_ice)/rho_ice279 & +ccn(ig,l)*(4./3.)*pi*rdust(ig,l)**3.)280 & /(ccn(ig,l)*4./3.*pi) ), rdust(ig,l))281 282 enddo ! of do ig=1,ngrid283 enddo ! of do l=1,nlay284 285 c The following part have been commented because iceparty286 c is not used anymore: water=>iceparty (JBM).287 288 c else ! if not iceparty289 290 c Saturation couche nlay a 2 :291 c ~~~~~~~~~~~~~~~~~~~~~~~~~~292 c do l=nlay,2, -1293 c do ig=1,ngrid294 c if (zq(ig,l,i_h2o).gt.zqsat(ig,l))then295 c zq(ig,l-1,i_h2o)= zq(ig,l-1,i_h2o)+296 c & (zq(ig,l,i_h2o)-zqsat(ig,l))297 c & *(pplev(ig,l)-pplev(ig,l+1))/(pplev(ig,l-1)-pplev(ig,l))298 c zq(ig,l,i_h2o)=zqsat(ig,l)299 c endif300 c enddo301 c enddo302 303 c Saturation couche l=1 si pas iceparty304 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~305 c do ig=1,ngridmx306 c if (zq(ig,1,i_h2o).gt.zqsat(ig,1))then307 c pdqscloud(ig,i_ice)=(zq(ig,1,i_h2o)-zqsat(ig,1))308 c & *(pplev(ig,1)-pplev(ig,2))/(g*ptimestep)309 c zq(ig,1,i_h2o)=zqsat(ig,1)310 c endif311 c enddo312 313 c endif ! of if (iceparty)314 315 c Tendance finale316 c ~~~~~~~~~~~~~~~317 do l=1, nlay318 do ig=1,ngridmx319 pdqcloud(ig,l,i_h2o)=(zq(ig,l,i_h2o)320 & -zq0(ig,l,i_h2o))/ptimestep321 pdqcloud(ig,l,i_ice) =322 & (zq(ig,l,i_ice) - zq0(ig,l,i_ice))/ptimestep323 lw=(2834.3-0.28*(zt(ig,l)-To)-0.004*(zt(ig,l)-To)**2)*1.e+3324 pdtcloud(ig,l)=-pdqcloud(ig,l,i_h2o)*lw/cpp325 end do326 end do327 328 c A correction if a lot of subliming CO2 fills the 1st layer FF04/2005329 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~330 c Then that should not affect the ice particle radius331 do ig=1,ngridmx332 if(pdpsrf(ig)*ptimestep.gt.0.9*(pplev(ig,1)-pplev(ig,2)))then333 if(pdpsrf(ig)*ptimestep.gt.0.9*(pplev(ig,1)-pplev(ig,3)))334 & rice(ig,2)=rice(ig,3)335 rice(ig,1)=rice(ig,2)336 end if337 end do338 339 c**************************************************340 c Output341 c**************************************************342 ! NB: for diagnostics use zq(), the updated value of tracers343 344 c do ig=1,ngridmx345 c do l=1 ,nlay346 c masse de glace d'eau dans la couche l347 c icetot(ig)=icetot(ig)+masse(ig,l)*zq(ig,l,i_ice)348 c rayon moyen des cristaux dans la colonne ig349 c rave(ig)=rave(ig)+masse(ig,l)*zq(ig,l,i_ice)*rice(ig,l)350 c enddo351 c rave(ig)=rave(ig)/max(icetot(ig),1.e-30)352 c if (icetot(ig)*1000.lt.0.01) rave(ig)=0.353 c enddo ! (ngridmx)354 c**************************************************355 153 356 154 RETURN
Note: See TracChangeset
for help on using the changeset viewer.