1 !WRF:MODEL_LAYER:PHYSICS
9 REAL , PARAMETER, PRIVATE :: RH = 1.0
10 ! REAL , PARAMETER, PRIVATE :: episp0 = 0.622*611.21
11 REAL , PARAMETER, PRIVATE :: xnor = 8.0e6
12 REAL , PARAMETER, PRIVATE :: xnos = 3.0e6
15 ! REAL , PARAMETER, PRIVATE :: xnog = 4.0e4
16 ! REAL , PARAMETER, PRIVATE :: rhograul = 917.
19 REAL , PARAMETER, PRIVATE :: xnog = 4.0e6
20 REAL , PARAMETER, PRIVATE :: rhograul = 400.
23 REAL , PARAMETER, PRIVATE :: &
24 qi0 = 1.0e-3, ql0 = 7.0e-4, qs0 = 6.0E-4, &
25 xmi50 = 4.8e-10, xmi40 = 2.46e-10, &
26 constb = 0.8, constd = 0.25, &
27 o6 = 1./6., cdrag = 0.6, &
28 avisc = 1.49628e-6, adiffwv = 8.7602e-5, &
29 axka = 1.4132e3, di50 = 1.0e-4, xmi = 4.19e-13, &
30 cw = 4.187e3, vf1s = 0.78, vf2s = 0.31, &
31 xni0 = 1.0e-2, xmnin = 1.05e-18, bni = 0.5, &
35 !-------------------------------------------------------------------
36 ! Lin et al., 1983, JAM, 1065-1092, and
37 ! Rutledge and Hobbs, 1984, JAS, 2949-2972
38 ! May 2009 - Changes and corrections from P. Blossey (U. Washington)
39 !-------------------------------------------------------------------
40 SUBROUTINE lin_et_al(th &
46 ,grav, cp, Rair, rvapor &
47 ,XLS, XLV, XLF, rhowater, rhosnow &
48 ,EP2,SVP1,SVP2,SVP3,SVPT0 &
51 , GRAUPELNC, GRAUPELNCV, SR &
52 ,refl_10cm, diagflag, do_radar_ref &
53 ,ids,ide, jds,jde, kds,kde &
54 ,ims,ime, jms,jme, kms,kme &
55 ,its,ite, jts,jte, kts,kte &
57 ,qlsink, precr, preci, precs, precg &
61 !-------------------------------------------------------------------
63 !-------------------------------------------------------------------
67 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde , &
68 ims,ime, jms,jme, kms,kme , &
69 its,ite, jts,jte, kts,kte
71 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
79 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
86 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
91 REAL , DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: ht
93 REAL, INTENT(IN ) :: dt_in, &
104 REAL, INTENT(IN ) :: EP2,SVP1,SVP2,SVP3,SVPT0
106 REAL, DIMENSION( ims:ime , jms:jme ), &
107 INTENT(INOUT) :: RAINNC, &
111 !+---+-----------------------------------------------------------------+
112 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: & ! GT
114 !+---+-----------------------------------------------------------------+
117 REAL, DIMENSION( ims:ime , jms:jme ), &
119 INTENT(INOUT) :: SNOWNC, &
124 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
132 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
133 OPTIONAL, INTENT(OUT ) :: &
134 qlsink, & ! cloud water conversion to rain (/s)
135 precr, & ! rain precipitation rate at all levels (kg/m2/s)
136 preci, & ! ice precipitation rate at all levels (kg/m2/s)
137 precs, & ! snow precipitation rate at all levels (kg/m2/s)
138 precg ! graupel precipitation rate at all levels (kg/m2/s)
140 LOGICAL, INTENT(IN), OPTIONAL :: F_QG, F_QNDROP
144 INTEGER :: min_q, max_q
146 REAL, DIMENSION( its:ite , jts:jte ) &
147 :: rain, snow, graupel,ice
149 REAL, DIMENSION( kts:kte ) :: qvz, qlz, qrz, &
155 precrz, preciz, precsz, precgz, &
159 LOGICAL :: flag_qg, flag_qndrop
161 REAL :: dt, pptrain, pptsnow, pptgraul, rhoe_s, &
167 !+---+-----------------------------------------------------------------+
168 REAL, DIMENSION(kts:kte):: qv1d, t1d, p1d, qr1d, qs1d, qg1d, dBZ
169 LOGICAL, OPTIONAL, INTENT(IN) :: diagflag
170 INTEGER, OPTIONAL, INTENT(IN) :: do_radar_ref
171 !+---+-----------------------------------------------------------------+
174 flag_qndrop = .false.
175 IF ( PRESENT ( f_qg ) ) flag_qg = f_qg
176 IF ( PRESENT ( f_qndrop ) ) flag_qndrop = f_qndrop
180 qndropconst=100.e6 !sg
183 IF (.not.flag_qg) gindex=0.
185 j_loop: DO j = jts, jte
186 i_loop: DO i = its, ite
188 !- write data from 3-D to 1-D
199 sqrhoz(k)=sqrt(rhoe_s*orhoz(k))
205 IF (flag_qndrop .AND. PRESENT( qndrop )) THEN
207 qndropz(k)=qndrop(i,k,j)
211 qndropz(k)=qndropconst
220 IF ( flag_qg .AND. PRESENT( qg ) ) THEN
234 CALL clphy1d( dt, qvz, qlz, qrz, qiz, qsz, qgz, &
235 qndropz,flag_qndrop, &
236 thz, tothz, rhoz, orhoz, sqrhoz, &
237 prez, zz, dzw, ht(I,J), preclw, &
238 precrz, preciz, precsz, precgz, &
239 pptrain, pptsnow, pptgraul, pptice, &
240 grav, cp, Rair, rvapor, gindex, &
241 XLS, XLV, XLF, rhowater, rhosnow, &
242 EP2,SVP1,SVP2,SVP3,SVPT0, &
246 ! Precipitation from cloud microphysics -- only for one time step
248 ! unit is transferred from m to mm
253 graupel(i,j)=pptgraul
255 sr(i,j)=(pptice+pptsnow+pptgraul)/(pptice+pptsnow+pptgraul+pptrain+1.e-12)
257 RAINNCV(i,j)= pptrain + pptsnow + pptgraul + pptice
258 RAINNC(i,j)=RAINNC(i,j) + pptrain + pptsnow + pptgraul + pptice
259 IF(PRESENT(SNOWNCV))SNOWNCV(i,j)= pptsnow + pptice
260 IF(PRESENT(SNOWNC))SNOWNC(i,j)=SNOWNC(i,j) + pptsnow + pptice
261 IF(PRESENT(GRAUPELNCV))GRAUPELNCV(i,j)= pptgraul
262 IF(PRESENT(GRAUPELNC))GRAUPELNC(i,j)=GRAUPELNC(i,j) + pptgraul
265 !- update data from 1-D back to 3-D
268 IF ( present(qlsink) .and. present(precr) ) THEN !sg beg
270 if(ql(i,k,j)>1.e-20) then
271 qlsink(i,k,j)=-preclw(k)/ql(i,k,j)
275 precr(i,k,j)=precrz(k)
286 IF ( flag_qndrop .AND. PRESENT( qndrop ) ) THEN !sg beg
288 qndrop(i,k,j)=qndropz(k)
297 IF ( present(preci) ) THEN !sg beg
299 preci(i,k,j)=preciz(k)
303 IF ( present(precs) ) THEN
305 precs(i,k,j)=precsz(k)
309 IF ( flag_qg .AND. PRESENT( qg ) ) THEN
314 IF ( present(precg) ) THEN !sg beg
316 precg(i,k,j)=precgz(k)
320 IF ( present(precg) ) precg(i,:,j)=0. !sg end
323 !+---+-----------------------------------------------------------------+
324 IF ( PRESENT (diagflag) ) THEN
325 if (diagflag .and. do_radar_ref == 1) then
327 t1d(k)=th(i,k,j)*pii(i,k,j)
334 call refl10cm_lin (qv1d, qr1d, qs1d, qg1d, &
335 t1d, p1d, dBZ, kts, kte, i, j)
337 refl_10cm(i,k,j) = MAX(-35., dBZ(k))
341 !+---+-----------------------------------------------------------------+
347 END SUBROUTINE lin_et_al
350 !-----------------------------------------------------------------------
351 SUBROUTINE clphy1d(dt, qvz, qlz, qrz, qiz, qsz, qgz, &
352 qndropz,flag_qndrop, &
353 thz, tothz, rho, orho, sqrho, &
354 prez, zz, dzw, zsfc, preclw, &
355 precrz, preciz, precsz, precgz, &
356 pptrain, pptsnow, pptgraul, &
357 pptice, grav, cp, Rair, rvapor, gindex, &
358 XLS, XLV, XLF, rhowater, rhosnow, &
359 EP2,SVP1,SVP2,SVP3,SVPT0, &
361 !-----------------------------------------------------------------------
363 !-----------------------------------------------------------------------
364 ! This program handles the vertical 1-D cloud micphysics
365 !-----------------------------------------------------------------------
366 ! avisc: constant in empirical formular for dynamic viscosity of air
367 ! =1.49628e-6 [kg/m/s] = 1.49628e-5 [g/cm/s]
368 ! adiffwv: constant in empirical formular for diffusivity of water
370 ! = 8.7602e-5 [kgm/s3] = 8.7602 [gcm/s3]
371 ! axka: constant in empirical formular for thermal conductivity of air
372 ! = 1.4132e3 [m2/s2/K] = 1.4132e7 [cm2/s2/K]
373 ! qi0: mixing ratio threshold for cloud ice aggregation [kg/kg]
374 ! xmi50: mass of a 50 micron ice crystal
375 ! = 4.8e-10 [kg] =4.8e-7 [g]
376 ! xmi40: mass of a 40 micron ice crystal
377 ! = 2.46e-10 [kg] = 2.46e-7 [g]
378 ! di50: diameter of a 50 micro (radius) ice crystal
380 ! xmi: mass of one cloud ice crystal
381 ! =4.19e-13 [kg] = 4.19e-10 [g]
384 ! xni0=1.0e-2 [m-3] The value given in Lin et al. is wrong.(see
385 ! Hsie et al.(1980) and Rutledge and Hobbs(1983) )
387 ! xmnin: mass of a natural ice nucleus
388 ! = 1.05e-18 [kg] = 1.05e-15 [g] This values is suggested by
390 ! = 1.0e-12 [kg] suggested by Rutlegde and Hobbs (1983)
391 ! rhowater: density of water=1.0 g/cm3=1000.0 kg/m3
392 ! consta: constant in empirical formular for terminal
393 ! velocity of raindrop
394 ! =2115.0 [cm**(1-b)/s] = 2115.0*0.01**(1-b) [m**(1-b)/s]
395 ! constb: constant in empirical formular for terminal
396 ! velocity of raindrop
398 ! xnor: intercept parameter of the raindrop size distribution
399 ! = 0.08 cm-4 = 8.0e6 m-4
400 ! araut: time sacle for autoconversion of cloud water to raindrops
402 ! ql0: mixing ratio threshold for cloud watercoalescence [kg/kg]
403 ! vf1r: ventilation factors for rain =0.78
404 ! vf2r: ventilation factors for rain =0.31
405 ! rhosnow: density of snow=0.1 g/cm3=100.0 kg/m3
406 ! constc: constant in empirical formular for terminal
408 ! =152.93 [cm**(1-d)/s] = 152.93*0.01**(1-d) [m**(1-d)/s]
409 ! constd: constant in empirical formular for terminal
412 ! xnos: intercept parameter of the snowflake size distribution
413 ! vf1s: ventilation factors for snow =0.78
414 ! vf2s: ventilation factors for snow =0.31
416 !----------------------------------------------------------------------
418 INTEGER, INTENT(IN ) :: kts, kte, i, j
420 REAL, DIMENSION( kts:kte ), &
421 INTENT(INOUT) :: qvz, qlz, qrz, qiz, qsz, &
425 REAL, DIMENSION( kts:kte ), &
426 INTENT(IN ) :: tothz, rho, orho, sqrho, &
429 REAL, INTENT(IN ) :: dt, grav, cp, Rair, rvapor, &
430 XLS, XLV, XLF, rhowater, &
431 rhosnow,EP2,SVP1,SVP2,SVP3,SVPT0
433 REAL, DIMENSION( kts:kte ), INTENT(OUT) :: preclw, &
434 precrz, preciz, precsz, precgz
436 REAL, INTENT(INOUT) :: pptrain, pptsnow, pptgraul, pptice
438 REAL, INTENT(IN ) :: zsfc
439 logical, intent(in) :: flag_qndrop !sg
443 REAL :: obp4, bp3, bp5, bp6, odp4, &
449 REAL :: tmp, tmp0, tmp1, tmp2,tmp3, &
450 tmp4,delta2,delta3, delta4, &
451 tmpa,tmpb,tmpc,tmpd,alpha1, &
452 qic, abi,abr, abg, odtberg, &
453 vti50,eiw,eri,esi,esr, esw, &
454 erw,delrs,term0,term1,araut, &
455 constg2, vf1r, vf2r,alpha2, &
456 Ap, Bp, egw, egi, egs, egr, &
457 constg, gdelta4, g1sdelt4, &
458 factor, tmp_r, tmp_s,tmp_g, &
459 qlpqi, rsat, a1, a2, xnin
463 REAL, DIMENSION( kts:kte ) :: oprez, tem, temcc, theiz, qswz, &
464 qsiz, qvoqswz, qvoqsiz, qvzodt, &
465 qlzodt, qizodt, qszodt, qrzodt, &
468 REAL, DIMENSION( kts:kte ) :: psnow, psaut, psfw, psfi, praci, &
469 piacr, psaci, psacw, psdep, pssub, &
470 pracs, psacr, psmlt, psmltevp, &
471 prain, praut, pracw, prevp, pvapor, &
472 pclw, pladj, pcli, pimlt, pihom, &
473 pidw, piadj, pgraupel, pgaut, &
474 pgfr, pgacw, pgaci, pgacr, pgacs, &
475 pgacip,pgacrp,pgacsp,pgwet, pdry, &
476 pgsub, pgdep, pgmlt, pgmltevp, &
480 REAL, DIMENSION( kts:kte ) :: qvsbar, rs0, viscmu, visc, diffwv, &
483 REAL, DIMENSION( kts:kte ) :: vtr, vts, vtg, &
484 vtrold, vtsold, vtgold, vtiold, &
485 xlambdar, xlambdas, xlambdag, &
486 olambdar, olambdas, olambdag
488 REAL :: episp0k, dtb, odtb, pi, pio4, &
489 pio6, oxLf, xLvocp, xLfocp, consta, &
490 constc, ocdrag, gambp4, gamdp4, &
491 gam4pt5, Cpor, oxmi, gambp3, gamdp3,&
492 gambp6, gam3pt5, gam2pt75, gambp5o2,&
493 gamdp5o2, cwoxlf, ocp, xni50, es
497 REAL :: temc1,save1,save2,xni50mx
499 ! for terminal velocity flux
501 INTEGER :: min_q, max_q
502 REAL :: t_del_tv, del_tv, flux, fluxin, fluxout ,tmpqrz
505 REAL :: tmp_tem, tmp_temcc !bloss
507 real :: liqconc, dis, beta, kappa, p0, xc, capn,rhocgs
509 !+---+-----------------------------------------------------------------+
512 IF (NCALL .EQ. 0) THEN
513 !..Set these variables needed for computing radar reflectivity. These
514 !.. get used within radar_init to create other variables used in the
516 xam_r = 3.14159*rhowater/6.
519 xam_s = 3.14159*rhosnow/6.
522 xam_g = 3.14159*rhograul/6.
529 !+---+-----------------------------------------------------------------+
532 ! liqconc = liquid water content (g cm^-3)
533 ! capn = droplet number concentration (# cm^-3)
534 ! dis = relative dispersion (dimensionless) between 0.2 and 1.
535 ! Written by Yangang Liu based on Liu et al., GRL 32, 2005.
536 ! Autoconversion rate p = p0 * (threshold function)
537 ! p0 = "base" autoconversion rate (g cm^-3 s^-1)
538 ! kappa = constant in Long kernel = [kappa2 * (3/(4*pi*rhow))^3] in Liu papers
539 ! beta = Condensation rate constant = (beta6)^6 in Liu papers
540 ! xc = Normalized critical mass
541 ! ***********************************************************
543 dis = 0.5 ! droplet dispersion, set to 0.5 per SG 8-Nov-2006
544 ! Give empirical constants
546 ! Calculate Condensation rate constant
547 beta = (1.0d0+3.0d0*dis**2)*(1.0d0+4.0d0*dis**2)* &
548 (1.0d0+5.0d0*dis**2)/((1.0d0+dis**2)*(1.0d0+2.0d0*dis**2))
561 consta=2115.0*0.01**(1-constb)
562 constc=152.93*0.01**(1-constd)
565 episp0k=RH*ep2*1000.*svp1
567 gambp4=ggamma(constb+4.)
568 gamdp4=ggamma(constd+4.)
572 gambp3=ggamma(constb+3.)
573 gamdp3=ggamma(constd+3.)
574 gambp6=ggamma(constb+6)
576 gam2pt75=ggamma(2.75)
577 gambp5o2=ggamma((constb+5.)/2.)
578 gamdp5o2=ggamma((constd+5.)/2.)
584 !-----------------------------------------------------------------------
585 ! oprez 1./prez ( prez : pressure)
586 ! qsw saturated mixing ratio on water surface
587 ! qsi saturated mixing ratio on ice surface
588 ! episp0k RH*e*saturated pressure at 273.15 K
598 ! temcc temperature in dregee C
601 obp4=1.0/(constb+4.0)
605 odp4=1.0/(constd+4.0)
608 dp5o2=0.5*(constd+5.0)
615 qlz(k)=amax1( 0.0,qlz(k) )
616 qiz(k)=amax1( 0.0,qiz(k) )
617 qvz(k)=amax1( qvmin,qvz(k) )
618 qsz(k)=amax1( 0.0,qsz(k) )
619 qrz(k)=amax1( 0.0,qrz(k) )
620 qgz(k)=amax1( 0.0,qgz(k) )
621 qndropz(k)=amax1( 0.0,qndropz(k) ) !sg
623 tem(k)=thz(k)*tothz(k)
624 temcc(k)=tem(k)-273.15
626 ! qswz(k)=episp0k*oprez(k)* &
627 ! exp( svp2*temcc(k)/(tem(k)-svp3) )
628 es=1000.*svp1*exp( svp2*temcc(k)/(tem(k)-svp3) )
629 qswz(k)=ep2*es/(prez(k)-es)
630 if (tem(k) .lt. 273.15 ) then
631 ! qsiz(k)=episp0k*oprez(k)* &
632 ! exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
633 es=1000.*svp1*exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
634 qsiz(k)=ep2*es/(prez(k)-es)
635 if (temcc(k) .lt. -40.0) qswz(k)=qsiz(k)
640 qvoqswz(k)=qvz(k)/qswz(k)
641 qvoqsiz(k)=qvz(k)/qsiz(k)
643 theiz(k)=thz(k)+(xlvocp*qvz(k)-xlfocp*qiz(k))/tothz(k)
649 !-----------------------------------------------------------------------
650 ! In this simple stable cloud parameterization scheme, only five
651 ! forms of water substance (water vapor, cloud water, cloud ice,
652 ! rain and snow are considered. The prognostic variables are total
653 ! water (qp),cloud water (ql), and cloud ice (qi). Rain and snow are
654 ! diagnosed following Nagata and Ogura, 1991, MWR, 1309-1337. Eq (A7).
655 ! the micro physics are based on (1) Hsie et al.,1980, JAM, 950-977 ;
656 ! (2) Lin et al., 1983, JAM, 1065-1092 ; (3) Rutledge and Hobbs, 1983,
657 ! JAS, 1185-1206 ; (4) Rutledge and Hobbs, 1984, JAS, 2949-2972.
658 !-----------------------------------------------------------------------
660 ! rhowater: density of water=1.0 g/cm3=1000.0 kg/m3
661 ! rhosnow: density of snow=0.1 g/cm3=100.0 kg/m3
662 ! xnor: intercept parameter of the raindrop size distribution
663 ! = 0.08 cm-4 = 8.0e6 m-4
664 ! xnos: intercept parameter of the snowflake size distribution
665 ! = 0.03 cm-4 = 3.0e6 m-4
666 ! xnog: intercept parameter of the graupel size distribution
667 ! = 4.0e-4 cm-4 = 4.0e4 m-4
668 ! consta: constant in empirical formular for terminal
669 ! velocity of raindrop
670 ! =2115.0 [cm**(1-b)/s] = 2115.0*0.01**(1-b) [m**(1-b)/s]
671 ! constb: constant in empirical formular for terminal
672 ! velocity of raindrop
674 ! constc: constant in empirical formular for terminal
676 ! =152.93 [cm**(1-d)/s] = 152.93*0.01**(1-d) [m**(1-d)/s]
677 ! constd: constant in empirical formular for terminal
680 ! avisc: constant in empirical formular for dynamic viscosity of air
681 ! =1.49628e-6 [kg/m/s] = 1.49628e-5 [g/cm/s]
682 ! adiffwv: constant in empirical formular for diffusivity of water
684 ! = 8.7602e-5 [kgm/s3] = 8.7602 [gcm/s3]
685 ! axka: constant in empirical formular for thermal conductivity of air
686 ! = 1.4132e3 [m2/s2/K] = 1.4132e7 [cm2/s2/K]
687 ! qi0: mixing ratio threshold for cloud ice aggregation [kg/kg]
688 ! = 1.0e-3 g/g = 1.0e-3 kg/gk
689 ! ql0: mixing ratio threshold for cloud watercoalescence [kg/kg]
690 ! = 2.0e-3 g/g = 2.0e-3 kg/gk
691 ! qs0: mixing ratio threshold for snow aggregation
692 ! = 6.0e-4 g/g = 6.0e-4 kg/gk
693 ! xmi50: mass of a 50 micron ice crystal
694 ! = 4.8e-10 [kg] =4.8e-7 [g]
695 ! xmi40: mass of a 40 micron ice crystal
696 ! = 2.46e-10 [kg] = 2.46e-7 [g]
697 ! di50: diameter of a 50 micro (radius) ice crystal
699 ! xmi: mass of one cloud ice crystal
700 ! =4.19e-13 [kg] = 4.19e-10 [g]
705 ! if gindex=1.0 include graupel
706 ! if gindex=0. no graupel
768 ! Set rs0=episp0*oprez(k)
769 ! episp0=e*saturated pressure at 273.15 K
773 rs0(k)=ep2*1000.*svp1/(prez(k)-1000.*svp1)
776 !***********************************************************************
777 ! Calculate precipitation fluxes due to terminal velocities.
778 !***********************************************************************
780 !- Calculate termianl velocity (vt?) of precipitation q?z
781 !- Find maximum vt? to determine the small delta t
794 if (qrz(k) .gt. 1.0e-8) then
797 tmp1=sqrt(pi*rhowater*xnor/rho(k)/qrz(k))
799 vtrold(k)=o6*consta*gambp4*sqrho(k)/tmp1**constb
801 del_tv=amin1(del_tv,0.9*(zz(k)-zsfc)/vtrold(k))
803 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vtrold(k))
810 if (max_q .ge. min_q) then
812 !- Check if the summation of the small delta t >= big delta t
813 ! (t_del_tv) (del_tv) (dtb)
815 t_del_tv=t_del_tv+del_tv
817 if ( t_del_tv .ge. dtb ) then
819 del_tv=dtb+del_tv-t_del_tv
824 fluxout=rho(k)*vtrold(k)*qrz(k)
825 flux=(fluxin-fluxout)/rho(k)/dzw(k)
827 qrz(k)=qrz(k)+del_tv*flux
830 if (min_q .eq. 1) then
831 pptrain=pptrain+fluxin*del_tv
833 qrz(min_q-1)=qrz(min_q-1)+del_tv* &
834 fluxin/rho(min_q-1)/dzw(min_q-1)
855 if (qsz(k) .gt. 1.0e-8) then
858 tmp1=sqrt(pi*rhosnow*xnos/rho(k)/qsz(k))
860 vtsold(k)=o6*constc*gamdp4*sqrho(k)/tmp1**constd
862 del_tv=amin1(del_tv,0.9*(zz(k)-zsfc)/vtsold(k))
864 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vtsold(k))
871 if (max_q .ge. min_q) then
874 !- Check if the summation of the small delta t >= big delta t
875 ! (t_del_tv) (del_tv) (dtb)
877 t_del_tv=t_del_tv+del_tv
879 if ( t_del_tv .ge. dtb ) then
881 del_tv=dtb+del_tv-t_del_tv
886 fluxout=rho(k)*vtsold(k)*qsz(k)
887 flux=(fluxin-fluxout)/rho(k)/dzw(k)
888 qsz(k)=qsz(k)+del_tv*flux
889 qsz(k)=amax1(0.,qsz(k))
892 if (min_q .eq. 1) then
893 pptsnow=pptsnow+fluxin*del_tv
895 qsz(min_q-1)=qsz(min_q-1)+del_tv* &
896 fluxin/rho(min_q-1)/dzw(min_q-1)
917 if (qgz(k) .gt. 1.0e-8) then
920 tmp1=sqrt(pi*rhograul*xnog/rho(k)/qgz(k))
922 term0=sqrt(4.*grav*rhograul*0.33334/rho(k)/cdrag)
923 vtgold(k)=o6*gam4pt5*term0*sqrt(1./tmp1)
925 del_tv=amin1(del_tv,0.9*(zz(k)-zsfc)/vtgold(k))
927 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vtgold(k))
934 if (max_q .ge. min_q) then
937 !- Check if the summation of the small delta t >= big delta t
938 ! (t_del_tv) (del_tv) (dtb)
940 t_del_tv=t_del_tv+del_tv
942 if ( t_del_tv .ge. dtb ) then
944 del_tv=dtb+del_tv-t_del_tv
950 fluxout=rho(k)*vtgold(k)*qgz(k)
951 flux=(fluxin-fluxout)/rho(k)/dzw(k)
952 qgz(k)=qgz(k)+del_tv*flux
953 qgz(k)=amax1(0.,qgz(k))
956 if (min_q .eq. 1) then
957 pptgraul=pptgraul+fluxin*del_tv
959 qgz(min_q-1)=qgz(min_q-1)+del_tv* &
960 fluxin/rho(min_q-1)/dzw(min_q-1)
970 !-- cloud ice (03/21/02) follow Vaughan T.J. Phillips at GFDL
982 if (qiz(k) .gt. 1.0e-8) then
985 vtiold(k)= 3.29 * (rho(k)* qiz(k))** 0.16 ! Heymsfield and Donner
987 del_tv=amin1(del_tv,0.9*(zz(k)-zsfc)/vtiold(k))
989 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vtiold(k))
996 if (max_q .ge. min_q) then
999 !- Check if the summation of the small delta t >= big delta t
1000 ! (t_del_tv) (del_tv) (dtb)
1002 t_del_tv=t_del_tv+del_tv
1004 if ( t_del_tv .ge. dtb ) then
1006 del_tv=dtb+del_tv-t_del_tv
1011 fluxout=rho(k)*vtiold(k)*qiz(k)
1012 flux=(fluxin-fluxout)/rho(k)/dzw(k)
1013 qiz(k)=qiz(k)+del_tv*flux
1014 qiz(k)=amax1(0.,qiz(k))
1017 if (min_q .eq. 1) then
1018 pptice=pptice+fluxin*del_tv
1020 qiz(min_q-1)=qiz(min_q-1)+del_tv* &
1021 fluxin/rho(min_q-1)/dzw(min_q-1)
1029 do k=kts,kte-1 !sg beg
1030 precrz(k)=rho(k)*vtrold(k)*qrz(k)
1031 preciz(k)=rho(k)*vtiold(k)*qiz(k)
1032 precsz(k)=rho(k)*vtsold(k)*qsz(k)
1033 precgz(k)=rho(k)*vtgold(k)*qgz(k)
1035 precrz(kte)=0. !wig - top level never set for vtXold vars
1041 ! Microphysics processes
1045 qvzodt(k)=amax1( 0.0,odtb*qvz(k) )
1046 qlzodt(k)=amax1( 0.0,odtb*qlz(k) )
1047 qizodt(k)=amax1( 0.0,odtb*qiz(k) )
1048 qszodt(k)=amax1( 0.0,odtb*qsz(k) )
1049 qrzodt(k)=amax1( 0.0,odtb*qrz(k) )
1050 qgzodt(k)=amax1( 0.0,odtb*qgz(k) )
1051 !***********************************************************************
1052 !***** diagnose mixing ratios (qrz,qsz), terminal *****
1053 !***** velocities (vtr,vts), and slope parameters in size *****
1054 !***** distribution(xlambdar,xlambdas) of rain and snow *****
1055 !***** follows Nagata and Ogura, 1991, MWR, 1309-1337. Eq (A7) *****
1056 !***********************************************************************
1058 !**** assuming no cloud water can exist in the top two levels due to
1059 !**** radiation consideration
1063 !! no cloud water, rain, ice, snow and graupel
1065 !! skip these processes and jump to line 2000
1068 tmp=qiz(k)+qlz(k)+qsz(k)+qrz(k)+qgz(k)*gindex
1069 if( qvz(k)+qlz(k)+qiz(k) .lt. qsiz(k) &
1070 .and. tmp .eq. 0.0 ) go to 2000
1072 !! calculate terminal velocity of rain
1074 if (qrz(k) .gt. 1.0e-8) then
1075 tmp1=sqrt(pi*rhowater*xnor*orho(k)/qrz(k))
1076 xlambdar(k)=sqrt(tmp1)
1077 olambdar(k)=1.0/xlambdar(k)
1078 vtrold(k)=o6*consta*gambp4*sqrho(k)*olambdar(k)**constb
1084 ! if (qrz(k) .gt. 1.0e-12) then
1085 if (qrz(k) .gt. 1.0e-8) then
1086 tmp1=sqrt(pi*rhowater*xnor*orho(k)/qrz(k))
1087 xlambdar(k)=sqrt(tmp1)
1088 olambdar(k)=1.0/xlambdar(k)
1089 vtr(k)=o6*consta*gambp4*sqrho(k)*olambdar(k)**constb
1095 !! calculate terminal velocity of snow
1097 if (qsz(k) .gt. 1.0e-8) then
1098 tmp1=sqrt(pi*rhosnow*xnos*orho(k)/qsz(k))
1099 xlambdas(k)=sqrt(tmp1)
1100 olambdas(k)=1.0/xlambdas(k)
1101 vtsold(k)=o6*constc*gamdp4*sqrho(k)*olambdas(k)**constd
1107 ! if (qsz(k) .gt. 1.0e-12) then
1108 if (qsz(k) .gt. 1.0e-8) then
1109 tmp1=sqrt(pi*rhosnow*xnos*orho(k)/qsz(k))
1110 xlambdas(k)=sqrt(tmp1)
1111 olambdas(k)=1.0/xlambdas(k)
1112 vts(k)=o6*constc*gamdp4*sqrho(k)*olambdas(k)**constd
1118 !! calculate terminal velocity of graupel
1120 if (qgz(k) .gt. 1.0e-8) then
1121 tmp1=sqrt( pi*rhograul*xnog*orho(k)/qgz(k))
1122 xlambdag(k)=sqrt(tmp1)
1123 olambdag(k)=1.0/xlambdag(k)
1124 term0=sqrt(4.*grav*rhograul*0.33334*orho(k)*ocdrag)
1125 vtgold(k)=o6*gam4pt5*term0*sqrt(olambdag(k))
1131 ! if (qgz(k) .gt. 1.0e-12) then
1132 if (qgz(k) .gt. 1.0e-8) then
1133 tmp1=sqrt( pi*rhograul*xnog*orho(k)/qgz(k))
1134 xlambdag(k)=sqrt(tmp1)
1135 olambdag(k)=1.0/xlambdag(k)
1136 term0=sqrt(4.*grav*rhograul*0.33334*orho(k)*ocdrag)
1137 vtg(k)=o6*gam4pt5*term0*sqrt(olambdag(k))
1143 !***********************************************************************
1144 !***** compute viscosity,difusivity,thermal conductivity, and ******
1145 !***** Schmidt number ******
1146 !***********************************************************************
1147 !c------------------------------------------------------------------
1148 !c viscmu: dynamic viscosity of air kg/m/s
1149 !c visc: kinematic viscosity of air = viscmu/rho (m2/s)
1150 !c avisc=1.49628e-6 kg/m/s=1.49628e-5 g/cm/s
1151 !c viscmu=1.718e-5 kg/m/s in RH
1152 !c diffwv: Diffusivity of water vapor in air
1153 !c adiffwv = 8.7602e-5 (8.794e-5 in MM5) kgm/s3
1154 !c = 8.7602 (8.794 in MM5) gcm/s3
1155 !c diffwv(k)=2.26e-5 m2/s
1156 !c schmidt: Schmidt number=visc/diffwv
1157 !c xka: thermal conductivity of air J/m/s/K (Kgm/s3/K)
1158 !c xka(k)=2.43e-2 J/m/s/K in RH
1159 !c axka=1.4132e3 (1.414e3 in MM5) m2/s2/k = 1.4132e7 cm2/s2/k
1160 !c------------------------------------------------------------------
1162 viscmu(k)=avisc*tem(k)**1.5/(tem(k)+120.0)
1163 visc(k)=viscmu(k)*orho(k)
1164 diffwv(k)=adiffwv*tem(k)**1.81*oprez(k)
1165 schmidt(k)=visc(k)/diffwv(k)
1166 xka(k)=axka*viscmu(k)
1168 if (tem(k) .lt. 273.15) then
1171 !***********************************************************************
1172 !********* snow production processes for T < 0 C **********
1173 !***********************************************************************
1175 !c (1) ICE CRYSTAL AGGREGATION TO SNOW (Psaut): Lin (21)
1176 !c! psaut=alpha1*(qi-qi0)
1177 !c! alpha1=1.0e-3*exp(0.025*(T-T0))
1179 ! alpha1=1.0e-3*exp( 0.025*temcc(k) )
1181 alpha1=1.0e-3*exp( 0.025*temcc(k) )
1183 if(temcc(k) .lt. -20.0) then
1184 tmp1=-7.6+4.0*exp( -0.2443e-3*(abs(temcc(k))-20)**2.455 )
1185 qic=1.0e-3*exp(tmp1)*orho(k)
1190 ! tmp1=amax1( 0.0,alpha1*(qiz(k)-qic) )
1191 ! psaut(k)=amin1( tmp1,qizodt(k) )
1193 tmp1=odtb*(qiz(k)-qic)*(1.0-exp(-alpha1*dtb))
1194 psaut(k)=amax1( 0.0,tmp1 )
1197 !c (2) BERGERON PROCESS TRANSFER OF CLOUD WATER TO SNOW (Psfw)
1198 !c this process only considered when -31 C < T < 0 C
1199 !c Lin (33) and Hsie (17)
1202 !c! parama1 and parama2 functions must be user supplied
1206 if( qlz(k) .gt. 1.0e-10 ) then
1207 temc1=amax1(-30.99,temcc(k))
1208 ! print*,'temc1',temc1,qlz(k)
1212 !! change unit from cgs to mks
1214 !c! dtberg is the time needed for a crystal to grow from 40 to 50 um
1215 !c ! odtberg=1.0/dtberg
1216 odtberg=(a1*tmp1)/(xmi50**tmp1-xmi40**tmp1)
1218 !c! compute terminal velocity of a 50 micron ice cystal
1220 vti50=constc*di50**constd*sqrho(k)
1224 save2=0.25*pi*eiw*rho(k)*di50*di50*vti50
1226 tmp2=( save1 + save2*qlz(k) )
1228 !! maximum number of 50 micron crystals limited by the amount
1229 !! of supercool water
1231 xni50mx=qlzodt(k)/tmp2
1233 !! number of 50 micron crystals produced
1236 xni50=qiz(k)*( 1.0-exp(-dtb*odtberg) )/xmi50
1237 xni50=amin1(xni50,xni50mx)
1239 tmp3=odtb*tmp2/save2*( 1.0-exp(-save2*xni50*dtb) )
1240 psfw(k)=amin1( tmp3,qlzodt(k) )
1244 !0915 if( temcc(k).gt.-30.99 ) then
1245 !0915 a1=parama1( temcc(k) )
1246 !0915 a2=parama2( temcc(k) )
1248 !! change unit from cgs to mks
1249 !0915 a1=a1*0.001**tmp1
1251 !c! dtberg is the time needed for a crystal to grow from 40 to 50 um
1252 !c! odtberg=1.0/dtberg
1253 !0915 odtberg=(a1*tmp1)/(xmi50**tmp1-xmi40**tmp1)
1255 !c! number of 50 micron crystals produced
1256 !0915 xni50=qiz(k)*dtb*odtberg/xmi50
1258 !c! need to calculate the terminal velocity of a 50 micron
1260 !0915 vti50=constc*di50**constd*sqrho(k)
1262 !0915 tmp2=xni50*( a1*xmi50**a2 + &
1263 !0915 0.25*qlz(k)*pi*eiw*rho(k)*di50*di50*vti50 )
1264 !0915 psfw(k)=amin1( tmp2,qlzodt(k) )
1267 !c (3) REDUCTION OF CLOUD ICE BY BERGERON PROCESS (Psfi): Lin (34)
1268 !c this process only considered when -31 C < T < 0 C
1270 tmp1=xni50*xmi50-psfw(k)
1271 psfi(k)=amin1(tmp1,qizodt(k))
1277 !0915 tmp1=qiz(k)*odtberg
1278 !0915 psfi(k)=amin1(tmp1,qizodt(k))
1283 if(qrz(k) .le. 0.0) go to 1000
1285 ! Processes (4) and (5) only need when qrz > 0.0
1288 !c (4) CLOUD ICE ACCRETION BY RAIN (Praci): Lin (25)
1289 !c may produce snow or graupel
1292 !0915 tmp1=qiz(k)*pio4*eri*xnor*consta*sqrho(k)
1293 !0915 tmp2=tmp1*gambp3*olambdar(k)**bp3
1294 !0915 praci(k)=amin1( tmp2,qizodt(k) )
1296 save1=pio4*eri*xnor*consta*sqrho(k)
1297 tmp1=save1*gambp3*olambdar(k)**bp3
1298 praci(k)=qizodt(k)*( 1.0-exp(-tmp1*dtb) )
1301 !c (5) RAIN ACCRETION BY CLOUD ICE (Piacr): Lin (26)
1303 !0915 tmp2=tmp1*rho(k)*pio6*rhowater*gambp6*oxmi* &
1304 !0915 olambdar(k)**bp6
1305 !0915 piacr(k)=amin1( tmp2,qrzodt(k) )
1307 tmp2=qiz(k)*save1*rho(k)*pio6*rhowater*gambp6*oxmi* &
1309 piacr(k)=amin1( tmp2,qrzodt(k) )
1314 if(qsz(k) .le. 0.0) go to 1200
1316 ! Compute the following processes only when qsz > 0.0
1319 !c (6) ICE CRYSTAL ACCRETION BY SNOW (Psaci): Lin (22)
1321 esi=exp( 0.025*temcc(k) )
1322 save1=pio4*xnos*constc*gamdp3*sqrho(k)* &
1325 psaci(k)=qizodt(k)*( 1.0-exp(-tmp1*dtb) )
1327 !0915 tmp1=pio4*xnos*constc*gamdp3*sqrho(k)* &
1328 !0915 olambdas(k)**dp3
1329 !0915 tmp2=qiz(k)*esi*tmp1
1330 !0915 psaci(k)=amin1( tmp2,qizodt(k) )
1332 !c (7) CLOUD WATER ACCRETION BY SNOW (Psacw): Lin (24)
1336 psacw(k)=qlzodt(K)*( 1.0-exp(-tmp1*dtb) )
1338 !0915 tmp2=qlz(k)*esw*tmp1
1339 !0915 psacw(k)=amin1( tmp2,qlzodt(k) )
1341 !c (8) DEPOSITION/SUBLIMATION OF SNOW (Psdep/Pssub): Lin (31)
1342 !c includes consideration of ventilation effect
1344 !c abi=2*pi*(Si-1)/rho/(A"+B")
1346 tmpa=rvapor*xka(k)*tem(k)*tem(k)
1347 tmpb=xls*xls*rho(k)*qsiz(k)*diffwv(k)
1348 tmpc=tmpa*qsiz(k)*diffwv(k)
1349 abi=2.0*pi*(qvoqsiz(k)-1.0)*tmpc/(tmpa+tmpb)
1351 !c vf1s,vf2s=ventilation factors for snow
1352 !c vf1s=0.78,vf2s=0.31 in LIN
1354 tmp1=constc*sqrho(k)*olambdas(k)**dp5/visc(k)
1355 tmp2=abi*xnos*( vf1s*olambdas(k)*olambdas(k)+ &
1356 vf2s*schmidt(k)**0.33334*gamdp5o2*sqrt(tmp1) )
1357 tmp3=odtb*( qvz(k)-qsiz(k) )
1360 !the old implementation would give the wrong results if olambdas(k) ==0
1361 !which can lead to positive pssub, i.e. tmp2=0 but tmp3> 0
1362 ! if( tmp2 .le. 0.0) then
1363 if( tmp3 .le. 0.0) then
1364 tmp2=amax1( tmp2,tmp3)
1365 pssub(k)=amin1(0.,amax1( tmp2,-qszodt(k) ))
1369 psdep(k)=amin1( tmp2,tmp3 )
1373 !0915 psdep(k)=amax1(0.0,tmp2)
1374 !0915 pssub(k)=amin1(0.0,tmp2)
1375 !0915 pssub(k)=amax1( pssub(k),-qszodt(k) )
1377 if(qrz(k) .le. 0.0) go to 1200
1379 ! Compute processes (9) and (10) only when qsz > 0.0 and qrz > 0.0
1382 !c (9) ACCRETION OF SNOW BY RAIN (Pracs): Lin (27)
1385 tmpa=olambdar(k)*olambdar(k)
1386 tmpb=olambdas(k)*olambdas(k)
1387 tmpc=olambdar(k)*olambdas(k)
1388 tmp1=pi*pi*esr*xnor*xnos*abs( vtr(k)-vts(k) )*orho(k)
1389 tmp2=tmpb*tmpb*olambdar(k)*(5.0*tmpb+2.0*tmpc+0.5*tmpa)
1390 tmp3=tmp1*rhosnow*tmp2
1391 pracs(k)=amin1( tmp3,qszodt(k) )
1393 !c (10) ACCRETION OF RAIN BY SNOW (Psacr): Lin (28)
1395 tmp3=tmpa*tmpa*olambdas(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1396 tmp4=tmp1*rhowater*tmp3
1397 psacr(k)=amin1( tmp4,qrzodt(k) )
1403 !***********************************************************************
1404 !********* snow production processes for T > 0 C **********
1405 !***********************************************************************
1407 if (qsz(k) .le. 0.0) go to 1400
1409 !c (1) CLOUD WATER ACCRETION BY SNOW (Psacw): Lin (24)
1413 tmp1=esw*pio4*xnos*constc*gamdp3*sqrho(k)* &
1415 psacw(k)=qlzodt(k)*( 1.0-exp(-tmp1*dtb) )
1417 !0915 tmp1=pio4*xnos*constc*gamdp3*sqrho(k)* &
1418 !0915 olambdas(k)**dp3
1419 !0915 tmp2=qlz(k)*esw*tmp1
1420 !0915 psacw(k)=amin1( tmp2,qlzodt(k) )
1422 !c (2) ACCRETION OF RAIN BY SNOW (Psacr): Lin (28)
1425 tmpa=olambdar(k)*olambdar(k)
1426 tmpb=olambdas(k)*olambdas(k)
1427 tmpc=olambdar(k)*olambdas(k)
1428 tmp1=pi*pi*esr*xnor*xnos*abs( vtr(k)-vts(k) )*orho(k)
1429 tmp2=tmpa*tmpa*olambdas(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1430 tmp3=tmp1*rhowater*tmp2
1431 psacr(k)=amin1( tmp3,qrzodt(k) )
1433 !c (3) MELTING OF SNOW (Psmlt): Lin (32)
1434 !c Psmlt is negative value
1437 term1=2.0*pi*orho(k)*( xlv*diffwv(k)*rho(k)*delrs- &
1439 tmp1=constc*sqrho(k)*olambdas(k)**dp5/visc(k)
1440 tmp2=xnos*( vf1s*olambdas(k)*olambdas(k)+ &
1441 vf2s*schmidt(k)**0.33334*gamdp5o2*sqrt(tmp1) )
1442 tmp3=term1*oxlf*tmp2-cwoxlf*temcc(k)*( psacw(k)+psacr(k) )
1443 tmp4=amin1(0.0,tmp3)
1444 psmlt(k)=amax1( tmp4,-qszodt(k) )
1446 !c (4) EVAPORATION OF MELTING SNOW (Psmltevp): HR (A27)
1447 !c but use Lin et al. coefficience
1448 !c Psmltevp is a negative value
1450 tmpa=rvapor*xka(k)*tem(k)*tem(k)
1451 tmpb=xlv*xlv*rho(k)*qswz(k)*diffwv(k)
1452 tmpc=tmpa*qswz(k)*diffwv(k)
1453 tmpd=amin1( 0.0,(qvoqswz(k)-0.90)*qswz(k)*odtb )
1455 ! abr=2.0*pi*(qvoqswz(k)-1.0)*tmpc/(tmpa+tmpb)
1457 abr=2.0*pi*(qvoqswz(k)-0.90)*tmpc/(tmpa+tmpb)
1459 !**** allow evaporation to occur when RH less than 90%
1460 !**** here not using 100% because the evaporation cooling
1461 !**** of temperature is not taking into account yet; hence,
1462 !**** the qsw value is a little bit larger. This will avoid
1463 !**** evaporation can generate cloud.
1465 !c vf1s,vf2s=ventilation factors for snow
1466 !c vf1s=0.78,vf2s=0.31 in LIN
1468 tmp1=constc*sqrho(k)*olambdas(k)**dp5/visc(k)
1469 tmp2=abr*xnos*( vf1s*olambdas(k)*olambdas(k)+ &
1470 vf2s*schmidt(k)**0.33334*gamdp5o2*sqrt(tmp1) )
1471 tmp3=amin1(0.0,tmp2)
1472 tmp3=amax1( tmp3,tmpd )
1473 psmltevp(k)=amax1( tmp3,-qszodt(k) )
1478 !***********************************************************************
1479 !********* rain production processes **********
1480 !***********************************************************************
1483 !c (1) AUTOCONVERSION OF RAIN (Praut): RH
1486 if( qndropz(k) >= 1. ) then
1487 ! Liu et al. autoconversion scheme
1489 liqconc=rhocgs*qlz(k) ! (kg/kg) to (g/cm3)
1490 capn=1.0e-3*rhocgs*qndropz(k) ! (#/kg) to (#/cm3)
1492 if(liqconc.gt.1.e-10)then
1493 p0=(kappa*beta/capn)*(liqconc*liqconc*liqconc)
1494 xc=9.7d-17*capn*sqrt(capn)/(liqconc*liqconc)
1495 ! Calculate autoconversion rate (g/g/s)
1497 praut(k)=(p0/rhocgs) * ( 0.5d0*(xc*xc+2*xc+2.0d0)* &
1498 (1.0d0+xc)*exp(-2.0d0*xc) )
1505 !c afa=0.001 Rate coefficient for autoconvergence
1511 ! tmp1=amax1( 0.0,araut*(qlz(k)-ql0) )
1512 ! praut(k)=amin1( tmp1,qlzodt(k) )
1513 tmp1=odtb*(qlz(k)-ql0)*( 1.0-exp(-araut*dtb) )
1514 praut(k)=amax1( 0.0,tmp1 )
1518 !c (2) ACCRETION OF CLOUD WATER BY RAIN (Pracw): Lin (51)
1521 ! tmp1=qlz(k)*pio4*erw*xnor*consta*sqrho(k)
1522 ! tmp2=tmp1*gambp3*olambdar(k)**bp3
1523 ! pracw(k)=amin1( tmp2,qlzodt(k) )
1525 tmp1=pio4*erw*xnor*consta*sqrho(k)* &
1526 gambp3*olambdar(k)**bp3
1527 pracw(k)=qlzodt(k)*( 1.0-exp(-tmp1*dtb) )
1530 !c (3) EVAPORATION OF RAIN (Prevp): Lin (52)
1531 !c Prevp is negative value
1533 !c Sw=qvoqsw : saturation ratio
1535 tmpa=rvapor*xka(k)*tem(k)*tem(k)
1536 tmpb=xlv*xlv*rho(k)*qswz(k)*diffwv(k)
1537 tmpc=tmpa*qswz(k)*diffwv(k)
1539 ! tmpd=amin1(0.0,(qvoqswz(k)-0.90)*qswz(k)*odtb)
1541 ! set max allowed evaporation to 90% of the amount that
1542 ! would induce saturation wrt liquid in a single step.
1543 tmpd = qswz(k)*xlv/(rvapor*tem(k)**2) ! d(qsat_liq)/dT
1544 tmpd = min( 0., 0.9*odtb*(qvz(k) + qlz(k) - qswz(k)) &
1545 / (1. + xlvocp * tmpd) )
1547 abr=2.0*pi*(qvoqswz(k)-1.0)*tmpc/(tmpa+tmpb)
1549 ! abr=2.0*pi*(qvoqswz(k)-0.90)*tmpc/(tmpa+tmpb)
1552 !c vf1r,vf2r=ventilation factors for rain
1553 !c vf1r=0.78,vf2r=0.31 in RH, LIN and MM5
1557 tmp1=consta*sqrho(k)*olambdar(k)**bp5/visc(k)
1558 tmp2=abr*xnor*( vf1r*olambdar(k)*olambdar(k)+ &
1559 vf2r*schmidt(k)**0.33334*gambp5o2*sqrt(tmp1) )
1560 tmp3=amin1( 0.0,tmp2 )
1561 tmp3=amax1( tmp3,tmpd )
1562 prevp(k)=amax1( tmp3,-qrzodt(k) )
1565 ! if(iout .gt. 0) write(20,*)'tmp1,tmp2,tmp3=',tmp1,tmp2,tmp3
1566 ! if(iout .gt. 0) write(20,*)'qlz,qiz,qrz=',qlz(k),qiz(k),qrz(k)
1567 ! if(iout .gt. 0) write(20,*)'tem,qsz,qvz=',tem(k),qsz(k),qvz(k)
1571 ! if (gindex .eq. 0.) goto 900
1573 if (tem(k) .lt. 273.15) then
1577 !***********************************************************************
1578 !********* graupel production processes for T < 0 C **********
1579 !***********************************************************************
1581 !c (1) AUTOCONVERSION OF SNOW TO FORM GRAUPEL (Pgaut): Lin (37)
1582 !c pgaut=alpha2*(qsz-qs0)
1584 !c alpha2=1.0e-3*exp(0.09*temcc(k)) Lin (38)
1586 alpha2=1.0e-3*exp(0.09*temcc(k))
1590 ! tmp1=alpha2*(qsz(k)-qs0)
1591 ! tmp1=amax1(0.0,tmp1)
1592 ! pgaut(k)=amin1( tmp1,qszodt(k) )
1594 tmp1=odtb*(qsz(k)-qs0)*(1.0-exp(-alpha2*dtb))
1595 pgaut(k)=amax1( 0.0,tmp1 )
1598 !c (2) FREEZING OF RAIN TO FORM GRAUPEL (Pgfr): Lin (45)
1600 !c Constant in Bigg freezing Aplume=Ap=0.66 /k
1601 !c Constant in raindrop freezing equ. Bplume=Bp=100./m/m/m/s
1604 if (qrz(k) .gt. 1.e-8 ) then
1607 tmp1=olambdar(k)*olambdar(k)*olambdar(k)
1608 tmp2=20.*pi*pi*Bp*xnor*rhowater*orho(k)* &
1609 (exp(-Ap*temcc(k))-1.0)*tmp1*tmp1*olambdar(k)
1610 Pgfr(k)=amin1( tmp2,qrzodt(k) )
1616 !c if (qgz(k) = 0.0) skip the other step below about graupel
1618 if (qgz(k) .eq. 0.0) goto 4000
1621 !c Comparing Pgwet(wet process) and Pdry(dry process),
1622 !c we will pick up the small one.
1626 !c | dry processes |
1629 !c (3) ACCRETION OF CLOUD WATER BY GRAUPEL (Pgacw): Lin (40)
1631 !c Cdrag=0.6 drag coefficients for hairstone
1632 !c constg=sqrt(4.*grav*rhograul*0.33334*orho(k)/Cdrag)
1635 constg=sqrt(4.*grav*rhograul*0.33334*orho(k)*oCdrag)
1636 tmp1=pio4*xnog*gam3pt5*constg*olambdag(k)**3.5
1637 tmp2=qlz(k)*egw*tmp1
1638 Pgacw(k)=amin1( tmp2,qlzodt(k) )
1640 !c (4) ACCRETION OF ICE CRYSTAL BY GRAUPEL (Pgaci): Lin (41)
1641 !c egi=1. for wet growth
1642 !c egi=0.1 for dry growth
1645 tmp2=qiz(k)*egi*tmp1
1646 pgaci(k)=amin1( tmp2,qizodt(k) )
1650 !c (5) ACCRETION OF SNOW BY GRAUPEL (Pgacs) : Lin (29)
1651 !c Compute processes (6) only when qsz > 0.0 and qgz > 0.0
1653 egs=exp(0.09*temcc(k))
1654 tmpa=olambdas(k)*olambdas(k)
1655 tmpb=olambdag(k)*olambdag(k)
1656 tmpc=olambdas(k)*olambdag(k)
1657 tmp1=pi*pi*xnos*xnog*abs( vts(k)-vtg(k) )*orho(k)
1658 tmp2=tmpa*tmpa*olambdag(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1659 tmp3=tmp1*egs*rhosnow*tmp2
1660 Pgacs(k)=amin1( tmp3,qszodt(k) )
1664 !c (6) ACCRETION OF RAIN BY GRAUPEL (Pgacr): Lin (42)
1665 !c Compute processes (6) only when qrz > 0.0 and qgz > 0.0
1669 tmpa=olambdar(k)*olambdar(k)
1670 tmpb=olambdag(k)*olambdag(k)
1671 tmpc=olambdar(k)*olambdag(k)
1672 tmp1=pi*pi*xnor*xnog*abs( vtr(k)-vtg(k) )*orho(k)
1673 tmp2=tmpa*tmpa*olambdag(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1674 tmp3=tmp1*egr*rhowater*tmp2
1675 pgacr(k)=amin1( tmp3,qrzodt(k) )
1678 !c (7) Calculate total dry process effect Pdry(k)
1680 Pdry(k)=Pgacw(k)+pgaci(k)+Pgacs(k)+pgacr(k)
1683 !c | wet processes |
1686 !c (3) ACCRETION OF ICE CRYSTAL BY GRAUPEL (Pgacip): Lin (41)
1687 !c egi=1. for wet growth
1688 !c egi=0.1 for dry growth
1691 pgacip(k)=amin1( tmp2,qizodt(k) )
1694 !c (4) ACCRETION OF SNOW BY GRAUPEL ((Pgacsp) : Lin (29)
1695 !c Compute processes (6) only when qsz > 0.0 and qgz > 0.0
1696 !c egs=exp(0.09*(tem(k)-273.15)) when T < 273.15 k
1698 tmp3=Pgacs(k)*1.0/egs
1699 Pgacsp(k)=amin1( tmp3,qszodt(k) )
1702 !c (5) WET GROWTH OF GRAUPEL (Pgwet) : Lin (43)
1703 !c may involve Pgacs or Pgaci and
1704 !c must include PPgacw or Pgacr, or both.
1705 !c ( The amount of Pgacw which is not able
1706 !c to freeze is shed to rain. )
1707 IF(temcc(k).gt.-40.)THEN
1709 term0=constg*olambdag(k)**5.5/visc(k)
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
1715 !c constg2=vf1s*olambdag(k)*olambdag(k)+
1716 !c vf2s*schmidt(k)**0.33334*gam2pt75*sqrt(term0)
1719 tmp0=1./(xlf+cw*temcc(k))
1720 tmp1=2.*pi*xnog*(rho(k)*xlv*diffwv(k)*delrs-xka(k)* &
1721 temcc(k))*orho(k)*tmp0
1722 constg2=vf1s*olambdag(k)*olambdag(k)+ &
1723 vf2s*schmidt(k)**0.33334*gam2pt75*sqrt(term0)
1724 tmp3=tmp1*constg2+(Pgacip(k)+Pgacsp(k))* &
1725 (1-Ci*temcc(k)*tmp0)
1726 tmp3=amax1(0.0,tmp3)
1727 Pgwet(k)=amin1(tmp3,qlzodt(k)+qszodt(k)+qizodt(k) ) !bloss
1730 !c Comparing Pgwet(wet process) and Pdry(dry process),
1731 !c we will apply the small one.
1732 !c if dry processes then delta4=1.0
1733 !c if wet processes then delta4=0.0
1735 if ( Pdry(k) .lt. Pgwet(k) ) then
1746 !c (6) Pgacrp(k)=Pgwet(k)-Pgacw(k)-Pgacip(k)-Pgacsp(k)
1747 !c if Pgacrp(k) > 0. then some of the rain is frozen to hail
1748 !c if Pgacrp(k) < 0. then some of the cloud water collected
1749 !c by the hail is unable to freeze and is
1752 Pgacrp(k)=Pgwet(k)-Pgacw(k)-Pgacip(k)-Pgacsp(k)
1755 !c (8) DEPOSITION/SUBLIMATION OF GRAUPEL (Pgdep/Pgsub): Lin (46)
1756 !c includes ventilation effect
1757 !c constg=sqrt(4.*grav*rhograul*0.33334*orho(k)/Cdrag)
1758 !c constg2=vf1s*olambdag(k)*olambdag(k)+
1759 !c vf2s*schmidt(k)**0.33334*gam2pt75*constg
1761 !c abg=2*pi*(Si-1)/rho/(A"+B")
1763 tmpa=rvapor*xka(k)*tem(k)*tem(k)
1764 tmpb=xls*xls*rho(k)*qsiz(k)*diffwv(k)
1765 tmpc=tmpa*qsiz(k)*diffwv(k)
1766 abg=2.0*pi*(qvoqsiz(k)-1.0)*tmpc/(tmpa+tmpb)
1768 !c vf1s,vf2s=ventilation factors for graupel
1769 !c vf1s=0.78,vf2s=0.31 in LIN
1770 !c Cdrag=0.6 drag coefficient for hairstone
1772 term0=constg*olambdag(k)**5.5/visc(k)
1773 constg2=vf1s*olambdag(k)*olambdag(k)+ &
1774 vf2s*schmidt(k)**0.33334*gam2pt75*sqrt(term0)
1775 tmp2=abg*xnog*constg2
1776 pgdep(k)=amax1(0.0,tmp2)
1777 pgsub(k)=amin1(0.0,tmp2)
1778 pgsub(k)=amax1( pgsub(k),-qgzodt(k) )
1783 !***********************************************************************
1784 !********* graupel production processes for T > 0 C **********
1785 !***********************************************************************
1788 !c (1) ACCRETION OF CLOUD WATER BY GRAUPEL (Pgacw): Lin (40)
1790 !c Cdrag=0.6 drag coefficients for hairstone
1791 !c constg=sqrt(4.*grav*rhograul*0.33334*orho(k)/Cdrag)
1794 constg=sqrt(4.*grav*rhograul*0.33334*orho(k)*oCdrag)
1795 tmp1=pio4*xnog*gam3pt5*constg*olambdag(k)**3.5
1796 tmp2=qlz(k)*egw*tmp1
1797 Pgacw(k)=amin1( tmp2,qlzodt(k) )
1800 !c (2) ACCRETION OF RAIN BY GRAUPEL (Pgacr): Lin (42)
1801 !c Compute processes (5) only when qrz > 0.0 and qgz > 0.0
1805 tmpa=olambdar(k)*olambdar(k)
1806 tmpb=olambdag(k)*olambdag(k)
1807 tmpc=olambdar(k)*olambdag(k)
1808 tmp1=pi*pi*xnor*xnog*abs( vtr(k)-vtg(k) )*orho(k)
1809 tmp2=tmpa*tmpa*olambdag(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1810 tmp3=tmp1*egr*rhowater*tmp2
1811 pgacr(k)=amin1( tmp3,qrzodt(k) )
1815 !c (3) GRAUPEL MELTING TO FORM RAIN (Pgmlt): Lin (47)
1816 !c Pgmlt is negative value
1817 !c constg=sqrt(4.*grav*rhograul*0.33334*orho(k)/Cdrag)
1818 !c constg2=vf1s*olambdag(k)*olambdag(k)+
1819 !c vf2s*schmidt(k)**0.33334*gam2pt75*constg
1820 !c Cdrag=0.6 drag coefficients for hairstone
1823 term1=2.0*pi*orho(k)*( xlv*diffwv(k)*rho(k)*delrs- &
1825 term0=sqrt(4.*grav*rhograul*0.33334*orho(k)*ocdrag) &
1826 *olambdag(k)**5.5/visc(k)
1828 constg2=vf1s*olambdag(k)*olambdag(k)+ &
1829 vf2s*schmidt(k)**0.33334*gam2pt75*sqrt(term0)
1831 tmp3=term1*oxlf*tmp2-cwoxlf*temcc(k)*( pgacw(k)+pgacr(k) )
1832 tmp4=amin1(0.0,tmp3)
1833 pgmlt(k)=amax1( tmp4,-qgzodt(k) )
1837 !c (4) EVAPORATION OF MELTING GRAUPEL (Pgmltevp) : HR (A19)
1838 !c but use Lin et al. coefficience
1839 !c Pgmltevp is a negative value
1840 !c abg=2.0*pi*(qvoqsiz(k)-1.0)*tmpc/(tmpa+tmpb)
1842 tmpa=rvapor*xka(k)*tem(k)*tem(k)
1843 tmpb=xlv*xlv*rho(k)*qswz(k)*diffwv(k)
1844 tmpc=tmpa*qswz(k)*diffwv(k)
1845 tmpd=amin1( 0.0,(qvoqswz(k)-0.90)*qswz(k)*odtb )
1848 !c abg=2*pi*(Si-1)/rho/(A"+B")
1850 abg=2.0*pi*(qvoqswz(k)-0.90)*tmpc/(tmpa+tmpb)
1852 !**** allow evaporation to occur when RH less than 90%
1853 !**** here not using 100% because the evaporation cooling
1854 !**** of temperature is not taking into account yet; hence,
1855 !**** the qgw value is a little bit larger. This will avoid
1856 !**** evaporation can generate cloud.
1858 !c vf1s,vf2s=ventilation factors for snow
1859 !c vf1s=0.78,vf2s=0.31 in LIN
1860 !c constg=sqrt(4.*grav*rhograul*0.33334*orho(k)/Cdrag)
1861 !c constg2=vf1s*olambdag(k)*olambdag(k)+
1862 !c vf2s*schmidt(k)**0.33334*gam2pt75*constg
1864 tmp2=abg*xnog*constg2
1865 tmp3=amin1(0.0,tmp2)
1866 tmp3=amax1( tmp3,tmpd )
1867 pgmltevp(k)=amax1( tmp3,-qgzodt(k) )
1870 !c (5) ACCRETION OF SNOW BY GRAUPEL (Pgacs) : Lin (29)
1871 !c Compute processes (3) only when qsz > 0.0 and qgz > 0.0
1875 tmpa=olambdas(k)*olambdas(k)
1876 tmpb=olambdag(k)*olambdag(k)
1877 tmpc=olambdas(k)*olambdag(k)
1878 tmp1=pi*pi*xnos*xnog*abs( vts(k)-vtg(k) )*orho(k)
1879 tmp2=tmpa*tmpa*olambdag(k)*(5.0*tmpa+2.0*tmpc+0.5*tmpb)
1880 tmp3=tmp1*egs*rhosnow*tmp2
1881 Pgacs(k)=amin1( tmp3,qszodt(k) )
1891 !c**********************************************************************
1892 !c***** combine all processes together and avoid negative *****
1893 !c***** water substances
1894 !***********************************************************************
1896 if ( temcc(k) .lt. 0.0) then
1899 !c gdelta4=gindex*delta4
1900 !c g1sdelt4=gindex*(1.-delta4)
1902 gdelta4=gindex*delta4
1903 g1sdelt4=gindex*(1.-delta4)
1905 !c combined water vapor depletions
1908 tmp=psdep(k)+pgdep(k)*gindex
1909 if ( tmp .gt. qvzodt(k) ) then
1910 factor=qvzodt(k)/tmp
1911 psdep(k)=psdep(k)*factor
1912 pgdep(k)=pgdep(k)*factor*gindex
1915 !c combined cloud water depletions
1917 tmp=praut(k)+psacw(k)+psfw(k)+pracw(k)+gindex*Pgacw(k)
1918 if ( tmp .gt. qlzodt(k) ) then
1919 factor=qlzodt(k)/tmp
1920 praut(k)=praut(k)*factor
1921 psacw(k)=psacw(k)*factor
1922 psfw(k)=psfw(k)*factor
1923 pracw(k)=pracw(k)*factor
1925 Pgacw(k)=Pgacw(k)*factor*gindex
1928 !c combined cloud ice depletions
1930 tmp=psaut(k)+psaci(k)+praci(k)+psfi(k)+Pgaci(k)*gdelta4 &
1932 if (tmp .gt. qizodt(k) ) then
1933 factor=qizodt(k)/tmp
1934 psaut(k)=psaut(k)*factor
1935 psaci(k)=psaci(k)*factor
1936 praci(k)=praci(k)*factor
1937 psfi(k)=psfi(k)*factor
1939 Pgaci(k)=Pgaci(k)*factor*gdelta4
1940 Pgacip(k)=Pgacip(k)*factor*g1sdelt4
1943 !c combined all rain processes
1945 tmp_r=piacr(k)+psacr(k)-prevp(k)-praut(k)-pracw(k) &
1946 +Pgfr(k)*gindex+Pgacr(k)*gdelta4 &
1948 if (tmp_r .gt. qrzodt(k) ) then
1949 factor=qrzodt(k)/tmp_r
1950 piacr(k)=piacr(k)*factor
1951 psacr(k)=psacr(k)*factor
1952 prevp(k)=prevp(k)*factor
1954 Pgfr(k)=Pgfr(k)*factor*gindex
1955 Pgacr(k)=Pgacr(k)*factor*gdelta4
1956 Pgacrp(k)=Pgacrp(k)*factor*g1sdelt4
1960 !c if qrz < 1.0E-4 and qsz < 1.0E-4 then delta2=1.
1961 !c (all Pracs and Psacr become to snow)
1962 !c if qrz >= 1.0E-4 or qsz >= 1.0E-4 then delta2=0.
1963 !c (all Pracs and Psacr become to graupel)
1965 if (qrz(k) .lt. 1.0E-4 .and. qsz(k) .lt. 1.0E-4) then
1974 !c if qrz(k) < 1.0e-4 then delta3=1. means praci(k) --> qs
1976 !c if qrz(k) > 1.0e-4 then delta3=0. means praci(k) --> qg
1977 !c piacr(k) --> qg : Lin (20)
1979 if (qrz(k) .lt. 1.0e-4) then
1986 !c if gindex = 0.(no graupel) then delta2=1.0
1989 if (gindex .eq. 0.) then
1995 !c combined all snow processes
1997 tmp_s=-pssub(k)-(psaut(k)+psaci(k)+psacw(k)+psfw(k)+ &
1998 psfi(k)+praci(k)*delta3+piacr(k)*delta3+ &
1999 psdep(k))+Pgaut(k)*gindex+Pgacs(k)*gdelta4+ &
2000 Pgacsp(k)*g1sdelt4+Pracs(k)*(1.-delta2)- &
2002 if ( tmp_s .gt. qszodt(k) ) then
2003 factor=qszodt(k)/tmp_s
2004 pssub(k)=pssub(k)*factor
2005 Pracs(k)=Pracs(k)*factor
2007 Pgaut(k)=Pgaut(k)*factor*gindex
2008 Pgacs(k)=Pgacs(k)*factor*gdelta4
2009 Pgacsp(k)=Pgacsp(k)*factor*g1sdelt4
2015 ! if (gindex .eq. 0.) goto 998
2017 !c combined all graupel processes
2019 if(delta4.lt.0.5) then
2020 !Re-define pgwet to account for limiting of pgacrp,
2021 ! pgacip, pgacw and pgacsp above
2022 pgwet(k) = pgacrp(k) + pgacw(k) + pgacip(k) + pgacsp(k)
2024 tmp_g=-pgaut(k)-pgfr(k)-Pgacw(k)*delta4-Pgaci(k)*delta4 &
2025 -Pgacr(k)*delta4-Pgacs(k)*delta4 &
2026 -pgwet(k)*(1.-delta4)-pgsub(k)-pgdep(k) &
2027 -psacr(k)*(1-delta2)-Pracs(k)*(1-delta2) &
2028 -praci(k)*(1-delta3)-piacr(k)*(1-delta3)
2029 if (tmp_g .gt. qgzodt(k)) then
2030 factor=qgzodt(k)/tmp_g
2031 pgsub(k)=pgsub(k)*factor
2036 !c calculate new water substances, thetae, tem, and qvsbar
2040 pvapor(k)=-pssub(k)-psdep(k)-prevp(k)-pgsub(k)*gindex &
2042 qvz(k)=amax1( qvmin,qvz(k)+dtb*pvapor(k) )
2043 pclw(k)=-praut(k)-pracw(k)-psacw(k)-psfw(k)-pgacw(k)*gindex
2045 if( qlz(k) > 1e-20 ) &
2046 qndropz(k)=amax1( 0.0,qndropz(k)+dtb*pclw(k)*qndropz(k)/qlz(k) ) !sg
2048 qlz(k)=amax1( 0.0,qlz(k)+dtb*pclw(k) )
2049 pcli(k)=-psaut(k)-psfi(k)-psaci(k)-praci(k)-pgaci(k)*gdelta4 &
2051 qiz(k)=amax1( 0.0,qiz(k)+dtb*pcli(k) )
2052 tmp_r=piacr(k)+psacr(k)-prevp(k)-praut(k)-pracw(k) &
2053 +Pgfr(k)*gindex+Pgacr(k)*gdelta4 &
2055 232 format(i2,1x,6(f9.3,1x))
2057 qrz(k)=amax1( 0.0,qrz(k)+dtb*prain(k) )
2058 tmp_s=-pssub(k)-(psaut(k)+psaci(k)+psacw(k)+psfw(k)+ &
2059 psfi(k)+praci(k)*delta3+piacr(k)*delta3+ &
2060 psdep(k))+Pgaut(k)*gindex+Pgacs(k)*gdelta4+ &
2061 Pgacsp(k)*g1sdelt4+Pracs(k)*(1.-delta2)- &
2064 qsz(k)=amax1( 0.0,qsz(k)+dtb*psnow(k) )
2065 qschg(k)=qschg(k)+psnow(k)
2068 tmp_g=-pgaut(k)-pgfr(k)-Pgacw(k)*delta4-Pgaci(k)*delta4 &
2069 -Pgacr(k)*delta4-Pgacs(k)*delta4 &
2070 -pgwet(k)*(1.-delta4)-pgsub(k)-pgdep(k) &
2071 -psacr(k)*(1-delta2)-Pracs(k)*(1-delta2) &
2072 -praci(k)*(1-delta3)-piacr(k)*(1-delta3)
2073 252 format(i2,1x,6(f12.9,1x))
2074 262 format(i2,1x,7(f12.9,1x))
2076 pgraupel(k)=pgraupel(k)*gindex
2077 qgz(k)=amax1( 0.0,qgz(k)+dtb*pgraupel(k))
2078 ! qgchg(k)=qgchg(k)+pgraupel(k)
2079 qgchg(k)=pgraupel(k)
2080 qgz(k)=qgz(k)*gindex
2082 tmp=ocp/tothz(k)*xLf*(qschg(k)+qgchg(k))
2083 theiz(k)=theiz(k)+dtb*tmp
2084 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2085 tem(k)=thz(k)*tothz(k)
2087 temcc(k)=tem(k)-273.15
2089 !bloss: Moves computation of saturation mixing ratio below
2091 ! if( temcc(k) .lt. -40.0 ) qswz(k)=qsiz(k)
2092 ! qlpqi=qlz(k)+qiz(k)
2093 ! if ( qlpqi .eq. 0.0 ) then
2096 ! qvsbar(k)=( qiz(k)*qsiz(k)+qlz(k)*qswz(k) )/qlpqi
2102 !c combined cloud water depletions
2104 tmp=praut(k)+psacw(k)+pracw(k)+pgacw(k)*gindex
2105 if ( tmp .gt. qlzodt(k) ) then
2106 factor=qlzodt(k)/tmp
2107 praut(k)=praut(k)*factor
2108 psacw(k)=psacw(k)*factor
2109 pracw(k)=pracw(k)*factor
2111 pgacw(k)=pgacw(k)*factor*gindex
2114 !c combined all snow processes
2116 tmp_s=-(psmlt(k)+psmltevp(k))+Pgacs(k)*gindex
2117 if (tmp_s .gt. qszodt(k) ) then
2118 factor=qszodt(k)/tmp_s
2119 psmlt(k)=psmlt(k)*factor
2120 psmltevp(k)=psmltevp(k)*factor
2122 Pgacs(k)=Pgacs(k)*factor*gindex
2129 ! if (gindex .eq. 0.) goto 997
2132 !c combined all graupel processes
2134 tmp_g=-pgmlt(k)-pgacs(k)-pgmltevp(k)
2135 if (tmp_g .gt. qgzodt(k)) then
2136 factor=qgzodt(k)/tmp_g
2137 pgmltevp(k)=pgmltevp(k)*factor
2138 pgmlt(k)=pgmlt(k)*factor
2144 !c combined all rain processes
2146 tmp_r=-prevp(k)-(praut(k)+pracw(k)+psacw(k)-psmlt(k)) &
2147 +pgmlt(k)*gindex-pgacw(k)*gindex
2148 if (tmp_r .gt. qrzodt(k) ) then
2149 factor=qrzodt(k)/tmp_r
2150 prevp(k)=prevp(k)*factor
2154 !c calculate new water substances and thetae
2158 pvapor(k)=-psmltevp(k)-prevp(k)-pgmltevp(k)*gindex
2159 qvz(k)=amax1( qvmin,qvz(k)+dtb*pvapor(k))
2160 pclw(k)=-praut(k)-pracw(k)-psacw(k)-pgacw(k)*gindex
2162 if( qlz(k) > 1e-20 ) &
2163 qndropz(k)=amax1( 0.0,qndropz(k)+dtb*pclw(k)*qndropz(k)/qlz(k) ) !sg
2165 qlz(k)=amax1( 0.0,qlz(k)+dtb*pclw(k) )
2167 qiz(k)=amax1( 0.0,qiz(k)+dtb*pcli(k) )
2168 tmp_r=-prevp(k)-(praut(k)+pracw(k)+psacw(k)-psmlt(k)) &
2169 +pgmlt(k)*gindex-pgacw(k)*gindex
2170 242 format(i2,1x,7(f9.6,1x))
2173 qrz(k)=amax1( 0.0,qrz(k)+dtb*prain(k) )
2174 tmp_s=-(psmlt(k)+psmltevp(k))+Pgacs(k)*gindex
2176 qsz(k)=amax1( 0.0,qsz(k)+dtb*psnow(k) )
2177 ! qschg(k)=qschg(k)+psnow(k)
2181 tmp_g=-pgmlt(k)-pgacs(k)-pgmltevp(k)
2182 ! write(*,272)k,pgmlt(k),pgacs(k),pgmltevp(k),
2183 272 format(i2,1x,3(f12.9,1x))
2184 pgraupel(k)=-tmp_g*gindex
2185 qgz(k)=amax1( 0.0,qgz(k)+dtb*pgraupel(k))
2186 ! qgchg(k)=qgchg(k)+pgraupel(k)
2187 qgchg(k)=pgraupel(k)
2188 qgz(k)=qgz(k)*gindex
2190 tmp=ocp/tothz(k)*xLf*(qschg(k)+qgchg(k))
2191 theiz(k)=theiz(k)+dtb*tmp
2192 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2194 tem(k)=thz(k)*tothz(k)
2195 temcc(k)=tem(k)-273.15
2196 ! qswz(k)=episp0k*oprez(k)* &
2197 ! exp( svp2*temcc(k)/(tem(k)-svp3) )
2199 !bloss: Moved computation of saturation mixing ratio below
2201 ! es=1000.*svp1*exp( svp2*temcc(k)/(tem(k)-svp3) )
2202 ! qswz(k)=ep2*es/(prez(k)-es)
2207 preclw(k)=pclw(k) !sg
2210 !***********************************************************************
2211 !********** saturation adjustment **********
2212 !***********************************************************************
2215 ! compute saturation specific humidity at the temperature
2216 ! which would be experienced if all cloud liquid and ice
2217 ! were to become vapor. This will make for a consistent
2218 ! check of saturation. Previously, qvsbar was computed
2219 ! without accounting for the change in temperature due to
2220 ! evaporation/sublimation, and as a result would
2221 ! incorrectly identify some points as subsaturated.
2223 tmp_tem = tem(k) ! updated temperature from above.
2225 if(qlz(k)+qiz(k).gt. 0.) then
2226 ! account for latent heat if all qlz and qiz were converted to vapor
2227 tmp_tem = tem(k) - xlvocp*qlz(k) - (xlvocp+xlfocp)*qiz(k)
2230 ! compute temperature in celsius
2231 tmp_temcc = tmp_tem - 273.15
2233 ! estimate lower bound on saturation vapor pressure
2234 ! (ice if <0C, liquid aboce)
2235 if (tmp_temcc .lt. 0.) then
2236 es=1000.*svp1*exp( 21.8745584*(tmp_tem-273.16)/(tmp_tem-7.66) ) !ice
2238 es=1000.*svp1*exp( svp2*tmp_temcc/(tmp_tem-svp3) ) !liquid
2241 ! compute lower bound on saturation mixing ratio.
2242 qvsbar(k)=ep2*es/(prez(k)-es)
2246 ! allow supersaturation exits linearly from 0% at 500 mb to 50%
2248 ! 5.0e-5=1.0/(500mb-300mb)
2250 rsat=1.0+0.5*(50000.0-prez(k))*5.0e-5
2251 rsat=amax1(1.0,rsat)
2252 rsat=amin1(1.5,rsat)
2254 if( qvz(k)+qlz(k)+qiz(k) .lt. rsat*qvsbar(k) ) then
2259 qvz(k)=qvz(k)+qlz(k)+qiz(k)
2263 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2264 tem(k)=thz(k)*tothz(k)
2265 temcc(k)=tem(k)-273.15
2278 CALL satadj(qvz, qlz, qiz, prez, theiz, thz, tothz, kts, kte, &
2279 k, xLvocp, xLfocp, episp0k, EP2,SVP1,SVP2,SVP3,SVPT0 )
2282 pladj(k)=odtb*(qlz(k)-pladj(k))
2283 piadj(k)=odtb*(qiz(k)-piadj(k))
2285 pclw(k)=pclw(k)+pladj(k)
2286 pcli(k)=pcli(k)+piadj(k)
2287 pvapor(k)=pvapor(k)-( pladj(k)+piadj(k) )
2289 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2290 tem(k)=thz(k)*tothz(k)
2292 temcc(k)=tem(k)-273.15
2294 ! qswz(k)=episp0k*oprez(k)* &
2295 ! exp( svp2*temcc(k)/(tem(k)-svp3) )
2296 es=1000.*svp1*exp( svp2*temcc(k)/(tem(k)-svp3) )
2297 qswz(k)=ep2*es/(prez(k)-es)
2298 if (tem(k) .lt. 273.15 ) then
2299 ! qsiz(k)=episp0k*oprez(k)* &
2300 ! exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
2301 es=1000.*svp1*exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
2302 qsiz(k)=ep2*es/(prez(k)-es)
2303 if (temcc(k) .lt. -40.0) qswz(k)=qsiz(k)
2308 if ( qlpqi .eq. 0.0 ) then
2311 qvsbar(k)=( qiz(k)*qsiz(k)+qlz(k)*qswz(k) )/qlpqi
2317 !***********************************************************************
2318 !***** melting and freezing of cloud ice and cloud water *****
2319 !***********************************************************************
2321 if(qlpqi .le. 0.0) go to 1800
2324 !c (1) HOMOGENEOUS NUCLEATION WHEN T< -40 C (Pihom)
2326 if(temcc(k) .lt. -40.0) pihom(k)=qlz(k)*odtb
2328 !c (2) MELTING OF ICE CRYSTAL WHEN T> 0 C (Pimlt)
2330 if(temcc(k) .gt. 0.0) pimlt(k)=qiz(k)*odtb
2332 !c (3) PRODUCTION OF CLOUD ICE BY BERGERON PROCESS (Pidw): Hsie (p957)
2333 !c this process only considered when -31 C < T < 0 C
2335 if(temcc(k) .lt. 0.0 .and. temcc(k) .gt. -31.0) then
2337 !c! parama1 and parama2 functions must be user supplied
2339 a1=parama1( temcc(k) )
2340 a2=parama2( temcc(k) )
2341 !! change unit from cgs to mks
2342 a1=a1*0.001**(1.0-a2)
2343 xnin=xni0*exp(-bni*temcc(k))
2344 pidw(k)=xnin*orho(k)*(a1*xmnin**a2)
2347 pcli(k)=pcli(k)+pihom(k)-pimlt(k)+pidw(k)
2348 pclw(k)=pclw(k)-pihom(k)+pimlt(k)-pidw(k)
2349 qlz(k)=amax1( 0.0,qlz(k)+dtb*(-pihom(k)+pimlt(k)-pidw(k)) )
2350 qiz(k)=amax1( 0.0,qiz(k)+dtb*(pihom(k)-pimlt(k)+pidw(k)) )
2353 CALL satadj(qvz, qlz, qiz, prez, theiz, thz, tothz, kts, kte, &
2354 k, xLvocp, xLfocp, episp0k ,EP2,SVP1,SVP2,SVP3,SVPT0)
2356 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2357 tem(k)=thz(k)*tothz(k)
2359 temcc(k)=tem(k)-273.15
2361 ! qswz(k)=episp0k*oprez(k)* &
2362 ! exp( svp2*temcc(k)/(tem(k)-svp3) )
2363 es=1000.*svp1*exp( svp2*temcc(k)/(tem(k)-svp3) )
2364 qswz(k)=ep2*es/(prez(k)-es)
2366 if (tem(k) .lt. 273.15 ) then
2367 ! qsiz(k)=episp0k*oprez(k)* &
2368 ! exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
2369 es=1000.*svp1*exp( 21.8745584*(tem(k)-273.16)/(tem(k)-7.66) )
2370 qsiz(k)=ep2*es/(prez(k)-es)
2371 if (temcc(k) .lt. -40.0) qswz(k)=qsiz(k)
2376 if ( qlpqi .eq. 0.0 ) then
2379 qvsbar(k)=( qiz(k)*qsiz(k)+qlz(k)*qswz(k) )/qlpqi
2384 !***********************************************************************
2385 !********** integrate the productions of rain and snow **********
2386 !***********************************************************************
2392 !---------------------------------------------------------------------
2395 !***********************************************************************
2396 !****** Write terms in cloud physics to time series dataset *****
2397 !***********************************************************************
2399 ! open(unit=24,form='formatted',status='new',
2400 ! & file='cloud.dat')
2402 !9030 format(10e12.6)
2405 ! write(24,9030) (tem(k),k=kts+1,kte)
2407 ! write(24,9030) (qiz(k),k=kts+1,kte)
2409 ! write(24,9030) (qsz(k),k=kts+1,kte)
2411 ! write(24,9030) (qrz(k),k=kts+1,kte)
2413 ! write(24,9030) (qgz(k),k=kts+1,kte)
2414 ! write(24,*)'qvoqsw'
2415 ! write(24,9030) (qvoqswz(k),k=kts+1,kte)
2416 ! write(24,*)'qvoqsi'
2417 ! write(24,9030) (qvoqsiz(k),k=kts+1,kte)
2419 ! write(24,9030) (vtr(k),k=kts+1,kte)
2421 ! write(24,9030) (vts(k),k=kts+1,kte)
2423 ! write(24,9030) (vtg(k),k=kts+1,kte)
2425 ! write(24,9030) (pclw(k),k=kts+1,kte)
2426 ! write(24,*)'pvapor'
2427 ! write(24,9030) (pvapor(k),k=kts+1,kte)
2429 ! write(24,9030) (pcli(k),k=kts+1,kte)
2430 ! write(24,*)'pimlt'
2431 ! write(24,9030) (pimlt(k),k=kts+1,kte)
2432 ! write(24,*)'pihom'
2433 ! write(24,9030) (pihom(k),k=kts+1,kte)
2435 ! write(24,9030) (pidw(k),k=kts+1,kte)
2436 ! write(24,*)'prain'
2437 ! write(24,9030) (prain(k),k=kts+1,kte)
2438 ! write(24,*)'praut'
2439 ! write(24,9030) (praut(k),k=kts+1,kte)
2440 ! write(24,*)'pracw'
2441 ! write(24,9030) (pracw(k),k=kts+1,kte)
2442 ! write(24,*)'prevp'
2443 ! write(24,9030) (prevp(k),k=kts+1,kte)
2444 ! write(24,*)'psnow'
2445 ! write(24,9030) (psnow(k),k=kts+1,kte)
2446 ! write(24,*)'psaut'
2447 ! write(24,9030) (psaut(k),k=kts+1,kte)
2449 ! write(24,9030) (psfw(k),k=kts+1,kte)
2451 ! write(24,9030) (psfi(k),k=kts+1,kte)
2452 ! write(24,*)'praci'
2453 ! write(24,9030) (praci(k),k=kts+1,kte)
2454 ! write(24,*)'piacr'
2455 ! write(24,9030) (piacr(k),k=kts+1,kte)
2456 ! write(24,*)'psaci'
2457 ! write(24,9030) (psaci(k),k=kts+1,kte)
2458 ! write(24,*)'psacw'
2459 ! write(24,9030) (psacw(k),k=kts+1,kte)
2460 ! write(24,*)'psdep'
2461 ! write(24,9030) (psdep(k),k=kts+1,kte)
2462 ! write(24,*)'pssub'
2463 ! write(24,9030) (pssub(k),k=kts+1,kte)
2464 ! write(24,*)'pracs'
2465 ! write(24,9030) (pracs(k),k=kts+1,kte)
2466 ! write(24,*)'psacr'
2467 ! write(24,9030) (psacr(k),k=kts+1,kte)
2468 ! write(24,*)'psmlt'
2469 ! write(24,9030) (psmlt(k),k=kts+1,kte)
2470 ! write(24,*)'psmltevp'
2471 ! write(24,9030) (psmltevp(k),k=kts+1,kte)
2472 ! write(24,*)'pladj'
2473 ! write(24,9030) (pladj(k),k=kts+1,kte)
2474 ! write(24,*)'piadj'
2475 ! write(24,9030) (piadj(k),k=kts+1,kte)
2476 ! write(24,*)'pgraupel'
2477 ! write(24,9030) (pgraupel(k),k=kts+1,kte)
2478 ! write(24,*)'pgaut'
2479 ! write(24,9030) (pgaut(k),k=kts+1,kte)
2481 ! write(24,9030) (pgfr(k),k=kts+1,kte)
2482 ! write(24,*)'pgacw'
2483 ! write(24,9030) (pgacw(k),k=kts+1,kte)
2484 ! write(24,*)'pgaci'
2485 ! write(24,9030) (pgaci(k),k=kts+1,kte)
2486 ! write(24,*)'pgacr'
2487 ! write(24,9030) (pgacr(k),k=kts+1,kte)
2488 ! write(24,*)'pgacs'
2489 ! write(24,9030) (pgacs(k),k=kts+1,kte)
2490 ! write(24,*)'pgacip'
2491 ! write(24,9030) (pgacip(k),k=kts+1,kte)
2492 ! write(24,*)'pgacrP'
2493 ! write(24,9030) (pgacrP(k),k=kts+1,kte)
2494 ! write(24,*)'pgacsp'
2495 ! write(24,9030) (pgacsp(k),k=kts+1,kte)
2496 ! write(24,*)'pgwet'
2497 ! write(24,9030) (pgwet(k),k=kts+1,kte)
2499 ! write(24,9030) (pdry(k),k=kts+1,kte)
2500 ! write(24,*)'pgsub'
2501 ! write(24,9030) (pgsub(k),k=kts+1,kte)
2502 ! write(24,*)'pgdep'
2503 ! write(24,9030) (pgdep(k),k=kts+1,kte)
2504 ! write(24,*)'pgmlt'
2505 ! write(24,9030) (pgmlt(k),k=kts+1,kte)
2506 ! write(24,*)'pgmltevp'
2507 ! write(24,9030) (pgmltevp(k),k=kts+1,kte)
2511 !**** below if qv < qvmin then qv=qvmin, ql=0.0, and qi=0.0
2514 if ( qvz(k) .lt. qvmin ) then
2517 qvz(k)=amax1( qvmin,qvz(k)+qlz(k)+qiz(k) )
2521 END SUBROUTINE clphy1d
2524 !---------------------------------------------------------------------
2525 ! SATURATED ADJUSTMENT
2526 !---------------------------------------------------------------------
2527 SUBROUTINE satadj(qvz, qlz, qiz, prez, theiz, thz, tothz, &
2528 kts, kte, k, xLvocp, xLfocp, episp0k, EP2,SVP1,SVP2,SVP3,SVPT0)
2529 !---------------------------------------------------------------------
2531 !---------------------------------------------------------------------
2532 ! This program use Newton's method for finding saturated temperature
2533 ! and saturation mixing ratio.
2535 ! In this saturation adjustment scheme we assume
2536 ! (1) the saturation mixing ratio is the mass weighted average of
2537 ! saturation values over liquid water (qsw), and ice (qsi)
2538 ! following Lord et al., 1984 and Tao, 1989
2540 ! (2) the percentage of cloud liquid and cloud ice will
2541 ! be fixed during the saturation calculation
2542 !---------------------------------------------------------------------
2545 INTEGER, INTENT(IN ) :: kts, kte, k
2547 REAL, DIMENSION( kts:kte ), &
2548 INTENT(INOUT) :: qvz, qlz, qiz
2550 REAL, DIMENSION( kts:kte ), &
2551 INTENT(IN ) :: prez, theiz, tothz
2553 REAL, INTENT(IN ) :: xLvocp, xLfocp, episp0k
2554 REAL, INTENT(IN ) :: EP2,SVP1,SVP2,SVP3,SVPT0
2560 REAL, DIMENSION( kts:kte ) :: thz, tem, temcc, qsiz, &
2563 REAL :: qsat, qlpqi, ratql, t0, t1, tmp1, ratqi, tsat, absft, &
2564 denom1, denom2, dqvsbar, ftsat, dftsat, qpz, &
2567 REAL :: tem_noliqice, qsat_noliqice !bloss
2569 !---------------------------------------------------------------------
2571 thz(k)=theiz(k)-(xLvocp*qvz(k)-xLfocp*qiz(k))/tothz(k)
2573 tem(k)=tothz(k)*thz(k)
2576 tem_noliqice = tem(k) - xlvocp*qlz(k) - (xLvocp+xLfocp)*qiz(k)
2578 if (tem_noliqice .gt. 273.15) then
2579 es=1000.*svp1*exp( svp2*(tem_noliqice-svpt0)/(tem_noliqice-svp3) )
2580 qsat_noliqice=ep2*es/(prez(k)-es)
2582 qsat_noliqice=episp0k/prez(k)* &
2583 exp( 21.8745584*(tem_noliqice-273.15)/(tem_noliqice-7.66) )
2586 qpz=qvz(k)+qlz(k)+qiz(k)
2587 if (qpz .lt. qsat_noliqice) then
2594 if( qlpqi .ge. 1.0e-5) then
2601 tmp1=( t0-tem(k) )/(t0-t1)
2602 tmp1=amin1(1.0,tmp1)
2603 tmp1=amax1(0.0,tmp1)
2609 !-- saturation mixing ratios over water and ice
2610 !-- at the outset we will follow Bolton 1980 MWR for
2611 !-- the water and Murray JAS 1967 for the ice
2613 !-- dqvsbar=d(qvsbar)/dT
2615 !-- dftsat=d(F(T))/dT
2617 ! First guess of tsat
2623 denom1=1.0/(tsat-svp3)
2624 denom2=1.0/(tsat-7.66)
2625 ! qswz(k)=episp0k/prez(k)* &
2626 ! exp( svp2*denom1*(tsat-273.15) )
2627 es=1000.*svp1*exp( svp2*denom1*(tsat-svpt0) )
2628 qswz(k)=ep2*es/(prez(k)-es)
2629 if (tem(k) .lt. 273.15) then
2630 ! qsiz(k)=episp0k/prez(k)* &
2631 ! exp( 21.8745584*denom2*(tsat-273.15) )
2632 es=1000.*svp1*exp( 21.8745584*denom2*(tsat-273.15) )
2633 qsiz(k)=ep2*es/(prez(k)-es)
2634 if (tem(k) .lt. 233.15) qswz(k)=qsiz(k)
2638 qvsbar(k)=ratql*qswz(k)+ratqi*qsiz(k)
2640 ! if( absft .lt. 0.01 .and. n .gt. 3 ) go to 300
2641 if( absft .lt. 0.01 ) go to 300
2643 dqvsbar=ratql*qswz(k)*svp2*243.5*denom1*denom1+ &
2644 ratqi*qsiz(k)*21.8745584*265.5*denom2*denom2
2645 ftsat=tsat+(xlvocp+ratqi*xlfocp)*qvsbar(k)- &
2646 tothz(k)*theiz(k)-xlfocp*ratqi*(qvz(k)+qlz(k)+qiz(k))
2647 dftsat=1.0+(xlvocp+ratqi*xlfocp)*dqvsbar
2648 tsat=tsat-ftsat/dftsat
2652 9020 format(1x,'point can not converge, absft,n=',e12.5,i5)
2655 if( qpz .gt. qvsbar(k) ) then
2657 qiz(k)=ratqi*( qpz-qvz(k) )
2658 qlz(k)=ratql*( qpz-qvz(k) )
2666 END SUBROUTINE satadj
2669 !----------------------------------------------------------------
2670 REAL FUNCTION parama1(temp)
2671 !----------------------------------------------------------------
2673 !----------------------------------------------------------------
2674 ! This program calculate the parameter for crystal growth rate
2675 ! in Bergeron process
2676 !----------------------------------------------------------------
2678 REAL, INTENT (IN ) :: temp
2679 REAL, DIMENSION(32) :: a1
2683 data a1/0.100e-10,0.7939e-7,0.7841e-6,0.3369e-5,0.4336e-5, &
2684 0.5285e-5,0.3728e-5,0.1852e-5,0.2991e-6,0.4248e-6, &
2685 0.7434e-6,0.1812e-5,0.4394e-5,0.9145e-5,0.1725e-4, &
2686 0.3348e-4,0.1725e-4,0.9175e-5,0.4412e-5,0.2252e-5, &
2687 0.9115e-6,0.4876e-6,0.3473e-6,0.4758e-6,0.6306e-6, &
2688 0.8573e-6,0.7868e-6,0.7192e-6,0.6513e-6,0.5956e-6, &
2689 0.5333e-6,0.4834e-6/
2693 ratio=-(temp)-float(i1-1)
2694 parama1=a1(i1)+ratio*( a1(i1p1)-a1(i1) )
2696 END FUNCTION parama1
2698 !----------------------------------------------------------------
2699 REAL FUNCTION parama2(temp)
2700 !----------------------------------------------------------------
2702 !----------------------------------------------------------------
2703 ! This program calculate the parameter for crystal growth rate
2704 ! in Bergeron process
2705 !----------------------------------------------------------------
2707 REAL, INTENT (IN ) :: temp
2708 REAL, DIMENSION(32) :: a2
2712 data a2/0.0100,0.4006,0.4831,0.5320,0.5307,0.5319,0.5249, &
2713 0.4888,0.3849,0.4047,0.4318,0.4771,0.5183,0.5463, &
2714 0.5651,0.5813,0.5655,0.5478,0.5203,0.4906,0.4447, &
2715 0.4126,0.3960,0.4149,0.4320,0.4506,0.4483,0.4460, &
2716 0.4433,0.4413,0.4382,0.4361/
2719 ratio=-(temp)-float(i1-1)
2720 parama2=a2(i1)+ratio*( a2(i1p1)-a2(i1) )
2722 END FUNCTION parama2
2724 !----------------------------------------------------------------
2725 REAL FUNCTION ggamma(X)
2726 !----------------------------------------------------------------
2728 !----------------------------------------------------------------
2729 REAL, INTENT(IN ) :: x
2730 REAL, DIMENSION(8) :: B
2732 REAL ::PF, G1TO2 ,TEMP
2734 DATA B/-.577191652,.988205891,-.897056937,.918206857, &
2735 -.756704078,.482199394,-.193527818,.035868343/
2740 IF (TEMP .LE. 2) GO TO 20
2743 100 FORMAT(//,5X,'module_mp_lin: INPUT TO GAMMA FUNCTION TOO LARGE, X=',E12.5)
2744 WRITE(wrf_err_message,100)X
2745 CALL wrf_error_fatal(wrf_err_message)
2749 30 G1TO2=G1TO2 + B(K1)*TEMP**K1
2754 !----------------------------------------------------------------
2756 !+---+-----------------------------------------------------------------+
2757 subroutine refl10cm_lin (qv1d, qr1d, qs1d, qg1d, &
2758 t1d, p1d, dBZ, kts, kte, ii, jj)
2763 INTEGER, INTENT(IN):: kts, kte, ii, jj
2764 REAL, DIMENSION(kts:kte), INTENT(IN):: &
2765 qv1d, qr1d, qs1d, qg1d, t1d, p1d
2766 REAL, DIMENSION(kts:kte), INTENT(INOUT):: dBZ
2769 REAL, DIMENSION(kts:kte):: temp, pres, qv, rho
2770 REAL, DIMENSION(kts:kte):: rr, rs, rg
2772 DOUBLE PRECISION, DIMENSION(kts:kte):: ilamr, ilams, ilamg
2773 DOUBLE PRECISION, DIMENSION(kts:kte):: N0_r, N0_s, N0_g
2774 DOUBLE PRECISION:: lamr, lams, lamg
2775 LOGICAL, DIMENSION(kts:kte):: L_qr, L_qs, L_qg
2777 REAL, DIMENSION(kts:kte):: ze_rain, ze_snow, ze_graupel
2778 DOUBLE PRECISION:: fmelt_s, fmelt_g
2780 INTEGER:: i, k, k_0, kbot, n
2783 DOUBLE PRECISION:: cback, x, eta, f_d
2784 REAL, PARAMETER:: R=287.
2785 REAL, PARAMETER:: PIx=3.1415926536
2793 !+---+-----------------------------------------------------------------+
2794 !..Put column of data into local arrays.
2795 !+---+-----------------------------------------------------------------+
2798 qv(k) = MAX(1.E-10, qv1d(k))
2800 rho(k) = 0.622*pres(k)/(R*temp(k)*(qv(k)+0.622))
2802 if (qr1d(k) .gt. 1.E-9) then
2803 rr(k) = qr1d(k)*rho(k)
2805 lamr = (xam_r*xcrg(3)*N0_r(k)/rr(k))**(1./xcre(1))
2813 if (qs1d(k) .gt. 1.E-9) then
2814 rs(k) = qs1d(k)*rho(k)
2816 lams = (xam_s*xcsg(3)*N0_s(k)/rs(k))**(1./xcse(1))
2824 if (qg1d(k) .gt. 1.E-9) then
2825 rg(k) = qg1d(k)*rho(k)
2827 lamg = (xam_g*xcgg(3)*N0_g(k)/rg(k))**(1./xcge(1))
2836 !+---+-----------------------------------------------------------------+
2837 !..Locate K-level of start of melting (k_0 is level above).
2838 !+---+-----------------------------------------------------------------+
2841 do k = kte-1, kts, -1
2842 if ( (temp(k).gt.273.15) .and. L_qr(k) &
2843 .and. (L_qs(k+1).or.L_qg(k+1)) ) then
2851 !+---+-----------------------------------------------------------------+
2852 !..Assume Rayleigh approximation at 10 cm wavelength. Rain (all temps)
2853 !.. and non-water-coated snow and graupel when below freezing are
2854 !.. simple. Integrations of m(D)*m(D)*N(D)*dD.
2855 !+---+-----------------------------------------------------------------+
2860 ze_graupel(k) = 1.e-22
2861 if (L_qr(k)) ze_rain(k) = N0_r(k)*xcrg(4)*ilamr(k)**xcre(4)
2862 if (L_qs(k)) ze_snow(k) = (0.176/0.93) * (6.0/PIx)*(6.0/PIx) &
2863 * (xam_s/900.0)*(xam_s/900.0) &
2864 * N0_s(k)*xcsg(4)*ilams(k)**xcse(4)
2865 if (L_qg(k)) ze_graupel(k) = (0.176/0.93) * (6.0/PIx)*(6.0/PIx) &
2866 * (xam_g/900.0)*(xam_g/900.0) &
2867 * N0_g(k)*xcgg(4)*ilamg(k)**xcge(4)
2871 !+---+-----------------------------------------------------------------+
2872 !..Special case of melting ice (snow/graupel) particles. Assume the
2873 !.. ice is surrounded by the liquid water. Fraction of meltwater is
2874 !.. extremely simple based on amount found above the melting level.
2875 !.. Uses code from Uli Blahak (rayleigh_soak_wetgraupel and supporting
2877 !+---+-----------------------------------------------------------------+
2879 if (melti .and. k_0.ge.kts+1) then
2880 do k = k_0-1, kts, -1
2882 !..Reflectivity contributed by melting snow
2883 if (L_qs(k) .and. L_qs(k_0) ) then
2884 fmelt_s = MAX(0.005d0, MIN(1.0d0-rs(k)/rs(k_0), 0.99d0))
2888 x = xam_s * xxDs(n)**xbm_s
2889 call rayleigh_soak_wetgraupel (x,DBLE(xocms),DBLE(xobms), &
2890 fmelt_s, melt_outside_s, m_w_0, m_i_0, lamda_radar, &
2891 CBACK, mixingrulestring_s, matrixstring_s, &
2892 inclusionstring_s, hoststring_s, &
2893 hostmatrixstring_s, hostinclusionstring_s)
2894 f_d = N0_s(k)*xxDs(n)**xmu_s * DEXP(-lams*xxDs(n))
2895 eta = eta + f_d * CBACK * simpson(n) * xdts(n)
2897 ze_snow(k) = SNGL(lamda4 / (pi5 * K_w) * eta)
2901 !..Reflectivity contributed by melting graupel
2903 if (L_qg(k) .and. L_qg(k_0) ) then
2904 fmelt_g = MAX(0.005d0, MIN(1.0d0-rg(k)/rg(k_0), 0.99d0))
2908 x = xam_g * xxDg(n)**xbm_g
2909 call rayleigh_soak_wetgraupel (x,DBLE(xocmg),DBLE(xobmg), &
2910 fmelt_g, melt_outside_g, m_w_0, m_i_0, lamda_radar, &
2911 CBACK, mixingrulestring_g, matrixstring_g, &
2912 inclusionstring_g, hoststring_g, &
2913 hostmatrixstring_g, hostinclusionstring_g)
2914 f_d = N0_g(k)*xxDg(n)**xmu_g * DEXP(-lamg*xxDg(n))
2915 eta = eta + f_d * CBACK * simpson(n) * xdtg(n)
2917 ze_graupel(k) = SNGL(lamda4 / (pi5 * K_w) * eta)
2924 dBZ(k) = 10.*log10((ze_rain(k)+ze_snow(k)+ze_graupel(k))*1.d18)
2927 end subroutine refl10cm_lin
2928 !+---+-----------------------------------------------------------------+
2930 END MODULE module_mp_lin