1 !WRF:MODEL_LAYER:PHYSICS
4 MODULE module_mp_gsfcgce
11 REAL, PRIVATE :: rd1, rd2, al, cp
14 REAL, PRIVATE :: c38, c358, c610, c149, &
15 c879, c172, c409, c76, &
18 REAL, PRIVATE :: ag, bg, as, bs, &
23 REAL, PRIVATE :: tnw, tns, tng, &
27 REAL, PRIVATE :: zrc, zgc, zsc, &
31 REAL, PRIVATE :: alv, alf, als, t0, t00, &
32 avc, afc, asc, rn1, bnd1, &
33 rn2, bnd2, rn3, rn4, rn5, &
34 rn6, rn7, rn8, rn9, rn10, &
35 rn101,rn10a, rn11,rn11a, rn12
37 REAL, PRIVATE :: rn14, rn15,rn15a, rn16, rn17, &
38 rn17a,rn17b,rn17c, rn18, rn18a, &
39 rn19,rn19a,rn19b, rn20, rn20a, &
40 rn20b, bnd3, rn21, rn22, rn23, &
41 rn23a,rn23b, rn25,rn30a, rn30b, &
42 rn30c, rn31, beta, rn32
44 REAL, PRIVATE, DIMENSION( 31 ) :: rn12a, rn12b, rn13, rn25a
47 REAL, PRIVATE :: rn10b, rn10c, rnn191, rnn192, rn30, &
48 rnn30a, rn33, rn331, rn332
51 REAL, PRIVATE, DIMENSION( 31 ) :: aa1, aa2
52 DATA aa1/.7939e-7, .7841e-6, .3369e-5, .4336e-5, .5285e-5, &
53 .3728e-5, .1852e-5, .2991e-6, .4248e-6, .7434e-6, &
54 .1812e-5, .4394e-5, .9145e-5, .1725e-4, .3348e-4, &
55 .1725e-4, .9175e-5, .4412e-5, .2252e-5, .9115e-6, &
56 .4876e-6, .3473e-6, .4758e-6, .6306e-6, .8573e-6, &
57 .7868e-6, .7192e-6, .6513e-6, .5956e-6, .5333e-6, &
59 DATA aa2/.4006, .4831, .5320, .5307, .5319, &
60 .5249, .4888, .3894, .4047, .4318, &
61 .4771, .5183, .5463, .5651, .5813, &
62 .5655, .5478, .5203, .4906, .4447, &
63 .4126, .3960, .4149, .4320, .4506, &
64 .4483, .4460, .4433, .4413, .4382, &
71 !-------------------------------------------------------------------
73 ! Tao et al, 2001, Meteo. & Atmos. Phy., 97-137
74 !-------------------------------------------------------------------
75 ! SUBROUTINE gsfcgce( th, th_old, &
76 SUBROUTINE gsfcgce( th, &
83 rho, pii, p, dt_in, z, &
87 ids,ide, jds,jde, kds,kde, & ! domain dims
88 ims,ime, jms,jme, kms,kme, & ! memory dims
89 its,ite, jts,jte, kts,kte, & ! tile dims
91 snownc, snowncv, sr, &
92 graupelnc, graupelncv, &
98 !-------------------------------------------------------------------
100 !-------------------------------------------------------------------
104 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde , &
105 ims,ime, jms,jme, kms,kme , &
106 its,ite, jts,jte, kts,kte
107 INTEGER, INTENT(IN ) :: itimestep, ihail, ice2
109 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
119 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
134 REAL, DIMENSION( ims:ime , jms:jme ), &
135 INTENT(INOUT) :: rainnc, &
146 REAL , DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: ht
148 REAL, INTENT(IN ) :: dt_in, &
153 LOGICAL, INTENT(IN), OPTIONAL :: F_QG
158 !jjs INTEGER :: min_q, max_q
160 !jjs REAL, DIMENSION( its:ite , jts:jte ) &
161 !jjs :: rain, snow, graupel,ice
164 ! INTEGER :: IHAIL, itaobraun, ice2, istatmin, new_ice_sat, id
165 INTEGER :: itaobraun, istatmin, new_ice_sat, id
168 INTEGER :: iskip, ih, icount, ibud, i12h
170 REAL , PARAMETER :: cmin=1.e-20
171 REAL :: dth, dqv, dqrest, dqall, dqall1, rhotot, a1, a2
172 REAL, DIMENSION( its:ite , kts:kte , jts:jte ) :: &
173 th1, qv1, ql1, qr1, qi1, qs1, qg1
178 !c ihail = 0 for graupel, for tropical region
179 !c ihail = 1 for hail, for mid-lat region
181 ! itaobraun: 0 for Tao's constantis, 1 for Braun's constants
182 !c if ( itaobraun.eq.1 ) --> betah=0.5*beta=-.46*0.5=-0.23; cn0=1.e-6
183 !c if ( itaobraun.eq.0 ) --> betah=0.5*beta=-.6*0.5=-0.30; cn0=1.e-8
186 !c ice2 = 0 for 3 ice --- ice, snow and graupel/hail
187 !c ice2 = 1 for 2 ice --- ice and snow only
188 !c ice2 = 2 for 2 ice --- ice and graupel only, use ihail = 0 only
190 i12h=int(86400./dt_in)
191 ! if (itimestep.eq.1.or.itimestep.eq.1441) then
192 ! if (mod(itimestep,1440).eq.1) then
193 if (mod(itimestep,i12h).eq.1) then
194 write(6,*) 'ihail=',ihail,' ice2=',ice2
196 write(6,*) 'Running 3-ice scheme in GSFCGCE with'
198 write(6,*) ' ice, snow and graupel'
199 else if (ihail.eq.1) then
200 write(6,*) ' ice, snow and hail'
202 write(6,*) 'ihail has to be either 1 or 0'
205 else if (ice2.eq.1) then
206 write(6,*) 'Running 2-ice scheme in GSFCGCE with'
207 write(6,*) ' ice and snow'
208 else if (ice2.eq.2) then
209 write(6,*) 'Running 2-ice scheme in GSFCGCE with'
210 write(6,*) ' ice and graupel'
212 write(6,*) 'gsfcgce_2ice in namelist.input has to be 0, 1, or 2'
217 !c new_ice_sat = 0, 1 or 2
223 !c id = 0 without in-line staticstics
224 !c id = 1 with in-line staticstics
227 !c ibud = 0 no calculation of dth, dqv, dqrest and dqall
234 ! IF (P_QI .lt. P_FIRST_SCALAR .or. P_QS .lt. P_FIRST_SCALAR) THEN
235 ! CALL wrf_error_fatal3 ( "module_mp_lin.b" , 130 , 'module_mp_lin: Improper use of Lin et al scheme; no ice phase. Please chose another one.')
238 ! calculte fallflux and precipiation in MKS system
240 call fall_flux(dt_in, qr, qi, qs, qg, p, &
241 rho, z, dz8w, ht, rainnc, &
242 rainncv, grav,itimestep, &
244 snownc, snowncv, sr, &
245 graupelnc, graupelncv, &
247 ims,ime, jms,jme, kms,kme, & ! memory dims
248 its,ite, jts,jte, kts,kte ) ! tile dims
249 !-----------------------------------------------------------------------
251 !c set up constants used internally in GCE
253 call consat_s (ihail, itaobraun)
256 !c Negative values correction
259 ! i12h=int(86400./dt_in)
262 call negcor(qv,rho,dz8w,ims,ime,jms,jme,kms,kme, &
264 its,ite,jts,jte,kts,kte)
265 call negcor(ql,rho,dz8w,ims,ime,jms,jme,kms,kme, &
267 its,ite,jts,jte,kts,kte)
268 call negcor(qr,rho,dz8w,ims,ime,jms,jme,kms,kme, &
270 its,ite,jts,jte,kts,kte)
271 call negcor(qi,rho,dz8w,ims,ime,jms,jme,kms,kme, &
273 its,ite,jts,jte,kts,kte)
274 call negcor(qs,rho,dz8w,ims,ime,jms,jme,kms,kme, &
276 its,ite,jts,jte,kts,kte)
277 call negcor(qg,rho,dz8w,ims,ime,jms,jme,kms,kme, &
279 its,ite,jts,jte,kts,kte)
280 if (mod(itimestep,i12h).eq.1) then
281 print *,'negative correction used in gsfcgce mp '
285 !c microphysics in GCE
287 call SATICEL_S( dt_in, IHAIL, itaobraun, ICE2, istatmin, &
289 ! th, th_old, qv, ql, qr, &
292 ! qvold, qlold, qrold, &
293 ! qiold, qsold, qgold, &
294 rho, pii, p, itimestep, &
295 ids,ide, jds,jde, kds,kde, & ! domain dims
296 ims,ime, jms,jme, kms,kme, & ! memory dims
297 its,ite, jts,jte, kts,kte & ! tile dims
300 END SUBROUTINE gsfcgce
302 !-----------------------------------------------------------------------
303 SUBROUTINE fall_flux ( dt, qr, qi, qs, qg, p, &
304 rho, z, dz8w, topo, rainnc, &
305 rainncv, grav, itimestep, &
307 snownc, snowncv, sr, &
308 graupelnc, graupelncv, &
310 ims,ime, jms,jme, kms,kme, & ! memory dims
311 its,ite, jts,jte, kts,kte ) ! tile dims
312 !-----------------------------------------------------------------------
313 ! adopted from Jiun-Dar Chern's codes for Purdue Regional Model
314 ! adopted by Jainn J. Shi, 6/10/2005
315 !-----------------------------------------------------------------------
318 INTEGER, INTENT(IN ) :: ihail, ice2, &
319 ims,ime, jms,jme, kms,kme, &
320 its,ite, jts,jte, kts,kte
321 INTEGER, INTENT(IN ) :: itimestep
322 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
323 INTENT(INOUT) :: qr, qi, qs, qg
324 REAL, DIMENSION( ims:ime , jms:jme ), &
325 INTENT(INOUT) :: rainnc, rainncv, &
326 snownc, snowncv, sr, &
327 graupelnc, graupelncv
328 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
329 INTENT(IN ) :: rho, z, dz8w, p
331 REAL, INTENT(IN ) :: dt, grav, rhowater, rhosnow
334 REAL, DIMENSION( ims:ime , jms:jme ), &
339 REAL, DIMENSION( kts:kte ) :: sqrhoz
341 REAL :: pptrain, pptsnow, &
343 REAL, DIMENSION( kts:kte ) :: qrz, qiz, qsz, qgz, &
344 zz, dzw, prez, rhoz, &
351 REAL, DIMENSION( kts:kte ) :: vtr, vts, vtg, vti
353 REAL :: dtb, pi, consta, constc, gambp4, &
354 gamdp4, gam4pt5, gam4bbar
357 REAL , PARAMETER :: xnor = 8.0e6
358 ! REAL , PARAMETER :: xnos = 3.0e6
359 REAL , PARAMETER :: xnos = 1.6e7 ! Tao's value
360 REAL , PARAMETER :: &
361 constb = 0.8, constd = 0.25, o6 = 1./6., &
364 ! REAL , PARAMETER :: xnoh = 4.0e4
365 REAL , PARAMETER :: xnoh = 2.0e5 ! Tao's value
366 REAL , PARAMETER :: rhohail = 917.
369 REAL , PARAMETER :: xnog = 4.0e6
370 REAL , PARAMETER :: rhograul = 400.
371 REAL , PARAMETER :: abar = 19.3, bbar = 0.37, &
374 REAL , PARAMETER :: rhoe_s = 1.29
376 ! for terminal velocity flux
377 INTEGER :: min_q, max_q
378 REAL :: t_del_tv, del_tv, flux, fluxin, fluxout ,tmpqrz
381 ! if (itimestep.eq.1) then
382 ! write(6, *) 'in fall_flux'
383 ! write(6, *) 'ims=', ims, ' ime=', ime
384 ! write(6, *) 'jms=', jms, ' jme=', jme
385 ! write(6, *) 'kms=', kms, ' kme=', kme
386 ! write(6, *) 'its=', its, ' ite=', ite
387 ! write(6, *) 'jts=', jts, ' jte=', jte
388 ! write(6, *) 'kts=', kts, ' kte=', kte
389 ! write(6, *) 'dt=', dt
390 ! write(6, *) 'ihail=', ihail
391 ! write(6, *) 'ICE2=', ICE2
392 ! write(6, *) 'dt=', dt
395 !-----------------------------------------------------------------------
396 ! This program calculates precipitation fluxes due to terminal velocities.
397 !-----------------------------------------------------------------------
401 consta=2115.0*0.01**(1-constb)
402 ! constc=152.93*0.01**(1-constd)
403 constc=78.63*0.01**(1-constd)
406 gambp4=ggamma(constb+4.)
407 gamdp4=ggamma(constd+4.)
409 gam4bbar=ggamma(4.+bbar)
411 !***********************************************************************
412 ! Calculate precipitation fluxes due to terminal velocities.
413 !***********************************************************************
415 !- Calculate termianl velocity (vt?) of precipitation q?z
416 !- Find maximum vt? to determine the small delta t
418 j_loop: do j = jts, jte
419 i_loop: do i = its, ite
431 sqrhoz(k)=sqrt(rhoe_s/rhoz(k))
444 IF (ice2 .eq. 0) THEN
467 if (qrz(k) .gt. 1.0e-8) then
470 tmp1=sqrt(pi*rhowater*xnor/rhoz(k)/qrz(k))
472 vtr(k)=consta*gambp4*sqrhoz(k)/tmp1**constb
475 del_tv=amin1(del_tv,0.9*(zz(k)-topo(i,j))/vtr(k))
477 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vtr(k))
484 if (max_q .ge. min_q) then
486 !- Check if the summation of the small delta t >= big delta t
487 ! (t_del_tv) (del_tv) (dtb)
489 t_del_tv=t_del_tv+del_tv
491 if ( t_del_tv .ge. dtb ) then
493 del_tv=dtb+del_tv-t_del_tv
496 ! use small delta t to calculate the qrz flux
497 ! termi is the qrz flux pass in the grid box through the upper boundary
498 ! termo is the qrz flux pass out the grid box through the lower boundary
502 fluxout=rhoz(k)*vtr(k)*qrz(k)
503 flux=(fluxin-fluxout)/rhoz(k)/dzw(k)
505 qrz(k)=qrz(k)+del_tv*flux
506 qrz(k)=amax1(0.,qrz(k))
510 if (min_q .eq. 1) then
511 pptrain=pptrain+fluxin*del_tv
513 qrz(min_q-1)=qrz(min_q-1)+del_tv* &
514 fluxin/rhoz(min_q-1)/dzw(min_q-1)
515 qr(i,min_q-1,j)=qrz(min_q-1)
536 if (qsz(k) .gt. 1.0e-8) then
539 tmp1=sqrt(pi*rhosnow*xnos/rhoz(k)/qsz(k))
541 vts(k)=constc*gamdp4*sqrhoz(k)/tmp1**constd
544 del_tv=amin1(del_tv,0.9*(zz(k)-topo(i,j))/vts(k))
546 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vts(k))
553 if (max_q .ge. min_q) then
556 !- Check if the summation of the small delta t >= big delta t
557 ! (t_del_tv) (del_tv) (dtb)
559 t_del_tv=t_del_tv+del_tv
561 if ( t_del_tv .ge. dtb ) then
563 del_tv=dtb+del_tv-t_del_tv
566 ! use small delta t to calculate the qsz flux
567 ! termi is the qsz flux pass in the grid box through the upper boundary
568 ! termo is the qsz flux pass out the grid box through the lower boundary
572 fluxout=rhoz(k)*vts(k)*qsz(k)
573 flux=(fluxin-fluxout)/rhoz(k)/dzw(k)
574 qsz(k)=qsz(k)+del_tv*flux
575 qsz(k)=amax1(0.,qsz(k))
579 if (min_q .eq. 1) then
580 pptsnow=pptsnow+fluxin*del_tv
582 qsz(min_q-1)=qsz(min_q-1)+del_tv* &
583 fluxin/rhoz(min_q-1)/dzw(min_q-1)
584 qs(i,min_q-1,j)=qsz(min_q-1)
594 ! ice2=0 --- with hail/graupel
595 ! ice2=1 --- without hail/graupel
599 !-- If IHAIL=1, use hail.
600 !-- If IHAIL=0, use graupel.
602 ! if (ihail .eq. 1) then
617 if (qgz(k) .gt. 1.0e-8) then
618 if (ihail .eq. 1) then
619 ! for hail, based on Lin et al (1983)
622 tmp1=sqrt(pi*rhohail*xnoh/rhoz(k)/qgz(k))
624 term0=sqrt(4.*grav*rhohail/3./rhoz(k)/cdrag)
625 vtg(k)=gam4pt5*term0*sqrt(1./tmp1)
628 del_tv=amin1(del_tv,0.9*(zz(k)-topo(i,j))/vtg(k))
630 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vtg(k))
634 ! for graupel, based on RH (1984)
637 tmp1=sqrt(pi*rhograul*xnog/rhoz(k)/qgz(k))
641 term0=abar*gam4bbar/6.
642 vtg(k)=term0*tmp1*(p0/prez(k))**0.4
644 del_tv=amin1(del_tv,0.9*(zz(k)-topo(i,j))/vtg(k))
646 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vtg(k))
654 if (max_q .ge. min_q) then
657 !- Check if the summation of the small delta t >= big delta t
658 ! (t_del_tv) (del_tv) (dtb)
660 t_del_tv=t_del_tv+del_tv
662 if ( t_del_tv .ge. dtb ) then
664 del_tv=dtb+del_tv-t_del_tv
667 ! use small delta t to calculate the qgz flux
668 ! termi is the qgz flux pass in the grid box through the upper boundary
669 ! termo is the qgz flux pass out the grid box through the lower boundary
673 fluxout=rhoz(k)*vtg(k)*qgz(k)
674 flux=(fluxin-fluxout)/rhoz(k)/dzw(k)
675 qgz(k)=qgz(k)+del_tv*flux
676 qgz(k)=amax1(0.,qgz(k))
680 if (min_q .eq. 1) then
681 pptgraul=pptgraul+fluxin*del_tv
683 qgz(min_q-1)=qgz(min_q-1)+del_tv* &
684 fluxin/rhoz(min_q-1)/dzw(min_q-1)
685 qg(i,min_q-1,j)=qgz(min_q-1)
695 !-- cloud ice (03/21/02) follow Vaughan T.J. Phillips at GFDL
708 if (qiz(k) .gt. 1.0e-8) then
711 vti(k)= 3.29 * (rhoz(k)* qiz(k))** 0.16 ! Heymsfield and Donner
713 del_tv=amin1(del_tv,0.9*(zz(k)-topo(i,j))/vti(k))
715 del_tv=amin1(del_tv,0.9*(zz(k)-zz(k-1))/vti(k))
722 if (max_q .ge. min_q) then
725 !- Check if the summation of the small delta t >= big delta t
726 ! (t_del_tv) (del_tv) (dtb)
728 t_del_tv=t_del_tv+del_tv
730 if ( t_del_tv .ge. dtb ) then
732 del_tv=dtb+del_tv-t_del_tv
735 ! use small delta t to calculate the qiz flux
736 ! termi is the qiz flux pass in the grid box through the upper boundary
737 ! termo is the qiz flux pass out the grid box through the lower boundary
742 fluxout=rhoz(k)*vti(k)*qiz(k)
743 flux=(fluxin-fluxout)/rhoz(k)/dzw(k)
744 qiz(k)=qiz(k)+del_tv*flux
745 qiz(k)=amax1(0.,qiz(k))
749 if (min_q .eq. 1) then
750 pptice=pptice+fluxin*del_tv
752 qiz(min_q-1)=qiz(min_q-1)+del_tv* &
753 fluxin/rhoz(min_q-1)/dzw(min_q-1)
754 qi(i,min_q-1,j)=qiz(min_q-1)
763 ! prnc(i,j)=prnc(i,j)+pptrain
764 ! psnowc(i,j)=psnowc(i,j)+pptsnow
765 ! pgrauc(i,j)=pgrauc(i,j)+pptgraul
766 ! picec(i,j)=picec(i,j)+pptice
769 ! write(6,*) 'i=',i,' j=',j,' ', pptrain, pptsnow, pptgraul, pptice
772 snowncv(i,j) = pptsnow
773 snownc(i,j) = snownc(i,j) + pptsnow
774 graupelncv(i,j) = pptgraul
775 graupelnc(i,j) = graupelnc(i,j) + pptgraul
776 RAINNCV(i,j) = pptrain + pptsnow + pptgraul + pptice
777 RAINNC(i,j) = RAINNC(i,j) + pptrain + pptsnow + pptgraul + pptice
779 if (RAINNCV(i,j) .gt. 0.) sr(i,j) = (pptsnow + pptgraul + pptice) / RAINNCV(i,j)
784 ! if (itimestep.eq.6480) then
785 ! write(51,*) 'in the end of fallflux, itimestep=',itimestep
788 ! if (rainnc(i,j).gt.400.) then
789 ! write(50,*) 'i=',i,' j=',j,' rainnc=',rainnc
795 END SUBROUTINE fall_flux
797 !----------------------------------------------------------------
798 REAL FUNCTION ggamma(X)
799 !----------------------------------------------------------------
801 !----------------------------------------------------------------
802 REAL, INTENT(IN ) :: x
803 REAL, DIMENSION(8) :: B
805 REAL ::PF, G1TO2 ,TEMP
807 DATA B/-.577191652,.988205891,-.897056937,.918206857, &
808 -.756704078,.482199394,-.193527818,.035868343/
813 IF (TEMP .LE. 2) GO TO 20
816 100 FORMAT(//,5X,'module_gsfcgce: INPUT TO GAMMA FUNCTION TOO LARGE, X=',E12.5)
817 WRITE(wrf_err_message,100)X
818 CALL wrf_error_fatal(wrf_err_message)
822 30 G1TO2=G1TO2 + B(K1)*TEMP**K1
827 !-----------------------------------------------------------------------
828 !c Correction of negative values
829 SUBROUTINE negcor ( X, rho, dz8w, &
830 ims,ime, jms,jme, kms,kme, & ! memory dims
832 its,ite, jts,jte, kts,kte ) ! tile dims
833 !-----------------------------------------------------------------------
834 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
836 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
837 INTENT(IN ) :: rho, dz8w
838 integer, INTENT(IN ) :: itimestep, ics
841 ! REAL, DIMENSION( kts:kte ) :: Y1, Y2
849 A1=A1+max(X(i,k,j), 0.)*rho(i,k,j)*dz8w(i,k,j)
850 A2=A2+max(-X(i,k,j), 0.)*rho(i,k,j)*dz8w(i,k,j)
864 if (A1.NE.0.0.and.A1.GT.A2) then
867 if (mod(itimestep,540).eq.0) then
869 write(61,*) 'kms=',kms,' kme=',kme,' kts=',kts,' kte=',kte
870 write(61,*) 'jms=',jms,' jme=',jme,' jts=',jts,' jte=',jte
871 write(61,*) 'ims=',ims,' ime=',ime,' its=',its,' ite=',ite
874 write(61,*) 'qv timestep=',itimestep
875 write(61,*) ' A1=',A1,' A2=',A2,' A0=',A0
876 else if (ics.eq.2) then
877 write(61,*) 'ql timestep=',itimestep
878 write(61,*) ' A1=',A1,' A2=',A2,' A0=',A0
879 else if (ics.eq.3) then
880 write(61,*) 'qr timestep=',itimestep
881 write(61,*) ' A1=',A1,' A2=',A2,' A0=',A0
882 else if (ics.eq.4) then
883 write(61,*) 'qi timestep=',itimestep
884 write(61,*) ' A1=',A1,' A2=',A2,' A0=',A0
885 else if (ics.eq.5) then
886 write(61,*) 'qs timestep=',itimestep
887 write(61,*) ' A1=',A1,' A2=',A2,' A0=',A0
888 else if (ics.eq.6) then
889 write(61,*) 'qg timestep=',itimestep
890 write(61,*) ' A1=',A1,' A2=',A2,' A0=',A0
892 write(61,*) 'wrong cloud specieis number'
899 X(i,k,j)=A0*AMAX1(X(i,k,j), 0.0)
905 END SUBROUTINE negcor
907 SUBROUTINE consat_s (ihail,itaobraun)
909 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
911 ! Tao, W.-K., and J. Simpson, 1989: Modeling study of a tropical c
912 ! squall-type convective line. J. Atmos. Sci., 46, 177-202. c
914 ! Tao, W.-K., J. Simpson and M. McCumber, 1989: An ice-water c
915 ! saturation adjustment. Mon. Wea. Rev., 117, 231-235. c
917 ! Tao, W.-K., and J. Simpson, 1993: The Goddard Cumulus Ensemble c
918 ! Model. Part I: Model description. Terrestrial, Atmospheric and c
919 ! Oceanic Sciences, 4, 35-72. c
921 ! Tao, W.-K., J. Simpson, D. Baker, S. Braun, M.-D. Chou, B. c
922 ! Ferrier,D. Johnson, A. Khain, S. Lang, B. Lynn, C.-L. Shie, c
923 ! D. Starr, C.-H. Sui, Y. Wang and P. Wetzel, 2003: Microphysics, c
924 ! radiation and surface processes in the Goddard Cumulus Ensemble c
925 ! (GCE) model, A Special Issue on Non-hydrostatic Mesoscale c
926 ! Modeling, Meteorology and Atmospheric Physics, 82, 97-137. c
928 ! Lang, S., W.-K. Tao, R. Cifelli, W. Olson, J. Halverson, S. c
929 ! Rutledge, and J. Simpson, 2007: Improving simulations of c
930 ! convective system from TRMM LBA: Easterly and Westerly regimes. c
931 ! J. Atmos. Sci., 64, 1141-1164. c
933 ! Coded by Tao (1989-2003), modified by S. Lang (2006/07) c
935 ! Implemented into WRF by Roger Shi 2006/2007 c
936 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
938 ! itaobraun=0 ! see Tao and Simpson (1993)
939 ! itaobraun=1 ! see Tao et al. (2003)
945 !JJS the following common blocks have been moved to the top of
946 !JJS module_mp_gsfcgce_driver_instat.F
948 ! real, dimension (1:31) :: a1, a2
949 ! data a1/.7939e-7,.7841e-6,.3369e-5,.4336e-5,.5285e-5,.3728e-5, &
950 ! .1852e-5,.2991e-6,.4248e-6,.7434e-6,.1812e-5,.4394e-5,.9145e-5, &
951 ! .1725e-4,.3348e-4,.1725e-4,.9175e-5,.4412e-5,.2252e-5,.9115e-6, &
952 ! .4876e-6,.3473e-6,.4758e-6,.6306e-6,.8573e-6,.7868e-6,.7192e-6, &
953 ! .6513e-6,.5956e-6,.5333e-6,.4834e-6/
954 ! data a2/.4006,.4831,.5320,.5307,.5319,.5249,.4888,.3894,.4047, &
955 ! .4318,.4771,.5183,.5463,.5651,.5813,.5655,.5478,.5203,.4906, &
956 ! .4447,.4126,.3960,.4149,.4320,.4506,.4483,.4460,.4433,.4413, &
961 ! ******************************************************************
1000 !*** DEFINE THE COEFFICIENTS USED IN TERMINAL VELOCITY
1001 !*** DEFINE THE DENSITY AND SIZE DISTRIBUTION OF PRECIPITATION
1002 !********** HAIL OR GRAUPEL PARAMETERS **********
1003 if(ihail .eq. 1) then
1011 ! AG=372.3 ! if ice913=1 6/15/02 tao's
1015 !********** SNOW PARAMETERS **********
1016 !ccshie 6/15/02 tao's
1018 ! TNS=.08 ! if ice913=1, tao's
1019 tns=.16 ! if ice913=0, tao's
1025 !********** RAIN PARAMETERS **********
1030 !*****************************************************************
1037 !**********GAMMA FUNCTION CALCULATIONS*************
1038 ga3b = gammagce(3.+bw)
1039 ga4b = gammagce(4.+bw)
1040 ga6b = gammagce(6.+bw)
1041 ga5bh = gammagce((5.+bw)/2.)
1042 ga3g = gammagce(3.+bg)
1043 ga4g = gammagce(4.+bg)
1044 ga5gh = gammagce((5.+bg)/2.)
1045 ga3d = gammagce(3.+bs)
1046 ga4d = gammagce(4.+bs)
1047 ga5dh = gammagce((5.+bs)/2.)
1048 !CCCCC LIN ET AL., 1983 OR LORD ET AL., 1984 CCCCCCCCCCCCCCCCC
1057 zrc=(cpi*roqr*tnw)**0.25
1058 zsc=(cpi*roqs*tns)**0.25
1059 zgc=(cpi*roqg*tng)**0.25
1060 vrc=aw*ga4b/(6.*zrc**bw)
1061 vsc=as*ga4d/(6.*zsc**bs)
1062 vgc=ag*ga4g/(6.*zgc**bg)
1063 ! ****************************
1065 rn1=9.4e-15 ! 6/15/02 tao's
1069 ! BND2=1.5E-3 ! if ice913=1 6/15/02 tao's
1070 bnd2=2.0e-3 ! if ice913=0 6/15/02 tao's
1071 rn3=.25*cpi*tns*cc1*ga3d
1073 rn4=.25*cpi*esw*tns*cc1*ga3d
1075 eri=.1 ! 6/17/02 tao's ice913=0 (not 1)
1076 rn5=.25*cpi*eri*tnw*ac1*ga3b
1077 ! AMI=1./(24.*4.19E-10)
1078 ami=1./(24.*6.e-9) ! 6/15/02 tao's
1079 rn6=cpi2*eri*tnw*ac1*roqr*ga6b*ami
1080 ! ESR=1. ! also if ice913=1 for tao's
1081 esr=.5 ! 6/15/02 for ice913=0 tao's
1082 rn7=cpi2*esr*tnw*tns*roqs
1084 rn8=cpi2*esr*tnw*tns*roqr
1085 rn9=cpi2*tns*tng*roqs
1087 rn101=.31*ga5dh*sqrt(cc1)
1096 ami50=3.84e-6 ! 6/15/02 tao's
1098 ami40=3.08e-8 ! 6/15/02 tao's
1101 ui50=100. ! 6/15/02 tao's
1104 rn12=cpi*eiw*ui50*ri50**2
1108 rn13(k)=aa1(k)*y1/(ami50**y1-ami40**y1)
1109 rn12a(k)=rn13(k)/ami50
1110 rn12b(k)=aa1(k)*ami50**aa2(k)
1111 rn25a(k)=aa1(k)*cmn**aa2(k)
1115 rn14=.25*cpi*egw*tng*ga3g*ag
1117 rn15=.25*cpi*egi*tng*ga3g*ag
1119 rn15a=.25*cpi*egi*tng*ga3g*ag
1121 rn16=cpi2*egr*tng*tnw*roqr
1123 rn17a=.31*ga5gh*sqrt(ag)
1128 bpri=0.5*bpri ! 6/17/02 tao's
1129 rn18=20.*cpi2*bpri*tnw*roqr
1132 rn19a=.31*ga5gh*sqrt(ag)
1136 rnn192=.31*ga5gh*sqrt(ac2/dva)
1140 rn20b=.31*ga5gh*sqrt(ag)
1142 rn21=1.e3*1.569e-12/0.15
1144 rn22=.25*cpi*erw*ac1*tnw*ga3b
1146 rn23a=.31*ga5bh*sqrt(ac1)
1150 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1152 !cc "c0" in routine "consat" (2d), "consatrh" (3d)
1153 !cc if ( itaobraun.eq.1 ) --> betah=0.5*beta=-.46*0.5=-0.23; cn0=1.e-6
1154 !cc if ( itaobraun.eq.0 ) --> betah=0.5*beta=-.6*0.5=-0.30; cn0=1.e-8
1156 if (itaobraun .eq. 0) then
1159 elseif (itaobraun .eq. 1) then
1163 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1165 ! CN0=1.E-8 ! 6/15/02 tao's
1167 ! BETA=-.6 ! 6/15/02 tao's
1170 rn30a=alv*als*amw/(tca*ars)
1178 rnn30a=alv*alv*amw/(tca*ars)
1182 rn332=.44*sqrt(ac3/dva)*ga5dh
1186 END SUBROUTINE consat_s
1188 SUBROUTINE saticel_s (dt, ihail, itaobraun, ice2, istatmin, &
1190 ptwrf, qvwrf, qlwrf, qrwrf, &
1191 qiwrf, qswrf, qgwrf, &
1192 rho_mks, pi_mks, p0_mks,itimestep, &
1193 ids,ide, jds,jde, kds,kde, &
1194 ims,ime, jms,jme, kms,kme, &
1195 its,ite, jts,jte, kts,kte &
1197 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1199 ! Tao, W.-K., and J. Simpson, 1989: Modeling study of a tropical c
1200 ! squall-type convective line. J. Atmos. Sci., 46, 177-202. c
1202 ! Tao, W.-K., J. Simpson and M. McCumber, 1989: An ice-water c
1203 ! saturation adjustment. Mon. Wea. Rev., 117, 231-235. c
1205 ! Tao, W.-K., and J. Simpson, 1993: The Goddard Cumulus Ensemble c
1206 ! Model. Part I: Model description. Terrestrial, Atmospheric and c
1207 ! Oceanic Sciences, 4, 35-72. c
1209 ! Tao, W.-K., J. Simpson, D. Baker, S. Braun, M.-D. Chou, B. c
1210 ! Ferrier,D. Johnson, A. Khain, S. Lang, B. Lynn, C.-L. Shie, c
1211 ! D. Starr, C.-H. Sui, Y. Wang and P. Wetzel, 2003: Microphysics, c
1212 ! radiation and surface processes in the Goddard Cumulus Ensemble c
1213 ! (GCE) model, A Special Issue on Non-hydrostatic Mesoscale c
1214 ! Modeling, Meteorology and Atmospheric Physics, 82, 97-137. c
1216 ! Lang, S., W.-K. Tao, R. Cifelli, W. Olson, J. Halverson, S. c
1217 ! Rutledge, and J. Simpson, 2007: Improving simulations of c
1218 ! convective system from TRMM LBA: Easterly and Westerly regimes. c
1219 ! J. Atmos. Sci., 64, 1141-1164. c
1221 ! Tao, W.-K., J. J. Shi, S. Lang, C. Peters-Lidard, A. Hou, S. c
1222 ! Braun, and J. Simpson, 2007: New, improved bulk-microphysical c
1223 ! schemes for studying precipitation processes in WRF. Part I: c
1224 ! Comparisons with other schemes. to appear on Mon. Wea. Rev. C
1226 ! Coded by Tao (1989-2003), modified by S. Lang (2006/07) c
1228 ! Implemented into WRF by Roger Shi 2006/2007 c
1229 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1231 ! COMPUTE ICE PHASE MICROPHYSICS AND SATURATION PROCESSES
1233 integer, parameter :: nt=2880, nt2=2*nt
1235 !cc using scott braun's way for pint, pidep computations
1236 integer :: itaobraun,ice2,ihail,new_ice_sat,id,istatmin
1237 integer :: itimestep
1238 real :: tairccri, cn0, dt
1241 !JJS common/bxyz/ n,isec,nran,kt1,kt2
1242 !JJS common/option/ lipps,ijkadv,istatmin,iwater,itoga,imlifting,lin,
1243 !JJS 1 irf,iadvh,irfg,ismg,id
1245 !JJS common/timestat/ ndt_stat,idq
1246 !JJS common/iice/ new_ice_sat
1247 !JJS common/bt/ dt,d2t,rijl2,dts,f5,rd1,rd2,bound,al,cp,ra,ck,ce,eps,
1248 !JJS 1 psfc,fcor,sec,aminut,rdt
1250 !JJS the following common blocks have been moved to the top of
1251 !JJS module_mp_gsfcgce_driver_instat.F
1253 ! common/bt/ rd1,rd2,al,cp
1256 ! common/bterv/ zrc,zgc,zsc,vrc,vgc,vsc
1257 ! common/size/ tnw,tns,tng,roqs,roqg,roqr
1258 ! common/cont/ c38,c358,c610,c149,c879,c172,c409,c76,c218,c580,c141
1259 ! common/b3cs/ ag,bg,as,bs,aw,bw,bgh,bgq,bsh,bsq,bwh,bwq
1260 ! common/bsnw/ alv,alf,als,t0,t00,avc,afc,asc,rn1,bnd1,rn2,bnd2, &
1261 ! rn3,rn4,rn5,rn6,rn7,rn8,rn9,rn10,rn101,rn10a,rn11,rn11a, &
1262 ! rn12,rn12a(31),rn12b(31),rn13(31),rn14,rn15,rn15a,rn16,rn17, &
1263 ! rn17a,rn17b,rn17c,rn18,rn18a,rn19,rn19a,rn19b,rn20,rn20a,rn20b, &
1264 ! bnd3,rn21,rn22,rn23,rn23a,rn23b,rn25,rn25a(31),rn30a,rn30b, &
1265 ! rn30c,rn31,beta,rn32
1266 ! common/rsnw1/ rn10b,rn10c,rnn191,rnn192,rn30,rnn30a,rn33,rn331, &
1270 real, dimension (its:ite,jts:jte,kts:kte) :: fv
1271 real, dimension (its:ite,jts:jte,kts:kte) :: dpt, dqv
1272 real, dimension (its:ite,jts:jte,kts:kte) :: qcl, qrn, &
1275 ! real dpt1(ims:ime,jms:jme,kms:kme)
1276 ! real dqv1(ims:ime,jms:jme,kms:kme),
1277 ! 1 qcl1(ims:ime,jms:jme,kms:kme)
1278 ! real qrn1(ims:ime,jms:jme,kms:kme),
1279 ! 1 qci1(ims:ime,jms:jme,kms:kme)
1280 ! real qcs1(ims:ime,jms:jme,kms:kme),
1281 ! 1 qcg1(ims:ime,jms:jme,kms:kme)
1286 real, dimension (ims:ime, kms:kme, jms:jme) :: ptwrf, qvwrf
1287 real, dimension (ims:ime, kms:kme, jms:jme) :: qlwrf, qrwrf, &
1290 ! real ptwrfold(ims:ime, kms:kme, jms:jme)
1291 ! real qvwrfold(ims:ime, kms:kme, jms:jme),
1292 ! 1 qlwrfold(ims:ime, kms:kme, jms:jme)
1293 ! real qrwrfold(ims:ime, kms:kme, jms:jme),
1294 ! 1 qiwrfold(ims:ime, kms:kme, jms:jme)
1295 ! real qswrfold(ims:ime, kms:kme, jms:jme),
1296 ! 1 qgwrfold(ims:ime, kms:kme, jms:jme)
1300 real, dimension (ims:ime, kms:kme, jms:jme) :: rho_mks
1301 real, dimension (ims:ime, kms:kme, jms:jme) :: pi_mks
1302 real, dimension (ims:ime, kms:kme, jms:jme) :: p0_mks
1304 ! real, dimension (its:ite,jts:jte,kts:kte) :: ww1
1305 ! real, dimension (its:ite,jts:jte,kts:kte) :: rsw
1306 ! real, dimension (its:ite,jts:jte,kts:kte) :: rlw
1309 real, dimension (its:ite,jts:jte) :: &
1325 !JJS Y2(its:ite,jts:jte), DDE(NB)
1328 real, dimension (its:ite,jts:jte) :: &
1347 real, dimension (its:ite,jts:jte) :: &
1366 real, dimension (its:ite,jts:jte,kts:kte) :: rho
1367 real, dimension (kts:kte) :: &
1372 wb, ub1, vb1, rrho, &
1376 real, dimension (its:ite,jts:jte,kts:kte) :: p0, pi, f0
1377 real, dimension (kts:kte) :: &
1384 real, dimension (kts:kte) :: &
1385 srro, qrro, sqc, sqr, &
1386 sqi, sqs, sqg, stqc, &
1387 stqr, stqi, stqs, stqg
1388 real, dimension (nt) :: &
1389 tqc, tqr, tqi, tqs, tqg
1391 !JJS common/bls/ y0(nx,ny),ts0new(nx,ny),qss0new(nx,ny)
1394 real, dimension (its:ite,jts:jte) :: &
1397 !JJS COMMON/BI/ IT(its:ite,jts:jte), ICS(its:ite,jts:jte,4)
1398 integer, dimension (its:ite,jts:jte) :: it
1399 integer, dimension (its:ite,jts:jte, 4) :: ics
1402 real, dimension (its:ite,kts:kte,jts:jte) :: &
1403 physc, physe, physd, &
1406 !23456789012345678901234567890123456789012345678901234567890123456789012
1410 !JJS the following common blocks have been moved to the top of
1411 !JJS module_mp_gsfcgce_driver.F
1413 ! real, dimension (31) :: aa1, aa2
1414 ! data aa1/.7939e-7, .7841e-6, .3369e-5, .4336e-5, .5285e-5, &
1415 ! .3728e-5, .1852e-5, .2991e-6, .4248e-6, .7434e-6, &
1416 ! .1812e-5, .4394e-5, .9145e-5, .1725e-4, .3348e-4, &
1417 ! .1725e-4, .9175e-5, .4412e-5, .2252e-5, .9115e-6, &
1418 ! .4876e-6, .3473e-6, .4758e-6, .6306e-6, .8573e-6, &
1419 ! .7868e-6, .7192e-6, .6513e-6, .5956e-6, .5333e-6, &
1421 ! data aa2/.4006, .4831, .5320, .5307, .5319, &
1422 ! .5249, .4888, .3894, .4047, .4318, &
1423 ! .4771, .5183, .5463, .5651, .5813, &
1424 ! .5655, .5478, .5203, .4906, .4447, &
1425 ! .4126, .3960, .4149, .4320, .4506, &
1426 ! .4483, .4460, .4433, .4413, .4382, &
1434 ! write(6, *) 'in gsfcgce_open_ice2 at itimestep=',itimestep
1435 ! write(6, *) 'ims=', ims, ' ime=', ime
1436 ! write(6, *) 'jms=', jms, ' jme=', jme
1437 ! write(6, *) 'kms=', kms, ' kme=', kme
1438 ! write(6, *) 'its=', its, ' ite=', ite
1439 ! write(6, *) 'jts=', jts, ' jte=', jte
1440 ! write(6, *) 'kts=', kts, ' kte=', kte
1441 ! write(6, *) 'ihail=', ihail
1442 ! write(6, *) 'itaobraun=',itaobraun
1443 ! write(6, *) 'ICE2=', ICE2
1444 ! write(6, *) 'istatmin=',istatmin
1445 ! write(6, *) 'new_ice_sat=', new_ice_sat
1446 ! write(6, *) 'id=', id
1447 ! write(6, *) 'dt=', dt
1450 !JJS convert from mks to cgs, and move from WRF grid to GCE grid
1454 rho(i,j,k)=rho_mks(i,k,j)*0.001
1455 p0(i,j,k)=p0_mks(i,k,j)*10.0
1456 pi(i,j,k)=pi_mks(i,k,j)
1457 dpt(i,j,k)=ptwrf(i,k,j)
1458 dqv(i,j,k)=qvwrf(i,k,j)
1459 qcl(i,j,k)=qlwrf(i,k,j)
1460 qrn(i,j,k)=qrwrf(i,k,j)
1461 qci(i,j,k)=qiwrf(i,k,j)
1462 qcs(i,j,k)=qswrf(i,k,j)
1463 qcg(i,j,k)=qgwrf(i,k,j)
1465 ! dpt1(i,j,k)=ptwrfold(i,k,j)
1466 ! dqv1(i,j,k)=qvwrfold(i,k,j)
1467 ! qcl1(i,j,k)=qlwrfold(i,k,j)
1468 ! qrn1(i,j,k)=qrwrfold(i,k,j)
1469 ! qci1(i,j,k)=qiwrfold(i,k,j)
1470 ! qcs1(i,j,k)=qswrfold(i,k,j)
1471 ! qcg1(i,j,k)=qgwrfold(i,k,j)
1477 if (ice2 .eq. 2) ihail = 0
1482 fv(i,j,k)=sqrt(rho(i,j,2)/rho(i,j,k))
1489 ! ****** THREE CLASSES OF ICE-PHASE (LIN ET AL, 1983) *********
1492 !JJS IF(IJKADV .EQ. 0) THEN
1498 ! itaobraun=0 ! original pint and pidep & see Tao and Simpson 1993
1499 itaobraun=1 ! see Tao et al. (2003)
1501 if ( itaobraun.eq.0 ) then
1504 elseif ( itaobraun.eq.1 ) then
1506 ! cn0=1.e-8 ! special
1510 ! ICE2=2 ! 2ICE with cloud ice and graupel (no snow) - r2ice=1, r2iceg=0.
1511 ! ICE2=1 ! 2ice with cloud ice and snow (no graupel) - r2iceg=1, r2ice=0.
1515 if (ice2 .eq. 1) then
1519 if (ice2 .eq. 2) then
1527 ucor=3071.29/tnw**.75
1528 ucos=687.97*roqs**.25/tns**.75
1529 ucog=687.97*roqg**.25/tng**.75
1532 rijl2 = 1. / (ide-ids) / (jde-jds)
1534 !JJScap $doacross local(j,i)
1549 a0=.5*istatmin*rijl2
1567 ! ami50 for use in PINT
1572 !C ******************************************************************
1574 !JJS DO 1000 K=2,kles
1585 rp0=3.799052e3/p0(i,j,k)
1590 r0s=sqrt(rho(i,j,k))
1597 f0(i,j,k)=al/cp/pi(i,j,k)
1651 !JJS DO 100 J=3,JLES
1652 !JJS DO 100 I=3,ILES
1660 ! IF (QV(I,J)+QB0 .LE. 0.) QV(I,J)=-QB0
1661 if (qc(i,j) .le. cmin1) qc(i,j)=0.0
1662 if (qr(i,j) .le. cmin1) qr(i,j)=0.0
1663 if (qi(i,j) .le. cmin1) qi(i,j)=0.0
1664 if (qs(i,j) .le. cmin1) qs(i,j)=0.0
1665 if (qg(i,j) .le. cmin1) qg(i,j)=0.0
1666 tair(i,j)=(pt(i,j)+tb0)*pi0
1667 tairc(i,j)=tair(i,j)-t0
1675 ! *** COMPUTE ZR,ZS,ZG,VR,VS,VG *****************************
1677 if (qr(i,j) .gt. cmin1) then
1679 y1(i,j)=dd(i,j)**.25
1681 vr(i,j)=max(vrcf*dd(i,j)**bwq, 0.)
1684 if (qs(i,j) .gt. cmin1) then
1686 y1(i,j)=dd(i,j)**.25
1688 vs(i,j)=max(vscf*dd(i,j)**bsq, 0.)
1691 if (qg(i,j) .gt. cmin1) then
1693 y1(i,j)=dd(i,j)**.25
1695 if(ihail .eq. 1) then
1696 vg(i,j)=max(vgcr*dd(i,j)**bgq, 0.)
1698 vg(i,j)=max(vgcf*dd(i,j)**bgq, 0.)
1702 if (qr(i,j) .le. cmin2) vr(i,j)=0.0
1703 if (qs(i,j) .le. cmin2) vs(i,j)=0.0
1704 if (qg(i,j) .le. cmin2) vg(i,j)=0.0
1706 ! ******************************************************************
1707 ! *** Y1 : DYNAMIC VISCOSITY OF AIR (U)
1708 ! *** DWV : DIFFUSIVITY OF WATER VAPOR IN AIR (PI)
1709 ! *** TCA : THERMAL CONDUCTIVITY OF AIR (KA)
1710 ! *** Y2 : KINETIC VISCOSITY (V)
1712 y1(i,j)=c149*tair(i,j)**1.5/(tair(i,j)+120.)
1713 dwv(i,j)=dwvp*tair(i,j)**1.81
1714 tca(i,j)=c141*y1(i,j)
1715 scv(i,j)=1./((rr0*y1(i,j))**.1666667*dwv(i,j)**.3333333)
1718 !* 1 * PSAUT : AUTOCONVERSION OF QI TO QS ***1**
1719 !* 3 * PSACI : ACCRETION OF QI TO QS ***3**
1720 !* 4 * PSACW : ACCRETION OF QC BY QS (RIMING) (QSACW FOR PSMLT) ***4**
1721 !* 5 * PRACI : ACCRETION OF QI BY QR ***5**
1722 !* 6 * PIACR : ACCRETION OF QR OR QG BY QI ***6**
1724 !JJS DO 125 J=3,JLES
1725 !JJS DO 125 I=3,ILES
1732 dd(i,j)=1./zs(i,j)**bs3
1734 if (tair(i,j).lt.t0) then
1735 esi(i,j)=exp(.025*tairc(i,j))
1736 psaut(i,j)=r2iceg*max(rn1*esi(i,j)*(qi(i,j)-bnd1) ,0.0)
1737 psaci(i,j)=r2iceg*r3f*esi(i,j)*qi(i,j)*dd(i,j)
1739 ! to cut water to snow accretion by half
1740 ! PSACW(I,J)=R4F*QC(I,J)*DD(I,J)
1741 psacw(i,j)=r2iceg*0.5*r4f*qc(i,j)*dd(i,j)
1743 praci(i,j)=r2iceg*r5f*qi(i,j)/zr(i,j)**bw3
1744 piacr(i,j)=r2iceg*r6f*qi(i,j)*(zr(i,j)**(-bw6))
1745 !JJS PIACR(I,J)=R6F*QI(I,J)/ZR(I,J)**BW6
1747 qsacw(i,j)=r2iceg*r4f*qc(i,j)*dd(i,j)
1750 !* 21 * PRAUT AUTOCONVERSION OF QC TO QR **21**
1751 !* 22 * PRACW : ACCRETION OF QC BY QR **22**
1753 pracw(i,j)=r22f*qc(i,j)/zr(i,j)**bw3
1755 y1(i,j)=qc(i,j)-bnd3
1756 if (y1(i,j).gt.0.0) then
1757 praut(i,j)=r00*y1(i,j)*y1(i,j)/(1.2e-4+rn21/y1(i,j))
1760 !* 12 * PSFW : BERGERON PROCESSES FOR QS (KOENING, 1971) **12**
1761 !* 13 * PSFI : BERGERON PROCESSES FOR QS **13**
1767 if(tair(i,j).lt.t0.and.qi(i,j).gt.cmin) then
1768 y1(i,j)=max( min(tairc(i,j), -1.), -31.)
1769 it(i,j)=int(abs(y1(i,j)))
1770 y1(i,j)=rn12a(it(i,j))
1771 y2(i,j)=rn12b(it(i,j))
1772 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1774 max(d2t*y1(i,j)*(y2(i,j)+r12r*qc(i,j))*qi(i,j),0.0)
1775 rtair(i,j)=1./(tair(i,j)-c76)
1776 y2(i,j)=exp(c218-c580*rtair(i,j))
1777 qsi(i,j)=rp0*y2(i,j)
1778 esi(i,j)=c610*y2(i,j)
1779 ssi(i,j)=(qv(i,j)+qb0)/qsi(i,j)-1.
1780 r_nci=min(1.e-6*exp(-.46*tairc(i,j)),1.)
1781 ! R_NCI=min(1.e-8*EXP(-.6*TAIRC(I,J)),1.) ! use Tao's
1782 dm(i,j)=max( (qv(i,j)+qb0-qsi(i,j)), 0.)
1783 rsub1(i,j)=cs580*qsi(i,j)*rtair(i,j)*rtair(i,j)
1784 y3(i,j)=1./tair(i,j)
1785 dd(i,j)=y3(i,j)*(rn30a*y3(i,j)-rn30b)+rn30c*tair(i,j)/esi(i,j)
1786 y1(i,j)=206.18*ssi(i,j)/dd(i,j)
1787 pidep(i,j)=y1(i,j)*sqrt(r_nci*qi(i,j)/r00)
1788 dep(i,j)=dm(i,j)/(1.+rsub1(i,j))/d2t
1789 if(dm(i,j).gt.cmin2) then
1791 if(pidep(i,j).gt.dep(i,j).and.pidep(i,j).gt.cmin2) then
1792 a2=dep(i,j)/pidep(i,j)
1795 psfi(i,j)=r2iceg*a2*.5*qi(i,j)*y1(i,j)/(sqrt(ami100) &
1797 elseif(dm(i,j).lt.-cmin2) then
1799 ! SUBLIMATION TERMS USED ONLY WHEN SATURATION ADJUSTMENT FOR ICE
1810 !TTT***** QG=QG+MIN(PGDRY,PGWET)
1811 !* 9 * PGACS : ACCRETION OF QS BY QG (DGACS,WGACS: DRY AND WET) ***9**
1812 !* 14 * DGACW : ACCRETION OF QC BY QG (QGACW FOR PGMLT) **14**
1813 !* 16 * DGACR : ACCRETION OF QR TO QG (QGACR FOR PGMLT) **16**
1815 if(qc(i,j)+qr(i,j).lt.1.e-4) then
1821 egs(i,j)=ee1*exp(ee2*tairc(i,j))
1822 ! EGS(I,J)=0.1 ! 6/15/02 tao's
1823 if (tair(i,j).ge.t0) egs(i,j)=1.0
1824 y1(i,j)=abs(vg(i,j)-vs(i,j))
1825 y2(i,j)=zs(i,j)*zg(i,j)
1827 y4(i,j)=.08*y3(i,j)*y3(i,j)
1828 y5(i,j)=.05*y3(i,j)*y4(i,j)
1829 dd(i,j)=y1(i,j)*(y3(i,j)/zs(i,j)**5+y4(i,j)/zs(i,j)**3 &
1831 pgacs(i,j)=r2ice*r2iceg*r9r*egs(i,j)*dd(i,j)
1832 !JJS 1/3/06 from Steve and Chunglin
1833 if (ihail.eq.1) then
1834 dgacs(i,j)=pgacs(i,j)
1838 !JJS 1/3/06 from Steve and Chunglin
1839 wgacs(i,j)=r2ice*r2iceg*r9r*dd(i,j)
1840 ! WGACS(I,J)=0. ! 6/15/02 tao's
1841 y1(i,j)=1./zg(i,j)**bg3
1843 if(ihail .eq. 1) then
1844 dgacw(i,j)=r2ice*max(r14r*qc(i,j)*y1(i,j), 0.0)
1846 dgacw(i,j)=r2ice*max(r14f*qc(i,j)*y1(i,j), 0.0)
1849 qgacw(i,j)=dgacw(i,j)
1850 y1(i,j)=abs(vg(i,j)-vr(i,j))
1851 y2(i,j)=zr(i,j)*zg(i,j)
1853 y4(i,j)=.08*y3(i,j)*y3(i,j)
1854 y5(i,j)=.05*y3(i,j)*y4(i,j)
1855 dd(i,j)=r16r*y1(i,j)*(y3(i,j)/zr(i,j)**5+y4(i,j)/zr(i,j)**3 &
1857 dgacr(i,j)=r2ice*max(dd(i,j), 0.0)
1858 qgacr(i,j)=dgacr(i,j)
1860 if (tair(i,j).ge.t0) then
1871 !*******PGDRY : DGACW+DGACI+DGACR+DGACS ******
1872 !* 15 * DGACI : ACCRETION OF QI BY QG (WGACI FOR WET GROWTH) **15**
1873 !* 17 * PGWET : WET GROWTH OF QG **17**
1879 if (tair(i,j).lt.t0) then
1880 y1(i,j)=qi(i,j)/zg(i,j)**bg3
1881 if (ihail.eq.1) then
1882 dgaci(i,j)=r2ice*r15r*y1(i,j)
1883 wgaci(i,j)=r2ice*r15ar*y1(i,j)
1884 ! WGACI(I,J)=0. ! 6/15/02 tao's
1887 !JJS DGACI(I,J)=r2ice*R15F*Y1(I,J)
1889 wgaci(i,j)=r2ice*r15af*y1(i,j)
1890 ! WGACI(I,J)=0. ! 6/15/02 tao's
1893 if (tairc(i,j).ge.-50.) then
1894 if (alf+rn17c*tairc(i,j) .eq. 0.) then
1895 write(91,*) itimestep, i,j,k, alf, rn17c, tairc(i,j)
1897 y1(i,j)=1./(alf+rn17c*tairc(i,j))
1898 if (ihail.eq.1) then
1899 y3(i,j)=.78/zg(i,j)**2+r17aq*scv(i,j)/zg(i,j)**bgh5
1901 y3(i,j)=.78/zg(i,j)**2+r17as*scv(i,j)/zg(i,j)**bgh5
1903 y4(i,j)=alvr*dwv(i,j)*(rp0-(qv(i,j)+qb0)) &
1904 -tca(i,j)*tairc(i,j)
1905 dd(i,j)=y1(i,j)*(r17r*y4(i,j)*y3(i,j) &
1906 +(wgaci(i,j)+wgacs(i,j))*(alf+rn17b*tairc(i,j)))
1907 pgwet(i,j)=r2ice*max(dd(i,j), 0.0)
1912 !******** HANDLING THE NEGATIVE CLOUD WATER (QC) ******************
1913 !******** HANDLING THE NEGATIVE CLOUD ICE (QI) ******************
1915 !JJS DO 150 J=3,JLES
1916 !JJS DO 150 I=3,ILES
1919 psacw(i,j)=min(y1(i,j), psacw(i,j))
1920 praut(i,j)=min(y1(i,j), praut(i,j))
1921 pracw(i,j)=min(y1(i,j), pracw(i,j))
1922 psfw(i,j)= min(y1(i,j), psfw(i,j))
1923 dgacw(i,j)=min(y1(i,j), dgacw(i,j))
1924 qsacw(i,j)=min(y1(i,j), qsacw(i,j))
1925 qgacw(i,j)=min(y1(i,j), qgacw(i,j))
1927 y1(i,j)=(psacw(i,j)+praut(i,j)+pracw(i,j)+psfw(i,j) &
1928 +dgacw(i,j)+qsacw(i,j)+qgacw(i,j))*d2t
1929 qc(i,j)=qc(i,j)-y1(i,j)
1931 if (qc(i,j) .lt. 0.0) then
1933 if (y1(i,j) .ne. 0.0) a1=qc(i,j)/y1(i,j)+1.
1934 psacw(i,j)=psacw(i,j)*a1
1935 praut(i,j)=praut(i,j)*a1
1936 pracw(i,j)=pracw(i,j)*a1
1937 psfw(i,j)=psfw(i,j)*a1
1938 dgacw(i,j)=dgacw(i,j)*a1
1939 qsacw(i,j)=qsacw(i,j)*a1
1940 qgacw(i,j)=qgacw(i,j)*a1
1945 !******** SHED PROCESS (WGACR=PGWET-DGACW-WGACI-WGACS)
1947 wgacr(i,j)=pgwet(i,j)-dgacw(i,j)-wgaci(i,j)-wgacs(i,j)
1948 y2(i,j)=dgacw(i,j)+dgaci(i,j)+dgacr(i,j)+dgacs(i,j)
1949 if (pgwet(i,j).ge.y2(i,j)) then
1958 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1961 psaut(i,j)=min(y1(i,j), psaut(i,j))
1962 psaci(i,j)=min(y1(i,j), psaci(i,j))
1963 praci(i,j)=min(y1(i,j), praci(i,j))
1964 psfi(i,j)= min(y1(i,j), psfi(i,j))
1965 dgaci(i,j)=min(y1(i,j), dgaci(i,j))
1966 wgaci(i,j)=min(y1(i,j), wgaci(i,j))
1968 y2(i,j)=(psaut(i,j)+psaci(i,j)+praci(i,j)+psfi(i,j) &
1969 +dgaci(i,j)+wgaci(i,j))*d2t
1970 qi(i,j)=qi(i,j)-y2(i,j)+pidep(i,j)*d2t
1972 if (qi(i,j).lt.0.0) then
1974 if (y2(i,j) .ne. 0.0) a2=qi(i,j)/y2(i,j)+1.
1975 psaut(i,j)=psaut(i,j)*a2
1976 psaci(i,j)=psaci(i,j)*a2
1977 praci(i,j)=praci(i,j)*a2
1978 psfi(i,j)=psfi(i,j)*a2
1979 dgaci(i,j)=dgaci(i,j)*a2
1980 wgaci(i,j)=wgaci(i,j)*a2
1989 ! if(qc(i,j) .gt. 5.e-4) dlt4(i,j)=0.0
1990 ! if(qs(i,j) .le. 1.e-4) dlt4(i,j)=1.0
1992 ! IF (TAIR(I,J).ge.T0) THEN
1996 if (tair(i,j).lt.t0) then
1997 if (qr(i,j).lt.1.e-4) then
2001 if (qs(i,j).ge.1.e-4) then
2006 if (ice2 .eq. 1) then
2010 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2011 pr(i,j)=(qsacw(i,j)+praut(i,j)+pracw(i,j)+qgacw(i,j))*d2t
2012 ps(i,j)=(psaut(i,j)+psaci(i,j)+psacw(i,j)+psfw(i,j) &
2013 +psfi(i,j)+dlt3(i,j)*praci(i,j))*d2t
2014 ! PS(I,J)=(PSAUT(I,J)+PSACI(I,J)+dlt4(i,j)*PSACW(I,J)
2015 ! 1 +PSFW(I,J)+PSFI(I,J)+DLT3(I,J)*PRACI(I,J))*D2T
2016 pg(i,j)=((1.-dlt3(i,j))*praci(i,j)+dgaci(i,j)+wgaci(i,j) &
2018 ! PG(I,J)=((1.-DLT3(I,J))*PRACI(I,J)+DGACI(I,J)+WGACI(I,J)
2019 ! 1 +DGACW(I,J)+(1.-dlt4(i,j))*PSACW(I,J))*D2T
2023 !* 7 * PRACS : ACCRETION OF QS BY QR ***7**
2024 !* 8 * PSACR : ACCRETION OF QR BY QS (QSACR FOR PSMLT) ***8**
2026 !JJS DO 175 J=3,JLES
2027 !JJS DO 175 I=3,ILES
2029 y1(i,j)=abs(vr(i,j)-vs(i,j))
2030 y2(i,j)=zr(i,j)*zs(i,j)
2032 y4(i,j)=.08*y3(i,j)*y3(i,j)
2033 y5(i,j)=.05*y3(i,j)*y4(i,j)
2034 pracs(i,j)=r2ice*r2iceg*r7r*y1(i,j)*(y3(i,j)/zs(i,j)**5 &
2035 +y4(i,j)/zs(i,j)**3+y5(i,j)/zs(i,j))
2036 psacr(i,j)=r2iceg*r8r*y1(i,j)*(y3(i,j)/zr(i,j)**5 &
2037 +y4(i,j)/zr(i,j)**3+y5(i,j)/zr(i,j))
2038 qsacr(i,j)=psacr(i,j)
2040 if (tair(i,j).ge.t0) then
2046 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2047 !* 2 * PGAUT : AUTOCONVERSION OF QS TO QG ***2**
2048 !* 18 * PGFR : FREEZING OF QR TO QG **18**
2053 if (tair(i,j) .lt. t0) then
2054 ! Y1(I,J)=EXP(.09*TAIRC(I,J))
2055 ! PGAUT(I,J)=r2iceg*max(RN2*Y1(I,J)*(QS(I,J)-BND2), 0.0)
2056 ! IF(IHAIL.EQ.1) PGAUT(I,J)=max(RN2*Y1(I,J)*(QS(I,J)-BND2),0.0)
2057 y2(i,j)=exp(rn18a*(t0-tair(i,j)))
2058 !JJS PGFR(I,J)=r2ice*max(R18R*(Y2(I,J)-1.)/ZR(I,J)**7., 0.0)
2059 ! pgfr(i,j)=r2ice*max(r18r*(y2(i,j)-1.)* &
2060 ! (zr(i,j)**(-7.)), 0.0)
2061 ! modify to prevent underflow on some computers (JD)
2063 temp = temp*temp*temp*temp*temp*temp*temp
2064 pgfr(i,j)=r2ice*max(r18r*(y2(i,j)-1.)* &
2070 !******** HANDLING THE NEGATIVE RAIN WATER (QR) *******************
2071 !******** HANDLING THE NEGATIVE SNOW (QS) *******************
2073 !JJS DO 200 J=3,JLES
2074 !JJS DO 200 I=3,ILES
2077 y2(i,j)=-qg(i,j)/d2t
2078 piacr(i,j)=min(y1(i,j), piacr(i,j))
2079 dgacr(i,j)=min(y1(i,j), dgacr(i,j))
2080 wgacr(i,j)=min(y1(i,j), wgacr(i,j))
2081 wgacr(i,j)=max(y2(i,j), wgacr(i,j))
2082 psacr(i,j)=min(y1(i,j), psacr(i,j))
2083 pgfr(i,j)= min(y1(i,j), pgfr(i,j))
2085 if(wgacr(i,j) .lt. 0.) del=1.
2086 y1(i,j)=(piacr(i,j)+dgacr(i,j)+(1.-del)*wgacr(i,j) &
2087 +psacr(i,j)+pgfr(i,j))*d2t
2088 qr(i,j)=qr(i,j)+pr(i,j)-y1(i,j)-del*wgacr(i,j)*d2t
2089 if (qr(i,j) .lt. 0.0) then
2091 if(y1(i,j) .ne. 0.) a1=qr(i,j)/y1(i,j)+1.
2092 piacr(i,j)=piacr(i,j)*a1
2093 dgacr(i,j)=dgacr(i,j)*a1
2094 if (wgacr(i,j).gt.0.) wgacr(i,j)=wgacr(i,j)*a1
2095 pgfr(i,j)=pgfr(i,j)*a1
2096 psacr(i,j)=psacr(i,j)*a1
2099 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2100 prn(i,j)=d2t*((1.-dlt3(i,j))*piacr(i,j)+dgacr(i,j) &
2101 +wgacr(i,j)+(1.-dlt2(i,j))*psacr(i,j)+pgfr(i,j))
2102 ps(i,j)=ps(i,j)+d2t*(dlt3(i,j)*piacr(i,j) &
2103 +dlt2(i,j)*psacr(i,j))
2104 pracs(i,j)=(1.-dlt2(i,j))*pracs(i,j)
2106 pgacs(i,j)=min(y1(i,j), pgacs(i,j))
2107 dgacs(i,j)=min(y1(i,j), dgacs(i,j))
2108 wgacs(i,j)=min(y1(i,j), wgacs(i,j))
2109 pgaut(i,j)=min(y1(i,j), pgaut(i,j))
2110 pracs(i,j)=min(y1(i,j), pracs(i,j))
2111 psn(i,j)=d2t*(pgacs(i,j)+dgacs(i,j)+wgacs(i,j) &
2112 +pgaut(i,j)+pracs(i,j))
2113 qs(i,j)=qs(i,j)+ps(i,j)-psn(i,j)
2115 if (qs(i,j).lt.0.0) then
2117 if (psn(i,j) .ne. 0.0) a2=qs(i,j)/psn(i,j)+1.
2118 pgacs(i,j)=pgacs(i,j)*a2
2119 dgacs(i,j)=dgacs(i,j)*a2
2120 wgacs(i,j)=wgacs(i,j)*a2
2121 pgaut(i,j)=pgaut(i,j)*a2
2122 pracs(i,j)=pracs(i,j)*a2
2123 psn(i,j)=psn(i,j)*a2
2127 !C PSN(I,J)=D2T*(PGACS(I,J)+DGACS(I,J)+WGACS(I,J)
2128 !c +PGAUT(I,J)+PRACS(I,J))
2129 y2(i,j)=d2t*(psacw(i,j)+psfw(i,j)+dgacw(i,j)+piacr(i,j) &
2130 +dgacr(i,j)+wgacr(i,j)+psacr(i,j)+pgfr(i,j))
2131 pt(i,j)=pt(i,j)+afcp*y2(i,j)
2132 qg(i,j)=qg(i,j)+pg(i,j)+prn(i,j)+psn(i,j)
2136 !* 11 * PSMLT : MELTING OF QS **11**
2137 !* 19 * PGMLT : MELTING OF QG TO QR **19**
2139 !JJS DO 225 J=3,JLES
2140 !JJS DO 225 I=3,ILES
2144 tair(i,j)=(pt(i,j)+tb0)*pi0
2146 if (tair(i,j).ge.t0) then
2147 tairc(i,j)=tair(i,j)-t0
2148 y1(i,j)=tca(i,j)*tairc(i,j)-alvr*dwv(i,j) &
2149 *(rp0-(qv(i,j)+qb0))
2150 y2(i,j)=.78/zs(i,j)**2+r101f*scv(i,j)/zs(i,j)**bsh5
2151 dd(i,j)=r11rt*y1(i,j)*y2(i,j)+r11at*tairc(i,j) &
2152 *(qsacw(i,j)+qsacr(i,j))
2153 psmlt(i,j)=r2iceg*max(0.0, min(dd(i,j), qs(i,j)))
2156 y3(i,j)=.78/zg(i,j)**2+r19aq*scv(i,j)/zg(i,j)**bgh5
2158 y3(i,j)=.78/zg(i,j)**2+r19as*scv(i,j)/zg(i,j)**bgh5
2161 dd1(i,j)=r19rt*y1(i,j)*y3(i,j)+r19bt*tairc(i,j) &
2162 *(qgacw(i,j)+qgacr(i,j))
2163 pgmlt(i,j)=r2ice*max(0.0, min(dd1(i,j), qg(i,j)))
2164 pt(i,j)=pt(i,j)-afcp*(psmlt(i,j)+pgmlt(i,j))
2165 qr(i,j)=qr(i,j)+psmlt(i,j)+pgmlt(i,j)
2166 qs(i,j)=qs(i,j)-psmlt(i,j)
2167 qg(i,j)=qg(i,j)-pgmlt(i,j)
2169 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2170 !* 24 * PIHOM : HOMOGENEOUS FREEZING OF QC TO QI (T < T00) **24**
2171 !* 25 * PIDW : DEPOSITION GROWTH OF QC TO QI ( T0 < T <= T00) **25**
2172 !* 26 * PIMLT : MELTING OF QI TO QC (T >= T0) **26**
2174 if (qc(i,j).le.cmin1) qc(i,j)=0.0
2175 if (qi(i,j).le.cmin1) qi(i,j)=0.0
2176 tair(i,j)=(pt(i,j)+tb0)*pi0
2178 if(tair(i,j).le.t00) then
2183 if(tair(i,j).ge.t0) then
2190 if (tair(i,j).lt.t0 .and. tair(i,j).gt.t00) then
2191 tairc(i,j)=tair(i,j)-t0
2192 y1(i,j)=max( min(tairc(i,j), -1.), -31.)
2193 it(i,j)=int(abs(y1(i,j)))
2194 y2(i,j)=aa1(it(i,j))
2195 y3(i,j)=aa2(it(i,j))
2196 y4(i,j)=exp(abs(beta*tairc(i,j)))
2197 y5(i,j)=(r00*qi(i,j)/(r25a*y4(i,j)))**y3(i,j)
2198 pidw(i,j)=min(r25rt*y2(i,j)*y4(i,j)*y5(i,j), qc(i,j))
2201 y1(i,j)=pihom(i,j)-pimlt(i,j)+pidw(i,j)
2202 pt(i,j)=pt(i,j)+afcp*y1(i,j)+ascp*(pidep(i,j))*d2t
2203 qv(i,j)=qv(i,j)-(pidep(i,j))*d2t
2204 qc(i,j)=qc(i,j)-y1(i,j)
2205 qi(i,j)=qi(i,j)+y1(i,j)
2207 !* 31 * PINT : INITIATION OF QI **31**
2208 !* 32 * PIDEP : DEPOSITION OF QI **32**
2210 ! CALCULATION OF PINT USES DIFFERENT VALUES OF THE INTERCEPT AND SLOPE FOR
2211 ! THE FLETCHER EQUATION. ALSO, ONLY INITIATE MORE ICE IF THE NEW NUMBER
2212 ! CONCENTRATION EXCEEDS THAT ALREADY PRESENT.
2213 !* 31 * pint : initiation of qi **31**
2214 !* 32 * pidep : deposition of qi **32**
2216 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2217 if ( itaobraun.eq.1 ) then
2218 tair(i,j)=(pt(i,j)+tb0)*pi0
2219 if (tair(i,j) .lt. t0) then
2220 ! if (qi(i,j) .le. cmin) qi(i,j)=0.
2221 if (qi(i,j) .le. cmin2) qi(i,j)=0.
2222 tairc(i,j)=tair(i,j)-t0
2223 rtair(i,j)=1./(tair(i,j)-c76)
2224 y2(i,j)=exp(c218-c580*rtair(i,j))
2225 qsi(i,j)=rp0*y2(i,j)
2226 esi(i,j)=c610*y2(i,j)
2227 ssi(i,j)=(qv(i,j)+qb0)/qsi(i,j)-1.
2230 !ccif ( itaobraun.eq.1 ) --> betah=0.5*beta=-.46*0.5=-0.23; cn0=1.e-6
2231 !ccif ( itaobraun.eq.0 ) --> betah=0.5*beta=-.6*0.5=-0.30; cn0=1.e-8
2233 y1(i,j)=1./tair(i,j)
2235 !cc insert a restriction on ice collection that ice collection
2236 !cc should be stopped at -30 c (with cn0=1.e-6, beta=-.46)
2238 tairccri=tairc(i,j) ! in degree c
2239 if(tairccri.le.-30.) tairccri=-30.
2241 ! y2(i,j)=exp(betah*tairc(i,j))
2242 y2(i,j)=exp(betah*tairccri)
2243 y3(i,j)=sqrt(qi(i,j))
2244 dd(i,j)=y1(i,j)*(rn10a*y1(i,j)-rn10b)+rn10c*tair(i,j) &
2246 pidep(i,j)=max(r32rt*ssi(i,j)*y2(i,j)*y3(i,j)/dd(i,j), 0.e0)
2248 r_nci=min(cn0*exp(beta*tairc(i,j)),1.)
2249 ! r_nci=min(1.e-6*exp(-.46*tairc(i,j)),1.)
2251 dd(i,j)=max(1.e-9*r_nci/r00-qi(i,j)*1.e-9/ami50, 0.)
2252 dm(i,j)=max( (qv(i,j)+qb0-qsi(i,j)), 0.0)
2253 rsub1(i,j)=cs580*qsi(i,j)*rtair(i,j)*rtair(i,j)
2254 dep(i,j)=dm(i,j)/(1.+rsub1(i,j))
2255 pint(i,j)=max(min(dd(i,j), dm(i,j)), 0.)
2257 ! pint(i,j)=min(pint(i,j), dep(i,j))
2258 pint(i,j)=min(pint(i,j)+pidep(i,j), dep(i,j))
2260 ! if (pint(i,j) .le. cmin) pint(i,j)=0.
2261 if (pint(i,j) .le. cmin2) pint(i,j)=0.
2262 pt(i,j)=pt(i,j)+ascp*pint(i,j)
2263 qv(i,j)=qv(i,j)-pint(i,j)
2264 qi(i,j)=qi(i,j)+pint(i,j)
2266 endif ! if ( itaobraun.eq.1 )
2267 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2269 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2270 if ( itaobraun.eq.0 ) then
2271 tair(i,j)=(pt(i,j)+tb0)*pi0
2272 if (tair(i,j) .lt. t0) then
2273 if (qi(i,j) .le. cmin1) qi(i,j)=0.
2274 tairc(i,j)=tair(i,j)-t0
2275 dd(i,j)=r31r*exp(beta*tairc(i,j))
2276 rtair(i,j)=1./(tair(i,j)-c76)
2277 y2(i,j)=exp(c218-c580*rtair(i,j))
2278 qsi(i,j)=rp0*y2(i,j)
2279 esi(i,j)=c610*y2(i,j)
2280 ssi(i,j)=(qv(i,j)+qb0)/qsi(i,j)-1.
2281 dm(i,j)=max( (qv(i,j)+qb0-qsi(i,j)), 0.)
2282 rsub1(i,j)=cs580*qsi(i,j)*rtair(i,j)*rtair(i,j)
2283 dep(i,j)=dm(i,j)/(1.+rsub1(i,j))
2284 pint(i,j)=max(min(dd(i,j), dm(i,j)), 0.)
2285 y1(i,j)=1./tair(i,j)
2286 y2(i,j)=exp(betah*tairc(i,j))
2287 y3(i,j)=sqrt(qi(i,j))
2288 dd(i,j)=y1(i,j)*(rn10a*y1(i,j)-rn10b) &
2289 +rn10c*tair(i,j)/esi(i,j)
2290 pidep(i,j)=max(r32rt*ssi(i,j)*y2(i,j)*y3(i,j)/dd(i,j), 0.)
2291 pint(i,j)=pint(i,j)+pidep(i,j)
2292 pint(i,j)=min(pint(i,j),dep(i,j))
2293 !c if (pint(i,j) .le. cmin2) pint(i,j)=0.
2294 pt(i,j)=pt(i,j)+ascp*pint(i,j)
2295 qv(i,j)=qv(i,j)-pint(i,j)
2296 qi(i,j)=qi(i,j)+pint(i,j)
2298 endif ! if ( itaobraun.eq.0 )
2299 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2303 !***** TAO ET AL (1989) SATURATION TECHNIQUE ***********************
2305 if (new_ice_sat .eq. 0) then
2307 !JJS DO 250 J=3,JLES
2308 !JJS DO 250 I=3,ILES
2309 tair(i,j)=(pt(i,j)+tb0)*pi0
2310 cnd(i,j)=rt0*(tair(i,j)-t00)
2311 dep(i,j)=rt0*(t0-tair(i,j))
2312 y1(i,j)=1./(tair(i,j)-c358)
2313 y2(i,j)=1./(tair(i,j)-c76)
2314 qsw(i,j)=rp0*exp(c172-c409*y1(i,j))
2315 qsi(i,j)=rp0*exp(c218-c580*y2(i,j))
2316 dd(i,j)=cp409*y1(i,j)*y1(i,j)
2317 dd1(i,j)=cp580*y2(i,j)*y2(i,j)
2318 if (qc(i,j).le.cmin) qc(i,j)=cmin
2319 if (qi(i,j).le.cmin) qi(i,j)=cmin
2320 if (tair(i,j).ge.t0) then
2326 if (tair(i,j).lt.t00) then
2332 y5(i,j)=avcp*cnd(i,j)+ascp*dep(i,j)
2333 ! if (qc(i,j) .ge. cmin .or. qi(i,j) .ge. cmin) then
2334 y1(i,j)=qc(i,j)*qsw(i,j)/(qc(i,j)+qi(i,j))
2335 y2(i,j)=qi(i,j)*qsi(i,j)/(qc(i,j)+qi(i,j))
2336 y4(i,j)=dd(i,j)*y1(i,j)+dd1(i,j)*y2(i,j)
2337 qvs(i,j)=y1(i,j)+y2(i,j)
2338 rsub1(i,j)=(qv(i,j)+qb0-qvs(i,j))/(1.+y4(i,j)*y5(i,j))
2339 cnd(i,j)=cnd(i,j)*rsub1(i,j)
2340 dep(i,j)=dep(i,j)*rsub1(i,j)
2341 if (qc(i,j).le.cmin) qc(i,j)=0.
2342 if (qi(i,j).le.cmin) qi(i,j)=0.
2343 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2344 !c ****** condensation or evaporation of qc ******
2346 cnd(i,j)=max(-qc(i,j),cnd(i,j))
2348 !c ****** deposition or sublimation of qi ******
2350 dep(i,j)=max(-qi(i,j),dep(i,j))
2352 pt(i,j)=pt(i,j)+avcp*cnd(i,j)+ascp*dep(i,j)
2353 qv(i,j)=qv(i,j)-cnd(i,j)-dep(i,j)
2354 qc(i,j)=qc(i,j)+cnd(i,j)
2355 qi(i,j)=qi(i,j)+dep(i,j)
2359 if (new_ice_sat .eq. 1) then
2364 tair(i,j)=(pt(i,j)+tb0)*pi0
2365 cnd(i,j)=rt0*(tair(i,j)-t00)
2366 dep(i,j)=rt0*(t0-tair(i,j))
2367 y1(i,j)=1./(tair(i,j)-c358)
2368 y2(i,j)=1./(tair(i,j)-c76)
2369 qsw(i,j)=rp0*exp(c172-c409*y1(i,j))
2370 qsi(i,j)=rp0*exp(c218-c580*y2(i,j))
2371 dd(i,j)=cp409*y1(i,j)*y1(i,j)
2372 dd1(i,j)=cp580*y2(i,j)*y2(i,j)
2373 y5(i,j)=avcp*cnd(i,j)+ascp*dep(i,j)
2374 y1(i,j)=rt0*(tair(i,j)-t00)*qsw(i,j)
2375 y2(i,j)=rt0*(t0-tair(i,j))*qsi(i,j)
2376 ! IF (QC(I,J).LE.CMIN) QC(I,J)=CMIN
2377 ! IF (QI(I,J).LE.CMIN) QI(I,J)=CMIN
2379 if (tair(i,j).ge.t0) then
2386 if (tair(i,j).lt.t00) then
2394 ! Y1(I,J)=QC(I,J)*QSW(I,J)/(QC(I,J)+QI(I,J))
2395 ! Y2(I,J)=QI(I,J)*QSI(I,J)/(QC(I,J)+QI(I,J))
2397 y4(i,j)=dd(i,j)*y1(i,j)+dd1(i,j)*y2(i,j)
2398 qvs(i,j)=y1(i,j)+y2(i,j)
2399 rsub1(i,j)=(qv(i,j)+qb0-qvs(i,j))/(1.+y4(i,j)*y5(i,j))
2400 cnd(i,j)=cnd(i,j)*rsub1(i,j)
2401 dep(i,j)=dep(i,j)*rsub1(i,j)
2402 ! IF (QC(I,J).LE.CMIN) QC(I,J)=0.
2403 ! IF (QI(I,J).LE.CMIN) QI(I,J)=0.
2405 !C ****** CONDENSATION OR EVAPORATION OF QC ******
2407 cnd(i,j)=max(-qc(i,j),cnd(i,j))
2409 !C ****** DEPOSITION OR SUBLIMATION OF QI ******
2411 dep(i,j)=max(-qi(i,j),dep(i,j))
2413 pt(i,j)=pt(i,j)+avcp*cnd(i,j)+ascp*dep(i,j)
2414 qv(i,j)=qv(i,j)-cnd(i,j)-dep(i,j)
2415 qc(i,j)=qc(i,j)+cnd(i,j)
2416 qi(i,j)=qi(i,j)+dep(i,j)
2423 if (new_ice_sat .eq. 2) then
2428 tair(i,j)=(pt(i,j)+tb0)*pi0
2429 if (tair(i,j) .ge. 253.16) then
2430 y1(i,j)=1./(tair(i,j)-c358)
2431 qsw(i,j)=rp0*exp(c172-c409*y1(i,j))
2432 dd(i,j)=cp409*y1(i,j)*y1(i,j)
2433 dm(i,j)=qv(i,j)+qb0-qsw(i,j)
2434 cnd(i,j)=dm(i,j)/(1.+avcp*dd(i,j)*qsw(i,j))
2435 !c ****** condensation or evaporation of qc ******
2436 cnd(i,j)=max(-qc(i,j), cnd(i,j))
2437 pt(i,j)=pt(i,j)+avcp*cnd(i,j)
2438 qv(i,j)=qv(i,j)-cnd(i,j)
2439 qc(i,j)=qc(i,j)+cnd(i,j)
2441 if (tair(i,j) .le. 258.16) then
2443 y2(i,j)=1./(tair(i,j)-c76)
2444 qsi(i,j)=rp0*exp(c218-c580*y2(i,j))
2445 dd1(i,j)=cp580*y2(i,j)*y2(i,j)
2446 dep(i,j)=(qv(i,j)+qb0-qsi(i,j))/(1.+ascp*dd1(i,j)*qsi(i,j))
2447 !c ****** deposition or sublimation of qi ******
2448 dep(i,j)=max(-qi(i,j),dep(i,j))
2449 pt(i,j)=pt(i,j)+ascp*dep(i,j)
2450 qv(i,j)=qv(i,j)-dep(i,j)
2451 qi(i,j)=qi(i,j)+dep(i,j)
2459 !* 10 * PSDEP : DEPOSITION OR SUBLIMATION OF QS **10**
2460 !* 20 * PGSUB : SUBLIMATION OF QG **20**
2462 !JJS DO 275 J=3,JLES
2463 !JJS DO 275 I=3,ILES
2468 tair(i,j)=(pt(i,j)+tb0)*pi0
2470 if(tair(i,j).lt.t0) then
2471 if(qs(i,j).lt.cmin1) qs(i,j)=0.0
2472 if(qg(i,j).lt.cmin1) qg(i,j)=0.0
2473 rtair(i,j)=1./(tair(i,j)-c76)
2474 qsi(i,j)=rp0*exp(c218-c580*rtair(i,j))
2475 ssi(i,j)=(qv(i,j)+qb0)/qsi(i,j)-1.
2476 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2477 y1(i,j)=r10ar/(tca(i,j)*tair(i,j)**2)+1./(dwv(i,j) &
2479 y2(i,j)=.78/zs(i,j)**2+r101f*scv(i,j)/zs(i,j)**bsh5
2480 psdep(i,j)=r10t*ssi(i,j)*y2(i,j)/y1(i,j)
2481 pssub(i,j)=psdep(i,j)
2482 psdep(i,j)=r2iceg*max(psdep(i,j), 0.)
2483 pssub(i,j)=r2iceg*max(-qs(i,j), min(pssub(i,j), 0.))
2486 y2(i,j)=.78/zg(i,j)**2+r20bq*scv(i,j)/zg(i,j)**bgh5
2488 y2(i,j)=.78/zg(i,j)**2+r20bs*scv(i,j)/zg(i,j)**bgh5
2491 pgsub(i,j)=r2ice*r20t*ssi(i,j)*y2(i,j)/y1(i,j)
2492 dm(i,j)=qv(i,j)+qb0-qsi(i,j)
2493 rsub1(i,j)=cs580*qsi(i,j)*rtair(i,j)*rtair(i,j)
2495 ! ******** DEPOSITION OR SUBLIMATION OF QS **********************
2497 y1(i,j)=dm(i,j)/(1.+rsub1(i,j))
2498 psdep(i,j)=r2iceg*min(psdep(i,j),max(y1(i,j),0.))
2499 y2(i,j)=min(y1(i,j),0.)
2500 pssub(i,j)=r2iceg*max(pssub(i,j),y2(i,j))
2502 ! ******** SUBLIMATION OF QG ***********************************
2504 dd(i,j)=max((-y2(i,j)-qs(i,j)), 0.)
2505 pgsub(i,j)=r2ice*min(dd(i,j), qg(i,j), max(pgsub(i,j),0.))
2507 if(qc(i,j)+qi(i,j).gt.1.e-5) then
2513 psdep(i,j)=dlt1(i,j)*psdep(i,j)
2514 pssub(i,j)=(1.-dlt1(i,j))*pssub(i,j)
2515 pgsub(i,j)=(1.-dlt1(i,j))*pgsub(i,j)
2517 pt(i,j)=pt(i,j)+ascp*(psdep(i,j)+pssub(i,j)-pgsub(i,j))
2518 qv(i,j)=qv(i,j)+pgsub(i,j)-pssub(i,j)-psdep(i,j)
2519 qs(i,j)=qs(i,j)+psdep(i,j)+pssub(i,j)
2520 qg(i,j)=qg(i,j)-pgsub(i,j)
2523 !* 23 * ERN : EVAPORATION OF QR (SUBSATURATION) **23**
2527 if(qr(i,j).gt.0.0) then
2528 tair(i,j)=(pt(i,j)+tb0)*pi0
2529 rtair(i,j)=1./(tair(i,j)-c358)
2530 qsw(i,j)=rp0*exp(c172-c409*rtair(i,j))
2531 ssw(i,j)=(qv(i,j)+qb0)/qsw(i,j)-1.0
2532 dm(i,j)=qv(i,j)+qb0-qsw(i,j)
2533 rsub1(i,j)=cv409*qsw(i,j)*rtair(i,j)*rtair(i,j)
2534 dd1(i,j)=max(-dm(i,j)/(1.+rsub1(i,j)), 0.0)
2535 y1(i,j)=.78/zr(i,j)**2+r23af*scv(i,j)/zr(i,j)**bwh5
2536 y2(i,j)=r23br/(tca(i,j)*tair(i,j)**2)+1./(dwv(i,j) &
2539 ern(i,j)=r23t*ssw(i,j)*y1(i,j)/y2(i,j)
2540 ern(i,j)=min(dd1(i,j),qr(i,j),max(ern(i,j),0.))
2541 pt(i,j)=pt(i,j)-avcp*ern(i,j)
2542 qv(i,j)=qv(i,j)+ern(i,j)
2543 qr(i,j)=qr(i,j)-ern(i,j)
2546 ! IF (QV(I,J)+QB0 .LE. 0.) QV(I,J)=-QB0
2547 if (qc(i,j) .le. cmin1) qc(i,j)=0.
2548 if (qr(i,j) .le. cmin1) qr(i,j)=0.
2549 if (qi(i,j) .le. cmin1) qi(i,j)=0.
2550 if (qs(i,j) .le. cmin1) qs(i,j)=0.
2551 if (qg(i,j) .le. cmin1) qg(i,j)=0.
2567 ! DD(I,J)=MAX(-CND(I,J), 0.)
2568 ! CND(I,J)=MAX(CND(I,J), 0.)
2569 ! DD1(I,J)=MAX(-DEP(I,J), 0.)
2571 !ccshie 2/21/02 shie follow tao
2572 !CC for reference QI(I,J)=QI(I,J)-Y2(I,J)+PIDEP(I,J)*D2T
2573 !CC for reference QV(I,J)=QV(I,J)-(PIDEP(I,J))*D2T
2575 !c DEP(I,J)=MAX(DEP(I,J), 0.)
2576 ! DEP(I,J)=MAX(DEP(I,J), 0.)+PIDEP(I,J)*D2T
2578 ! SEE=SEE+DD(I,J)+ERN(I,J)
2585 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2586 !c henry: please take a look (start)
2587 !JJS modified by JJS on 5/1/2007 vvvvv
2589 !JJS do 305 j=3,jles
2590 !JJS do 305 i=3,iles
2591 dd(i,j)=max(-cnd(i,j), 0.)
2592 cnd(i,j)=max(cnd(i,j), 0.)
2593 dd1(i,j)=max(-dep(i,j), 0.)+pidep(i,j)*d2t
2594 dep(i,j)=max(dep(i,j), 0.)
2597 !JJS do 306 j=3,jles
2598 !JJS do 306 i=3,iles
2599 !JJS scc=scc+cnd(i,j)
2600 !JJS see=see+(dd(i,j)+ern(i,j))
2602 !JJS sddd=sddd+(dep(i,j)+pint(i,j)+psdep(i,j)+pgdep(i,j))
2603 !JJS ssss=ssss+dd1(i,j)
2605 ! shhh=shhh+rsw(i,j,k)*d2t
2606 ! sccc=sccc+rlw(i,j,k)*d2t
2608 !JJS smmm=smmm+(psmlt(i,j)+pgmlt(i,j)+pimlt(i,j))
2609 !JJS sfff=sfff+d2t*(psacw(i,j)+piacr(i,j)+psfw(i,j)
2610 !JJS 1 +pgfr(i,j)+dgacw(i,j)+dgacr(i,j)+psacr(i,j))
2611 !JJS 2 -qracs(i,j)+pihom(i,j)+pidw(i,j)
2615 seee=dd(i,j)+ern(i,j)
2616 sddd=dep(i,j)+pint(i,j)+psdep(i,j)+pgdep(i,j)
2617 ssss=dd1(i,j) + pgsub(i,j)
2618 smmm=psmlt(i,j)+pgmlt(i,j)+pimlt(i,j)
2619 sfff=d2t*(psacw(i,j)+piacr(i,j)+psfw(i,j) &
2620 +pgfr(i,j)+dgacw(i,j)+dgacr(i,j)+psacr(i,j) &
2621 +wgacr(i,j))+pihom(i,j)+pidw(i,j)
2623 physc(i,k,j) = avcp * sccc / d2t
2624 physe(i,k,j) = avcp * seee / d2t
2625 physd(i,k,j) = ascp * sddd / d2t
2626 physs(i,k,j) = ascp * ssss / d2t
2627 physm(i,k,j) = afcp * smmm / d2t
2628 physf(i,k,j) = afcp * sfff / d2t
2630 !JJS modified by JJS on 5/1/2007 ^^^^^
2636 !JJS ****************************************************************
2637 !JJS convert from GCE grid back to WRF grid
2641 ptwrf(i,k,j) = dpt(i,j,k)
2642 qvwrf(i,k,j) = dqv(i,j,k)
2643 qlwrf(i,k,j) = qcl(i,j,k)
2644 qrwrf(i,k,j) = qrn(i,j,k)
2645 qiwrf(i,k,j) = qci(i,j,k)
2646 qswrf(i,k,j) = qcs(i,j,k)
2647 qgwrf(i,k,j) = qcg(i,j,k)
2652 ! ****************************************************************
2655 END SUBROUTINE saticel_s
2658 !JJS REAL FUNCTION GAMMA(X)
2663 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2664 !JJS real function GAMMLN (xx)
2665 real function gammagce (xx)
2666 !**********************************************************************
2667 real*8 cof(6),stp,half,one,fpf,x,tmp,ser
2668 data cof,stp / 76.18009173,-86.50532033,24.01409822, &
2669 -1.231739516,.120858003e-2,-.536382e-5, 2.50662827465 /
2670 data half,one,fpf / .5, 1., 5.5 /
2674 tmp=(x+half)*log(tmp)-tmp
2680 gammln=tmp+log(stp*ser)
2682 gammagce=exp(gammln)
2685 END FUNCTION gammagce
2687 END MODULE module_mp_gsfcgce