3 USE machine
, ONLY : kind_phys
14 &CN0r0, CN0r_DMRmin, CN0r_DMRmax, CRACW, CRAUT, ESW0,
42 REAL,
PRIVATE,
DIMENSION(MDImin:MDImax) :: &
43 & ACCRI,MASSI,SDENS,VSNOWI,VENTI1,VENTI2
64 &, recimin=1.5*xmimin, resnowmin=1.5*
indexsmin, recwmin=10.
73 REAL,
PRIVATE,
DIMENSION(MDRmin:MDRmax):: &
74 & ACCRR,MASSR,RRATE,VRAIN,VENTR1,VENTR2
82 INTEGER,
PRIVATE,
PARAMETER ::
nrime=40
83 REAL,
DIMENSION(2:9,0:Nrime),
PRIVATE ::
vel_rf 91 REAL,
PRIVATE,
PARAMETER :: &
94 & t_ice=-40., t_ice_init=-15.
109 &, flg0p1=0.1, flg0p2=0.2, flg1p0=1.0
118 SUBROUTINE gsmconst (DTPG,mype,first)
161 REAL,
PARAMETER :: C1=1./3., dmr1=.1e-3, dmr2=.2e-3, dmr3=.32e-3,
164 INTEGER,
PARAMETER :: MDR1=xmr1, mdr2=xmr2, mdr3=xmr3
171 logical,
parameter :: read_lookup=.false., write_lookup=.false.
216 if ( read_lookup )
then 217 OPEN (unit=1,file=
"eta_micro_lookup.dat",form=
"UNFORMATTED")
235 if (write_lookup)
then 236 open(unit=1,file=
'micro_lookup.dat',form=
'unformatted')
259 cbfr=20.*pi*pi*bbfr*rhol*1.e-21
279 qautx=pi*rhol*1.0e6*(20.e-6)**3/6.
287 rr_drmin=n0r0*rrate(
mdrmin)
288 rr_dr1=n0r0*rrate(mdr1)
289 rr_dr2=n0r0*rrate(mdr2)
290 rr_dr3=n0r0*rrate(mdr3)
291 rr_drmax=n0r0*rrate(
mdrmax)
293 rqr_drmin=n0r0*massr(
mdrmin)
294 rqr_dr1=n0r0*massr(mdr1)
295 rqr_dr2=n0r0*massr(mdr2)
296 rqr_dr3=n0r0*massr(mdr3)
297 rqr_drmax=n0r0*massr(
mdrmax)
300 cn0r_dmrmin=1./(pi*rhol*
dmrmin**4)
301 cn0r_dmrmax=1./(pi*rhol*
dmrmax**4)
307 mic_step = max(1, int(dtpg/600.0+0.5))
310 if (mype == 0) print *,
' DTPG=',dtpg,
' mic_step=',
mic_step 324 ciacw=dtph*0.25*pi*0.1*(1.e5)**c1
338 cracw=dtph*0.25*pi*0.1
354 craut=1.-exp(-1.e-3*dtph)
379 sdens(i)=pi*1.0e-15*float(i*i*i)/massi(i)
412 & 2.e-6, 9.e-7, 8.8e-7, 8.2e-7, 9.4e-7,
413 & 1.2e-6, 1.85e-6, 5.5e-6, 1.5e-5, 1.7e-5,
414 & 1.5e-5, 1.e-5, 3.4e-6, 1.85e-6, 1.35e-6,
415 & 1.05e-6, 1.e-6, 9.5e-7, 9.0e-7 , 9.5e-7,
416 & 9.5e-7, 9.e-7, 9.e-7, 9.e-7, 9.e-7,
417 & 9.e-7, 9.e-7, 9.e-7, 9.e-7, 9.e-7 /
421 dt_ice=(dtph/600.)**1.5
463 real,
parameter :: DminI=.02e-3, dmaxi=20.e-3, ddeli=1.e-6,
465 integer,
parameter :: IDImin=ximin, idimax=ximax
474 real diam(idimin:idimax),mass(idimin:idimax),vel(idimin:idimax), &
475 & vent1(IDImin:IDImax),vent2(IDImin:IDImax)
484 real,
parameter :: d_crystal_max=1.5
491 real,
parameter :: xmax=20.
522 real,
parameter :: cvent1i=.86, cvent2i=.28
528 real,
parameter :: cvent1a=.65, cvent2a=.44
530 real m_agg,m_bullet,m_column,m_ice,m_plate
534 real,
parameter :: c1=2./3., cexp=1./3.
537 logical,
parameter :: print_diag=.false.
548 real,
parameter :: t_std=288., dens_std=1000.e2/(287.04*288.)
557 real,
parameter :: dens_crystal=850., dens_agg=600.
566 & rime_factor(0:Nrime), rime_vel(0:Nrime),
569 integer i, j, jj, k, icount
570 real c2, cbulk, cbulk_ice, px, dynvis_std, crime1 &
571 &, crime2, crime3, crime4, crime5, d, c_avg, c_agg
592 dynvis_std=1.496e-6*t_std**1.5/(t_std+120.)
594 crime2=8.*9.81*dens_std/(pi*dynvis_std**2)
595 crime3=crime1*dens_crystal
596 crime4=crime1*dens_agg
597 crime5=dynvis_std/dens_std
599 rime_factor(i)=1.1**i
616 write(7,
"(2a)")
'---- Increase in fall speeds of rimed ice',
617 ' particles as function of ice particle diameter ----' 619 if (icount == 60 .and. print_diag)
then 620 write(6,
"(/2a/3a)")
'Particle masses (mg), fall speeds ',
621 '(m/s), and ventilation factors',
622 ' D(mm) CR_mass Mass_bull Mass_col Mass_plat ',
623 ' Mass_agg CR_vel V_bul CR_col CR_pla Aggreg',
625 write(7,
"(3a)")
' <----------------------------------',
626 '--------------- Rime Factor --------------------------',
627 '--------------------------->' 628 write(7,
"(a,23f5.2)")
' D(mm)',(rime_factor(k), k=1,5),
632 d=(float(i)+.5)*1.e-3
650 if (d < d_crystal_max)
then 664 m_bullet=min(.044*d**3, m_ice)
665 m_column=min(.017*d**1.7, m_ice)
666 m_plate=min(.026*d**2.5, m_ice)
668 mass(i)=m_bullet+m_column+m_plate
675 v_column=8.114e-5*dx**1.585
676 v_bullet=5.666e-5*dx**1.663
678 else if (dx <= 400.)
then 679 v_column=4.995e-3*dx**.807
680 v_bullet=3.197e-3*dx**.902
681 v_plate=1.48e-3*dx**.926
682 else if (dx <= 600.)
then 683 v_column=2.223e-2*dx**.558
684 v_bullet=2.977e-2*dx**.529
686 else if (dx <= 800.)
then 687 v_column=4.352e-2*dx**.453
688 v_bullet=2.144e-2*dx**.581
689 v_plate=3.161e-3*dx**.812
691 v_column=3.833e-2*dx**.472
692 v_bullet=3.948e-2*dx**.489
693 v_plate=7.109e-3*dx**.691
704 vel(i)=(m_bullet*v_bullet+m_column*v_column+m_plate*v_plate)/
724 cl_bullet=.5*pi*wd*(.25*wd+d)/(d+wd)
731 ecc_plate=sqrt(1.-wd*wd/(d*d))
732 c_plate=d*ecc_plate/asin(ecc_plate)
745 ecc_column=sqrt(1.-wd*wd/(d*d))
746 c_column=ecc_column*d/log((1.+ecc_column)*d/wd)
748 cl_column=(wd+2.*d)/(c1+c2*d/wd)
753 c_bullet=.001*c_bullet
755 c_column=.001*c_column
756 cl_bullet=.001*cl_bullet
757 cl_plate=.001*cl_plate
758 cl_column=.001*cl_column
767 cvent1=1.0+.1*max(0., d-.05)/.15
773 vent1(i)=cvent1*(c_bullet+c_plate+c_column)/3.
774 vent2(i)=cvent2*(c_bullet*sqrt(v_bullet*cl_bullet)
789 m_agg=(.073*d**1.4+.037*d**1.9+.04*d**1.4)/3.
790 v_agg=(.8*d**.16+.69*d**.41+.82*d**.12)/3.
804 vent1(i)=cvent1a*c_agg
805 vent2(i)=cvent2a*c_agg*sqrt(v_agg*cl_agg)
811 vent1(i)=4.*pi*vent1(i)
812 vent2(i)=4.*pi*vent2(i)
814 mass(i)=1.e-6*mass(i)
820 rime_m1=rime_factor(k)*mass(i)
821 rime_m2=cbulk_ice*diam(i)**3
822 m_rime=min(rime_m1, rime_m2)
824 x_rime=crime2*m_rime*(crime_best/m_rime)**.25
826 re_rime=8.5*(sqrt(1.+.1519*sqrt(x_rime))-1.)**2
827 rime_vel(k)=crime5*re_rime/diam(i)
830 vel_rime(i,k)=rime_vel(k)/rime_vel(0)
838 if (mod(i,10) == 0) iprint=.true.
840 if (mod(i,100) == 0) iprint=.true.
843 write(6,
"(f7.4,5e11.4,1x,5f7.4,1x,2e11.4)")
847 write(7,
"(f7.4,23f5.2)") d,(vel_rime(i,k), k=1,5),
868 write(6,
"(/2a)")
'------------- Statistics as functions of ',
869 'mean particle diameter -------------' 870 write(7,
"(/2a)")
'------ Increase in fall speeds of rimed ice',
871 ' particles as functions of mean particle diameter -----' 874 if (icount == 60 .AND. print_diag)
then 875 write(6,
"(/2a)")
'D(mm) Vent1 Vent2 ',
876 'Accrete Mass Vel Dens ' 877 write(7,
"(3a)")
' <----------------------------------',
878 '--------------- Rime Factor --------------------------',
879 '--------------------------->' 880 write(7,
"(a,23f5.2)")
'D(mm)',(rime_factor(k), k=1,5),
884 mdiam=deldmi*float(j)
892 venti1(j)=venti1(j)+vent1(i)*expf
893 venti2(j)=venti2(j)+vent2(i)*expf
894 accri(j)=accri(j)+diam(i)*diam(i)*vel(i)*expf
897 rime_vel(k)=rime_vel(k)+xmass*vel_rime(i,k)
899 massi(j)=massi(j)+xmass
900 pratei=pratei+xmass*vel(i)
901 smom3=smom3+diam(i)**3*expf
911 ivel_rime(j,k)=rime_vel(k)/massi(j)
918 if (jj >= 2 .AND. jj <= 9)
then 923 bulk_dens=cbulk*massi(j)/smom3
924 venti1(j)=venti1(j)/mdiam
925 venti2(j)=venti2(j)/mdiam
926 accri(j)=accri(j)/mdiam
927 vsnowi(j)=pratei/massi(j)
928 massi(j)=massi(j)/mdiam
929 if (mod(j,10) == 0 .AND. print_diag)
then 931 write(6,
"(f6.3,4e11.4,f6.3,f8.3)") xmdiam,venti1(j),venti2(j),
933 write(7,
"(f6.3,23f5.2)") xmdiam,(ivel_rime(j,k), k=1,5),
943 write(7,
"(/2a)")
' ------- Increase in fall speeds of rimed ',
944 'ice particles at reduced, 0.1-mm intervals --------' 945 write(7,
"(3a)")
' <----------------------------------',
946 '--------------- Rime Factor --------------------------',
947 '--------------------------->' 948 write(7,
"(a,23f5.2)")
'D(mm)',(rime_factor(k), k=1,5),
956 if (print_diag)
write(7,
"(f4.1,2x,23f5.2)") 0.1*j,
977 real,
parameter :: DminR=.05e-3, dmaxr=10.e-3, ddelr=1.e-6,
979 integer,
parameter :: IDRmin=xrmin, idrmax=xrmax
980 real diam(idrmin:idrmax), vel(idrmin:idrmax)
989 logical,
parameter :: print_diag=.false.
991 real d, cmass, pi2, expf
999 diam(i)=float(i)*ddelr
1005 vel(i)=max(0., -.267+51.5*d-102.25*d*d+75.7*d**3)
1006 else if (d > 0.42 .and. d <= .58)
then 1010 vel(i)=8.92+.25/(.58-.42)*(d-.42)
1021 if (diam(i1) > .58e-2)
exit 1022 if (print_diag)
then 1024 write(6,
"('D(mm)-> ',10f7.3)") (1000.*diam(j), j=i1,i2,10)
1025 write(6,
"('V(m/s)-> ',10f7.3)") (vel(j), j=i1,i2,10)
1036 if (print_diag)
then 1037 write(6,
"(/'Diam - Mean diameter (mm)' & 1038 & /'VENTR1 - 1st ventilation coefficient (m**2)' & 1039 & /'VENTR2 - 2nd ventilation coefficient (m**3/s**.5)' & 1040 & /'ACCRR - accretion moment (m**4/s)' & 1041 & /'RHO*QR - mass content (kg/m**3) for N0r=8e6' & 1042 & /'RRATE - rain rate moment (m**5/s)' & 1043 & /'VR - mass-weighted rain fall speed (m/s)' & 1044 & /' Diam VENTR1 VENTR2 ACCRR ', & 1045 & 'RHO*QR RRATE VR')")
1048 mdiam=float(j)*deldmr
1054 expf=exp(-diam(i)/mdiam)*ddelr
1055 ventr2(j)=ventr2(j)+diam(i)**1.5*vel(i)**.5*expf
1056 accrr(j)=accrr(j)+diam(i)*diam(i)*vel(i)*expf
1057 massr(j)=massr(j)+diam(i)**3*expf
1058 rrate(j)=rrate(j)+diam(i)**3*vel(i)*expf
1066 ventr1(j)=.78*pi2*mdiam**2
1067 ventr2(j)=.31*pi2*ventr2(j)
1069 massr(j)=cmass*massr(j)
1070 rrate(j)=cmass*rrate(j)
1071 vrain(j)=rrate(j)/massr(j)
1072 if (print_diag)
write(6,
"(f6.3,5g12.5,f6.3)") 1000.*mdiam,
1131 SUBROUTINE gsmcolumn ( ARAING, ASNOWG, DTPG, I_index, J_index, &
1132 & lsfc, p_col, qi_col, qr_col, qv_col, qw_col, rimef_col, t_col,
1210 REAL ARAING, ASNOWG, P_col(lm), QI_col(lm), QR_col(lm), QV_col(lm)&
1211 &, QW_col(LM), RimeF_col(LM), T_col(LM), THICK_col(LM),
1215 INTEGER I_index, J_index, LSFC
1234 REAL,
PARAMETER :: DMImin=.05e-3,
dmimax=1.e-3, deldmi=1.e-6,
1236 INTEGER,
PARAMETER :: MDImin=xmimin,
mdimax=xmimax
1255 REAL,
PARAMETER :: RHOL=1000., xls=hvap+hfus
1265 &,climit=10.*epsq, rcp=1./cp,
1272 INTEGER,
PARAMETER :: MDR1=xmr1, mdr2=xmr2, mdr3=xmr3
1284 REAL,
PARAMETER :: BLEND=1.
1292 REAL EMAIRI, N0r, NLICE, NSmICE, NLImax, pfac
1293 LOGICAL CLEAR, ICE_logical, DBG_logical, RAIN_logical
1295 integer lbef, ipass, ixrf, ixs, itdx, idr &
1296 &, index_my, indexr, indexr1, indexs
1300 real flimass, xlimass, vsnow, qi_min, dum, piloss &
1301 &, tot_ice, xsimass, vel_inc, vrimef, rimef1, dum1
1339 qi_min_0c = 10.e3*massi(mdimin)
1352 IF (qv_col(l) > epsq .OR. wc_col(l) > epsq)
THEN 1380 esw = min(pp, fpvsl(tk))
1382 qsw = eps*esw/(pp+epsm1*esw)
1386 esi = min(pp,fpvsi(tk))
1388 qsi = eps*esi/(pp+epsm1*esi)
1390 if (pp <= esi) ws = wv / rhgrd
1394 qsw0 = eps*dum/(pp+epsm1*dum)
1407 IF (wv > wsgrd .OR. wc > epsq) clear = .false.
1408 IF (arain > climit)
THEN 1419 IF (asnow > climit)
THEN 1429 IF (.not. clear)
THEN 1439 rho = pp/(rd*tk*(1.+eps1*qv))
1442 bldtrh = blend*dtrho
1443 thick = thick_col(l)
1497 xlv = 3.148e6 - 2370*tk
1502 xlv2 = xlv*xlv*qsw_l*tk2/rv
1503 denomw = 1. + xlv2*rcp
1511 tfactor = tk*sqrt(tk)/(tk+120.)
1512 dynvis = 1.496e-6*tfactor
1513 therm_cond = 2.116e-3*tfactor
1514 diffus = 8.794e-5*tk**1.81/pp
1515 schmit_fac = (rho/(diffus*diffus*dynvis))**c2
1520 gammas = (1.e5/pp)**c1
1524 gammar = (rho0/rho)**0.4
1532 IF (tc < 0. .OR. qi > epsq .OR. asnow > climit)
THEN 1533 ice_logical = .true.
1535 ice_logical = .false.
1542 rain_logical = .false.
1543 IF (arain > climit .OR. qr > epsq) rain_logical = .true.
1545 IF (ice_logical)
THEN 1603 IF (qi <= epsq .AND. asnow <= climit)
THEN 1607 xsimass = rrho*massi(mdimin)
1615 xlimass = rrho*rimef1*massi(indexs)
1616 flimass = xlimass/(xlimass+xsimass)
1632 dum = max(0.05, min(1., exp(.0564*tc)) )
1633 indexs = min(
mdimax, max(mdimin, int(xmimax*dum) ) )
1635 dum = max(flgmin*pfac, dum)
1637 qi_min = qi_min_0c * dum
1641 nlimax = 10.e3/sqrt(dum)
1647 fsmall = (1.-flarge)/flarge
1648 xsimass = rrho*massi(mdimin)*fsmall
1649 tot_ice = thick*qi + blend*asnow
1650 piloss = -tot_ice/thick
1652 rimef1 = (rimef_col(l)*thick*qi
1657 IF (rimef1 .LE. 1.)
THEN 1661 ixs = max(2, min(indexs/100, 9))
1662 xrf = 10.492*log(rimef1)
1663 ixrf = max(0, min(int(xrf),
nrime))
1664 IF (ixrf .GE.
nrime)
THEN 1667 vrimef =
vel_rf(ixs,ixrf)+(xrf-float(ixrf))*
1671 vel_inc = gammas*vrimef
1672 vsnow = vel_inc*vsnowi(indexs)
1673 emairi = thick + bldtrh*vsnow
1674 xlimass = rrho*rimef1*massi(indexs)
1675 flimass = xlimass/(xlimass+xsimass)
1676 qtice = tot_ice/emairi
1677 qlice = flimass*qtice
1678 nlice = qlice/xlimass
1679 nsmice = fsmall*nlice
1681 IF ( (nlice >= nlimin .AND. nlice <= nlimax)
1686 xli = rho*(qtice/dum-xsimass)/rimef1
1687 IF (xli <= massi(mdimin) )
THEN 1689 ELSE IF (xli <= massi(450) )
THEN 1690 dli = 9.5885e5*xli**.42066
1691 indexs = min(
mdimax, max(mdimin, int(dli) ) )
1692 ELSE IF (xli <= massi(
mdimax) )
THEN 1693 dli = 3.9751e6*xli**.49870
1694 indexs = min(
mdimax, max(mdimin, int(dli) ) )
1711 dum = max(nlimin, min(nlimax, nlice) )
1712 IF (dum >= nlimax .AND. indexs >=
mdimax)
1731 IF (qw > epsq .AND. tc >= t_ice)
THEN 1739 qw0 = qautx*rrho*xncw(l)
1740 praut = max(0., qw-qw0)*craut
1741 IF (qlice > epsq)
THEN 1747 fws = min(0.1,
ciacw*vel_inc*nlice*accri(indexs)
1750 IF (tc < 0.) piacwi = piacw
1759 IF (ice_logical)
THEN 1763 IF (tc < t_ice .AND. (wv > qsigrd .OR. qw > epsq))
THEN 1772 dum1 = tk + xlv1*pcond
1774 dum = min(pp,fpvsi(dum1))
1775 dum = rhgrd*eps*dum/(pp+epsm1*dum)
1778 IF (dum2 > dum) pidep =
deposit(pp, rhgrd, dum1, dum2)
1782 ELSE IF (tc < 0.)
THEN 1787 denomi = 1. + xls2*qsi_l*tk2
1788 dwvi = min(wvqw,qsw_l)-qsi_l
1789 pidep_max = max(piloss, dwvi/denomi)
1790 IF (qtice > 0.)
THEN 1800 sfactor = sqrt(vel_inc)*schmit_fac
1801 abi = 1./(rho*xls3*qsi*tk2/therm_cond+1./diffus)
1809 ventil = (venti1(indexs) + sfactor*venti2(indexs))
1817 IF (didep >= xratio)
1820 pidep = min(dwvi*didep, pidep_max)
1821 ELSE IF (dwvi < 0.)
THEN 1822 pidep = max(dwvi*didep, pidep_max)
1825 ELSE IF (wvqw > qsi_l .AND. tc <= t_ice_init)
THEN 1833 index_my = max(
my_t1, min( int(.5-tc),
my_t2 ) )
1844 dum2 = 1.e3*exp(12.96*dum1-0.639)
1845 pidep = min(pidep_max,dum2*
my_growth(index_my)*rrho)
1859 IF (tc >= t_ice .AND. (qw > epsq .OR. wv > qswgrd))
THEN 1860 IF (piacwi == 0. .AND. pidep == 0.)
THEN 1861 pcond =
condense(pp, qw, rhgrd, tk, wv)
1863 dum = xlv*qswgrd*rcprv*tk2
1864 denomwi = 1. + xls*dum
1866 dum = max(0., pidep)
1867 pcond = (wv-qswgrd-denomwi*dum-denomf*piacwi)/denomw
1869 dum2 = pcond - piacw
1870 IF (dum2 < dum1)
THEN 1882 tcc = tc + xlv1*pcond + xls1*pidep + xlf1*piacwi
1885 tcc = tc + xlv1*pcond + xls1*pidep
1888 IF (tc > 0. .AND. tcc > 0. .AND. ice_logical)
THEN 1896 sfactor = sqrt(vel_inc)*schmit_fac
1897 ventil = nlice*(venti1(indexs)+sfactor*venti2(indexs))
1898 aievp = ventil*diffus*dtph
1899 IF (aievp < xratio)
THEN 1902 dievp = 1. - exp(-aievp)
1909 dwv0 = min(wv,qsw_l)-qsw0_l
1911 IF (wv < qsw_l .AND. dum <= epsq)
THEN 1917 pievp = max( min(0., dum), piloss)
1918 picnd = max(0., dum)
1920 pimlt = therm_cond*tcc*ventil*rrho*dtph/xlf
1924 dum1 = max( 0., (tcc+xlv1*pievp)/xlf1 )
1925 pimlt = min(pimlt, dum1)
1930 IF (dum < piloss)
THEN 1958 IF (rain_logical)
THEN 1959 IF (arain <= 0.)
THEN 1969 rr = arain / (dtph*gammar)
1971 IF (rr <= rr_drmin)
THEN 1977 ELSE IF (rr <= rr_dr1)
THEN 1986 indexr = int( 1.123e3*rr**.1947 + .5 )
1987 indexr = max(
mdrmin, min(indexr, mdr1) )
1989 ELSE IF (rr <= rr_dr2)
THEN 1998 indexr = int( 1.225e3*rr**.2017 + .5 )
1999 indexr = max( mdr1, min(indexr, mdr2) )
2001 ELSE IF (rr <= rr_dr3)
THEN 2010 indexr = int( 1.3006e3*rr**.2083 + .5 )
2011 indexr = max( mdr2, min(indexr, mdr3) )
2013 ELSE IF (rr <= rr_drmax)
THEN 2022 indexr = int( 1.355e3*rr**.2144 + .5 )
2023 indexr = max( mdr3, min(indexr,
mdrmax) )
2032 vrain1 = gammar*vrain(indexr)
2036 tot_rain = thick*qr+blend*arain
2037 qtrain = tot_rain/(thick+bldtrh*vrain1)
2038 prloss = -tot_rain/thick
2043 IF (rqr <= rqr_drmin)
THEN 2044 n0r = max(n0rmin, cn0r_dmrmin*rqr)
2046 ELSE IF (rqr >= rqr_drmax)
THEN 2047 n0r = cn0r_dmrmax*rqr
2052 item = cn0r0*sqrt(sqrt(rqr))
2056 IF (tc < t_ice)
THEN 2059 dwvr = wv - pcond - qsw_l
2061 IF (dwvr < 0. .AND. dum <= epsq)
THEN 2073 rfactor = sqrt(gammar)*schmit_fac
2074 abw = 1./(rho*xlv2/therm_cond+1./diffus)
2079 ventr = n0r*(ventr1(indexr)+rfactor*ventr2(indexr))
2080 crevp = abw*ventr*dtph
2081 IF (crevp < xratio)
THEN 2084 dum = dwvr*(1.-exp(-crevp*denomw))/denomw
2086 prevp = max(dum, prloss)
2087 ELSE IF (qw > epsq)
THEN 2088 fwr = cracw*gammar*n0r*accrr(indexr)
2090 pracw = min(0.1,fwr)*qw
2093 IF (tc < 0. .AND. tcc < 0.)
THEN 2098 dum = .001*float(indexr)
2100 dum = (exp(
abfr*tc)-1.)*dum1*dum1*dum1*dum
2101 piacr = min(
cbfr*n0r*rrho*dum, qtrain)
2102 IF (qlice > epsq)
THEN 2106 dum = gammar*vrain(indexr)
2113 dum2 = (dum1*dum1+.04*dum*vsnow)**.5
2114 dum1 = 5.e-12*indexr*indexr+2.e-12*indexr*indexs
2120 piacr = min(piacr+fir*qtrain, qtrain)
2123 If (dum < prloss)
THEN 2143 dum1 = piacw + praut + pracw - min(0.,pcond)
2150 IF (pcond < 0.) pcond=dum*pcond
2152 piacwr = piacw - piacwi
2156 delw = pcond - piacw - praut - pracw
2158 IF (qwnew <= epsq) qwnew = 0.
2159 IF (qw > 0. .AND. qwnew /= 0.)
THEN 2161 IF (dum <
toler) qwnew = 0.
2166 delt = xlv1 * (pcond+pievp+picnd+prevp)
2170 delv = -pcond - pidep - pievp - picnd - prevp
2190 IF (ice_logical)
THEN 2191 deli = pidep + pievp + piacwi + piacr - pimlt
2192 tot_icenew = tot_ice + thick*deli
2193 IF (tot_ice > 0. .AND. tot_icenew /= 0.)
THEN 2194 dum = tot_icenew/tot_ice
2195 IF (dum <
toler) tot_icenew = 0.
2197 IF (tot_icenew <= climit)
THEN 2206 dum = piacwi + piacr
2207 IF (dum <= epsq .AND. pidep <= epsq)
THEN 2215 dum1 = tot_ice + thick*(pidep+dum)
2216 dum2 = tot_ice/rimef1 + thick*pidep
2217 IF (dum2 <= 0.)
THEN 2220 rimef = min(rfmax, max(1., dum1/dum2) )
2223 qinew = tot_icenew/(thick+bldtrh*flimass*vsnow)
2224 IF (qinew <= epsq) qinew = 0.
2225 IF (qi > 0. .AND. qinew /= 0.)
THEN 2227 IF (dum <
toler) qinew = 0.
2229 asnownew = bldtrh*flimass*vsnow*qinew
2230 IF (asnow > 0. .AND. asnownew /= 0.)
THEN 2231 dum = asnownew/asnow
2232 IF (dum <
toler) asnownew = 0.
2249 delr = praut + pracw + piacwr - piacr + pimlt
2252 IF (tot_rain > 0. .AND. tot_rainnew /= 0.)
THEN 2253 dum = tot_rainnew/tot_rain
2254 IF (dum <
toler) tot_rainnew = 0.
2256 IF (tot_rainnew <= climit)
THEN 2265 rr = tot_rainnew/(dtph*gammar)
2274 IF (rr <= rr_drmin)
THEN 2276 ELSE IF (rr <= rr_dr1)
THEN 2277 idr = int( 1.123e3*rr**.1947 + .5 )
2278 idr = max(
mdrmin, min(idr, mdr1) )
2279 ELSE IF (rr <= rr_dr2)
THEN 2280 idr = int( 1.225e3*rr**.2017 + .5 )
2281 idr = max( mdr1, min(idr, mdr2) )
2282 ELSE IF (rr <= rr_dr3)
THEN 2283 idr = int( 1.3006e3*rr**.2083 + .5 )
2284 idr = max( mdr2, min(idr, mdr3) )
2285 ELSE IF (rr <= rr_drmax)
THEN 2286 idr = int( 1.355e3*rr**.2144 + .5 )
2287 idr = max( mdr3, min(idr,
mdrmax) )
2291 vrain2 = gammar*vrain(idr)
2292 qrnew = tot_rainnew / (thick+bldtrh*vrain2)
2293 IF (qrnew <= epsq) qrnew = 0.
2294 IF (qr > 0. .AND. qrnew /= 0.)
THEN 2296 IF (dum <
toler) qrnew = 0.
2298 arainnew = bldtrh*vrain2*qrnew
2299 IF (arain > 0. .AND. arainnew /= 0.)
THEN 2300 dum = arainnew/arain
2301 IF (dum <
toler) arainnew = 0.
2305 wcnew = qwnew + qrnew + qinew
2317 qt = thick*(wv+wc) + arain + asnow
2318 qtnew = thick*(wvnew+wcnew) + arainnew + asnownew
2336 IF ((wvnew < epsq .OR. dbg_logical) .AND. print_diag)
THEN 2338 WRITE(6,
"(/2(a,i4),2(a,i2))")
'{} i=',i_index,
' j=',
2339 ' L=',l,
' LSFC=',lsfc
2341 esw = min(pp, fpvsl(tnew))
2343 qswnew = eps*esw/(pp+epsm1*esw)
2344 IF (tc < 0. .OR. tnew < 0.)
THEN 2345 esi = min(pp, fpvsi(tnew))
2347 qsinew = eps*esi/(pp+epsm1*esi)
2353 WRITE(6,
"(4(a12,g11.4,1x))")
2354 '{} TCold=',tc,
'TCnew=',tnew-t0c,
'P=',.01*pp,
'RHO=',rho,
2355 '{} THICK=',thick,
'RHold=',wv/ws,
'RHnew=',wvnew/wsnew,
2357 '{} RHWold=',wv/qsw,
'RHWnew=',wvnew/qswnew,
'RHIold=',wv/qsi,
2358 'RHInew=',wvnew/qsinew,
2359 '{} QSWold=',qsw,
'QSWnew=',qswnew,
'QSIold=',qsi,
'QSInew=',qsinew,
2360 '{} WSold=',ws,
'WSnew=',wsnew,
'WVold=',wv,
'WVnew=',wvnew,
2361 '{} WCold=',wc,
'WCnew=',wcnew,
'QWold=',qw,
'QWnew=',qwnew,
2362 '{} QIold=',qi,
'QInew=',qinew,
'QRold=',qr,
'QRnew=',qrnew,
2363 '{} ARAINold=',arain,
'ARAINnew=',arainnew,
'ASNOWold=',asnow,
2364 'ASNOWnew=',asnownew,
2365 '{} TOT_RAIN=',tot_rain,
'TOT_RAINnew=',tot_rainnew,
2366 'TOT_ICE=',tot_ice,
'TOT_ICEnew=',tot_icenew,
2367 '{} BUDGET=',budget,
'QTold=',qt,
'QTnew=',qtnew
2369 WRITE(6,
"(4(a12,g11.4,1x))")
2370 '{} DELT=',delt,
'DELV=',delv,
'DELW=',delw,
'DELI=',deli,
2371 '{} DELR=',delr,
'PCOND=',pcond,
'PIDEP=',pidep,
'PIEVP=',pievp,
2372 '{} PICND=',picnd,
'PREVP=',prevp,
'PRAUT=',praut,
'PRACW=',pracw,
2373 '{} PIACW=',piacw,
'PIACWI=',piacwi,
'PIACWR=',piacwr,
'PIMLT=',
2377 IF (ice_logical)
WRITE(6,
"(4(a12,g11.4,1x))")
2378 '{} RimeF1=',rimef1,
'GAMMAS=',gammas,
'VrimeF=',vrimef,
2380 '{} INDEXS=',float(indexs),
'FLARGE=',flarge,
'FSMALL=',fsmall,
2382 '{} XSIMASS=',xsimass,
'XLIMASS=',xlimass,
'QLICE=',qlice,
2384 '{} NLICE=',nlice,
'NSmICE=',nsmice,
'PILOSS=',piloss,
2388 IF (tot_rain > 0. .OR. tot_rainnew > 0.)
2389 WRITE(6,
"(4(a12,g11.4,1x))")
2390 '{} INDEXR1=',float(indexr1),
'INDEXR=',float(indexr),
2391 'GAMMAR=',gammar,
'N0r=',n0r,
2392 '{} VRAIN1=',vrain1,
'VRAIN2=',vrain2,
'QTRAIN=',qtrain,
'RQR=',rqr,
2393 '{} PRLOSS=',prloss,
'VOLR1=',thick+bldtrh*vrain1,
2394 'VOLR2=',thick+bldtrh*vrain2
2396 IF (praut > 0.)
WRITE(6,
"(a12,g11.4,1x)")
'{} QW0=',qw0
2398 IF (pracw > 0.)
WRITE(6,
"(a12,g11.4,1x)")
'{} FWR=',fwr
2400 IF (piacr > 0.)
WRITE(6,
"(a12,g11.4,1x)")
'{} FIR=',fir
2402 dum = pimlt + picnd - prevp - pievp
2403 IF (dum > 0. .or. dwvi /= 0.)
2404 WRITE(6,
"(4(a12,g11.4,1x))")
2405 '{} TFACTOR=',tfactor,
'DYNVIS=',dynvis,
2406 'THERM_CON=',therm_cond,
'DIFFUS=',diffus
2408 IF (prevp < 0.)
WRITE(6,
"(4(a12,g11.4,1x))")
2409 '{} RFACTOR=',rfactor,
'ABW=',abw,
'VENTR=',ventr,
'CREVP=',crevp,
2410 '{} DWVr=',dwvr,
'DENOMW=',denomw
2412 IF (pidep /= 0. .AND. dwvi /= 0.)
2413 WRITE(6,
"(4(a12,g11.4,1x))")
2414 '{} DWVi=',dwvi,
'DENOMI=',denomi,
'PIDEP_max=',pidep_max,
2416 '{} ABI=',abi,
'VENTIL=',ventil,
'VENTIL1=',venti1(indexs),
2417 'VENTIL2=',sfactor*venti2(indexs),
2418 '{} VENTIS=',ventis,
'DIDEP=',didep
2420 IF (pidep > 0. .AND. pcond /= 0.)
2421 WRITE(6,
"(4(a12,g11.4,1x))")
2422 '{} DENOMW=',denomw,
'DENOMWI=',denomwi,
'DENOMF=',denomf,
2425 IF (fws > 0.)
WRITE(6,
"(4(a12,g11.4,1x))")
'{} FWS=',fws
2427 dum = pimlt + picnd - pievp
2428 IF (dum > 0.)
WRITE(6,
"(4(a12,g11.4,1x))")
2429 '{} SFACTOR=',sfactor,
'VENTIL=',ventil,
'VENTIL1=',venti1(indexs),
2430 'VENTIL2=',sfactor*venti2(indexs),
2431 '{} AIEVP=',aievp,
'DIEVP=',dievp,
'QSW0=',qsw0,
'DWV0=',dwv0
2439 IF (print_diag)
THEN 2440 itdx = max(
itlo, min( int(tnew-t0c),
ithi ) )
2442 IF (qinew > epsq .AND. qrnew+qwnew > epsq)
2447 qmax(itdx,1) = max(
qmax(itdx,1), qinew)
2448 qmax(itdx,2) = max(
qmax(itdx,2), qwnew)
2449 qmax(itdx,3) = max(
qmax(itdx,3), qrnew)
2450 qmax(itdx,4) = max(
qmax(itdx,4), asnownew)
2451 qmax(itdx,5) = max(
qmax(itdx,5), arainnew)
2452 qtot(itdx,1) =
qtot(itdx,1)+qinew*thick
2453 qtot(itdx,2) =
qtot(itdx,2)+qwnew*thick
2454 qtot(itdx,3) =
qtot(itdx,3)+qrnew*thick
2456 qtot(itdx,4) =
qtot(itdx,4)+pcond*thick
2457 qtot(itdx,5) =
qtot(itdx,5)+picnd*thick
2458 qtot(itdx,6) =
qtot(itdx,6)+pievp*thick
2459 qtot(itdx,7) =
qtot(itdx,7)+pidep*thick
2460 qtot(itdx,8) =
qtot(itdx,8)+prevp*thick
2461 qtot(itdx,9) =
qtot(itdx,9)+praut*thick
2462 qtot(itdx,10) =
qtot(itdx,10)+pracw*thick
2463 qtot(itdx,11) =
qtot(itdx,11)+pimlt*thick
2464 qtot(itdx,12) =
qtot(itdx,12)+piacw*thick
2465 qtot(itdx,13) =
qtot(itdx,13)+piacwi*thick
2466 qtot(itdx,14) =
qtot(itdx,14)+piacwr*thick
2467 qtot(itdx,15) =
qtot(itdx,15)+piacr*thick
2469 qtot(itdx,16) =
qtot(itdx,16)+(wvnew-wv)*thick
2470 qtot(itdx,17) =
qtot(itdx,17)+(qwnew-qw)*thick
2471 qtot(itdx,18) =
qtot(itdx,18)+(qinew-qi)*thick
2472 qtot(itdx,19) =
qtot(itdx,19)+(qrnew-qr)*thick
2473 qtot(itdx,20) =
qtot(itdx,20)+(arainnew-arain)
2474 qtot(itdx,21) =
qtot(itdx,21)+(asnownew-asnow)
2487 qv_col(l) = max(0.0, wvnew )
2488 wc_col(l) = max(0.0, wcnew)
2489 qi_col(l) = max(0.0, qinew)
2490 qr_col(l) = max(0.0, qrnew)
2491 qw_col(l) = max(0.0, qwnew)
2492 rimef_col(l) = rimef
2503 araing = araing + arain
2504 asnowg = asnowg + asnow
2520 REAL FUNCTION condense (PP, QW, RHgrd, TK, WV)
2530 real pp, qw, rhgrd, tk, wv
2531 INTEGER,
PARAMETER :: HIGH_PRES=kind_phys
2533 REAL (KIND=HIGH_PRES),
PARAMETER :: &
2534 & RHLIMIT=.001, RHLIMIT1=-RHLIMIT
2535 REAL,
PARAMETER :: RCP=1./cp, rcprv=rcp/rv
2536 REAL (KIND=HIGH_PRES) :: COND, SSAT, WCdum, tsq
2537 real wvdum, tdum, xlv, xlv1, xlv2, ws, dwv, esw, rfac
2550 esw = min(pp, fpvsl(tdum))
2552 ws = rhgrd*eps*esw/(pp+epsm1*esw)
2557 DO WHILE ((ssat < rhlimit1 .AND. wcdum > epsq)
2560 xlv = 3.148e6-2370.*tdum
2562 xlv2 = xlv*xlv*rcprv
2566 cond = rfac*dwv*tsq/(tsq+xlv2*ws)
2568 cond = max(cond, -wcdum)
2569 tdum = tdum+xlv1*cond
2573 esw = min(pp, fpvsl(tdum))
2575 ws = rhgrd*eps*esw/(pp+epsm1*esw)
2587 REAL FUNCTION deposit (PP, RHgrd, Tdum, WVdum)
2594 REAL PP, RHgrd, Tdum, WVdum
2595 INTEGER,
PARAMETER :: HIGH_PRES=kind_phys
2597 REAL (KIND=HIGH_PRES),
PARAMETER :: RHLIMIT=.001, &
2599 PARAMETER :: rcp=1./cp, rcprv=rcp/rv, xls=hvap+hfus
2601 REAL (KIND=HIGH_PRES) :: DEP, SSAT
2606 esi=min(pp, fpvsi(tdum))
2608 ws=rhgrd*eps*esi/(pp+epsm1*esi)
2612 DO WHILE (ssat > rhlimit .OR. ssat < rhlimit1)
2618 dep=dwv/(1.+xls2*ws/(tdum*tdum))
2622 esi=min(pp, fpvsi(tdum))
2624 ws=rhgrd*eps*esi/(pp+epsm1*esi)
2633 SUBROUTINE rsipath(im, ix, ix2, levs, prsl, prsi, t, q, clw &
2634 &, f_ice, f_rain, f_rime, flgmin
2641 integer im, ix, ix2, levs, ipr
2642 real prsl(ix,levs), prsi(ix,levs+1), t(ix,levs), q(ix,levs) &
2643 &, clw(ix2,levs), f_ice(ix2,levs), f_rain(ix2,levs)
2649 real frice, frrain, qcice, qcwat, qrain, qsnow, qtot, sden &
2650 &, cpath, rho, dsnow, flarge, rimef, xsimass, nlice
2654 real,
parameter :: cexp=1./3.
2655 integer i, l, indexs
2659 recw1 = 620.3505 /
tnw**cexp
2669 recwat(i,l) = recwmin
2671 resnow(i,l) = resnowmin
2686 pp = prsl(i,l) / prsi(i,levs+1)
2699 IF (qtot > epsq)
THEN 2704 frice = max(0.0, min(1.0, f_ice(i,l)))
2705 frrain = max(0.0, min(1.0, f_rain(i,l)))
2709 qcice = frice * qtot
2710 qcwat = qtot - qcice
2711 qrain = frrain * qcwat
2712 qcwat = qcwat - qrain
2717 rho = prsl(i,l)/(rd*t(i,l)*(1.+eps1*q(i,l)))
2718 cpath = (prsi(i,l+1)-prsi(i,l))*(1000000.0/grav)
2726 recwat(i,l) = max(recwmin, recw1*(rho*qcwat)**cexp)
2727 cwatp(i,l) = cpath*qcwat
2740 drain = cn0r0*sqrt(sqrt((rho*qrain)))
2741 rerain(i,l) = 1.5*max(xmrmin, min(drain, xmrmax))
2742 rainp(i,l) = cpath*qrain
2764 dum=max(0.05, min(1., exp(.0564*tc)) )
2768 dum=max(flgmin*pfac, dum)
2772 nlimax=10.e3/sqrt(dum)
2819 rimef=max(1., f_rime(i,l))
2820 xsimass=massi(
mdimin)*(1.-flarge)/flarge
2823 nlice=rho*qcice/(xsimass+rimef*massi(indexs))
2832 nlice=max(nlimin, nlice)
2833 ELSEIF (nlice > nlimax)
THEN 2837 xli=(rho*qcice/nlimax-xsimass)/rimef
2839 IF(xli <= massi(450) )
THEN 2840 dsnow=9.5885e5*xli**.42066
2842 dsnow=3.9751e6*xli**.49870
2845 indexs=min(
mdimax, max(indexs, int(dsnow)))
2846 nlice=rho*qcice/(xsimass+rimef*massi(indexs))
2859 if (prsi(i,levs+1)-prsi(i,l) < 40.0
2869 qsnow = min(qcice, nlice*rimef*massi(indexs)/rho)
2873 qcice = max(0., qcice-qsnow)
2875 cicep(i,l) = cpath*qcice
2876 resnow(i,l) = 1.5*float(indexs)
2877 sden = sdens(indexs)/rimef
2878 snowp(i,l) = cpath*qsnow*sden
2930 & ( plyr, plvl, tlyr, qlyr, qcwat, qcice, qrain, rrime,
2933 & cwatp, cicep, rainp, snowp, recwat, rerain, resnow, snden
2990 real,
parameter :: CEXP= 1.0/3.0
2993 real,
dimension(:,:),
intent(in) :: &
2994 & plyr, plvl, tlyr, qlyr, qcwat, qcice, qrain, rrime
2996 integer,
intent(in) :: IM, LEVS, iflip
2997 real,
dimension(:),
intent(in) :: flgmin
3001 real,
dimension(:,:),
intent(out) :: &
3002 & cwatp, cicep, rainp, snowp, recwat, rerain, resnow, snden
3007 real :: recw1, dsnow, qsnow, qqcice, flarge, xsimass, pfac, &
3008 & nlice, xli, nlimax, dum, tem,
3011 integer :: i, k, indexs, ksfc, k1
3015 recw1 = 620.3505 /
tnw**cexp
3026 recwat(i,k) = recwmin
3028 resnow(i,k) = resnowmin
3037 if (iflip == 0)
then 3047 totcnd = qcwat(i,k) + qcice(i,k) + qrain(i,k)
3049 if(totcnd > epsq)
then 3053 rho = 0.1 * plyr(i,k)
3065 if (qcwat(i,k) > 0.0)
then 3066 recwat(i,k) = max(recwmin,recw1*(rho*qcwat(i,k))**cexp)
3067 cwatp(i,k) = cpath * qcwat(i,k)
3081 if (qrain(i,k) > 0.0)
then 3082 tem = cn0r0 * sqrt(sqrt(rho*qrain(i,k)))
3083 rerain(i,k) = 1.5 * max(xmrmin, min(xmrmax, tem))
3084 rainp(i,k) = cpath * qrain(i,k)
3099 if (qcice(i,k) > 0.0)
then 3113 dum = max(0.05, min(1.0, exp(0.0564*tc) ))
3115 dum=max(flgmin(i)*pfac, dum)
3153 xsimass = massi(
mdimin) * (1.0 - flarge) / flarge
3156 nlimax=10.e3/sqrt(dum)
3168 tem = rho * qcice(i,k)
3169 nlice = tem / (xsimass +rrime(i,k)*massi(indexs))
3179 nlice = max(nlimin, nlice)
3181 elseif (nlice > nlimax)
then 3185 xli = (tem/nlimax - xsimass) / rrime(i,k)
3187 if (xli <= massi(450) )
then 3188 dsnow = 9.5885e5 * xli**0.42066
3190 dsnow = 3.9751e6 * xli** 0.49870
3193 indexs = min(
mdimax, max(indexs, int(dsnow)))
3194 nlice = tem / (xsimass + rrime(i,k)*massi(indexs))
3203 if (plvl(i,ksfc) > 850.0 .and.
3205 & plvl(i,k+k1) > 700.0 .and. indexs >=
indexsmin)
then 3210 qsnow = min( qcice(i,k),
3214 qqcice = max(0.0, qcice(i,k)-qsnow)
3215 cicep(i,k) = cpath * qqcice
3216 resnow(i,k) = 1.5 * float(indexs)
3217 snden(i,k) = sdens(indexs) / rrime(i,k)
3218 snowp(i,k) = cpath*qsnow
real, parameter, private rerainmin
real, parameter, private dmimax
real function condense(PP, QW, RHgrd, TK, WV)
integer, dimension(itlo:ithi, 4) nstats
subroutine rsipath2
This subroutine is a modified version of ferrier's original "rsipath" subprogram. It computes layer's...
integer, private mic_step
real(kind=kind_phys), parameter con_t0c
temp at 0C (K)
real(kind=kind_phys), parameter con_hfus
lat heat H2O fusion (J/kg)
real(kind=kind_phys), parameter con_hvap
lat heat H2O cond (J/kg)
integer, parameter, private nrime
real, parameter, private tnw
This module contains some the most frequently used math and physics constants for gcm models...
real function deposit(PP, RHgrd, Tdum, WVdum)
real, dimension(2:9, 0:nrime), private vel_rf
subroutine rsipath(im, ix, ix2, levs, prsl, prsi, t, q, clw
real, dimension(itlo:ithi, 5) qmax
real, parameter, private thom
subroutine my_growth_rates(DTPH)
integer, parameter, private mdimin
integer, parameter, private my_t2
real(kind=kind_phys), parameter con_rd
gas constant air (J/kg/K)
real, parameter, private dmrmax
subroutine gsmconst(DTPG, mype, first)
integer, parameter, private indexsmin
real, dimension(itlo:ithi, 22) qtot
integer, parameter, private my_t1
subroutine gsmcolumn(ARAING, ASNOWG, DTPG, I_index, J_index,
integer, parameter, private mdrmin
real, parameter, private dmrmin
real(kind=kind_phys), parameter con_rv
gas constant H2O (J/kg/K)
real(kind=kind_phys), parameter con_g
gravity (m/s2)
real(kind=kind_phys), parameter con_pi
integer, parameter, private mdrmax
real, parameter, private dmimin
real, dimension(my_t1:my_t2), private my_growth
integer, parameter, private mdimax
real(kind=kind_phys), parameter con_cp
spec heat air at p (J/kg/K)
real, parameter, private toler
real(kind=kind_phys), parameter con_fvirt
real(kind=kind_phys), parameter con_epsm1
real(kind=kind_phys), parameter con_eps