406 module module_radsw_main
416 use mersenne_twister
, only : random_setseed, random_number, &
426 character(40),
parameter :: &
427 & VTAGSW=
'NCEP SW v5.1 Nov 2012 -RRTMG-SW v3.8 '
439 real (kind=kind_phys),
parameter :: eps = 1.0e-6
440 real (kind=kind_phys),
parameter :: oneminus= 1.0 - eps
442 real (kind=kind_phys),
parameter ::
bpade = 1.0/0.278
443 real (kind=kind_phys),
parameter :: stpfac = 296.0/1013.0
444 real (kind=kind_phys),
parameter :: ftiny = 1.0e-12
446 real (kind=kind_phys),
parameter ::
s0 = 1368.22
448 real (kind=kind_phys),
parameter :: f_zero = 0.0
449 real (kind=kind_phys),
parameter :: f_one = 1.0
456 integer,
dimension(nblow:nbhgh) :: nspa, nspb
458 integer,
dimension(nblow:nbhgh) ::
idxsfc
460 integer,
dimension(nblow:nbhgh) ::
idxebc
462 data nspa(:) / 9, 9, 9, 9, 1, 9, 9, 1, 9, 1, 0, 1, 9, 1 /
463 data nspb(:) / 1, 5, 1, 1, 1, 5, 1, 0, 1, 0, 0, 1, 5, 1 /
466 data idxsfc(:) / 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1 /
467 data idxebc(:) / 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 1, 5 /
483 integer,
parameter ::
nuvb = 27
486 logical :: lhswb = .false.
487 logical :: lhsw0 = .false.
488 logical :: lflxprf= .false.
489 logical :: lfdncmp= .false.
585 & ( plyr,plvl,tlyr,tlvl,qlyr,olyr,gasvmr, &
586 & clouds,icseed,aerosols,sfcalb, &
587 & cosz,solcon,nday,idxday, &
588 & npts, nlay, nlp1, lprnt, &
589 & hswc,topflx,sfcflx, &
590 & hsw0,hswb,flxprf,fdncmp &
769 integer,
intent(in) :: npts, nlay, nlp1, NDAY
771 integer,
dimension(:),
intent(in) :: idxday, icseed
773 logical,
intent(in) :: lprnt
775 real (kind=kind_phys),
dimension(npts,nlp1),
intent(in) :: &
777 real (kind=kind_phys),
dimension(npts,nlay),
intent(in) :: &
778 & plyr, tlyr, qlyr, olyr
779 real (kind=kind_phys),
dimension(npts,4),
intent(in) :: sfcalb
781 real (kind=kind_phys),
dimension(npts,nlay,9),
intent(in):: gasvmr
782 real (kind=kind_phys),
dimension(npts,nlay,9),
intent(in):: clouds
783 real (kind=kind_phys),
dimension(npts,nlay,nbdsw,3),
intent(in):: &
786 real (kind=kind_phys),
intent(in) :: cosz(npts), solcon
789 real (kind=kind_phys),
dimension(npts,nlay),
intent(out) :: hswc
791 type(
topfsw_type),
dimension(npts),
intent(out) :: topflx
792 type(
sfcfsw_type),
dimension(npts),
intent(out) :: sfcflx
795 real (kind=kind_phys),
dimension(npts,nlay,nbdsw),
optional, &
796 & intent(out) :: hswb
798 real (kind=kind_phys),
dimension(npts,nlay),
optional, &
799 & intent(out) :: hsw0
800 type (
profsw_type),
dimension(npts,nlp1),
optional, &
801 & intent(out) :: flxprf
803 & intent(out) :: fdncmp
806 real (kind=kind_phys),
dimension(nlay,ngptsw) :: cldfmc, &
808 real (kind=kind_phys),
dimension(nlp1,nbdsw):: fxupc, fxdnc, &
811 real (kind=kind_phys),
dimension(nlay,nbdsw) :: &
812 & tauae, ssaae, asyae, taucw, ssacw, asycw
814 real (kind=kind_phys),
dimension(ngptsw) :: sfluxzen
816 real (kind=kind_phys),
dimension(nlay) :: cldfrc, delp, &
817 & pavel, tavel, coldry, colmol, h2ovmr, o3vmr, temcol, &
818 & cliqp, reliq, cicep, reice, cdat1, cdat2, cdat3, cdat4, &
819 & cfrac, fac00, fac01, fac10, fac11, forfac, forfrac, &
820 & selffac, selffrac, rfdelp
822 real (kind=kind_phys),
dimension(nlp1) :: fnet, flxdc, flxuc, &
825 real (kind=kind_phys),
dimension(2) :: albbm, albdf, sfbmc, &
826 & sfbm0, sfdfc, sfdf0
828 real (kind=kind_phys) :: cosz1, sntz1, tem0, tem1, tem2, s0fac, &
829 & ssolar, zcf0, zcf1, ftoau0, ftoauc, ftoadc, &
830 & fsfcu0, fsfcuc, fsfcd0, fsfcdc, suvbfc, suvbf0
834 real (kind=kind_phys) :: colamt(nlay,
maxgas)
836 integer,
dimension(npts) :: ipseed
837 integer,
dimension(nlay) :: indfor, indself, jp, jt, jt1
839 integer :: i, ib, ipt, j1, k, kk, laytrop, mb
844 lhswb =
present ( hswb )
845 lhsw0 =
present ( hsw0 )
846 lflxprf=
present ( flxprf )
847 lfdncmp=
present ( fdncmp )
859 sfcflx =
sfcfsw_type( f_zero, f_zero, f_zero, f_zero )
863 flxprf =
profsw_type( f_zero, f_zero, f_zero, f_zero )
867 fdncmp =
cmpfsw_type(f_zero,f_zero,f_zero,f_zero,f_zero,f_zero)
887 ipseed(i) = icseed(i)
892 write(0,*)
' In radsw, isubcsw, ipsdsw0,ipseed =', &
898 lab_do_ipt :
do ipt = 1, nday
903 sntz1 = f_one / cosz(j1)
904 ssolar = s0fac * cosz(j1)
907 albbm(1) = sfcalb(j1,1)
908 albdf(1) = sfcalb(j1,2)
909 albbm(2) = sfcalb(j1,3)
910 albdf(2) = sfcalb(j1,4)
922 pavel(k) = plyr(j1,kk)
923 tavel(k) = tlyr(j1,kk)
924 delp(k) = plvl(j1,kk+1) - plvl(j1,kk)
936 h2ovmr(k)= max(f_zero,qlyr(j1,kk)*amdw/(f_one-qlyr(j1,kk)))
937 o3vmr(k)= max(f_zero,olyr(j1,kk)*amdo3)
940 coldry(k) = tem2 * delp(k) / (tem1*tem0*(f_one + h2ovmr(k)))
941 temcol(k) = 1.0e-12 * coldry(k)
943 colamt(k,1) = max(f_zero, coldry(k)*h2ovmr(k))
944 colamt(k,2) = max(temcol(k), coldry(k)*gasvmr(j1,kk,1))
945 colamt(k,3) = max(f_zero, coldry(k)*o3vmr(k))
946 colmol(k) = coldry(k) + colamt(k,1)
955 colamt(k,4) = max(temcol(k), coldry(k)*gasvmr(j1,kk,2))
956 colamt(k,5) = max(temcol(k), coldry(k)*gasvmr(j1,kk,3))
957 colamt(k,6) = max(temcol(k), coldry(k)*gasvmr(j1,kk,4))
962 colamt(k,4) = temcol(k)
963 colamt(k,5) = temcol(k)
964 colamt(k,6) = temcol(k)
974 tauae(k,ib) = aerosols(j1,kk,ib,1)
975 ssaae(k,ib) = aerosols(j1,kk,ib,2)
976 asyae(k,ib) = aerosols(j1,kk,ib,3)
984 cfrac(k) = clouds(j1,kk,1)
985 cliqp(k) = clouds(j1,kk,2)
986 reliq(k) = clouds(j1,kk,3)
987 cicep(k) = clouds(j1,kk,4)
988 reice(k) = clouds(j1,kk,5)
989 cdat1(k) = clouds(j1,kk,6)
990 cdat2(k) = clouds(j1,kk,7)
991 cdat3(k) = clouds(j1,kk,8)
992 cdat4(k) = clouds(j1,kk,9)
997 cfrac(k) = clouds(j1,kk,1)
998 cdat1(k) = clouds(j1,kk,2)
999 cdat2(k) = clouds(j1,kk,3)
1000 cdat3(k) = clouds(j1,kk,4)
1006 tem1 = 100.0 *
con_g
1010 pavel(k) = plyr(j1,k)
1011 tavel(k) = tlyr(j1,k)
1012 delp(k) = plvl(j1,k) - plvl(j1,k+1)
1020 h2ovmr(k)= max(f_zero,qlyr(j1,k)*amdw/(f_one-qlyr(j1,k)))
1021 o3vmr(k)= max(f_zero,olyr(j1,k)*amdo3)
1024 coldry(k) = tem2 * delp(k) / (tem1*tem0*(f_one + h2ovmr(k)))
1025 temcol(k) = 1.0e-12 * coldry(k)
1027 colamt(k,1) = max(f_zero, coldry(k)*h2ovmr(k))
1028 colamt(k,2) = max(temcol(k), coldry(k)*gasvmr(j1,k,1))
1029 colamt(k,3) = max(f_zero, coldry(k)*o3vmr(k))
1030 colmol(k) = coldry(k) + colamt(k,1)
1036 write(0,*)
' pavel=',pavel
1037 write(0,*)
' tavel=',tavel
1038 write(0,*)
' delp=',delp
1039 write(0,*)
' h2ovmr=',h2ovmr*1000
1040 write(0,*)
' o3vmr=',o3vmr*1000000
1049 colamt(k,4) = max(temcol(k), coldry(k)*gasvmr(j1,k,2))
1050 colamt(k,5) = max(temcol(k), coldry(k)*gasvmr(j1,k,3))
1051 colamt(k,6) = max(temcol(k), coldry(k)*gasvmr(j1,k,4))
1056 colamt(k,4) = temcol(k)
1057 colamt(k,5) = temcol(k)
1058 colamt(k,6) = temcol(k)
1067 tauae(k,ib) = aerosols(j1,k,ib,1)
1068 ssaae(k,ib) = aerosols(j1,k,ib,2)
1069 asyae(k,ib) = aerosols(j1,k,ib,3)
1075 cfrac(k) = clouds(j1,k,1)
1076 cliqp(k) = clouds(j1,k,2)
1077 reliq(k) = clouds(j1,k,3)
1078 cicep(k) = clouds(j1,k,4)
1079 reice(k) = clouds(j1,k,5)
1080 cdat1(k) = clouds(j1,k,6)
1081 cdat2(k) = clouds(j1,k,7)
1082 cdat3(k) = clouds(j1,k,8)
1083 cdat4(k) = clouds(j1,k,9)
1087 cfrac(k) = clouds(j1,k,1)
1088 cdat1(k) = clouds(j1,k,2)
1089 cdat2(k) = clouds(j1,k,3)
1090 cdat3(k) = clouds(j1,k,4)
1105 zcf0 = zcf0 * (f_one - cfrac(k))
1107 else if (
iovrsw == 1)
then
1109 if (cfrac(k) > ftiny)
then
1110 zcf1 = min( zcf1, f_one-cfrac(k) )
1111 elseif (zcf1 < f_one)
then
1117 else if (
iovrsw == 2)
then
1119 zcf0 = min( zcf0, f_one-cfrac(k) )
1123 if (zcf0 <= ftiny) zcf0 = f_zero
1124 if (zcf0 > oneminus) zcf0 = f_one
1130 if (zcf1 > f_zero)
then
1134 & ( cfrac,cliqp,reliq,cicep,reice,cdat1,cdat2,cdat3,cdat4, &
1135 & zcf1, nlay, ipseed(j1), &
1137 & taucw, ssacw, asycw, cldfrc, cldfmc &
1156 & ( pavel,tavel,h2ovmr, nlay,nlp1, &
1158 & laytrop,jp,jt,jt1,fac00,fac01,fac10,fac11, &
1159 & selffac,selffrac,indself,forfac,forfrac,indfor &
1166 & ( colamt,colmol,fac00,fac01,fac10,fac11,jp,jt,jt1,laytrop, &
1167 & forfac,forfrac,indfor,selffac,selffrac,indself, nlay, &
1169 & sfluxzen, taug, taur &
1182 & ( ssolar,cosz1,sntz1,albbm,albdf,sfluxzen,cldfrc, &
1183 & zcf1,zcf0,taug,taur,tauae,ssaae,asyae,taucw,ssacw,asycw, &
1186 & fxupc,fxdnc,fxup0,fxdn0, &
1187 & ftoauc,ftoau0,ftoadc,fsfcuc,fsfcu0,fsfcdc,fsfcd0, &
1188 & sfbmc,sfdfc,sfbm0,sfdf0,suvbfc,suvbf0 &
1195 & ( ssolar,cosz1,sntz1,albbm,albdf,sfluxzen,cldfmc, &
1196 & zcf1,zcf0,taug,taur,tauae,ssaae,asyae,taucw,ssacw,asycw, &
1199 & fxupc,fxdnc,fxup0,fxdn0, &
1200 & ftoauc,ftoau0,ftoadc,fsfcuc,fsfcu0,fsfcdc,fsfcd0, &
1201 & sfbmc,sfdfc,sfbm0,sfdf0,suvbfc,suvbf0 &
1214 flxuc(k) = flxuc(k) + fxupc(k,ib)
1215 flxdc(k) = flxdc(k) + fxdnc(k,ib)
1221 if ( lhsw0 .or. lflxprf )
then
1227 flxu0(k) = flxu0(k) + fxup0(k,ib)
1228 flxd0(k) = flxd0(k) + fxdn0(k,ib)
1241 fdncmp(j1)%uvbf0 = suvbf0
1242 fdncmp(j1)%uvbfc = suvbfc
1245 fdncmp(j1)%nirbm = sfbmc(1)
1246 fdncmp(j1)%nirdf = sfdfc(1)
1247 fdncmp(j1)%visbm = sfbmc(2)
1248 fdncmp(j1)%visdf = sfdfc(2)
1253 topflx(j1)%upfxc = ftoauc
1254 topflx(j1)%dnfxc = ftoadc
1255 topflx(j1)%upfx0 = ftoau0
1257 sfcflx(j1)%upfxc = fsfcuc
1258 sfcflx(j1)%dnfxc = fsfcdc
1259 sfcflx(j1)%upfx0 = fsfcu0
1260 sfcflx(j1)%dnfx0 = fsfcd0
1266 fnet(1) = flxdc(1) - flxuc(1)
1270 fnet(k) = flxdc(k) - flxuc(k)
1271 hswc(j1,kk) = (fnet(k)-fnet(k-1)) * rfdelp(k-1)
1279 flxprf(j1,kk)%upfxc = flxuc(k)
1280 flxprf(j1,kk)%dnfxc = flxdc(k)
1281 flxprf(j1,kk)%upfx0 = flxu0(k)
1282 flxprf(j1,kk)%dnfx0 = flxd0(k)
1289 fnet(1) = flxd0(1) - flxu0(1)
1293 fnet(k) = flxd0(k) - flxu0(k)
1294 hsw0(j1,kk) = (fnet(k)-fnet(k-1)) * rfdelp(k-1)
1302 fnet(1) = fxdnc(1,mb) - fxupc(1,mb)
1306 fnet(k) = fxdnc(k,mb) - fxupc(k,mb)
1307 hswb(j1,kk,mb) = (fnet(k) - fnet(k-1)) * rfdelp(k-1)
1316 fnet(1) = flxdc(1) - flxuc(1)
1319 fnet(k) = flxdc(k) - flxuc(k)
1320 hswc(j1,k-1) = (fnet(k)-fnet(k-1)) * rfdelp(k-1)
1327 flxprf(j1,k)%upfxc = flxuc(k)
1328 flxprf(j1,k)%dnfxc = flxdc(k)
1329 flxprf(j1,k)%upfx0 = flxu0(k)
1330 flxprf(j1,k)%dnfx0 = flxd0(k)
1337 fnet(1) = flxd0(1) - flxu0(1)
1340 fnet(k) = flxd0(k) - flxu0(k)
1341 hsw0(j1,k-1) = (fnet(k)-fnet(k-1)) * rfdelp(k-1)
1349 fnet(1) = fxdnc(1,mb) - fxupc(1,mb)
1352 fnet(k+1) = fxdnc(k+1,mb) - fxupc(k+1,mb)
1353 hswb(j1,k,mb) = (fnet(k+1) - fnet(k)) * rfdelp(k)
1364 end subroutine swrad
1429 integer,
intent(in) :: me
1434 real (kind=kind_phys),
parameter :: expeps = 1.e-20
1438 real (kind=kind_phys) :: tfn, tau
1444 print *,
' *** Error in specification of cloud overlap flag', &
1445 &
' IOVRSW=',
iovrsw,
' in RSWINIT !!'
1450 print *,
' - Using AER Shortwave Radiation, Version: ',vtagsw
1453 print *,
' --- Delta-eddington 2-stream transfer scheme'
1455 print *,
' --- PIFM 2-stream transfer scheme'
1457 print *,
' --- Discrete ordinates 2-stream transfer scheme'
1461 print *,
' --- Rare gases absorption is NOT included in SW'
1463 print *,
' --- Include rare gases N2O, CH4, O2, absorptions',&
1468 print *,
' --- Using standard grid average clouds, no ', &
1469 &
'sub-column clouds approximation applied'
1471 print *,
' --- Using MCICA sub-colum clouds approximation ', &
1472 &
'with a prescribed sequence of permutation seeds'
1474 print *,
' --- Using MCICA sub-colum clouds approximation ', &
1475 &
'with provided input array of permutation seeds'
1477 print *,
' *** Error in specification of sub-column cloud ', &
1478 &
' control flag isubcsw =',
isubcsw,
' !!'
1487 print *,
' *** Model cloud scheme inconsistent with SW', &
1488 &
' radiation cloud radiative property setup !!'
1514 tfn = float(i) / float(
ntbmx-i)
1560 & ( cfrac,cliqp,reliq,cicep,reice,cdat1,cdat2,cdat3,cdat4, &
1561 & cf1, nlay, ipseed, &
1562 & taucw, ssacw, asycw, cldfrc, cldfmc &
1643 integer,
intent(in) :: nlay, ipseed
1644 real (kind=kind_phys),
intent(in) :: cf1
1646 real (kind=kind_phys),
dimension(nlay),
intent(in) :: cliqp, &
1647 & reliq, cicep, reice, cdat1, cdat2, cdat3, cdat4, cfrac
1650 real (kind=kind_phys),
dimension(nlay,ngptsw),
intent(out) :: &
1652 real (kind=kind_phys),
dimension(nlay,nbdsw),
intent(out) :: &
1653 & taucw, ssacw, asycw
1654 real (kind=kind_phys),
dimension(nlay),
intent(out) :: cldfrc
1657 real (kind=kind_phys),
dimension(nblow:nbhgh) :: tauliq, tauice, &
1658 & ssaliq, ssaice, ssaran, ssasnw, asyliq, asyice, &
1660 real (kind=kind_phys),
dimension(nlay) :: cldf
1662 real (kind=kind_phys) :: dgeice, factor, fint, tauran, tausnw, &
1663 & cldliq, refliq, cldice, refice, cldran, cldsnw, refsnw, &
1664 & extcoliq, ssacoliq, asycoliq, extcoice, ssacoice, asycoice,&
1667 logical :: lcloudy(nlay,
ngptsw)
1668 integer :: ia, ib, ig, jb, k, index
1675 taucw(k,ib) = f_zero
1677 asycw(k,ib) = f_zero
1683 lab_if_iswcliq :
if (
iswcliq > 0)
then
1685 lab_do_k :
do k = 1, nlay
1686 lab_if_cld :
if (cfrac(k) > ftiny)
then
1704 dgesnw = 1.0315 * refsnw
1706 tauran = cldran *
a0r
1714 if (cldsnw>f_zero .and. refsnw>10.0_kind_phys)
then
1716 tausnw = cldsnw*1.09087*(
a0s + a1s/dgesnw)
1722 ssaran(ib) = tauran * (f_one -
b0r(ib))
1723 ssasnw(ib) = tausnw * (f_one - (
b0s(ib)+b1s(ib)*dgesnw))
1724 asyran(ib) = ssaran(ib) *
c0r(ib)
1725 asysnw(ib) = ssasnw(ib) *
c0s(ib)
1735 if ( cldliq <= f_zero )
then
1743 factor = refliq - 1.5
1744 index = max( 1, min( 57, int( factor ) ))
1745 fint = factor - float(index)
1748 extcoliq = max(f_zero,
extliq1(index,ib) &
1750 ssacoliq = max(f_zero, min(f_one,
ssaliq1(index,ib) &
1753 asycoliq = max(f_zero, min(f_one,
asyliq1(index,ib) &
1757 tauliq(ib) = cldliq * extcoliq
1758 ssaliq(ib) = tauliq(ib) * ssacoliq
1759 asyliq(ib) = ssaliq(ib) * asycoliq
1766 if ( cldice <= f_zero )
then
1778 refice = min(130.0_kind_phys,max(13.0_kind_phys,refice))
1783 extcoice = max(f_zero,
abari(ia)+
bbari(ia)/refice )
1784 ssacoice = max(f_zero, min(f_one, &
1786 asycoice = max(f_zero, min(f_one, &
1790 tauice(ib) = cldice * extcoice
1791 ssaice(ib) = tauice(ib) * ssacoice
1792 asyice(ib) = ssaice(ib) * asycoice
1798 refice = min(131.0_kind_phys,max(5.0_kind_phys,refice))
1800 factor = (refice - 2.0) / 3.0
1801 index = max( 1, min( 42, int( factor ) ))
1802 fint = factor - float(index)
1805 extcoice = max(f_zero,
extice2(index,ib) &
1807 ssacoice = max(f_zero, min(f_one,
ssaice2(index,ib) &
1809 asycoice = max(f_zero, min(f_one,
asyice2(index,ib) &
1813 tauice(ib) = cldice * extcoice
1814 ssaice(ib) = tauice(ib) * ssacoice
1815 asyice(ib) = ssaice(ib) * asycoice
1822 dgeice = max( 5.0, min( 140.0, 1.0315*refice ))
1824 factor = (dgeice - 2.0) / 3.0
1825 index = max( 1, min( 45, int( factor ) ))
1826 fint = factor - float(index)
1829 extcoice = max(f_zero,
extice3(index,ib) &
1831 ssacoice = max(f_zero, min(f_one,
ssaice3(index,ib) &
1833 asycoice = max(f_zero, min(f_one,
asyice3(index,ib) &
1839 tauice(ib) = cldice * extcoice
1840 ssaice(ib) = tauice(ib) * ssacoice
1841 asyice(ib) = ssaice(ib) * asycoice
1849 taucw(k,ib) = tauliq(jb)+tauice(jb)+tauran+tausnw
1850 ssacw(k,ib) = ssaliq(jb)+ssaice(jb)+ssaran(jb)+ssasnw(jb)
1851 asycw(k,ib) = asyliq(jb)+asyice(jb)+asyran(jb)+asysnw(jb)
1860 if (cfrac(k) > ftiny)
then
1862 taucw(k,ib) = cdat1(k)
1863 ssacw(k,ib) = cdat1(k) * cdat2(k)
1864 asycw(k,ib) = ssacw(k,ib) * cdat3(k)
1869 endif lab_if_iswcliq
1877 where (cldf(:) < ftiny)
1885 & ( cldf, nlay, ipseed, &
1892 if ( lcloudy(k,ig) )
then
1893 cldfmc(k,ig) = f_one
1895 cldfmc(k,ig) = f_zero
1903 cldfrc(k) = cfrac(k) / cf1
1921 & ( cldf, nlay, ipseed, &
1948 integer,
intent(in) :: nlay, ipseed
1950 real (kind=kind_phys),
dimension(nlay),
intent(in) :: cldf
1953 logical,
dimension(nlay,ngptsw),
intent(out):: lcloudy
1956 real (kind=kind_phys) :: cdfunc(nlay,
ngptsw), tem1, &
1957 & rand2d(nlay*ngptsw), rand1d(ngptsw)
1959 type(random_stat) :: stat
1967 call random_setseed &
1980 call random_number &
1989 cdfunc(k,n) = rand2d(k1)
1995 call random_number &
2004 cdfunc(k,n) = rand2d(k1)
2016 tem1 = f_one - cldf(k1)
2019 if ( cdfunc(k1,n) > tem1 )
then
2020 cdfunc(k,n) = cdfunc(k1,n)
2022 cdfunc(k,n) = cdfunc(k,n) * tem1
2047 call random_number &
2065 tem1 = f_one - cldf(k)
2068 lcloudy(k,n) = cdfunc(k,n) >= tem1
2103 & ( pavel,tavel,h2ovmr, nlay,nlp1, &
2104 & laytrop,jp,jt,jt1,fac00,fac01,fac10,fac11, &
2105 & selffac,selffrac,indself,forfac,forfrac,indfor &
2145 integer,
intent(in) :: nlay, nlp1
2147 real (kind=kind_phys),
dimension(:),
intent(in) :: pavel, tavel, &
2151 integer,
dimension(nlay),
intent(out) :: indself, indfor, &
2153 integer,
intent(out) :: laytrop
2155 real (kind=kind_phys),
dimension(nlay),
intent(out) :: fac00, &
2156 & fac01, fac10, fac11, selffac, selffrac, forfac, forfrac
2159 real (kind=kind_phys) :: plog, fp, fp1, ft, ft1, tem1, tem2
2161 integer :: i, k, jp1
2169 forfac(k) = pavel(k)*stpfac / (tavel(k)*(f_one + h2ovmr(k)))
2176 plog = log(pavel(k))
2177 jp(k) = max(1, min(58, int(36.0 - 5.0*(plog+0.04)) ))
2179 fp = 5.0 * (
preflog(jp(k)) - plog)
2188 tem1 = (tavel(k) -
tref(jp(k))) / 15.0
2189 tem2 = (tavel(k) -
tref(jp1 )) / 15.0
2190 jt(k) = max(1, min(4, int(3.0 + tem1) ))
2191 jt1(k) = max(1, min(4, int(3.0 + tem2) ))
2192 ft = tem1 - float(jt(k) - 3)
2193 ft1 = tem2 - float(jt1(k) - 3)
2204 fac00(k) = fp1 * (f_one - ft)
2206 fac01(k) = fp * (f_one - ft1)
2211 if ( plog > 4.56 )
then
2218 tem1 = (332.0 - tavel(k)) / 36.0
2219 indfor(k) = min(2, max(1, int(tem1)))
2220 forfrac(k) = tem1 - float(indfor(k))
2225 tem2 = (tavel(k) - 188.0) / 7.2
2226 indself(k) = min(9, max(1, int(tem2)-7))
2227 selffrac(k) = tem2 - float(indself(k) + 7)
2228 selffac(k) = h2ovmr(k) * forfac(k)
2235 tem1 = (tavel(k) - 188.0) / 36.0
2237 forfrac(k) = tem1 - f_one
2240 selffrac(k) = f_zero
2293 & ( ssolar,cosz,sntz,albbm,albdf,sfluxzen,cldfrc, &
2294 & cf1,cf0,taug,taur,tauae,ssaae,asyae,taucw,ssacw,asycw, &
2296 & fxupc,fxdnc,fxup0,fxdn0, &
2297 & ftoauc,ftoau0,ftoadc,fsfcuc,fsfcu0,fsfcdc,fsfcd0, &
2298 & sfbmc,sfdfc,sfbm0,sfdf0,suvbfc,suvbf0 &
2392 real (kind=kind_phys),
parameter :: zcrit = 0.9999995
2393 real (kind=kind_phys),
parameter :: zsr3 = sqrt(3.0)
2394 real (kind=kind_phys),
parameter :: od_lo = 0.06
2395 real (kind=kind_phys),
parameter :: eps1 = 1.0e-8
2398 integer,
intent(in) :: nlay, nlp1
2400 real (kind=kind_phys),
dimension(nlay,ngptsw),
intent(in) :: &
2402 real (kind=kind_phys),
dimension(nlay,nbdsw),
intent(in) :: &
2403 & taucw, ssacw, asycw, tauae, ssaae, asyae
2405 real (kind=kind_phys),
dimension(ngptsw),
intent(in) :: sfluxzen
2406 real (kind=kind_phys),
dimension(nlay),
intent(in) :: cldfrc
2408 real (kind=kind_phys),
dimension(2),
intent(in) :: albbm, albdf
2410 real (kind=kind_phys),
intent(in) :: cosz, sntz, cf1, cf0, ssolar
2413 real (kind=kind_phys),
dimension(nlp1,nbdsw),
intent(out) :: &
2414 & fxupc, fxdnc, fxup0, fxdn0
2416 real (kind=kind_phys),
dimension(2),
intent(out) :: sfbmc, sfdfc, &
2419 real (kind=kind_phys),
intent(out) :: suvbfc, suvbf0, ftoadc, &
2420 & ftoauc, ftoau0, fsfcuc, fsfcu0, fsfcdc, fsfcd0
2423 real (kind=kind_phys),
dimension(nlay) :: ztaus, zssas, zasys, &
2426 real (kind=kind_phys),
dimension(nlp1) :: zrefb, zrefd, ztrab, &
2427 & ztrad, ztdbt, zldbt, zfu, zfd
2429 real (kind=kind_phys) :: ztau1, zssa1, zasy1, ztau0, zssa0, &
2430 & zasy0, zasy3, zssaw, zasyw, zgam1, zgam2, zgam3, zgam4, &
2431 & zc0, zc1, za1, za2, zb1, zb2, zrk, zrk2, zrp, zrp1, zrm1, &
2432 & zrpp, zrkg1, zrkg3, zrkg4, zexp1, zexm1, zexp2, zexm2, &
2433 & zexp3, zexp4, zden1, ze1r45, ftind, zsolar, zrefb1, &
2434 & zrefd1, ztrab1, ztrad1, ztdbt0, zr1, zr2, zr3, zr4, zr5, &
2435 & zt1, zt2, zt3, zf1, zf2
2437 integer :: ib, ibd, jb, jg, k, kp, itind
2444 fxdnc(k,ib) = f_zero
2445 fxupc(k,ib) = f_zero
2446 fxdn0(k,ib) = f_zero
2447 fxup0(k,ib) = f_zero
2475 lab_do_jg :
do jg = 1,
ngptsw
2481 zsolar = ssolar * sfluxzen(jg)
2490 zrefb(1) = albbm(ibd)
2491 zrefd(1) = albdf(ibd)
2493 zrefb(1) = 0.5 * (albbm(1) + albbm(2))
2494 zrefd(1) = 0.5 * (albdf(1) + albdf(2))
2513 ztau0 = max( ftiny, taur(k,jg)+taug(k,jg)+tauae(k,ib) )
2514 zssa0 = taur(k,jg) + tauae(k,ib)*ssaae(k,ib)
2515 zasy0 = asyae(k,ib)*ssaae(k,ib)*tauae(k,ib)
2516 zssaw = min( oneminus, zssa0 / ztau0 )
2517 zasyw = zasy0 / max( ftiny, zssa0 )
2528 ztau1 = (f_one - za2) * ztau0
2529 zssa1 = (zssaw - za2) / (f_one - za2)
2531 zasy1 = zasyw / (f_one + zasyw)
2532 zasy3 = 0.75 * zasy1
2536 zgam1 = 1.75 - zssa1 * (f_one + zasy3)
2537 zgam2 =-0.25 + zssa1 * (f_one - zasy3)
2538 zgam3 = 0.5 - zasy3 * cosz
2540 zgam1 = 2.0 - zssa1 * (1.25 + zasy3)
2541 zgam2 = 0.75* zssa1 * (f_one- zasy1)
2542 zgam3 = 0.5 - zasy3 * cosz
2544 zgam1 = zsr3 * (2.0 - zssa1 * (1.0 + zasy1)) * 0.5
2545 zgam2 = zsr3 * zssa1 * (1.0 - zasy1) * 0.5
2546 zgam3 = (1.0 - zsr3 * zasy1 * cosz) * 0.5
2548 zgam4 = f_one - zgam3
2552 if ( zssaw >= zcrit )
then
2553 za1 = zgam1 * cosz - zgam3
2559 zb1 = min( ztau1*sntz , 500.0 )
2560 if ( zb1 <= od_lo )
then
2561 zb2 = f_one - zb1 + 0.5*zb1*zb1
2563 ftind = zb1 / (
bpade + zb1)
2564 itind = ftind*
ntbmx + 0.5
2569 zrefb(kp) = max(f_zero, min(f_one, &
2570 & (za2 - za1*(f_one - zb2))/(f_one + za2) ))
2571 ztrab(kp) = max(f_zero, min(f_one, f_one-zrefb(kp) ))
2574 zrefd(kp) = max(f_zero, min(f_one, za2/(f_one + za2) ))
2575 ztrad(kp) = max(f_zero, min(f_one, f_one-zrefd(kp) ))
2578 za1 = zgam1*zgam4 + zgam2*zgam3
2579 za2 = zgam1*zgam3 + zgam2*zgam4
2580 zrk = sqrt( (zgam1 - zgam2) * (zgam1 + zgam2) )
2586 zrpp = f_one - zrp*zrp
2591 zr1 = zrm1 * (za2 + zrkg3)
2592 zr2 = zrp1 * (za2 - zrkg3)
2593 zr3 = zrk2 * (zgam3 - za2*cosz)
2595 zr5 = zrpp * (zrk - zgam1)
2597 zt1 = zrp1 * (za1 + zrkg4)
2598 zt2 = zrm1 * (za1 - zrkg4)
2599 zt3 = zrk2 * (zgam4 + za1*cosz)
2604 zb1 = min( zrk*ztau1, 500.0 )
2605 if ( zb1 <= od_lo )
then
2606 zexm1 = f_one - zb1 + 0.5*zb1*zb1
2608 ftind = zb1 / (
bpade + zb1)
2609 itind = ftind*
ntbmx + 0.5
2612 zexp1 = f_one / zexm1
2614 zb2 = min( sntz*ztau1, 500.0 )
2615 if ( zb2 <= od_lo )
then
2616 zexm2 = f_one - zb2 + 0.5*zb2*zb2
2618 ftind = zb2 / (
bpade + zb2)
2619 itind = ftind*
ntbmx + 0.5
2622 zexp2 = f_one / zexm2
2623 ze1r45 = zr4*zexp1 + zr5*zexm1
2626 if (ze1r45>=-eps1 .and. ze1r45<=eps1)
then
2630 zden1 = zssa1 / ze1r45
2631 zrefb(kp) = max(f_zero, min(f_one, &
2632 & (zr1*zexp1 - zr2*zexm1 - zr3*zexm2)*zden1 ))
2633 ztrab(kp) = max(f_zero, min(f_one, zexm2*(f_one &
2634 & - (zt1*zexp1 - zt2*zexm1 - zt3*zexp2)*zden1) ))
2638 zden1 = zr4 / (ze1r45 * zrkg1)
2639 zrefd(kp) = max(f_zero, min(f_one, &
2640 & zgam2*(zexp1 - zexm1)*zden1 ))
2641 ztrad(kp) = max(f_zero, min(f_one, zrk2*zden1 ))
2649 if ( zr1 <= od_lo )
then
2650 zexp3 = f_one - zr1 + 0.5*zr1*zr1
2652 ftind = zr1 / (
bpade + zr1)
2653 itind = max(0, min(
ntbmx, int(0.5+
ntbmx*ftind) ))
2657 ztdbt(k) = zexp3 * ztdbt(kp)
2664 if ( zr1 <= od_lo )
then
2665 zexp4 = f_one - zr1 + 0.5*zr1*zr1
2667 ftind = zr1 / (
bpade + zr1)
2668 itind = max(0, min(
ntbmx, int(0.5+
ntbmx*ftind) ))
2673 ztdbt0 = zexp4 * ztdbt0
2678 & ( zrefb,zrefd,ztrab,ztrad,zldbt,ztdbt, &
2686 fxup0(k,ib) = fxup0(k,ib) + zsolar*zfu(k)
2687 fxdn0(k,ib) = fxdn0(k,ib) + zsolar*zfd(k)
2692 zb2 = zsolar*(zfd(1) - ztdbt0)
2695 sfbm0(ibd) = sfbm0(ibd) + zb1
2696 sfdf0(ibd) = sfdf0(ibd) + zb2
2700 sfbm0(1) = sfbm0(1) + zf1
2701 sfdf0(1) = sfdf0(1) + zf2
2702 sfbm0(2) = sfbm0(2) + zf1
2703 sfdf0(2) = sfdf0(2) + zf2
2718 if ( cf1 > eps )
then
2726 zc0 = f_one - cldfrc(k)
2728 if ( zc1 > ftiny )
then
2730 ztau0 = ztaus(k) + taucw(k,ib)
2731 zssa0 = zssas(k) + ssacw(k,ib)
2732 zasy0 = zasys(k) + asycw(k,ib)
2733 zssaw = min(oneminus, zssa0 / ztau0)
2734 zasyw = zasy0 / max(ftiny, zssa0)
2740 ztau1 = (f_one - za2) * ztau0
2741 zssa1 = (zssaw - za2) / (f_one - za2)
2743 zasy1 = zasyw / (f_one + zasyw)
2744 zasy3 = 0.75 * zasy1
2748 zgam1 = 1.75 - zssa1 * (f_one + zasy3)
2749 zgam2 =-0.25 + zssa1 * (f_one - zasy3)
2750 zgam3 = 0.5 - zasy3 * cosz
2752 zgam1 = 2.0 - zssa1 * (1.25 + zasy3)
2753 zgam2 = 0.75* zssa1 * (f_one- zasy1)
2754 zgam3 = 0.5 - zasy3 * cosz
2756 zgam1 = zsr3 * (2.0 - zssa1 * (1.0 + zasy1)) * 0.5
2757 zgam2 = zsr3 * zssa1 * (1.0 - zasy1) * 0.5
2758 zgam3 = (1.0 - zsr3 * zasy1 * cosz) * 0.5
2760 zgam4 = f_one - zgam3
2769 if ( zssaw >= zcrit )
then
2770 za1 = zgam1 * cosz - zgam3
2776 zb1 = min( ztau1*sntz , 500.0 )
2777 if ( zb1 <= od_lo )
then
2778 zb2 = f_one - zb1 + 0.5*zb1*zb1
2780 ftind = zb1 / (
bpade + zb1)
2781 itind = ftind*
ntbmx + 0.5
2786 zrefb(kp) = max(f_zero, min(f_one, &
2787 & (za2 - za1*(f_one - zb2))/(f_one + za2) ))
2788 ztrab(kp) = max(f_zero, min(f_one, f_one-zrefb(kp)))
2791 zrefd(kp) = max(f_zero, min(f_one, za2 / (f_one+za2) ))
2792 ztrad(kp) = max(f_zero, min(f_one, f_one - zrefd(kp) ))
2795 za1 = zgam1*zgam4 + zgam2*zgam3
2796 za2 = zgam1*zgam3 + zgam2*zgam4
2797 zrk = sqrt( (zgam1 - zgam2) * (zgam1 + zgam2) )
2803 zrpp = f_one - zrp*zrp
2808 zr1 = zrm1 * (za2 + zrkg3)
2809 zr2 = zrp1 * (za2 - zrkg3)
2810 zr3 = zrk2 * (zgam3 - za2*cosz)
2812 zr5 = zrpp * (zrk - zgam1)
2814 zt1 = zrp1 * (za1 + zrkg4)
2815 zt2 = zrm1 * (za1 - zrkg4)
2816 zt3 = zrk2 * (zgam4 + za1*cosz)
2821 zb1 = min( zrk*ztau1, 500.0 )
2822 if ( zb1 <= od_lo )
then
2823 zexm1 = f_one - zb1 + 0.5*zb1*zb1
2825 ftind = zb1 / (
bpade + zb1)
2826 itind = ftind*
ntbmx + 0.5
2829 zexp1 = f_one / zexm1
2831 zb2 = min( ztau1*sntz, 500.0 )
2832 if ( zb2 <= od_lo )
then
2833 zexm2 = f_one - zb2 + 0.5*zb2*zb2
2835 ftind = zb2 / (
bpade + zb2)
2836 itind = ftind*
ntbmx + 0.5
2839 zexp2 = f_one / zexm2
2840 ze1r45 = zr4*zexp1 + zr5*zexm1
2843 if ( ze1r45>=-eps1 .and. ze1r45<=eps1 )
then
2847 zden1 = zssa1 / ze1r45
2848 zrefb(kp) = max(f_zero, min(f_one, &
2849 & (zr1*zexp1-zr2*zexm1-zr3*zexm2)*zden1 ))
2850 ztrab(kp) = max(f_zero, min(f_one, zexm2*(f_one - &
2851 & (zt1*zexp1-zt2*zexm1-zt3*zexp2)*zden1) ))
2855 zden1 = zr4 / (ze1r45 * zrkg1)
2856 zrefd(kp) = max(f_zero, min(f_one, &
2857 & zgam2*(zexp1 - zexm1)*zden1 ))
2858 ztrad(kp) = max(f_zero, min(f_one, zrk2*zden1 ))
2864 zrefb(kp) = zc0*zrefb1 + zc1*zrefb(kp)
2865 zrefd(kp) = zc0*zrefd1 + zc1*zrefd(kp)
2866 ztrab(kp) = zc0*ztrab1 + zc1*ztrab(kp)
2867 ztrad(kp) = zc0*ztrad1 + zc1*ztrad(kp)
2874 if ( zr1 <= od_lo )
then
2875 zexp3 = f_one - zr1 + 0.5*zr1*zr1
2877 ftind = zr1 / (
bpade + zr1)
2878 itind = max(0, min(
ntbmx, int(0.5+
ntbmx*ftind) ))
2882 zldbt(kp) = zc0*zldbt(kp) + zc1*zexp3
2883 ztdbt(k) = zldbt(kp) * ztdbt(kp)
2889 if ( zr1 <= od_lo )
then
2890 zexp4 = f_one - zr1 + 0.5*zr1*zr1
2892 ftind = zr1 / (
bpade + zr1)
2893 itind = max(0, min(
ntbmx, int(0.5+
ntbmx*ftind) ))
2897 ztdbt0 = (zc0*zldbt0(k) + zc1*zexp4) * ztdbt0
2902 ztdbt(k) = zldbt(kp) * ztdbt(kp)
2905 ztdbt0 = zldbt0(k) * ztdbt0
2914 & ( zrefb,zrefd,ztrab,ztrad,zldbt,ztdbt, &
2922 fxupc(k,ib) = fxupc(k,ib) + zsolar*zfu(k)
2923 fxdnc(k,ib) = fxdnc(k,ib) + zsolar*zfd(k)
2929 zb2 = zsolar*(zfd(1) - ztdbt0)
2932 sfbmc(ibd) = sfbmc(ibd) + zb1
2933 sfdfc(ibd) = sfdfc(ibd) + zb2
2937 sfbmc(1) = sfbmc(1) + zf1
2938 sfdfc(1) = sfdfc(1) + zf2
2939 sfbmc(2) = sfbmc(2) + zf1
2940 sfdfc(2) = sfdfc(2) + zf2
2952 ftoadc = ftoadc + fxdn0(nlp1,ib)
2953 ftoau0 = ftoau0 + fxup0(nlp1,ib)
2954 fsfcu0 = fsfcu0 + fxup0(1,ib)
2955 fsfcd0 = fsfcd0 + fxdn0(1,ib)
2960 suvbf0 = fxdn0(1,ibd)
2962 if ( cf1 <= eps )
then
2965 fxupc(k,ib) = fxup0(k,ib)
2966 fxdnc(k,ib) = fxdn0(k,ib)
2985 fxupc(k,ib) = cf1*fxupc(k,ib) + cf0*fxup0(k,ib)
2986 fxdnc(k,ib) = cf1*fxdnc(k,ib) + cf0*fxdn0(k,ib)
2991 ftoauc = ftoauc + fxupc(nlp1,ib)
2992 fsfcuc = fsfcuc + fxupc(1,ib)
2993 fsfcdc = fsfcdc + fxdnc(1,ib)
2997 suvbfc = fxdnc(1,ibd)
3000 sfbmc(1) = cf1*sfbmc(1) + cf0*sfbm0(1)
3001 sfbmc(2) = cf1*sfbmc(2) + cf0*sfbm0(2)
3002 sfdfc(1) = cf1*sfdfc(1) + cf0*sfdf0(1)
3003 sfdfc(2) = cf1*sfdfc(2) + cf0*sfdf0(2)
3053 & ( ssolar,cosz,sntz,albbm,albdf,sfluxzen,cldfmc, &
3054 & cf1,cf0,taug,taur,tauae,ssaae,asyae,taucw,ssacw,asycw, &
3056 & fxupc,fxdnc,fxup0,fxdn0, &
3057 & ftoauc,ftoau0,ftoadc,fsfcuc,fsfcu0,fsfcdc,fsfcd0, &
3058 & sfbmc,sfdfc,sfbm0,sfdf0,suvbfc,suvbf0 &
3154 real (kind=kind_phys),
parameter :: zcrit = 0.9999995
3155 real (kind=kind_phys),
parameter :: zsr3 = sqrt(3.0)
3156 real (kind=kind_phys),
parameter :: od_lo = 0.06
3157 real (kind=kind_phys),
parameter :: eps1 = 1.0e-8
3160 integer,
intent(in) :: nlay, nlp1
3162 real (kind=kind_phys),
dimension(nlay,ngptsw),
intent(in) :: &
3163 & taug, taur, cldfmc
3164 real (kind=kind_phys),
dimension(nlay,nbdsw),
intent(in) :: &
3165 & taucw, ssacw, asycw, tauae, ssaae, asyae
3167 real (kind=kind_phys),
dimension(ngptsw),
intent(in) :: sfluxzen
3169 real (kind=kind_phys),
dimension(2),
intent(in) :: albbm, albdf
3171 real (kind=kind_phys),
intent(in) :: cosz, sntz, cf1, cf0, ssolar
3174 real (kind=kind_phys),
dimension(nlp1,nbdsw),
intent(out) :: &
3175 & fxupc, fxdnc, fxup0, fxdn0
3177 real (kind=kind_phys),
dimension(2),
intent(out) :: sfbmc, sfdfc, &
3180 real (kind=kind_phys),
intent(out) :: suvbfc, suvbf0, ftoadc, &
3181 & ftoauc, ftoau0, fsfcuc, fsfcu0, fsfcdc, fsfcd0
3184 real (kind=kind_phys),
dimension(nlay) :: ztaus, zssas, zasys, &
3187 real (kind=kind_phys),
dimension(nlp1) :: zrefb, zrefd, ztrab, &
3188 & ztrad, ztdbt, zldbt, zfu, zfd
3190 real (kind=kind_phys) :: ztau1, zssa1, zasy1, ztau0, zssa0, &
3191 & zasy0, zasy3, zssaw, zasyw, zgam1, zgam2, zgam3, zgam4, &
3192 & za1, za2, zb1, zb2, zrk, zrk2, zrp, zrp1, zrm1, zrpp, &
3193 & zrkg1, zrkg3, zrkg4, zexp1, zexm1, zexp2, zexm2, zden1, &
3194 & zexp3, zexp4, ze1r45, ftind, zsolar, ztdbt0, zr1, zr2, &
3195 & zr3, zr4, zr5, zt1, zt2, zt3, zf1, zf2
3197 integer :: ib, ibd, jb, jg, k, kp, itind
3205 fxdnc(k,ib) = f_zero
3206 fxupc(k,ib) = f_zero
3207 fxdn0(k,ib) = f_zero
3208 fxup0(k,ib) = f_zero
3236 lab_do_jg :
do jg = 1,
ngptsw
3242 zsolar = ssolar * sfluxzen(jg)
3251 zrefb(1) = albbm(ibd)
3252 zrefd(1) = albdf(ibd)
3254 zrefb(1) = 0.5 * (albbm(1) + albbm(2))
3255 zrefd(1) = 0.5 * (albdf(1) + albdf(2))
3273 ztau0 = max( ftiny, taur(k,jg)+taug(k,jg)+tauae(k,ib) )
3274 zssa0 = taur(k,jg) + tauae(k,ib)*ssaae(k,ib)
3275 zasy0 = asyae(k,ib)*ssaae(k,ib)*tauae(k,ib)
3276 zssaw = min( oneminus, zssa0 / ztau0 )
3277 zasyw = zasy0 / max( ftiny, zssa0 )
3288 ztau1 = (f_one - za2) * ztau0
3289 zssa1 = (zssaw - za2) / (f_one - za2)
3291 zasy1 = zasyw / (f_one + zasyw)
3292 zasy3 = 0.75 * zasy1
3296 zgam1 = 1.75 - zssa1 * (f_one + zasy3)
3297 zgam2 =-0.25 + zssa1 * (f_one - zasy3)
3298 zgam3 = 0.5 - zasy3 * cosz
3300 zgam1 = 2.0 - zssa1 * (1.25 + zasy3)
3301 zgam2 = 0.75* zssa1 * (f_one- zasy1)
3302 zgam3 = 0.5 - zasy3 * cosz
3304 zgam1 = zsr3 * (2.0 - zssa1 * (1.0 + zasy1)) * 0.5
3305 zgam2 = zsr3 * zssa1 * (1.0 - zasy1) * 0.5
3306 zgam3 = (1.0 - zsr3 * zasy1 * cosz) * 0.5
3308 zgam4 = f_one - zgam3
3312 if ( zssaw >= zcrit )
then
3313 za1 = zgam1 * cosz - zgam3
3319 zb1 = min( ztau1*sntz , 500.0 )
3320 if ( zb1 <= od_lo )
then
3321 zb2 = f_one - zb1 + 0.5*zb1*zb1
3323 ftind = zb1 / (
bpade + zb1)
3324 itind = ftind*
ntbmx + 0.5
3329 zrefb(kp) = max(f_zero, min(f_one, &
3330 & (za2 - za1*(f_one - zb2))/(f_one + za2) ))
3331 ztrab(kp) = max(f_zero, min(f_one, f_one-zrefb(kp) ))
3334 zrefd(kp) = max(f_zero, min(f_one, za2/(f_one + za2) ))
3335 ztrad(kp) = max(f_zero, min(f_one, f_one-zrefd(kp) ))
3338 za1 = zgam1*zgam4 + zgam2*zgam3
3339 za2 = zgam1*zgam3 + zgam2*zgam4
3340 zrk = sqrt( (zgam1 - zgam2) * (zgam1 + zgam2) )
3346 zrpp = f_one - zrp*zrp
3351 zr1 = zrm1 * (za2 + zrkg3)
3352 zr2 = zrp1 * (za2 - zrkg3)
3353 zr3 = zrk2 * (zgam3 - za2*cosz)
3355 zr5 = zrpp * (zrk - zgam1)
3357 zt1 = zrp1 * (za1 + zrkg4)
3358 zt2 = zrm1 * (za1 - zrkg4)
3359 zt3 = zrk2 * (zgam4 + za1*cosz)
3364 zb1 = min( zrk*ztau1, 500.0 )
3365 if ( zb1 <= od_lo )
then
3366 zexm1 = f_one - zb1 + 0.5*zb1*zb1
3368 ftind = zb1 / (
bpade + zb1)
3369 itind = ftind*
ntbmx + 0.5
3372 zexp1 = f_one / zexm1
3374 zb2 = min( sntz*ztau1, 500.0 )
3375 if ( zb2 <= od_lo )
then
3376 zexm2 = f_one - zb2 + 0.5*zb2*zb2
3378 ftind = zb2 / (
bpade + zb2)
3379 itind = ftind*
ntbmx + 0.5
3382 zexp2 = f_one / zexm2
3383 ze1r45 = zr4*zexp1 + zr5*zexm1
3386 if (ze1r45>=-eps1 .and. ze1r45<=eps1)
then
3390 zden1 = zssa1 / ze1r45
3391 zrefb(kp) = max(f_zero, min(f_one, &
3392 & (zr1*zexp1 - zr2*zexm1 - zr3*zexm2)*zden1 ))
3393 ztrab(kp) = max(f_zero, min(f_one, zexm2*(f_one &
3394 & - (zt1*zexp1 - zt2*zexm1 - zt3*zexp2)*zden1) ))
3398 zden1 = zr4 / (ze1r45 * zrkg1)
3399 zrefd(kp) = max(f_zero, min(f_one, &
3400 & zgam2*(zexp1 - zexm1)*zden1 ))
3401 ztrad(kp) = max(f_zero, min(f_one, zrk2*zden1 ))
3409 if ( zr1 <= od_lo )
then
3410 zexp3 = f_one - zr1 + 0.5*zr1*zr1
3412 ftind = zr1 / (
bpade + zr1)
3413 itind = max(0, min(
ntbmx, int(0.5+
ntbmx*ftind) ))
3417 ztdbt(k) = zexp3 * ztdbt(kp)
3424 if ( zr1 <= od_lo )
then
3425 zexp4 = f_one - zr1 + 0.5*zr1*zr1
3427 ftind = zr1 / (
bpade + zr1)
3428 itind = max(0, min(
ntbmx, int(0.5+
ntbmx*ftind) ))
3433 ztdbt0 = zexp4 * ztdbt0
3438 & ( zrefb,zrefd,ztrab,ztrad,zldbt,ztdbt, &
3446 fxup0(k,ib) = fxup0(k,ib) + zsolar*zfu(k)
3447 fxdn0(k,ib) = fxdn0(k,ib) + zsolar*zfd(k)
3452 zb2 = zsolar*(zfd(1) - ztdbt0)
3455 sfbm0(ibd) = sfbm0(ibd) + zb1
3456 sfdf0(ibd) = sfdf0(ibd) + zb2
3460 sfbm0(1) = sfbm0(1) + zf1
3461 sfdf0(1) = sfdf0(1) + zf2
3462 sfbm0(2) = sfbm0(2) + zf1
3463 sfdf0(2) = sfdf0(2) + zf2
3478 if ( cf1 > eps )
then
3486 if ( cldfmc(k,jg) > ftiny )
then
3488 ztau0 = ztaus(k) + taucw(k,ib)
3489 zssa0 = zssas(k) + ssacw(k,ib)
3490 zasy0 = zasys(k) + asycw(k,ib)
3491 zssaw = min(oneminus, zssa0 / ztau0)
3492 zasyw = zasy0 / max(ftiny, zssa0)
3498 ztau1 = (f_one - za2) * ztau0
3499 zssa1 = (zssaw - za2) / (f_one - za2)
3501 zasy1 = zasyw / (f_one + zasyw)
3502 zasy3 = 0.75 * zasy1
3506 zgam1 = 1.75 - zssa1 * (f_one + zasy3)
3507 zgam2 =-0.25 + zssa1 * (f_one - zasy3)
3508 zgam3 = 0.5 - zasy3 * cosz
3510 zgam1 = 2.0 - zssa1 * (1.25 + zasy3)
3511 zgam2 = 0.75* zssa1 * (f_one- zasy1)
3512 zgam3 = 0.5 - zasy3 * cosz
3514 zgam1 = zsr3 * (2.0 - zssa1 * (1.0 + zasy1)) * 0.5
3515 zgam2 = zsr3 * zssa1 * (1.0 - zasy1) * 0.5
3516 zgam3 = (1.0 - zsr3 * zasy1 * cosz) * 0.5
3518 zgam4 = f_one - zgam3
3522 if ( zssaw >= zcrit )
then
3523 za1 = zgam1 * cosz - zgam3
3529 zb1 = min( ztau1*sntz , 500.0 )
3530 if ( zb1 <= od_lo )
then
3531 zb2 = f_one - zb1 + 0.5*zb1*zb1
3533 ftind = zb1 / (
bpade + zb1)
3534 itind = ftind*
ntbmx + 0.5
3539 zrefb(kp) = max(f_zero, min(f_one, &
3540 & (za2 - za1*(f_one - zb2))/(f_one + za2) ))
3541 ztrab(kp) = max(f_zero, min(f_one, f_one-zrefb(kp)))
3544 zrefd(kp) = max(f_zero, min(f_one, za2 / (f_one+za2) ))
3545 ztrad(kp) = max(f_zero, min(f_one, f_one - zrefd(kp) ))
3548 za1 = zgam1*zgam4 + zgam2*zgam3
3549 za2 = zgam1*zgam3 + zgam2*zgam4
3550 zrk = sqrt( (zgam1 - zgam2) * (zgam1 + zgam2) )
3556 zrpp = f_one - zrp*zrp
3561 zr1 = zrm1 * (za2 + zrkg3)
3562 zr2 = zrp1 * (za2 - zrkg3)
3563 zr3 = zrk2 * (zgam3 - za2*cosz)
3565 zr5 = zrpp * (zrk - zgam1)
3567 zt1 = zrp1 * (za1 + zrkg4)
3568 zt2 = zrm1 * (za1 - zrkg4)
3569 zt3 = zrk2 * (zgam4 + za1*cosz)
3574 zb1 = min( zrk*ztau1, 500.0 )
3575 if ( zb1 <= od_lo )
then
3576 zexm1 = f_one - zb1 + 0.5*zb1*zb1
3578 ftind = zb1 / (
bpade + zb1)
3579 itind = ftind*
ntbmx + 0.5
3582 zexp1 = f_one / zexm1
3584 zb2 = min( ztau1*sntz, 500.0 )
3585 if ( zb2 <= od_lo )
then
3586 zexm2 = f_one - zb2 + 0.5*zb2*zb2
3588 ftind = zb2 / (
bpade + zb2)
3589 itind = ftind*
ntbmx + 0.5
3592 zexp2 = f_one / zexm2
3593 ze1r45 = zr4*zexp1 + zr5*zexm1
3596 if ( ze1r45>=-eps1 .and. ze1r45<=eps1 )
then
3600 zden1 = zssa1 / ze1r45
3601 zrefb(kp) = max(f_zero, min(f_one, &
3602 & (zr1*zexp1-zr2*zexm1-zr3*zexm2)*zden1 ))
3603 ztrab(kp) = max(f_zero, min(f_one, zexm2*(f_one - &
3604 & (zt1*zexp1-zt2*zexm1-zt3*zexp2)*zden1) ))
3608 zden1 = zr4 / (ze1r45 * zrkg1)
3609 zrefd(kp) = max(f_zero, min(f_one, &
3610 & zgam2*(zexp1 - zexm1)*zden1 ))
3611 ztrad(kp) = max(f_zero, min(f_one, zrk2*zden1 ))
3619 if ( zr1 <= od_lo )
then
3620 zexp3 = f_one - zr1 + 0.5*zr1*zr1
3622 ftind = zr1 / (
bpade + zr1)
3623 itind = max(0, min(
ntbmx, int(0.5+
ntbmx*ftind) ))
3628 ztdbt(k) = zexp3 * ztdbt(kp)
3634 if ( zr1 <= od_lo )
then
3635 zexp4 = f_one - zr1 + 0.5*zr1*zr1
3637 ftind = zr1 / (
bpade + zr1)
3638 itind = max(0, min(
ntbmx, int(0.5+
ntbmx*ftind) ))
3642 ztdbt0 = zexp4 * ztdbt0
3647 ztdbt(k) = zldbt(kp) * ztdbt(kp)
3650 ztdbt0 = zldbt0(k) * ztdbt0
3659 & ( zrefb,zrefd,ztrab,ztrad,zldbt,ztdbt, &
3667 fxupc(k,ib) = fxupc(k,ib) + zsolar*zfu(k)
3668 fxdnc(k,ib) = fxdnc(k,ib) + zsolar*zfd(k)
3674 zb2 = zsolar*(zfd(1) - ztdbt0)
3677 sfbmc(ibd) = sfbmc(ibd) + zb1
3678 sfdfc(ibd) = sfdfc(ibd) + zb2
3682 sfbmc(1) = sfbmc(1) + zf1
3683 sfdfc(1) = sfdfc(1) + zf2
3684 sfbmc(2) = sfbmc(2) + zf1
3685 sfdfc(2) = sfdfc(2) + zf2
3697 ftoadc = ftoadc + fxdn0(nlp1,ib)
3698 ftoau0 = ftoau0 + fxup0(nlp1,ib)
3699 fsfcu0 = fsfcu0 + fxup0(1,ib)
3700 fsfcd0 = fsfcd0 + fxdn0(1,ib)
3705 suvbf0 = fxdn0(1,ibd)
3707 if ( cf1 <= eps )
then
3710 fxupc(k,ib) = fxup0(k,ib)
3711 fxdnc(k,ib) = fxdn0(k,ib)
3729 ftoauc = ftoauc + fxupc(nlp1,ib)
3730 fsfcuc = fsfcuc + fxupc(1,ib)
3731 fsfcdc = fsfcdc + fxdnc(1,ib)
3735 suvbfc = fxdnc(1,ibd)
3758 & ( zrefb,zrefd,ztrab,ztrad,zldbt,ztdbt, &
3790 integer,
intent(in) :: nlay, nlp1
3792 real (kind=kind_phys),
dimension(nlp1),
intent(in) :: zrefb, &
3793 & zrefd, ztrab, ztrad, ztdbt, zldbt
3796 real (kind=kind_phys),
dimension(nlp1),
intent(out) :: zfu, zfd
3799 real (kind=kind_phys),
dimension(nlp1) :: zrupb,zrupd,zrdnd,ztdn
3801 real (kind=kind_phys) :: zden1
3816 zden1 = f_one / ( f_one - zrupd(k)*zrefd(kp) )
3817 zrupb(kp) = zrefb(kp) + ( ztrad(kp) * &
3818 & ( (ztrab(kp) - zldbt(kp))*zrupd(k) + &
3819 & zldbt(kp)*zrupb(k)) ) * zden1
3820 zrupd(kp) = zrefd(kp) + ztrad(kp)*ztrad(kp)*zrupd(k)*zden1
3825 zrdnd(nlp1) = f_zero
3826 ztdn(nlay) = ztrab(nlp1)
3827 zrdnd(nlay) = zrefd(nlp1)
3831 zden1 = f_one / (f_one - zrefd(k)*zrdnd(k))
3832 ztdn(k-1) = ztdbt(k)*ztrab(k) + ( ztrad(k) * &
3833 & ( (ztdn(k) - ztdbt(k)) + ztdbt(k) * &
3834 & zrefb(k)*zrdnd(k) )) * zden1
3835 zrdnd(k-1) = zrefd(k) + ztrad(k)*ztrad(k)*zrdnd(k)*zden1
3840 zden1 = f_one / (f_one - zrdnd(k)*zrupd(k))
3841 zfu(k) = ( ztdbt(k)*zrupb(k) + &
3842 & (ztdn(k) - ztdbt(k))*zrupd(k) ) * zden1
3843 zfd(k) = ztdbt(k) + ( ztdn(k) - ztdbt(k) + &
3844 & ztdbt(k)*zrupb(k)*zrdnd(k) ) * zden1
3894 & ( colamt,colmol,fac00,fac01,fac10,fac11,jp,jt,jt1,laytrop, &
3895 & forfac,forfrac,indfor,selffac,selffrac,indself, nlay, &
3896 & sfluxzen, taug, taur &
3996 integer,
intent(in) :: nlay, laytrop
3998 integer,
dimension(nlay),
intent(in) :: indfor, indself, &
4001 real (kind=kind_phys),
dimension(nlay),
intent(in) :: colmol, &
4002 & fac00, fac01, fac10, fac11, forfac, forfrac, selffac, &
4005 real (kind=kind_phys),
dimension(nlay,maxgas),
intent(in) :: colamt
4008 real (kind=kind_phys),
dimension(ngptsw),
intent(out) :: sfluxzen
4010 real (kind=kind_phys),
dimension(nlay,ngptsw),
intent(out) :: &
4014 real (kind=kind_phys) :: fs, speccomb, specmult, colm1, colm2
4016 integer,
dimension(nlay,nblow:nbhgh) :: id0, id1
4018 integer :: ibd, j, jb, js, k, klow, khgh, klim, ks, njb, ns
4029 id0(k,jb) = ((jp(k)-1)*5 + (jt(k)-1)) * nspa(jb)
4030 id1(k,jb) = ( jp(k) *5 + (jt1(k)-1)) * nspa(jb)
4033 do k = laytrop+1, nlay
4034 id0(k,jb) = ((jp(k)-13)*5 + (jt(k)-1)) * nspb(jb)
4035 id1(k,jb) = ((jp(k)-12)*5 + (jt1(k)-1)) * nspb(jb)
4046 case (16, 20, 23, 25, 26, 29)
4055 sfluxzen(ns+j) = scalekur *
sfluxref01(j,1,ibd)
4060 if (jb==17 .or. jb==28)
then
4063 lab_do_k1 :
do k = laytrop, nlay-1
4070 colm1 = colamt(ks,
ix1(jb))
4071 colm2 = colamt(ks,
ix2(jb))
4072 speccomb = colm1 +
strrat(jb)*colm2
4073 specmult =
specwt(jb) * min( oneminus, colm1/speccomb )
4074 js = 1 + int( specmult )
4075 fs = mod(specmult, f_one)
4085 lab_do_k2 :
do k = 1, laytrop-1
4092 colm1 = colamt(ks,
ix1(jb))
4093 colm2 = colamt(ks,
ix2(jb))
4094 speccomb = colm1 +
strrat(jb)*colm2
4095 specmult =
specwt(jb) * min( oneminus, colm1/speccomb )
4096 js = 1 + int( specmult )
4097 fs = mod(specmult, f_one)
4160 real (kind=kind_phys) :: speccomb, specmult, tauray, fs, fs1, &
4161 & fac000,fac001,fac010,fac011, fac100,fac101,fac110,fac111
4163 integer :: ind01, ind02, ind03, ind04, ind11, ind12, ind13, ind14
4164 integer :: inds, indf, indsp, indfp, j, js, k
4175 tauray = colmol(k) *
rayl
4178 taur(k,ns16+j) = tauray
4183 speccomb = colamt(k,1) +
strrat(16)*colamt(k,5)
4184 specmult = 8.0 * min( oneminus, colamt(k,1)/speccomb )
4186 js = 1 + int( specmult )
4187 fs = mod( specmult, f_one )
4189 fac000 = fs1 * fac00(k)
4190 fac010 = fs1 * fac10(k)
4191 fac100 = fs * fac00(k)
4192 fac110 = fs * fac10(k)
4193 fac001 = fs1 * fac01(k)
4194 fac011 = fs1 * fac11(k)
4195 fac101 = fs * fac01(k)
4196 fac111 = fs * fac11(k)
4198 ind01 = id0(k,16) + js
4202 ind11 = id1(k,16) + js
4212 taug(k,ns16+j) = speccomb &
4213 & *( fac000 *
absa(ind01,j) + fac100 *
absa(ind02,j) &
4214 & + fac010 *
absa(ind03,j) + fac110 *
absa(ind04,j) &
4215 & + fac001 *
absa(ind11,j) + fac101 *
absa(ind12,j) &
4216 & + fac011 *
absa(ind13,j) + fac111 *
absa(ind14,j) ) &
4217 & + colamt(k,1) * (selffac(k) * (
selfref(inds,j) &
4219 & + forfac(k) * (forref(indf,j) + forfrac(k) &
4220 & * (forref(indfp,j) - forref(indf,j))))
4224 do k = laytrop+1, nlay
4225 ind01 = id0(k,16) + 1
4227 ind11 = id1(k,16) + 1
4231 taug(k,ns16+j) = colamt(k,5) &
4232 & * ( fac00(k)*
absb(ind01,j) + fac10(k)*
absb(ind02,j) &
4233 & + fac01(k)*
absb(ind11,j) + fac11(k)*
absb(ind12,j) )
4256 real (kind=kind_phys) :: speccomb, specmult, tauray, fs, fs1, &
4257 & fac000,fac001,fac010,fac011, fac100,fac101,fac110,fac111
4259 integer :: ind01, ind02, ind03, ind04, ind11, ind12, ind13, ind14
4260 integer :: inds, indf, indsp, indfp, j, js, k
4271 tauray = colmol(k) *
rayl
4274 taur(k,ns17+j) = tauray
4279 speccomb = colamt(k,1) +
strrat(17)*colamt(k,2)
4280 specmult = 8.0 * min(oneminus, colamt(k,1) / speccomb)
4282 js = 1 + int(specmult)
4283 fs = mod(specmult, f_one)
4285 fac000 = fs1 * fac00(k)
4286 fac010 = fs1 * fac10(k)
4287 fac100 = fs * fac00(k)
4288 fac110 = fs * fac10(k)
4289 fac001 = fs1 * fac01(k)
4290 fac011 = fs1 * fac11(k)
4291 fac101 = fs * fac01(k)
4292 fac111 = fs * fac11(k)
4294 ind01 = id0(k,17) + js
4298 ind11 = id1(k,17) + js
4309 taug(k,ns17+j) = speccomb &
4310 & * ( fac000 *
absa(ind01,j) + fac100 *
absa(ind02,j) &
4311 & + fac010 *
absa(ind03,j) + fac110 *
absa(ind04,j) &
4312 & + fac001 *
absa(ind11,j) + fac101 *
absa(ind12,j) &
4313 & + fac011 *
absa(ind13,j) + fac111 *
absa(ind14,j) ) &
4314 & + colamt(k,1) * (selffac(k) * (
selfref(inds,j) &
4316 & + forfac(k) * (forref(indf,j) + forfrac(k) &
4317 & * (forref(indfp,j) - forref(indf,j))))
4321 do k = laytrop+1, nlay
4322 speccomb = colamt(k,1) +
strrat(17)*colamt(k,2)
4323 specmult = 4.0 * min(oneminus, colamt(k,1) / speccomb)
4325 js = 1 + int(specmult)
4326 fs = mod(specmult, f_one)
4328 fac000 = fs1 * fac00(k)
4329 fac010 = fs1 * fac10(k)
4330 fac100 = fs * fac00(k)
4331 fac110 = fs * fac10(k)
4332 fac001 = fs1 * fac01(k)
4333 fac011 = fs1 * fac11(k)
4334 fac101 = fs * fac01(k)
4335 fac111 = fs * fac11(k)
4337 ind01 = id0(k,17) + js
4341 ind11 = id1(k,17) + js
4350 taug(k,ns17+j) = speccomb &
4351 & * ( fac000 *
absb(ind01,j) + fac100 *
absb(ind02,j) &
4352 & + fac010 *
absb(ind03,j) + fac110 *
absb(ind04,j) &
4353 & + fac001 *
absb(ind11,j) + fac101 *
absb(ind12,j) &
4354 & + fac011 *
absb(ind13,j) + fac111 *
absb(ind14,j) ) &
4355 & + colamt(k,1) * forfac(k) * (forref(indf,j) &
4356 & + forfrac(k) * (forref(indfp,j) - forref(indf,j)))
4379 real (kind=kind_phys) :: speccomb, specmult, tauray, fs, fs1, &
4380 & fac000,fac001,fac010,fac011, fac100,fac101,fac110,fac111
4382 integer :: ind01, ind02, ind03, ind04, ind11, ind12, ind13, ind14
4383 integer :: inds, indf, indsp, indfp, j, js, k
4394 tauray = colmol(k) *
rayl
4397 taur(k,ns18+j) = tauray
4402 speccomb = colamt(k,1) +
strrat(18)*colamt(k,5)
4403 specmult = 8.0 * min(oneminus, colamt(k,1) / speccomb)
4405 js = 1 + int(specmult)
4406 fs = mod(specmult, f_one)
4408 fac000 = fs1 * fac00(k)
4409 fac010 = fs1 * fac10(k)
4410 fac100 = fs * fac00(k)
4411 fac110 = fs * fac10(k)
4412 fac001 = fs1 * fac01(k)
4413 fac011 = fs1 * fac11(k)
4414 fac101 = fs * fac01(k)
4415 fac111 = fs * fac11(k)
4417 ind01 = id0(k,18) + js
4421 ind11 = id1(k,18) + js
4432 taug(k,ns18+j) = speccomb &
4433 & * ( fac000 *
absa(ind01,j) + fac100 *
absa(ind02,j) &
4434 & + fac010 *
absa(ind03,j) + fac110 *
absa(ind04,j) &
4435 & + fac001 *
absa(ind11,j) + fac101 *
absa(ind12,j) &
4436 & + fac011 *
absa(ind13,j) + fac111 *
absa(ind14,j) ) &
4437 & + colamt(k,1) * (selffac(k) * (
selfref(inds,j) &
4439 & + forfac(k) * (forref(indf,j) + forfrac(k) &
4440 & * (forref(indfp,j) - forref(indf,j))))
4444 do k = laytrop+1, nlay
4445 ind01 = id0(k,18) + 1
4447 ind11 = id1(k,18) + 1
4451 taug(k,ns18+j) = colamt(k,5) &
4452 & * ( fac00(k)*
absb(ind01,j) + fac10(k)*
absb(ind02,j) &
4453 & + fac01(k)*
absb(ind11,j) + fac11(k)*
absb(ind12,j) )
4475 real (kind=kind_phys) :: speccomb, specmult, tauray, fs, fs1, &
4476 & fac000,fac001,fac010,fac011, fac100,fac101,fac110,fac111
4478 integer :: ind01, ind02, ind03, ind04, ind11, ind12, ind13, ind14
4479 integer :: inds, indf, indsp, indfp, j, js, k
4490 tauray = colmol(k) *
rayl
4493 taur(k,ns19+j) = tauray
4498 speccomb = colamt(k,1) +
strrat(19)*colamt(k,2)
4499 specmult = 8.0 * min(oneminus, colamt(k,1) / speccomb)
4501 js = 1 + int(specmult)
4502 fs = mod(specmult, f_one)
4504 fac000 = fs1 * fac00(k)
4505 fac010 = fs1 * fac10(k)
4506 fac100 = fs * fac00(k)
4507 fac110 = fs * fac10(k)
4508 fac001 = fs1 * fac01(k)
4509 fac011 = fs1 * fac11(k)
4510 fac101 = fs * fac01(k)
4511 fac111 = fs * fac11(k)
4513 ind01 = id0(k,19) + js
4517 ind11 = id1(k,19) + js
4528 taug(k,ns19+j) = speccomb &
4529 & * ( fac000 *
absa(ind01,j) + fac100 *
absa(ind02,j) &
4530 & + fac010 *
absa(ind03,j) + fac110 *
absa(ind04,j) &
4531 & + fac001 *
absa(ind11,j) + fac101 *
absa(ind12,j) &
4532 & + fac011 *
absa(ind13,j) + fac111 *
absa(ind14,j) ) &
4533 & + colamt(k,1) * (selffac(k) * (
selfref(inds,j) &
4535 & + forfac(k) * (forref(indf,j) + forfrac(k) &
4536 & * (forref(indfp,j) - forref(indf,j))))
4540 do k = laytrop+1, nlay
4541 ind01 = id0(k,19) + 1
4543 ind11 = id1(k,19) + 1
4547 taug(k,ns19+j) = colamt(k,2) &
4548 & * ( fac00(k)*
absb(ind01,j) + fac10(k)*
absb(ind02,j) &
4549 & + fac01(k)*
absb(ind11,j) + fac11(k)*
absb(ind12,j) )
4571 real (kind=kind_phys) :: tauray
4573 integer :: ind01, ind02, ind11, ind12
4574 integer :: inds, indf, indsp, indfp, j, k
4585 tauray = colmol(k) *
rayl
4588 taur(k,ns20+j) = tauray
4593 ind01 = id0(k,20) + 1
4595 ind11 = id1(k,20) + 1
4604 taug(k,ns20+j) = colamt(k,1) &
4605 & * ( (fac00(k)*
absa(ind01,j) + fac10(k)*
absa(ind02,j) &
4606 & + fac01(k)*
absa(ind11,j) + fac11(k)*
absa(ind12,j)) &
4607 & + selffac(k) * (
selfref(inds,j) + selffrac(k) &
4609 & + forfac(k) * (forref(indf,j) + forfrac(k) &
4610 & * (forref(indfp,j) - forref(indf,j))) ) &
4611 & + colamt(k,5) *
absch4(j)
4615 do k = laytrop+1, nlay
4616 ind01 = id0(k,20) + 1
4618 ind11 = id1(k,20) + 1
4625 taug(k,ns20+j) = colamt(k,1) &
4626 & * ( fac00(k)*
absb(ind01,j) + fac10(k)*
absb(ind02,j) &
4627 & + fac01(k)*
absb(ind11,j) + fac11(k)*
absb(ind12,j) &
4628 & + forfac(k) * (forref(indf,j) + forfrac(k) &
4629 & * (forref(indfp,j) - forref(indf,j))) ) &
4630 & + colamt(k,5) *
absch4(j)
4653 real (kind=kind_phys) :: speccomb, specmult, tauray, fs, fs1, &
4654 & fac000,fac001,fac010,fac011, fac100,fac101,fac110,fac111
4656 integer :: ind01, ind02, ind03, ind04, ind11, ind12, ind13, ind14
4657 integer :: inds, indf, indsp, indfp, j, js, k
4668 tauray = colmol(k) *
rayl
4671 taur(k,ns21+j) = tauray
4676 speccomb = colamt(k,1) +
strrat(21)*colamt(k,2)
4677 specmult = 8.0 * min(oneminus, colamt(k,1) / speccomb)
4679 js = 1 + int(specmult)
4680 fs = mod(specmult, f_one)
4682 fac000 = fs1 * fac00(k)
4683 fac010 = fs1 * fac10(k)
4684 fac100 = fs * fac00(k)
4685 fac110 = fs * fac10(k)
4686 fac001 = fs1 * fac01(k)
4687 fac011 = fs1 * fac11(k)
4688 fac101 = fs * fac01(k)
4689 fac111 = fs * fac11(k)
4691 ind01 = id0(k,21) + js
4695 ind11 = id1(k,21) + js
4706 taug(k,ns21+j) = speccomb &
4707 & * ( fac000 *
absa(ind01,j) + fac100 *
absa(ind02,j) &
4708 & + fac010 *
absa(ind03,j) + fac110 *
absa(ind04,j) &
4709 & + fac001 *
absa(ind11,j) + fac101 *
absa(ind12,j) &
4710 & + fac011 *
absa(ind13,j) + fac111 *
absa(ind14,j) ) &
4711 & + colamt(k,1) * (selffac(k) * (
selfref(inds,j) &
4713 & + forfac(k) * (forref(indf,j) + forfrac(k) &
4714 & * (forref(indfp,j) - forref(indf,j))))
4718 do k = laytrop+1, nlay
4719 speccomb = colamt(k,1) +
strrat(21)*colamt(k,2)
4720 specmult = 4.0 * min(oneminus, colamt(k,1) / speccomb)
4722 js = 1 + int(specmult)
4723 fs = mod(specmult, f_one)
4725 fac000 = fs1 * fac00(k)
4726 fac010 = fs1 * fac10(k)
4727 fac100 = fs * fac00(k)
4728 fac110 = fs * fac10(k)
4729 fac001 = fs1 * fac01(k)
4730 fac011 = fs1 * fac11(k)
4731 fac101 = fs * fac01(k)
4732 fac111 = fs * fac11(k)
4734 ind01 = id0(k,21) + js
4738 ind11 = id1(k,21) + js
4747 taug(k,ns21+j) = speccomb &
4748 & * ( fac000 *
absb(ind01,j) + fac100 *
absb(ind02,j) &
4749 & + fac010 *
absb(ind03,j) + fac110 *
absb(ind04,j) &
4750 & + fac001 *
absb(ind11,j) + fac101 *
absb(ind12,j) &
4751 & + fac011 *
absb(ind13,j) + fac111 *
absb(ind14,j) ) &
4752 & + colamt(k,1) * forfac(k) * (forref(indf,j) &
4753 & + forfrac(k) * (forref(indfp,j) - forref(indf,j)))
4775 real (kind=kind_phys) :: speccomb, specmult, tauray, fs, fs1, &
4776 & fac000,fac001,fac010,fac011, fac100,fac101,fac110,fac111, &
4777 & o2adj, o2cont, o2tem
4779 integer :: ind01, ind02, ind03, ind04, ind11, ind12, ind13, ind14
4780 integer :: inds, indf, indsp, indfp, j, js, k
4790 o2tem = 4.35e-4 / (350.0*2.0)
4798 tauray = colmol(k) *
rayl
4801 taur(k,ns22+j) = tauray
4806 o2cont = o2tem * colamt(k,6)
4807 speccomb = colamt(k,1) +
strrat(22)*colamt(k,6)
4808 specmult = 8.0 * min(oneminus, colamt(k,1) / speccomb)
4810 js = 1 + int(specmult)
4811 fs = mod(specmult, f_one)
4813 fac000 = fs1 * fac00(k)
4814 fac010 = fs1 * fac10(k)
4815 fac100 = fs * fac00(k)
4816 fac110 = fs * fac10(k)
4817 fac001 = fs1 * fac01(k)
4818 fac011 = fs1 * fac11(k)
4819 fac101 = fs * fac01(k)
4820 fac111 = fs * fac11(k)
4822 ind01 = id0(k,22) + js
4826 ind11 = id1(k,22) + js
4837 taug(k,ns22+j) = speccomb &
4838 & * ( fac000 *
absa(ind01,j) + fac100 *
absa(ind02,j) &
4839 & + fac010 *
absa(ind03,j) + fac110 *
absa(ind04,j) &
4840 & + fac001 *
absa(ind11,j) + fac101 *
absa(ind12,j) &
4841 & + fac011 *
absa(ind13,j) + fac111 *
absa(ind14,j) ) &
4842 & + colamt(k,1) * (selffac(k) * (
selfref(inds,j) &
4844 & + forfac(k) * (forref(indf,j) + forfrac(k) &
4845 & * (forref(indfp,j) - forref(indf,j)))) + o2cont
4849 do k = laytrop+1, nlay
4850 o2cont = o2tem * colamt(k,6)
4852 ind01 = id0(k,22) + 1
4854 ind11 = id1(k,22) + 1
4858 taug(k,ns22+j) = colamt(k,6) * o2adj &
4859 & * ( fac00(k)*
absb(ind01,j) + fac10(k)*
absb(ind02,j) &
4860 & + fac01(k)*
absb(ind11,j) + fac11(k)*
absb(ind12,j) ) &
4884 integer :: ind01, ind02, ind11, ind12
4885 integer :: inds, indf, indsp, indfp, j, k
4897 taur(k,ns23+j) = colmol(k) *
rayl(j)
4902 ind01 = id0(k,23) + 1
4904 ind11 = id1(k,23) + 1
4913 taug(k,ns23+j) = colamt(k,1) * (
givfac &
4914 & * ( fac00(k)*
absa(ind01,j) + fac10(k)*
absa(ind02,j) &
4915 & + fac01(k)*
absa(ind11,j) + fac11(k)*
absa(ind12,j) ) &
4916 & + selffac(k) * (
selfref(inds,j) + selffrac(k) &
4918 & + forfac(k) * (forref(indf,j) + forfrac(k) &
4919 & * (forref(indfp,j) - forref(indf,j))))
4923 do k = laytrop+1, nlay
4925 taug(k,ns23+j) = f_zero
4947 real (kind=kind_phys) :: speccomb, specmult, fs, fs1, &
4948 & fac000,fac001,fac010,fac011, fac100,fac101,fac110,fac111
4950 integer :: ind01, ind02, ind03, ind04, ind11, ind12, ind13, ind14
4951 integer :: inds, indf, indsp, indfp, j, js, k
4962 speccomb = colamt(k,1) +
strrat(24)*colamt(k,6)
4963 specmult = 8.0 * min(oneminus, colamt(k,1) / speccomb)
4965 js = 1 + int(specmult)
4966 fs = mod(specmult, f_one)
4968 fac000 = fs1 * fac00(k)
4969 fac010 = fs1 * fac10(k)
4970 fac100 = fs * fac00(k)
4971 fac110 = fs * fac10(k)
4972 fac001 = fs1 * fac01(k)
4973 fac011 = fs1 * fac11(k)
4974 fac101 = fs * fac01(k)
4975 fac111 = fs * fac11(k)
4977 ind01 = id0(k,24) + js
4981 ind11 = id1(k,24) + js
4992 taug(k,ns24+j) = speccomb &
4993 & * ( fac000 *
absa(ind01,j) + fac100 *
absa(ind02,j) &
4994 & + fac010 *
absa(ind03,j) + fac110 *
absa(ind04,j) &
4995 & + fac001 *
absa(ind11,j) + fac101 *
absa(ind12,j) &
4996 & + fac011 *
absa(ind13,j) + fac111 *
absa(ind14,j) ) &
4997 & + colamt(k,3) *
abso3a(j) + colamt(k,1) &
4998 & * (selffac(k) * (
selfref(inds,j) + selffrac(k) &
5000 & + forfac(k) * (forref(indf,j) + forfrac(k) &
5001 & * (forref(indfp,j) - forref(indf,j))))
5003 taur(k,ns24+j) = colmol(k) &
5008 do k = laytrop+1, nlay
5009 ind01 = id0(k,24) + 1
5011 ind11 = id1(k,24) + 1
5015 taug(k,ns24+j) = colamt(k,6) &
5016 & * ( fac00(k)*
absb(ind01,j) + fac10(k)*
absb(ind02,j) &
5017 & + fac01(k)*
absb(ind11,j) + fac11(k)*
absb(ind12,j) ) &
5018 & + colamt(k,3) *
abso3b(j)
5020 taur(k,ns24+j) = colmol(k) * raylb(j)
5043 integer :: ind01, ind02, ind11, ind12
5056 taur(k,ns25+j) = colmol(k) *
rayl(j)
5061 ind01 = id0(k,25) + 1
5063 ind11 = id1(k,25) + 1
5067 taug(k,ns25+j) = colamt(k,1) &
5068 & * ( fac00(k)*
absa(ind01,j) + fac10(k)*
absa(ind02,j) &
5069 & + fac01(k)*
absa(ind11,j) + fac11(k)*
absa(ind12,j) ) &
5070 & + colamt(k,3) *
abso3a(j)
5074 do k = laytrop+1, nlay
5076 taug(k,ns25+j) = colamt(k,3) *
abso3b(j)
5111 taug(k,ns26+j) = f_zero
5112 taur(k,ns26+j) = colmol(k) *
rayl(j)
5135 integer :: ind01, ind02, ind11, ind12
5148 taur(k,ns27+j) = colmol(k) *
rayl(j)
5153 ind01 = id0(k,27) + 1
5155 ind11 = id1(k,27) + 1
5159 taug(k,ns27+j) = colamt(k,3) &
5160 & * ( fac00(k)*
absa(ind01,j) + fac10(k)*
absa(ind02,j) &
5161 & + fac01(k)*
absa(ind11,j) + fac11(k)*
absa(ind12,j) )
5165 do k = laytrop+1, nlay
5166 ind01 = id0(k,27) + 1
5168 ind11 = id1(k,27) + 1
5172 taug(k,ns27+j) = colamt(k,3) &
5173 & * ( fac00(k)*
absb(ind01,j) + fac10(k)*
absb(ind02,j) &
5174 & + fac01(k)*
absb(ind11,j) + fac11(k)*
absb(ind12,j) )
5197 real (kind=kind_phys) :: speccomb, specmult, tauray, fs, fs1, &
5198 & fac000,fac001,fac010,fac011, fac100,fac101,fac110,fac111
5200 integer :: ind01, ind02, ind03, ind04, ind11, ind12, ind13, ind14
5212 tauray = colmol(k) *
rayl
5215 taur(k,ns28+j) = tauray
5220 speccomb = colamt(k,3) +
strrat(28)*colamt(k,6)
5221 specmult = 8.0 * min(oneminus, colamt(k,3) / speccomb)
5223 js = 1 + int(specmult)
5224 fs = mod(specmult, f_one)
5226 fac000 = fs1 * fac00(k)
5227 fac010 = fs1 * fac10(k)
5228 fac100 = fs * fac00(k)
5229 fac110 = fs * fac10(k)
5230 fac001 = fs1 * fac01(k)
5231 fac011 = fs1 * fac11(k)
5232 fac101 = fs * fac01(k)
5233 fac111 = fs * fac11(k)
5235 ind01 = id0(k,28) + js
5239 ind11 = id1(k,28) + js
5245 taug(k,ns28+j) = speccomb &
5246 & * ( fac000 *
absa(ind01,j) + fac100 *
absa(ind02,j) &
5247 & + fac010 *
absa(ind03,j) + fac110 *
absa(ind04,j) &
5248 & + fac001 *
absa(ind11,j) + fac101 *
absa(ind12,j) &
5249 & + fac011 *
absa(ind13,j) + fac111 *
absa(ind14,j) )
5253 do k = laytrop+1, nlay
5254 speccomb = colamt(k,3) +
strrat(28)*colamt(k,6)
5255 specmult = 4.0 * min(oneminus, colamt(k,3) / speccomb)
5257 js = 1 + int(specmult)
5258 fs = mod(specmult, f_one)
5260 fac000 = fs1 * fac00(k)
5261 fac010 = fs1 * fac10(k)
5262 fac100 = fs * fac00(k)
5263 fac110 = fs * fac10(k)
5264 fac001 = fs1 * fac01(k)
5265 fac011 = fs1 * fac11(k)
5266 fac101 = fs * fac01(k)
5267 fac111 = fs * fac11(k)
5269 ind01 = id0(k,28) + js
5273 ind11 = id1(k,28) + js
5279 taug(k,ns28+j) = speccomb &
5280 & * ( fac000 *
absb(ind01,j) + fac100 *
absb(ind02,j) &
5281 & + fac010 *
absb(ind03,j) + fac110 *
absb(ind04,j) &
5282 & + fac001 *
absb(ind11,j) + fac101 *
absb(ind12,j) &
5283 & + fac011 *
absb(ind13,j) + fac111 *
absb(ind14,j) )
5306 real (kind=kind_phys) :: tauray
5308 integer :: ind01, ind02, ind11, ind12
5309 integer :: inds, indf, indsp, indfp, j, k
5320 tauray = colmol(k) *
rayl
5323 taur(k,ns29+j) = tauray
5328 ind01 = id0(k,29) + 1
5330 ind11 = id1(k,29) + 1
5339 taug(k,ns29+j) = colamt(k,1) &
5340 & * ( (fac00(k)*
absa(ind01,j) + fac10(k)*
absa(ind02,j) &
5341 & + fac01(k)*
absa(ind11,j) + fac11(k)*
absa(ind12,j) ) &
5342 & + selffac(k) * (
selfref(inds,j) + selffrac(k) &
5344 & + forfac(k) * (forref(indf,j) + forfrac(k) &
5345 & * (forref(indfp,j) - forref(indf,j)))) &
5346 & + colamt(k,2) *
absco2(j)
5350 do k = laytrop+1, nlay
5351 ind01 = id0(k,29) + 1
5353 ind11 = id1(k,29) + 1
5357 taug(k,ns29+j) = colamt(k,2) &
5358 & * ( fac00(k)*
absb(ind01,j) + fac10(k)*
absb(ind02,j) &
5359 & + fac01(k)*
absb(ind11,j) + fac11(k)*
absb(ind12,j) ) &
5360 & + colamt(k,1) *
absh2o(j)
5376 end module module_radsw_main
real(kind=kind_phys), dimension(msf22, ng22), public selfref
the array selfref contains the coefficient of the water vapor self-continuum (including the energy te...
integer, save iovrsw
cloud overlapping control flag for SW =0:use random cloud overlapping method =1:use maximum-rando...
real(kind=kind_phys), parameter, public rayl
rayleigh extinction coefficient at
This module sets up absorption coeffients for band 19: 4650-5150 cm-1 (low - h2o,co2; high - co2) ...
integer, save isubcsw
sub-column cloud approx flag in SW radiation =0:no McICA approximation in SW radiation =1:use McI...
subroutine taumol(colamt, colmol, fac00, fac01, fac10, fac11, jp, jt, jt1, laytrop, forfac, forfrac, indfor, selffac, selffrac, indself, nlay, sfluxzen, taug, taur )
This subroutine calculates optical depths for gaseous absorption and rayleigh scattering subroutine...
real(kind=kind_phys), parameter con_amw
molecular wght of water vapor ( )
real(kind=kind_phys), dimension(msf24, ng24), public selfref
the array selfref contains the coefficient of the water vapor self-continuum (including the energy te...
real(kind=kind_phys), parameter, public rayl
rayleigh extinction coefficient at
real(kind=kind_phys), dimension(5), public ebari
asymmetry coefficients
real(kind=kind_phys), dimension(msf18, ng18), public selfref
the array selfref contains the coefficient of the water vapor self-continuum (including the energy te...
This module sets up absorption coeffients for band 24: 12850-16000 cm-1 (low - h2o, o2; high - o2)
real(kind=kind_phys), dimension(msa19, ng19), public absa
the array absa(585,NG19) (ka(9,5,13,NG19)) contains absorption coefs at the 16 chosen g-values for a ...
subroutine taumol17
The subroutine computes the optical depth in band 17: 3250-4000 cm-1 (low - h2o,co2; high - h2o...
real(kind=kind_phys) heatfac
the factor for heating rates (in k/day, or k/sec set by subroutine 'rswinit')
subroutine spcvrtm(ssolar, cosz, sntz, albbm, albdf, sfluxzen, cldfmc, cf1, cf0, taug, taur, tauae, ssaae, asyae, taucw, ssacw, asycw, nlay, nlp1, fxupc, fxdnc, fxup0, fxdn0, ftoauc, ftoau0, ftoadc, fsfcuc, fsfcu0, fsfcdc, fsfcd0, sfbmc, sfdfc, sfbm0, sfdf0, suvbfc, suvbf0 )
This subroutine computes the shortwave radiative fluxes using two-stream method of h...
real(kind=kind_phys), dimension(msa23, ng23), public absa
the array absa(65,NG23) (ka(5,13,NG23)) contains absorption coefs at the 16 chosen g-values for a ran...
integer, dimension(nblow:nbhgh), public ix2
indexes for 2nd entries of the two key species for each of the spectral bands
real(kind=kind_phys), parameter con_g
gravity ( )
real(kind=kind_phys), dimension(0:ntbmx) exp_tbl
those data will be set up only once by "rswinit"
integer, dimension(nblow:nbhgh), public ix1
indexes for 1st entries of the two key species for each of the spectral bands
derived type for special components of surface SW fluxes
real(kind=kind_phys), dimension(ng24), public abso3a
o3
real(kind=kind_phys), dimension(msb28, ng28), public absb
the array absb(1175,6) (kb(5,5,13:59,6)) contains absorption coefs at the 16 chosen g-values for a ra...
real(kind=kind_phys), dimension(nblow:nbhgh), public c0r
asymmetry coefficients
This module sets up absorption coeffients for band 27: 29000-38000 cm-1 (low - o3; high - o3) ...
real(kind=kind_phys), dimension(43, nblow:nbhgh), public asyice2
asymmetry coefficients
integer, parameter iswrgas
SW minor gases effect control flag (CH4 and O2): =0:no; =1:yes. =0: minor gases' effects are not in...
real(kind=kind_phys), dimension(43, nblow:nbhgh), public extice2
extinction coefficients
real(kind=kind_phys), dimension(msf16, ng16), public selfref
the array selfref contains the coefficient of the water vapor self-continuum (including the energy te...
integer, parameter nbhgh
band range upper index
This module sets up absorption coeffients for band 20: 5150-6150 cm-1 (low - h2o; high - h2o) ...
integer, parameter ntbmx
index upper limit of optical depth and transmittance tables
real(kind=kind_phys), dimension(msb24, ng24), public absb
the array absb(235,8) (kb(5,13:59,8)) contains absorption coefs at the 16 chosen g-values for a range...
real(kind=kind_phys), public a0s
optical depth coefficients
real(kind=kind_phys), dimension(ngmax, mfs01, mfb01), target, public sfluxref01
spectral solar fluxes, j=1,2,...,7 for SW band number of 16,20,23,25,26,27,29
integer, parameter nuvb
uv-b band index
real(kind=kind_phys), dimension(ng26), public rayl
rayleigh extinction coefficient at all v
integer, parameter ngptsw
total number of g-point in all bands
real(kind=kind_phys), dimension(msf23, ng23), public selfref
the array selfref contains the coefficient of the water vapor self-continuum (including the energy te...
real(kind=kind_phys), parameter, public rayl
rayleigh extinction coefficient at
real(kind=kind_phys), dimension(58, nblow:nbhgh), public extliq1
extinction coefficients
integer, parameter iswmode
SW control flag for scattering process approximation =1:two-stream delta-eddington (Joseph et al...
This module contains cloud radiative property coefficients.
real(kind=kind_phys), dimension(nblow:nbhgh), public c0s
asymmetry coefficients
real(kind=kind_phys), dimension(msb22, ng22), public absb
the array absb(235,2) (kb(5,13:59,2)) contains absorption coefs at the 16 chosen g-values for a range...
real(kind=kind_phys), dimension(ng24, mfx24), public rayla
rayleigh extinction coefficient at all v
This module sets up absorption coeffients for band 23: 8050-12850 cm-1 (low - h2o; high - nothing) ...
real(kind=kind_phys), dimension(msf19, ng19), public selfref
the array selfref contains the coefficient of the water vapor self-continuum (including the energy te...
real(kind=kind_phys), dimension(msa29, ng29), public absa
the array absa(65,NG29) (ka(5,13,NG29)) contains absorption coefs at the 16 chosen g-values for a ran...
real(kind=kind_phys), dimension(msa22, ng22), public absa
the array absa(585,NG22) (ka(9,5,13,NG22)) contains absorption coefs at the 16 chosen g-values for a ...
subroutine, public swrad(plyr, plvl, tlyr, tlvl, qlyr, olyr, gasvmr, clouds, icseed, aerosols, sfcalb, cosz, solcon, NDAY, idxday, npts, nlay, nlp1, lprnt, hswc, topflx, sfcflx, HSW0, HSWB, FLXPRF, FDNCMP )
This subroutine is the main SW radiation routine.
real(kind=kind_phys), dimension(msa27, ng27), public absa
the array absa(65,NG27) (ka(5,13,NG27)) contains absorption coefs at the 16 chosen g-values for a ran...
subroutine vrtqdr(zrefb, zrefd, ztrab, ztrad, zldbt, ztdbt, NLAY, NLP1, zfu, zfd )
This subroutine is called by spcvrtc() and spcvrtm(), and computes the upward and downward radiation ...
real(kind=kind_phys), dimension(ngmax, mfs02, mfb02), target, public sfluxref02
spectral solar fluxes, j=1,2 for SW band number of 17 and 28
real(kind=kind_phys), dimension(msb27, ng27), public absb
the array absb(235,8) (kb(5,13:59,8)) contains absorption coefs at the 16 chosen g-values for a range...
real(kind=kind_phys), dimension(msf20, ng20), public selfref
the array selfref contains the coefficient of the water vapor self-continuum (including the energy te...
real(kind=kind_phys), dimension(msa16, ng16), public absa
the array absa(585,NG16) (ka(9,5,13,NG16)) contains absorption coefs at the 16 chosen g-values for a ...
real(kind=kind_phys), dimension(msa24, ng24), public absa
the array absa(585,NG24) (ka(9,5,13,NG24)) contains absorption coefs at the 16 chosen g-values for a ...
This module sets up absorption coeffients for band 18: 4000-4650 cm-1 (low - h2o,ch4; high - ch4) ...
subroutine setcoef(pavel, tavel, h2ovmr, nlay, nlp1, laytrop, jp, jt, jt1, fac00, fac01, fac10, fac11, selffac, selffrac, indself, forfac, forfrac, indfor )
This subroutine computes various coefficients needed in radiative transfer calculation.
integer, save icldflg
cloud optical property scheme control flag =0:use diagnostic cloud scheme for cloud cover and mean ...
subroutine taumol22
The subroutine computes the optical depth in band 22: 7700-8050 cm-1 (low - h2o,o2; high - o2) ...
real(kind=kind_phys), dimension(nblow:nbhgh), public b0s
single scattering albedo coefficients
derived type for SW fluxes' column profiles (at layer interfaces)
integer, dimension(nblow:nbhgh) idxebc
band index for cld prop
real(kind=kind_phys), dimension(msb29, ng29), public absb
the array absb(235,12) (kb(5,13:59,12)) contains absorption coefs at the 16 chosen g-values for a ran...
real(kind=kind_phys), dimension(ng20), public absch4
ch4
real(kind=kind_phys), dimension(43, nblow:nbhgh), public ssaice2
single scattering albedo coefficients
real(kind=kind_phys), parameter con_cp
spec heat air at p ( )
subroutine taumol23
The subroutine computes the optical depth in band 23: 8050-12850 cm-1 (low - h2o; high - nothing) ...
real(kind=kind_phys), dimension(59) preflog
logarithm,ln(p), of a 59-level standard pressure profile
subroutine taumol26
The subroutine computes the optical depth in band 26: 22650-29000 cm-1 (low - nothing; high - nothing...
integer, save iswcice
SW optical property for ice clouds (only iswcliq>0) =1:optical property scheme based on Ebert and C...
subroutine spcvrtc(ssolar, cosz, sntz, albbm, albdf, sfluxzen, cldfrc, cf1, cf0, taug, taur, tauae, ssaae, asyae, taucw, ssacw, asycw, nlay, nlp1, fxupc, fxdnc, fxup0, fxdn0, ftoauc, ftoau0, ftoadc, fsfcuc, fsfcu0, fsfcdc, fsfcd0, sfbmc, sfdfc, sfbm0, sfdf0, suvbfc, suvbf0 )
This subroutine computes the shortwave radiative fluxes using two-stream method.
real(kind=kind_phys), dimension(ng25), public abso3b
o3
This module contains the reference pressures (in logarithm form) at 59 vertical levels (TOA is omitte...
integer, dimension(nblow:nbhgh) idxsfc
band index for sfc flux
subroutine taumol16
The subroutine computes the optical depth in band 16: 2600-3250 cm-1 (low - h2o,ch4; high - ch4) ...
subroutine, public rswinit(me)
This subroutine initializes non-varying module variables, conversion factors, and look-up tables...
This module is for specifying the band structures and program parameters used by the RRTMG-SW scheme...
real(kind=kind_phys), dimension(msb21, ng21), public absb
the array absb(1175,10) (kb(5,5,13:59,10)) contains absorption coefs at the 16 chosen g-values for a ...
integer, parameter nblow
band range lower index
subroutine taumol19
The subroutine computes the optical depth in band 19: 4650-5150 cm-1 (low - h2o,co2; high - co2) ...
This module sets up absorption coeffients for band 26: 22650-29000 cm-1 (low - nothing; high - nothin...
subroutine taumol28
The subroutine computes the optical depth in band 28: 38000-50000 cm-1 (low - o3,o2; high - o3...
subroutine taumol18
The subroutine computes the optical depth in band 18: 4000-4650 cm-1 (low - h2o,ch4; high - ch4) ...
real(kind=kind_phys), dimension(nblow:nbhgh), public strrat
coefficients for computing binary absorbing species
integer, parameter iswrate
SW heating rate unit control flag: =1:k/day; =2:k/second.
real(kind=kind_phys), dimension(46, nblow:nbhgh), public extice3
extinction coefficients
real(kind=kind_phys), dimension(5), public fbari
asymmetry coefficients
real(kind=kind_phys), dimension(5), public dbari
single scattering albedo coefficients
This module sets up absorption coeffients for band 29: 820-2600 cm-1 (low - h2o; high - co2) ...
integer, save iswcliq
SW optical property for liquid clouds =0:input cld opt depth, ignoring iswcice setting =1:cloud o...
This module sets up absorption coeffients for band 17: 3250-4000 cm-1 (low - h2o,co2; high - h2o...
subroutine taumol29
The subroutine computes the optical depth in band 29: 820-2600 cm-1 (low - h2o; high - co2) ...
real(kind=kind_phys), dimension(msa25, ng25), public absa
the array absa(65,NG25) (ka(5,13,NG25)) contains absorption coefs at the 16 chosen g-values for a ran...
real(kind=kind_phys), dimension(58, nblow:nbhgh), public asyliq1
asymmetry coefficients
real(kind=kind_phys), dimension(46, nblow:nbhgh), public asyice3
asymmetry coefficients
subroutine taumol27
The subroutine computes the optical depth in band 27: 29000-38000 cm-1 (low - o3; high - o3) ...
This module sets up absorption coeffients for band 22: 7700-8050 cm-1 (low - h2o, o2; high - o2) ...
real(kind=kind_phys), dimension(msf29, ng29), public selfref
the array selfref contains the coefficient of the water vapor self-continuum (including the energy te...
real(kind=kind_phys), parameter s0
internal solar constant
real(kind=kind_phys), dimension(ngmax, mfs03, mfb03), target, public sfluxref03
spectral solar fluxes, j=1,2,...,5 for SW band number of 18,19,21,22,24
integer, parameter ipsdsw0
initial permutation seed used for sub-column cloud scheme
This module contains various indexes and coefficients for SW spectral bands, as well as the spectral ...
real(kind=kind_phys), dimension(msa17, ng17), public absa
the array absa(585,NG17) (ka((9,5,13,NG17)) contains absorption coefs at the 16 chosen g-values for a...
real(kind=kind_phys), dimension(ng23), public rayl
rayleigh extinction coefficient at all v
real(kind=kind_phys), parameter con_avgd
avogadro constant ( )
real(kind=kind_phys), dimension(ng25), public abso3a
o3
subroutine taumol20
The subroutine computes the optical depth in band 20: 5150-6150 cm-1 (low - h2o; high - h2o) ...
subroutine taumol21
The subroutine computes the optical depth in band 21: 6150-7700 cm-1 (low - h2o,co2; high - h2o...
real(kind=kind_phys), dimension(msa21, ng21), public absa
the array absa(585,NG21) (ka((9,5,13,NG21)) contains absorption coefs at the 16 chosen g-values for a...
This module sets up absorption coeffients for band 25: 16000-22650 cm-1 (low - h2o; high - nothing) ...
real(kind=kind_phys), dimension(msb20, ng20), public absb
the array absb(235,10) (kb(5,13:59,10)) contains absorption coefs at the 16 chosen g-values for a ran...
real(kind=kind_phys), dimension(58, nblow:nbhgh), public ssaliq1
single scattering albedo coefficients
real(kind=kind_phys), dimension(msa18, ng18), public absa
the array absa(585,NG18) (ka(9,5,13,NG18)) contains absorption coefs at the 16 chosen g-values for a ...
real(kind=kind_phys), dimension(msb16, ng16), public absb
the array absb(235,6) (kb(5,13:59,6)) contains absorption coefs at the 16 chosen g-values for a range...
real(kind=kind_phys), parameter bpade
pade approx constant
real(kind=kind_phys), parameter, public rayl
rayleigh extinction coefficient at
integer, dimension(nblow:nbhgh) ngs
array contains values of NS16-NS29
integer, dimension(nblow:nbhgh), public ibx
band index (3rd index in array sfluxref described below)
real(kind=kind_phys), dimension(msb17, ng17), public absb
the array absb(1175,12) (kb(5,5,13:59,12)) contains absorption coefs at the 16 chosen g-values for a ...
real(kind=kind_phys), parameter, public rayl
rayleigh extinction coefficient
real(kind=kind_phys), parameter con_amo3
molecular wght of o3 ( )
subroutine taumol25
The subroutine computes the optical depth in band 25: 16000-22650 cm-1 (low - h2o; high - nothing) ...
real(kind=kind_phys), dimension(msa20, ng20), public absa
the array absa(65,NG20) (ka(5,13,NG20)) contains absorption coefs at the 16 chosen g-values for a ran...
real(kind=kind_phys), dimension(46, nblow:nbhgh), public ssaice3
single scattering albedo coefficients
real(kind=kind_phys), public a0r
optical depth coefficients
This module sets up absorption coeffients for band 21: 6150-7700 cm-1 (low - h2o,co2; high - h2o...
real(kind=kind_phys), dimension(msb18, ng18), public absb
the array absb(235,8) (kb(5,13:59,8)) contains absorption coefs at the 16 chosen g-values for a range...
real(kind=kind_phys), dimension(5), public cbari
single scattering albedo coefficients
real(kind=kind_phys), parameter, public rayl
rayleigh extinction coefficient at v =
real(kind=kind_phys), parameter, public givfac
average giver et al. correction factor for this band.
derived type for SW fluxes at TOA
real(kind=kind_phys), dimension(msf21, ng21), public selfref
the array selfref contains the coefficient of the water vapor self-continuum (including the energy te...
subroutine cldprop(cfrac, cliqp, reliq, cicep, reice, cdat1, cdat2, cdat3, cdat4, cf1, nlay, ipseed, taucw, ssacw, asycw, cldfrc, cldfmc )
This subroutine computes the cloud optical properties for each cloudy layer and g-point interval...
real(kind=kind_phys), dimension(ng27), public rayl
rayleigh extinction coefficient
real(kind=kind_phys), dimension(msf17, ng17), public selfref
the array selfref contains the coefficient of the water vapor self-continuum (including the energy te...
real(kind=kind_phys), parameter, public rayl
rayleigh extinction coefficient at
integer, dimension(ngptsw) ngb
reverse checking of band index for each g-point
integer, save ivflip
vertical profile indexing flag
real(kind=kind_phys), dimension(ng29), public absh2o
h2o
integer, parameter maxgas
maximum number of absorbing gases
real(kind=kind_phys), dimension(msb19, ng19), public absb
the array absb(235,8) (kb(5,13:59,8)) contains absorption coefs at the 16 chosen g-values for a range...
integer, dimension(nblow:nbhgh), public layreffr
reference pressure level for each of the spectral bands
real(kind=kind_phys), dimension(nblow:nbhgh), public b0r
single scattering albedo coefficients
This module sets up absorption coeffients for band 28: 38000-50000 cm-1 (low - o3,o2; high - o3,o2)
real(kind=kind_phys), dimension(msa28, ng28), public absa
the array absa(585,NG28) (ka((9,5,13,NG28)) contains absorption coefs at the 16 chosen g-values for a...
real(kind=kind_phys), dimension(5), public abari
extinction coefficients
This module sets up absorption coefficients for band 16: 2600-3250 cm-1 (low - h2o, ch4; high - ch4)
derived type for SW fluxes at surface
real(kind=kind_phys), dimension(ng24), public abso3b
o3
real(kind=kind_phys), dimension(59) tref
MLS standard atmosphere temperature at the standard pressure levels.
subroutine mcica_subcol(cldf, nlay, ipseed, lcloudy )
This subroutine computes the sub-colum cloud profile flag array.
real(kind=kind_phys), dimension(5), public bbari
extinction coefficients
real(kind=kind_phys), dimension(nblow:nbhgh), public specwt
weighting parameters for major absorbers in each band
real(kind=kind_phys), parameter, public rayl
rayleigh extinction coefficient at v = 3625
subroutine taumol24
The subroutine computes the optical depth in band 24: 12850-16000 cm-1 (low - h2o,o2; high - o2)
real(kind=kind_phys), dimension(ng29), public absco2
co2
real(kind=kind_phys), parameter con_amd
molecular wght of dry air ( )
real(kind=kind_phys), dimension(ng25), public rayl
rayleigh extinction coefficient
real(kind=kind_phys), parameter, public rayl
rayleigh extinction coefficient at