144 &
ivflip, kind_phys, kind_io4
149 use module_iounitdef
, only : nicltun
156 character(40),
parameter :: &
157 & VTAGCLD=
'NCEP-Radiation_clouds v5.1 Nov 2012 ' 172 data ptopc / 1050., 650., 400., 0.0, 1050., 750., 500., 0.0 /
176 real (kind=kind_phys),
parameter ::
ovcst = 1.0 - 1.0e-8
196 real (kind=kind_phys),
parameter ::
xlim=5.0
199 data xlabdy / 30.0, 0.0, -30.0 /,
xlobdy / 0.0, 180., 360. /
202 real (kind=kind_phys),
parameter ::
vvcld1= 0.0003e0
203 real (kind=kind_phys),
parameter ::
vvcld2=-0.0005e0
274 integer,
intent(in) :: NLAY, me
276 real (kind=kind_phys),
intent(in) :: si(:)
281 integer :: k, kl, ier
293 if (me == 0) print *,
' - Using Diagnostic Cloud Method' 303 99
format(3x,
' *** Error in finding tuned RH table ***' &
304 &, /3x,
' STOP at calling subroutine RHTABLE !!'/)
309 print *,
' - Using Prognostic Cloud Method' 311 print *,
' --- Zhao/Carr/Sundqvist microphysics' 313 print *,
' --- Ferrier cloud microphysics' 315 print *,
' --- zhao/carr/sundqvist + pdf cloud' 317 print *,
' !!! ERROR in cloud microphysc specification!!!', &
329 lab_do_k0 :
do k = nlay, 2, -1
331 if (si(k) < 0.9e0)
exit lab_do_k0
336 lab_do_k1 :
do k = 2, nlay
338 if (si(k) < 0.9e0)
exit lab_do_k1
386 & ( plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw, &
388 & ix, nlay, nlp1, shoc_cld, cldcov, &
390 & clouds,clds,mtop,mbot &
465 integer,
intent(in) :: IX, NLAY, NLP1
467 logical,
intent(in) :: shoc_cld
468 real (kind=kind_phys),
dimension(:,:),
intent(in) :: plvl, plyr, &
469 & tlyr, tvly, qlyr, qstl, rhly, clw, cldcov
471 real (kind=kind_phys),
dimension(:),
intent(in) :: xlat, xlon, &
475 real (kind=kind_phys),
dimension(:,:,:),
intent(out) :: clouds
477 real (kind=kind_phys),
dimension(:,:),
intent(out) :: clds
479 integer,
dimension(:,:),
intent(out) :: mtop,mbot
482 real (kind=kind_phys),
dimension(IX,NLAY) :: cldtot, cldcnv, &
483 & cwp, cip, crp, csp, rew, rei, res, rer, delp, tem2d, clwf
485 real (kind=kind_phys) :: ptop1(ix,
nk_clds+1)
487 real (kind=kind_phys) :: clwmin, clwm, clwt, onemrh,
value, &
490 integer :: i, k, id, nf
516 tem2d(i,k) = min( 1.0, max( 0.0, (
con_ttp-tlyr(i,k))*0.05 ) )
523 clwf(i,1) = 0.75*clw(i,1) + 0.25*clw(i,2)
524 clwf(i,nlay) = 0.75*clw(i,nlay) + 0.25*clw(i,nlay-1)
528 clwf(i,k) = 0.25*clw(i,k-1) + 0.5*clw(i,k) + 0.25*clw(i,k+1)
551 ptop1(i,id) =
ptopc(id,1) + tem1*max( 0.0, 4.0*abs(tem2)-1.0 )
561 delp(i,k) = plvl(i,k+1) - plvl(i,k)
562 clwt = max(0.0, clwf(i,k)) *
gfac * delp(i,k)
563 cip(i,k) = clwt * tem2d(i,k)
564 cwp(i,k) = clwt - cip(i,k)
570 delp(i,k) = plvl(i,k) - plvl(i,k+1)
571 clwt = max(0.0, clwf(i,k)) *
gfac * delp(i,k)
572 cip(i,k) = clwt * tem2d(i,k)
573 cwp(i,k) = clwt - cip(i,k)
582 if (nint(slmsk(i)) == 1)
then 584 rew(i,k) = 5.0 + 5.0 * tem2d(i,k)
591 cldtot(i,k) = cldcov(i,k)
604 clwt = 1.0e-6 * (plyr(i,k)*0.001)
607 if (clwf(i,k) > clwt)
then 609 onemrh= max( 1.e-10, 1.0-rhly(i,k) )
610 clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
612 tem1 = min(max(sqrt(sqrt(onemrh*qstl(i,k))),0.0001),1.0)
616 value = max( min( tem1*(clwf(i,k)-clwm), 50.0 ), 0.0 )
617 tem2 = sqrt( sqrt(rhly(i,k)) )
619 cldtot(i,k) = max( tem2*(1.0-exp(-
value)), 0.0 )
626 clwt = 1.0e-6 * (plyr(i,k)*0.001)
629 if (clwf(i,k) > clwt)
then 630 onemrh= max( 1.e-10, 1.0-rhly(i,k) )
631 clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
636 tem1 = min(max((onemrh*qstl(i,k))**0.49,0.0001),1.0)
643 value = max( min( tem1*(clwf(i,k)-clwm), 50.0 ), 0.0 )
644 tem2 = sqrt( sqrt(rhly(i,k)) )
645 cldtot(i,k) = max( tem2*(1.0-exp(-
value)), 0.0 )
657 clwt = 1.0e-6 * (plyr(i,k)*0.001)
660 if (clwf(i,k) > clwt)
then 662 onemrh= max( 1.e-10, 1.0-rhly(i,k) )
663 clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
665 tem1 = min(max(sqrt(sqrt(onemrh*qstl(i,k))),0.0001),1.0)
670 value = max( min( tem1*(clwf(i,k)-clwm), 50.0 ), 0.0 )
671 tem2 = sqrt( sqrt(rhly(i,k)) )
673 cldtot(i,k) = max( tem2*(1.0-exp(-
value)), 0.0 )
680 clwt = 1.0e-6 * (plyr(i,k)*0.001)
683 if (clwf(i,k) > clwt)
then 684 onemrh= max( 1.e-10, 1.0-rhly(i,k) )
685 clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
690 tem1 = min(max((onemrh*qstl(i,k))**0.49,0.0001),1.0)
697 value = max( min( tem1*(clwf(i,k)-clwm), 50.0 ), 0.0 )
698 tem2 = sqrt( sqrt(rhly(i,k)) )
700 cldtot(i,k) = max( tem2*(1.0-exp(-
value)), 0.0 )
711 if (cldtot(i,k) <
climit)
then 724 if (cldtot(i,k) >=
climit)
then 725 tem1 = 1.0 / max(
climit2, cldtot(i,k))
726 cwp(i,k) = cwp(i,k) * tem1
727 cip(i,k) = cip(i,k) * tem1
728 crp(i,k) = crp(i,k) * tem1
729 csp(i,k) = csp(i,k) * tem1
748 if (cip(i,k) > 0.0)
then 749 tem3 =
gord * cip(i,k) * plyr(i,k) / (delp(i,k)*tvly(i,k))
751 if (tem2 < -50.0)
then 752 rei(i,k) = (1250.0/9.917) * tem3 ** 0.109
753 elseif (tem2 < -40.0)
then 754 rei(i,k) = (1250.0/9.337) * tem3 ** 0.08
755 elseif (tem2 < -30.0)
then 756 rei(i,k) = (1250.0/9.208) * tem3 ** 0.055
758 rei(i,k) = (1250.0/9.387) * tem3 ** 0.031
762 rei(i,k) = max(10.0, min(rei(i,k), 150.0))
771 clouds(i,k,1) = cldtot(i,k)
772 clouds(i,k,2) = cwp(i,k)
773 clouds(i,k,3) = rew(i,k)
774 clouds(i,k,4) = cip(i,k)
775 clouds(i,k,5) = rei(i,k)
777 clouds(i,k,7) = rer(i,k)
779 clouds(i,k,9) = rei(i,k)
792 & ( plyr, ptop1, cldtot, cldcnv, &
846 & ( plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw, &
847 & xlat,xlon,slmsk, f_ice,f_rain,r_rime,flgmin, &
850 & clouds,clds,mtop,mbot &
934 integer,
intent(in) :: IX, NLAY, NLP1
936 real (kind=kind_phys),
dimension(:,:),
intent(in) :: plvl, plyr, &
937 & tlyr, tvly, qlyr, qstl, rhly, clw, f_ice, f_rain, r_rime
939 real (kind=kind_phys),
dimension(:),
intent(in) :: xlat, xlon, &
941 real (kind=kind_phys),
dimension(:),
intent(in) :: flgmin
944 real (kind=kind_phys),
dimension(:,:,:),
intent(out) :: clouds
946 real (kind=kind_phys),
dimension(:,:),
intent(out) :: clds
948 integer,
dimension(:,:),
intent(out) :: mtop,mbot
951 real (kind=kind_phys),
dimension(IX,NLAY) :: cldtot, cldcnv, &
952 & cwp, cip, crp, csp, rew, rei, res, rer, tem2d, clw2, &
953 & qcwat, qcice, qrain, fcice, frain, rrime, rsden, clwf
955 real (kind=kind_phys) :: ptop1(ix,
nk_clds+1)
957 real (kind=kind_phys) :: clwmin, clwm, clwt, onemrh,
value, &
979 fcice(i,k) = max(0.0, min(1.0, f_ice(i,k)))
980 frain(i,k) = max(0.0, min(1.0, f_rain(i,k)))
981 rrime(i,k) = max(1.0, r_rime(i,k))
982 tem2d(i,k) = tlyr(i,k) -
con_t0c 988 clwf(i,1) = 0.75*clw(i,1) + 0.25*clw(i,2)
989 clwf(i,nlay) = 0.75*clw(i,nlay) + 0.25*clw(i,nlay-1)
993 clwf(i,k) = 0.25*clw(i,k-1) + 0.5*clw(i,k) + 0.25*clw(i,k+1)
1016 ptop1(i,id) =
ptopc(id,1) + tem1*max( 0.0, 4.0*abs(tem2)-1.0 )
1028 if (tem2d(i,k) > -40.0)
then 1029 qcice(i,k) = clwf(i,k) * fcice(i,k)
1030 tem1 = clwf(i,k) - qcice(i,k)
1031 qrain(i,k) = tem1 * frain(i,k)
1032 qcwat(i,k) = tem1 - qrain(i,k)
1033 clw2(i,k) = qcwat(i,k) + qcice(i,k)
1035 qcice(i,k) = clwf(i,k)
1038 clw2(i,k) = clwf(i,k)
1048 & ( plyr, plvl, tlyr, qlyr, qcwat, qcice, qrain, rrime, &
1049 & ix, nlay,
ivflip, flgmin, &
1051 & cwp, cip, crp, csp, rew, rer, res, rsden &
1058 tem2d(i,k) = (
con_g * plyr(i,k)) &
1059 & / (
con_rd* (plvl(i,k+1) - plvl(i,k)))
1065 tem2d(i,k) = (
con_g * plyr(i,k)) &
1066 & / (
con_rd* (plvl(i,k) - plvl(i,k+1)))
1081 clwt = 2.0e-6 * (plyr(i,k)*0.001)
1085 if (clw2(i,k) > clwt)
then 1086 onemrh= max( 1.e-10, 1.0-rhly(i,k) )
1087 clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
1092 tem1 = min(max(sqrt(sqrt(onemrh*qstl(i,k))),0.0001),1.0)
1093 tem1 = 2000.0 / tem1
1101 value = max( min( tem1*(clw2(i,k)-clwm), 50.0 ), 0.0 )
1102 tem2 = sqrt( sqrt(rhly(i,k)) )
1104 cldtot(i,k) = max( tem2*(1.0-exp(-
value)), 0.0 )
1112 clwt = 2.0e-6 * (plyr(i,k)*0.001)
1114 if (clw2(i,k) > clwt)
then 1115 onemrh= max( 1.e-10, 1.0-rhly(i,k) )
1116 clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
1118 tem1 = min(max((onemrh*qstl(i,k))**0.49,0.0001),1.0)
1133 value = max( min( tem1*(clw2(i,k)-clwm), 50.0 ), 0.0 )
1134 tem2 = sqrt( sqrt(rhly(i,k)) )
1136 cldtot(i,k) = max( tem2*(1.0-exp(-
value)), 0.0 )
1150 clwt = 2.0e-6 * (plyr(i,k)*0.001)
1154 if (clw2(i,k) > clwt)
then 1155 onemrh= max( 1.e-10, 1.0-rhly(i,k) )
1156 clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
1161 tem1 = min(max(sqrt(sqrt(onemrh*qstl(i,k))),0.0001),1.0)
1162 tem1 = 2000.0 / tem1
1170 value = max( min( tem1*(clw2(i,k)-clwm), 50.0 ), 0.0 )
1171 tem2 = sqrt( sqrt(rhly(i,k)) )
1173 cldtot(i,k) = max( tem2*(1.0-exp(-
value)), 0.0 )
1181 clwt = 2.0e-6 * (plyr(i,k)*0.001)
1183 if (clw2(i,k) > clwt)
then 1184 onemrh= max( 1.e-10, 1.0-rhly(i,k) )
1185 clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
1187 tem1 = min(max((onemrh*qstl(i,k))**0.49,0.0001),1.0)
1202 value = max( min( tem1*(clw2(i,k)-clwm), 50.0 ), 0.0 )
1203 tem2 = sqrt( sqrt(rhly(i,k)) )
1205 cldtot(i,k) = max( tem2*(1.0-exp(-
value)), 0.0 )
1215 if (cldtot(i,k) <
climit)
then 1238 if (cldtot(i,k) >=
climit)
then 1239 tem1 = 1.0 / max(
climit2, cldtot(i,k))
1240 cwp(i,k) = cwp(i,k) * tem1
1241 cip(i,k) = cip(i,k) * tem1
1242 crp(i,k) = crp(i,k) * tem1
1243 csp(i,k) = csp(i,k) * tem1
1257 if (tem2 > 0.0)
then 1258 tem3 = tem2d(i,k) * tem2 / tvly(i,k)
1260 if (tem1 < -50.0)
then 1261 rei(i,k) = (1250.0/9.917) * tem3 ** 0.109
1262 elseif (tem1 < -40.0)
then 1263 rei(i,k) = (1250.0/9.337) * tem3 ** 0.08
1264 elseif (tem1 < -30.0)
then 1265 rei(i,k) = (1250.0/9.208) * tem3 ** 0.055
1267 rei(i,k) = (1250.0/9.387) * tem3 ** 0.031
1273 rei(i,k) = max(10.0, min(rei(i,k), 300.0))
1284 clouds(i,k,1) = cldtot(i,k)
1285 clouds(i,k,2) = cwp(i,k)
1286 clouds(i,k,3) = rew(i,k)
1287 clouds(i,k,4) = cip(i,k)
1288 clouds(i,k,5) = rei(i,k)
1289 clouds(i,k,6) = crp(i,k)
1290 clouds(i,k,7) = rer(i,k)
1292 clouds(i,k,8) = csp(i,k) * rsden(i,k)
1293 clouds(i,k,9) = rei(i,k)
1307 & ( plyr, ptop1, cldtot, cldcnv, &
1310 & clds, mtop, mbot &
1359 & ( plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw,cnvw,cnvc, &
1360 & xlat,xlon,slmsk, &
1362 & deltaq,sup,kdt,me, &
1364 & clouds,clds,mtop,mbot &
1443 integer,
intent(in) :: ix, nlay, nlp1,kdt
1445 real (kind=kind_phys),
dimension(:,:),
intent(in) :: plvl, plyr, &
1446 & tlyr, tvly, qlyr, qstl, rhly, clw
1449 real (kind=kind_phys),
dimension(:,:) :: deltaq, cnvw, cnvc
1450 real (kind=kind_phys) qtmp,qsc,rhs
1451 real (kind=kind_phys),
intent(in) :: sup
1452 real (kind=kind_phys),
parameter :: epsq = 1.0e-12
1454 real (kind=kind_phys),
dimension(:),
intent(in) :: xlat, xlon, &
1459 real (kind=kind_phys),
dimension(:,:,:),
intent(out) :: clouds
1461 real (kind=kind_phys),
dimension(:,:),
intent(out) :: clds
1463 integer,
dimension(:,:),
intent(out) :: mtop,mbot
1466 real (kind=kind_phys),
dimension(ix,nlay) :: cldtot, cldcnv, &
1467 & cwp, cip, crp, csp, rew, rei, res, rer, delp, tem2d, clwf
1469 real (kind=kind_phys) :: ptop1(ix,
nk_clds+1)
1471 real (kind=kind_phys) :: clwmin, clwm, clwt, onemrh,
value, &
1474 integer :: i, k, id, nf
1482 clouds(i,k,nf) = 0.0
1500 tem2d(i,k) = min( 1.0, max( 0.0, (
con_ttp-tlyr(i,k))*0.05 ) )
1507 clwf(i,1) = 0.75*clw(i,1) + 0.25*clw(i,2)
1508 clwf(i,nlay) = 0.75*clw(i,nlay) + 0.25*clw(i,nlay-1)
1512 clwf(i,k) = 0.25*clw(i,k-1) + 0.5*clw(i,k) + 0.25*clw(i,k+1)
1518 clwf(i,k) = clw(i,k)
1526 deltaq(i,k) = (1.-0.95)*qstl(i,k)
1543 ptop1(i,id) =
ptopc(id,1) + tem1*max( 0.0, 4.0*abs(tem2)-1.0 )
1553 delp(i,k) = plvl(i,k+1) - plvl(i,k)
1554 clwt = max(0.0,(clwf(i,k)+cnvw(i,k))) *
gfac * delp(i,k)
1555 cip(i,k) = clwt * tem2d(i,k)
1556 cwp(i,k) = clwt - cip(i,k)
1562 delp(i,k) = plvl(i,k) - plvl(i,k+1)
1563 clwt = max(0.0,(clwf(i,k)+cnvw(i,k))) *
gfac * delp(i,k)
1564 cip(i,k) = clwt * tem2d(i,k)
1565 cwp(i,k) = clwt - cip(i,k)
1574 if (nint(slmsk(i)) == 1)
then 1576 rew(i,k) = 5.0 + 5.0 * tem2d(i,k)
1586 tem1 = tlyr(i,k) - 273.16
1588 qsc = sup * qstl(i,k)
1594 if(rhly(i,k) >= rhs)
then 1597 qtmp = qlyr(i,k) + clwf(i,k) - qsc
1598 if(deltaq(i,k) > epsq)
then 1599 if(qtmp < -deltaq(i,k) .or. clwf(i,k) < epsq)
then 1602 elseif(qtmp >= deltaq(i,k))
then 1605 cldtot(i,k) = 0.5*qtmp/deltaq(i,k) + 0.5
1606 cldtot(i,k) = max(cldtot(i,k),0.0)
1607 cldtot(i,k) = min(cldtot(i,k),1.0)
1617 cldtot(i,k) = cnvc(i,k)+(1-cnvc(i,k))*cldtot(i,k)
1618 cldtot(i,k) = max(cldtot(i,k),0.)
1619 cldtot(i,k) = min(cldtot(i,k),1.)
1625 tem1 = tlyr(i,k) - 273.16
1627 qsc = sup * qstl(i,k)
1633 if(rhly(i,k) >= rhs)
then 1636 qtmp = qlyr(i,k) + clwf(i,k) - qsc
1637 if(deltaq(i,k) > epsq)
then 1639 if(qtmp <= -deltaq(i,k))
then 1641 elseif(qtmp >= deltaq(i,k))
then 1644 cldtot(i,k) = 0.5*qtmp/deltaq(i,k) + 0.5
1645 cldtot(i,k) = max(cldtot(i,k),0.0)
1646 cldtot(i,k) = min(cldtot(i,k),1.0)
1656 cldtot(i,k) = cnvc(i,k) + (1-cnvc(i,k))*cldtot(i,k)
1657 cldtot(i,k) = max(cldtot(i,k),0.)
1658 cldtot(i,k) = min(cldtot(i,k),1.)
1666 if (cldtot(i,k) <
climit)
then 1679 if (cldtot(i,k) >=
climit)
then 1680 tem1 = 1.0 / max(
climit2, cldtot(i,k))
1681 cwp(i,k) = cwp(i,k) * tem1
1682 cip(i,k) = cip(i,k) * tem1
1683 crp(i,k) = crp(i,k) * tem1
1684 csp(i,k) = csp(i,k) * tem1
1703 if (cip(i,k) > 0.0)
then 1705 tem3 =
gord * cip(i,k) * plyr(i,k) / (delp(i,k)*tvly(i,k))
1707 if (tem2 < -50.0)
then 1708 rei(i,k) = (1250.0/9.917) * tem3 ** 0.109
1709 elseif (tem2 < -40.0)
then 1710 rei(i,k) = (1250.0/9.337) * tem3 ** 0.08
1711 elseif (tem2 < -30.0)
then 1712 rei(i,k) = (1250.0/9.208) * tem3 ** 0.055
1714 rei(i,k) = (1250.0/9.387) * tem3 ** 0.031
1718 rei(i,k) = max(10.0, min(rei(i,k), 150.0))
1727 clouds(i,k,1) = cldtot(i,k)
1728 clouds(i,k,2) = cwp(i,k)
1729 clouds(i,k,3) = rew(i,k)
1730 clouds(i,k,4) = cip(i,k)
1731 clouds(i,k,5) = rei(i,k)
1733 clouds(i,k,7) = rer(i,k)
1735 clouds(i,k,9) = rei(i,k)
1749 & ( plyr, ptop1, cldtot, cldcnv, &
1752 & clds, mtop, mbot &
1792 & ( plyr,plvl,tlyr,rhly,vvel,cv,cvt,cvb, &
1793 & xlat,xlon,slmsk, &
1796 & clouds,clds,mtop,mbot &
1859 integer,
intent(in) :: IX, NLAY, NLP1
1861 real (kind=kind_phys),
dimension(:,:),
intent(in) :: plvl, plyr, &
1864 real (kind=kind_phys),
dimension(:),
intent(in) :: xlat, xlon, &
1865 & slmsk, cv, cvt, cvb
1868 real (kind=kind_phys),
dimension(:,:,:),
intent(out) :: clouds
1870 real (kind=kind_phys),
dimension(:,:),
intent(out) :: clds
1872 integer,
dimension(:,:),
intent(out) :: mtop,mbot
1875 real (kind=kind_phys),
dimension(IX,NLAY) :: cldtot, cldcnv, &
1876 & cldtau, taufac, dthdp, tem2d
1878 real (kind=kind_phys) :: ptop1(ix,
nk_clds+1)
1880 real (kind=kind_phys) :: cr1, cr2, crk, pval, cval, omeg,
value, &
1883 integer,
dimension(IX):: idom, kcut
1886 real (kind=kind_phys) :: xlatdg, xlondg, xlnn, xlss, xrgt, xlft, &
1887 & rhcla(NBIN,NLON,MCLD,NSEAL), rhcld(IX,NBIN,MCLD)
1889 integer :: ireg, ib, ic, id, id1, il, is, nhalf
1891 integer :: i, j, k, klowt
1903 lab_do_i_ix :
do i = 1, ix
1905 xlatdg = xlat(i) * tem1
1908 xlondg = xlon(i) * tem1
1909 if (xlondg < 0.0) xlondg = xlondg + 360.0
1916 lab_do_j :
do j = 1, 3
1917 if (xlatdg >
xlabdy(j))
then 1927 rhcla(ib,il,ic,is) =
rhcl(ib,il,ireg,ic,is)
1939 if (xlatdg < xlnn .and. xlatdg > xlss)
then 1944 rhcla(ib,il,ic,is) =
rhcl(ib,il,j+1,ic,is) &
1945 & + (
rhcl(ib,il,j,ic,is)-
rhcl(ib,il,j+1,ic,is)) &
1946 & * (xlatdg-xlss) / (xlnn-xlss)
1959 if (slmsk(i) < 1.0)
then 1967 if (xlondg > 180.e0)
then 1975 rhcld(i,ib,ic) = rhcla(ib,il,ic,is)
1978 lab_do_k :
do k = 1, 3
1979 tem2 = abs(xlondg -
xlobdy(k))
1981 if (tem2 <
xlim)
then 1984 if (id1 >
nlon) id1 = 1
1990 rhcld(i,ib,ic) = rhcla(ib,id1,ic,is) &
1991 & + (rhcla(ib,id,ic,is) - rhcla(ib,id1,ic,is)) &
1992 & * (xlondg-xrgt)/(xlft-xrgt)
2012 ptop1(i,j) =
ptopc(j,1) + tem1*max( 0.0, 4.0*abs(tem2)-1.0 )
2022 if (tem1 <= -10.0)
then 2023 cldtau(i,k) = max( 0.1e-3, 2.0e-6*(tem1+82.5)**2 )
2025 cldtau(i,k) = min( 0.08, 6.949e-3*tem1+0.08 )
2037 tem1 = (plyr(i,k)*0.001) ** (-
con_rocp)
2038 tem2d(i,k) = tem1 * tlyr(i,k)
2044 dthdp(i,k) = (tem2d(i,k+1)-tem2d(i,k))/(plyr(i,k+1)-plyr(i,k))
2063 if (plvl(i,k) < ptop1(i,2)) klowt = max(klowt,k)
2064 taufac(i,k) = plvl(i,k+1) - plvl(i,k)
2078 lab_do_kcut0 :
do k = klowt-1, 2, -1
2079 if (plyr(i,k) <= ptop1(i,3) .and. &
2080 & dthdp(i,k) < -0.25e0)
then 2089 if (cv(i) >=
climit .and. cvt(i) < cvb(i))
then 2093 lab_do_k_cvt0 :
do k = 2, nlay
2094 if (cvt(i) <= plyr(i,k))
then 2100 lab_do_k_cvb0 :
do k = nlay-1, 1, -1
2101 if (cvb(i) >= plyr(i,k))
then 2107 tem1 = plyr(i,id1) - plyr(i,id)
2110 taufac(i,k) = taufac(i,k) * max( 0.25, 1.0-0.125*tem1 )
2128 do k = nlay-1, 2, -1
2136 lab_do_ic0 :
do ic = 2, 4
2137 if(plyr(i,k) >= ptop1(i,ic))
then 2151 nhalf = (
nbin + 1) / 2
2153 if (id <= 0 .or. k < kcut(i))
then 2155 elseif (rhly(i,k) <= rhcld(i,1,id))
then 2157 elseif (rhly(i,k) >= rhcld(i,
nbin,id))
then 2164 do while ( notstop )
2165 nhalf = (nhalf + 1) / 2
2166 cr1 = rhcld(i,ib, id)
2167 cr2 = rhcld(i,ib+1,id)
2169 if (crk <= cr1)
then 2170 ib = max( ib-nhalf, 1 )
2171 elseif (crk > cr2)
then 2172 ib = min( ib+nhalf,
nbin-1 )
2174 cldtot(i,k) = 0.01 * (ib + (crk - cr1)/(cr2 - cr1))
2187 do k = klowt,
llyr+1
2196 if (cval >=
climit .and. pval >= ptop1(i,2))
then 2199 elseif (omeg >
vvcld2)
then 2200 tem1 = (
vvcld1 - omeg) /
value 2201 cldtot(i,k) = cldtot(i,k) * sqrt(tem1)
2218 if (plvl(i,k) < ptop1(i,2)) klowt = min(klowt,k)
2219 taufac(i,k) = plvl(i,k) - plvl(i,k+1)
2230 lab_do_kcut1 :
do k = klowt+1, nlay-1
2231 if (plyr(i,k) <= ptop1(i,3) .and. &
2232 & dthdp(i,k) < -0.25e0)
then 2240 if (cv(i) >=
climit .and. cvt(i) < cvb(i))
then 2244 lab_do_k_cvt :
do k = nlay-1, 1, -1
2245 if (cvt(i) <= plyr(i,k))
then 2251 lab_do_k_cvb :
do k = 2, nlay
2252 if (cvb(i) >= plyr(i,k))
then 2258 tem1 = plyr(i,id1) - plyr(i,id)
2261 taufac(i,k) = taufac(i,k) * max( 0.25, 1.0-0.125*tem1 )
2285 lab_do_ic1 :
do ic = 2, 4
2286 if(plyr(i,k) >= ptop1(i,ic))
then 2300 nhalf = (
nbin + 1) / 2
2302 if (id <= 0 .or. k > kcut(i))
then 2304 elseif (rhly(i,k) <= rhcld(i,1,id))
then 2306 elseif (rhly(i,k) >= rhcld(i,
nbin,id))
then 2313 do while ( notstop )
2314 nhalf = (nhalf + 1) / 2
2315 cr1 = rhcld(i,ib, id)
2316 cr2 = rhcld(i,ib+1,id)
2318 if (crk <= cr1)
then 2319 ib = max( ib-nhalf, 1 )
2320 elseif (crk > cr2)
then 2321 ib = min( ib+nhalf,
nbin-1 )
2323 cldtot(i,k) = 0.01 * (ib + (crk - cr1)/(cr2 - cr1))
2335 do k =
llyr-1, klowt
2344 if (cval >=
climit .and. pval >= ptop1(i,2))
then 2347 elseif (omeg >
vvcld2)
then 2348 tem1 = (
vvcld1 - omeg) /
value 2349 cldtot(i,k) = cldtot(i,k) * sqrt(tem1)
2374 clouds(i,k,1) = max(cldtot(i,k), cldcnv(i,k))
2375 clouds(i,k,2) = cldtau(i,k) * taufac(i,k)
2392 & ( plyr, ptop1, cldtot, cldcnv, &
2395 & clds, mtop, mbot &
2412 & ( plyr, ptop1, cldtot, cldcnv, &
2415 & clds, mtop, mbot &
2467 integer,
intent(in) :: IX, NLAY
2469 real (kind=kind_phys),
dimension(:,:),
intent(in) :: plyr, ptop1, &
2473 real (kind=kind_phys),
dimension(:,:),
intent(out) :: clds
2475 integer,
dimension(:,:),
intent(out) :: mtop, mbot
2478 real (kind=kind_phys) :: cl1(ix), cl2(ix)
2479 real (kind=kind_phys) :: pcur, pnxt, ccur, cnxt
2481 integer,
dimension(IX):: idom, kbt1, kth1, kbt2, kth2
2482 integer :: i, k, id, id1, kstr, kend, kinc
2507 if (
iovr == 0 )
then 2509 do k = kstr, kend, kinc
2511 ccur = min(
ovcst, max( cldtot(i,k), cldcnv(i,k) ))
2512 if (ccur >=
climit) cl1(i) = cl1(i) * (1.0 - ccur)
2517 clds(i,5) = 1.0 - cl1(i)
2523 clds(i,4) = 1.0 - cl1(i)
2528 do k = kstr, kend, kinc
2530 ccur = min(
ovcst, max( cldtot(i,k), cldcnv(i,k) ))
2532 cl2(i) = min( cl2(i), (1.0 - ccur) )
2534 cl1(i) = cl1(i) * cl2(i)
2541 clds(i,5) = 1.0 - cl1(i) * cl2(i)
2547 clds(i,4) = 1.0 - cl1(i) * cl2(i)
2569 mbot(i,2) = nlay - 1
2570 mtop(i,2) = nlay - 1
2571 mbot(i,3) = nlay - 1
2572 mtop(i,3) = nlay - 1
2582 ccur = min(
ovcst, max( cldtot(i,k), cldcnv(i,k) ))
2586 cnxt = min(
ovcst, max( cldtot(i,k-1), cldcnv(i,k-1) ))
2592 if (pcur < ptop1(i,id1))
then 2599 if (kth2(i) == 0) kbt2(i) = k
2600 kth2(i) = kth2(i) + 1
2602 if (
iovr == 0 )
then 2603 cl2(i) = cl2(i) + ccur - cl2(i)*ccur
2605 cl2(i) = max( cl2(i), ccur )
2608 if (cnxt <
climit .or. pnxt < ptop1(i,id1))
then 2609 kbt1(i) = nint( (cl1(i)*kbt1(i) + cl2(i)*kbt2(i) ) &
2610 & / (cl1(i) + cl2(i)) )
2611 kth1(i) = nint( (cl1(i)*kth1(i) + cl2(i)*kth2(i) ) &
2612 & / (cl1(i) + cl2(i)) )
2613 cl1(i) = cl1(i) + cl2(i) - cl1(i)*cl2(i)
2621 if (pnxt < ptop1(i,id1))
then 2623 mtop(i,id) = min( kbt1(i), kbt1(i)-kth1(i)+1 )
2624 mbot(i,id) = kbt1(i)
2631 mbot(i,id1) = kbt1(i)
2632 mtop(i,id1) = kbt1(i)
2664 ccur = min(
ovcst, max( cldtot(i,k), cldcnv(i,k) ))
2668 cnxt = min(
ovcst, max( cldtot(i,k+1), cldcnv(i,k+1) ))
2674 if (pcur < ptop1(i,id1))
then 2681 if (kth2(i) == 0) kbt2(i) = k
2682 kth2(i) = kth2(i) + 1
2684 if (
iovr == 0 )
then 2685 cl2(i) = cl2(i) + ccur - cl2(i)*ccur
2687 cl2(i) = max( cl2(i), ccur )
2690 if (cnxt <
climit .or. pnxt < ptop1(i,id1))
then 2691 kbt1(i) = nint( (cl1(i)*kbt1(i) + cl2(i)*kbt2(i)) &
2692 & / (cl1(i) + cl2(i)) )
2693 kth1(i) = nint( (cl1(i)*kth1(i) + cl2(i)*kth2(i)) &
2694 & / (cl1(i) + cl2(i)) )
2695 cl1(i) = cl1(i) + cl2(i) - cl1(i)*cl2(i)
2703 if (pnxt < ptop1(i,id1))
then 2705 mtop(i,id) = max( kbt1(i), kbt1(i)+kth1(i)-1 )
2706 mbot(i,id) = kbt1(i)
2709 kbt1(i) = min(k+1, nlay)
2713 mbot(i,id1) = kbt1(i)
2714 mtop(i,id1) = kbt1(i)
2756 integer,
intent(in) :: me
2759 integer,
intent(out) :: ier
2762 real (kind=kind_phys),
dimension(NBIN,NLON,NLAT,MCLD,NSEAL) :: &
2763 & rhfd, rtnfd, rhcf, rtncf, rhcla
2765 real (kind=kind_io4),
dimension(NBIN,NLON,NLAT,MCLD,NSEAL) :: &
2768 real(kind=kind_io4) :: fhour
2770 real(kind=kind_phys) :: binscl, cfrac, clsat, rhsat, cstem
2772 integer,
dimension(NLON,NLAT,MCLD,NSEAL) :: kpts, kkpts
2774 integer :: icdays(15), idate(4), nbdayi, isat
2776 integer :: i, i1, j, k, l, m, id, im, iy
2795 rhcf(i,j,k,l,m) = 0.0
2796 rtncf(i,j,k,l,m) = 0.0
2797 rhcla(i,j,k,l,m) = -0.1
2808 read (nicltun,err=998,end=999) nbdayi, icdays
2810 if (me == 0) print 11, nbdayi
2811 11
format(
' from rhtable DAYS ON FILE =',i5)
2814 id = icdays(i) / 10000
2815 im = (icdays(i)-id*10000) / 100
2816 iy = icdays(i)-id*10000-im*100
2817 if (me == 0) print 51, id,im,iy
2818 51
format(
' from rhtable ARCHV DATA FROM DA,MO,YR=',3i4)
2821 read (nicltun,err=998,end=999) fhour,idate
2824 read (nicltun) rhfd4
2827 read (nicltun) rtnfd4
2837 rhcf(i,j,k,l,m) = rhcf(i,j,k,l,m) + rhfd(i,j,k,l,m)
2838 rtncf(i,j,k,l,m) = rtncf(i,j,k,l,m) + rtnfd(i,j,k,l,m)
2845 kkpts = kkpts + kpts
2857 rhcf(i,j,k,l,m) = rhcf(i-1,j,k,l,m) + rhcf(i,j,k,l,m)
2858 rtncf(i,j,k,l,m) = rtncf(i-1,j,k,l,m) + rtncf(i,j,k,l,m)
2861 if (kkpts(j,k,l,m) > 0)
then 2863 rhcf(i,j,k,l,m)= rhcf(i,j,k,l,m)/kkpts(j,k,l,m)
2864 rtncf(i,j,k,l,m)=min(1., rtncf(i,j,k,l,m)/kkpts(j,k,l,m))
2871 rhcf(
nbin,j,k,l,m) = 1.0
2874 lab_do_i1 :
do i1 = 1,
nbin 2875 if (rhcf(i1,j,k,l,m) >= rtncf(i,j,k,l,m))
then 2876 rhcla(i,j,k,l,m) = i1 * binscl
2886 rhcf(i,j,k,l,m) = -0.1
2887 rtncf(i,j,k,l,m) = -0.1
2892 210
format(
' NO CRIT RH FOR LAT=',i3,
' AND LON BAND=',i3, &
2893 &
' LAND(=1) SEA=',i3//
' MODEL RH ',
' OBS RTCLD')
2895 print 203, rhcf(i,j,k,l,m), rtncf(i,j,k,l,m)
2914 cfrac = binscl * (i - 1)
2916 if (rhcla(i,j,k,l,m) < 0.0)
then 2917 print 1941, i,m,l,k,j
2918 1941
format(
' NEG RHCLA FOR IT,NSL,NC,LAT,LON=',5i4 &
2923 if (rtncf(i,j,k,l,m) >= 1.0)
then 2926 rhsat = rhcla(i,j,k,l,m)
2930 rhcla(i,j,k,l,m) = rhsat + (1.0 - rhsat) &
2931 & * (cfrac - clsat) / (1.0 - clsat)
2935 rhcla(
nbin,j,k,l,m) = 1.0
2954 lab_do_i :
do i = 1,
nbin - 2
2957 if (rhcla(i,j,k,l,m) >= 0.98)
then 2961 rhcl(i1,j,k,l,m) = rhcla(i,j,k,l,m) &
2962 & + (rhcla(
nbin,j,k,l,m) - rhcla(i,j,k,l,m)) &
2963 & * (cstem - cfrac) / (1.0 - cfrac)
2975 print *,
'completed rhtable for cloud tuninig tables' 2980 988
format(
' from rhtable ERROR READING TABLES')
2985 989
format(
' from rhtable E.O.F READING TABLES')
subroutine, public progcld1
This subroutine computes cloud related quantities using zhao/moorthi's prognostic cloud microphysics ...
real(kind=kind_phys), dimension(nbin, nlon, nlat, mcld, nseal) rhcl
real(kind=kind_phys), dimension(nk_clds+1, 2), save ptopc
subroutine rsipath2
This subroutine is a modified version of ferrier's original "rsipath" subprogram. It computes layer's...
real(kind=kind_phys), parameter con_t0c
temp at 0C (K)
real(kind=kind_phys), parameter climit
real(kind=kind_phys), parameter rrain_def
integer, parameter, public nk_clds
number of cloud vertical domains
This module computes cloud related quantities for radiation computations.
integer, save iovrsw
cloud overlapping control flag for sw
real(kind=kind_phys), parameter rsnow_def
This module contains some the most frequently used math and physics constants for gcm models...
real(kind=kind_phys), parameter xlim
real(kind=kind_phys), parameter reice_def
real(kind=kind_phys), parameter cldasy_def
real(kind=kind_phys), parameter con_ttp
temp at H2O 3pt (K)
integer, save iovrlw
cloud overlapping control flag for lw
real(kind=kind_phys), parameter con_thgni
temperature the H.G.Nuc. ice starts
character(40), parameter vtagcld
This module defines commonly used control variables/parameters in physics related programs...
real(kind=kind_phys), dimension(3) xlobdy
real(kind=kind_phys), parameter cldssa_def
real(kind=kind_phys), parameter con_rd
gas constant air (J/kg/K)
real(kind=kind_phys), parameter gord
subroutine rhtable
cld-rh relations obtained from mitchell-hahn procedure.
integer, save icmphys
cloud microphysics scheme control flag
logical, save lnoprec
precip effect on radiation flag (ferrier microphysics)
real(kind=kind_phys), parameter reliq_def
real(kind=kind_phys), parameter con_rocp
logical, save lcrick
eliminating CRICK control flag
integer, save ivflip
vertical profile indexing flag
real(kind=kind_phys), parameter vvcld1
real(kind=kind_phys), parameter vvcld2
real(kind=kind_phys), parameter climit2
real(kind=kind_phys), dimension(3) xlabdy
subroutine gethml
This subroutine computes high, mid, low, total, and boundary cloud fractions and cloud top/bottom lay...
real(kind=kind_phys), parameter con_g
gravity (m/s2)
real(kind=kind_phys), parameter gfac
real(kind=kind_phys), parameter con_pi
logical, save lsashal
shallow convection flag
integer, parameter, public nf_clds
number of fields in cloud array
real(kind=kind_phys), parameter ovcst
subroutine, public cld_init
This subroutine is an initialization program for cloud-radiation calculations. It sets up boundary la...
subroutine, public diagcld1
This subroutine computes cloud fractions for radiation calculations.
real(kind=kind_phys), parameter con_fvirt
subroutine, public progcld2
This subroutine computes cloud related quantities using ferrier's prognostic cloud microphysics schem...
subroutine, public progcld3
This subroutine computes cloud related quantities using zhao/moorthi's prognostic cloud microphysics ...
logical, save lcnorm
in-cld condensate control flag
integer, save icldflg
cloud optical property scheme control flag