117 & ( nsoil, couple, icein, ffrozp, dt, zlvl, sldpth, &
118 & swdn, swnet, lwdn, sfcems, sfcprs, sfctmp, &
119 & sfcspd, prcp, q2, q2sat, dqsdt2, th2, ivegsrc, &
120 & vegtyp, soiltyp, slopetyp, shdmin, alb, snoalb, &
121 & rhonewsn, exticeden, &
124 & tbot, cmc, t1, stc, smc, sh2o, sneqv, ch, cm,z0, &
125 & nroot, shdfac, snowh,
albedo, eta, sheat, ec, &
126 & edir, et, ett, esnow, drip, dew, beta, etp, ssoil, &
127 & flx1, flx2, flx3, runoff1, runoff2, runoff3, &
128 & snomlt, sncovr, rc, pc, rsmin, xlai, rcs, rct, rcq, &
129 & rcsoil, soilw, soilm, smcwlt, smcdry, smcref, smcmax, &
273 use machine ,
only : kind_phys
275 use physcons,
only : con_cp, con_rd, con_t0c, con_g, con_pi, &
276 & con_cliq, con_csol, con_hvap, con_hfus, &
287 integer,
parameter :: nsold = 4
290 real (kind=kind_phys),
parameter :: gs1 = 9.8
291 real (kind=kind_phys),
parameter :: gs2 = 9.81
292 real (kind=kind_phys),
parameter :: tfreez = con_t0c
293 real (kind=kind_phys),
parameter :: lsubc = 2.501e+6
294 real (kind=kind_phys),
parameter :: lsubf = 3.335e5
295 real (kind=kind_phys),
parameter :: lsubs = 2.83e+6
296 real (kind=kind_phys),
parameter :: elcp = 2.4888e+3
298 real (kind=kind_phys),
parameter :: rd1 = 287.04
299 real (kind=kind_phys),
parameter :: cp = con_cp
300 real (kind=kind_phys),
parameter :: cp1 = 1004.5
301 real (kind=kind_phys),
parameter :: cp2 = 1004.0
303 real (kind=kind_phys),
parameter :: cph2o1 = 4.218e+3
304 real (kind=kind_phys),
parameter :: cph2o2 = 4.2e6
305 real (kind=kind_phys),
parameter :: cpice = con_csol
306 real (kind=kind_phys),
parameter :: cpice1 = 2.106e6
308 real (kind=kind_phys),
parameter :: sigma1 = 5.67e-8
311 integer,
intent(in) :: nsoil, couple, icein, vegtyp, soiltyp, &
314 real (kind=kind_phys),
intent(in) :: ffrozp, dt, zlvl, lwdn, &
315 & sldpth(nsoil), swdn, swnet, sfcems, sfcprs, sfctmp, &
316 & sfcspd, prcp, q2, q2sat, dqsdt2, th2, shdmin, alb, snoalb, &
317 & bexpp, xlaip, rhonewsn &
319 logical,
intent(in) :: lheatstrg, exticeden
322 real (kind=kind_phys),
intent(inout) :: tbot, cmc, t1, sneqv, &
323 & stc(nsoil), smc(nsoil), sh2o(nsoil), ch, cm
326 integer,
intent(out) :: nroot
328 real (kind=kind_phys),
intent(out) :: shdfac, snowh,
albedo, &
329 & eta, sheat, ec, edir, et(nsoil), ett, esnow, drip, dew, &
330 & beta, etp, ssoil, flx1, flx2, flx3, snomlt, sncovr, &
331 & runoff1, runoff2, runoff3, rc, pc, rsmin, xlai, rcs, &
332 & rct, rcq, rcsoil, soilw, soilm, smcwlt, smcdry, smcref, &
334 character(len=*),
intent(out) :: errmsg
335 integer,
intent(out) :: errflg
339 real (kind=kind_phys) :: bexp, cfactr, cmcmax, csoil, czil, &
340 & df1, df1a, dksat, dwsat, dsoil, dtot, frcsno, &
341 & frcsoi, epsca, fdown, f1, fxexp, frzx, hs, kdt, prcp1, &
342 & psisat, quartz, rch, refkdt, rr, rgl, rsmax, sndens, &
343 & sncond, sbeta, sn_new, slope, snup, salp, soilwm, soilww, &
344 & t1v, t24, t2v, th2v, topt, tsnow, zbot, z0
346 real (kind=kind_phys) :: shdfac0
347 real (kind=kind_phys),
dimension(nsold) :: rtdis, zsoil
349 logical :: frzgra, snowng
351 integer :: ice, k, kz
379 if(ivegsrc == 2)
then
380 if (vegtyp == 13)
then
386 if(ivegsrc == 1)
then
387 if (vegtyp == 15)
then
402 zsoil(kz) = -3.0 * float(kz) / float(nsoil)
411 zsoil(1) = -sldpth(1)
413 zsoil(kz) = -sldpth(kz) + zsoil(kz-1)
424 call redprm(errmsg, errflg)
425 if(ivegsrc == 1)
then
435 rsmin=400.0*(1-shdfac0)+40.0*shdfac0
437 smcmax = 0.45*(1-shdfac0)+smcmax*shdfac0
438 smcref = 0.42*(1-shdfac0)+smcref*shdfac0
439 smcwlt = 0.40*(1-shdfac0)+smcwlt*shdfac0
440 smcdry = 0.40*(1-shdfac0)+smcdry*shdfac0
465 bexp = bexp * max(1.+bexpp, 0.)
467 if( bexpp >= 0.)
then
468 bexp = bexp * min(1.+bexpp, 2.)
472 xlai = xlai * (1.+xlaip)
473 xlai = max(xlai, .75)
489 if (sneqv < 0.01)
then
495 elseif (ice == -1)
then
497 if (sneqv < 0.10)
then
521 if (sneqv .eq. 0.0)
then
526 sndens = sneqv / snowh
527 sndens = max( 0.0, min( 1.0, sndens ))
544 if (ffrozp > 0.)
then
547 if (t1 <= tfreez) frzgra = .true.
558 if (snowng .or. frzgra)
then
562 sn_new = ffrozp*prcp * dt * 0.001
563 sneqv = sneqv + sn_new
564 prcp1 = (1.-ffrozp)*prcp
568 sn_new = prcp * dt * 0.001
569 sneqv = sneqv + sn_new
613 if (sneqv == 0.0)
then
673 & ( smc(1), quartz, smcmax, sh2o(1), &
690 if((.not.lheatstrg) .and. &
691 & (ivegsrc == 1 .and. vegtyp == 13))
then
692 df1 = 3.24*(1.-shdfac) + shdfac*df1*exp(sbeta*shdfac)
694 df1 = df1 * exp( sbeta*shdfac )
703 dsoil = -0.5 * zsoil(1)
705 if (sneqv == 0.0)
then
707 ssoil = df1 * (t1 - stc(1)) / dsoil
712 frcsno = snowh / dtot
713 frcsoi = dsoil / dtot
723 df1a = frcsno*sncond + frcsoi*df1
730 df1 = df1a*sncovr + df1 *(1.0-sncovr)
736 ssoil = df1 * (t1 - stc(1)) / dtot
744 if (sncovr > 0.0)
then
758 t2v = sfctmp * (1.0 + 0.61*q2)
790 if (couple == 0)
then
795 t1v = t1 * (1.0 + 0.61 * q2)
796 th2v = th2 * (1.0 + 0.61 * q2)
836 if (shdfac > 0.)
then
856 if (sneqv .eq. 0.0)
then
898 sheat = -(ch*cp1*sfcprs) / (rd1*t2v) * (th2 - t1)
910 et(k) = et(k) * lsubc
914 esnow = esnow * lsubs
915 etp = etp * ((1.0 - sncovr)*lsubc + sncovr*lsubs)
918 eta = edir + ec + ett + esnow
942 runoff3 = runoff3 / dt
943 runoff2 = runoff2 + runoff3
952 runoff1 = snomlt / dt
958 soilm = -1.0 * smc(1) * zsoil(1)
960 soilm = soilm + smc(k)*(zsoil(k-1) - zsoil(k))
963 soilwm = -1.0 * (smcmax - smcwlt) * zsoil(1)
964 soilww = -1.0 * (smc(1) - smcwlt) * zsoil(1)
966 soilwm = soilwm + (smcmax - smcwlt) * (zsoil(k-1) - zsoil(k))
967 soilww = soilww + (smc(k) - smcwlt) * (zsoil(k-1) - zsoil(k))
970 soilw = soilww / soilwm
1035 albedo = alb + sncovr*(snoalb - alb)
1144 real (kind=kind_phys) :: delta, ff, gx, rr, part(nsold)
1161 ff = 0.55 * 2.0 * swdn / (rgl*xlai)
1162 rcs = (ff + rsmin/rsmax) / (1.0 + ff)
1163 rcs = max( rcs, 0.0001 )
1168 rct = 1.0 - 0.0016 * (topt - sfctmp)**2.0
1169 rct = max( rct, 0.0001 )
1174 rcq = 1.0 / (1.0 + hs*(q2sat-q2))
1175 rcq = max( rcq, 0.01 )
1180 gx = (sh2o(1) - smcwlt) / (smcref - smcwlt)
1181 gx = max( 0.0, min( 1.0, gx ) )
1184 part(1) = (zsoil(1)/zsoil(nroot)) * gx
1191 gx = (sh2o(k) - smcwlt) / (smcref - smcwlt)
1192 gx = max( 0.0, min( 1.0, gx ) )
1195 part(k) = ((zsoil(k) - zsoil(k-1)) / zsoil(nroot)) * gx
1203 rcsoil = rcsoil + part(k)
1205 rcsoil = max( rcsoil, 0.0001 )
1213 rc = rsmin / (xlai*rcs*rct*rcq*rcsoil)
1214 rr = (4.0*sfcems*sigma1*rd1/cp1) * (sfctmp**4.0)/(sfcprs*ch) + 1.0
1215 delta = (lsubc/cp1) * dqsdt2
1217 pc = (rr + delta) / (rr*(1.0 + rc*ch) + delta)
1254 real (kind=kind_phys),
parameter :: unit = 0.11631
1263 real (kind=kind_phys) :: c
1271 c = 0.328 * 10**(2.25*sndens)
1284 end subroutine csnow
1408 real (kind=kind_phys) :: df1, eta1, etp1, prcp1, yy, yynum, &
1409 & zz1, ec1, edir1, et1(nsoil), ett1
1440 & ( nsoil, nroot, cmc, cmcmax, etp1, dt, zsoil, &
1441 & sh2o, smcmax, smcwlt, smcref, smcdry, pc, &
1442 & shdfac, cfactr, rtdis, fxexp, &
1444 & eta1, edir1, ec1, et1, ett1 &
1449 & ( nsoil, dt, kdt, smcmax, smcwlt, cmcmax, prcp1, &
1450 & zsoil, slope, frzx, bexp, dksat, dwsat, shdfac, &
1451 & edir1, ec1, et1, &
1455 & runoff1, runoff2, runoff3, drip &
1472 & ( nsoil, dt, kdt, smcmax, smcwlt, cmcmax, prcp1, &
1473 & zsoil, slope, frzx, bexp, dksat, dwsat, shdfac, &
1474 & edir1, ec1, et1, &
1478 & runoff1, runoff2, runoff3, drip &
1486 edir = edir1 * 1000.0
1490 et(k) = et1(k) * 1000.0
1497 if ( etp <= 0.0 )
then
1499 if ( etp < 0.0 )
then
1512 & ( smc(1), quartz, smcmax, sh2o(1), &
1530 if((.not.lheatstrg) .and. &
1531 & (ivegsrc == 1 .and. vegtyp == 13))
then
1532 df1 = 3.24*(1.-shdfac) + shdfac*df1*exp(sbeta*shdfac)
1534 df1 = df1 * exp( sbeta*shdfac )
1540 yynum = fdown - sfcems*sigma1*t24
1541 yy = sfctmp + (yynum/rch + th2 - sfctmp - beta*epsca)/rr
1542 zz1 = df1/(-0.5*zsoil(1)*rch*rr) + 1.0
1546 & ( nsoil, smc, smcmax, dt, yy, zz1, zsoil, zbot, &
1547 & psisat, bexp, df1, ice, quartz, csoil, vegtyp, &
1548 & shdfac, lheatstrg, &
1550 & stc, t1, tbot, sh2o, &
1564 end subroutine nopac
1631 real (kind=kind_phys) :: a, delta, fnet, rad, rho
1640 delta = elcp * dqsdt2
1641 t24 = sfctmp * sfctmp * sfctmp * sfctmp
1642 rr = t24 * 6.48e-8 / (sfcprs*ch) + 1.0
1643 rho = sfcprs / (rd1*t2v)
1649 if (.not. snowng)
then
1650 if (prcp > 0.0) rr = rr + cph2o1*prcp/rch
1653 rr = rr + (cpice*ffrozp+cph2o1*(1.-ffrozp)) &
1657 fnet = fdown - sfcems*sigma1*t24 - ssoil
1663 flx2 = -lsubf * prcp
1669 rad = fnet/rch + th2 - sfctmp
1670 a = elcp * (q2sat - q2)
1671 epsca = (a*rr + rad*delta) / (delta + rr)
1672 etp = epsca * rch / lsubc
1872 character(len=*),
intent(out) :: errmsg
1873 integer,
intent(out) :: errflg
1877 real (kind=kind_phys) :: frzfact, frzk, refdk
1888 if (soiltyp > defined_soil)
then
1889 write(*,*)
'warning: too many soil types,soiltyp=',soiltyp, &
1890 &
'defined_soil=',defined_soil
1892 errmsg =
'ERROR(sflx.f): too many soil types'
1896 if (vegtyp > defined_veg)
then
1897 write(*,*)
'warning: too many veg types'
1899 errmsg =
'ERROR(sflx.f): too many veg types'
1903 if (slopetyp > defined_slope)
then
1904 write(*,*)
'warning: too many slope types'
1906 errmsg =
'ERROR(sflx.f): too many slope types'
1915 cfactr = cfactr_data
1916 cmcmax = cmcmax_data
1923 refkdt = refkdt_data
1930 dksat = satdk(soiltyp)
1931 dwsat = satdw(soiltyp)
1933 kdt = refkdt * dksat / refdk
1935 psisat = satpsi(soiltyp)
1936 quartz = qtz(soiltyp)
1937 smcdry = drysmc(soiltyp)
1938 smcmax = maxsmc(soiltyp)
1939 smcref = refsmc(soiltyp)
1940 smcwlt = wltsmc(soiltyp)
1942 frzfact = (smcmax / smcref) * (0.412 / 0.468)
1946 frzx = frzk * frzfact
1950 nroot = nroot_data(vegtyp)
1951 snup = snupx(vegtyp)
1952 rsmin = rsmtbl(vegtyp)
1954 rgl = rgltbl(vegtyp)
1958 xlai= lai_data(vegtyp)
1960 if (vegtyp == bare) shdfac = 0.0
1962 if (nroot > nsoil)
then
1963 write(*,*)
'warning: too many root layers'
1965 errmsg =
'ERROR(sflx.f): too many root layers'
1973 rtdis(i) = -sldpth(i) / zsoil(nroot)
1978 slope = slope_data(slopetyp)
2024 integer,
parameter :: itrmx = 5
2025 real (kind=kind_phys),
parameter :: wwst = 1.2
2026 real (kind=kind_phys),
parameter :: wwst2 = wwst*wwst
2027 real (kind=kind_phys),
parameter :: vkrm = 0.40
2028 real (kind=kind_phys),
parameter :: excm = 0.001
2029 real (kind=kind_phys),
parameter :: beta = 1.0/270.0
2030 real (kind=kind_phys),
parameter :: btg = beta*gs1
2031 real (kind=kind_phys),
parameter :: elfc = vkrm*btg
2032 real (kind=kind_phys),
parameter :: wold = 0.15
2033 real (kind=kind_phys),
parameter :: wnew = 1.0-wold
2034 real (kind=kind_phys),
parameter :: pihf = 3.14159265/2.0
2036 real (kind=kind_phys),
parameter :: epsu2 = 1.e-4
2037 real (kind=kind_phys),
parameter :: epsust = 0.07
2038 real (kind=kind_phys),
parameter :: ztmin = -5.0
2039 real (kind=kind_phys),
parameter :: ztmax = 1.0
2040 real (kind=kind_phys),
parameter :: hpbl = 1000.0
2041 real (kind=kind_phys),
parameter :: sqvisc = 258.2
2043 real (kind=kind_phys),
parameter :: ric = 0.183
2044 real (kind=kind_phys),
parameter :: rric = 1.0/ric
2045 real (kind=kind_phys),
parameter :: fhneu = 0.8
2046 real (kind=kind_phys),
parameter :: rfc = 0.191
2047 real (kind=kind_phys),
parameter :: rfac = ric/(fhneu*rfc*rfc)
2057 real (kind=kind_phys) :: zilfc, zu, zt, rdz, cxch, dthv, du2, &
2058 & btgh, wstar2, ustar, zslu, zslt, rlogu, rlogt, rlmo, &
2059 & zetalt, zetalu, zetau, zetat, xlu4, xlt4, xu4, xt4, &
2060 & xlu, xlt, xu, xt, psmz, simm, pshz, simh, ustark, &
2063 integer :: ilech, itr
2067 real (kind=kind_phys) :: pslmu, pslms, pslhu, pslhs, zz
2068 real (kind=kind_phys) :: pspmu, pspms, psphu, psphs, xx, yy
2072 pslmu( zz ) = -0.96 * log( 1.0-4.5*zz )
2073 pslms( zz ) = zz*rric - 2.076*(1.0 - 1.0/(zz + 1.0))
2074 pslhu( zz ) = -0.96 * log( 1.0-4.5*zz )
2075 pslhs( zz ) = zz*rfac - 2.076*(1.0 - 1.0/(zz + 1.0))
2079 pspmu( xx ) = -2.0 * log( (xx + 1.0)*0.5 ) &
2080 & - log( (xx*xx + 1.0)*0.5 ) + 2.0*atan(xx) - pihf
2081 pspms( yy ) = 5.0 * yy
2082 psphu( xx ) = -2.0 * log( (xx*xx + 1.0)*0.5 )
2083 psphs( yy ) = 5.0 * yy
2096 zilfc = -czil * vkrm * sqvisc
2103 du2 = max( sfcspd*sfcspd, epsu2 )
2110 if (btgh*ch*dthv /= 0.0)
then
2111 wstar2 = wwst2 * abs( btgh*ch*dthv )**(2.0/3.0)
2116 ustar = max( sqrt( cm*sqrt( du2+wstar2 ) ), epsust )
2120 zt = exp( zilfc*sqrt( ustar*z0 ) ) * z0
2129 rlogu = log( zslu/zu )
2130 rlogt = log( zslt/zt )
2132 rlmo = elfc*ch*dthv / ustar**3
2144 zetalt = max( zslt*rlmo, ztmin )
2145 rlmo = zetalt / zslt
2146 zetalu = zslu * rlmo
2150 if (ilech == 0)
then
2152 if (rlmo < 0.0)
then
2153 xlu4 = 1.0 - 16.0 * zetalu
2154 xlt4 = 1.0 - 16.0 * zetalt
2155 xu4 = 1.0 - 16.0 * zetau
2156 xt4 = 1.0 - 16.0* zetat
2158 xlu = sqrt( sqrt( xlu4 ) )
2159 xlt = sqrt( sqrt( xlt4 ) )
2160 xu = sqrt( sqrt( xu4 ) )
2161 xt = sqrt( sqrt( xt4 ) )
2171 simm = pspmu( xlu ) - psmz + rlogu
2173 simh = psphu( xlt ) - pshz + rlogt
2175 zetalu = min( zetalu, ztmax )
2176 zetalt = min( zetalt, ztmax )
2177 psmz = pspms( zetau )
2185 simm = pspms( zetalu ) - psmz + rlogu
2186 pshz = psphs( zetat )
2187 simh = psphs( zetalt ) - pshz + rlogt
2194 if (rlmo < 0.0)
then
2195 psmz = pslmu( zetau )
2203 simm = pslmu( zetalu ) - psmz + rlogu
2204 pshz = pslhu( zetat )
2205 simh = pslhu( zetalt ) - pshz + rlogt
2207 zetalu = min( zetalu, ztmax )
2208 zetalt = min( zetalt, ztmax )
2210 psmz = pslms( zetau )
2218 simm = pslms( zetalu ) - psmz + rlogu
2219 pshz = pslhs( zetat )
2220 simh = pslhs( zetalt ) - pshz + rlogt
2227 ustar = max( sqrt( cm*sqrt( du2+wstar2 ) ), epsust )
2231 zt = exp( zilfc*sqrt( ustar*z0 ) ) * z0
2234 rlogt = log( zslt/zt )
2236 ustark = ustar * vkrm
2237 cm = max( ustark/simm, cxch )
2238 ch = max( ustark/simh, cxch )
2242 if (btgh*ch*dthv /= 0.0)
then
2243 wstar2 = wwst2 * abs(btgh*ch*dthv) ** (2.0/3.0)
2248 rlmn = elfc*ch*dthv / ustar**3
2249 rlma = rlmo*wold + rlmn*wnew
2313 real (kind=kind_phys) :: rsnow, z0n
2321 if (sneqv < snup)
then
2322 rsnow = sneqv / snup
2323 sncovr = 1.0 - (exp(-salp*rsnow) - rsnow*exp(-salp))
2453 real,
parameter :: esdmin = 1.e-6
2479 real (kind=kind_phys):: denom, dsoil, dtot, etp1, ssoil1, &
2480 & snoexp, ex, t11, t12, t12a, t12b, yy, zz1, seh, t14, &
2481 & ec1, edir1, ett1, etns, etns1, esnow1, esnow2, etanrg, &
2504 prcp1 = prcp1 * 0.001
2534 etanrg = etp * ((1.0-sncovr)*lsubc + sncovr*lsubs)
2543 esnow1 = esnow * 0.001
2544 esnow2 = esnow1 * dt
2545 etanrg = esnow * lsubs
2549 if (sncovr < 1.0)
then
2553 & ( nsoil, nroot, cmc, cmcmax, etp1, dt, zsoil, &
2554 & sh2o, smcmax, smcwlt, smcref, smcdry, pc, &
2555 & shdfac, cfactr, rtdis, fxexp, &
2557 & etns1, edir1, ec1, et1, ett1 &
2560 edir1 = edir1 * (1.0 - sncovr)
2561 ec1 = ec1 * (1.0 - sncovr)
2564 et1(k) = et1(k) * (1.0 - sncovr)
2567 ett1 = ett1 * (1.0 - sncovr)
2568 etns1 = etns1 * (1.0 - sncovr)
2570 edir = edir1 * 1000.0
2574 et(k) = et1(k) * 1000.0
2578 etns = etns1 * 1000.0
2582 esnow = etp * sncovr
2584 esnow1 = esnow * 0.001
2585 esnow2 = esnow1 * dt
2586 etanrg = esnow*lsubs + etns*lsubc
2600 flx1 = (cpice* ffrozp + cph2o1*(1.-ffrozp)) &
2601 & * prcp * (t1 - sfctmp)
2603 if (prcp > 0.0) flx1 = cph2o1 * prcp * (t1 - sfctmp)
2613 dsoil = -0.5 * zsoil(1)
2614 dtot = snowh + dsoil
2615 denom = 1.0 + df1 / (dtot * rr * rch)
2619 t12a = ( (fdown - flx1 - flx2 - sfcems*sigma1*t24) / rch &
2620 & + th2 - sfctmp - etanrg/rch ) / rr
2622 t12b = df1 * stc(1) / (dtot * rr * rch)
2623 t12 = (sfctmp + t12a + t12b) / denom
2634 if (t12 <= tfreez)
then
2637 ssoil = df1 * (t1 - stc(1)) / dtot
2639 sneqv = max(0.0, sneqv-esnow2)
2664 t1 = tfreez * max(0.01,sncovr**snoexp) + &
2665 & t12 * (1.0 - max(0.01,sncovr**snoexp))
2668 ssoil = df1 * (t1 - stc(1)) / dtot
2674 if (sneqv-esnow2 <= esdmin)
then
2686 sneqv = sneqv - esnow2
2687 seh = rch * (t1 - th2)
2692 flx3 = fdown - flx1 - flx2 - sfcems*sigma1*t14 &
2693 & - ssoil - seh - etanrg
2694 if (flx3 <= 0.0) flx3 = 0.0
2696 ex = flx3 * 0.001 / lsubf
2709 if (sneqv-snomlt >= esdmin)
then
2711 sneqv = sneqv - snomlt
2718 flx3 = ex * 1000.0 * lsubf
2735 if (ice == 0) prcp1 = prcp1 + ex
2752 & ( nsoil, dt, kdt, smcmax, smcwlt, cmcmax, prcp1, &
2753 & zsoil, slope, frzx, bexp, dksat, dwsat, shdfac, &
2754 & edir1, ec1, et1, &
2758 & runoff1, runoff2, runoff3, drip &
2771 yy = stc(1) - 0.5*ssoil*zsoil(1)*zz1 / df1
2782 & ( nsoil, smc, smcmax, dt, yy, zz1, zsoil, zbot, &
2783 & psisat, bexp, df1, ice, quartz, csoil, vegtyp, &
2784 & shdfac, lheatstrg, &
2786 & stc, t11, tbot, sh2o, &
2796 if (sneqv > 0.0)
then
2800 & ( sneqv, dt, t1, yy, &
2821 elseif (ice == 1)
then
2823 if (sneqv >= 0.01)
then
2827 & ( sneqv, dt, t1, yy, &
2845 if (sneqv >= 0.10)
then
2849 & ( sneqv, dt, t1, yy, &
2914 real(kind=kind_phys) :: dsnew, snowhc, hnewc, newsnc, tempc
2921 snowhc = snowh * 100.0
2922 newsnc = sn_new * 100.0
2923 tempc = sfctmp - tfreez
2930 if(.not. exticeden)
then
2931 if (tempc <= -15.0)
then
2934 dsnew = 0.05 + 0.0017*(tempc + 15.0)**1.5
2937 dsnew = rhonewsn*0.001
2942 hnewc = newsnc / dsnew
2943 sndens = (snowhc*sndens + hnewc*dsnew) / (snowhc + hnewc)
2944 snowhc = snowhc + hnewc
2945 snowh = snowhc * 0.01
2988 real(kind=kind_phys) :: z0s
2996 z0 = (1.0 - sncovr)*z0 + sncovr*z0s
3011 & ( smc, qz, smcmax, sh2o, &
3061 real (kind=kind_phys),
intent(in) :: smc, qz, smcmax, sh2o
3064 real (kind=kind_phys),
intent(out) :: df
3067 real (kind=kind_phys) :: gammd, thkdry, ake, thkice, thko, &
3068 & thkqtz, thksat, thks, thkw, satratio, xu, xunfroz
3077 satratio = smc / smcmax
3088 thks = (thkqtz**qz) * (thko**(1.0-qz))
3092 xunfroz = (sh2o + 1.e-9) / (smc + 1.e-9)
3100 thksat = thks**(1.-smcmax) * thkice**(smcmax-xu) * thkw**(xu)
3104 gammd = (1.0 - smcmax) * 2700.0
3108 thkdry = (0.135*gammd + 64.7) / (2700.0 - 0.947*gammd)
3110 if ( sh2o+0.0005 < smc )
then
3117 if ( satratio > 0.1 )
then
3123 ake = log10( satratio ) + 1.0
3136 df = ake * (thksat - thkdry) + thkdry
3158 & ( nsoil, nroot, cmc, cmcmax, etp1, dt, zsoil, &
3159 & sh2o, smcmax, smcwlt, smcref, smcdry, pc, &
3160 & shdfac, cfactr, rtdis, fxexp, &
3162 & eta1, edir1, ec1, et1, ett1 &
3208 integer,
intent(in) :: nsoil, nroot
3210 real (kind=kind_phys),
intent(in) :: cmc, cmcmax, etp1, dt, pc, &
3211 & smcmax, smcwlt, smcref, smcdry, shdfac, cfactr, fxexp, &
3212 & zsoil(nsoil), sh2o(nsoil), rtdis(nsoil)
3215 real (kind=kind_phys),
intent(out) :: eta1, edir1, ec1, ett1, &
3219 real (kind=kind_phys) :: cmc2ms
3237 if (etp1 > 0.0)
then
3243 if (shdfac < 1.0)
then
3247 & ( etp1, sh2o(1), shdfac, smcmax, smcdry, fxexp, &
3257 if (shdfac > 0.0)
then
3261 & ( nsoil, nroot, etp1, sh2o, smcwlt, smcref, &
3262 & cmc, cmcmax, zsoil, shdfac, pc, cfactr, rtdis, &
3268 ett1 = ett1 + et1(k)
3275 ec1 = shdfac * ( (cmc/cmcmax)**cfactr ) * etp1
3284 ec1 = min( cmc2ms, ec1 )
3291 eta1 = edir1 + ett1 + ec1
3296 end subroutine evapo
3307 & ( nsoil, smc, smcmax, dt, yy, zz1, zsoil, zbot, &
3308 & psisat, bexp, df1, ice, quartz, csoil, vegtyp, &
3309 & shdfac, lheatstrg, &
3311 & stc, t1, tbot, sh2o, &
3360 real (kind=kind_phys),
parameter :: ctfil1 = 0.5
3361 real (kind=kind_phys),
parameter :: ctfil2 = 1.0 - ctfil1
3364 integer,
intent(in) :: nsoil, ice, vegtyp
3366 real (kind=kind_phys),
intent(in) :: smc(nsoil), smcmax, dt, yy, &
3367 & zz1, zsoil(nsoil), zbot, psisat, bexp, df1, quartz, csoil, &
3370 logical,
intent(in) :: lheatstrg
3373 real (kind=kind_phys),
intent(inout) :: stc(nsoil), t1, tbot, &
3377 real (kind=kind_phys),
intent(out) :: ssoil
3380 real (kind=kind_phys) :: ai(nsold), bi(nsold), ci(nsold), oldt1, &
3381 & rhsts(nsold), stcf(nsold), stsoil(nsoil)
3401 & ( nsoil, stc, zsoil, yy, zz1, df1, ice, &
3405 & rhsts, ai, bi, ci &
3410 & ( nsoil, stc, dt, &
3412 & rhsts, ai, bi, ci, &
3423 & ( nsoil, stc, smc, smcmax, zsoil, yy, zz1, tbot, &
3424 & zbot, psisat, dt, bexp, df1, quartz, csoil,vegtyp, &
3425 & shdfac, lheatstrg, &
3429 & rhsts, ai, bi, ci &
3434 & ( nsoil, stc, dt, &
3436 & rhsts, ai, bi, ci, &
3453 t1 = (yy + (zz1 - 1.0)*stc(1)) / zz1
3454 t1 = ctfil1*t1 + ctfil2*oldt1
3457 stc(i) = ctfil1*stc(i) + ctfil2*stsoil(i)
3462 ssoil = df1*(stc(1) - t1) / (0.5*zsoil(1))
3467 end subroutine shflx
3481 & ( nsoil, dt, kdt, smcmax, smcwlt, cmcmax, prcp1, &
3482 & zsoil, slope, frzx, bexp, dksat, dwsat, shdfac, &
3483 & edir1, ec1, et1, &
3487 & runoff1, runoff2, runoff3, drip &
3537 integer,
intent(in) :: nsoil
3539 real (kind=kind_phys),
intent(in) :: dt, kdt, smcmax, smcwlt, &
3540 & cmcmax, prcp1, slope, frzx, bexp, dksat, dwsat, shdfac, &
3541 & edir1, ec1, et1(nsoil), zsoil(nsoil)
3544 real (kind=kind_phys),
intent(inout) :: cmc, sh2o(nsoil), &
3548 real (kind=kind_phys),
intent(out) :: runoff1, runoff2, &
3552 real (kind=kind_phys) :: dummy, excess, pcpdrp, rhsct, trhsct, &
3553 & rhstt(nsold), sice(nsold), sh2oa(nsold), sh2ofg(nsold), &
3554 & ai(nsold), bi(nsold), ci(nsold)
3566 rhsct = shdfac*prcp1 - ec1
3574 excess = cmc + trhsct
3576 if (excess > cmcmax) drip = excess - cmcmax
3581 pcpdrp = (1.0 - shdfac)*prcp1 + drip/dt
3586 sice(i) = smc(i) - sh2o(i)
3610 if ( (pcpdrp*dt) > (0.001*1000.0*(-zsoil(1))*smcmax) )
then
3619 & ( nsoil, edir1, et1, sh2o, sh2o, pcpdrp, zsoil, dwsat, &
3620 & dksat, smcmax, bexp, dt, smcwlt, slope, kdt, frzx, sice, &
3622 & rhstt, runoff1, runoff2, ai, bi, ci &
3627 & ( nsoil, sh2o, rhsct, dt, smcmax, cmcmax, zsoil, sice, &
3629 & dummy, rhstt, ai, bi, ci, &
3631 & sh2ofg, runoff3, smc &
3635 sh2oa(k) = (sh2o(k) + sh2ofg(k)) * 0.5
3640 & ( nsoil, edir1, et1, sh2o, sh2oa, pcpdrp, zsoil, dwsat, &
3641 & dksat, smcmax, bexp, dt, smcwlt, slope, kdt, frzx, sice, &
3643 & rhstt, runoff1, runoff2, ai, bi, ci &
3648 & ( nsoil, sh2o, rhsct, dt, smcmax, cmcmax, zsoil, sice, &
3650 & cmc, rhstt, ai, bi, ci, &
3652 & sh2o, runoff3, smc &
3659 & ( nsoil, edir1, et1, sh2o, sh2o, pcpdrp, zsoil, dwsat, &
3660 & dksat, smcmax, bexp, dt, smcwlt, slope, kdt, frzx, sice, &
3662 & rhstt, runoff1, runoff2, ai, bi, ci &
3667 & ( nsoil, sh2o, rhsct, dt, smcmax, cmcmax, zsoil, sice, &
3669 & cmc, rhstt, ai, bi, ci, &
3671 & sh2o, runoff3, smc &
3680 end subroutine smflx
3693 & ( esd, dtsec, tsnow, tsoil, &
3727 real (kind=kind_phys),
parameter :: c1 = 0.01
3728 real (kind=kind_phys),
parameter :: c2 = 21.0
3731 real (kind=kind_phys),
intent(in) :: esd, dtsec, tsnow, tsoil
3734 real (kind=kind_phys),
intent(inout) :: snowh, sndens
3737 real (kind=kind_phys) :: bfac, dsx, dthr, dw, snowhc, pexp, &
3738 & tavgc, tsnowc, tsoilc, esdc, esdcx
3746 snowhc = snowh * 100.0
3748 dthr = dtsec / 3600.0
3749 tsnowc = tsnow - tfreez
3750 tsoilc = tsoil - tfreez
3754 tavgc = 0.5 * (tsnowc + tsoilc)
3764 if (esdc > 1.e-2)
then
3770 bfac = dthr*c1 * exp(0.08*tavgc - c2*sndens)
3795 pexp = (1.0 + pexp)*bfac*esdcx/real(j+1)
3820 dsx = max( min( dsx, 0.40 ), 0.05 )
3827 if (tsnowc >= 0.0)
then
3828 dw = 0.13 * dthr / 24.0
3829 sndens = sndens*(1.0 - dw) + dw
3830 if (sndens > 0.40) sndens = 0.40
3836 snowhc = esdc / sndens
3837 snowh = snowhc * 0.01
3856 & ( etp1, smc, shdfac, smcmax, smcdry, fxexp, &
3886 real (kind=kind_phys),
intent(in) :: etp1, smc, shdfac, smcmax, &
3890 real (kind=kind_phys),
intent(out) :: edir1
3893 real (kind=kind_phys) :: fx, sratio
3902 sratio = (smc - smcdry) / (smcmax - smcdry)
3904 if (sratio > 0.0)
then
3906 fx = max( min( fx, 1.0 ), 0.0 )
3913 edir1 = fx * ( 1.0 - shdfac ) * etp1
3917 end subroutine devap
3936 & ( tkelv, smc, sh2o, smcmax, bexp, psis, &
3976 real (kind=kind_phys),
parameter :: ck = 8.0
3978 real (kind=kind_phys),
parameter :: blim = 5.5
3979 real (kind=kind_phys),
parameter ::
error = 0.005
3982 real (kind=kind_phys),
intent(in) :: tkelv, smc, sh2o, smcmax, &
3986 real (kind=kind_phys),
intent(out) :: liqwat
3989 real (kind=kind_phys) :: bx, denom, df, dswl, fk, swl, swlk
3991 integer :: nlog, kcount
4000 if (bexp > blim) bx = blim
4009 if (tkelv > (tfreez-1.e-3))
then
4026 swl = max( min( swl, smc-0.02 ), 0.0 )
4030 do while ( (nlog < 10) .and. (kcount == 0) )
4033 df = log( (psis*gs2/lsubf) * ( (1.0 + ck*swl)**2.0 ) &
4034 & * (smcmax/(smc-swl))**bx ) - log(-(tkelv-tfreez)/tkelv)
4036 denom = 2.0*ck/(1.0 + ck*swl) + bx/(smc - swl)
4037 swlk = swl - df/denom
4041 swlk = max( min( swlk, smc-0.02 ), 0.0 )
4045 dswl = abs(swlk - swl)
4051 if ( dswl <=
error )
then
4066 if (kcount == 0)
then
4067 fk = ( ( (lsubf/(gs2*(-psis))) &
4068 & * ((tkelv-tfreez)/tkelv) )**(-1/bx) ) * smcmax
4070 fk = max( fk, 0.02 )
4072 liqwat = min( fk, smc )
4079 end subroutine frh2o
4091 & ( nsoil, stc, smc, smcmax, zsoil, yy, zz1, tbot, &
4092 & zbot, psisat, dt, bexp, df1, quartz, csoil, vegtyp, &
4093 & shdfac, lheatstrg, &
4097 & rhsts, ai, bi, ci &
4146 integer,
intent(in) :: nsoil, vegtyp
4148 real (kind=kind_phys),
intent(in) :: stc(nsoil), smc(nsoil), &
4149 & smcmax, zsoil(nsoil), yy, zz1, tbot, zbot, psisat, dt, &
4150 & bexp, df1, quartz, csoil, shdfac
4152 logical,
intent(in) :: lheatstrg
4155 real (kind=kind_phys),
intent(inout) :: sh2o(nsoil)
4158 real (kind=kind_phys),
intent(out) :: rhsts(nsoil), ai(nsold), &
4159 & bi(nsold), ci(nsold)
4162 real (kind=kind_phys) :: ddz, ddz2, denom, df1n, df1k, dtsdz, &
4163 & dtsdz2, hcpct, qtot, ssoil, sice, tavg, tbk, tbk1, &
4164 & tsnsr, tsurf, csoil_loc
4175 if (.not.lheatstrg .and. ivegsrc == 1)
then
4180 if( vegtyp == 13 )
then
4182 csoil_loc=3.0e6*(1.-shdfac)+csoil*shdfac
4195 hcpct = sh2o(1)*cph2o2 + (1.0 - smcmax)*csoil_loc &
4196 & + (smcmax - smc(1))*cp2 + (smc(1) - sh2o(1))*cpice1
4200 ddz = 1.0 / ( -0.5*zsoil(2) )
4202 ci(1) = (df1*ddz) / ( zsoil(1)*hcpct )
4203 bi(1) = -ci(1) + df1 / ( 0.5*zsoil(1)*zsoil(1)*hcpct*zz1 )
4210 dtsdz = (stc(1) - stc(2)) / (-0.5*zsoil(2))
4211 ssoil = df1 * (stc(1) - yy) / (0.5*zsoil(1)*zz1)
4212 rhsts(1) = (df1*dtsdz - ssoil) / (zsoil(1)*hcpct)
4218 qtot = ssoil - df1*dtsdz
4231 tsurf = (yy + (zz1-1)*stc(1)) / zz1
4235 & ( stc(1), stc(2), zsoil, zbot, 1, nsoil, &
4244 sice = smc(1) - sh2o(1)
4251 if ( (sice > 0.0) .or. (tsurf < tfreez) .or. &
4252 & (stc(1) < tfreez) .or. (tbk < tfreez) )
then
4258 & ( tsurf, stc(1), tbk, zsoil, nsoil, 1, &
4271 & ( nsoil, 1, tavg, smc(1), smcmax, psisat, bexp, dt, &
4280 rhsts(1) = rhsts(1) - tsnsr / ( zsoil(1)*hcpct )
4299 hcpct = sh2o(k)*cph2o2 + (1.0 - smcmax)*csoil_loc &
4300 & + (smcmax - smc(k))*cp2 + (smc(k) - sh2o(k))*cpice1
4302 if (k /= nsoil)
then
4309 & ( smc(k), quartz, smcmax, sh2o(k), &
4321 if((.not.lheatstrg) .and.
4322 & (ivegsrc == 1 .and. vegtyp == 13))
then
4323 df1n = 3.24*(1.-shdfac) + shdfac*df1n
4328 denom = 0.5 * (zsoil(k-1) - zsoil(k+1))
4329 dtsdz2 = (stc(k) - stc(k+1)) / denom
4333 ddz2 = 2.0 / (zsoil(k-1) - zsoil(k+1))
4334 ci(k) = -df1n*ddz2 / ((zsoil(k-1) - zsoil(k)) * hcpct)
4343 & ( stc(k), stc(k+1), zsoil, zbot, k, nsoil, &
4357 & ( smc(k), quartz, smcmax, sh2o(k), &
4369 if((.not.lheatstrg) .and.
4370 & (ivegsrc == 1 .and. vegtyp == 13))
then
4371 df1n = 3.24*(1.-shdfac) + shdfac*df1n
4376 denom = 0.5 * (zsoil(k-1) + zsoil(k)) - zbot
4377 dtsdz2 = (stc(k) - tbot) / denom
4390 & ( stc(k), tbot, zsoil, zbot, k, nsoil, &
4401 denom = (zsoil(k) - zsoil(k-1)) * hcpct
4402 rhsts(k) = ( df1n*dtsdz2 - df1k*dtsdz ) / denom
4404 qtot = -1.0 * denom * rhsts(k)
4405 sice = smc(k) - sh2o(k)
4407 if ( (sice > 0.0) .or. (tbk < tfreez) .or. &
4408 & (stc(k) < tfreez) .or. (tbk1 < tfreez) )
then
4414 & ( tbk, stc(k), tbk1, zsoil, nsoil, k, &
4425 & ( nsoil, k, tavg, smc(k), smcmax, psisat, bexp, dt, &
4433 rhsts(k) = rhsts(k) - tsnsr/denom
4438 ai(k) = - df1 * ddz / ((zsoil(k-1) - zsoil(k)) * hcpct)
4439 bi(k) = -(ai(k) + ci(k))
4464 & ( nsoil, stc, zsoil, yy, zz1, df1, ice, &
4468 & rhsts, ai, bi, ci &
4507 integer,
intent(in) :: nsoil, ice
4509 real (kind=kind_phys),
intent(in) :: stc(nsoil), zsoil(nsoil), &
4513 real (kind=kind_phys),
intent(inout) :: tbot
4516 real (kind=kind_phys),
intent(out) :: rhsts(nsoil), ai(nsold), &
4517 & bi(nsold), ci(nsold)
4520 real (kind=kind_phys) :: ddz, ddz2, denom, dtsdz, dtsdz2, &
4521 & hcpct, ssoil, zbot
4563 ddz = 1.0 / (-0.5*zsoil(2))
4565 ci(1) = (df1*ddz) / (zsoil(1)*hcpct)
4566 bi(1) = -ci(1) + df1 / (0.5*zsoil(1)*zsoil(1)*hcpct*zz1)
4572 dtsdz = (stc(1) - stc(2)) / (-0.5*zsoil(2))
4573 ssoil = df1 * (stc(1) - yy) / (0.5*zsoil(1)*zz1)
4574 rhsts(1) = (df1*dtsdz - ssoil) / (zsoil(1)*hcpct)
4584 if (k /= nsoil)
then
4588 denom = 0.5 * (zsoil(k-1) - zsoil(k+1))
4589 dtsdz2 = (stc(k) - stc(k+1)) / denom
4593 ddz2 = 2.0 / (zsoil(k-1) - zsoil(k+1))
4594 ci(k) = -df1*ddz2 / ((zsoil(k-1) - zsoil(k))*hcpct)
4600 dtsdz2 = (stc(k) - tbot) &
4601 & / (0.5*(zsoil(k-1) + zsoil(k)) - zbot)
4611 denom = (zsoil(k) - zsoil(k-1)) * hcpct
4612 rhsts(k) = (df1*dtsdz2 - df1*dtsdz) / denom
4616 ai(k) = - df1*ddz / ((zsoil(k-1) - zsoil(k)) * hcpct)
4617 bi(k) = -(ai(k) + ci(k))
4637 & ( nsoil, stcin, dt, &
4639 & rhsts, ai, bi, ci, &
4671 integer,
intent(in) :: nsoil
4673 real (kind=kind_phys),
intent(in) :: stcin(nsoil), dt
4676 real (kind=kind_phys),
intent(inout) :: rhsts(nsoil), &
4677 & ai(nsold), bi(nsold), ci(nsold)
4680 real (kind=kind_phys),
intent(out) :: stcout(nsoil)
4685 real (kind=kind_phys) :: ciin(nsold), rhstsin(nsoil)
4693 rhsts(k) = rhsts(k) * dt
4695 bi(k) = 1.0 + bi(k)*dt
4702 rhstsin(k) = rhsts(k)
4713 & ( nsoil, ai, bi, rhstsin, &
4723 stcout(k) = stcin(k) + ci(k)
4728 end subroutine hstep
4737 & ( nsoil, a, b, d, &
4785 integer,
intent(in) :: nsoil
4787 real (kind=kind_phys),
dimension(nsoil),
intent(in) :: a, b, d
4790 real (kind=kind_phys),
dimension(nsoil),
intent(inout) :: c
4793 real (kind=kind_phys),
dimension(nsoil),
intent(out) :: p, delta
4808 delta(1) = d(1) / b(1)
4813 p(k) = -c(k) * ( 1.0 / (b(k) + a(k)*p(k-1)) )
4814 delta(k) = (d(k) - a(k)*delta(k-1)) &
4815 & * ( 1.0 / (b(k) + a(k)*p(k-1)) )
4820 p(nsoil) = delta(nsoil)
4826 p(kk) = p(kk)*p(kk+1) + delta(kk)
4840 & ( nsoil, k, tavg, smc, smcmax, psisat, bexp, dt, &
4880 real (kind=kind_phys),
parameter :: dh2o = 1.0000e3
4883 integer,
intent(in) :: nsoil, k
4885 real (kind=kind_phys),
intent(in) :: tavg, smc, smcmax, psisat, &
4886 & bexp, dt, qtot, zsoil(nsoil)
4889 real (kind=kind_phys),
intent(inout) :: sh2o
4892 real (kind=kind_phys),
intent(out) :: tsrc
4895 real (kind=kind_phys) :: dz, free, xh2o
4905 dz = zsoil(k-1) - zsoil(k)
4918 & ( tavg, smc, sh2o, smcmax, bexp, psisat, &
4932 xh2o = sh2o + qtot*dt / (dh2o*lsubf*dz)
4938 if ( xh2o < sh2o .and. xh2o < free)
then
4939 if ( free > sh2o )
then
4950 if ( xh2o > sh2o .and. xh2o > free )
then
4951 if ( free < sh2o )
then
4958 xh2o = max( min( xh2o, smc ), 0.0 )
4963 tsrc = -dh2o * lsubf * dz * (xh2o - sh2o) / dt
4980 & ( nsoil, edir, et, sh2o, sh2oa, pcpdrp, zsoil, dwsat, &
4981 & dksat, smcmax, bexp, dt, smcwlt, slope, kdt, frzx, sice, &
4983 & rhstt, runoff1, runoff2, ai, bi, ci &
5028 integer,
intent(in) :: nsoil
5030 real (kind=kind_phys),
dimension(nsoil),
intent(in) :: et, &
5031 & sh2o, sh2oa, zsoil, sice
5033 real (kind=kind_phys),
intent(in) :: edir, pcpdrp, dwsat, dksat, &
5034 & smcmax, smcwlt, bexp, dt, slope, kdt, frzx
5037 real (kind=kind_phys),
intent(out) :: runoff1, runoff2, &
5038 & rhstt(nsoil), ai(nsold), bi(nsold), ci(nsold)
5042 real (kind=kind_phys) :: acrt, dd, ddt, ddz, ddz2, denom, denom2, &
5043 & dice, dsmdz, dsmdz2, dt1, fcr, infmax, mxsmc, mxsmc2, px, &
5044 & numer, pddum, sicemax, slopx, smcav, sstt, sum, val, wcnd, &
5045 & wcnd2, wdf, wdf2, dmax(nsold)
5047 integer :: cvfrz, ialp1, iohinf, j, jj, k, ks
5060 parameter(cvfrz = 3)
5062c ----------------------------------------------------------------------
5074 if (sice(ks) > sicemax) sicemax = sice(ks)
5082 if (pcpdrp /= 0.0)
then
5087 smcav = smcmax - smcwlt
5088 dmax(1) = -zsoil(1) * smcav
5092 dice = -zsoil(1) * sice(1)
5094 dmax(1) = dmax(1)*(1.0 - (sh2oa(1)+sice(1)-smcwlt)/smcav)
5101 dice = dice + ( zsoil(ks-1) - zsoil(ks) ) * sice(ks)
5103 dmax(ks) = (zsoil(ks-1)-zsoil(ks))*smcav
5104 dmax(ks) = dmax(ks)*(1.0 - (sh2oa(ks)+sice(ks)-smcwlt)/smcav)
5111 val = 1.0 - exp(-kdt*dt1)
5115 if (px < 0.0) px = 0.0
5117 infmax = (px*(ddt/(px+ddt)))/dt
5124 if (dice > 1.e-2)
then
5125 acrt = cvfrz * frzx / dice
5136 sum = sum + (acrt**( cvfrz-j)) / float(k)
5139 fcr = 1.0 - exp(-acrt) * sum
5142 infmax = infmax * fcr
5153 & ( mxsmc, smcmax, bexp, dksat, dwsat, sicemax, &
5158 infmax = max( infmax, wcnd )
5159 infmax = min( infmax, px )
5161 if (pcpdrp > infmax)
then
5162 runoff1 = pcpdrp - infmax
5176 & ( mxsmc, smcmax, bexp, dksat, dwsat, sicemax, &
5183 ddz = 1.0 / ( -.5*zsoil(2) )
5185 bi(1) = wdf * ddz / ( -zsoil(1) )
5191 dsmdz = ( sh2o(1) - sh2o(2) ) / ( -.5*zsoil(2) )
5192 rhstt(1) = (wdf*dsmdz + wcnd - pddum + edir + et(1)) / zsoil(1)
5193 sstt = wdf * dsmdz + wcnd + edir + et(1)
5202 denom2 = (zsoil(k-1) - zsoil(k))
5204 if (k /= nsoil)
then
5215 & ( mxsmc2, smcmax, bexp, dksat, dwsat, sicemax, &
5222 denom = (zsoil(k-1) - zsoil(k+1))
5223 dsmdz2 = (sh2o(k) - sh2o(k+1)) / (denom * 0.5)
5228 ci(k) = -wdf2 * ddz2 / denom2
5241 & ( sh2oa(nsoil), smcmax, bexp, dksat, dwsat, sicemax, &
5257 numer = wdf2*dsmdz2 + slopx*wcnd2 - wdf*dsmdz - wcnd + et(k)
5258 rhstt(k) = numer / (-denom2)
5262 ai(k) = -wdf * ddz / denom2
5263 bi(k) = -( ai(k) + ci(k) )
5268 if (k == nsoil)
then
5269 runoff2 = slopx * wcnd2
5272 if (k /= nsoil)
then
5292 & ( nsoil, sh2oin, rhsct, dt, smcmax, cmcmax, zsoil, sice, &
5294 & cmc, rhstt, ai, bi, ci, &
5296 & sh2oout, runoff3, smc &
5334 integer,
intent(in) :: nsoil
5336 real (kind=kind_phys),
dimension(nsoil),
intent(in) :: sh2oin, &
5339 real (kind=kind_phys),
intent(in) :: rhsct, dt, smcmax, cmcmax
5342 real (kind=kind_phys),
intent(inout) :: cmc, rhstt(nsoil), &
5343 & ai(nsold), bi(nsold), ci(nsold)
5346 real (kind=kind_phys),
intent(out) :: sh2oout(nsoil), runoff3, &
5350 real (kind=kind_phys) :: ciin(nsold), rhsttin(nsoil), ddz, stot, &
5353 integer :: i, k, kk11
5361 rhstt(k) = rhstt(k) * dt
5363 bi(k) = 1. + bi(k) * dt
5370 rhsttin(k) = rhstt(k)
5381 & ( nsoil, ai, bi, rhsttin, &
5397 if (k /= 1) ddz = zsoil(k - 1) - zsoil(k)
5399 sh2oout(k) = sh2oin(k) + ci(k) + wplus/ddz
5401 stot = sh2oout(k) + sice(k)
5402 if (stot > smcmax)
then
5407 ddz = -zsoil(k) + zsoil(kk11)
5410 wplus = (stot - smcmax) * ddz
5415 smc(k) = max( min( stot, smcmax ), 0.02 )
5416 sh2oout(k) = max( smc(k)-sice(k), 0.0 )
5424 cmc = cmc + dt*rhsct
5425 if (cmc < 1.e-20) cmc = 0.0
5426 cmc = min( cmc, cmcmax )
5430 end subroutine sstep
5440 & ( tu, tb, zsoil, zbot, k, nsoil, &
5469 integer,
intent(in) :: k, nsoil
5471 real (kind=kind_phys),
intent(in) :: tu, tb, zbot, zsoil(nsoil)
5474 real (kind=kind_phys),
intent(out) :: tbnd1
5477 real (kind=kind_phys) :: zb, zup
5490 if (k == nsoil)
then
5491 zb = 2.0*zbot - zsoil(k)
5498 tbnd1 = tu + (tb-tu)*(zup-zsoil(k))/(zup-zb)
5515 & ( tup, tm, tdn, zsoil, nsoil, k, &
5547 integer,
intent(in) :: nsoil, k
5549 real (kind=kind_phys),
intent(in) :: tup, tm, tdn, zsoil(nsoil)
5552 real (kind=kind_phys),
intent(out) :: tavg
5555 real (kind=kind_phys) :: dz, dzh, x0, xdn, xup
5562 dz = zsoil(k-1) - zsoil(k)
5567 if (tup < tfreez)
then
5569 if (tm < tfreez)
then
5570 if (tdn < tfreez)
then
5571 tavg = (tup + 2.0*tm + tdn) / 4.0
5573 x0 = (tfreez - tm) * dzh / (tdn - tm)
5574 tavg = 0.5*(tup*dzh + tm*(dzh+x0)+tfreez*(2.*dzh-x0)) / dz
5577 if (tdn < tfreez)
then
5578 xup = (tfreez-tup) * dzh / (tm-tup)
5579 xdn = dzh - (tfreez-tm) * dzh / (tdn-tm)
5580 tavg = 0.5*(tup*xup + tfreez*(2.*dz-xup-xdn)+tdn*xdn) / dz
5582 xup = (tfreez-tup) * dzh / (tm-tup)
5583 tavg = 0.5*(tup*xup + tfreez*(2.*dz-xup)) / dz
5589 if (tm < tfreez)
then
5590 if (tdn < tfreez)
then
5591 xup = dzh - (tfreez-tup) * dzh / (tm-tup)
5592 tavg = 0.5*(tfreez*(dz-xup) + tm*(dzh+xup)+tdn*dzh) / dz
5594 xup = dzh - (tfreez-tup) * dzh / (tm-tup)
5595 xdn = (tfreez-tm) * dzh / (tdn-tm)
5596 tavg = 0.5 * (tfreez*(2.*dz-xup-xdn) + tm*(xup+xdn)) / dz
5599 if (tdn < tfreez)
then
5600 xdn = dzh - (tfreez-tm) * dzh / (tdn-tm)
5601 tavg = (tfreez*(dz-xdn) + 0.5*(tfreez+tdn)*xdn) / dz
5603 tavg = (tup + 2.0*tm + tdn) / 4.0
5620 & ( nsoil, nroot, etp1, smc, smcwlt, smcref, &
5621 & cmc, cmcmax, zsoil, shdfac, pc, cfactr, rtdis, &
5656 integer,
intent(in) :: nsoil, nroot
5658 real (kind=kind_phys),
intent(in) :: etp1, smcwlt, smcref, &
5659 & cmc, cmcmax, shdfac, pc, cfactr
5661 real (kind=kind_phys),
dimension(nsoil),
intent(in) :: smc, &
5665 real (kind=kind_phys),
dimension(nsoil),
intent(out) :: et1
5668 real (kind=kind_phys) :: denom, etp1a, rtx, sgx, gx(7)
5686 if (cmc /= 0.0)
then
5687 etp1a = shdfac * pc * etp1 * (1.0 - (cmc /cmcmax) ** cfactr)
5689 etp1a = shdfac * pc * etp1
5694 gx(i) = ( smc(i) - smcwlt ) / ( smcref - smcwlt )
5695 gx(i) = max( min( gx(i), 1.0 ), 0.0 )
5702 rtx = rtdis(i) + gx(i) - sgx
5703 gx(i) = gx(i) * max( rtx, 0.0 )
5704 denom = denom + gx(i)
5706 if (denom <= 0.0) denom = 1.0
5709 et1(i) = etp1a * gx(i) / denom
5754 & ( smc, smcmax, bexp, dksat, dwsat, sicemax, &
5784 real (kind=kind_phys),
intent(in) :: smc, smcmax, bexp, dksat, &
5788 real (kind=kind_phys),
intent(out) :: wdf, wcnd
5791 real (kind=kind_phys) :: expon, factr1, factr2, vkwgt
5797 factr1 = min(1.0, max(0.0, 0.2/smcmax))
5798 factr2 = min(1.0, max(0.0, smc/smcmax))
5803 wdf = dwsat * factr2 ** expon
5816 if (sicemax > 0.0)
then
5817 vkwgt = 1.0 / (1.0 + (500.0*sicemax)**3.0)
5818 wdf = vkwgt*wdf + (1.0- vkwgt)*dwsat*factr1**expon
5823 expon = (2.0 * bexp) + 3.0
5824 wcnd = dksat * factr2 ** expon
subroutine csnow
This subroutine calculates snow termal conductivity.
subroutine alcalc
This subroutine calculates albedo including snow effect (0 -> 1).
subroutine snksrc(nsoil, k, tavg, smc, smcmax, psisat, bexp, dt, qtot, zsoil, sh2o, tsrc)
This subroutine calculates sink/source term of the termal diffusion equation.
subroutine redprm(errmsg, errflg)
This subroutine internally sets default values or optionally read-in via namelist i/o,...
subroutine sstep(nsoil, sh2oin, rhsct, dt, smcmax, cmcmax, zsoil, sice, cmc, rhstt, ai, bi, ci, sh2oout, runoff3, smc)
This subroutine calculates/updates soil moisture content values and canopy moisture content values.
subroutine penman
This subroutine calculates potential evaporation for the current point. various partial sums/products...
subroutine hrtice(nsoil, stc, zsoil, yy, zz1, df1, ice, tbot, rhsts, ai, bi, ci)
This subroutine calculates the right hand side of the time tendency term of the soil thermal diffusio...
subroutine gfssflx(nsoil, couple, icein, ffrozp, dt, zlvl, sldpth, swdn, swnet, lwdn, sfcems, sfcprs, sfctmp, sfcspd, prcp, q2, q2sat, dqsdt2, th2, ivegsrc, vegtyp, soiltyp, slopetyp, shdmin, alb, snoalb, rhonewsn, exticeden, bexpp, xlaip, lheatstrg, tbot, cmc, t1, stc, smc, sh2o, sneqv, ch, cm, z0, nroot, shdfac, snowh, albedo, eta, sheat, ec, edir, et, ett, esnow, drip, dew, beta, etp, ssoil, flx1, flx2, flx3, runoff1, runoff2, runoff3, snomlt, sncovr, rc, pc, rsmin, xlai, rcs, rct, rcq, rcsoil, soilw, soilm, smcwlt, smcdry, smcref, smcmax, errmsg, errflg)
This is the entity of GFS Noah LSM model of physics subroutines. It is a soil/veg/snowpack land-surfa...
subroutine rosr12(nsoil, a, b, d, c, p, delta)
This subroutine inverts (solve) the tri-diagonal matrix problem.
subroutine evapo(nsoil, nroot, cmc, cmcmax, etp1, dt, zsoil, sh2o, smcmax, smcwlt, smcref, smcdry, pc, shdfac, cfactr, rtdis, fxexp, eta1, edir1, ec1, et1, ett1)
This subroutine calculates soil moisture flux. The soil moisture content (smc - a per unit volume mea...
subroutine transp(nsoil, nroot, etp1, smc, smcwlt, smcref, cmc, cmcmax, zsoil, shdfac, pc, cfactr, rtdis, et1)
This subroutine calculates transpiration for the veg class.
subroutine frh2o(tkelv, smc, sh2o, smcmax, bexp, psis, liqwat)
This subroutine calculates amount of supercooled liquid soil water content if temperature is below 27...
subroutine tdfcnd(smc, qz, smcmax, sh2o, df)
This subroutine calculates thermal diffusivity and conductivity of the soil for a given point and tim...
subroutine tbnd(tu, tb, zsoil, zbot, k, nsoil, tbnd1)
This subroutine calculates temperature on the boundary of the layer by interpolation of the middle la...
subroutine nopac
This subroutine calculates soil moisture and heat flux values and update soil moisture content and so...
subroutine snowz0
This subroutine calculates total roughness length over snow.
subroutine shflx(nsoil, smc, smcmax, dt, yy, zz1, zsoil, zbot, psisat, bexp, df1, ice, quartz, csoil, vegtyp, shdfac, lheatstrg, stc, t1, tbot, sh2o, ssoil)
This subroutine updates the temperature state of the soil column based on the thermal diffusion equat...
subroutine canres
This subroutine calculates canopy resistance which depends on incoming solar radiation,...
subroutine snowpack(esd, dtsec, tsnow, tsoil, snowh, sndens)
This subroutine calculates compaction of a snowpack under conditions of increasing snow density,...
subroutine snow_new
This subroutine calculates snow depth and densitity to account for the new snowfall....
subroutine hrt(nsoil, stc, smc, smcmax, zsoil, yy, zz1, tbot, zbot, psisat, dt, bexp, df1, quartz, csoil, vegtyp, shdfac, lheatstrg, sh2o, rhsts, ai, bi, ci)
This subroutine calculates the right hand side of the time tendency term of the soil thermal diffusio...
subroutine devap(etp1, smc, shdfac, smcmax, smcdry, fxexp, edir1)
This subrtouine calculates direct soil evaporation.
subroutine wdfcnd(smc, smcmax, bexp, dksat, dwsat, sicemax, wdf, wcnd)
This subroutine calculates soil water diffusivity and soil hydraulic conductivity.
subroutine hstep(nsoil, stcin, dt, rhsts, ai, bi, ci, stcout)
This subroutine calculates/updates the soil temperature field.
subroutine snopac
This subroutine calculates soil moisture and heat flux values and update soil moisture content and so...
subroutine tmpavg(tup, tm, tdn, zsoil, nsoil, k, tavg)
This subroutine calculates soil layer average temperature (tavg) in freezing/thawing layer using up,...
subroutine srt(nsoil, edir, et, sh2o, sh2oa, pcpdrp, zsoil, dwsat, dksat, smcmax, bexp, dt, smcwlt, slope, kdt, frzx, sice, rhstt, runoff1, runoff2, ai, bi, ci)
This subroutine calculates the right hand side of the time tendency term of the soil water diffusion ...
subroutine smflx(nsoil, dt, kdt, smcmax, smcwlt, cmcmax, prcp1, zsoil, slope, frzx, bexp, dksat, dwsat, shdfac, edir1, ec1, et1, cmc, sh2o, smc, runoff1, runoff2, runoff3, drip)
This subroutine calculates soil moisture flux. The soil moisture content (smc - a per unit vulume mea...
subroutine snfrac
This subroutine calculates snow fraction (0->1).
subroutine sfcdif
This subroutine calculates surface layer exchange coefficients via iterative process(see Chen et al....
subroutine albedo(parameters, vegtyp, ist, ice, nsoil, dt, cosz, fage, elai, esai, tg, tv, snowh, fsno, fwet, smc, sneqvo, sneqv, qsnow, fveg, iloc, jloc, albold, tauss, albgrd, albgri, albd, albi, fabd, fabi, ftdd, ftid, ftii, fsun, frevi, frevd, fregd, fregi, bgap, wgap, albsnd, albsni)
surface albedos. also fluxes (per unit incoming direct and diffuse radiation) reflected,...
subroutine error(parameters, swdown,fsa,fsr,fira,fsh,fcev, fgev,fctr,ssoil,beg_wb,canliq,canice, sneqv,wa,smc,dzsnso,prcp,ecan, etran,edir,runsrf,runsub,dt,nsoil, nsnow,ist,errwat, iloc,jloc,fveg, sav,sag,fsrv,fsrg,zwt,pah, ifdef ccpp
check surface energy balance and water balance.
This module contains namelist options for Noah LSM.
This module contains the entity of GFS Noah LSM Model(Version 2.7).