1 #if ( (defined(wrfmodel) ) && ( RWORDSIZE == 4 ) ) || ( ( defined(mpas) ) && defined(SINGLE_PRECISION) )
12 USE module_model_constants, only : RE_QC_BG, RE_QI_BG, RE_QS_BG
14 REAL, PARAMETER, PRIVATE :: dtcldcr = 120. ! maximum time step for minor loops
15 REAL, PARAMETER, PRIVATE :: n0r = 8.e6 ! intercept parameter rain
16 ! REAL, PARAMETER, PRIVATE :: n0g = 4.e6 ! intercept parameter graupel ! set later with hail_opt
17 REAL, PARAMETER, PRIVATE :: avtr = 841.9 ! a constant for terminal velocity of rain
18 REAL, PARAMETER, PRIVATE :: bvtr = 0.8 ! a constant for terminal velocity of rain
19 REAL, PARAMETER, PRIVATE :: r0 = .8e-5 ! 8 microm in contrast to 10 micro m
20 REAL, PARAMETER, PRIVATE :: peaut = .55 ! collection efficiency
21 REAL, PARAMETER, PRIVATE :: xncr = 3.e8 ! maritime cloud in contrast to 3.e8 in tc80
22 REAL, PARAMETER, PRIVATE :: xmyu = 1.718e-5 ! the dynamic viscosity kgm-1s-1
23 REAL, PARAMETER, PRIVATE :: avts = 11.72 ! a constant for terminal velocity of snow
24 REAL, PARAMETER, PRIVATE :: bvts = .41 ! a constant for terminal velocity of snow
25 ! REAL, PARAMETER, PRIVATE :: avtg = 330. ! a constant for terminal velocity of graupel ! set later with hail_opt
26 ! REAL, PARAMETER, PRIVATE :: bvtg = 0.8 ! a constant for terminal velocity of graupel ! set later with hail_opt
27 ! REAL, PARAMETER, PRIVATE :: deng = 500. ! density of graupel ! set later with hail_opt
28 REAL, PARAMETER, PRIVATE :: n0smax = 1.e11 ! maximum n0s (t=-90C unlimited)
29 REAL, PARAMETER, PRIVATE :: lamdarmax = 8.e4 ! limited maximum value for slope parameter of rain
30 REAL, PARAMETER, PRIVATE :: lamdasmax = 1.e5 ! limited maximum value for slope parameter of snow
31 ! REAL, PARAMETER, PRIVATE :: lamdagmax = 6.e4 ! limited maximum value for slope parameter of graupel
32 REAL, PARAMETER, PRIVATE :: dicon = 11.9 ! constant for the cloud-ice diamter
33 REAL, PARAMETER, PRIVATE :: dimax = 500.e-6 ! limited maximum value for the cloud-ice diamter
34 REAL, PARAMETER, PRIVATE :: n0s = 2.e6 ! temperature dependent intercept parameter snow
35 REAL, PARAMETER, PRIVATE :: alpha = .12 ! .122 exponen factor for n0s
36 REAL, PARAMETER, PRIVATE :: pfrz1 = 100. ! constant in Biggs freezing
37 REAL, PARAMETER, PRIVATE :: pfrz2 = 0.66 ! constant in Biggs freezing
38 REAL, PARAMETER, PRIVATE :: qcrmin = 1.e-9 ! minimun values for qr, qs, and qg
39 REAL, PARAMETER, PRIVATE :: eacrc = 1.0 ! Snow/cloud-water collection efficiency
40 REAL, PARAMETER, PRIVATE :: dens = 100.0 ! Density of snow
41 REAL, PARAMETER, PRIVATE :: qs0 = 6.e-4 ! threshold amount for aggretion to occur
44 bvtr1,bvtr2,bvtr3,bvtr4,g1pbr, &
45 g3pbr,g4pbr,g5pbro2,pvtr,eacrr,pacrr, &
47 precr1,precr2,roqimax,bvts1, &
48 bvts2,bvts3,bvts4,g1pbs,g3pbs,g4pbs, &
49 n0g,avtg,bvtg,deng,lamdagmax, & !RAS13.3 - set these in wsm6init
50 g5pbso2,pvts,pacrs,precs1,precs2,pidn0r, &
51 pidn0s,xlv1,pacrc,pi, &
52 bvtg1,bvtg2,bvtg3,bvtg4,g1pbg, &
53 g3pbg,g4pbg,g5pbgo2,pvtg,pacrg, &
54 precg1,precg2,pidn0g, &
55 rslopermax,rslopesmax,rslopegmax, &
56 rsloperbmax,rslopesbmax,rslopegbmax, &
57 rsloper2max,rslopes2max,rslopeg2max, &
58 rsloper3max,rslopes3max,rslopeg3max
60 !===================================================================
62 SUBROUTINE wsm6(th, q, qc, qr, qi, qs, qg &
64 ,delt,g, cpd, cpv, rd, rv, t0c &
66 ,XLS, XLV0, XLF0, den0, denr &
71 ,refl_10cm, diagflag, do_radar_ref &
72 ,graupel, graupelncv &
73 ,has_reqc, has_reqi, has_reqs & ! for radiation
74 ,re_cloud, re_ice, re_snow & ! for radiation
75 ,ids,ide, jds,jde, kds,kde &
76 ,ims,ime, jms,jme, kms,kme &
77 ,its,ite, jts,jte, kts,kte &
79 ,wetscav_on, evapprod, rainprod &
82 !-------------------------------------------------------------------
84 !-------------------------------------------------------------------
85 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde , &
86 ims,ime, jms,jme, kms,kme , &
87 its,ite, jts,jte, kts,kte
88 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
97 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
103 REAL, INTENT(IN ) :: delt, &
121 REAL, DIMENSION( ims:ime , jms:jme ), &
122 INTENT(INOUT) :: rain, &
125 ! for radiation connecting
126 INTEGER, INTENT(IN):: &
130 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), &
135 !+---+-----------------------------------------------------------------+
136 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, & ! GT
137 INTENT(INOUT) :: refl_10cm
138 !+---+-----------------------------------------------------------------+
140 REAL, DIMENSION( ims:ime , jms:jme ), OPTIONAL, &
141 INTENT(INOUT) :: snow, &
143 REAL, DIMENSION( ims:ime , jms:jme ), OPTIONAL, &
144 INTENT(INOUT) :: graupel, &
147 #if ( WRF_CHEM == 1 )
148 REAL, DIMENSION( ims:ime , kms:kme, jms:jme ), INTENT(INOUT) :: &
151 LOGICAL, INTENT(IN) :: wetscav_on
154 REAL, DIMENSION( its:ite , kts:kte ) :: &
160 REAL, DIMENSION( its:ite , kts:kte ) :: t
161 REAL, DIMENSION( its:ite , kts:kte, 2 ) :: qci
162 REAL, DIMENSION( its:ite , kts:kte, 3 ) :: qrs
165 !+---+-----------------------------------------------------------------+
166 REAL, DIMENSION(kts:kte):: qv1d, t1d, p1d, qr1d, qs1d, qg1d, dBZ
167 LOGICAL, OPTIONAL, INTENT(IN) :: diagflag
168 INTEGER, OPTIONAL, INTENT(IN) :: do_radar_ref
169 !+---+-----------------------------------------------------------------+
170 ! to calculate effective radius for radiation
171 REAL, DIMENSION( kts:kte ) :: den1d
172 REAL, DIMENSION( kts:kte ) :: qc1d
173 REAL, DIMENSION( kts:kte ) :: qi1d
174 REAL, DIMENSION( kts:kte ) :: re_qc, re_qi, re_qs
179 t(i,k)=th(i,k,j)*pii(i,k,j)
180 qci(i,k,1) = qc(i,k,j)
181 qci(i,k,2) = qi(i,k,j)
182 qrs(i,k,1) = qr(i,k,j)
183 qrs(i,k,2) = qs(i,k,j)
184 qrs(i,k,3) = qg(i,k,j)
187 ! Sending array starting locations of optional variables may cause
188 ! troubles, so we explicitly change the call.
189 CALL wsm62D(t, q(ims,kms,j), qci, qrs &
191 ,p(ims,kms,j), delz(ims,kms,j) &
192 ,delt,g, cpd, cpv, rd, rv, t0c &
194 ,XLS, XLV0, XLF0, den0, denr &
197 ,rain(ims,j),rainncv(ims,j) &
199 ,ids,ide, jds,jde, kds,kde &
200 ,ims,ime, jms,jme, kms,kme &
201 ,its,ite, jts,jte, kts,kte &
203 ,graupel,graupelncv &
205 ,wetscav_on, rainprod2d, evapprod2d &
210 th(i,k,j)=t(i,k)/pii(i,k,j)
211 qc(i,k,j) = qci(i,k,1)
212 qi(i,k,j) = qci(i,k,2)
213 qr(i,k,j) = qrs(i,k,1)
214 qs(i,k,j) = qrs(i,k,2)
215 qg(i,k,j) = qrs(i,k,3)
219 !+---+-----------------------------------------------------------------+
220 IF ( PRESENT (diagflag) ) THEN
221 if (diagflag .and. do_radar_ref == 1) then
224 t1d(k)=th(i,k,j)*pii(i,k,j)
231 call refl10cm_wsm6 (qv1d, qr1d, qs1d, qg1d, &
232 t1d, p1d, dBZ, kts, kte, i, j)
234 refl_10cm(i,k,j) = MAX(-35., dBZ(k))
240 if (has_reqc.ne.0 .and. has_reqi.ne.0 .and. has_reqs.ne.0) then
247 t1d(k) = th(i,k,j)*pii(i,k,j)
253 call effectRad_wsm6(t1d, qc1d, qi1d, qs1d, den1d, &
254 qmin, t0c, re_qc, re_qi, re_qs, &
257 re_cloud(i,k,j) = MAX(RE_QC_BG, MIN(re_qc(k), 50.E-6))
258 re_ice(i,k,j) = MAX(RE_QI_BG, MIN(re_qi(k), 125.E-6))
259 re_snow(i,k,j) = MAX(RE_QS_BG, MIN(re_qs(k), 999.E-6))
262 endif ! has_reqc, etc...
263 !+---+-----------------------------------------------------------------+
265 if( wetscav_on ) then
268 rainprod(i,k,j) = rainprod2d(i,k)
269 evapprod(i,k,j) = evapprod2d(i,k)
276 !===================================================================
278 SUBROUTINE wsm62D(t, q &
279 ,qci, qrs, den, p, delz &
280 ,delt,g, cpd, cpv, rd, rv, t0c &
282 ,XLS, XLV0, XLF0, den0, denr &
287 ,ids,ide, jds,jde, kds,kde &
288 ,ims,ime, jms,jme, kms,kme &
289 ,its,ite, jts,jte, kts,kte &
291 ,graupel,graupelncv &
292 #if ( WRF_CHEM == 1 )
293 ,wetscav_on, rainprod2d, evapprod2d &
296 !-------------------------------------------------------------------
298 !-------------------------------------------------------------------
300 ! This code is a 6-class GRAUPEL phase microphyiscs scheme (WSM6) of the
301 ! Single-Moment MicroPhyiscs (WSMMP). The WSMMP assumes that ice nuclei
302 ! number concentration is a function of temperature, and seperate assumption
303 ! is developed, in which ice crystal number concentration is a function
304 ! of ice amount. A theoretical background of the ice-microphysics and related
305 ! processes in the WSMMPs are described in Hong et al. (2004).
306 ! All production terms in the WSM6 scheme are described in Hong and Lim (2006).
307 ! All units are in m.k.s. and source/sink terms in kgkg-1s-1.
311 ! Coded by Song-You Hong and Jeong-Ock Jade Lim (Yonsei Univ.)
314 ! Implemented by Song-You Hong (Yonsei Univ.) and Jimy Dudhia (NCAR)
317 ! further modifications :
318 ! semi-lagrangian sedimentation (JH,2010),hong, aug 2009
319 ! ==> higher accuracy and efficient at lower resolutions
320 ! reflectivity computation from greg thompson, lim, jun 2011
321 ! ==> only diagnostic, but with removal of too large drops
322 ! add hail option from afwa, aug 2014
323 ! ==> switch graupel or hail by changing no, den, fall vel.
324 ! effective radius of hydrometeors, bae from kiaps, jan 2015
325 ! ==> consistency in solar insolation of rrtmg radiation
326 ! bug fix in melting terms, bae from kiaps, nov 2015
327 ! ==> density of air is divided, which has not been
329 ! Reference) Hong, Dudhia, Chen (HDC, 2004) Mon. Wea. Rev.
330 ! Hong and Lim (HL, 2006) J. Korean Meteor. Soc.
331 ! Dudhia, Hong and Lim (DHL, 2008) J. Meteor. Soc. Japan
332 ! Lin, Farley, Orville (LFO, 1983) J. Appl. Meteor.
333 ! Rutledge, Hobbs (RH83, 1983) J. Atmos. Sci.
334 ! Rutledge, Hobbs (RH84, 1984) J. Atmos. Sci.
335 ! Juang and Hong (JH, 2010) Mon. Wea. Rev.
337 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde , &
338 ims,ime, jms,jme, kms,kme , &
339 its,ite, jts,jte, kts,kte, &
341 REAL, DIMENSION( its:ite , kts:kte ), &
344 REAL, DIMENSION( its:ite , kts:kte, 2 ), &
347 REAL, DIMENSION( its:ite , kts:kte, 3 ), &
350 REAL, DIMENSION( ims:ime , kms:kme ), &
353 REAL, DIMENSION( ims:ime , kms:kme ), &
358 REAL, INTENT(IN ) :: delt, &
376 REAL, DIMENSION( ims:ime ), &
377 INTENT(INOUT) :: rain, &
380 REAL, DIMENSION( ims:ime, jms:jme ), OPTIONAL, &
381 INTENT(INOUT) :: snow, &
383 REAL, DIMENSION( ims:ime, jms:jme ), OPTIONAL, &
384 INTENT(INOUT) :: graupel, &
388 REAL, DIMENSION( its:ite , kts:kte ), INTENT(INOUT) :: &
391 LOGICAL, INTENT(IN) :: wetscav_on
395 REAL, DIMENSION( its:ite , kts:kte , 3) :: &
406 REAL, DIMENSION( its:ite , kts:kte ) :: &
413 REAL, DIMENSION( its:ite , kts:kte ) :: &
416 REAL, DIMENSION( its:ite , kts:kte ) :: &
444 REAL, DIMENSION( its:ite , kts:kte ) :: &
456 REAL, DIMENSION( its:ite ) :: delqrs1, &
460 REAL, DIMENSION( its:ite ) :: tstepsnow, &
462 INTEGER, DIMENSION( its:ite ) :: mstep, &
464 LOGICAL, DIMENSION( its:ite ) :: flgcld
466 cpmcal, xlcal, diffus, &
467 viscos, xka, venfac, conden, diffac, &
468 x, y, z, a, b, c, d, e, &
469 qdt, holdrr, holdrs, holdrg, supcol, supcolt, pvt, &
470 coeres, supsat, dtcld, xmi, eacrs, satdt, &
471 qimax, diameter, xni0, roqi0, &
472 fallsum, fallsum_qsi, fallsum_qg, &
473 vt2i,vt2r,vt2s,vt2g,acrfac,egs,egi, &
474 xlwork2, factor, source, value, &
475 xlf, pfrzdtc, pfrzdtr, supice, alpha2, delta2, delta3
477 REAL :: holdc, holdci
478 INTEGER :: i, j, k, mstepmax, &
479 iprt, latd, lond, loop, loops, ifsat, n, idim, kdim
480 ! Temporaries used for inlining fpvs function
481 REAL :: dldti, xb, xai, tr, xbi, xa, hvap, cvap, hsub, dldt, ttp
482 ! variables for optimization
483 REAL, DIMENSION( its:ite ) :: tvec1
486 !=================================================================
487 ! compute internal functions
489 cpmcal(x) = cpd*(1.-max(x,qmin))+max(x,qmin)*cpv
490 xlcal(x) = xlv0-xlv1*(x-t0c)
491 !----------------------------------------------------------------
492 ! diffus: diffusion coefficient of the water vapor
493 ! viscos: kinematic viscosity(m2s-1)
494 ! Optimizatin : A**B => exp(log(A)*(B))
496 diffus(x,y) = 8.794e-5 * exp(log(x)*(1.81)) / y ! 8.794e-5*x**1.81/y
497 viscos(x,y) = 1.496e-6 * (x*sqrt(x)) /(x+120.)/y ! 1.496e-6*x**1.5/(x+120.)/y
498 xka(x,y) = 1.414e3*viscos(x,y)*y
499 diffac(a,b,c,d,e) = d*a*a/(xka(c,d)*rv*c*c)+1./(e*diffus(c,b))
500 venfac(a,b,c) = exp(log((viscos(b,c)/diffus(b,a)))*((.3333333))) &
501 /sqrt(viscos(b,c))*sqrt(sqrt(den0/c))
502 conden(a,b,c,d,e) = (max(b,qmin)-c)/(1.+d*d/(rv*e)*c/(a*a))
508 !----------------------------------------------------------------
509 ! paddint 0 for negative values generated by dynamics
513 qci(i,k,1) = max(qci(i,k,1),0.0)
514 qrs(i,k,1) = max(qrs(i,k,1),0.0)
515 qci(i,k,2) = max(qci(i,k,2),0.0)
516 qrs(i,k,2) = max(qrs(i,k,2),0.0)
517 qrs(i,k,3) = max(qrs(i,k,3),0.0)
521 !----------------------------------------------------------------
522 ! latent heat for phase changes and heat capacity. neglect the
523 ! changes during microphysical process calculation
528 cpm(i,k) = cpmcal(q(i,k))
529 xl(i,k) = xlcal(t(i,k))
534 delz_tmp(i,k) = delz(i,k)
535 den_tmp(i,k) = den(i,k)
539 !----------------------------------------------------------------
540 ! initialize the surface rain, snow, graupel
544 if(PRESENT (snowncv) .AND. PRESENT (snow)) snowncv(i,lat) = 0.
545 if(PRESENT (graupelncv) .AND. PRESENT (graupel)) graupelncv(i,lat) = 0.
547 ! new local array to catch step snow and graupel
552 !----------------------------------------------------------------
553 ! compute the minor time steps.
555 loops = max(nint(delt/dtcldcr),1)
557 if(delt.le.dtcldcr) dtcld = delt
561 !----------------------------------------------------------------
562 ! initialize the large scale variables
571 ! denfac(i,k) = sqrt(den0/den(i,k))
575 CALL VREC( tvec1(its), den(its,k), ite-its+1)
577 tvec1(i) = tvec1(i)*den0
579 CALL VSQRT( denfac(its,k), tvec1(its), ite-its+1)
582 ! Inline expansion for fpvs
583 ! qs(i,k,1) = fpvs(t(i,k),0,rd,rv,cpv,cliq,cice,xlv0,xls,psat,t0c)
584 ! qs(i,k,2) = fpvs(t(i,k),1,rd,rv,cpv,cliq,cice,xlv0,xls,psat,t0c)
594 xbi=xai+hsub/(rv*ttp)
598 qs(i,k,1)=psat*exp(log(tr)*(xa))*exp(xb*(1.-tr))
599 qs(i,k,1) = min(qs(i,k,1),0.99*p(i,k))
600 qs(i,k,1) = ep2 * qs(i,k,1) / (p(i,k) - qs(i,k,1))
601 qs(i,k,1) = max(qs(i,k,1),qmin)
602 rh(i,k,1) = max(q(i,k) / qs(i,k,1),qmin)
604 if(t(i,k).lt.ttp) then
605 qs(i,k,2)=psat*exp(log(tr)*(xai))*exp(xbi*(1.-tr))
607 qs(i,k,2)=psat*exp(log(tr)*(xa))*exp(xb*(1.-tr))
609 qs(i,k,2) = min(qs(i,k,2),0.99*p(i,k))
610 qs(i,k,2) = ep2 * qs(i,k,2) / (p(i,k) - qs(i,k,2))
611 qs(i,k,2) = max(qs(i,k,2),qmin)
612 rh(i,k,2) = max(q(i,k) / qs(i,k,2),qmin)
616 !----------------------------------------------------------------
617 ! initialize the variables for microphysical physics
660 !-------------------------------------------------------------
661 ! Ni: ice crystal number concentraiton [HDC 5c]
662 !-------------------------------------------------------------
665 temp = (den(i,k)*max(qci(i,k,2),qmin))
666 temp = sqrt(sqrt(temp*temp*temp))
667 xni(i,k) = min(max(5.38e7*temp,1.e3),1.e6)
671 !----------------------------------------------------------------
672 ! compute the fallout term:
673 ! first, vertical terminal velosity for minor loops
674 !----------------------------------------------------------------
677 qrs_tmp(i,k,1) = qrs(i,k,1)
678 qrs_tmp(i,k,2) = qrs(i,k,2)
679 qrs_tmp(i,k,3) = qrs(i,k,3)
682 call slope_wsm6(qrs_tmp,den_tmp,denfac,t,rslope,rslopeb,rslope2,rslope3, &
683 work1,its,ite,kts,kte)
687 workr(i,k) = work1(i,k,1)
688 qsum(i,k) = max( (qrs(i,k,2)+qrs(i,k,3)), 1.E-15)
689 IF ( qsum(i,k) .gt. 1.e-15 ) THEN
690 worka(i,k) = (work1(i,k,2)*qrs(i,k,2) + work1(i,k,3)*qrs(i,k,3)) &
695 denqrs1(i,k) = den(i,k)*qrs(i,k,1)
696 denqrs2(i,k) = den(i,k)*qrs(i,k,2)
697 denqrs3(i,k) = den(i,k)*qrs(i,k,3)
698 if(qrs(i,k,1).le.0.0) workr(i,k) = 0.0
701 call nislfv_rain_plm(idim,kdim,den_tmp,denfac,t,delz_tmp,workr,denqrs1, &
703 call nislfv_rain_plm6(idim,kdim,den_tmp,denfac,t,delz_tmp,worka, &
704 denqrs2,denqrs3,delqrs2,delqrs3,dtcld,1,1)
707 qrs(i,k,1) = max(denqrs1(i,k)/den(i,k),0.)
708 qrs(i,k,2) = max(denqrs2(i,k)/den(i,k),0.)
709 qrs(i,k,3) = max(denqrs3(i,k)/den(i,k),0.)
710 fall(i,k,1) = denqrs1(i,k)*workr(i,k)/delz(i,k)
711 fall(i,k,2) = denqrs2(i,k)*worka(i,k)/delz(i,k)
712 fall(i,k,3) = denqrs3(i,k)*worka(i,k)/delz(i,k)
716 fall(i,1,1) = delqrs1(i)/delz(i,1)/dtcld
717 fall(i,1,2) = delqrs2(i)/delz(i,1)/dtcld
718 fall(i,1,3) = delqrs3(i)/delz(i,1)/dtcld
722 qrs_tmp(i,k,1) = qrs(i,k,1)
723 qrs_tmp(i,k,2) = qrs(i,k,2)
724 qrs_tmp(i,k,3) = qrs(i,k,3)
727 call slope_wsm6(qrs_tmp,den_tmp,denfac,t,rslope,rslopeb,rslope2,rslope3, &
728 work1,its,ite,kts,kte)
733 n0sfac(i,k) = max(min(exp(alpha*supcol),n0smax/n0s),1.)
734 if(t(i,k).gt.t0c) then
735 !---------------------------------------------------------------
736 ! psmlt: melting of snow [HL A33] [RH83 A25]
738 !---------------------------------------------------------------
740 work2(i,k) = venfac(p(i,k),t(i,k),den(i,k))
741 if(qrs(i,k,2).gt.0.) then
742 coeres = rslope2(i,k,2)*sqrt(rslope(i,k,2)*rslopeb(i,k,2))
743 psmlt(i,k) = xka(t(i,k),den(i,k))/xlf*(t0c-t(i,k))*pi/2. &
744 *n0sfac(i,k)*(precs1*rslope2(i,k,2) &
745 +precs2*work2(i,k)*coeres)/den(i,k)
746 psmlt(i,k) = min(max(psmlt(i,k)*dtcld/mstep(i), &
747 -qrs(i,k,2)/mstep(i)),0.)
748 qrs(i,k,2) = qrs(i,k,2) + psmlt(i,k)
749 qrs(i,k,1) = qrs(i,k,1) - psmlt(i,k)
750 t(i,k) = t(i,k) + xlf/cpm(i,k)*psmlt(i,k)
752 !---------------------------------------------------------------
753 ! pgmlt: melting of graupel [HL A23] [LFO 47]
755 !---------------------------------------------------------------
756 if(qrs(i,k,3).gt.0.) then
757 coeres = rslope2(i,k,3)*sqrt(rslope(i,k,3)*rslopeb(i,k,3))
758 pgmlt(i,k) = xka(t(i,k),den(i,k))/xlf &
759 *(t0c-t(i,k))*(precg1*rslope2(i,k,3) &
760 +precg2*work2(i,k)*coeres)/den(i,k)
761 pgmlt(i,k) = min(max(pgmlt(i,k)*dtcld/mstep(i), &
762 -qrs(i,k,3)/mstep(i)),0.)
763 qrs(i,k,3) = qrs(i,k,3) + pgmlt(i,k)
764 qrs(i,k,1) = qrs(i,k,1) - pgmlt(i,k)
765 t(i,k) = t(i,k) + xlf/cpm(i,k)*pgmlt(i,k)
770 !---------------------------------------------------------------
771 ! Vice [ms-1] : fallout of ice crystal [HDC 5a]
772 !---------------------------------------------------------------
775 if(qci(i,k,2).le.0.) then
778 xmi = den(i,k)*qci(i,k,2)/xni(i,k)
779 diameter = max(min(dicon * sqrt(xmi),dimax), 1.e-25)
780 work1c(i,k) = 1.49e4*exp(log(diameter)*(1.31))
785 ! forward semi-laglangian scheme (JH), PCM (piecewise constant), (linear)
789 denqci(i,k) = den(i,k)*qci(i,k,2)
792 call nislfv_rain_plm(idim,kdim,den_tmp,denfac,t,delz_tmp,work1c,denqci, &
796 qci(i,k,2) = max(denqci(i,k)/den(i,k),0.)
800 fallc(i,1) = delqi(i)/delz(i,1)/dtcld
803 !----------------------------------------------------------------
804 ! rain (unit is mm/sec;kgm-2s-1: /1000*delt ===> m)==> mm for wrf
807 fallsum = fall(i,kts,1)+fall(i,kts,2)+fall(i,kts,3)+fallc(i,kts)
808 fallsum_qsi = fall(i,kts,2)+fallc(i,kts)
809 fallsum_qg = fall(i,kts,3)
810 if(fallsum.gt.0.) then
811 rainncv(i) = fallsum*delz(i,kts)/denr*dtcld*1000. + rainncv(i)
812 rain(i) = fallsum*delz(i,kts)/denr*dtcld*1000. + rain(i)
814 if(fallsum_qsi.gt.0.) then
815 tstepsnow(i) = fallsum_qsi*delz(i,kts)/denr*dtcld*1000. &
817 IF ( PRESENT (snowncv) .AND. PRESENT (snow)) THEN
818 snowncv(i,lat) = fallsum_qsi*delz(i,kts)/denr*dtcld*1000. &
820 snow(i,lat) = fallsum_qsi*delz(i,kts)/denr*dtcld*1000. + snow(i,lat)
823 if(fallsum_qg.gt.0.) then
824 tstepgraup(i) = fallsum_qg*delz(i,kts)/denr*dtcld*1000. &
826 IF ( PRESENT (graupelncv) .AND. PRESENT (graupel)) THEN
827 graupelncv(i,lat) = fallsum_qg*delz(i,kts)/denr*dtcld*1000. &
829 graupel(i,lat) = fallsum_qg*delz(i,kts)/denr*dtcld*1000. + graupel(i,lat)
832 IF ( PRESENT (snowncv)) THEN
833 if(fallsum.gt.0.)sr(i)=(snowncv(i,lat) + graupelncv(i,lat))/(rainncv(i)+1.e-12)
835 if(fallsum.gt.0.)sr(i)=(tstepsnow(i) + tstepgraup(i))/(rainncv(i)+1.e-12)
839 !---------------------------------------------------------------
840 ! pimlt: instantaneous melting of cloud ice [HL A47] [RH83 A28]
842 !---------------------------------------------------------------
847 if(supcol.lt.0.) xlf = xlf0
848 if(supcol.lt.0.and.qci(i,k,2).gt.0.) then
849 qci(i,k,1) = qci(i,k,1) + qci(i,k,2)
850 t(i,k) = t(i,k) - xlf/cpm(i,k)*qci(i,k,2)
853 !---------------------------------------------------------------
854 ! pihmf: homogeneous freezing of cloud water below -40c [HL A45]
856 !---------------------------------------------------------------
857 if(supcol.gt.40..and.qci(i,k,1).gt.0.) then
858 qci(i,k,2) = qci(i,k,2) + qci(i,k,1)
859 t(i,k) = t(i,k) + xlf/cpm(i,k)*qci(i,k,1)
862 !---------------------------------------------------------------
863 ! pihtf: heterogeneous freezing of cloud water [HL A44]
865 !---------------------------------------------------------------
866 if(supcol.gt.0..and.qci(i,k,1).gt.qmin) then
867 ! pfrzdtc = min(pfrz1*(exp(pfrz2*supcol)-1.) &
868 ! *den(i,k)/denr/xncr*qci(i,k,1)**2*dtcld,qci(i,k,1))
869 supcolt=min(supcol,50.)
870 pfrzdtc = min(pfrz1*(exp(pfrz2*supcolt)-1.) &
871 *den(i,k)/denr/xncr*qci(i,k,1)*qci(i,k,1)*dtcld,qci(i,k,1))
872 qci(i,k,2) = qci(i,k,2) + pfrzdtc
873 t(i,k) = t(i,k) + xlf/cpm(i,k)*pfrzdtc
874 qci(i,k,1) = qci(i,k,1)-pfrzdtc
876 !---------------------------------------------------------------
877 ! pgfrz: freezing of rain water [HL A20] [LFO 45]
879 !---------------------------------------------------------------
880 if(supcol.gt.0..and.qrs(i,k,1).gt.0.) then
881 ! pfrzdtr = min(20.*pi**2*pfrz1*n0r*denr/den(i,k) &
882 ! *(exp(pfrz2*supcol)-1.)*rslope3(i,k,1)**2 &
883 ! *rslope(i,k,1)*dtcld,qrs(i,k,1))
884 temp = rslope3(i,k,1)
885 temp = temp*temp*rslope(i,k,1)
886 supcolt=min(supcol,50.)
887 pfrzdtr = min(20.*(pi*pi)*pfrz1*n0r*denr/den(i,k) &
888 *(exp(pfrz2*supcolt)-1.)*temp*dtcld, &
890 qrs(i,k,3) = qrs(i,k,3) + pfrzdtr
891 t(i,k) = t(i,k) + xlf/cpm(i,k)*pfrzdtr
892 qrs(i,k,1) = qrs(i,k,1)-pfrzdtr
898 !----------------------------------------------------------------
899 ! update the slope parameters for microphysics computation
903 qrs_tmp(i,k,1) = qrs(i,k,1)
904 qrs_tmp(i,k,2) = qrs(i,k,2)
905 qrs_tmp(i,k,3) = qrs(i,k,3)
908 call slope_wsm6(qrs_tmp,den_tmp,denfac,t,rslope,rslopeb,rslope2,rslope3, &
909 work1,its,ite,kts,kte)
910 !------------------------------------------------------------------
911 ! work1: the thermodynamic term in the denominator associated with
912 ! heat conduction and vapor diffusion
914 ! work2: parameter associated with the ventilation effects(y93)
918 work1(i,k,1) = diffac(xl(i,k),p(i,k),t(i,k),den(i,k),qs(i,k,1))
919 work1(i,k,2) = diffac(xls,p(i,k),t(i,k),den(i,k),qs(i,k,2))
920 work2(i,k) = venfac(p(i,k),t(i,k),den(i,k))
924 !===============================================================
926 ! warm rain processes
928 ! - follows the processes in RH83 and LFO except for autoconcersion
930 !===============================================================
934 supsat = max(q(i,k),qmin)-qs(i,k,1)
936 !---------------------------------------------------------------
937 ! praut: auto conversion rate from cloud to rain [HDC 16]
939 !---------------------------------------------------------------
940 if(qci(i,k,1).gt.qc0) then
941 praut(i,k) = qck1*qci(i,k,1)**(7./3.)
942 praut(i,k) = min(praut(i,k),qci(i,k,1)/dtcld)
944 !---------------------------------------------------------------
945 ! pracw: accretion of cloud water by rain [HL A40] [LFO 51]
947 !---------------------------------------------------------------
948 if(qrs(i,k,1).gt.qcrmin.and.qci(i,k,1).gt.qmin) then
949 pracw(i,k) = min(pacrr*rslope3(i,k,1)*rslopeb(i,k,1) &
950 *qci(i,k,1)*denfac(i,k),qci(i,k,1)/dtcld)
952 !---------------------------------------------------------------
953 ! prevp: evaporation/condensation rate of rain [HDC 14]
955 !---------------------------------------------------------------
956 if(qrs(i,k,1).gt.0.) then
957 coeres = rslope2(i,k,1)*sqrt(rslope(i,k,1)*rslopeb(i,k,1))
958 prevp(i,k) = (rh(i,k,1)-1.)*(precr1*rslope2(i,k,1) &
959 +precr2*work2(i,k)*coeres)/work1(i,k,1)
960 if(prevp(i,k).lt.0.) then
961 prevp(i,k) = max(prevp(i,k),-qrs(i,k,1)/dtcld)
962 prevp(i,k) = max(prevp(i,k),satdt/2)
964 prevp(i,k) = min(prevp(i,k),satdt/2)
970 !===============================================================
972 ! cold rain processes
974 ! - follows the revised ice microphysics processes in HDC
975 ! - the processes same as in RH83 and RH84 and LFO behave
976 ! following ice crystal hapits defined in HDC, inclduing
977 ! intercept parameter for snow (n0s), ice crystal number
978 ! concentration (ni), ice nuclei number concentration
979 ! (n0i), ice diameter (d)
981 !===============================================================
986 n0sfac(i,k) = max(min(exp(alpha*supcol),n0smax/n0s),1.)
987 supsat = max(q(i,k),qmin)-qs(i,k,2)
990 !-------------------------------------------------------------
991 ! Ni: ice crystal number concentraiton [HDC 5c]
992 !-------------------------------------------------------------
993 ! xni(i,k) = min(max(5.38e7*(den(i,k) &
994 ! *max(qci(i,k,2),qmin))**0.75,1.e3),1.e6)
995 temp = (den(i,k)*max(qci(i,k,2),qmin))
996 temp = sqrt(sqrt(temp*temp*temp))
997 xni(i,k) = min(max(5.38e7*temp,1.e3),1.e6)
998 eacrs = exp(0.07*(-supcol))
1000 xmi = den(i,k)*qci(i,k,2)/xni(i,k)
1001 diameter = min(dicon * sqrt(xmi),dimax)
1002 vt2i = 1.49e4*diameter**1.31
1003 vt2r=pvtr*rslopeb(i,k,1)*denfac(i,k)
1004 vt2s=pvts*rslopeb(i,k,2)*denfac(i,k)
1005 vt2g=pvtg*rslopeb(i,k,3)*denfac(i,k)
1006 qsum(i,k) = max( (qrs(i,k,2)+qrs(i,k,3)), 1.E-15)
1007 if(qsum(i,k) .gt. 1.e-15) then
1008 vt2ave=(vt2s*qrs(i,k,2)+vt2g*qrs(i,k,3))/(qsum(i,k))
1012 if(supcol.gt.0.and.qci(i,k,2).gt.qmin) then
1013 if(qrs(i,k,1).gt.qcrmin) then
1014 !-------------------------------------------------------------
1015 ! praci: Accretion of cloud ice by rain [HL A15] [LFO 25]
1017 !-------------------------------------------------------------
1018 acrfac = 2.*rslope3(i,k,1)+2.*diameter*rslope2(i,k,1) &
1019 +diameter**2*rslope(i,k,1)
1020 praci(i,k) = pi*qci(i,k,2)*n0r*abs(vt2r-vt2i)*acrfac/4.
1021 ! reduce collection efficiency (suggested by B. Wilt)
1022 praci(i,k) = praci(i,k)*min(max(0.0,qrs(i,k,1)/qci(i,k,2)),1.)**2
1023 praci(i,k) = min(praci(i,k),qci(i,k,2)/dtcld)
1024 !-------------------------------------------------------------
1025 ! piacr: Accretion of rain by cloud ice [HL A19] [LFO 26]
1026 ! (T<T0: R->S or R->G)
1027 !-------------------------------------------------------------
1028 piacr(i,k) = pi**2*avtr*n0r*denr*xni(i,k)*denfac(i,k) &
1029 *g6pbr*rslope3(i,k,1)*rslope3(i,k,1) &
1030 *rslopeb(i,k,1)/24./den(i,k)
1031 ! reduce collection efficiency (suggested by B. Wilt)
1032 piacr(i,k) = piacr(i,k)*min(max(0.0,qci(i,k,2)/qrs(i,k,1)),1.)**2
1033 piacr(i,k) = min(piacr(i,k),qrs(i,k,1)/dtcld)
1035 !-------------------------------------------------------------
1036 ! psaci: Accretion of cloud ice by snow [HDC 10]
1038 !-------------------------------------------------------------
1039 if(qrs(i,k,2).gt.qcrmin) then
1040 acrfac = 2.*rslope3(i,k,2)+2.*diameter*rslope2(i,k,2) &
1041 +diameter**2*rslope(i,k,2)
1042 psaci(i,k) = pi*qci(i,k,2)*eacrs*n0s*n0sfac(i,k) &
1043 *abs(vt2ave-vt2i)*acrfac/4.
1044 psaci(i,k) = min(psaci(i,k),qci(i,k,2)/dtcld)
1046 !-------------------------------------------------------------
1047 ! pgaci: Accretion of cloud ice by graupel [HL A17] [LFO 41]
1049 !-------------------------------------------------------------
1050 if(qrs(i,k,3).gt.qcrmin) then
1051 egi = exp(0.07*(-supcol))
1052 acrfac = 2.*rslope3(i,k,3)+2.*diameter*rslope2(i,k,3) &
1053 +diameter**2*rslope(i,k,3)
1054 pgaci(i,k) = pi*egi*qci(i,k,2)*n0g*abs(vt2ave-vt2i)*acrfac/4.
1055 pgaci(i,k) = min(pgaci(i,k),qci(i,k,2)/dtcld)
1058 !-------------------------------------------------------------
1059 ! psacw: Accretion of cloud water by snow [HL A7] [LFO 24]
1060 ! (T<T0: C->S, and T>=T0: C->R)
1061 !-------------------------------------------------------------
1062 if(qrs(i,k,2).gt.qcrmin.and.qci(i,k,1).gt.qmin) then
1063 psacw(i,k) = min(pacrc*n0sfac(i,k)*rslope3(i,k,2)*rslopeb(i,k,2) &
1064 ! reduce collection efficiency (suggested by B. Wilt)
1065 *min(max(0.0,qrs(i,k,2)/qci(i,k,1)),1.)**2 &
1066 *qci(i,k,1)*denfac(i,k),qci(i,k,1)/dtcld)
1068 !-------------------------------------------------------------
1069 ! pgacw: Accretion of cloud water by graupel [HL A6] [LFO 40]
1070 ! (T<T0: C->G, and T>=T0: C->R)
1071 !-------------------------------------------------------------
1072 if(qrs(i,k,3).gt.qcrmin.and.qci(i,k,1).gt.qmin) then
1073 pgacw(i,k) = min(pacrg*rslope3(i,k,3)*rslopeb(i,k,3) &
1074 ! reduce collection efficiency (suggested by B. Wilt)
1075 *min(max(0.0,qrs(i,k,3)/qci(i,k,1)),1.)**2 &
1076 *qci(i,k,1)*denfac(i,k),qci(i,k,1)/dtcld)
1078 !-------------------------------------------------------------
1079 ! paacw: Accretion of cloud water by averaged snow/graupel
1080 ! (T<T0: C->G or S, and T>=T0: C->R)
1081 !-------------------------------------------------------------
1082 if(qsum(i,k) .gt. 1.e-15) then
1083 paacw(i,k) = (qrs(i,k,2)*psacw(i,k)+qrs(i,k,3)*pgacw(i,k)) &
1086 !-------------------------------------------------------------
1087 ! pracs: Accretion of snow by rain [HL A11] [LFO 27]
1089 !-------------------------------------------------------------
1090 if(qrs(i,k,2).gt.qcrmin.and.qrs(i,k,1).gt.qcrmin) then
1091 if(supcol.gt.0) then
1092 acrfac = 5.*rslope3(i,k,2)*rslope3(i,k,2)*rslope(i,k,1) &
1093 +2.*rslope3(i,k,2)*rslope2(i,k,2)*rslope2(i,k,1) &
1094 +.5*rslope2(i,k,2)*rslope2(i,k,2)*rslope3(i,k,1)
1095 pracs(i,k) = pi**2*n0r*n0s*n0sfac(i,k)*abs(vt2r-vt2ave) &
1096 *(dens/den(i,k))*acrfac
1097 ! reduce collection efficiency (suggested by B. Wilt)
1098 pracs(i,k) = pracs(i,k)*min(max(0.0,qrs(i,k,1)/qrs(i,k,2)),1.)**2
1099 pracs(i,k) = min(pracs(i,k),qrs(i,k,2)/dtcld)
1101 !-------------------------------------------------------------
1102 ! psacr: Accretion of rain by snow [HL A10] [LFO 28]
1103 ! (T<T0:R->S or R->G) (T>=T0: enhance melting of snow)
1104 !-------------------------------------------------------------
1105 acrfac = 5.*rslope3(i,k,1)*rslope3(i,k,1)*rslope(i,k,2) &
1106 +2.*rslope3(i,k,1)*rslope2(i,k,1)*rslope2(i,k,2) &
1107 +.5*rslope2(i,k,1)*rslope2(i,k,1)*rslope3(i,k,2)
1108 psacr(i,k) = pi**2*n0r*n0s*n0sfac(i,k)*abs(vt2ave-vt2r) &
1109 *(denr/den(i,k))*acrfac
1110 ! reduce collection efficiency (suggested by B. Wilt)
1111 psacr(i,k) = psacr(i,k)*min(max(0.0,qrs(i,k,2)/qrs(i,k,1)),1.)**2
1112 psacr(i,k) = min(psacr(i,k),qrs(i,k,1)/dtcld)
1114 !-------------------------------------------------------------
1115 ! pgacr: Accretion of rain by graupel [HL A12] [LFO 42]
1116 ! (T<T0: R->G) (T>=T0: enhance melting of graupel)
1117 !-------------------------------------------------------------
1118 if(qrs(i,k,3).gt.qcrmin.and.qrs(i,k,1).gt.qcrmin) then
1119 acrfac = 5.*rslope3(i,k,1)*rslope3(i,k,1)*rslope(i,k,3) &
1120 +2.*rslope3(i,k,1)*rslope2(i,k,1)*rslope2(i,k,3) &
1121 +.5*rslope2(i,k,1)*rslope2(i,k,1)*rslope3(i,k,3)
1122 pgacr(i,k) = pi**2*n0r*n0g*abs(vt2ave-vt2r)*(denr/den(i,k)) &
1124 ! reduce collection efficiency (suggested by B. Wilt)
1125 pgacr(i,k) = pgacr(i,k)*min(max(0.0,qrs(i,k,3)/qrs(i,k,1)),1.)**2
1126 pgacr(i,k) = min(pgacr(i,k),qrs(i,k,1)/dtcld)
1129 !-------------------------------------------------------------
1130 ! pgacs: Accretion of snow by graupel [HL A13] [LFO 29]
1131 ! (S->G): This process is eliminated in V3.0 with the
1132 ! new combined snow/graupel fall speeds
1133 !-------------------------------------------------------------
1134 if(qrs(i,k,3).gt.qcrmin.and.qrs(i,k,2).gt.qcrmin) then
1137 if(supcol.le.0) then
1139 !-------------------------------------------------------------
1140 ! pseml: Enhanced melting of snow by accretion of water [HL A34]
1142 !-------------------------------------------------------------
1143 if(qrs(i,k,2).gt.0.) &
1144 pseml(i,k) = min(max(cliq*supcol*(paacw(i,k)+psacr(i,k)) &
1145 /xlf,-qrs(i,k,2)/dtcld),0.)
1146 !-------------------------------------------------------------
1147 ! pgeml: Enhanced melting of graupel by accretion of water [HL A24] [RH84 A21-A22]
1149 !-------------------------------------------------------------
1150 if(qrs(i,k,3).gt.0.) &
1151 pgeml(i,k) = min(max(cliq*supcol*(paacw(i,k)+pgacr(i,k)) &
1152 /xlf,-qrs(i,k,3)/dtcld),0.)
1154 if(supcol.gt.0) then
1155 !-------------------------------------------------------------
1156 ! pidep: Deposition/Sublimation rate of ice [HDC 9]
1157 ! (T<T0: V->I or I->V)
1158 !-------------------------------------------------------------
1159 if(qci(i,k,2).gt.0.and.ifsat.ne.1) then
1160 pidep(i,k) = 4.*diameter*xni(i,k)*(rh(i,k,2)-1.)/work1(i,k,2)
1161 supice = satdt-prevp(i,k)
1162 if(pidep(i,k).lt.0.) then
1163 pidep(i,k) = max(max(pidep(i,k),satdt/2),supice)
1164 pidep(i,k) = max(pidep(i,k),-qci(i,k,2)/dtcld)
1166 pidep(i,k) = min(min(pidep(i,k),satdt/2),supice)
1168 if(abs(prevp(i,k)+pidep(i,k)).ge.abs(satdt)) ifsat = 1
1170 !-------------------------------------------------------------
1171 ! psdep: deposition/sublimation rate of snow [HDC 14]
1172 ! (T<T0: V->S or S->V)
1173 !-------------------------------------------------------------
1174 if(qrs(i,k,2).gt.0..and.ifsat.ne.1) then
1175 coeres = rslope2(i,k,2)*sqrt(rslope(i,k,2)*rslopeb(i,k,2))
1176 psdep(i,k) = (rh(i,k,2)-1.)*n0sfac(i,k)*(precs1*rslope2(i,k,2) &
1177 + precs2*work2(i,k)*coeres)/work1(i,k,2)
1178 supice = satdt-prevp(i,k)-pidep(i,k)
1179 if(psdep(i,k).lt.0.) then
1180 psdep(i,k) = max(psdep(i,k),-qrs(i,k,2)/dtcld)
1181 psdep(i,k) = max(max(psdep(i,k),satdt/2),supice)
1183 psdep(i,k) = min(min(psdep(i,k),satdt/2),supice)
1185 if(abs(prevp(i,k)+pidep(i,k)+psdep(i,k)).ge.abs(satdt)) &
1188 !-------------------------------------------------------------
1189 ! pgdep: deposition/sublimation rate of graupel [HL A21] [LFO 46]
1190 ! (T<T0: V->G or G->V)
1191 !-------------------------------------------------------------
1192 if(qrs(i,k,3).gt.0..and.ifsat.ne.1) then
1193 coeres = rslope2(i,k,3)*sqrt(rslope(i,k,3)*rslopeb(i,k,3))
1194 pgdep(i,k) = (rh(i,k,2)-1.)*(precg1*rslope2(i,k,3) &
1195 +precg2*work2(i,k)*coeres)/work1(i,k,2)
1196 supice = satdt-prevp(i,k)-pidep(i,k)-psdep(i,k)
1197 if(pgdep(i,k).lt.0.) then
1198 pgdep(i,k) = max(pgdep(i,k),-qrs(i,k,3)/dtcld)
1199 pgdep(i,k) = max(max(pgdep(i,k),satdt/2),supice)
1201 pgdep(i,k) = min(min(pgdep(i,k),satdt/2),supice)
1203 if(abs(prevp(i,k)+pidep(i,k)+psdep(i,k)+pgdep(i,k)).ge. &
1204 abs(satdt)) ifsat = 1
1206 !-------------------------------------------------------------
1207 ! pigen: generation(nucleation) of ice from vapor [HL 50] [HDC 7-8]
1209 !-------------------------------------------------------------
1210 if(supsat.gt.0.and.ifsat.ne.1) then
1211 supice = satdt-prevp(i,k)-pidep(i,k)-psdep(i,k)-pgdep(i,k)
1212 xni0 = 1.e3*exp(0.1*supcol)
1213 roqi0 = 4.92e-11*xni0**1.33
1214 pigen(i,k) = max(0.,(roqi0/den(i,k)-max(qci(i,k,2),0.))/dtcld)
1215 pigen(i,k) = min(min(pigen(i,k),satdt),supice)
1218 !-------------------------------------------------------------
1219 ! psaut: conversion(aggregation) of ice to snow [HDC 12]
1221 !-------------------------------------------------------------
1222 if(qci(i,k,2).gt.0.) then
1223 qimax = roqimax/den(i,k)
1224 psaut(i,k) = max(0.,(qci(i,k,2)-qimax)/dtcld)
1227 !-------------------------------------------------------------
1228 ! pgaut: conversion(aggregation) of snow to graupel [HL A4] [LFO 37]
1230 !-------------------------------------------------------------
1231 if(qrs(i,k,2).gt.0.) then
1232 alpha2 = 1.e-3*exp(0.09*(-supcol))
1233 pgaut(i,k) = min(max(0.,alpha2*(qrs(i,k,2)-qs0)),qrs(i,k,2)/dtcld)
1237 !-------------------------------------------------------------
1238 ! psevp: Evaporation of melting snow [HL A35] [RH83 A27]
1240 !-------------------------------------------------------------
1241 if(supcol.lt.0.) then
1242 if(qrs(i,k,2).gt.0..and.rh(i,k,1).lt.1.) then
1243 coeres = rslope2(i,k,2)*sqrt(rslope(i,k,2)*rslopeb(i,k,2))
1244 psevp(i,k) = (rh(i,k,1)-1.)*n0sfac(i,k)*(precs1 &
1245 *rslope2(i,k,2)+precs2*work2(i,k) &
1246 *coeres)/work1(i,k,1)
1247 psevp(i,k) = min(max(psevp(i,k),-qrs(i,k,2)/dtcld),0.)
1249 !-------------------------------------------------------------
1250 ! pgevp: Evaporation of melting graupel [HL A25] [RH84 A19]
1252 !-------------------------------------------------------------
1253 if(qrs(i,k,3).gt.0..and.rh(i,k,1).lt.1.) then
1254 coeres = rslope2(i,k,3)*sqrt(rslope(i,k,3)*rslopeb(i,k,3))
1255 pgevp(i,k) = (rh(i,k,1)-1.)*(precg1*rslope2(i,k,3) &
1256 +precg2*work2(i,k)*coeres)/work1(i,k,1)
1257 pgevp(i,k) = min(max(pgevp(i,k),-qrs(i,k,3)/dtcld),0.)
1264 !----------------------------------------------------------------
1265 ! check mass conservation of generation terms and feedback to the
1273 if(qrs(i,k,1).lt.1.e-4.and.qrs(i,k,2).lt.1.e-4) delta2=1.
1274 if(qrs(i,k,1).lt.1.e-4) delta3=1.
1275 if(t(i,k).le.t0c) then
1279 value = max(qmin,qci(i,k,1))
1280 source = (praut(i,k)+pracw(i,k)+paacw(i,k)+paacw(i,k))*dtcld
1281 if (source.gt.value) then
1282 factor = value/source
1283 praut(i,k) = praut(i,k)*factor
1284 pracw(i,k) = pracw(i,k)*factor
1285 paacw(i,k) = paacw(i,k)*factor
1290 value = max(qmin,qci(i,k,2))
1291 source = (psaut(i,k)-pigen(i,k)-pidep(i,k)+praci(i,k)+psaci(i,k) &
1293 if (source.gt.value) then
1294 factor = value/source
1295 psaut(i,k) = psaut(i,k)*factor
1296 pigen(i,k) = pigen(i,k)*factor
1297 pidep(i,k) = pidep(i,k)*factor
1298 praci(i,k) = praci(i,k)*factor
1299 psaci(i,k) = psaci(i,k)*factor
1300 pgaci(i,k) = pgaci(i,k)*factor
1305 value = max(qmin,qrs(i,k,1))
1306 source = (-praut(i,k)-prevp(i,k)-pracw(i,k)+piacr(i,k)+psacr(i,k) &
1308 if (source.gt.value) then
1309 factor = value/source
1310 praut(i,k) = praut(i,k)*factor
1311 prevp(i,k) = prevp(i,k)*factor
1312 pracw(i,k) = pracw(i,k)*factor
1313 piacr(i,k) = piacr(i,k)*factor
1314 psacr(i,k) = psacr(i,k)*factor
1315 pgacr(i,k) = pgacr(i,k)*factor
1320 value = max(qmin,qrs(i,k,2))
1321 source = -(psdep(i,k)+psaut(i,k)-pgaut(i,k)+paacw(i,k)+piacr(i,k) &
1322 *delta3+praci(i,k)*delta3-pracs(i,k)*(1.-delta2) &
1323 +psacr(i,k)*delta2+psaci(i,k)-pgacs(i,k) )*dtcld
1324 if (source.gt.value) then
1325 factor = value/source
1326 psdep(i,k) = psdep(i,k)*factor
1327 psaut(i,k) = psaut(i,k)*factor
1328 pgaut(i,k) = pgaut(i,k)*factor
1329 paacw(i,k) = paacw(i,k)*factor
1330 piacr(i,k) = piacr(i,k)*factor
1331 praci(i,k) = praci(i,k)*factor
1332 psaci(i,k) = psaci(i,k)*factor
1333 pracs(i,k) = pracs(i,k)*factor
1334 psacr(i,k) = psacr(i,k)*factor
1335 pgacs(i,k) = pgacs(i,k)*factor
1340 value = max(qmin,qrs(i,k,3))
1341 source = -(pgdep(i,k)+pgaut(i,k) &
1342 +piacr(i,k)*(1.-delta3)+praci(i,k)*(1.-delta3) &
1343 +psacr(i,k)*(1.-delta2)+pracs(i,k)*(1.-delta2) &
1344 +pgaci(i,k)+paacw(i,k)+pgacr(i,k)+pgacs(i,k))*dtcld
1345 if (source.gt.value) then
1346 factor = value/source
1347 pgdep(i,k) = pgdep(i,k)*factor
1348 pgaut(i,k) = pgaut(i,k)*factor
1349 piacr(i,k) = piacr(i,k)*factor
1350 praci(i,k) = praci(i,k)*factor
1351 psacr(i,k) = psacr(i,k)*factor
1352 pracs(i,k) = pracs(i,k)*factor
1353 paacw(i,k) = paacw(i,k)*factor
1354 pgaci(i,k) = pgaci(i,k)*factor
1355 pgacr(i,k) = pgacr(i,k)*factor
1356 pgacs(i,k) = pgacs(i,k)*factor
1359 work2(i,k)=-(prevp(i,k)+psdep(i,k)+pgdep(i,k)+pigen(i,k)+pidep(i,k))
1361 q(i,k) = q(i,k)+work2(i,k)*dtcld
1362 qci(i,k,1) = max(qci(i,k,1)-(praut(i,k)+pracw(i,k) &
1363 +paacw(i,k)+paacw(i,k))*dtcld,0.)
1364 qrs(i,k,1) = max(qrs(i,k,1)+(praut(i,k)+pracw(i,k) &
1365 +prevp(i,k)-piacr(i,k)-pgacr(i,k) &
1366 -psacr(i,k))*dtcld,0.)
1367 qci(i,k,2) = max(qci(i,k,2)-(psaut(i,k)+praci(i,k) &
1368 +psaci(i,k)+pgaci(i,k)-pigen(i,k)-pidep(i,k)) &
1370 qrs(i,k,2) = max(qrs(i,k,2)+(psdep(i,k)+psaut(i,k)+paacw(i,k) &
1371 -pgaut(i,k)+piacr(i,k)*delta3 &
1372 +praci(i,k)*delta3+psaci(i,k)-pgacs(i,k) &
1373 -pracs(i,k)*(1.-delta2)+psacr(i,k)*delta2) &
1375 qrs(i,k,3) = max(qrs(i,k,3)+(pgdep(i,k)+pgaut(i,k) &
1376 +piacr(i,k)*(1.-delta3) &
1377 +praci(i,k)*(1.-delta3)+psacr(i,k)*(1.-delta2) &
1378 +pracs(i,k)*(1.-delta2)+pgaci(i,k)+paacw(i,k) &
1379 +pgacr(i,k)+pgacs(i,k))*dtcld,0.)
1381 xlwork2 = -xls*(psdep(i,k)+pgdep(i,k)+pidep(i,k)+pigen(i,k)) &
1382 -xl(i,k)*prevp(i,k)-xlf*(piacr(i,k)+paacw(i,k) &
1383 +paacw(i,k)+pgacr(i,k)+psacr(i,k))
1384 t(i,k) = t(i,k)-xlwork2/cpm(i,k)*dtcld
1389 value = max(qmin,qci(i,k,1))
1390 source=(praut(i,k)+pracw(i,k)+paacw(i,k)+paacw(i,k))*dtcld
1391 if (source.gt.value) then
1392 factor = value/source
1393 praut(i,k) = praut(i,k)*factor
1394 pracw(i,k) = pracw(i,k)*factor
1395 paacw(i,k) = paacw(i,k)*factor
1400 value = max(qmin,qrs(i,k,1))
1401 source = (-paacw(i,k)-praut(i,k)+pseml(i,k)+pgeml(i,k)-pracw(i,k) &
1402 -paacw(i,k)-prevp(i,k))*dtcld
1403 if (source.gt.value) then
1404 factor = value/source
1405 praut(i,k) = praut(i,k)*factor
1406 prevp(i,k) = prevp(i,k)*factor
1407 pracw(i,k) = pracw(i,k)*factor
1408 paacw(i,k) = paacw(i,k)*factor
1409 pseml(i,k) = pseml(i,k)*factor
1410 pgeml(i,k) = pgeml(i,k)*factor
1415 value = max(qcrmin,qrs(i,k,2))
1416 source=(pgacs(i,k)-pseml(i,k)-psevp(i,k))*dtcld
1417 if (source.gt.value) then
1418 factor = value/source
1419 pgacs(i,k) = pgacs(i,k)*factor
1420 psevp(i,k) = psevp(i,k)*factor
1421 pseml(i,k) = pseml(i,k)*factor
1426 value = max(qcrmin,qrs(i,k,3))
1427 source=-(pgacs(i,k)+pgevp(i,k)+pgeml(i,k))*dtcld
1428 if (source.gt.value) then
1429 factor = value/source
1430 pgacs(i,k) = pgacs(i,k)*factor
1431 pgevp(i,k) = pgevp(i,k)*factor
1432 pgeml(i,k) = pgeml(i,k)*factor
1434 work2(i,k)=-(prevp(i,k)+psevp(i,k)+pgevp(i,k))
1436 q(i,k) = q(i,k)+work2(i,k)*dtcld
1437 qci(i,k,1) = max(qci(i,k,1)-(praut(i,k)+pracw(i,k) &
1438 +paacw(i,k)+paacw(i,k))*dtcld,0.)
1439 qrs(i,k,1) = max(qrs(i,k,1)+(praut(i,k)+pracw(i,k) &
1440 +prevp(i,k)+paacw(i,k)+paacw(i,k)-pseml(i,k) &
1441 -pgeml(i,k))*dtcld,0.)
1442 qrs(i,k,2) = max(qrs(i,k,2)+(psevp(i,k)-pgacs(i,k) &
1443 +pseml(i,k))*dtcld,0.)
1444 qrs(i,k,3) = max(qrs(i,k,3)+(pgacs(i,k)+pgevp(i,k) &
1445 +pgeml(i,k))*dtcld,0.)
1447 xlwork2 = -xl(i,k)*(prevp(i,k)+psevp(i,k)+pgevp(i,k)) &
1448 -xlf*(pseml(i,k)+pgeml(i,k))
1449 t(i,k) = t(i,k)-xlwork2/cpm(i,k)*dtcld
1454 ! Inline expansion for fpvs
1455 ! qs(i,k,1) = fpvs(t(i,k),0,rd,rv,cpv,cliq,cice,xlv0,xls,psat,t0c)
1456 ! qs(i,k,2) = fpvs(t(i,k),1,rd,rv,cpv,cliq,cice,xlv0,xls,psat,t0c)
1466 xbi=xai+hsub/(rv*ttp)
1470 qs(i,k,1)=psat*exp(log(tr)*(xa))*exp(xb*(1.-tr))
1471 qs(i,k,1) = min(qs(i,k,1),0.99*p(i,k))
1472 qs(i,k,1) = ep2 * qs(i,k,1) / (p(i,k) - qs(i,k,1))
1473 qs(i,k,1) = max(qs(i,k,1),qmin)
1475 if(t(i,k).lt.ttp) then
1476 qs(i,k,2)=psat*exp(log(tr)*(xai))*exp(xbi*(1.-tr))
1478 qs(i,k,2)=psat*exp(log(tr)*(xa))*exp(xb*(1.-tr))
1480 qs(i,k,2) = min(qs(i,k,2),0.99*p(i,k))
1481 qs(i,k,2) = ep2 * qs(i,k,2) / (p(i,k) - qs(i,k,2))
1482 qs(i,k,2) = max(qs(i,k,2),qmin)
1486 !----------------------------------------------------------------
1487 ! pcond: condensational/evaporational rate of cloud water [HL A46] [RH83 A6]
1488 ! if there exists additional water vapor condensated/if
1489 ! evaporation of cloud water is not enough to remove subsaturation
1493 work1(i,k,1) = conden(t(i,k),q(i,k),qs(i,k,1),xl(i,k),cpm(i,k))
1494 work2(i,k) = qci(i,k,1)+work1(i,k,1)
1495 pcond(i,k) = min(max(work1(i,k,1)/dtcld,0.),max(q(i,k),0.)/dtcld)
1496 if(qci(i,k,1).gt.0..and.work1(i,k,1).lt.0.) &
1497 pcond(i,k) = max(work1(i,k,1),-qci(i,k,1))/dtcld
1498 q(i,k) = q(i,k)-pcond(i,k)*dtcld
1499 qci(i,k,1) = max(qci(i,k,1)+pcond(i,k)*dtcld,0.)
1500 t(i,k) = t(i,k)+pcond(i,k)*xl(i,k)/cpm(i,k)*dtcld
1505 !----------------------------------------------------------------
1506 ! padding for small values
1510 if(qci(i,k,1).le.qmin) qci(i,k,1) = 0.0
1511 if(qci(i,k,2).le.qmin) qci(i,k,2) = 0.0
1516 #if( WRF_CHEM == 1 )
1517 if( wetscav_on ) then
1518 rainprod2d = praut+pracw+praci+psaci+pgaci+psacw+pgacw+paacw+psaut
1519 evapprod2d = -(prevp+psevp+pgevp+psdep+pgdep)
1523 END SUBROUTINE wsm62d
1524 ! ...................................................................
1525 REAL FUNCTION rgmma(x)
1526 !-------------------------------------------------------------------
1528 !-------------------------------------------------------------------
1529 ! rgmma function: use infinite product form
1531 PARAMETER (euler=0.577215664901532)
1537 rgmma=x*exp(euler*x)
1540 rgmma=rgmma*(1.000+x/y)*exp(-x/y)
1546 !--------------------------------------------------------------------------
1547 REAL FUNCTION fpvs(t,ice,rd,rv,cvap,cliq,cice,hvap,hsub,psat,t0c)
1548 !--------------------------------------------------------------------------
1550 !--------------------------------------------------------------------------
1551 REAL t,rd,rv,cvap,cliq,cice,hvap,hsub,psat,t0c,dldt,xa,xb,dldti, &
1554 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1561 xbi=xai+hsub/(rv*ttp)
1563 if(t.lt.ttp.and.ice.eq.1) then
1564 fpvs=psat*(tr**xai)*exp(xbi*(1.-tr))
1566 fpvs=psat*(tr**xa)*exp(xb*(1.-tr))
1568 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1570 !-------------------------------------------------------------------
1571 SUBROUTINE wsm6init(den0,denr,dens,cl,cpv,hail_opt,allowed_to_read)
1572 !-------------------------------------------------------------------
1574 !-------------------------------------------------------------------
1575 !.... constants which may not be tunable
1576 REAL, INTENT(IN) :: den0,denr,dens,cl,cpv
1577 INTEGER, INTENT(IN) :: hail_opt ! RAS
1578 LOGICAL, INTENT(IN) :: allowed_to_read
1580 ! RAS13.1 define graupel parameters as graupel-like or hail-like,
1581 ! depending on namelist option
1582 IF (hail_opt .eq. 1) THEN !Hail!
1599 qc0 = 4./3.*pi*denr*r0**3*xncr/den0 ! 0.419e-3 -- .61e-3
1600 qck1 = .104*9.8*peaut/(xncr*denr)**(1./3.)/xmyu*den0**(4./3.) ! 7.03
1601 pidnc = pi*denr/6. ! syb
1608 g1pbr = rgmma(bvtr1)
1609 g3pbr = rgmma(bvtr3)
1610 g4pbr = rgmma(bvtr4) ! 17.837825
1611 g6pbr = rgmma(bvtr6)
1612 g5pbro2 = rgmma(bvtr2) ! 1.8273
1613 pvtr = avtr*g4pbr/6.
1615 pacrr = pi*n0r*avtr*g3pbr*.25*eacrr
1616 precr1 = 2.*pi*n0r*.78
1617 precr2 = 2.*pi*n0r*.31*avtr**.5*g5pbro2
1618 roqimax = 2.08e22*dimax**8
1624 g1pbs = rgmma(bvts1) !.8875
1625 g3pbs = rgmma(bvts3)
1626 g4pbs = rgmma(bvts4) ! 12.0786
1627 g5pbso2 = rgmma(bvts2)
1628 pvts = avts*g4pbs/6.
1629 pacrs = pi*n0s*avts*g3pbs*.25
1631 precs2 = 4.*n0s*.44*avts**.5*g5pbso2
1632 pidn0r = pi*denr*n0r
1633 pidn0s = pi*dens*n0s
1635 pacrc = pi*n0s*avts*g3pbs*.25*eacrc
1641 g1pbg = rgmma(bvtg1)
1642 g3pbg = rgmma(bvtg3)
1643 g4pbg = rgmma(bvtg4)
1644 pacrg = pi*n0g*avtg*g3pbg*.25
1645 g5pbgo2 = rgmma(bvtg2)
1646 pvtg = avtg*g4pbg/6.
1647 precg1 = 2.*pi*n0g*.78
1648 precg2 = 2.*pi*n0g*.31*avtg**.5*g5pbgo2
1649 pidn0g = pi*deng*n0g
1651 rslopermax = 1./lamdarmax
1652 rslopesmax = 1./lamdasmax
1653 rslopegmax = 1./lamdagmax
1654 rsloperbmax = rslopermax ** bvtr
1655 rslopesbmax = rslopesmax ** bvts
1656 rslopegbmax = rslopegmax ** bvtg
1657 rsloper2max = rslopermax * rslopermax
1658 rslopes2max = rslopesmax * rslopesmax
1659 rslopeg2max = rslopegmax * rslopegmax
1660 rsloper3max = rsloper2max * rslopermax
1661 rslopes3max = rslopes2max * rslopesmax
1662 rslopeg3max = rslopeg2max * rslopegmax
1664 !+---+-----------------------------------------------------------------+
1665 !..Set these variables needed for computing radar reflectivity. These
1666 !.. get used within radar_init to create other variables used in the
1679 !+---+-----------------------------------------------------------------+
1682 END SUBROUTINE wsm6init
1683 !------------------------------------------------------------------------------
1684 subroutine slope_wsm6(qrs,den,denfac,t,rslope,rslopeb,rslope2,rslope3, &
1687 INTEGER :: its,ite, jts,jte, kts,kte
1688 REAL, DIMENSION( its:ite , kts:kte,3) :: &
1695 REAL, DIMENSION( its:ite , kts:kte) :: &
1699 REAL, PARAMETER :: t0c = 273.15
1700 REAL, DIMENSION( its:ite , kts:kte ) :: &
1702 REAL :: lamdar, lamdas, lamdag, x, y, z, supcol
1704 !----------------------------------------------------------------
1705 ! size distributions: (x=mixing ratio, y=air density):
1706 ! valid for mixing ratio > 1.e-9 kg/kg.
1707 lamdar(x,y)= sqrt(sqrt(pidn0r/(x*y))) ! (pidn0r/(x*y))**.25
1708 lamdas(x,y,z)= sqrt(sqrt(pidn0s*z/(x*y))) ! (pidn0s*z/(x*y))**.25
1709 lamdag(x,y)= sqrt(sqrt(pidn0g/(x*y))) ! (pidn0g/(x*y))**.25
1714 !---------------------------------------------------------------
1715 ! n0s: Intercept parameter for snow [m-4] [HDC 6]
1716 !---------------------------------------------------------------
1717 n0sfac(i,k) = max(min(exp(alpha*supcol),n0smax/n0s),1.)
1718 if(qrs(i,k,1).le.qcrmin)then
1719 rslope(i,k,1) = rslopermax
1720 rslopeb(i,k,1) = rsloperbmax
1721 rslope2(i,k,1) = rsloper2max
1722 rslope3(i,k,1) = rsloper3max
1724 rslope(i,k,1) = 1./lamdar(qrs(i,k,1),den(i,k))
1725 rslopeb(i,k,1) = rslope(i,k,1)**bvtr
1726 rslope2(i,k,1) = rslope(i,k,1)*rslope(i,k,1)
1727 rslope3(i,k,1) = rslope2(i,k,1)*rslope(i,k,1)
1729 if(qrs(i,k,2).le.qcrmin)then
1730 rslope(i,k,2) = rslopesmax
1731 rslopeb(i,k,2) = rslopesbmax
1732 rslope2(i,k,2) = rslopes2max
1733 rslope3(i,k,2) = rslopes3max
1735 rslope(i,k,2) = 1./lamdas(qrs(i,k,2),den(i,k),n0sfac(i,k))
1736 rslopeb(i,k,2) = rslope(i,k,2)**bvts
1737 rslope2(i,k,2) = rslope(i,k,2)*rslope(i,k,2)
1738 rslope3(i,k,2) = rslope2(i,k,2)*rslope(i,k,2)
1740 if(qrs(i,k,3).le.qcrmin)then
1741 rslope(i,k,3) = rslopegmax
1742 rslopeb(i,k,3) = rslopegbmax
1743 rslope2(i,k,3) = rslopeg2max
1744 rslope3(i,k,3) = rslopeg3max
1746 rslope(i,k,3) = 1./lamdag(qrs(i,k,3),den(i,k))
1747 rslopeb(i,k,3) = rslope(i,k,3)**bvtg
1748 rslope2(i,k,3) = rslope(i,k,3)*rslope(i,k,3)
1749 rslope3(i,k,3) = rslope2(i,k,3)*rslope(i,k,3)
1751 vt(i,k,1) = pvtr*rslopeb(i,k,1)*denfac(i,k)
1752 vt(i,k,2) = pvts*rslopeb(i,k,2)*denfac(i,k)
1753 vt(i,k,3) = pvtg*rslopeb(i,k,3)*denfac(i,k)
1754 if(qrs(i,k,1).le.0.0) vt(i,k,1) = 0.0
1755 if(qrs(i,k,2).le.0.0) vt(i,k,2) = 0.0
1756 if(qrs(i,k,3).le.0.0) vt(i,k,3) = 0.0
1759 END subroutine slope_wsm6
1760 !-----------------------------------------------------------------------------
1761 subroutine slope_rain(qrs,den,denfac,t,rslope,rslopeb,rslope2,rslope3, &
1764 INTEGER :: its,ite, jts,jte, kts,kte
1765 REAL, DIMENSION( its:ite , kts:kte) :: &
1775 REAL, PARAMETER :: t0c = 273.15
1776 REAL, DIMENSION( its:ite , kts:kte ) :: &
1778 REAL :: lamdar, x, y, z, supcol
1780 !----------------------------------------------------------------
1781 ! size distributions: (x=mixing ratio, y=air density):
1782 ! valid for mixing ratio > 1.e-9 kg/kg.
1783 lamdar(x,y)= sqrt(sqrt(pidn0r/(x*y))) ! (pidn0r/(x*y))**.25
1787 if(qrs(i,k).le.qcrmin)then
1788 rslope(i,k) = rslopermax
1789 rslopeb(i,k) = rsloperbmax
1790 rslope2(i,k) = rsloper2max
1791 rslope3(i,k) = rsloper3max
1793 rslope(i,k) = 1./lamdar(qrs(i,k),den(i,k))
1794 rslopeb(i,k) = rslope(i,k)**bvtr
1795 rslope2(i,k) = rslope(i,k)*rslope(i,k)
1796 rslope3(i,k) = rslope2(i,k)*rslope(i,k)
1798 vt(i,k) = pvtr*rslopeb(i,k)*denfac(i,k)
1799 if(qrs(i,k).le.0.0) vt(i,k) = 0.0
1802 END subroutine slope_rain
1803 !------------------------------------------------------------------------------
1804 subroutine slope_snow(qrs,den,denfac,t,rslope,rslopeb,rslope2,rslope3, &
1807 INTEGER :: its,ite, jts,jte, kts,kte
1808 REAL, DIMENSION( its:ite , kts:kte) :: &
1818 REAL, PARAMETER :: t0c = 273.15
1819 REAL, DIMENSION( its:ite , kts:kte ) :: &
1821 REAL :: lamdas, x, y, z, supcol
1823 !----------------------------------------------------------------
1824 ! size distributions: (x=mixing ratio, y=air density):
1825 ! valid for mixing ratio > 1.e-9 kg/kg.
1826 lamdas(x,y,z)= sqrt(sqrt(pidn0s*z/(x*y))) ! (pidn0s*z/(x*y))**.25
1831 !---------------------------------------------------------------
1832 ! n0s: Intercept parameter for snow [m-4] [HDC 6]
1833 !---------------------------------------------------------------
1834 n0sfac(i,k) = max(min(exp(alpha*supcol),n0smax/n0s),1.)
1835 if(qrs(i,k).le.qcrmin)then
1836 rslope(i,k) = rslopesmax
1837 rslopeb(i,k) = rslopesbmax
1838 rslope2(i,k) = rslopes2max
1839 rslope3(i,k) = rslopes3max
1841 rslope(i,k) = 1./lamdas(qrs(i,k),den(i,k),n0sfac(i,k))
1842 rslopeb(i,k) = rslope(i,k)**bvts
1843 rslope2(i,k) = rslope(i,k)*rslope(i,k)
1844 rslope3(i,k) = rslope2(i,k)*rslope(i,k)
1846 vt(i,k) = pvts*rslopeb(i,k)*denfac(i,k)
1847 if(qrs(i,k).le.0.0) vt(i,k) = 0.0
1850 END subroutine slope_snow
1851 !----------------------------------------------------------------------------------
1852 subroutine slope_graup(qrs,den,denfac,t,rslope,rslopeb,rslope2,rslope3, &
1855 INTEGER :: its,ite, jts,jte, kts,kte
1856 REAL, DIMENSION( its:ite , kts:kte) :: &
1866 REAL, PARAMETER :: t0c = 273.15
1867 REAL, DIMENSION( its:ite , kts:kte ) :: &
1869 REAL :: lamdag, x, y, z, supcol
1871 !----------------------------------------------------------------
1872 ! size distributions: (x=mixing ratio, y=air density):
1873 ! valid for mixing ratio > 1.e-9 kg/kg.
1874 lamdag(x,y)= sqrt(sqrt(pidn0g/(x*y))) ! (pidn0g/(x*y))**.25
1878 !---------------------------------------------------------------
1879 ! n0s: Intercept parameter for snow [m-4] [HDC 6]
1880 !---------------------------------------------------------------
1881 if(qrs(i,k).le.qcrmin)then
1882 rslope(i,k) = rslopegmax
1883 rslopeb(i,k) = rslopegbmax
1884 rslope2(i,k) = rslopeg2max
1885 rslope3(i,k) = rslopeg3max
1887 rslope(i,k) = 1./lamdag(qrs(i,k),den(i,k))
1888 rslopeb(i,k) = rslope(i,k)**bvtg
1889 rslope2(i,k) = rslope(i,k)*rslope(i,k)
1890 rslope3(i,k) = rslope2(i,k)*rslope(i,k)
1892 vt(i,k) = pvtg*rslopeb(i,k)*denfac(i,k)
1893 if(qrs(i,k).le.0.0) vt(i,k) = 0.0
1896 END subroutine slope_graup
1897 !---------------------------------------------------------------------------------
1898 !-------------------------------------------------------------------
1899 SUBROUTINE nislfv_rain_plm(im,km,denl,denfacl,tkl,dzl,wwl,rql,precip,dt,id,iter)
1900 !-------------------------------------------------------------------
1902 ! for non-iteration semi-Lagrangain forward advection for cloud
1903 ! with mass conservation and positive definite advection
1904 ! 2nd order interpolation with monotonic piecewise linear method
1905 ! this routine is under assumption of decfl < 1 for semi_Lagrangian
1907 ! dzl depth of model layer in meter
1908 ! wwl terminal velocity at model layer m/s
1909 ! rql cloud density*mixing ration
1910 ! precip precipitation
1912 ! id kind of precip: 0 test case; 1 raindrop
1913 ! iter how many time to guess mean terminal velocity: 0 pure forward.
1914 ! 0 : use departure wind for advection
1915 ! 1 : use mean wind for advection
1916 ! > 1 : use mean wind after iter-1 iterations
1918 ! author: hann-ming henry juang <henry.juang@noaa.gov>
1919 ! implemented by song-you hong
1924 real dzl(im,km),wwl(im,km),rql(im,km),precip(im)
1925 real denl(im,km),denfacl(im,km),tkl(im,km)
1927 integer i,k,n,m,kk,kb,kt,iter
1928 real tl,tl2,qql,dql,qqd
1930 real zsum,qsum,dim,dip,c1,con1,fa1,fa2
1931 real allold, allnew, zz, dzamin, cflmax, decfl
1932 real dz(km), ww(km), qq(km), wd(km), wa(km), was(km)
1933 real den(km), denfac(km), tk(km)
1934 real wi(km+1), zi(km+1), za(km+1)
1935 real qn(km), qr(km),tmp(km),tmp1(km),tmp2(km),tmp3(km)
1936 real dza(km+1), qa(km+1), qmi(km+1), qpi(km+1)
1941 ! -----------------------------------
1946 denfac(:) = denfacl(i,:)
1948 ! skip for no precipitation for all layers
1951 allold = allold + qq(k)
1953 if(allold.le.0.0) then
1957 ! compute interface values
1960 zi(k+1) = zi(k)+dz(k)
1963 ! save departure wind
1967 ! plm is 2nd order, we can use 2nd order wi or 3rd order wi
1968 ! 2nd order interpolation to get wi
1972 wi(k) = (ww(k)*dz(k-1)+ww(k-1)*dz(k))/(dz(k-1)+dz(k))
1974 ! 3rd order interpolation to get wi
1978 wi(2) = 0.5*(ww(2)+ww(1))
1980 wi(k) = fa1*(ww(k)+ww(k-1))-fa2*(ww(k+1)+ww(k-2))
1982 wi(km) = 0.5*(ww(km)+ww(km-1))
1985 ! terminate of top of raingroup
1987 if( ww(k).eq.0.0 ) wi(k)=ww(k-1)
1993 decfl = (wi(k+1)-wi(k))*dt/dz(k)
1994 if( decfl .gt. con1 ) then
1995 wi(k) = wi(k+1) - con1*dz(k)/dt
1998 ! compute arrival point
2000 za(k) = zi(k) - wi(k)*dt
2004 dza(k) = za(k+1)-za(k)
2006 dza(km+1) = zi(km+1) - za(km+1)
2008 ! computer deformation at arrival point
2010 qa(k) = qq(k)*dz(k)/dza(k)
2011 qr(k) = qa(k)/den(k)
2014 ! call maxmin(km,1,qa,' arrival points ')
2016 ! compute arrival terminal velocity, and estimate mean terminal velocity
2017 ! then back to use mean terminal velocity
2018 if( n.le.iter ) then
2019 call slope_rain(qr,den,denfac,tk,tmp,tmp1,tmp2,tmp3,wa,1,1,1,km)
2020 if( n.ge.2 ) wa(1:km)=0.5*(wa(1:km)+was(1:km))
2023 ! print*,' slope_wsm3 ',qr(k)*1000.,den(k),denfac(k),tk(k),tmp(k),tmp1(k),tmp2(k),ww(k),wa(k)
2025 ! mean wind is average of departure and new arrival winds
2026 ww(k) = 0.5* ( wd(k)+wa(k) )
2033 ! estimate values at arrival cell interface with monotone
2035 dip=(qa(k+1)-qa(k))/(dza(k+1)+dza(k))
2036 dim=(qa(k)-qa(k-1))/(dza(k-1)+dza(k))
2037 if( dip*dim.le.0.0 ) then
2041 qpi(k)=qa(k)+0.5*(dip+dim)*dza(k)
2042 qmi(k)=2.0*qa(k)-qpi(k)
2043 if( qpi(k).lt.0.0 .or. qmi(k).lt.0.0 ) then
2054 ! interpolation to regular point
2062 if( zi(k).ge.za(km+1) ) then
2065 find_kb : do kk=kb,km
2066 if( zi(k).le.za(kk+1) ) then
2073 find_kt : do kk=kt,km
2074 if( zi(k+1).le.za(kk) ) then
2082 ! compute q with piecewise constant method
2084 tl=(zi(k)-za(kb))/dza(kb)
2085 th=(zi(k+1)-za(kb))/dza(kb)
2088 qqd=0.5*(qpi(kb)-qmi(kb))
2089 qqh=qqd*th2+qmi(kb)*th
2090 qql=qqd*tl2+qmi(kb)*tl
2091 qn(k) = (qqh-qql)/(th-tl)
2092 else if( kt.gt.kb ) then
2093 tl=(zi(k)-za(kb))/dza(kb)
2095 qqd=0.5*(qpi(kb)-qmi(kb))
2096 qql=qqd*tl2+qmi(kb)*tl
2098 zsum = (1.-tl)*dza(kb)
2100 if( kt-kb.gt.1 ) then
2102 zsum = zsum + dza(m)
2103 qsum = qsum + qa(m) * dza(m)
2106 th=(zi(k+1)-za(kt))/dza(kt)
2108 qqd=0.5*(qpi(kt)-qmi(kt))
2109 dqh=qqd*th2+qmi(kt)*th
2110 zsum = zsum + th*dza(kt)
2111 qsum = qsum + dqh*dza(kt)
2120 sum_precip: do k=1,km
2121 if( za(k).lt.0.0 .and. za(k+1).lt.0.0 ) then
2122 precip(i) = precip(i) + qa(k)*dza(k)
2124 else if ( za(k).lt.0.0 .and. za(k+1).ge.0.0 ) then
2125 precip(i) = precip(i) + qa(k)*(0.0-za(k))
2131 ! replace the new values
2134 ! ----------------------------------
2137 END SUBROUTINE nislfv_rain_plm
2138 !-------------------------------------------------------------------
2139 SUBROUTINE nislfv_rain_plm6(im,km,denl,denfacl,tkl,dzl,wwl,rql,rql2, precip1, precip2,dt,id,iter)
2140 !-------------------------------------------------------------------
2142 ! for non-iteration semi-Lagrangain forward advection for cloud
2143 ! with mass conservation and positive definite advection
2144 ! 2nd order interpolation with monotonic piecewise linear method
2145 ! this routine is under assumption of decfl < 1 for semi_Lagrangian
2147 ! dzl depth of model layer in meter
2148 ! wwl terminal velocity at model layer m/s
2149 ! rql cloud density*mixing ration
2150 ! precip precipitation
2152 ! id kind of precip: 0 test case; 1 raindrop
2153 ! iter how many time to guess mean terminal velocity: 0 pure forward.
2154 ! 0 : use departure wind for advection
2155 ! 1 : use mean wind for advection
2156 ! > 1 : use mean wind after iter-1 iterations
2158 ! author: hann-ming henry juang <henry.juang@noaa.gov>
2159 ! implemented by song-you hong
2164 real dzl(im,km),wwl(im,km),rql(im,km),rql2(im,km),precip(im),precip1(im),precip2(im)
2165 real denl(im,km),denfacl(im,km),tkl(im,km)
2167 integer i,k,n,m,kk,kb,kt,iter,ist
2168 real tl,tl2,qql,dql,qqd
2170 real zsum,qsum,dim,dip,c1,con1,fa1,fa2
2171 real allold, allnew, zz, dzamin, cflmax, decfl
2172 real dz(km), ww(km), qq(km), qq2(km), wd(km), wa(km), wa2(km), was(km)
2173 real den(km), denfac(km), tk(km)
2174 real wi(km+1), zi(km+1), za(km+1)
2175 real qn(km), qr(km),qr2(km),tmp(km),tmp1(km),tmp2(km),tmp3(km)
2176 real dza(km+1), qa(km+1), qa2(km+1),qmi(km+1), qpi(km+1)
2183 ! -----------------------------------
2189 denfac(:) = denfacl(i,:)
2191 ! skip for no precipitation for all layers
2194 allold = allold + qq(k) + qq2(k)
2196 if(allold.le.0.0) then
2200 ! compute interface values
2203 zi(k+1) = zi(k)+dz(k)
2206 ! save departure wind
2210 ! plm is 2nd order, we can use 2nd order wi or 3rd order wi
2211 ! 2nd order interpolation to get wi
2215 wi(k) = (ww(k)*dz(k-1)+ww(k-1)*dz(k))/(dz(k-1)+dz(k))
2217 ! 3rd order interpolation to get wi
2221 wi(2) = 0.5*(ww(2)+ww(1))
2223 wi(k) = fa1*(ww(k)+ww(k-1))-fa2*(ww(k+1)+ww(k-2))
2225 wi(km) = 0.5*(ww(km)+ww(km-1))
2228 ! terminate of top of raingroup
2230 if( ww(k).eq.0.0 ) wi(k)=ww(k-1)
2236 decfl = (wi(k+1)-wi(k))*dt/dz(k)
2237 if( decfl .gt. con1 ) then
2238 wi(k) = wi(k+1) - con1*dz(k)/dt
2241 ! compute arrival point
2243 za(k) = zi(k) - wi(k)*dt
2247 dza(k) = za(k+1)-za(k)
2249 dza(km+1) = zi(km+1) - za(km+1)
2251 ! computer deformation at arrival point
2253 qa(k) = qq(k)*dz(k)/dza(k)
2254 qa2(k) = qq2(k)*dz(k)/dza(k)
2255 qr(k) = qa(k)/den(k)
2256 qr2(k) = qa2(k)/den(k)
2260 ! call maxmin(km,1,qa,' arrival points ')
2262 ! compute arrival terminal velocity, and estimate mean terminal velocity
2263 ! then back to use mean terminal velocity
2264 if( n.le.iter ) then
2265 call slope_snow(qr,den,denfac,tk,tmp,tmp1,tmp2,tmp3,wa,1,1,1,km)
2266 call slope_graup(qr2,den,denfac,tk,tmp,tmp1,tmp2,tmp3,wa2,1,1,1,km)
2268 tmp(k) = max((qr(k)+qr2(k)), 1.E-15)
2269 IF ( tmp(k) .gt. 1.e-15 ) THEN
2270 wa(k) = (wa(k)*qr(k) + wa2(k)*qr2(k))/tmp(k)
2275 if( n.ge.2 ) wa(1:km)=0.5*(wa(1:km)+was(1:km))
2278 ! print*,' slope_wsm3 ',qr(k)*1000.,den(k),denfac(k),tk(k),tmp(k),tmp1(k),tmp2(k), &
2281 ! mean wind is average of departure and new arrival winds
2282 ww(k) = 0.5* ( wd(k)+wa(k) )
2288 ist_loop : do ist = 1, 2
2295 ! estimate values at arrival cell interface with monotone
2297 dip=(qa(k+1)-qa(k))/(dza(k+1)+dza(k))
2298 dim=(qa(k)-qa(k-1))/(dza(k-1)+dza(k))
2299 if( dip*dim.le.0.0 ) then
2303 qpi(k)=qa(k)+0.5*(dip+dim)*dza(k)
2304 qmi(k)=2.0*qa(k)-qpi(k)
2305 if( qpi(k).lt.0.0 .or. qmi(k).lt.0.0 ) then
2316 ! interpolation to regular point
2324 if( zi(k).ge.za(km+1) ) then
2327 find_kb : do kk=kb,km
2328 if( zi(k).le.za(kk+1) ) then
2335 find_kt : do kk=kt,km
2336 if( zi(k+1).le.za(kk) ) then
2344 ! compute q with piecewise constant method
2346 tl=(zi(k)-za(kb))/dza(kb)
2347 th=(zi(k+1)-za(kb))/dza(kb)
2350 qqd=0.5*(qpi(kb)-qmi(kb))
2351 qqh=qqd*th2+qmi(kb)*th
2352 qql=qqd*tl2+qmi(kb)*tl
2353 qn(k) = (qqh-qql)/(th-tl)
2354 else if( kt.gt.kb ) then
2355 tl=(zi(k)-za(kb))/dza(kb)
2357 qqd=0.5*(qpi(kb)-qmi(kb))
2358 qql=qqd*tl2+qmi(kb)*tl
2360 zsum = (1.-tl)*dza(kb)
2362 if( kt-kb.gt.1 ) then
2364 zsum = zsum + dza(m)
2365 qsum = qsum + qa(m) * dza(m)
2368 th=(zi(k+1)-za(kt))/dza(kt)
2370 qqd=0.5*(qpi(kt)-qmi(kt))
2371 dqh=qqd*th2+qmi(kt)*th
2372 zsum = zsum + th*dza(kt)
2373 qsum = qsum + dqh*dza(kt)
2382 sum_precip: do k=1,km
2383 if( za(k).lt.0.0 .and. za(k+1).lt.0.0 ) then
2384 precip(i) = precip(i) + qa(k)*dza(k)
2386 else if ( za(k).lt.0.0 .and. za(k+1).ge.0.0 ) then
2387 precip(i) = precip(i) + qa(k)*(0.0-za(k))
2393 ! replace the new values
2396 precip1(i) = precip(i)
2399 precip2(i) = precip(i)
2403 ! ----------------------------------
2406 END SUBROUTINE nislfv_rain_plm6
2408 !+---+-----------------------------------------------------------------+
2410 subroutine refl10cm_wsm6 (qv1d, qr1d, qs1d, qg1d, &
2411 t1d, p1d, dBZ, kts, kte, ii, jj)
2416 INTEGER, INTENT(IN):: kts, kte, ii, jj
2417 REAL, DIMENSION(kts:kte), INTENT(IN):: &
2418 qv1d, qr1d, qs1d, qg1d, t1d, p1d
2419 REAL, DIMENSION(kts:kte), INTENT(INOUT):: dBZ
2422 REAL, DIMENSION(kts:kte):: temp, pres, qv, rho
2423 REAL, DIMENSION(kts:kte):: rr, rs, rg
2426 DOUBLE PRECISION, DIMENSION(kts:kte):: ilamr, ilams, ilamg
2427 DOUBLE PRECISION, DIMENSION(kts:kte):: N0_r, N0_s, N0_g
2428 DOUBLE PRECISION:: lamr, lams, lamg
2429 LOGICAL, DIMENSION(kts:kte):: L_qr, L_qs, L_qg
2431 REAL, DIMENSION(kts:kte):: ze_rain, ze_snow, ze_graupel
2432 DOUBLE PRECISION:: fmelt_s, fmelt_g
2434 INTEGER:: i, k, k_0, kbot, n
2437 DOUBLE PRECISION:: cback, x, eta, f_d
2438 REAL, PARAMETER:: R=287.
2446 !+---+-----------------------------------------------------------------+
2447 !..Put column of data into local arrays.
2448 !+---+-----------------------------------------------------------------+
2451 temp_C = min(-0.001, temp(K)-273.15)
2452 qv(k) = MAX(1.E-10, qv1d(k))
2454 rho(k) = 0.622*pres(k)/(R*temp(k)*(qv(k)+0.622))
2456 if (qr1d(k) .gt. 1.E-9) then
2457 rr(k) = qr1d(k)*rho(k)
2459 lamr = (xam_r*xcrg(3)*N0_r(k)/rr(k))**(1./xcre(1))
2467 if (qs1d(k) .gt. 1.E-9) then
2468 rs(k) = qs1d(k)*rho(k)
2469 N0_s(k) = min(n0smax, n0s*exp(-alpha*temp_C))
2470 lams = (xam_s*xcsg(3)*N0_s(k)/rs(k))**(1./xcse(1))
2478 if (qg1d(k) .gt. 1.E-9) then
2479 rg(k) = qg1d(k)*rho(k)
2481 lamg = (xam_g*xcgg(3)*N0_g(k)/rg(k))**(1./xcge(1))
2490 !+---+-----------------------------------------------------------------+
2491 !..Locate K-level of start of melting (k_0 is level above).
2492 !+---+-----------------------------------------------------------------+
2495 do k = kte-1, kts, -1
2496 if ( (temp(k).gt.273.15) .and. L_qr(k) &
2497 .and. (L_qs(k+1).or.L_qg(k+1)) ) then
2505 !+---+-----------------------------------------------------------------+
2506 !..Assume Rayleigh approximation at 10 cm wavelength. Rain (all temps)
2507 !.. and non-water-coated snow and graupel when below freezing are
2508 !.. simple. Integrations of m(D)*m(D)*N(D)*dD.
2509 !+---+-----------------------------------------------------------------+
2514 ze_graupel(k) = 1.e-22
2515 if (L_qr(k)) ze_rain(k) = N0_r(k)*xcrg(4)*ilamr(k)**xcre(4)
2516 if (L_qs(k)) ze_snow(k) = (0.176/0.93) * (6.0/PI)*(6.0/PI) &
2517 * (xam_s/900.0)*(xam_s/900.0) &
2518 * N0_s(k)*xcsg(4)*ilams(k)**xcse(4)
2519 if (L_qg(k)) ze_graupel(k) = (0.176/0.93) * (6.0/PI)*(6.0/PI) &
2520 * (xam_g/900.0)*(xam_g/900.0) &
2521 * N0_g(k)*xcgg(4)*ilamg(k)**xcge(4)
2525 !+---+-----------------------------------------------------------------+
2526 !..Special case of melting ice (snow/graupel) particles. Assume the
2527 !.. ice is surrounded by the liquid water. Fraction of meltwater is
2528 !.. extremely simple based on amount found above the melting level.
2529 !.. Uses code from Uli Blahak (rayleigh_soak_wetgraupel and supporting
2531 !+---+-----------------------------------------------------------------+
2533 if (melti .and. k_0.ge.kts+1) then
2534 do k = k_0-1, kts, -1
2536 !..Reflectivity contributed by melting snow
2537 if (L_qs(k) .and. L_qs(k_0) ) then
2538 fmelt_s = MAX(0.005d0, MIN(1.0d0-rs(k)/rs(k_0), 0.99d0))
2542 x = xam_s * xxDs(n)**xbm_s
2543 call rayleigh_soak_wetgraupel (x,DBLE(xocms),DBLE(xobms), &
2544 fmelt_s, melt_outside_s, m_w_0, m_i_0, lamda_radar, &
2545 CBACK, mixingrulestring_s, matrixstring_s, &
2546 inclusionstring_s, hoststring_s, &
2547 hostmatrixstring_s, hostinclusionstring_s)
2548 f_d = N0_s(k)*xxDs(n)**xmu_s * DEXP(-lams*xxDs(n))
2549 eta = eta + f_d * CBACK * simpson(n) * xdts(n)
2551 ze_snow(k) = SNGL(lamda4 / (pi5 * K_w) * eta)
2555 !..Reflectivity contributed by melting graupel
2557 if (L_qg(k) .and. L_qg(k_0) ) then
2558 fmelt_g = MAX(0.005d0, MIN(1.0d0-rg(k)/rg(k_0), 0.99d0))
2562 x = xam_g * xxDg(n)**xbm_g
2563 call rayleigh_soak_wetgraupel (x,DBLE(xocmg),DBLE(xobmg), &
2564 fmelt_g, melt_outside_g, m_w_0, m_i_0, lamda_radar, &
2565 CBACK, mixingrulestring_g, matrixstring_g, &
2566 inclusionstring_g, hoststring_g, &
2567 hostmatrixstring_g, hostinclusionstring_g)
2568 f_d = N0_g(k)*xxDg(n)**xmu_g * DEXP(-lamg*xxDg(n))
2569 eta = eta + f_d * CBACK * simpson(n) * xdtg(n)
2571 ze_graupel(k) = SNGL(lamda4 / (pi5 * K_w) * eta)
2578 dBZ(k) = 10.*log10((ze_rain(k)+ze_snow(k)+ze_graupel(k))*1.d18)
2582 end subroutine refl10cm_wsm6
2583 !+---+-----------------------------------------------------------------+
2585 !-----------------------------------------------------------------------
2586 subroutine effectRad_wsm6 (t, qc, qi, qs, rho, qmin, t0c, &
2587 re_qc, re_qi, re_qs, kts, kte, ii, jj)
2589 !-----------------------------------------------------------------------
2590 ! Compute radiation effective radii of cloud water, ice, and snow for
2591 ! single-moment microphysics.
2592 ! These are entirely consistent with microphysics assumptions, not
2593 ! constant or otherwise ad hoc as is internal to most radiation
2595 ! Coded and implemented by Soo ya Bae, KIAPS, January 2015.
2596 !-----------------------------------------------------------------------
2601 integer, intent(in) :: kts, kte, ii, jj
2602 real, intent(in) :: qmin
2603 real, intent(in) :: t0c
2604 real, dimension( kts:kte ), intent(in):: t
2605 real, dimension( kts:kte ), intent(in):: qc
2606 real, dimension( kts:kte ), intent(in):: qi
2607 real, dimension( kts:kte ), intent(in):: qs
2608 real, dimension( kts:kte ), intent(in):: rho
2609 real, dimension( kts:kte ), intent(inout):: re_qc
2610 real, dimension( kts:kte ), intent(inout):: re_qi
2611 real, dimension( kts:kte ), intent(inout):: re_qs
2615 real, dimension( kts:kte ):: ni
2616 real, dimension( kts:kte ):: rqc
2617 real, dimension( kts:kte ):: rqi
2618 real, dimension( kts:kte ):: rni
2619 real, dimension( kts:kte ):: rqs
2622 real :: supcol, n0sfac, lamdas
2623 real :: diai ! diameter of ice in m
2624 logical :: has_qc, has_qi, has_qs
2625 !..Minimum microphys values
2626 real, parameter :: R1 = 1.E-12
2627 real, parameter :: R2 = 1.E-6
2628 !..Mass power law relations: mass = am*D**bm
2629 real, parameter :: bm_r = 3.0
2630 real, parameter :: obmr = 1.0/bm_r
2631 real, parameter :: nc0 = 3.E8
2632 !-----------------------------------------------------------------------
2639 rqc(k) = max(R1, qc(k)*rho(k))
2640 if (rqc(k).gt.R1) has_qc = .true.
2642 rqi(k) = max(R1, qi(k)*rho(k))
2643 temp = (rho(k)*max(qi(k),qmin))
2644 temp = sqrt(sqrt(temp*temp*temp))
2645 ni(k) = min(max(5.38e7*temp,1.e3),1.e6)
2646 rni(k)= max(R2, ni(k)*rho(k))
2647 if (rqi(k).gt.R1 .and. rni(k).gt.R2) has_qi = .true.
2649 rqs(k) = max(R1, qs(k)*rho(k))
2650 if (rqs(k).gt.R1) has_qs = .true.
2655 if (rqc(k).le.R1) CYCLE
2656 lamdac = (pidnc*nc0/rqc(k))**obmr
2657 re_qc(k) = max(2.51E-6,min(1.5*(1.0/lamdac),50.E-6))
2663 if (rqi(k).le.R1 .or. rni(k).le.R2) CYCLE
2664 diai = 11.9*sqrt(rqi(k)/ni(k))
2665 re_qi(k) = max(10.01E-6,min(0.75*0.163*diai,125.E-6))
2671 if (rqs(k).le.R1) CYCLE
2673 n0sfac = max(min(exp(alpha*supcol),n0smax/n0s),1.)
2674 lamdas = sqrt(sqrt(pidn0s*n0sfac/rqs(k)))
2675 re_qs(k) = max(25.E-6,min(0.5*(1./lamdas), 999.E-6))
2679 end subroutine effectRad_wsm6
2680 !-----------------------------------------------------------------------
2682 END MODULE module_mp_wsm6