428 subroutine ice_lookup
458 real,
parameter :: DminI=.02e-3, dmaxi=20.e-3, ddeli=1.e-6, &
459 & ximin=1.e6*dmini, ximax=1.e6*dmaxi
460 integer,
parameter :: IDImin=ximin, idimax=ximax
469 real diam(IDImin:IDImax),mass(IDImin:IDImax),vel(IDImin:IDImax), &
470 & vent1(IDImin:IDImax),vent2(IDImin:IDImax)
479 real,
parameter :: d_crystal_max=1.5
486 real,
parameter :: xmax=20.
517 real,
parameter :: cvent1i=.86, cvent2i=.28
523 real,
parameter :: cvent1a=.65, cvent2a=.44
525 real m_agg,m_bullet,m_column,m_ice,m_plate
529 real,
parameter :: c1=2./3., cexp=1./3.
532 logical,
parameter :: print_diag=.false.
543 real,
parameter :: t_std=288., dens_std=1000.e2/(287.04*288.)
552 real,
parameter :: dens_crystal=850., dens_agg=600.
561 & rime_factor(0:Nrime), rime_vel(0:Nrime), &
562 & vel_rime(IDImin:IDImax,Nrime), ivel_rime(MDImin:MDImax,Nrime)
564 integer i, j, jj, k, icount
565 real c2, cbulk, cbulk_ice, px, dynvis_std, crime1 &
566 &, crime2, crime3, crime4, crime5, d, c_avg, c_agg &
567 &, c_bullet, c_column, c_plate, cl_agg, cl_bullet &
568 &, cl_column, cl_plate, v_agg, v_bullet, v_column &
569 &, v_plate, wd, ecc_column &
570 &, cvent1, cvent2, crime_best, rime_m1, rime_m2 &
571 &, x_rime, re_rime, smom3, pratei, expf &
572 &, bulk_dens, xmass, xmdiam, ecc_plate, dx
587 dynvis_std=1.496e-6*t_std**1.5/(t_std+120.)
589 crime2=8.*9.81*dens_std/(pi*dynvis_std**2)
590 crime3=crime1*dens_crystal
591 crime4=crime1*dens_agg
592 crime5=dynvis_std/dens_std
594 rime_factor(i)=1.1**i
611 &
write(7,
"(2a)")
'---- Increase in fall speeds of rimed ice', &
612 &
' particles as function of ice particle diameter ----'
614 if (icount == 60 .and. print_diag)
then
615 write(6,
"(/2a/3a)")
'Particle masses (mg), fall speeds ', &
616 &
'(m/s), and ventilation factors', &
617 &
' D(mm) CR_mass Mass_bull Mass_col Mass_plat ', &
618 &
' Mass_agg CR_vel V_bul CR_col CR_pla Aggreg', &
620 write(7,
"(3a)")
' <----------------------------------',&
621 &
'--------------- Rime Factor --------------------------', &
622 &
'--------------------------->'
623 write(7,
"(a,23f5.2)")
' D(mm)',(rime_factor(k), k=1,5), &
624 & (rime_factor(k), k=6,40,2)
627 d=(float(i)+.5)*1.e-3
645 if (d < d_crystal_max)
then
659 m_bullet=min(.044*d**3, m_ice)
660 m_column=min(.017*d**1.7, m_ice)
661 m_plate=min(.026*d**2.5, m_ice)
663 mass(i)=m_bullet+m_column+m_plate
670 v_column=8.114e-5*dx**1.585
671 v_bullet=5.666e-5*dx**1.663
673 else if (dx <= 400.)
then
674 v_column=4.995e-3*dx**.807
675 v_bullet=3.197e-3*dx**.902
676 v_plate=1.48e-3*dx**.926
677 else if (dx <= 600.)
then
678 v_column=2.223e-2*dx**.558
679 v_bullet=2.977e-2*dx**.529
681 else if (dx <= 800.)
then
682 v_column=4.352e-2*dx**.453
683 v_bullet=2.144e-2*dx**.581
684 v_plate=3.161e-3*dx**.812
686 v_column=3.833e-2*dx**.472
687 v_bullet=3.948e-2*dx**.489
688 v_plate=7.109e-3*dx**.691
699 vel(i)=(m_bullet*v_bullet+m_column*v_column+m_plate*v_plate)/ &
719 cl_bullet=.5*pi*wd*(.25*wd+d)/(d+wd)
726 ecc_plate=sqrt(1.-wd*wd/(d*d))
727 c_plate=d*ecc_plate/asin(ecc_plate)
740 ecc_column=sqrt(1.-wd*wd/(d*d))
741 c_column=ecc_column*d/log((1.+ecc_column)*d/wd)
743 cl_column=(wd+2.*d)/(c1+c2*d/wd)
748 c_bullet=.001*c_bullet
750 c_column=.001*c_column
751 cl_bullet=.001*cl_bullet
752 cl_plate=.001*cl_plate
753 cl_column=.001*cl_column
762 cvent1=1.0+.1*max(0., d-.05)/.15
768 vent1(i)=cvent1*(c_bullet+c_plate+c_column)/3.
769 vent2(i)=cvent2*(c_bullet*sqrt(v_bullet*cl_bullet) &
770 & +c_plate*sqrt(v_plate*cl_plate) &
771 & +c_column*sqrt(v_column*cl_column) )
784 m_agg=(.073*d**1.4+.037*d**1.9+.04*d**1.4)/3.
785 v_agg=(.8*d**.16+.69*d**.41+.82*d**.12)/3.
799 vent1(i)=cvent1a*c_agg
800 vent2(i)=cvent2a*c_agg*sqrt(v_agg*cl_agg)
806 vent1(i)=4.*pi*vent1(i)
807 vent2(i)=4.*pi*vent2(i)
809 mass(i)=1.e-6*mass(i)
815 rime_m1=rime_factor(k)*mass(i)
816 rime_m2=cbulk_ice*diam(i)**3
817 m_rime=min(rime_m1, rime_m2)
819 x_rime=crime2*m_rime*(crime_best/m_rime)**.25
821 re_rime=8.5*(sqrt(1.+.1519*sqrt(x_rime))-1.)**2
822 rime_vel(k)=crime5*re_rime/diam(i)
825 vel_rime(i,k)=rime_vel(k)/rime_vel(0)
833 if (mod(i,10) == 0) iprint=.true.
835 if (mod(i,100) == 0) iprint=.true.
838 write(6,
"(f7.4,5e11.4,1x,5f7.4,1x,2e11.4)") &
839 & d,1.e6*mass(i),m_bullet,m_column,m_plate,m_agg, &
840 & vel(i),v_bullet,v_column,v_plate,v_agg, &
842 write(7,
"(f7.4,23f5.2)") d,(vel_rime(i,k), k=1,5), &
843 & (vel_rime(i,k), k=6,40,2)
863 write(6,
"(/2a)")
'------------- Statistics as functions of ', &
864 &
'mean particle diameter -------------'
865 write(7,
"(/2a)")
'------ Increase in fall speeds of rimed ice', &
866 &
' particles as functions of mean particle diameter -----'
869 if (icount == 60 .AND. print_diag)
then
870 write(6,
"(/2a)")
'D(mm) Vent1 Vent2 ', &
871 &
'Accrete Mass Vel Dens '
872 write(7,
"(3a)")
' <----------------------------------', &
873 &
'--------------- Rime Factor --------------------------', &
874 &
'--------------------------->'
875 write(7,
"(a,23f5.2)")
'D(mm)',(rime_factor(k), k=1,5), &
876 & (rime_factor(k), k=6,40,2)
879 mdiam=deldmi*float(j)
887 venti1(j)=venti1(j)+vent1(i)*expf
888 venti2(j)=venti2(j)+vent2(i)*expf
889 accri(j)=accri(j)+diam(i)*diam(i)*vel(i)*expf
892 rime_vel(k)=rime_vel(k)+xmass*vel_rime(i,k)
894 massi(j)=massi(j)+xmass
895 pratei=pratei+xmass*vel(i)
896 smom3=smom3+diam(i)**3*expf
906 ivel_rime(j,k)=rime_vel(k)/massi(j)
913 if (jj >= 2 .AND. jj <= 9)
then
915 vel_rf(jj,k)=vel_rf(jj,k)+ivel_rime(j,k)
918 bulk_dens=cbulk*massi(j)/smom3
919 venti1(j)=venti1(j)/mdiam
920 venti2(j)=venti2(j)/mdiam
921 accri(j)=accri(j)/mdiam
922 vsnowi(j)=pratei/massi(j)
923 massi(j)=massi(j)/mdiam
924 if (mod(j,10) == 0 .AND. print_diag)
then
926 write(6,
"(f6.3,4e11.4,f6.3,f8.3)") xmdiam,venti1(j),venti2(j),&
927 & accri(j),massi(j),vsnowi(j),bulk_dens
928 write(7,
"(f6.3,23f5.2)") xmdiam,(ivel_rime(j,k), k=1,5), &
929 & (ivel_rime(j,k), k=6,40,2)
938 write(7,
"(/2a)")
' ------- Increase in fall speeds of rimed ', &
939 &
'ice particles at reduced, 0.1-mm intervals --------'
940 write(7,
"(3a)")
' <----------------------------------', &
941 &
'--------------- Rime Factor --------------------------', &
942 &
'--------------------------->'
943 write(7,
"(a,23f5.2)")
'D(mm)',(rime_factor(k), k=1,5), &
944 & (rime_factor(k), k=6,40,2)
949 vel_rf(j,k)=.01*vel_rf(j,k)
951 if (print_diag)
write(7,
"(f4.1,2x,23f5.2)") 0.1*j, &
952 & (vel_rf(j,k), k=1,5),(vel_rf(j,k), k=6,40,2)
1123 SUBROUTINE gsmcolumn ( ARAING, ASNOWG, DTPG, I_index, J_index, &
1124 & LSFC, P_col, QI_col, QR_col, QV_col, QW_col, RimeF_col, T_col, &
1125 & THICK_col, WC_col, LM, RHC_col, XNCW, FLGmin, PRINT_diag, psfc)
1202 REAL ARAING, ASNOWG, P_col(LM), QI_col(LM), QR_col(LM), QV_col(LM)&
1203 &, QW_col(LM), RimeF_col(LM), T_col(LM), THICK_col(LM), &
1204 & WC_col(LM), RHC_col(LM), XNCW(LM), ARAIN, ASNOW, dtpg, psfc
1207 INTEGER I_index, J_index, LSFC
1226 REAL,
PARAMETER :: DMImin=.05e-3, dmimax=1.e-3, deldmi=1.e-6, &
1227 & xmimin=1.e6*dmimin, xmimax=1.e6*dmimax
1228 INTEGER,
PARAMETER :: MDImin=xmimin, mdimax=xmimax
1247 REAL,
PARAMETER :: RHOL=1000., xls=hvap+hfus &
1257 &,climit=10.*epsq, rcp=1./cp, &
1258 & rcprv=rcp/rv, rrhol=1./rhol, xls1=xls*rcp, xls2=xls*xls*rcprv, &
1259 & xls3=xls*xls/rv, &
1260 & c1=1./3., c2=1./6., c3=3.31/6., &
1261 & dmr1=.1e-3, dmr2=.2e-3, dmr3=.32e-3, n0r0=8.e6, n0rmin=1.e4, &
1262 & n0s0=4.e6, rho0=1.194, xmr1=1.e6*dmr1, xmr2=1.e6*dmr2, &
1263 & xmr3=1.e6*dmr3, xratio=.025
1264 INTEGER,
PARAMETER :: MDR1=xmr1, mdr2=xmr2, mdr3=xmr3
1276 REAL,
PARAMETER :: BLEND=1.
1284 REAL EMAIRI, N0r, NLICE, NSmICE, NLImax, pfac
1285 LOGICAL CLEAR, ICE_logical, DBG_logical, RAIN_logical
1287 integer lbef, ipass, ixrf, ixs, itdx, idr &
1288 &, index_my, indexr, indexr1, indexs &
1289 &, i, j, k, l, ntimes, item
1292 real flimass, xlimass, vsnow, qi_min, dum, piloss &
1293 &, tot_ice, xsimass, vel_inc, vrimef, rimef1, dum1 &
1294 &, dum2, fws, denomi, dwv &
1295 &, xrf, qw0, dli, xli, fsmall &
1296 &, prevp, tk2, dtph &
1297 &, pievp, picnd, piacr, pracw &
1298 &, praut, pimlt, qtice, qlice &
1299 &, gammar, flarge, wvqw, dynvis &
1300 &, tfactor, denom, gammas, diffus, therm_cond &
1301 &, wvnew, delv, tnew, tot_icenew, rimef &
1302 &, deli, fwr, crevp, ventr, delt &
1303 &, delw, fir, delr, qsinew, qswnew &
1304 &, budget, wsnew, vrain2, tot_rainnew &
1305 &, qtnew, qt, wcnew, abw &
1306 &, aievp, tcc, denomf, abi &
1307 &, sfactor, pidep_max, didep, ventis, ventil &
1308 &, dievp, rqr, rfactor, dwvr, rr, tot_rain &
1309 &, dwv0, qsw0, prloss, qtrain, vrain1 &
1310 &, qsw, ws, esi, esw, wv, wc, rhgrd, rho &
1311 &, rrho, dtrho, wsgrd, qsi, qswgrd, qsigrd &
1312 &, tk, tc, pp, bldtrh &
1313 &, xlv, xlv1, xlf, xlf1, xlv2, denomw, denomwi &
1314 &, qwnew, pcond, pidep, qrnew, qi, qr, qw &
1315 &, piacw, piacwi, piacwr, qv, dwvi &
1316 &, arainnew, thick, asnownew &
1317 &, qinew, qi_min_0c, QSW_l, QSI_l, QSW0_l, SCHMIT_FAC
1325 dtph = dtpg / mic_step
1329 do ntimes =1,mic_step
1331 qi_min_0c = 10.e3*massi(mdimin)
1344 IF (qv_col(l) > epsq .OR. wc_col(l) > epsq)
THEN
1372 esw = min(pp, fpvsl(tk))
1374 qsw = eps*esw/(pp+epsm1*esw)
1378 esi = min(pp,fpvsi(tk))
1380 qsi = eps*esi/(pp+epsm1*esi)
1382 if (pp <= esi) ws = wv / rhgrd
1386 qsw0 = eps*dum/(pp+epsm1*dum)
1399 IF (wv > wsgrd .OR. wc > epsq) clear = .false.
1400 IF (arain > climit)
THEN
1411 IF (asnow > climit)
THEN
1421 IF (.not. clear)
THEN
1431 rho = pp/(rd*tk*(1.+eps1*qv))
1434 bldtrh = blend*dtrho
1435 thick = thick_col(l)
1489 xlv = 3.148e6 - 2370*tk
1494 xlv2 = xlv*xlv*qsw_l*tk2/rv
1495 denomw = 1. + xlv2*rcp
1503 tfactor = tk*sqrt(tk)/(tk+120.)
1504 dynvis = 1.496e-6*tfactor
1505 therm_cond = 2.116e-3*tfactor
1506 diffus = 8.794e-5*tk**1.81/pp
1507 schmit_fac = (rho/(diffus*diffus*dynvis))**c2
1512 gammas = (1.e5/pp)**c1
1516 gammar = (rho0/rho)**0.4
1524 IF (tc < 0. .OR. qi > epsq .OR. asnow > climit)
THEN
1525 ice_logical = .true.
1527 ice_logical = .false.
1534 rain_logical = .false.
1535 IF (arain > climit .OR. qr > epsq) rain_logical = .true.
1537 IF (ice_logical)
THEN
1595 IF (qi <= epsq .AND. asnow <= climit)
THEN
1599 xsimass = rrho*massi(mdimin)
1607 xlimass = rrho*rimef1*massi(indexs)
1608 flimass = xlimass/(xlimass+xsimass)
1624 dum = max(0.05, min(1., exp(.0564*tc)) )
1625 indexs = min(mdimax, max(mdimin, int(xmimax*dum) ) )
1627 dum = max(flgmin*pfac, dum)
1629 qi_min = qi_min_0c * dum
1633 nlimax = 10.e3/sqrt(dum)
1639 fsmall = (1.-flarge)/flarge
1640 xsimass = rrho*massi(mdimin)*fsmall
1641 tot_ice = thick*qi + blend*asnow
1642 piloss = -tot_ice/thick
1644 rimef1 = (rimef_col(l)*thick*qi &
1645 & + rimef_col(lbef)*blend*asnow)/tot_ice
1646 rimef1 = min(rimef1, rfmax)
1649 IF (rimef1 .LE. 1.)
THEN
1653 ixs = max(2, min(indexs/100, 9))
1654 xrf = 10.492*log(rimef1)
1655 ixrf = max(0, min(int(xrf), nrime))
1656 IF (ixrf .GE. nrime)
THEN
1657 vrimef = vel_rf(ixs,nrime)
1659 vrimef = vel_rf(ixs,ixrf)+(xrf-float(ixrf))* &
1660 & (vel_rf(ixs,ixrf+1)-vel_rf(ixs,ixrf))
1663 vel_inc = gammas*vrimef
1664 vsnow = vel_inc*vsnowi(indexs)
1665 emairi = thick + bldtrh*vsnow
1666 xlimass = rrho*rimef1*massi(indexs)
1667 flimass = xlimass/(xlimass+xsimass)
1668 qtice = tot_ice/emairi
1669 qlice = flimass*qtice
1670 nlice = qlice/xlimass
1671 nsmice = fsmall*nlice
1673 IF ( (nlice >= nlimin .AND. nlice <= nlimax) &
1674 & .OR. ipass == 1)
THEN
1678 xli = rho*(qtice/dum-xsimass)/rimef1
1679 IF (xli <= massi(mdimin) )
THEN
1681 ELSE IF (xli <= massi(450) )
THEN
1682 dli = 9.5885e5*xli**.42066
1683 indexs = min(mdimax, max(mdimin, int(dli) ) )
1684 ELSE IF (xli <= massi(mdimax) )
THEN
1685 dli = 3.9751e6*xli**.49870
1686 indexs = min(mdimax, max(mdimin, int(dli) ) )
1703 dum = max(nlimin, min(nlimax, nlice) )
1704 IF (dum >= nlimax .AND. indexs >= mdimax) &
1705 & rimef1 = rho*(qtice/nlimax-xsimass)/massi(indexs)
1723 IF (qw > epsq .AND. tc >= t_ice)
THEN
1731 qw0 = qautx*rrho*xncw(l)
1732 praut = max(0., qw-qw0)*craut
1733 IF (qlice > epsq)
THEN
1739 fws = min(0.1, ciacw*vel_inc*nlice*accri(indexs) &
1742 IF (tc < 0.) piacwi = piacw
1751 IF (ice_logical)
THEN
1755 IF (tc < t_ice .AND. (wv > qsigrd .OR. qw > epsq))
THEN
1764 dum1 = tk + xlv1*pcond
1766 dum = min(pp,fpvsi(dum1))
1767 dum = rhgrd*eps*dum/(pp+epsm1*dum)
1770 IF (dum2 > dum) pidep = deposit(pp, rhgrd, dum1, dum2)
1774 ELSE IF (tc < 0.)
THEN
1779 denomi = 1. + xls2*qsi_l*tk2
1780 dwvi = min(wvqw,qsw_l)-qsi_l
1781 pidep_max = max(piloss, dwvi/denomi)
1782 IF (qtice > 0.)
THEN
1792 sfactor = sqrt(vel_inc)*schmit_fac
1793 abi = 1./(rho*xls3*qsi*tk2/therm_cond+1./diffus)
1801 ventil = (venti1(indexs) + sfactor*venti2(indexs)) &
1803 ventis = (venti1(mdimin) + sfactor*venti2(mdimin)) &
1805 didep = abi*(ventil+ventis)*dtph
1809 IF (didep >= xratio) &
1810 & didep = (1.-exp(-didep*denomi))/denomi
1812 pidep = min(dwvi*didep, pidep_max)
1813 ELSE IF (dwvi < 0.)
THEN
1814 pidep = max(dwvi*didep, pidep_max)
1817 ELSE IF (wvqw > qsi_l .AND. tc <= t_ice_init)
THEN
1825 index_my = max(my_t1, min( int(.5-tc), my_t2 ) )
1836 dum2 = 1.e3*exp(12.96*dum1-0.639)
1837 pidep = min(pidep_max,dum2*my_growth(index_my)*rrho)
1851 IF (tc >= t_ice .AND. (qw > epsq .OR. wv > qswgrd))
THEN
1852 IF (piacwi == 0. .AND. pidep == 0.)
THEN
1853 pcond = condense(pp, qw, rhgrd, tk, wv)
1855 dum = xlv*qswgrd*rcprv*tk2
1856 denomwi = 1. + xls*dum
1858 dum = max(0., pidep)
1859 pcond = (wv-qswgrd-denomwi*dum-denomf*piacwi)/denomw
1861 dum2 = pcond - piacw
1862 IF (dum2 < dum1)
THEN
1874 tcc = tc + xlv1*pcond + xls1*pidep + xlf1*piacwi
1877 tcc = tc + xlv1*pcond + xls1*pidep
1880 IF (tc > 0. .AND. tcc > 0. .AND. ice_logical)
THEN
1888 sfactor = sqrt(vel_inc)*schmit_fac
1889 ventil = nlice*(venti1(indexs)+sfactor*venti2(indexs))
1890 aievp = ventil*diffus*dtph
1891 IF (aievp < xratio)
THEN
1894 dievp = 1. - exp(-aievp)
1901 dwv0 = min(wv,qsw_l)-qsw0_l
1903 IF (wv < qsw_l .AND. dum <= epsq)
THEN
1909 pievp = max( min(0., dum), piloss)
1910 picnd = max(0., dum)
1912 pimlt = therm_cond*tcc*ventil*rrho*dtph/xlf
1916 dum1 = max( 0., (tcc+xlv1*pievp)/xlf1 )
1917 pimlt = min(pimlt, dum1)
1922 IF (dum < piloss)
THEN
1950 IF (rain_logical)
THEN
1951 IF (arain <= 0.)
THEN
1961 rr = arain / (dtph*gammar)
1963 IF (rr <= rr_drmin)
THEN
1969 ELSE IF (rr <= rr_dr1)
THEN
1978 indexr = int( 1.123e3*rr**.1947 + .5 )
1979 indexr = max( mdrmin, min(indexr, mdr1) )
1981 ELSE IF (rr <= rr_dr2)
THEN
1990 indexr = int( 1.225e3*rr**.2017 + .5 )
1991 indexr = max( mdr1, min(indexr, mdr2) )
1993 ELSE IF (rr <= rr_dr3)
THEN
2002 indexr = int( 1.3006e3*rr**.2083 + .5 )
2003 indexr = max( mdr2, min(indexr, mdr3) )
2005 ELSE IF (rr <= rr_drmax)
THEN
2014 indexr = int( 1.355e3*rr**.2144 + .5 )
2015 indexr = max( mdr3, min(indexr, mdrmax) )
2024 vrain1 = gammar*vrain(indexr)
2028 tot_rain = thick*qr+blend*arain
2029 qtrain = tot_rain/(thick+bldtrh*vrain1)
2030 prloss = -tot_rain/thick
2035 IF (rqr <= rqr_drmin)
THEN
2036 n0r = max(n0rmin, cn0r_dmrmin*rqr)
2038 ELSE IF (rqr >= rqr_drmax)
THEN
2039 n0r = cn0r_dmrmax*rqr
2044 item = cn0r0*sqrt(sqrt(rqr))
2045 indexr = max( mdrmin, min(item, mdrmax) )
2048 IF (tc < t_ice)
THEN
2051 dwvr = wv - pcond - qsw_l
2053 IF (dwvr < 0. .AND. dum <= epsq)
THEN
2065 rfactor = sqrt(gammar)*schmit_fac
2066 abw = 1./(rho*xlv2/therm_cond+1./diffus)
2071 ventr = n0r*(ventr1(indexr)+rfactor*ventr2(indexr))
2072 crevp = abw*ventr*dtph
2073 IF (crevp < xratio)
THEN
2076 dum = dwvr*(1.-exp(-crevp*denomw))/denomw
2078 prevp = max(dum, prloss)
2079 ELSE IF (qw > epsq)
THEN
2080 fwr = cracw*gammar*n0r*accrr(indexr)
2082 pracw = min(0.1,fwr)*qw
2085 IF (tc < 0. .AND. tcc < 0.)
THEN
2090 dum = .001*float(indexr)
2092 dum = (exp(abfr*tc)-1.)*dum1*dum1*dum1*dum
2093 piacr = min(cbfr*n0r*rrho*dum, qtrain)
2094 IF (qlice > epsq)
THEN
2098 dum = gammar*vrain(indexr)
2105 dum2 = (dum1*dum1+.04*dum*vsnow)**.5
2106 dum1 = 5.e-12*indexr*indexr+2.e-12*indexr*indexs &
2107 & +.5e-12*indexs*indexs
2108 fir = min(1., ciacr*nlice*dum1*dum2)
2112 piacr = min(piacr+fir*qtrain, qtrain)
2115 If (dum < prloss)
THEN
2135 dum1 = piacw + praut + pracw - min(0.,pcond)
2142 IF (pcond < 0.) pcond=dum*pcond
2144 piacwr = piacw - piacwi
2148 delw = pcond - piacw - praut - pracw
2150 IF (qwnew <= epsq) qwnew = 0.
2151 IF (qw > 0. .AND. qwnew /= 0.)
THEN
2153 IF (dum < toler) qwnew = 0.
2158 delt = xlv1 * (pcond+pievp+picnd+prevp) &
2159 & + xls1 * pidep + xlf1*(piacwi+piacr-pimlt)
2162 delv = -pcond - pidep - pievp - picnd - prevp
2182 IF (ice_logical)
THEN
2183 deli = pidep + pievp + piacwi + piacr - pimlt
2184 tot_icenew = tot_ice + thick*deli
2185 IF (tot_ice > 0. .AND. tot_icenew /= 0.)
THEN
2186 dum = tot_icenew/tot_ice
2187 IF (dum < toler) tot_icenew = 0.
2189 IF (tot_icenew <= climit)
THEN
2198 dum = piacwi + piacr
2199 IF (dum <= epsq .AND. pidep <= epsq)
THEN
2207 dum1 = tot_ice + thick*(pidep+dum)
2208 dum2 = tot_ice/rimef1 + thick*pidep
2209 IF (dum2 <= 0.)
THEN
2212 rimef = min(rfmax, max(1., dum1/dum2) )
2215 qinew = tot_icenew/(thick+bldtrh*flimass*vsnow)
2216 IF (qinew <= epsq) qinew = 0.
2217 IF (qi > 0. .AND. qinew /= 0.)
THEN
2219 IF (dum < toler) qinew = 0.
2221 asnownew = bldtrh*flimass*vsnow*qinew
2222 IF (asnow > 0. .AND. asnownew /= 0.)
THEN
2223 dum = asnownew/asnow
2224 IF (dum < toler) asnownew = 0.
2241 delr = praut + pracw + piacwr - piacr + pimlt &
2243 tot_rainnew = tot_rain+thick*delr
2244 IF (tot_rain > 0. .AND. tot_rainnew /= 0.)
THEN
2245 dum = tot_rainnew/tot_rain
2246 IF (dum < toler) tot_rainnew = 0.
2248 IF (tot_rainnew <= climit)
THEN
2257 rr = tot_rainnew/(dtph*gammar)
2266 IF (rr <= rr_drmin)
THEN
2268 ELSE IF (rr <= rr_dr1)
THEN
2269 idr = int( 1.123e3*rr**.1947 + .5 )
2270 idr = max( mdrmin, min(idr, mdr1) )
2271 ELSE IF (rr <= rr_dr2)
THEN
2272 idr = int( 1.225e3*rr**.2017 + .5 )
2273 idr = max( mdr1, min(idr, mdr2) )
2274 ELSE IF (rr <= rr_dr3)
THEN
2275 idr = int( 1.3006e3*rr**.2083 + .5 )
2276 idr = max( mdr2, min(idr, mdr3) )
2277 ELSE IF (rr <= rr_drmax)
THEN
2278 idr = int( 1.355e3*rr**.2144 + .5 )
2279 idr = max( mdr3, min(idr, mdrmax) )
2283 vrain2 = gammar*vrain(idr)
2284 qrnew = tot_rainnew / (thick+bldtrh*vrain2)
2285 IF (qrnew <= epsq) qrnew = 0.
2286 IF (qr > 0. .AND. qrnew /= 0.)
THEN
2288 IF (dum < toler) qrnew = 0.
2290 arainnew = bldtrh*vrain2*qrnew
2291 IF (arain > 0. .AND. arainnew /= 0.)
THEN
2292 dum = arainnew/arain
2293 IF (dum < toler) arainnew = 0.
2297 wcnew = qwnew + qrnew + qinew
2309 qt = thick*(wv+wc) + arain + asnow
2310 qtnew = thick*(wvnew+wcnew) + arainnew + asnownew
2328 IF ((wvnew < epsq .OR. dbg_logical) .AND. print_diag)
THEN
2330 WRITE(6,
"(/2(a,i4),2(a,i2))")
'{} i=',i_index,
' j=', &
2331 & j_index,
' L=',l,
' LSFC=',lsfc
2333 esw = min(pp, fpvsl(tnew))
2335 qswnew = eps*esw/(pp+epsm1*esw)
2336 IF (tc < 0. .OR. tnew < 0.)
THEN
2337 esi = min(pp, fpvsi(tnew))
2339 qsinew = eps*esi/(pp+epsm1*esi)
2345 WRITE(6,
"(4(a12,g11.4,1x))") &
2346 &
'{} TCold=',tc,
'TCnew=',tnew-t0c,
'P=',.01*pp,
'RHO=',rho, &
2347 &
'{} THICK=',thick,
'RHold=',wv/ws,
'RHnew=',wvnew/wsnew, &
2349 &
'{} RHWold=',wv/qsw,
'RHWnew=',wvnew/qswnew,
'RHIold=',wv/qsi, &
2350 &
'RHInew=',wvnew/qsinew, &
2351 &
'{} QSWold=',qsw,
'QSWnew=',qswnew,
'QSIold=',qsi,
'QSInew=',qsinew,&
2352 &
'{} WSold=',ws,
'WSnew=',wsnew,
'WVold=',wv,
'WVnew=',wvnew, &
2353 &
'{} WCold=',wc,
'WCnew=',wcnew,
'QWold=',qw,
'QWnew=',qwnew, &
2354 &
'{} QIold=',qi,
'QInew=',qinew,
'QRold=',qr,
'QRnew=',qrnew, &
2355 &
'{} ARAINold=',arain,
'ARAINnew=',arainnew,
'ASNOWold=',asnow, &
2356 &
'ASNOWnew=',asnownew, &
2357 &
'{} TOT_RAIN=',tot_rain,
'TOT_RAINnew=',tot_rainnew, &
2358 &
'TOT_ICE=',tot_ice,
'TOT_ICEnew=',tot_icenew, &
2359 &
'{} BUDGET=',budget,
'QTold=',qt,
'QTnew=',qtnew
2361 WRITE(6,
"(4(a12,g11.4,1x))") &
2362 &
'{} DELT=',delt,
'DELV=',delv,
'DELW=',delw,
'DELI=',deli, &
2363 &
'{} DELR=',delr,
'PCOND=',pcond,
'PIDEP=',pidep,
'PIEVP=',pievp, &
2364 &
'{} PICND=',picnd,
'PREVP=',prevp,
'PRAUT=',praut,
'PRACW=',pracw, &
2365 &
'{} PIACW=',piacw,
'PIACWI=',piacwi,
'PIACWR=',piacwr,
'PIMLT=', &
2369 IF (ice_logical)
WRITE(6,
"(4(a12,g11.4,1x))") &
2370 &
'{} RimeF1=',rimef1,
'GAMMAS=',gammas,
'VrimeF=',vrimef, &
2372 &
'{} INDEXS=',float(indexs),
'FLARGE=',flarge,
'FSMALL=',fsmall, &
2373 &
'FLIMASS=',flimass, &
2374 &
'{} XSIMASS=',xsimass,
'XLIMASS=',xlimass,
'QLICE=',qlice, &
2376 &
'{} NLICE=',nlice,
'NSmICE=',nsmice,
'PILOSS=',piloss, &
2377 &
'EMAIRI=',emairi, &
2380 IF (tot_rain > 0. .OR. tot_rainnew > 0.) &
2381 &
WRITE(6,
"(4(a12,g11.4,1x))") &
2382 &
'{} INDEXR1=',float(indexr1),
'INDEXR=',float(indexr), &
2383 &
'GAMMAR=',gammar,
'N0r=',n0r, &
2384 &
'{} VRAIN1=',vrain1,
'VRAIN2=',vrain2,
'QTRAIN=',qtrain,
'RQR=',rqr,&
2385 &
'{} PRLOSS=',prloss,
'VOLR1=',thick+bldtrh*vrain1, &
2386 &
'VOLR2=',thick+bldtrh*vrain2
2388 IF (praut > 0.)
WRITE(6,
"(a12,g11.4,1x)")
'{} QW0=',qw0
2390 IF (pracw > 0.)
WRITE(6,
"(a12,g11.4,1x)")
'{} FWR=',fwr
2392 IF (piacr > 0.)
WRITE(6,
"(a12,g11.4,1x)")
'{} FIR=',fir
2394 dum = pimlt + picnd - prevp - pievp
2395 IF (dum > 0. .or. dwvi /= 0.) &
2396 &
WRITE(6,
"(4(a12,g11.4,1x))") &
2397 &
'{} TFACTOR=',tfactor,
'DYNVIS=',dynvis, &
2398 &
'THERM_CON=',therm_cond,
'DIFFUS=',diffus
2400 IF (prevp < 0.)
WRITE(6,
"(4(a12,g11.4,1x))") &
2401 &
'{} RFACTOR=',rfactor,
'ABW=',abw,
'VENTR=',ventr,
'CREVP=',crevp, &
2402 &
'{} DWVr=',dwvr,
'DENOMW=',denomw
2404 IF (pidep /= 0. .AND. dwvi /= 0.) &
2405 &
WRITE(6,
"(4(a12,g11.4,1x))") &
2406 &
'{} DWVi=',dwvi,
'DENOMI=',denomi,
'PIDEP_max=',pidep_max, &
2407 &
'SFACTOR=',sfactor, &
2408 &
'{} ABI=',abi,
'VENTIL=',ventil,
'VENTIL1=',venti1(indexs), &
2409 &
'VENTIL2=',sfactor*venti2(indexs), &
2410 &
'{} VENTIS=',ventis,
'DIDEP=',didep
2412 IF (pidep > 0. .AND. pcond /= 0.) &
2413 &
WRITE(6,
"(4(a12,g11.4,1x))") &
2414 &
'{} DENOMW=',denomw,
'DENOMWI=',denomwi,
'DENOMF=',denomf, &
2415 &
'DUM2=',pcond-piacw
2417 IF (fws > 0.)
WRITE(6,
"(4(a12,g11.4,1x))")
'{} FWS=',fws
2419 dum = pimlt + picnd - pievp
2420 IF (dum > 0.)
WRITE(6,
"(4(a12,g11.4,1x))") &
2421 &
'{} SFACTOR=',sfactor,
'VENTIL=',ventil,
'VENTIL1=',venti1(indexs),&
2422 &
'VENTIL2=',sfactor*venti2(indexs), &
2423 &
'{} AIEVP=',aievp,
'DIEVP=',dievp,
'QSW0=',qsw0,
'DWV0=',dwv0
2431 IF (print_diag)
THEN
2432 itdx = max( itlo, min( int(tnew-t0c), ithi ) )
2433 IF (qinew > epsq) nstats(itdx,1) = nstats(itdx,1)+1
2434 IF (qinew > epsq .AND. qrnew+qwnew > epsq) &
2435 & nstats(itdx,2) = nstats(itdx,2)+1
2436 IF (qwnew > epsq) nstats(itdx,3) = nstats(itdx,3)+1
2437 IF (qrnew > epsq) nstats(itdx,4) = nstats(itdx,4)+1
2439 qmax(itdx,1) = max(qmax(itdx,1), qinew)
2440 qmax(itdx,2) = max(qmax(itdx,2), qwnew)
2441 qmax(itdx,3) = max(qmax(itdx,3), qrnew)
2442 qmax(itdx,4) = max(qmax(itdx,4), asnownew)
2443 qmax(itdx,5) = max(qmax(itdx,5), arainnew)
2444 qtot(itdx,1) = qtot(itdx,1)+qinew*thick
2445 qtot(itdx,2) = qtot(itdx,2)+qwnew*thick
2446 qtot(itdx,3) = qtot(itdx,3)+qrnew*thick
2448 qtot(itdx,4) = qtot(itdx,4)+pcond*thick
2449 qtot(itdx,5) = qtot(itdx,5)+picnd*thick
2450 qtot(itdx,6) = qtot(itdx,6)+pievp*thick
2451 qtot(itdx,7) = qtot(itdx,7)+pidep*thick
2452 qtot(itdx,8) = qtot(itdx,8)+prevp*thick
2453 qtot(itdx,9) = qtot(itdx,9)+praut*thick
2454 qtot(itdx,10) = qtot(itdx,10)+pracw*thick
2455 qtot(itdx,11) = qtot(itdx,11)+pimlt*thick
2456 qtot(itdx,12) = qtot(itdx,12)+piacw*thick
2457 qtot(itdx,13) = qtot(itdx,13)+piacwi*thick
2458 qtot(itdx,14) = qtot(itdx,14)+piacwr*thick
2459 qtot(itdx,15) = qtot(itdx,15)+piacr*thick
2461 qtot(itdx,16) = qtot(itdx,16)+(wvnew-wv)*thick
2462 qtot(itdx,17) = qtot(itdx,17)+(qwnew-qw)*thick
2463 qtot(itdx,18) = qtot(itdx,18)+(qinew-qi)*thick
2464 qtot(itdx,19) = qtot(itdx,19)+(qrnew-qr)*thick
2465 qtot(itdx,20) = qtot(itdx,20)+(arainnew-arain)
2466 qtot(itdx,21) = qtot(itdx,21)+(asnownew-asnow)
2468 & qtot(itdx,22) = qtot(itdx,22)+qinew*thick/rimef
2479 qv_col(l) = max(0.0, wvnew )
2480 wc_col(l) = max(0.0, wcnew)
2481 qi_col(l) = max(0.0, qinew)
2482 qr_col(l) = max(0.0, qrnew)
2483 qw_col(l) = max(0.0, qwnew)
2484 rimef_col(l) = rimef
2495 araing = araing + arain
2496 asnowg = asnowg + asnow
2512 REAL FUNCTION CONDENSE (PP, QW, RHgrd, TK, WV)
2522 real pp, qw, rhgrd, tk, wv
2523 INTEGER,
PARAMETER :: HIGH_PRES=kind_phys
2525 REAL (KIND=high_pres),
PARAMETER :: &
2526 & rhlimit=.001, rhlimit1=-rhlimit
2527 REAL,
PARAMETER :: RCP=1./cp, rcprv=rcp/rv
2528 REAL (KIND=high_pres) :: cond, ssat, wcdum, tsq
2529 real wvdum, tdum, xlv, xlv1, xlv2, ws, dwv, esw, rfac
2542 esw = min(pp, fpvsl(tdum))
2544 ws = rhgrd*eps*esw/(pp+epsm1*esw)
2549 DO WHILE ((ssat < rhlimit1 .AND. wcdum > epsq) &
2550 & .OR. ssat > rhlimit)
2552 xlv = 3.148e6-2370.*tdum
2554 xlv2 = xlv*xlv*rcprv
2558 cond = rfac*dwv*tsq/(tsq+xlv2*ws)
2560 cond = max(cond, -wcdum)
2561 tdum = tdum+xlv1*cond
2564 condense = condense + cond
2565 esw = min(pp, fpvsl(tdum))
2567 ws = rhgrd*eps*esw/(pp+epsm1*esw)
2573 END FUNCTION condense
2579 REAL FUNCTION DEPOSIT (PP, RHgrd, Tdum, WVdum)
2586 REAL PP, RHgrd, Tdum, WVdum
2587 INTEGER,
PARAMETER :: HIGH_PRES=kind_phys
2589 REAL (KIND=high_pres),
PARAMETER :: rhlimit=.001, &
2591 REAL,
PARAMETER :: RCP=1./cp, rcprv=rcp/rv, xls=hvap+hfus &
2592 &, xls1=xls*rcp, xls2=xls*xls*rcprv
2593 REAL (KIND=high_pres) :: dep, ssat
2598 esi=min(pp, fpvsi(tdum))
2600 ws=rhgrd*eps*esi/(pp+epsm1*esi)
2604 DO WHILE (ssat > rhlimit .OR. ssat < rhlimit1)
2610 dep=dwv/(1.+xls2*ws/(tdum*tdum))
2614 esi=min(pp, fpvsi(tdum))
2616 ws=rhgrd*eps*esi/(pp+epsm1*esi)
2620 END FUNCTION deposit