1 !WRF:MODEL_LAYER:PHYSICS
8 REAL , PARAMETER, PRIVATE :: RH = 1.0
9 ! REAL , PARAMETER, PRIVATE :: episp0 = 0.622*611.21
10 REAL , PARAMETER, PRIVATE :: xnor = 8.0e6
11 REAL , PARAMETER, PRIVATE :: xnos = 3.0e6
14 ! REAL , PARAMETER, PRIVATE :: xnog = 4.0e4
15 ! REAL , PARAMETER, PRIVATE :: rhograul = 917.
18 REAL , PARAMETER, PRIVATE :: xnog = 4.0e6
19 REAL , PARAMETER, PRIVATE :: rhograul = 400.
22 REAL , PARAMETER, PRIVATE :: &
23 qi0 = 1.0e-3, ql0 = 7.0e-4, qs0 = 6.0E-4, &
24 xmi50 = 4.8e-10, xmi40 = 2.46e-10, &
25 constb = 0.8, constd = 0.25, &
26 o6 = 1./6., cdrag = 0.6, &
27 avisc = 1.49628e-6, adiffwv = 8.7602e-5, &
28 axka = 1.4132e3, di50 = 1.0e-4, xmi = 4.19e-13, &
29 cw = 4.187e3, vf1s = 0.78, vf2s = 0.31, &
30 xni0 = 1.0e-2, xmnin = 1.05e-18, bni = 0.5, &
34 !-------------------------------------------------------------------
35 ! Lin et al., 1983, JAM, 1065-1092, and
36 ! Rutledge and Hobbs, 1984, JAS, 2949-2972
37 ! May 2009 - Changes and corrections from P. Blossey (U. Washington)
38 !-------------------------------------------------------------------
39 SUBROUTINE lin_et_al(th &
45 ,grav, cp, Rair, rvapor &
46 ,XLS, XLV, XLF, rhowater, rhosnow &
47 ,EP2,SVP1,SVP2,SVP3,SVPT0 &
50 , GRAUPELNC, GRAUPELNCV, SR &
51 ,ids,ide, jds,jde, kds,kde &
52 ,ims,ime, jms,jme, kms,kme &
53 ,its,ite, jts,jte, kts,kte &
55 ,qlsink, precr, preci, precs, precg &
59 !-------------------------------------------------------------------
61 !-------------------------------------------------------------------
65 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde , &
66 ims,ime, jms,jme, kms,kme , &
67 its,ite, jts,jte, kts,kte
69 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
77 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
84 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
89 REAL , DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: ht
91 REAL, INTENT(IN ) :: dt_in, &
102 REAL, INTENT(IN ) :: EP2,SVP1,SVP2,SVP3,SVPT0
104 REAL, DIMENSION( ims:ime , jms:jme ), &
105 INTENT(INOUT) :: RAINNC, &
110 REAL, DIMENSION( ims:ime , jms:jme ), &
112 INTENT(INOUT) :: SNOWNC, &
117 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
125 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
126 OPTIONAL, INTENT(OUT ) :: &
127 qlsink, & ! cloud water conversion to rain (/s)
128 precr, & ! rain precipitation rate at all levels (kg/m2/s)
129 preci, & ! ice precipitation rate at all levels (kg/m2/s)
130 precs, & ! snow precipitation rate at all levels (kg/m2/s)
131 precg ! graupel precipitation rate at all levels (kg/m2/s)
133 LOGICAL, INTENT(IN), OPTIONAL :: F_QG, F_QNDROP
137 INTEGER :: min_q, max_q
139 REAL, DIMENSION( its:ite , jts:jte ) &
140 :: rain, snow, graupel,ice
142 REAL, DIMENSION( kts:kte ) :: qvz, qlz, qrz, &
148 precrz, preciz, precsz, precgz, &
152 LOGICAL :: flag_qg, flag_qndrop
154 REAL :: dt, pptrain, pptsnow, pptgraul, rhoe_s, &
161 flag_qndrop = .false.
162 IF ( PRESENT ( f_qg ) ) flag_qg = f_qg
163 IF ( PRESENT ( f_qndrop ) ) flag_qndrop = f_qndrop
167 qndropconst=100.e6 !sg
170 IF (.not.flag_qg) gindex=0.
172 j_loop: DO j = jts, jte
173 i_loop: DO i = its, ite
175 !- write data from 3-D to 1-D
186 sqrhoz(k)=sqrt(rhoe_s*orhoz(k))
192 IF (flag_qndrop .AND. PRESENT( qndrop )) THEN
194 qndropz(k)=qndrop(i,k,j)
198 qndropz(k)=qndropconst
207 IF ( flag_qg .AND. PRESENT( qg ) ) THEN
221 CALL clphy1d( dt, qvz, qlz, qrz, qiz, qsz, qgz, &
222 qndropz,flag_qndrop, &
223 thz, tothz, rhoz, orhoz, sqrhoz, &
224 prez, zz, dzw, ht(I,J), preclw, &
225 precrz, preciz, precsz, precgz, &
226 pptrain, pptsnow, pptgraul, pptice, &
227 grav, cp, Rair, rvapor, gindex, &
228 XLS, XLV, XLF, rhowater, rhosnow, &
229 EP2,SVP1,SVP2,SVP3,SVPT0, &
233 ! Precipitation from cloud microphysics -- only for one time step
235 ! unit is transferred from m to mm
240 graupel(i,j)=pptgraul
242 sr(i,j)=(pptice+pptsnow+pptgraul)/(pptice+pptsnow+pptgraul+pptrain+1.e-12)
244 RAINNCV(i,j)= pptrain + pptsnow + pptgraul + pptice
245 RAINNC(i,j)=RAINNC(i,j) + pptrain + pptsnow + pptgraul + pptice
246 IF(PRESENT(SNOWNCV))SNOWNCV(i,j)= pptsnow + pptice
247 IF(PRESENT(SNOWNC))SNOWNC(i,j)=SNOWNC(i,j) + pptsnow + pptice
248 IF(PRESENT(GRAUPELNCV))GRAUPELNCV(i,j)= pptgraul
249 IF(PRESENT(GRAUPELNC))GRAUPELNC(i,j)=GRAUPELNC(i,j) + pptgraul
252 !- update data from 1-D back to 3-D
255 IF ( present(qlsink) .and. present(precr) ) THEN !sg beg
257 if(ql(i,k,j)>1.e-20) then
258 qlsink(i,k,j)=-preclw(k)/ql(i,k,j)
262 precr(i,k,j)=precrz(k)
273 IF ( flag_qndrop .AND. PRESENT( qndrop ) ) THEN !sg beg
275 qndrop(i,k,j)=qndropz(k)
284 IF ( present(preci) ) THEN !sg beg
286 preci(i,k,j)=preciz(k)
290 IF ( present(precs) ) THEN
292 precs(i,k,j)=precsz(k)
296 IF ( flag_qg .AND. PRESENT( qg ) ) THEN
301 IF ( present(precg) ) THEN !sg beg
303 precg(i,k,j)=precgz(k)
307 IF ( present(precg) ) precg(i,:,j)=0. !sg end
313 END SUBROUTINE lin_et_al
316 !-----------------------------------------------------------------------
317 SUBROUTINE clphy1d(dt, qvz, qlz, qrz, qiz, qsz, qgz, &
318 qndropz,flag_qndrop, &
319 thz, tothz, rho, orho, sqrho, &
320 prez, zz, dzw, zsfc, preclw, &
321 precrz, preciz, precsz, precgz, &
322 pptrain, pptsnow, pptgraul, &
323 pptice, grav, cp, Rair, rvapor, gindex, &
324 XLS, XLV, XLF, rhowater, rhosnow, &
325 EP2,SVP1,SVP2,SVP3,SVPT0, &
327 !-----------------------------------------------------------------------
329 !-----------------------------------------------------------------------
330 ! This program handles the vertical 1-D cloud micphysics
331 !-----------------------------------------------------------------------
332 ! avisc: constant in empirical formular for dynamic viscosity of air
333 ! =1.49628e-6 [kg/m/s] = 1.49628e-5 [g/cm/s]
334 ! adiffwv: constant in empirical formular for diffusivity of water
336 ! = 8.7602e-5 [kgm/s3] = 8.7602 [gcm/s3]
337 ! axka: constant in empirical formular for thermal conductivity of air
338 ! = 1.4132e3 [m2/s2/K] = 1.4132e7 [cm2/s2/K]
339 ! qi0: mixing ratio threshold for cloud ice aggregation [kg/kg]
340 ! xmi50: mass of a 50 micron ice crystal
341 ! = 4.8e-10 [kg] =4.8e-7 [g]
342 ! xmi40: mass of a 40 micron ice crystal
343 ! = 2.46e-10 [kg] = 2.46e-7 [g]
344 ! di50: diameter of a 50 micro (radius) ice crystal
346 ! xmi: mass of one cloud ice crystal
347 ! =4.19e-13 [kg] = 4.19e-10 [g]
350 ! xni0=1.0e-2 [m-3] The value given in Lin et al. is wrong.(see
351 ! Hsie et al.(1980) and Rutledge and Hobbs(1983) )
353 ! xmnin: mass of a natural ice nucleus
354 ! = 1.05e-18 [kg] = 1.05e-15 [g] This values is suggested by
356 ! = 1.0e-12 [kg] suggested by Rutlegde and Hobbs (1983)
357 ! rhowater: density of water=1.0 g/cm3=1000.0 kg/m3
358 ! consta: constant in empirical formular for terminal
359 ! velocity of raindrop
360 ! =2115.0 [cm**(1-b)/s] = 2115.0*0.01**(1-b) [m**(1-b)/s]
361 ! constb: constant in empirical formular for terminal
362 ! velocity of raindrop
364 ! xnor: intercept parameter of the raindrop size distribution
365 ! = 0.08 cm-4 = 8.0e6 m-4
366 ! araut: time sacle for autoconversion of cloud water to raindrops
368 ! ql0: mixing ratio threshold for cloud watercoalescence [kg/kg]
369 ! vf1r: ventilation factors for rain =0.78
370 ! vf2r: ventilation factors for rain =0.31
371 ! rhosnow: density of snow=0.1 g/cm3=100.0 kg/m3
372 ! constc: constant in empirical formular for terminal
374 ! =152.93 [cm**(1-d)/s] = 152.93*0.01**(1-d) [m**(1-d)/s]
375 ! constd: constant in empirical formular for terminal
378 ! xnos: intercept parameter of the snowflake size distribution
379 ! vf1s: ventilation factors for snow =0.78
380 ! vf2s: ventilation factors for snow =0.31
382 !----------------------------------------------------------------------
384 INTEGER, INTENT(IN ) :: kts, kte, i, j
386 REAL, DIMENSION( kts:kte ), &
387 INTENT(INOUT) :: qvz, qlz, qrz, qiz, qsz, &
391 REAL, DIMENSION( kts:kte ), &
392 INTENT(IN ) :: tothz, rho, orho, sqrho, &
395 REAL, INTENT(IN ) :: dt, grav, cp, Rair, rvapor, &
396 XLS, XLV, XLF, rhowater, &
397 rhosnow,EP2,SVP1,SVP2,SVP3,SVPT0
399 REAL, DIMENSION( kts:kte ), INTENT(OUT) :: preclw, &
400 precrz, preciz, precsz, precgz
402 REAL, INTENT(INOUT) :: pptrain, pptsnow, pptgraul, pptice
404 REAL, INTENT(IN ) :: zsfc
405 logical, intent(in) :: flag_qndrop !sg
409 REAL :: obp4, bp3, bp5, bp6, odp4, &
415 REAL :: tmp, tmp0, tmp1, tmp2,tmp3, &
416 tmp4,delta2,delta3, delta4, &
417 tmpa,tmpb,tmpc,tmpd,alpha1, &
418 qic, abi,abr, abg, odtberg, &
419 vti50,eiw,eri,esi,esr, esw, &
420 erw,delrs,term0,term1,araut, &
421 constg2, vf1r, vf2r,alpha2, &
422 Ap, Bp, egw, egi, egs, egr, &
423 constg, gdelta4, g1sdelt4, &
424 factor, tmp_r, tmp_s,tmp_g, &
425 qlpqi, rsat, a1, a2, xnin
429 REAL, DIMENSION( kts:kte ) :: oprez, tem, temcc, theiz, qswz, &
430 qsiz, qvoqswz, qvoqsiz, qvzodt, &
431 qlzodt, qizodt, qszodt, qrzodt, &
434 REAL, DIMENSION( kts:kte ) :: psnow, psaut, psfw, psfi, praci, &
435 piacr, psaci, psacw, psdep, pssub, &
436 pracs, psacr, psmlt, psmltevp, &
437 prain, praut, pracw, prevp, pvapor, &
438 pclw, pladj, pcli, pimlt, pihom, &
439 pidw, piadj, pgraupel, pgaut, &
440 pgfr, pgacw, pgaci, pgacr, pgacs, &
441 pgacip,pgacrp,pgacsp,pgwet, pdry, &
442 pgsub, pgdep, pgmlt, pgmltevp, &
446 REAL, DIMENSION( kts:kte ) :: qvsbar, rs0, viscmu, visc, diffwv, &
449 REAL, DIMENSION( kts:kte ) :: vtr, vts, vtg, &
450 vtrold, vtsold, vtgold, vtiold, &
451 xlambdar, xlambdas, xlambdag, &
452 olambdar, olambdas, olambdag
454 REAL :: episp0k, dtb, odtb, pi, pio4, &
455 pio6, oxLf, xLvocp, xLfocp, consta, &
456 constc, ocdrag, gambp4, gamdp4, &
457 gam4pt5, Cpor, oxmi, gambp3, gamdp3,&
458 gambp6, gam3pt5, gam2pt75, gambp5o2,&
459 gamdp5o2, cwoxlf, ocp, xni50, es
463 REAL :: temc1,save1,save2,xni50mx
465 ! for terminal velocity flux
467 INTEGER :: min_q, max_q
468 REAL :: t_del_tv, del_tv, flux, fluxin, fluxout ,tmpqrz
471 REAL :: tmp_tem, tmp_temcc !bloss
473 real :: liqconc, dis, beta, kappa, p0, xc, capn,rhocgs
476 ! liqconc = liquid water content (g cm^-3)
477 ! capn = droplet number concentration (# cm^-3)
478 ! dis = relative dispersion (dimensionless) between 0.2 and 1.
479 ! Written by Yangang Liu based on Liu et al., GRL 32, 2005.
480 ! Autoconversion rate p = p0 * (threshold function)
481 ! p0 = "base" autoconversion rate (g cm^-3 s^-1)
482 ! kappa = constant in Long kernel = [kappa2 * (3/(4*pi*rhow))^3] in Liu papers
483 ! beta = Condensation rate constant = (beta6)^6 in Liu papers
484 ! xc = Normalized critical mass
485 ! ***********************************************************
487 dis = 0.5 ! droplet dispersion, set to 0.5 per SG 8-Nov-2006
488 ! Give empirical constants
490 ! Calculate Condensation rate constant
491 beta = (1.0d0+3.0d0*dis**2)*(1.0d0+4.0d0*dis**2)* &
492 (1.0d0+5.0d0*dis**2)/((1.0d0+dis**2)*(1.0d0+2.0d0*dis**2))
505 consta=2115.0*0.01**(1-constb)
506 constc=152.93*0.01**(1-constd)
509 episp0k=RH*ep2*1000.*svp1
511 gambp4=ggamma(constb+4.)
512 gamdp4=ggamma(constd+4.)
516 gambp3=ggamma(constb+3.)
517 gamdp3=ggamma(constd+3.)
518 gambp6=ggamma(constb+6)
520 gam2pt75=ggamma(2.75)
521 gambp5o2=ggamma((constb+5.)/2.)
522 gamdp5o2=ggamma((constd+5.)/2.)
528 !-----------------------------------------------------------------------
529 ! oprez 1./prez ( prez : pressure)
530 ! qsw saturated mixing ratio on water surface
531 ! qsi saturated mixing ratio on ice surface
532 ! episp0k RH*e*saturated pressure at 273.15 K
542 ! temcc temperature in dregee C
545 obp4=1.0/(constb+4.0)
549 odp4=1.0/(constd+4.0)
552 dp5o2=0.5*(constd+5.0)
559 qlz(k)=amax1( 0.0,qlz(k) )
560 qiz(k)=amax1( 0.0,qiz(k) )
561 qvz(k)=amax1( qvmin,qvz(k) )
562 qsz(k)=amax1( 0.0,qsz(k) )
563 qrz(k)=amax1( 0.0,qrz(k) )
564 qgz(k)=amax1( 0.0,qgz(k) )
565 qndropz(k)=amax1( 0.0,qndropz(k) ) !sg
567 tem(k)=thz(k)*tothz(k)
568 temcc(k)=tem(k)-273.15
570 ! qswz(k)=episp0k*oprez(k)* &
571 ! exp( svp2*temcc(k)/(tem(k)-svp3) )
572 es=1000.*svp1*exp( svp2*temcc(k)/(tem(k)-svp3) )
573 qswz(k)=ep2*es/(prez(k)-es)
574 if (tem(k) .lt. 273.15 ) then
575 ! qsiz(k)=episp0k*oprez(k)* &
576 ! exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
577 es=1000.*svp1*exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
578 qsiz(k)=ep2*es/(prez(k)-es)
579 if (temcc(k) .lt. -40.0) qswz(k)=qsiz(k)
584 qvoqswz(k)=qvz(k)/qswz(k)
585 qvoqsiz(k)=qvz(k)/qsiz(k)
587 theiz(k)=thz(k)+(xlvocp*qvz(k)-xlfocp*qiz(k))/tothz(k)
593 !-----------------------------------------------------------------------
594 ! In this simple stable cloud parameterization scheme, only five
595 ! forms of water substance (water vapor, cloud water, cloud ice,
596 ! rain and snow are considered. The prognostic variables are total
597 ! water (qp),cloud water (ql), and cloud ice (qi). Rain and snow are
598 ! diagnosed following Nagata and Ogura, 1991, MWR, 1309-1337. Eq (A7).
599 ! the micro physics are based on (1) Hsie et al.,1980, JAM, 950-977 ;
600 ! (2) Lin et al., 1983, JAM, 1065-1092 ; (3) Rutledge and Hobbs, 1983,
601 ! JAS, 1185-1206 ; (4) Rutledge and Hobbs, 1984, JAS, 2949-2972.
602 !-----------------------------------------------------------------------
604 ! rhowater: density of water=1.0 g/cm3=1000.0 kg/m3
605 ! rhosnow: density of snow=0.1 g/cm3=100.0 kg/m3
606 ! xnor: intercept parameter of the raindrop size distribution
607 ! = 0.08 cm-4 = 8.0e6 m-4
608 ! xnos: intercept parameter of the snowflake size distribution
609 ! = 0.03 cm-4 = 3.0e6 m-4
610 ! xnog: intercept parameter of the graupel size distribution
611 ! = 4.0e-4 cm-4 = 4.0e4 m-4
612 ! consta: constant in empirical formular for terminal
613 ! velocity of raindrop
614 ! =2115.0 [cm**(1-b)/s] = 2115.0*0.01**(1-b) [m**(1-b)/s]
615 ! constb: constant in empirical formular for terminal
616 ! velocity of raindrop
618 ! constc: constant in empirical formular for terminal
620 ! =152.93 [cm**(1-d)/s] = 152.93*0.01**(1-d) [m**(1-d)/s]
621 ! constd: constant in empirical formular for terminal
624 ! avisc: constant in empirical formular for dynamic viscosity of air
625 ! =1.49628e-6 [kg/m/s] = 1.49628e-5 [g/cm/s]
626 ! adiffwv: constant in empirical formular for diffusivity of water
628 ! = 8.7602e-5 [kgm/s3] = 8.7602 [gcm/s3]
629 ! axka: constant in empirical formular for thermal conductivity of air
630 ! = 1.4132e3 [m2/s2/K] = 1.4132e7 [cm2/s2/K]
631 ! qi0: mixing ratio threshold for cloud ice aggregation [kg/kg]
632 ! = 1.0e-3 g/g = 1.0e-3 kg/gk
633 ! ql0: mixing ratio threshold for cloud watercoalescence [kg/kg]
634 ! = 2.0e-3 g/g = 2.0e-3 kg/gk
635 ! qs0: mixing ratio threshold for snow aggregation
636 ! = 6.0e-4 g/g = 6.0e-4 kg/gk
637 ! xmi50: mass of a 50 micron ice crystal
638 ! = 4.8e-10 [kg] =4.8e-7 [g]
639 ! xmi40: mass of a 40 micron ice crystal
640 ! = 2.46e-10 [kg] = 2.46e-7 [g]
641 ! di50: diameter of a 50 micro (radius) ice crystal
643 ! xmi: mass of one cloud ice crystal
644 ! =4.19e-13 [kg] = 4.19e-10 [g]
649 ! if gindex=1.0 include graupel
650 ! if gindex=0. no graupel
712 ! Set rs0=episp0*oprez(k)
713 ! episp0=e*saturated pressure at 273.15 K
717 rs0(k)=ep2*1000.*svp1/(prez(k)-1000.*svp1)
720 !***********************************************************************
721 ! Calculate precipitation fluxes due to terminal velocities.
722 !***********************************************************************
724 !- Calculate termianl velocity (vt?) of precipitation q?z
725 !- Find maximum vt? to determine the small delta t
738 if (qrz(k) .gt. 1.0e-8) then
741 tmp1=sqrt(pi*rhowater*xnor/rho(k)/qrz(k))
743 vtrold(k)=o6*consta*gambp4*sqrho(k)/tmp1**constb
745 del_tv=amin1(del_tv,0.9*(zz(k)-zsfc)/vtrold(k))
747 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vtrold(k))
754 if (max_q .ge. min_q) then
756 !- Check if the summation of the small delta t >= big delta t
757 ! (t_del_tv) (del_tv) (dtb)
759 t_del_tv=t_del_tv+del_tv
761 if ( t_del_tv .ge. dtb ) then
763 del_tv=dtb+del_tv-t_del_tv
768 fluxout=rho(k)*vtrold(k)*qrz(k)
769 flux=(fluxin-fluxout)/rho(k)/dzw(k)
771 qrz(k)=qrz(k)+del_tv*flux
774 if (min_q .eq. 1) then
775 pptrain=pptrain+fluxin*del_tv
777 qrz(min_q-1)=qrz(min_q-1)+del_tv* &
778 fluxin/rho(min_q-1)/dzw(min_q-1)
799 if (qsz(k) .gt. 1.0e-8) then
802 tmp1=sqrt(pi*rhosnow*xnos/rho(k)/qsz(k))
804 vtsold(k)=o6*constc*gamdp4*sqrho(k)/tmp1**constd
806 del_tv=amin1(del_tv,0.9*(zz(k)-zsfc)/vtsold(k))
808 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vtsold(k))
815 if (max_q .ge. min_q) then
818 !- Check if the summation of the small delta t >= big delta t
819 ! (t_del_tv) (del_tv) (dtb)
821 t_del_tv=t_del_tv+del_tv
823 if ( t_del_tv .ge. dtb ) then
825 del_tv=dtb+del_tv-t_del_tv
830 fluxout=rho(k)*vtsold(k)*qsz(k)
831 flux=(fluxin-fluxout)/rho(k)/dzw(k)
832 qsz(k)=qsz(k)+del_tv*flux
833 qsz(k)=amax1(0.,qsz(k))
836 if (min_q .eq. 1) then
837 pptsnow=pptsnow+fluxin*del_tv
839 qsz(min_q-1)=qsz(min_q-1)+del_tv* &
840 fluxin/rho(min_q-1)/dzw(min_q-1)
861 if (qgz(k) .gt. 1.0e-8) then
864 tmp1=sqrt(pi*rhograul*xnog/rho(k)/qgz(k))
866 term0=sqrt(4.*grav*rhograul*0.33334/rho(k)/cdrag)
867 vtgold(k)=o6*gam4pt5*term0*sqrt(1./tmp1)
869 del_tv=amin1(del_tv,0.9*(zz(k)-zsfc)/vtgold(k))
871 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vtgold(k))
878 if (max_q .ge. min_q) then
881 !- Check if the summation of the small delta t >= big delta t
882 ! (t_del_tv) (del_tv) (dtb)
884 t_del_tv=t_del_tv+del_tv
886 if ( t_del_tv .ge. dtb ) then
888 del_tv=dtb+del_tv-t_del_tv
894 fluxout=rho(k)*vtgold(k)*qgz(k)
895 flux=(fluxin-fluxout)/rho(k)/dzw(k)
896 qgz(k)=qgz(k)+del_tv*flux
897 qgz(k)=amax1(0.,qgz(k))
900 if (min_q .eq. 1) then
901 pptgraul=pptgraul+fluxin*del_tv
903 qgz(min_q-1)=qgz(min_q-1)+del_tv* &
904 fluxin/rho(min_q-1)/dzw(min_q-1)
914 !-- cloud ice (03/21/02) follow Vaughan T.J. Phillips at GFDL
926 if (qiz(k) .gt. 1.0e-8) then
929 vtiold(k)= 3.29 * (rho(k)* qiz(k))** 0.16 ! Heymsfield and Donner
931 del_tv=amin1(del_tv,0.9*(zz(k)-zsfc)/vtiold(k))
933 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vtiold(k))
940 if (max_q .ge. min_q) then
943 !- Check if the summation of the small delta t >= big delta t
944 ! (t_del_tv) (del_tv) (dtb)
946 t_del_tv=t_del_tv+del_tv
948 if ( t_del_tv .ge. dtb ) then
950 del_tv=dtb+del_tv-t_del_tv
955 fluxout=rho(k)*vtiold(k)*qiz(k)
956 flux=(fluxin-fluxout)/rho(k)/dzw(k)
957 qiz(k)=qiz(k)+del_tv*flux
958 qiz(k)=amax1(0.,qiz(k))
961 if (min_q .eq. 1) then
962 pptice=pptice+fluxin*del_tv
964 qiz(min_q-1)=qiz(min_q-1)+del_tv* &
965 fluxin/rho(min_q-1)/dzw(min_q-1)
973 do k=kts,kte-1 !sg beg
974 precrz(k)=rho(k)*vtrold(k)*qrz(k)
975 preciz(k)=rho(k)*vtiold(k)*qiz(k)
976 precsz(k)=rho(k)*vtsold(k)*qsz(k)
977 precgz(k)=rho(k)*vtgold(k)*qgz(k)
979 precrz(kte)=0. !wig - top level never set for vtXold vars
985 ! Microphysics processes
989 qvzodt(k)=amax1( 0.0,odtb*qvz(k) )
990 qlzodt(k)=amax1( 0.0,odtb*qlz(k) )
991 qizodt(k)=amax1( 0.0,odtb*qiz(k) )
992 qszodt(k)=amax1( 0.0,odtb*qsz(k) )
993 qrzodt(k)=amax1( 0.0,odtb*qrz(k) )
994 qgzodt(k)=amax1( 0.0,odtb*qgz(k) )
995 !***********************************************************************
996 !***** diagnose mixing ratios (qrz,qsz), terminal *****
997 !***** velocities (vtr,vts), and slope parameters in size *****
998 !***** distribution(xlambdar,xlambdas) of rain and snow *****
999 !***** follows Nagata and Ogura, 1991, MWR, 1309-1337. Eq (A7) *****
1000 !***********************************************************************
1002 !**** assuming no cloud water can exist in the top two levels due to
1003 !**** radiation consideration
1007 !! no cloud water, rain, ice, snow and graupel
1009 !! skip these processes and jump to line 2000
1012 tmp=qiz(k)+qlz(k)+qsz(k)+qrz(k)+qgz(k)*gindex
1013 if( qvz(k)+qlz(k)+qiz(k) .lt. qsiz(k) &
1014 .and. tmp .eq. 0.0 ) go to 2000
1016 !! calculate terminal velocity of rain
1018 if (qrz(k) .gt. 1.0e-8) then
1019 tmp1=sqrt(pi*rhowater*xnor*orho(k)/qrz(k))
1020 xlambdar(k)=sqrt(tmp1)
1021 olambdar(k)=1.0/xlambdar(k)
1022 vtrold(k)=o6*consta*gambp4*sqrho(k)*olambdar(k)**constb
1028 ! if (qrz(k) .gt. 1.0e-12) then
1029 if (qrz(k) .gt. 1.0e-8) then
1030 tmp1=sqrt(pi*rhowater*xnor*orho(k)/qrz(k))
1031 xlambdar(k)=sqrt(tmp1)
1032 olambdar(k)=1.0/xlambdar(k)
1033 vtr(k)=o6*consta*gambp4*sqrho(k)*olambdar(k)**constb
1039 !! calculate terminal velocity of snow
1041 if (qsz(k) .gt. 1.0e-8) then
1042 tmp1=sqrt(pi*rhosnow*xnos*orho(k)/qsz(k))
1043 xlambdas(k)=sqrt(tmp1)
1044 olambdas(k)=1.0/xlambdas(k)
1045 vtsold(k)=o6*constc*gamdp4*sqrho(k)*olambdas(k)**constd
1051 ! if (qsz(k) .gt. 1.0e-12) then
1052 if (qsz(k) .gt. 1.0e-8) then
1053 tmp1=sqrt(pi*rhosnow*xnos*orho(k)/qsz(k))
1054 xlambdas(k)=sqrt(tmp1)
1055 olambdas(k)=1.0/xlambdas(k)
1056 vts(k)=o6*constc*gamdp4*sqrho(k)*olambdas(k)**constd
1062 !! calculate terminal velocity of graupel
1064 if (qgz(k) .gt. 1.0e-8) then
1065 tmp1=sqrt( pi*rhograul*xnog*orho(k)/qgz(k))
1066 xlambdag(k)=sqrt(tmp1)
1067 olambdag(k)=1.0/xlambdag(k)
1068 term0=sqrt(4.*grav*rhograul*0.33334*orho(k)*ocdrag)
1069 vtgold(k)=o6*gam4pt5*term0*sqrt(olambdag(k))
1075 ! if (qgz(k) .gt. 1.0e-12) then
1076 if (qgz(k) .gt. 1.0e-8) then
1077 tmp1=sqrt( pi*rhograul*xnog*orho(k)/qgz(k))
1078 xlambdag(k)=sqrt(tmp1)
1079 olambdag(k)=1.0/xlambdag(k)
1080 term0=sqrt(4.*grav*rhograul*0.33334*orho(k)*ocdrag)
1081 vtg(k)=o6*gam4pt5*term0*sqrt(olambdag(k))
1087 !***********************************************************************
1088 !***** compute viscosity,difusivity,thermal conductivity, and ******
1089 !***** Schmidt number ******
1090 !***********************************************************************
1091 !c------------------------------------------------------------------
1092 !c viscmu: dynamic viscosity of air kg/m/s
1093 !c visc: kinematic viscosity of air = viscmu/rho (m2/s)
1094 !c avisc=1.49628e-6 kg/m/s=1.49628e-5 g/cm/s
1095 !c viscmu=1.718e-5 kg/m/s in RH
1096 !c diffwv: Diffusivity of water vapor in air
1097 !c adiffwv = 8.7602e-5 (8.794e-5 in MM5) kgm/s3
1098 !c = 8.7602 (8.794 in MM5) gcm/s3
1099 !c diffwv(k)=2.26e-5 m2/s
1100 !c schmidt: Schmidt number=visc/diffwv
1101 !c xka: thermal conductivity of air J/m/s/K (Kgm/s3/K)
1102 !c xka(k)=2.43e-2 J/m/s/K in RH
1103 !c axka=1.4132e3 (1.414e3 in MM5) m2/s2/k = 1.4132e7 cm2/s2/k
1104 !c------------------------------------------------------------------
1106 viscmu(k)=avisc*tem(k)**1.5/(tem(k)+120.0)
1107 visc(k)=viscmu(k)*orho(k)
1108 diffwv(k)=adiffwv*tem(k)**1.81*oprez(k)
1109 schmidt(k)=visc(k)/diffwv(k)
1110 xka(k)=axka*viscmu(k)
1112 if (tem(k) .lt. 273.15) then
1115 !***********************************************************************
1116 !********* snow production processes for T < 0 C **********
1117 !***********************************************************************
1119 !c (1) ICE CRYSTAL AGGREGATION TO SNOW (Psaut): Lin (21)
1120 !c! psaut=alpha1*(qi-qi0)
1121 !c! alpha1=1.0e-3*exp(0.025*(T-T0))
1123 ! alpha1=1.0e-3*exp( 0.025*temcc(k) )
1125 alpha1=1.0e-3*exp( 0.025*temcc(k) )
1127 if(temcc(k) .lt. -20.0) then
1128 tmp1=-7.6+4.0*exp( -0.2443e-3*(abs(temcc(k))-20)**2.455 )
1129 qic=1.0e-3*exp(tmp1)*orho(k)
1134 ! tmp1=amax1( 0.0,alpha1*(qiz(k)-qic) )
1135 ! psaut(k)=amin1( tmp1,qizodt(k) )
1137 tmp1=odtb*(qiz(k)-qic)*(1.0-exp(-alpha1*dtb))
1138 psaut(k)=amax1( 0.0,tmp1 )
1141 !c (2) BERGERON PROCESS TRANSFER OF CLOUD WATER TO SNOW (Psfw)
1142 !c this process only considered when -31 C < T < 0 C
1143 !c Lin (33) and Hsie (17)
1146 !c! parama1 and parama2 functions must be user supplied
1150 if( qlz(k) .gt. 1.0e-10 ) then
1151 temc1=amax1(-30.99,temcc(k))
1152 ! print*,'temc1',temc1,qlz(k)
1156 !! change unit from cgs to mks
1158 !c! dtberg is the time needed for a crystal to grow from 40 to 50 um
1159 !c ! odtberg=1.0/dtberg
1160 odtberg=(a1*tmp1)/(xmi50**tmp1-xmi40**tmp1)
1162 !c! compute terminal velocity of a 50 micron ice cystal
1164 vti50=constc*di50**constd*sqrho(k)
1168 save2=0.25*pi*eiw*rho(k)*di50*di50*vti50
1170 tmp2=( save1 + save2*qlz(k) )
1172 !! maximum number of 50 micron crystals limited by the amount
1173 !! of supercool water
1175 xni50mx=qlzodt(k)/tmp2
1177 !! number of 50 micron crystals produced
1180 xni50=qiz(k)*( 1.0-exp(-dtb*odtberg) )/xmi50
1181 xni50=amin1(xni50,xni50mx)
1183 tmp3=odtb*tmp2/save2*( 1.0-exp(-save2*xni50*dtb) )
1184 psfw(k)=amin1( tmp3,qlzodt(k) )
1188 !0915 if( temcc(k).gt.-30.99 ) then
1189 !0915 a1=parama1( temcc(k) )
1190 !0915 a2=parama2( temcc(k) )
1192 !! change unit from cgs to mks
1193 !0915 a1=a1*0.001**tmp1
1195 !c! dtberg is the time needed for a crystal to grow from 40 to 50 um
1196 !c! odtberg=1.0/dtberg
1197 !0915 odtberg=(a1*tmp1)/(xmi50**tmp1-xmi40**tmp1)
1199 !c! number of 50 micron crystals produced
1200 !0915 xni50=qiz(k)*dtb*odtberg/xmi50
1202 !c! need to calculate the terminal velocity of a 50 micron
1204 !0915 vti50=constc*di50**constd*sqrho(k)
1206 !0915 tmp2=xni50*( a1*xmi50**a2 + &
1207 !0915 0.25*qlz(k)*pi*eiw*rho(k)*di50*di50*vti50 )
1208 !0915 psfw(k)=amin1( tmp2,qlzodt(k) )
1211 !c (3) REDUCTION OF CLOUD ICE BY BERGERON PROCESS (Psfi): Lin (34)
1212 !c this process only considered when -31 C < T < 0 C
1214 tmp1=xni50*xmi50-psfw(k)
1215 psfi(k)=amin1(tmp1,qizodt(k))
1221 !0915 tmp1=qiz(k)*odtberg
1222 !0915 psfi(k)=amin1(tmp1,qizodt(k))
1227 if(qrz(k) .le. 0.0) go to 1000
1229 ! Processes (4) and (5) only need when qrz > 0.0
1232 !c (4) CLOUD ICE ACCRETION BY RAIN (Praci): Lin (25)
1233 !c may produce snow or graupel
1236 !0915 tmp1=qiz(k)*pio4*eri*xnor*consta*sqrho(k)
1237 !0915 tmp2=tmp1*gambp3*olambdar(k)**bp3
1238 !0915 praci(k)=amin1( tmp2,qizodt(k) )
1240 save1=pio4*eri*xnor*consta*sqrho(k)
1241 tmp1=save1*gambp3*olambdar(k)**bp3
1242 praci(k)=qizodt(k)*( 1.0-exp(-tmp1*dtb) )
1245 !c (5) RAIN ACCRETION BY CLOUD ICE (Piacr): Lin (26)
1247 !0915 tmp2=tmp1*rho(k)*pio6*rhowater*gambp6*oxmi* &
1248 !0915 olambdar(k)**bp6
1249 !0915 piacr(k)=amin1( tmp2,qrzodt(k) )
1251 tmp2=qiz(k)*save1*rho(k)*pio6*rhowater*gambp6*oxmi* &
1253 piacr(k)=amin1( tmp2,qrzodt(k) )
1258 if(qsz(k) .le. 0.0) go to 1200
1260 ! Compute the following processes only when qsz > 0.0
1263 !c (6) ICE CRYSTAL ACCRETION BY SNOW (Psaci): Lin (22)
1265 esi=exp( 0.025*temcc(k) )
1266 save1=pio4*xnos*constc*gamdp3*sqrho(k)* &
1269 psaci(k)=qizodt(k)*( 1.0-exp(-tmp1*dtb) )
1271 !0915 tmp1=pio4*xnos*constc*gamdp3*sqrho(k)* &
1272 !0915 olambdas(k)**dp3
1273 !0915 tmp2=qiz(k)*esi*tmp1
1274 !0915 psaci(k)=amin1( tmp2,qizodt(k) )
1276 !c (7) CLOUD WATER ACCRETION BY SNOW (Psacw): Lin (24)
1280 psacw(k)=qlzodt(K)*( 1.0-exp(-tmp1*dtb) )
1282 !0915 tmp2=qlz(k)*esw*tmp1
1283 !0915 psacw(k)=amin1( tmp2,qlzodt(k) )
1285 !c (8) DEPOSITION/SUBLIMATION OF SNOW (Psdep/Pssub): Lin (31)
1286 !c includes consideration of ventilation effect
1288 !c abi=2*pi*(Si-1)/rho/(A"+B")
1290 tmpa=rvapor*xka(k)*tem(k)*tem(k)
1291 tmpb=xls*xls*rho(k)*qsiz(k)*diffwv(k)
1292 tmpc=tmpa*qsiz(k)*diffwv(k)
1293 abi=2.0*pi*(qvoqsiz(k)-1.0)*tmpc/(tmpa+tmpb)
1295 !c vf1s,vf2s=ventilation factors for snow
1296 !c vf1s=0.78,vf2s=0.31 in LIN
1298 tmp1=constc*sqrho(k)*olambdas(k)**dp5/visc(k)
1299 tmp2=abi*xnos*( vf1s*olambdas(k)*olambdas(k)+ &
1300 vf2s*schmidt(k)**0.33334*gamdp5o2*sqrt(tmp1) )
1301 tmp3=odtb*( qvz(k)-qsiz(k) )
1304 !the old implementation would give the wrong results if olambdas(k) ==0
1305 !which can lead to positive pssub, i.e. tmp2=0 but tmp3> 0
1306 ! if( tmp2 .le. 0.0) then
1307 if( tmp3 .le. 0.0) then
1308 tmp2=amax1( tmp2,tmp3)
1309 pssub(k)=amin1(0.,amax1( tmp2,-qszodt(k) ))
1313 psdep(k)=amin1( tmp2,tmp3 )
1317 !0915 psdep(k)=amax1(0.0,tmp2)
1318 !0915 pssub(k)=amin1(0.0,tmp2)
1319 !0915 pssub(k)=amax1( pssub(k),-qszodt(k) )
1321 if(qrz(k) .le. 0.0) go to 1200
1323 ! Compute processes (9) and (10) only when qsz > 0.0 and qrz > 0.0
1326 !c (9) ACCRETION OF SNOW BY RAIN (Pracs): Lin (27)
1329 tmpa=olambdar(k)*olambdar(k)
1330 tmpb=olambdas(k)*olambdas(k)
1331 tmpc=olambdar(k)*olambdas(k)
1332 tmp1=pi*pi*esr*xnor*xnos*abs( vtr(k)-vts(k) )*orho(k)
1333 tmp2=tmpb*tmpb*olambdar(k)*(5.0*tmpb+2.0*tmpc+0.5*tmpa)
1334 tmp3=tmp1*rhosnow*tmp2
1335 pracs(k)=amin1( tmp3,qszodt(k) )
1337 !c (10) ACCRETION OF RAIN BY SNOW (Psacr): Lin (28)
1339 tmp3=tmpa*tmpa*olambdas(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1340 tmp4=tmp1*rhowater*tmp3
1341 psacr(k)=amin1( tmp4,qrzodt(k) )
1347 !***********************************************************************
1348 !********* snow production processes for T > 0 C **********
1349 !***********************************************************************
1351 if (qsz(k) .le. 0.0) go to 1400
1353 !c (1) CLOUD WATER ACCRETION BY SNOW (Psacw): Lin (24)
1357 tmp1=esw*pio4*xnos*constc*gamdp3*sqrho(k)* &
1359 psacw(k)=qlzodt(k)*( 1.0-exp(-tmp1*dtb) )
1361 !0915 tmp1=pio4*xnos*constc*gamdp3*sqrho(k)* &
1362 !0915 olambdas(k)**dp3
1363 !0915 tmp2=qlz(k)*esw*tmp1
1364 !0915 psacw(k)=amin1( tmp2,qlzodt(k) )
1366 !c (2) ACCRETION OF RAIN BY SNOW (Psacr): Lin (28)
1369 tmpa=olambdar(k)*olambdar(k)
1370 tmpb=olambdas(k)*olambdas(k)
1371 tmpc=olambdar(k)*olambdas(k)
1372 tmp1=pi*pi*esr*xnor*xnos*abs( vtr(k)-vts(k) )*orho(k)
1373 tmp2=tmpa*tmpa*olambdas(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1374 tmp3=tmp1*rhowater*tmp2
1375 psacr(k)=amin1( tmp3,qrzodt(k) )
1377 !c (3) MELTING OF SNOW (Psmlt): Lin (32)
1378 !c Psmlt is negative value
1381 term1=2.0*pi*orho(k)*( xlv*diffwv(k)*rho(k)*delrs- &
1383 tmp1=constc*sqrho(k)*olambdas(k)**dp5/visc(k)
1384 tmp2=xnos*( vf1s*olambdas(k)*olambdas(k)+ &
1385 vf2s*schmidt(k)**0.33334*gamdp5o2*sqrt(tmp1) )
1386 tmp3=term1*oxlf*tmp2-cwoxlf*temcc(k)*( psacw(k)+psacr(k) )
1387 tmp4=amin1(0.0,tmp3)
1388 psmlt(k)=amax1( tmp4,-qszodt(k) )
1390 !c (4) EVAPORATION OF MELTING SNOW (Psmltevp): HR (A27)
1391 !c but use Lin et al. coefficience
1392 !c Psmltevp is a negative value
1394 tmpa=rvapor*xka(k)*tem(k)*tem(k)
1395 tmpb=xlv*xlv*rho(k)*qswz(k)*diffwv(k)
1396 tmpc=tmpa*qswz(k)*diffwv(k)
1397 tmpd=amin1( 0.0,(qvoqswz(k)-0.90)*qswz(k)*odtb )
1399 ! abr=2.0*pi*(qvoqswz(k)-1.0)*tmpc/(tmpa+tmpb)
1401 abr=2.0*pi*(qvoqswz(k)-0.90)*tmpc/(tmpa+tmpb)
1403 !**** allow evaporation to occur when RH less than 90%
1404 !**** here not using 100% because the evaporation cooling
1405 !**** of temperature is not taking into account yet; hence,
1406 !**** the qsw value is a little bit larger. This will avoid
1407 !**** evaporation can generate cloud.
1409 !c vf1s,vf2s=ventilation factors for snow
1410 !c vf1s=0.78,vf2s=0.31 in LIN
1412 tmp1=constc*sqrho(k)*olambdas(k)**dp5/visc(k)
1413 tmp2=abr*xnos*( vf1s*olambdas(k)*olambdas(k)+ &
1414 vf2s*schmidt(k)**0.33334*gamdp5o2*sqrt(tmp1) )
1415 tmp3=amin1(0.0,tmp2)
1416 tmp3=amax1( tmp3,tmpd )
1417 psmltevp(k)=amax1( tmp3,-qszodt(k) )
1422 !***********************************************************************
1423 !********* rain production processes **********
1424 !***********************************************************************
1427 !c (1) AUTOCONVERSION OF RAIN (Praut): RH
1430 if( qndropz(k) >= 1. ) then
1431 ! Liu et al. autoconversion scheme
1433 liqconc=rhocgs*qlz(k) ! (kg/kg) to (g/cm3)
1434 capn=1.0e-3*rhocgs*qndropz(k) ! (#/kg) to (#/cm3)
1436 if(liqconc.gt.1.e-10)then
1437 p0=(kappa*beta/capn)*(liqconc*liqconc*liqconc)
1438 xc=9.7d-17*capn*sqrt(capn)/(liqconc*liqconc)
1439 ! Calculate autoconversion rate (g/g/s)
1441 praut(k)=(p0/rhocgs) * ( 0.5d0*(xc*xc+2*xc+2.0d0)* &
1442 (1.0d0+xc)*exp(-2.0d0*xc) )
1449 !c afa=0.001 Rate coefficient for autoconvergence
1455 ! tmp1=amax1( 0.0,araut*(qlz(k)-ql0) )
1456 ! praut(k)=amin1( tmp1,qlzodt(k) )
1457 tmp1=odtb*(qlz(k)-ql0)*( 1.0-exp(-araut*dtb) )
1458 praut(k)=amax1( 0.0,tmp1 )
1462 !c (2) ACCRETION OF CLOUD WATER BY RAIN (Pracw): Lin (51)
1465 ! tmp1=qlz(k)*pio4*erw*xnor*consta*sqrho(k)
1466 ! tmp2=tmp1*gambp3*olambdar(k)**bp3
1467 ! pracw(k)=amin1( tmp2,qlzodt(k) )
1469 tmp1=pio4*erw*xnor*consta*sqrho(k)* &
1470 gambp3*olambdar(k)**bp3
1471 pracw(k)=qlzodt(k)*( 1.0-exp(-tmp1*dtb) )
1474 !c (3) EVAPORATION OF RAIN (Prevp): Lin (52)
1475 !c Prevp is negative value
1477 !c Sw=qvoqsw : saturation ratio
1479 tmpa=rvapor*xka(k)*tem(k)*tem(k)
1480 tmpb=xlv*xlv*rho(k)*qswz(k)*diffwv(k)
1481 tmpc=tmpa*qswz(k)*diffwv(k)
1483 ! tmpd=amin1(0.0,(qvoqswz(k)-0.90)*qswz(k)*odtb)
1485 ! set max allowed evaporation to 90% of the amount that
1486 ! would induce saturation wrt liquid in a single step.
1487 tmpd = qswz(k)*xlv/(rvapor*tem(k)**2) ! d(qsat_liq)/dT
1488 tmpd = min( 0., 0.9*odtb*(qvz(k) + qlz(k) - qswz(k)) &
1489 / (1. + xlvocp * tmpd) )
1491 abr=2.0*pi*(qvoqswz(k)-1.0)*tmpc/(tmpa+tmpb)
1493 ! abr=2.0*pi*(qvoqswz(k)-0.90)*tmpc/(tmpa+tmpb)
1496 !c vf1r,vf2r=ventilation factors for rain
1497 !c vf1r=0.78,vf2r=0.31 in RH, LIN and MM5
1501 tmp1=consta*sqrho(k)*olambdar(k)**bp5/visc(k)
1502 tmp2=abr*xnor*( vf1r*olambdar(k)*olambdar(k)+ &
1503 vf2r*schmidt(k)**0.33334*gambp5o2*sqrt(tmp1) )
1504 tmp3=amin1( 0.0,tmp2 )
1505 tmp3=amax1( tmp3,tmpd )
1506 prevp(k)=amax1( tmp3,-qrzodt(k) )
1509 ! if(iout .gt. 0) write(20,*)'tmp1,tmp2,tmp3=',tmp1,tmp2,tmp3
1510 ! if(iout .gt. 0) write(20,*)'qlz,qiz,qrz=',qlz(k),qiz(k),qrz(k)
1511 ! if(iout .gt. 0) write(20,*)'tem,qsz,qvz=',tem(k),qsz(k),qvz(k)
1515 ! if (gindex .eq. 0.) goto 900
1517 if (tem(k) .lt. 273.15) then
1521 !***********************************************************************
1522 !********* graupel production processes for T < 0 C **********
1523 !***********************************************************************
1525 !c (1) AUTOCONVERSION OF SNOW TO FORM GRAUPEL (Pgaut): Lin (37)
1526 !c pgaut=alpha2*(qsz-qs0)
1528 !c alpha2=1.0e-3*exp(0.09*temcc(k)) Lin (38)
1530 alpha2=1.0e-3*exp(0.09*temcc(k))
1534 ! tmp1=alpha2*(qsz(k)-qs0)
1535 ! tmp1=amax1(0.0,tmp1)
1536 ! pgaut(k)=amin1( tmp1,qszodt(k) )
1538 tmp1=odtb*(qsz(k)-qs0)*(1.0-exp(-alpha2*dtb))
1539 pgaut(k)=amax1( 0.0,tmp1 )
1542 !c (2) FREEZING OF RAIN TO FORM GRAUPEL (Pgfr): Lin (45)
1544 !c Constant in Bigg freezing Aplume=Ap=0.66 /k
1545 !c Constant in raindrop freezing equ. Bplume=Bp=100./m/m/m/s
1548 if (qrz(k) .gt. 1.e-8 ) then
1551 tmp1=olambdar(k)*olambdar(k)*olambdar(k)
1552 tmp2=20.*pi*pi*Bp*xnor*rhowater*orho(k)* &
1553 (exp(-Ap*temcc(k))-1.0)*tmp1*tmp1*olambdar(k)
1554 Pgfr(k)=amin1( tmp2,qrzodt(k) )
1560 !c if (qgz(k) = 0.0) skip the other step below about graupel
1562 if (qgz(k) .eq. 0.0) goto 4000
1565 !c Comparing Pgwet(wet process) and Pdry(dry process),
1566 !c we will pick up the small one.
1570 !c | dry processes |
1573 !c (3) ACCRETION OF CLOUD WATER BY GRAUPEL (Pgacw): Lin (40)
1575 !c Cdrag=0.6 drag coefficients for hairstone
1576 !c constg=sqrt(4.*grav*rhograul*0.33334*orho(k)/Cdrag)
1579 constg=sqrt(4.*grav*rhograul*0.33334*orho(k)*oCdrag)
1580 tmp1=pio4*xnog*gam3pt5*constg*olambdag(k)**3.5
1581 tmp2=qlz(k)*egw*tmp1
1582 Pgacw(k)=amin1( tmp2,qlzodt(k) )
1584 !c (4) ACCRETION OF ICE CRYSTAL BY GRAUPEL (Pgaci): Lin (41)
1585 !c egi=1. for wet growth
1586 !c egi=0.1 for dry growth
1589 tmp2=qiz(k)*egi*tmp1
1590 pgaci(k)=amin1( tmp2,qizodt(k) )
1594 !c (5) ACCRETION OF SNOW BY GRAUPEL (Pgacs) : Lin (29)
1595 !c Compute processes (6) only when qsz > 0.0 and qgz > 0.0
1597 egs=exp(0.09*temcc(k))
1598 tmpa=olambdas(k)*olambdas(k)
1599 tmpb=olambdag(k)*olambdag(k)
1600 tmpc=olambdas(k)*olambdag(k)
1601 tmp1=pi*pi*xnos*xnog*abs( vts(k)-vtg(k) )*orho(k)
1602 tmp2=tmpa*tmpa*olambdag(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1603 tmp3=tmp1*egs*rhosnow*tmp2
1604 Pgacs(k)=amin1( tmp3,qszodt(k) )
1608 !c (6) ACCRETION OF RAIN BY GRAUPEL (Pgacr): Lin (42)
1609 !c Compute processes (6) only when qrz > 0.0 and qgz > 0.0
1613 tmpa=olambdar(k)*olambdar(k)
1614 tmpb=olambdag(k)*olambdag(k)
1615 tmpc=olambdar(k)*olambdag(k)
1616 tmp1=pi*pi*xnor*xnog*abs( vtr(k)-vtg(k) )*orho(k)
1617 tmp2=tmpa*tmpa*olambdag(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1618 tmp3=tmp1*egr*rhowater*tmp2
1619 pgacr(k)=amin1( tmp3,qrzodt(k) )
1622 !c (7) Calculate total dry process effect Pdry(k)
1624 Pdry(k)=Pgacw(k)+pgaci(k)+Pgacs(k)+pgacr(k)
1627 !c | wet processes |
1630 !c (3) ACCRETION OF ICE CRYSTAL BY GRAUPEL (Pgacip): Lin (41)
1631 !c egi=1. for wet growth
1632 !c egi=0.1 for dry growth
1635 pgacip(k)=amin1( tmp2,qizodt(k) )
1638 !c (4) ACCRETION OF SNOW BY GRAUPEL ((Pgacsp) : Lin (29)
1639 !c Compute processes (6) only when qsz > 0.0 and qgz > 0.0
1640 !c egs=exp(0.09*(tem(k)-273.15)) when T < 273.15 k
1642 tmp3=Pgacs(k)*1.0/egs
1643 Pgacsp(k)=amin1( tmp3,qszodt(k) )
1646 !c (5) WET GROWTH OF GRAUPEL (Pgwet) : Lin (43)
1647 !c may involve Pgacs or Pgaci and
1648 !c must include PPgacw or Pgacr, or both.
1649 !c ( The amount of Pgacw which is not able
1650 !c to freeze is shed to rain. )
1651 IF(temcc(k).gt.-40.)THEN
1653 term0=constg*olambdag(k)**5.5/visc(k)
1656 !c vf1s,vf2s=ventilation factors for graupel
1657 !c vf1s=0.78,vf2s=0.31 in LIN
1658 !c Cdrag=0.6 drag coefficient for hairstone
1659 !c constg2=vf1s*olambdag(k)*olambdag(k)+
1660 !c vf2s*schmidt(k)**0.33334*gam2pt75*sqrt(term0)
1663 tmp0=1./(xlf+cw*temcc(k))
1664 tmp1=2.*pi*xnog*(rho(k)*xlv*diffwv(k)*delrs-xka(k)* &
1665 temcc(k))*orho(k)*tmp0
1666 constg2=vf1s*olambdag(k)*olambdag(k)+ &
1667 vf2s*schmidt(k)**0.33334*gam2pt75*sqrt(term0)
1668 tmp3=tmp1*constg2+(Pgacip(k)+Pgacsp(k))* &
1669 (1-Ci*temcc(k)*tmp0)
1670 tmp3=amax1(0.0,tmp3)
1671 Pgwet(k)=amin1(tmp3,qlzodt(k)+qszodt(k)+qizodt(k) ) !bloss
1674 !c Comparing Pgwet(wet process) and Pdry(dry process),
1675 !c we will apply the small one.
1676 !c if dry processes then delta4=1.0
1677 !c if wet processes then delta4=0.0
1679 if ( Pdry(k) .lt. Pgwet(k) ) then
1690 !c (6) Pgacrp(k)=Pgwet(k)-Pgacw(k)-Pgacip(k)-Pgacsp(k)
1691 !c if Pgacrp(k) > 0. then some of the rain is frozen to hail
1692 !c if Pgacrp(k) < 0. then some of the cloud water collected
1693 !c by the hail is unable to freeze and is
1696 Pgacrp(k)=Pgwet(k)-Pgacw(k)-Pgacip(k)-Pgacsp(k)
1699 !c (8) DEPOSITION/SUBLIMATION OF GRAUPEL (Pgdep/Pgsub): Lin (46)
1700 !c includes ventilation effect
1701 !c constg=sqrt(4.*grav*rhograul*0.33334*orho(k)/Cdrag)
1702 !c constg2=vf1s*olambdag(k)*olambdag(k)+
1703 !c vf2s*schmidt(k)**0.33334*gam2pt75*constg
1705 !c abg=2*pi*(Si-1)/rho/(A"+B")
1707 tmpa=rvapor*xka(k)*tem(k)*tem(k)
1708 tmpb=xls*xls*rho(k)*qsiz(k)*diffwv(k)
1709 tmpc=tmpa*qsiz(k)*diffwv(k)
1710 abg=2.0*pi*(qvoqsiz(k)-1.0)*tmpc/(tmpa+tmpb)
1712 !c vf1s,vf2s=ventilation factors for graupel
1713 !c vf1s=0.78,vf2s=0.31 in LIN
1714 !c Cdrag=0.6 drag coefficient for hairstone
1716 term0=constg*olambdag(k)**5.5/visc(k)
1717 constg2=vf1s*olambdag(k)*olambdag(k)+ &
1718 vf2s*schmidt(k)**0.33334*gam2pt75*sqrt(term0)
1719 tmp2=abg*xnog*constg2
1720 pgdep(k)=amax1(0.0,tmp2)
1721 pgsub(k)=amin1(0.0,tmp2)
1722 pgsub(k)=amax1( pgsub(k),-qgzodt(k) )
1727 !***********************************************************************
1728 !********* graupel production processes for T > 0 C **********
1729 !***********************************************************************
1732 !c (1) ACCRETION OF CLOUD WATER BY GRAUPEL (Pgacw): Lin (40)
1734 !c Cdrag=0.6 drag coefficients for hairstone
1735 !c constg=sqrt(4.*grav*rhograul*0.33334*orho(k)/Cdrag)
1738 constg=sqrt(4.*grav*rhograul*0.33334*orho(k)*oCdrag)
1739 tmp1=pio4*xnog*gam3pt5*constg*olambdag(k)**3.5
1740 tmp2=qlz(k)*egw*tmp1
1741 Pgacw(k)=amin1( tmp2,qlzodt(k) )
1744 !c (2) ACCRETION OF RAIN BY GRAUPEL (Pgacr): Lin (42)
1745 !c Compute processes (5) only when qrz > 0.0 and qgz > 0.0
1749 tmpa=olambdar(k)*olambdar(k)
1750 tmpb=olambdag(k)*olambdag(k)
1751 tmpc=olambdar(k)*olambdag(k)
1752 tmp1=pi*pi*xnor*xnog*abs( vtr(k)-vtg(k) )*orho(k)
1753 tmp2=tmpa*tmpa*olambdag(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1754 tmp3=tmp1*egr*rhowater*tmp2
1755 pgacr(k)=amin1( tmp3,qrzodt(k) )
1759 !c (3) GRAUPEL MELTING TO FORM RAIN (Pgmlt): Lin (47)
1760 !c Pgmlt is negative value
1761 !c constg=sqrt(4.*grav*rhograul*0.33334*orho(k)/Cdrag)
1762 !c constg2=vf1s*olambdag(k)*olambdag(k)+
1763 !c vf2s*schmidt(k)**0.33334*gam2pt75*constg
1764 !c Cdrag=0.6 drag coefficients for hairstone
1767 term1=2.0*pi*orho(k)*( xlv*diffwv(k)*rho(k)*delrs- &
1769 term0=sqrt(4.*grav*rhograul*0.33334*orho(k)*ocdrag) &
1770 *olambdag(k)**5.5/visc(k)
1772 constg2=vf1s*olambdag(k)*olambdag(k)+ &
1773 vf2s*schmidt(k)**0.33334*gam2pt75*sqrt(term0)
1775 tmp3=term1*oxlf*tmp2-cwoxlf*temcc(k)*( pgacw(k)+pgacr(k) )
1776 tmp4=amin1(0.0,tmp3)
1777 pgmlt(k)=amax1( tmp4,-qgzodt(k) )
1781 !c (4) EVAPORATION OF MELTING GRAUPEL (Pgmltevp) : HR (A19)
1782 !c but use Lin et al. coefficience
1783 !c Pgmltevp is a negative value
1784 !c abg=2.0*pi*(qvoqsiz(k)-1.0)*tmpc/(tmpa+tmpb)
1786 tmpa=rvapor*xka(k)*tem(k)*tem(k)
1787 tmpb=xlv*xlv*rho(k)*qswz(k)*diffwv(k)
1788 tmpc=tmpa*qswz(k)*diffwv(k)
1789 tmpd=amin1( 0.0,(qvoqswz(k)-0.90)*qswz(k)*odtb )
1792 !c abg=2*pi*(Si-1)/rho/(A"+B")
1794 abg=2.0*pi*(qvoqswz(k)-0.90)*tmpc/(tmpa+tmpb)
1796 !**** allow evaporation to occur when RH less than 90%
1797 !**** here not using 100% because the evaporation cooling
1798 !**** of temperature is not taking into account yet; hence,
1799 !**** the qgw value is a little bit larger. This will avoid
1800 !**** evaporation can generate cloud.
1802 !c vf1s,vf2s=ventilation factors for snow
1803 !c vf1s=0.78,vf2s=0.31 in LIN
1804 !c constg=sqrt(4.*grav*rhograul*0.33334*orho(k)/Cdrag)
1805 !c constg2=vf1s*olambdag(k)*olambdag(k)+
1806 !c vf2s*schmidt(k)**0.33334*gam2pt75*constg
1808 tmp2=abg*xnog*constg2
1809 tmp3=amin1(0.0,tmp2)
1810 tmp3=amax1( tmp3,tmpd )
1811 pgmltevp(k)=amax1( tmp3,-qgzodt(k) )
1814 !c (5) ACCRETION OF SNOW BY GRAUPEL (Pgacs) : Lin (29)
1815 !c Compute processes (3) only when qsz > 0.0 and qgz > 0.0
1819 tmpa=olambdas(k)*olambdas(k)
1820 tmpb=olambdag(k)*olambdag(k)
1821 tmpc=olambdas(k)*olambdag(k)
1822 tmp1=pi*pi*xnos*xnog*abs( vts(k)-vtg(k) )*orho(k)
1823 tmp2=tmpa*tmpa*olambdag(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1824 tmp3=tmp1*egs*rhosnow*tmp2
1825 Pgacs(k)=amin1( tmp3,qszodt(k) )
1835 !c**********************************************************************
1836 !c***** combine all processes together and avoid negative *****
1837 !c***** water substances
1838 !***********************************************************************
1840 if ( temcc(k) .lt. 0.0) then
1843 !c gdelta4=gindex*delta4
1844 !c g1sdelt4=gindex*(1.-delta4)
1846 gdelta4=gindex*delta4
1847 g1sdelt4=gindex*(1.-delta4)
1849 !c combined water vapor depletions
1852 tmp=psdep(k)+pgdep(k)*gindex
1853 if ( tmp .gt. qvzodt(k) ) then
1854 factor=qvzodt(k)/tmp
1855 psdep(k)=psdep(k)*factor
1856 pgdep(k)=pgdep(k)*factor*gindex
1859 !c combined cloud water depletions
1861 tmp=praut(k)+psacw(k)+psfw(k)+pracw(k)+gindex*Pgacw(k)
1862 if ( tmp .gt. qlzodt(k) ) then
1863 factor=qlzodt(k)/tmp
1864 praut(k)=praut(k)*factor
1865 psacw(k)=psacw(k)*factor
1866 psfw(k)=psfw(k)*factor
1867 pracw(k)=pracw(k)*factor
1869 Pgacw(k)=Pgacw(k)*factor*gindex
1872 !c combined cloud ice depletions
1874 tmp=psaut(k)+psaci(k)+praci(k)+psfi(k)+Pgaci(k)*gdelta4 &
1876 if (tmp .gt. qizodt(k) ) then
1877 factor=qizodt(k)/tmp
1878 psaut(k)=psaut(k)*factor
1879 psaci(k)=psaci(k)*factor
1880 praci(k)=praci(k)*factor
1881 psfi(k)=psfi(k)*factor
1883 Pgaci(k)=Pgaci(k)*factor*gdelta4
1884 Pgacip(k)=Pgacip(k)*factor*g1sdelt4
1887 !c combined all rain processes
1889 tmp_r=piacr(k)+psacr(k)-prevp(k)-praut(k)-pracw(k) &
1890 +Pgfr(k)*gindex+Pgacr(k)*gdelta4 &
1892 if (tmp_r .gt. qrzodt(k) ) then
1893 factor=qrzodt(k)/tmp_r
1894 piacr(k)=piacr(k)*factor
1895 psacr(k)=psacr(k)*factor
1896 prevp(k)=prevp(k)*factor
1898 Pgfr(k)=Pgfr(k)*factor*gindex
1899 Pgacr(k)=Pgacr(k)*factor*gdelta4
1900 Pgacrp(k)=Pgacrp(k)*factor*g1sdelt4
1904 !c if qrz < 1.0E-4 and qsz < 1.0E-4 then delta2=1.
1905 !c (all Pracs and Psacr become to snow)
1906 !c if qrz >= 1.0E-4 or qsz >= 1.0E-4 then delta2=0.
1907 !c (all Pracs and Psacr become to graupel)
1909 if (qrz(k) .lt. 1.0E-4 .and. qsz(k) .lt. 1.0E-4) then
1918 !c if qrz(k) < 1.0e-4 then delta3=1. means praci(k) --> qs
1920 !c if qrz(k) > 1.0e-4 then delta3=0. means praci(k) --> qg
1921 !c piacr(k) --> qg : Lin (20)
1923 if (qrz(k) .lt. 1.0e-4) then
1930 !c if gindex = 0.(no graupel) then delta2=1.0
1933 if (gindex .eq. 0.) then
1939 !c combined all snow processes
1941 tmp_s=-pssub(k)-(psaut(k)+psaci(k)+psacw(k)+psfw(k)+ &
1942 psfi(k)+praci(k)*delta3+piacr(k)*delta3+ &
1943 psdep(k))+Pgaut(k)*gindex+Pgacs(k)*gdelta4+ &
1944 Pgacsp(k)*g1sdelt4+Pracs(k)*(1.-delta2)- &
1946 if ( tmp_s .gt. qszodt(k) ) then
1947 factor=qszodt(k)/tmp_s
1948 pssub(k)=pssub(k)*factor
1949 Pracs(k)=Pracs(k)*factor
1951 Pgaut(k)=Pgaut(k)*factor*gindex
1952 Pgacs(k)=Pgacs(k)*factor*gdelta4
1953 Pgacsp(k)=Pgacsp(k)*factor*g1sdelt4
1959 ! if (gindex .eq. 0.) goto 998
1961 !c combined all graupel processes
1963 if(delta4.lt.0.5) then
1964 !Re-define pgwet to account for limiting of pgacrp,
1965 ! pgacip, pgacw and pgacsp above
1966 pgwet(k) = pgacrp(k) + pgacw(k) + pgacip(k) + pgacsp(k)
1968 tmp_g=-pgaut(k)-pgfr(k)-Pgacw(k)*delta4-Pgaci(k)*delta4 &
1969 -Pgacr(k)*delta4-Pgacs(k)*delta4 &
1970 -pgwet(k)*(1.-delta4)-pgsub(k)-pgdep(k) &
1971 -psacr(k)*(1-delta2)-Pracs(k)*(1-delta2) &
1972 -praci(k)*(1-delta3)-piacr(k)*(1-delta3)
1973 if (tmp_g .gt. qgzodt(k)) then
1974 factor=qgzodt(k)/tmp_g
1975 pgsub(k)=pgsub(k)*factor
1980 !c calculate new water substances, thetae, tem, and qvsbar
1984 pvapor(k)=-pssub(k)-psdep(k)-prevp(k)-pgsub(k)*gindex &
1986 qvz(k)=amax1( qvmin,qvz(k)+dtb*pvapor(k) )
1987 pclw(k)=-praut(k)-pracw(k)-psacw(k)-psfw(k)-pgacw(k)*gindex
1989 if( qlz(k) > 1e-20 ) &
1990 qndropz(k)=amax1( 0.0,qndropz(k)+dtb*pclw(k)*qndropz(k)/qlz(k) ) !sg
1992 qlz(k)=amax1( 0.0,qlz(k)+dtb*pclw(k) )
1993 pcli(k)=-psaut(k)-psfi(k)-psaci(k)-praci(k)-pgaci(k)*gdelta4 &
1995 qiz(k)=amax1( 0.0,qiz(k)+dtb*pcli(k) )
1996 tmp_r=piacr(k)+psacr(k)-prevp(k)-praut(k)-pracw(k) &
1997 +Pgfr(k)*gindex+Pgacr(k)*gdelta4 &
1999 232 format(i2,1x,6(f9.3,1x))
2001 qrz(k)=amax1( 0.0,qrz(k)+dtb*prain(k) )
2002 tmp_s=-pssub(k)-(psaut(k)+psaci(k)+psacw(k)+psfw(k)+ &
2003 psfi(k)+praci(k)*delta3+piacr(k)*delta3+ &
2004 psdep(k))+Pgaut(k)*gindex+Pgacs(k)*gdelta4+ &
2005 Pgacsp(k)*g1sdelt4+Pracs(k)*(1.-delta2)- &
2008 qsz(k)=amax1( 0.0,qsz(k)+dtb*psnow(k) )
2009 qschg(k)=qschg(k)+psnow(k)
2012 tmp_g=-pgaut(k)-pgfr(k)-Pgacw(k)*delta4-Pgaci(k)*delta4 &
2013 -Pgacr(k)*delta4-Pgacs(k)*delta4 &
2014 -pgwet(k)*(1.-delta4)-pgsub(k)-pgdep(k) &
2015 -psacr(k)*(1-delta2)-Pracs(k)*(1-delta2) &
2016 -praci(k)*(1-delta3)-piacr(k)*(1-delta3)
2017 252 format(i2,1x,6(f12.9,1x))
2018 262 format(i2,1x,7(f12.9,1x))
2020 pgraupel(k)=pgraupel(k)*gindex
2021 qgz(k)=amax1( 0.0,qgz(k)+dtb*pgraupel(k))
2022 ! qgchg(k)=qgchg(k)+pgraupel(k)
2023 qgchg(k)=pgraupel(k)
2024 qgz(k)=qgz(k)*gindex
2026 tmp=ocp/tothz(k)*xLf*(qschg(k)+qgchg(k))
2027 theiz(k)=theiz(k)+dtb*tmp
2028 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2029 tem(k)=thz(k)*tothz(k)
2031 temcc(k)=tem(k)-273.15
2033 !bloss: Moves computation of saturation mixing ratio below
2035 ! if( temcc(k) .lt. -40.0 ) qswz(k)=qsiz(k)
2036 ! qlpqi=qlz(k)+qiz(k)
2037 ! if ( qlpqi .eq. 0.0 ) then
2040 ! qvsbar(k)=( qiz(k)*qsiz(k)+qlz(k)*qswz(k) )/qlpqi
2046 !c combined cloud water depletions
2048 tmp=praut(k)+psacw(k)+pracw(k)+pgacw(k)*gindex
2049 if ( tmp .gt. qlzodt(k) ) then
2050 factor=qlzodt(k)/tmp
2051 praut(k)=praut(k)*factor
2052 psacw(k)=psacw(k)*factor
2053 pracw(k)=pracw(k)*factor
2055 pgacw(k)=pgacw(k)*factor*gindex
2058 !c combined all snow processes
2060 tmp_s=-(psmlt(k)+psmltevp(k))+Pgacs(k)*gindex
2061 if (tmp_s .gt. qszodt(k) ) then
2062 factor=qszodt(k)/tmp_s
2063 psmlt(k)=psmlt(k)*factor
2064 psmltevp(k)=psmltevp(k)*factor
2066 Pgacs(k)=Pgacs(k)*factor*gindex
2073 ! if (gindex .eq. 0.) goto 997
2076 !c combined all graupel processes
2078 tmp_g=-pgmlt(k)-pgacs(k)-pgmltevp(k)
2079 if (tmp_g .gt. qgzodt(k)) then
2080 factor=qgzodt(k)/tmp_g
2081 pgmltevp(k)=pgmltevp(k)*factor
2082 pgmlt(k)=pgmlt(k)*factor
2088 !c combined all rain processes
2090 tmp_r=-prevp(k)-(praut(k)+pracw(k)+psacw(k)-psmlt(k)) &
2091 +pgmlt(k)*gindex-pgacw(k)*gindex
2092 if (tmp_r .gt. qrzodt(k) ) then
2093 factor=qrzodt(k)/tmp_r
2094 prevp(k)=prevp(k)*factor
2098 !c calculate new water substances and thetae
2102 pvapor(k)=-psmltevp(k)-prevp(k)-pgmltevp(k)*gindex
2103 qvz(k)=amax1( qvmin,qvz(k)+dtb*pvapor(k))
2104 pclw(k)=-praut(k)-pracw(k)-psacw(k)-pgacw(k)*gindex
2106 if( qlz(k) > 1e-20 ) &
2107 qndropz(k)=amax1( 0.0,qndropz(k)+dtb*pclw(k)*qndropz(k)/qlz(k) ) !sg
2109 qlz(k)=amax1( 0.0,qlz(k)+dtb*pclw(k) )
2111 qiz(k)=amax1( 0.0,qiz(k)+dtb*pcli(k) )
2112 tmp_r=-prevp(k)-(praut(k)+pracw(k)+psacw(k)-psmlt(k)) &
2113 +pgmlt(k)*gindex-pgacw(k)*gindex
2114 242 format(i2,1x,7(f9.6,1x))
2117 qrz(k)=amax1( 0.0,qrz(k)+dtb*prain(k) )
2118 tmp_s=-(psmlt(k)+psmltevp(k))+Pgacs(k)*gindex
2120 qsz(k)=amax1( 0.0,qsz(k)+dtb*psnow(k) )
2121 ! qschg(k)=qschg(k)+psnow(k)
2125 tmp_g=-pgmlt(k)-pgacs(k)-pgmltevp(k)
2126 ! write(*,272)k,pgmlt(k),pgacs(k),pgmltevp(k),
2127 272 format(i2,1x,3(f12.9,1x))
2128 pgraupel(k)=-tmp_g*gindex
2129 qgz(k)=amax1( 0.0,qgz(k)+dtb*pgraupel(k))
2130 ! qgchg(k)=qgchg(k)+pgraupel(k)
2131 qgchg(k)=pgraupel(k)
2132 qgz(k)=qgz(k)*gindex
2134 tmp=ocp/tothz(k)*xLf*(qschg(k)+qgchg(k))
2135 theiz(k)=theiz(k)+dtb*tmp
2136 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2138 tem(k)=thz(k)*tothz(k)
2139 temcc(k)=tem(k)-273.15
2140 ! qswz(k)=episp0k*oprez(k)* &
2141 ! exp( svp2*temcc(k)/(tem(k)-svp3) )
2143 !bloss: Moved computation of saturation mixing ratio below
2145 ! es=1000.*svp1*exp( svp2*temcc(k)/(tem(k)-svp3) )
2146 ! qswz(k)=ep2*es/(prez(k)-es)
2151 preclw(k)=pclw(k) !sg
2154 !***********************************************************************
2155 !********** saturation adjustment **********
2156 !***********************************************************************
2159 ! compute saturation specific humidity at the temperature
2160 ! which would be experienced if all cloud liquid and ice
2161 ! were to become vapor. This will make for a consistent
2162 ! check of saturation. Previously, qvsbar was computed
2163 ! without accounting for the change in temperature due to
2164 ! evaporation/sublimation, and as a result would
2165 ! incorrectly identify some points as subsaturated.
2167 tmp_tem = tem(k) ! updated temperature from above.
2169 if(qlz(k)+qiz(k).gt. 0.) then
2170 ! account for latent heat if all qlz and qiz were converted to vapor
2171 tmp_tem = tem(k) - xlvocp*qlz(k) - (xlvocp+xlfocp)*qiz(k)
2174 ! compute temperature in celsius
2175 tmp_temcc = tmp_tem - 273.15
2177 ! estimate lower bound on saturation vapor pressure
2178 ! (ice if <0C, liquid aboce)
2179 if (tmp_temcc .lt. 0.) then
2180 es=1000.*svp1*exp( 21.8745584*(tmp_tem-273.16)/(tmp_tem-7.66) ) !ice
2182 es=1000.*svp1*exp( svp2*tmp_temcc/(tmp_tem-svp3) ) !liquid
2185 ! compute lower bound on saturation mixing ratio.
2186 qvsbar(k)=ep2*es/(prez(k)-es)
2190 ! allow supersaturation exits linearly from 0% at 500 mb to 50%
2192 ! 5.0e-5=1.0/(500mb-300mb)
2194 rsat=1.0+0.5*(50000.0-prez(k))*5.0e-5
2195 rsat=amax1(1.0,rsat)
2196 rsat=amin1(1.5,rsat)
2198 if( qvz(k)+qlz(k)+qiz(k) .lt. rsat*qvsbar(k) ) then
2203 qvz(k)=qvz(k)+qlz(k)+qiz(k)
2207 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2208 tem(k)=thz(k)*tothz(k)
2209 temcc(k)=tem(k)-273.15
2222 CALL satadj(qvz, qlz, qiz, prez, theiz, thz, tothz, kts, kte, &
2223 k, xLvocp, xLfocp, episp0k, EP2,SVP1,SVP2,SVP3,SVPT0 )
2226 pladj(k)=odtb*(qlz(k)-pladj(k))
2227 piadj(k)=odtb*(qiz(k)-piadj(k))
2229 pclw(k)=pclw(k)+pladj(k)
2230 pcli(k)=pcli(k)+piadj(k)
2231 pvapor(k)=pvapor(k)-( pladj(k)+piadj(k) )
2233 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2234 tem(k)=thz(k)*tothz(k)
2236 temcc(k)=tem(k)-273.15
2238 ! qswz(k)=episp0k*oprez(k)* &
2239 ! exp( svp2*temcc(k)/(tem(k)-svp3) )
2240 es=1000.*svp1*exp( svp2*temcc(k)/(tem(k)-svp3) )
2241 qswz(k)=ep2*es/(prez(k)-es)
2242 if (tem(k) .lt. 273.15 ) then
2243 ! qsiz(k)=episp0k*oprez(k)* &
2244 ! exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
2245 es=1000.*svp1*exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
2246 qsiz(k)=ep2*es/(prez(k)-es)
2247 if (temcc(k) .lt. -40.0) qswz(k)=qsiz(k)
2252 if ( qlpqi .eq. 0.0 ) then
2255 qvsbar(k)=( qiz(k)*qsiz(k)+qlz(k)*qswz(k) )/qlpqi
2261 !***********************************************************************
2262 !***** melting and freezing of cloud ice and cloud water *****
2263 !***********************************************************************
2265 if(qlpqi .le. 0.0) go to 1800
2268 !c (1) HOMOGENEOUS NUCLEATION WHEN T< -40 C (Pihom)
2270 if(temcc(k) .lt. -40.0) pihom(k)=qlz(k)*odtb
2272 !c (2) MELTING OF ICE CRYSTAL WHEN T> 0 C (Pimlt)
2274 if(temcc(k) .gt. 0.0) pimlt(k)=qiz(k)*odtb
2276 !c (3) PRODUCTION OF CLOUD ICE BY BERGERON PROCESS (Pidw): Hsie (p957)
2277 !c this process only considered when -31 C < T < 0 C
2279 if(temcc(k) .lt. 0.0 .and. temcc(k) .gt. -31.0) then
2281 !c! parama1 and parama2 functions must be user supplied
2283 a1=parama1( temcc(k) )
2284 a2=parama2( temcc(k) )
2285 !! change unit from cgs to mks
2286 a1=a1*0.001**(1.0-a2)
2287 xnin=xni0*exp(-bni*temcc(k))
2288 pidw(k)=xnin*orho(k)*(a1*xmnin**a2)
2291 pcli(k)=pcli(k)+pihom(k)-pimlt(k)+pidw(k)
2292 pclw(k)=pclw(k)-pihom(k)+pimlt(k)-pidw(k)
2293 qlz(k)=amax1( 0.0,qlz(k)+dtb*(-pihom(k)+pimlt(k)-pidw(k)) )
2294 qiz(k)=amax1( 0.0,qiz(k)+dtb*(pihom(k)-pimlt(k)+pidw(k)) )
2297 CALL satadj(qvz, qlz, qiz, prez, theiz, thz, tothz, kts, kte, &
2298 k, xLvocp, xLfocp, episp0k ,EP2,SVP1,SVP2,SVP3,SVPT0)
2300 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2301 tem(k)=thz(k)*tothz(k)
2303 temcc(k)=tem(k)-273.15
2305 ! qswz(k)=episp0k*oprez(k)* &
2306 ! exp( svp2*temcc(k)/(tem(k)-svp3) )
2307 es=1000.*svp1*exp( svp2*temcc(k)/(tem(k)-svp3) )
2308 qswz(k)=ep2*es/(prez(k)-es)
2310 if (tem(k) .lt. 273.15 ) then
2311 ! qsiz(k)=episp0k*oprez(k)* &
2312 ! exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
2313 es=1000.*svp1*exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
2314 qsiz(k)=ep2*es/(prez(k)-es)
2315 if (temcc(k) .lt. -40.0) qswz(k)=qsiz(k)
2320 if ( qlpqi .eq. 0.0 ) then
2323 qvsbar(k)=( qiz(k)*qsiz(k)+qlz(k)*qswz(k) )/qlpqi
2328 !***********************************************************************
2329 !********** integrate the productions of rain and snow **********
2330 !***********************************************************************
2336 !---------------------------------------------------------------------
2339 !***********************************************************************
2340 !****** Write terms in cloud physics to time series dataset *****
2341 !***********************************************************************
2343 ! open(unit=24,form='formatted',status='new',
2344 ! & file='cloud.dat')
2346 !9030 format(10e12.6)
2349 ! write(24,9030) (tem(k),k=kts+1,kte)
2351 ! write(24,9030) (qiz(k),k=kts+1,kte)
2353 ! write(24,9030) (qsz(k),k=kts+1,kte)
2355 ! write(24,9030) (qrz(k),k=kts+1,kte)
2357 ! write(24,9030) (qgz(k),k=kts+1,kte)
2358 ! write(24,*)'qvoqsw'
2359 ! write(24,9030) (qvoqswz(k),k=kts+1,kte)
2360 ! write(24,*)'qvoqsi'
2361 ! write(24,9030) (qvoqsiz(k),k=kts+1,kte)
2363 ! write(24,9030) (vtr(k),k=kts+1,kte)
2365 ! write(24,9030) (vts(k),k=kts+1,kte)
2367 ! write(24,9030) (vtg(k),k=kts+1,kte)
2369 ! write(24,9030) (pclw(k),k=kts+1,kte)
2370 ! write(24,*)'pvapor'
2371 ! write(24,9030) (pvapor(k),k=kts+1,kte)
2373 ! write(24,9030) (pcli(k),k=kts+1,kte)
2374 ! write(24,*)'pimlt'
2375 ! write(24,9030) (pimlt(k),k=kts+1,kte)
2376 ! write(24,*)'pihom'
2377 ! write(24,9030) (pihom(k),k=kts+1,kte)
2379 ! write(24,9030) (pidw(k),k=kts+1,kte)
2380 ! write(24,*)'prain'
2381 ! write(24,9030) (prain(k),k=kts+1,kte)
2382 ! write(24,*)'praut'
2383 ! write(24,9030) (praut(k),k=kts+1,kte)
2384 ! write(24,*)'pracw'
2385 ! write(24,9030) (pracw(k),k=kts+1,kte)
2386 ! write(24,*)'prevp'
2387 ! write(24,9030) (prevp(k),k=kts+1,kte)
2388 ! write(24,*)'psnow'
2389 ! write(24,9030) (psnow(k),k=kts+1,kte)
2390 ! write(24,*)'psaut'
2391 ! write(24,9030) (psaut(k),k=kts+1,kte)
2393 ! write(24,9030) (psfw(k),k=kts+1,kte)
2395 ! write(24,9030) (psfi(k),k=kts+1,kte)
2396 ! write(24,*)'praci'
2397 ! write(24,9030) (praci(k),k=kts+1,kte)
2398 ! write(24,*)'piacr'
2399 ! write(24,9030) (piacr(k),k=kts+1,kte)
2400 ! write(24,*)'psaci'
2401 ! write(24,9030) (psaci(k),k=kts+1,kte)
2402 ! write(24,*)'psacw'
2403 ! write(24,9030) (psacw(k),k=kts+1,kte)
2404 ! write(24,*)'psdep'
2405 ! write(24,9030) (psdep(k),k=kts+1,kte)
2406 ! write(24,*)'pssub'
2407 ! write(24,9030) (pssub(k),k=kts+1,kte)
2408 ! write(24,*)'pracs'
2409 ! write(24,9030) (pracs(k),k=kts+1,kte)
2410 ! write(24,*)'psacr'
2411 ! write(24,9030) (psacr(k),k=kts+1,kte)
2412 ! write(24,*)'psmlt'
2413 ! write(24,9030) (psmlt(k),k=kts+1,kte)
2414 ! write(24,*)'psmltevp'
2415 ! write(24,9030) (psmltevp(k),k=kts+1,kte)
2416 ! write(24,*)'pladj'
2417 ! write(24,9030) (pladj(k),k=kts+1,kte)
2418 ! write(24,*)'piadj'
2419 ! write(24,9030) (piadj(k),k=kts+1,kte)
2420 ! write(24,*)'pgraupel'
2421 ! write(24,9030) (pgraupel(k),k=kts+1,kte)
2422 ! write(24,*)'pgaut'
2423 ! write(24,9030) (pgaut(k),k=kts+1,kte)
2425 ! write(24,9030) (pgfr(k),k=kts+1,kte)
2426 ! write(24,*)'pgacw'
2427 ! write(24,9030) (pgacw(k),k=kts+1,kte)
2428 ! write(24,*)'pgaci'
2429 ! write(24,9030) (pgaci(k),k=kts+1,kte)
2430 ! write(24,*)'pgacr'
2431 ! write(24,9030) (pgacr(k),k=kts+1,kte)
2432 ! write(24,*)'pgacs'
2433 ! write(24,9030) (pgacs(k),k=kts+1,kte)
2434 ! write(24,*)'pgacip'
2435 ! write(24,9030) (pgacip(k),k=kts+1,kte)
2436 ! write(24,*)'pgacrP'
2437 ! write(24,9030) (pgacrP(k),k=kts+1,kte)
2438 ! write(24,*)'pgacsp'
2439 ! write(24,9030) (pgacsp(k),k=kts+1,kte)
2440 ! write(24,*)'pgwet'
2441 ! write(24,9030) (pgwet(k),k=kts+1,kte)
2443 ! write(24,9030) (pdry(k),k=kts+1,kte)
2444 ! write(24,*)'pgsub'
2445 ! write(24,9030) (pgsub(k),k=kts+1,kte)
2446 ! write(24,*)'pgdep'
2447 ! write(24,9030) (pgdep(k),k=kts+1,kte)
2448 ! write(24,*)'pgmlt'
2449 ! write(24,9030) (pgmlt(k),k=kts+1,kte)
2450 ! write(24,*)'pgmltevp'
2451 ! write(24,9030) (pgmltevp(k),k=kts+1,kte)
2455 !**** below if qv < qvmin then qv=qvmin, ql=0.0, and qi=0.0
2458 if ( qvz(k) .lt. qvmin ) then
2461 qvz(k)=amax1( qvmin,qvz(k)+qlz(k)+qiz(k) )
2465 END SUBROUTINE clphy1d
2468 !---------------------------------------------------------------------
2469 ! SATURATED ADJUSTMENT
2470 !---------------------------------------------------------------------
2471 SUBROUTINE satadj(qvz, qlz, qiz, prez, theiz, thz, tothz, &
2472 kts, kte, k, xLvocp, xLfocp, episp0k, EP2,SVP1,SVP2,SVP3,SVPT0)
2473 !---------------------------------------------------------------------
2475 !---------------------------------------------------------------------
2476 ! This program use Newton's method for finding saturated temperature
2477 ! and saturation mixing ratio.
2479 ! In this saturation adjustment scheme we assume
2480 ! (1) the saturation mixing ratio is the mass weighted average of
2481 ! saturation values over liquid water (qsw), and ice (qsi)
2482 ! following Lord et al., 1984 and Tao, 1989
2484 ! (2) the percentage of cloud liquid and cloud ice will
2485 ! be fixed during the saturation calculation
2486 !---------------------------------------------------------------------
2489 INTEGER, INTENT(IN ) :: kts, kte, k
2491 REAL, DIMENSION( kts:kte ), &
2492 INTENT(INOUT) :: qvz, qlz, qiz
2494 REAL, DIMENSION( kts:kte ), &
2495 INTENT(IN ) :: prez, theiz, tothz
2497 REAL, INTENT(IN ) :: xLvocp, xLfocp, episp0k
2498 REAL, INTENT(IN ) :: EP2,SVP1,SVP2,SVP3,SVPT0
2504 REAL, DIMENSION( kts:kte ) :: thz, tem, temcc, qsiz, &
2507 REAL :: qsat, qlpqi, ratql, t0, t1, tmp1, ratqi, tsat, absft, &
2508 denom1, denom2, dqvsbar, ftsat, dftsat, qpz, &
2511 REAL :: tem_noliqice, qsat_noliqice !bloss
2513 !---------------------------------------------------------------------
2515 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2517 tem(k)=tothz(k)*thz(k)
2520 tem_noliqice = tem(k) - xlvocp*qlz(k) - (xLvocp+xLfocp)*qiz(k)
2522 if (tem_noliqice .gt. 273.15) then
2523 es=1000.*svp1*exp( svp2*(tem_noliqice-svpt0)/(tem_noliqice-svp3) )
2524 qsat_noliqice=ep2*es/(prez(k)-es)
2526 qsat_noliqice=episp0k/prez(k)* &
2527 exp( 21.8745584*(tem_noliqice-273.15)/(tem_noliqice-7.66) )
2530 qpz=qvz(k)+qlz(k)+qiz(k)
2531 if (qpz .lt. qsat_noliqice) then
2538 if( qlpqi .ge. 1.0e-5) then
2545 tmp1=( t0-tem(k) )/(t0-t1)
2546 tmp1=amin1(1.0,tmp1)
2547 tmp1=amax1(0.0,tmp1)
2553 !-- saturation mixing ratios over water and ice
2554 !-- at the outset we will follow Bolton 1980 MWR for
2555 !-- the water and Murray JAS 1967 for the ice
2557 !-- dqvsbar=d(qvsbar)/dT
2559 !-- dftsat=d(F(T))/dT
2561 ! First guess of tsat
2567 denom1=1.0/(tsat-svp3)
2568 denom2=1.0/(tsat-7.66)
2569 ! qswz(k)=episp0k/prez(k)* &
2570 ! exp( svp2*denom1*(tsat-273.15) )
2571 es=1000.*svp1*exp( svp2*denom1*(tsat-svpt0) )
2572 qswz(k)=ep2*es/(prez(k)-es)
2573 if (tem(k) .lt. 273.15) then
2574 ! qsiz(k)=episp0k/prez(k)* &
2575 ! exp( 21.8745584*denom2*(tsat-273.15) )
2576 es=1000.*svp1*exp( 21.8745584*denom2*(tsat-273.15) )
2577 qsiz(k)=ep2*es/(prez(k)-es)
2578 if (tem(k) .lt. 233.15) qswz(k)=qsiz(k)
2582 qvsbar(k)=ratql*qswz(k)+ratqi*qsiz(k)
2584 ! if( absft .lt. 0.01 .and. n .gt. 3 ) go to 300
2585 if( absft .lt. 0.01 ) go to 300
2587 dqvsbar=ratql*qswz(k)*svp2*243.5*denom1*denom1+ &
2588 ratqi*qsiz(k)*21.8745584*265.5*denom2*denom2
2589 ftsat=tsat+(xlvocp+ratqi*xlfocp)*qvsbar(k)- &
2590 tothz(k)*theiz(k)-xlfocp*ratqi*(qvz(k)+qlz(k)+qiz(k))
2591 dftsat=1.0+(xlvocp+ratqi*xlfocp)*dqvsbar
2592 tsat=tsat-ftsat/dftsat
2596 9020 format(1x,'point can not converge, absft,n=',e12.5,i5)
2599 if( qpz .gt. qvsbar(k) ) then
2601 qiz(k)=ratqi*( qpz-qvz(k) )
2602 qlz(k)=ratql*( qpz-qvz(k) )
2610 END SUBROUTINE satadj
2613 !----------------------------------------------------------------
2614 REAL FUNCTION parama1(temp)
2615 !----------------------------------------------------------------
2617 !----------------------------------------------------------------
2618 ! This program calculate the parameter for crystal growth rate
2619 ! in Bergeron process
2620 !----------------------------------------------------------------
2622 REAL, INTENT (IN ) :: temp
2623 REAL, DIMENSION(32) :: a1
2627 data a1/0.100e-10,0.7939e-7,0.7841e-6,0.3369e-5,0.4336e-5, &
2628 0.5285e-5,0.3728e-5,0.1852e-5,0.2991e-6,0.4248e-6, &
2629 0.7434e-6,0.1812e-5,0.4394e-5,0.9145e-5,0.1725e-4, &
2630 0.3348e-4,0.1725e-4,0.9175e-5,0.4412e-5,0.2252e-5, &
2631 0.9115e-6,0.4876e-6,0.3473e-6,0.4758e-6,0.6306e-6, &
2632 0.8573e-6,0.7868e-6,0.7192e-6,0.6513e-6,0.5956e-6, &
2633 0.5333e-6,0.4834e-6/
2637 ratio=-(temp)-float(i1-1)
2638 parama1=a1(i1)+ratio*( a1(i1p1)-a1(i1) )
2640 END FUNCTION parama1
2642 !----------------------------------------------------------------
2643 REAL FUNCTION parama2(temp)
2644 !----------------------------------------------------------------
2646 !----------------------------------------------------------------
2647 ! This program calculate the parameter for crystal growth rate
2648 ! in Bergeron process
2649 !----------------------------------------------------------------
2651 REAL, INTENT (IN ) :: temp
2652 REAL, DIMENSION(32) :: a2
2656 data a2/0.0100,0.4006,0.4831,0.5320,0.5307,0.5319,0.5249, &
2657 0.4888,0.3849,0.4047,0.4318,0.4771,0.5183,0.5463, &
2658 0.5651,0.5813,0.5655,0.5478,0.5203,0.4906,0.4447, &
2659 0.4126,0.3960,0.4149,0.4320,0.4506,0.4483,0.4460, &
2660 0.4433,0.4413,0.4382,0.4361/
2663 ratio=-(temp)-float(i1-1)
2664 parama2=a2(i1)+ratio*( a2(i1p1)-a2(i1) )
2666 END FUNCTION parama2
2668 !----------------------------------------------------------------
2669 REAL FUNCTION ggamma(X)
2670 !----------------------------------------------------------------
2672 !----------------------------------------------------------------
2673 REAL, INTENT(IN ) :: x
2674 REAL, DIMENSION(8) :: B
2676 REAL ::PF, G1TO2 ,TEMP
2678 DATA B/-.577191652,.988205891,-.897056937,.918206857, &
2679 -.756704078,.482199394,-.193527818,.035868343/
2684 IF (TEMP .LE. 2) GO TO 20
2687 100 FORMAT(//,5X,'module_mp_lin: INPUT TO GAMMA FUNCTION TOO LARGE, X=',E12.5)
2688 WRITE(wrf_err_message,100)X
2689 CALL wrf_error_fatal(wrf_err_message)
2693 30 G1TO2=G1TO2 + B(K1)*TEMP**K1
2698 !----------------------------------------------------------------
2700 END MODULE module_mp_lin