10 subroutine sorad ( m , & !Number of soundings
11 np , & !Number of model levels
12 nb , & !Number of bands
13 cosz_dev , & !Cosine of solar zenith angle
14 pl_dev , & !Pressure (Pa)
37 wk_uv, zk_uv, ry_uv, &
40 aig_uv, awg_uv, arg_uv, &
41 aib_uv, awb_uv, arb_uv, &
42 aib_nir, awb_nir, arb_nir, &
43 aia_nir, awa_nir, ara_nir, &
44 aig_nir, awg_nir, arg_nir, &
52 integer,
parameter :: nu = 43
53 integer,
parameter :: nw = 37
54 integer,
parameter :: nx = 62
55 integer,
parameter :: ny = 101
56 integer,
parameter :: nband_uv = 5
57 integer,
parameter :: nk_ir = 10
58 integer,
parameter :: nband_ir = 3
60 integer,
parameter :: nband = nband_uv + nband_ir
62 real(8),
parameter :: dsm = 0.602
69 integer m,np,ict,icb,nb
70 real(8) cosz_dev(m),pl_dev(m,np+1),ta_dev(m,np),wa_dev(m,np),oa_dev(m,np),co2
71 real(8) cwc_dev(m,np,4),fcld_dev(m,np),reff_dev(m,np,4), hk_uv(5),hk_ir(3,10)
72 real(8) rsuvbm_dev(m),rsuvdf_dev(m),rsirbm_dev(m),rsirdf_dev(m)
74 real(8) taua_dev(m,np,nb)
75 real(8) ssaa_dev(m,np,nb)
76 real(8) asya_dev(m,np,nb)
81 real(8),
intent(in) :: wk_uv(5), zk_uv(5), ry_uv(5)
82 real(8),
intent(in) :: xk_ir(10), ry_ir(3)
83 real(8),
intent(in) :: cah(43,37), coa(62,101)
85 real(8),
intent(in) :: aig_uv(3), awg_uv(3), arg_uv(3)
86 real(8),
intent(in) :: aib_uv, awb_uv(2), arb_uv(2)
87 real(8),
intent(in) :: aib_nir, awb_nir(3,2), arb_nir(3,2)
88 real(8),
intent(in) :: aia_nir(3,3), awa_nir(3,3), ara_nir(3,3)
89 real(8),
intent(in) :: aig_nir(3,3), awg_nir(3,3), arg_nir(3,3)
90 real(8),
intent(in) :: caib(11,9,11), caif(9,11)
92 real(8),
intent(in) :: cons_grav
96 real(8) flx_dev(m,np+1),flc_dev(m,np+1)
97 real(8) flxu_dev(m,np+1),flcu_dev(m,np+1)
98 real(8) fdiruv_dev (m),fdifuv_dev (m)
99 real(8) fdirpar_dev(m),fdifpar_dev(m)
100 real(8) fdirir_dev (m),fdifir_dev (m)
101 real(8) flx_sfc_band_dev(m,nband)
105 integer :: i,j,k,l,in,ntop
107 real(8) :: dp(np),wh(np),oh(np)
109 real(8) :: swh(np+1),so2(np+1),df(0:np+1)
110 real(8) :: scal0, wvtoa, o3toa, pa
111 real(8) :: snt,cnt,x,xx4,xtoa
116 real(8) :: w1,dw,
u1,du
119 real(8) :: tauclb(np),tauclf(np),asycl(np)
120 real(8) :: taubeam(np,4),taudiff(np,4)
121 real(8) :: fcld_col(np)
122 real(8) :: cwc_col(np,4)
123 real(8) :: reff_col(np,4)
124 real(8) :: taurs,tauoz,tauwv
125 real(8) :: tausto,ssatau,asysto
126 real(8) :: tautob,ssatob,asytob
127 real(8) :: tautof,ssatof,asytof
128 real(8) :: rr(0:np+1,2),tt(0:np+1,2),td(0:np+1,2)
129 real(8) :: rs(0:np+1,2),ts(0:np+1,2)
130 real(8) :: fall(np+1),fclr(np+1),fsdir,fsdif
131 real(8) :: fupa(np+1),fupc(np+1)
132 real(8) :: cc1,cc2,cc3
133 real(8) :: rrt,ttt,tdt,rst,tst
141 real(8) :: ulog,wlog,dc,dd,x0,x1,x2,y0,y1,y2,du2,dw2
150 real(8) :: rra(0:np+1,2,2),tta(0:np,2,2)
151 real(8) :: tda(0:np,2,2)
152 real(8) :: rsa(0:np,2,2),rxa(0:np+1,2,2)
156 real(8) :: fdndir,fdndif,fupdif
167 integer :: ii, jj, irhp1, an
184 snt = 1.0/cosz_dev(i)
185 xtoa =
max(pl_dev(i,1),1.e-3)
186 scal0 = xtoa*(0.5*xtoa/300.)**.8
187 o3toa = 1.02*oa_dev(i,1)*xtoa*466.7 + 1.0e-8
188 wvtoa = 1.02*wa_dev(i,1)*scal0 * (1.0+0.00135*(ta_dev(i,1)-240.)) + 1.0e-9
196 dp(k) = pl_dev(i,k+1)-pl_dev(i,k)
197 dp_pa(k) = dp(k) * 100.
202 pa = 0.5*(pl_dev(i,k)+pl_dev(i,k+1))
203 scal(k) = dp(k)*(pa/300.)**.8
204 wh(k) = 1.02*wa_dev(i,k)*scal(k) * (1.+0.00135*(ta_dev(i,k)-240.)) + 1.e-9
205 swh(k+1)= swh(k)+wh(k)
211 oh(k) = 1.02*oa_dev(i,k)*dp(k)*466.7 + 1.e-8
215 fcld_col(k) = fcld_dev(i,k)
217 reff_col(k,l) = reff_dev(i,k,l)
218 cwc_col(k,l) = cwc_dev(i,k,l)
253 flx_sfc_band_dev(i,ib) = 0.
269 rr(np+1,1)=rsuvbm_dev(i)
270 rr(np+1,2)=rsuvbm_dev(i)
271 rs(np+1,1)=rsuvdf_dev(i)
272 rs(np+1,2)=rsuvdf_dev(i)
329 call getvistau1(np,cosz_dev(i),dp_pa,fcld_col,reff_col,cwc_col,ict,icb, &
330 taubeam,taudiff,asycl, &
331 aig_uv, awg_uv, arg_uv, &
332 aib_uv, awb_uv, arb_uv, &
333 aib_nir, awb_nir, arb_nir, &
334 aia_nir, awa_nir, ara_nir, &
335 aig_nir, awg_nir, arg_nir, &
349 cc1=
max(cc1,fcld_dev(i,k))
350 elseif (k.lt.icb)
then 351 cc2=
max(cc2,fcld_dev(i,k))
353 cc3=
max(cc3,fcld_dev(i,k))
361 tauclb(k)=taubeam(k,1)+taubeam(k,2)+taubeam(k,3)+taubeam(k,4)
362 tauclf(k)=taudiff(k,1)+taudiff(k,2)+taudiff(k,3)+taudiff(k,4)
374 td(0,1)=exp(-(wvtoa*wk_uv(ib)+o3toa*zk_uv(ib))/cosz_dev(i))
382 taurs=ry_uv(ib)*dp(k)
383 tauoz=zk_uv(ib)*oh(k)
384 tauwv=wk_uv(ib)*wh(k)
386 tausto=taurs+tauoz+tauwv+taua_dev(i,k,ib)+1.0e-7
387 ssatau=ssaa_dev(i,k,ib)+taurs
388 asysto=asya_dev(i,k,ib)
392 ssatob=ssatau/tautob+1.0e-8
393 ssatob=
min(ssatob,0.999999)
397 call deledd(tautob,ssatob,asytob,cosz_dev(i),rrt,ttt,tdt)
402 call deledd(tautob,ssatob,asytob,dsm,rst,tst,dum)
416 tautob=tausto+tauclb(k)
417 ssatob=(ssatau+tauclb(k))/tautob+1.0e-8
418 ssatob=
min(ssatob,0.999999)
419 asytob=(asysto+asycl(k)*tauclb(k))/(ssatob*tautob)
423 tautof=tausto+tauclf(k)
424 ssatof=(ssatau+tauclf(k))/tautof+1.0e-8
425 ssatof=
min(ssatof,0.999999)
426 asytof=(asysto+asycl(k)*tauclf(k))/(ssatof*tautof)
432 call deledd(tautob,ssatob,asytob,cosz_dev(i),rrt,ttt,tdt)
437 call deledd(tautof,ssatof,asytof,dsm,rst,tst,dum)
627 denm=ts(k,ih)/(1.-rsa(k-1,ih,1)*rs(k,ih))
628 tda(k,ih,1)=tda(k-1,ih,1)*td(k,ih)
629 tta(k,ih,1)=tda(k-1,ih,1)*tt(k,ih)+(tda(k-1,ih,1)*rsa(k-1,ih,1)&
630 *rr(k,ih)+tta(k-1,ih,1)-tda(k-1,ih,1))*denm
631 rsa(k,ih,1)=rs(k,ih)+ts(k,ih)*rsa(k-1,ih,1)*denm
632 tda(k,ih,2)=tda(k,ih,1)
633 tta(k,ih,2)=tta(k,ih,1)
634 rsa(k,ih,2)=rsa(k,ih,1)
642 denm=ts(k,im)/(1.-rsa(k-1,ih,im)*rs(k,im))
643 tda(k,ih,im)=tda(k-1,ih,im)*td(k,im)
644 tta(k,ih,im)=tda(k-1,ih,im)*tt(k,im)+(tda(k-1,ih,im)&
645 *rsa(k-1,ih,im)*rr(k,im)+tta(k-1,ih,im)-tda(k-1,ih,im))*denm
646 rsa(k,ih,im)=rs(k,im)+ts(k,im)*rsa(k-1,ih,im)*denm
665 rra(np+1,1,is)=rr(np+1,is)
666 rxa(np+1,1,is)=rs(np+1,is)
667 rra(np+1,2,is)=rr(np+1,is)
668 rxa(np+1,2,is)=rs(np+1,is)
671 denm=ts(k,is)/(1.-rs(k,is)*rxa(k+1,1,is))
672 rra(k,1,is)=rr(k,is)+(td(k,is)*rra(k+1,1,is)+(tt(k,is)-td(k,is))&
674 rxa(k,1,is)=rs(k,is)+ts(k,is)*rxa(k+1,1,is)*denm
675 rra(k,2,is)=rra(k,1,is)
676 rxa(k,2,is)=rxa(k,1,is)
683 denm=ts(k,im)/(1.-rs(k,im)*rxa(k+1,im,is))
684 rra(k,im,is)=rr(k,im)+(td(k,im)*rra(k+1,im,is)+(tt(k,im)-td(k,im))&
685 *rxa(k+1,im,is))*denm
686 rxa(k,im,is)=rs(k,im)+ts(k,im)*rxa(k+1,im,is)*denm
725 denm=ts(k,is)/(1.-rsa(k-1,ih,im)*rs(k,is))
726 tda(k,ih,im)=tda(k-1,ih,im)*td(k,is)
727 tta(k,ih,im)=tda(k-1,ih,im)*tt(k,is)+(tda(k-1,ih,im)*rr(k,is)&
728 *rsa(k-1,ih,im)+tta(k-1,ih,im)-tda(k-1,ih,im))*denm
729 rsa(k,ih,im)=rs(k,is)+ts(k,is)*rsa(k-1,ih,im)*denm
735 denm=ts(k,ih)/(1.-rs(k,ih)*rxa(k+1,im,is))
736 rra(k,im,is)=rr(k,ih)+(td(k,ih)*rra(k+1,im,is)+(tt(k,ih)-td(k,ih))&
737 *rxa(k+1,im,is))*denm
738 rxa(k,im,is)=rs(k,ih)+ts(k,ih)*rxa(k+1,im,is)*denm
749 denm=1./(1.-rsa(k-1,ih,im)*rxa(k,im,is))
750 fdndir=tda(k-1,ih,im)
751 xx4=tda(k-1,ih,im)*rra(k,im,is)
752 yy=tta(k-1,ih,im)-tda(k-1,ih,im)
753 fdndif=(xx4*rsa(k-1,ih,im)+yy)*denm
754 fupdif=(xx4+yy*rxa(k,im,is))*denm
755 flxdn=fdndir+fdndif-fupdif
760 if(ih.eq.1 .and. im.eq.1 .and. is.eq.1)
then 764 fupa(k)=fupa(k)+fupdif*ct
765 fall(k)=fall(k)+flxdn*ct
767 fsdir=fsdir+fdndir*ct
768 fsdif=fsdif+fdndif*ct
780 flx_dev(i,k)=flx_dev(i,k)+fall(k)*hk_uv(ib)
781 flc_dev(i,k)=flc_dev(i,k)+fclr(k)*hk_uv(ib)
782 flxu_dev(i,k)=flxu_dev(i,k)+fupa(k)*hk_uv(ib)
783 flcu_dev(i,k)=flcu_dev(i,k)+fupc(k)*hk_uv(ib)
787 flx_sfc_band_dev(i,ib)=flx_sfc_band_dev(i,ib)+fall(np+1)*hk_uv(ib)
793 fdiruv_dev(i)=fdiruv_dev(i)+fsdir*hk_uv(ib)
794 fdifuv_dev(i)=fdifuv_dev(i)+fsdif*hk_uv(ib)
796 fdirpar_dev(i)=fsdir*hk_uv(ib)
797 fdifpar_dev(i)=fsdif*hk_uv(ib)
807 rr(np+1,1)=rsirbm_dev(i)
808 rr(np+1,2)=rsirbm_dev(i)
809 rs(np+1,1)=rsirdf_dev(i)
810 rs(np+1,2)=rsirdf_dev(i)
872 call getnirtau1(ib,np,cosz_dev(i),dp_pa,fcld_col,reff_col,cwc_col,ict,icb, &
873 taubeam,taudiff,asycl,ssacl, &
874 aig_uv, awg_uv, arg_uv, &
875 aib_uv, awb_uv, arb_uv, &
876 aib_nir, awb_nir, arb_nir, &
877 aia_nir, awa_nir, ara_nir, &
878 aig_nir, awg_nir, arg_nir, &
891 cc1=
max(cc1,fcld_dev(i,k))
892 elseif (k.lt.icb)
then 893 cc2=
max(cc2,fcld_dev(i,k))
895 cc3=
max(cc3,fcld_dev(i,k))
903 tauclb(k)=taubeam(k,1)+taubeam(k,2)+taubeam(k,3)+taubeam(k,4)
904 tauclf(k)=taudiff(k,1)+taudiff(k,2)+taudiff(k,3)+taudiff(k,4)
914 td(0,1)=exp(-wvtoa*xk_ir(ik)/cosz_dev(i))
918 taurs=ry_ir(ib)*dp(k)
919 tauwv=xk_ir(ik)*wh(k)
924 tausto=taurs+tauwv+taua_dev(i,k,iv)+1.0e-7
925 ssatau=ssaa_dev(i,k,iv)+taurs+1.0e-8
926 asysto=asya_dev(i,k,iv)
929 ssatob=ssatau/tautob+1.0e-8
930 ssatob=
min(ssatob,0.999999)
937 call deledd(tautob,ssatob,asytob,cosz_dev(i),rrt,ttt,tdt)
942 call deledd(tautob,ssatob,asytob,dsm,rst,tst,dum)
955 tautob=tausto+tauclb(k)
956 ssatob=(ssatau+ssacl(k)*tauclb(k))/tautob+1.0e-8
957 ssatob=
min(ssatob,0.999999)
958 asytob=(asysto+asycl(k)*ssacl(k)*tauclb(k))/(ssatob*tautob)
962 tautof=tausto+tauclf(k)
963 ssatof=(ssatau+ssacl(k)*tauclf(k))/tautof+1.0e-8
964 ssatof=
min(ssatof,0.999999)
965 asytof=(asysto+asycl(k)*ssacl(k)*tauclf(k))/(ssatof*tautof)
969 call deledd(tautob,ssatob,asytob,cosz_dev(i),rrt,ttt,tdt)
974 call deledd(tautof,ssatof,asytof,dsm,rst,tst,dum)
1158 tda(0,ih,1)=td(0,ih)
1159 tta(0,ih,1)=tt(0,ih)
1160 rsa(0,ih,1)=rs(0,ih)
1161 tda(0,ih,2)=td(0,ih)
1162 tta(0,ih,2)=tt(0,ih)
1163 rsa(0,ih,2)=rs(0,ih)
1166 denm=ts(k,ih)/(1.-rsa(k-1,ih,1)*rs(k,ih))
1167 tda(k,ih,1)=tda(k-1,ih,1)*td(k,ih)
1168 tta(k,ih,1)=tda(k-1,ih,1)*tt(k,ih)+(tda(k-1,ih,1)*rsa(k-1,ih,1)&
1169 *rr(k,ih)+tta(k-1,ih,1)-tda(k-1,ih,1))*denm
1170 rsa(k,ih,1)=rs(k,ih)+ts(k,ih)*rsa(k-1,ih,1)*denm
1171 tda(k,ih,2)=tda(k,ih,1)
1172 tta(k,ih,2)=tta(k,ih,1)
1173 rsa(k,ih,2)=rsa(k,ih,1)
1181 denm=ts(k,im)/(1.-rsa(k-1,ih,im)*rs(k,im))
1182 tda(k,ih,im)=tda(k-1,ih,im)*td(k,im)
1183 tta(k,ih,im)=tda(k-1,ih,im)*tt(k,im)+(tda(k-1,ih,im)&
1184 *rsa(k-1,ih,im)*rr(k,im)+tta(k-1,ih,im)-tda(k-1,ih,im))*denm
1185 rsa(k,ih,im)=rs(k,im)+ts(k,im)*rsa(k-1,ih,im)*denm
1204 rra(np+1,1,is)=rr(np+1,is)
1205 rxa(np+1,1,is)=rs(np+1,is)
1206 rra(np+1,2,is)=rr(np+1,is)
1207 rxa(np+1,2,is)=rs(np+1,is)
1210 denm=ts(k,is)/(1.-rs(k,is)*rxa(k+1,1,is))
1211 rra(k,1,is)=rr(k,is)+(td(k,is)*rra(k+1,1,is)+(tt(k,is)-td(k,is))&
1212 *rxa(k+1,1,is))*denm
1213 rxa(k,1,is)=rs(k,is)+ts(k,is)*rxa(k+1,1,is)*denm
1214 rra(k,2,is)=rra(k,1,is)
1215 rxa(k,2,is)=rxa(k,1,is)
1222 denm=ts(k,im)/(1.-rs(k,im)*rxa(k+1,im,is))
1223 rra(k,im,is)=rr(k,im)+(td(k,im)*rra(k+1,im,is)+(tt(k,im)-td(k,im))&
1224 *rxa(k+1,im,is))*denm
1225 rxa(k,im,is)=rs(k,im)+ts(k,im)*rxa(k+1,im,is)*denm
1263 denm=ts(k,is)/(1.-rsa(k-1,ih,im)*rs(k,is))
1264 tda(k,ih,im)=tda(k-1,ih,im)*td(k,is)
1265 tta(k,ih,im)=tda(k-1,ih,im)*tt(k,is)+(tda(k-1,ih,im)*rr(k,is)&
1266 *rsa(k-1,ih,im)+tta(k-1,ih,im)-tda(k-1,ih,im))*denm
1267 rsa(k,ih,im)=rs(k,is)+ts(k,is)*rsa(k-1,ih,im)*denm
1273 denm=ts(k,ih)/(1.-rs(k,ih)*rxa(k+1,im,is))
1274 rra(k,im,is)=rr(k,ih)+(td(k,ih)*rra(k+1,im,is)+(tt(k,ih)-td(k,ih))&
1275 *rxa(k+1,im,is))*denm
1276 rxa(k,im,is)=rs(k,ih)+ts(k,ih)*rxa(k+1,im,is)*denm
1286 denm=1./(1.-rsa(k-1,ih,im)*rxa(k,im,is))
1287 fdndir=tda(k-1,ih,im)
1288 xx4=tda(k-1,ih,im)*rra(k,im,is)
1289 yy=tta(k-1,ih,im)-tda(k-1,ih,im)
1290 fdndif=(xx4*rsa(k-1,ih,im)+yy)*denm
1291 fupdif=(xx4+yy*rxa(k,im,is))*denm
1292 flxdn=fdndir+fdndif-fupdif
1297 if(ih.eq.1 .and. im.eq.1 .and. is.eq.1)
then 1301 fupa(k)=fupa(k)+fupdif*ct
1302 fall(k)=fall(k)+flxdn*ct
1304 fsdir=fsdir+fdndir*ct
1305 fsdif=fsdif+fdndif*ct
1316 flx_dev(i,k)=flx_dev(i,k)+fall(k)*hk_ir(ib,ik)
1317 flc_dev(i,k)=flc_dev(i,k)+fclr(k)*hk_ir(ib,ik)
1318 flxu_dev(i,k)=flxu_dev(i,k)+fupa(k)*hk_ir(ib,ik)
1319 flcu_dev(i,k)=flcu_dev(i,k)+fupc(k)*hk_ir(ib,ik)
1324 fdirir_dev(i)=fdirir_dev(i)+fsdir*hk_ir(ib,ik)
1325 fdifir_dev(i)=fdifir_dev(i)+fsdif*hk_ir(ib,ik)
1328 flx_sfc_band_dev(i,iv)=flx_sfc_band_dev(i,iv)+fall(np+1)*hk_ir(ib,ik)
1342 df(1) = 0.0633*(1.-exp(-0.000155*sqrt(so2(1))))
1345 so2(k+1) = so2(k) + scal(k)*cnt
1347 df(k+1) = 0.0633*(1.0 - exp(-0.000155*sqrt(so2(k+1))))
1353 so2(1) = (789.*co2)*scal0
1356 so2(k+1) = so2(k) + (789.*co2)*scal(k)
1379 ulog=
min(log10(so2(k)*snt),x0)
1380 wlog=
min(log10(swh(k)*snt),y0)
1381 ic=int((ulog-x1)/du+1.)
1382 iw=int((wlog-y1)/dw+1.)
1387 dc=ulog-
real(ic-2)*du-
u1 1388 dd=wlog-
real(iw-2)*dw-w1
1389 x2=cah(ic-1,iw-1)+(cah(ic-1,iw)-cah(ic-1,iw-1))/dw*dd
1390 y2=x2+(cah(ic,iw-1)-cah(ic-1,iw-1))/du*dc
1415 ulog=
min(co2*snt,x0)
1416 wlog=
min(log10(pl_dev(i,k)),y0)
1417 ic=int((ulog-x1)/du+1.)
1418 iw=int((wlog-y1)/dw+1.)
1423 dc=ulog-
real(ic-2)*du-
u1 1424 dd=wlog-
real(iw-2)*dw-w1
1425 x2=coa(ic-1,iw-1)+(coa(ic-1,iw)-coa(ic-1,iw-1))/dw*dd
1426 y2=x2+(coa(ic,iw-1)-coa(ic-1,iw-1))/du*dc
1436 if (fcld_dev(i,k) > 0.02.and.foundtop.eq.0)
then 1442 if (foundtop.eq.0) ntop=np+1
1447 if (k .gt. ntop)
then 1448 xx4 = (flx_dev(i,k)/flx_dev(i,ntop))
1449 df(k) = dftop + xx4 * (df(k)-dftop)
1456 df(k) =
min(df(k),flx_dev(i,k)-1.0e-8)
1458 flx_dev(i,k) = flx_dev(i,k) - df(k)
1459 flc_dev(i,k) = flc_dev(i,k) - df(k)
1468 xx4 = flx_dev(i,np+1) + df(np+1)
1470 if ( abs(xx4) > epsilon(1.0) )
then 1471 xx4 =
max(
min(1.0 - df(np+1)/xx4,1.),0.)
1476 fdirir_dev(i) = xx4*fdirir_dev(i)
1477 fdifir_dev(i) = xx4*fdifir_dev(i)
1478 fdiruv_dev(i) = xx4*fdiruv_dev(i)
1479 fdifuv_dev(i) = xx4*fdifuv_dev(i)
1480 fdirpar_dev(i) = xx4*fdirpar_dev(i)
1481 fdifpar_dev(i) = xx4*fdifpar_dev(i)
1484 flx_sfc_band_dev(i,ib) = xx4*flx_sfc_band_dev(i,ib)
1489 end subroutine sorad 1494 subroutine deledd(tau1,ssc1,g01,cza1,rr1,tt1,td1)
1518 integer,
parameter :: real_de = 8
1523 real(8),
intent(in) :: tau1,ssc1,g01,cza1
1527 real(8),
intent(out) :: rr1, tt1, td1
1531 real(8),
parameter ::
zero = 0.0_real_de
1532 real(8),
parameter ::
one = 1.0_real_de
1533 real(8),
parameter ::
two = 2.0_real_de
1534 real(8),
parameter ::
three = 3.0_real_de
1535 real(8),
parameter ::
four = 4.0_real_de
1536 real(8),
parameter :: fourth = 0.25_real_de
1537 real(8),
parameter :: seven = 7.0_real_de
1538 real(8),
parameter :: thresh = 1.e-8_real_de
1540 real(8) :: tau,ssc,g0,rr,tt,td
1541 real(8) :: zth,ff,xx,taup,sscp,gp,gm1,gm2,gm3,akk,alf1,alf2
1542 real(8) :: all,bll,st7,st8,cll,dll,fll,ell,st1,st2,st3,st4
1557 sscp= ssc*(
one-ff)/xx
1561 gm1 = (seven-sscp*(
four+xx))*fourth
1562 gm2 =-(
one -sscp*(
four-xx))*fourth
1564 akk = sqrt((gm1+gm2)*(gm1-gm2))
1571 if (abs(st3) .lt. thresh)
then 1573 if(zth > 1.0) zth = zth-0.0020
1588 all = (gm3-alf2*zth )*xx*td
1589 bll = (
one-gm3+alf1*zth)*xx
1599 st2 = exp(-akk*taup)
1602 st1 = sscp/((akk+gm1+(akk-gm1)*st4)*st3)
1604 rr = ( cll-dll*st4 - all*st2)*st1
1605 tt =-((fll-ell*st4)*td - bll*st2)*st1
1622 subroutine getvistau1(nlevs,cosz,dp,fcld,reff,hydromets,ict,icb, &
1623 taubeam,taudiff,asycl, &
1624 aig_uv, awg_uv, arg_uv, &
1625 aib_uv, awb_uv, arb_uv, &
1626 aib_nir, awb_nir, arb_nir, &
1627 aia_nir, awa_nir, ara_nir, &
1628 aig_nir, awg_nir, arg_nir, &
1637 integer,
intent(IN ) :: nlevs
1638 real(8),
intent(IN ) :: cosz
1639 real(8),
intent(IN ) :: dp(nlevs)
1640 real(8),
intent(IN ) :: fcld(nlevs)
1641 real(8),
intent(IN ) :: reff(nlevs,4)
1642 real(8),
intent(IN ) :: hydromets(nlevs,4)
1643 integer,
intent(IN ) :: ict, icb
1651 real(8),
intent(OUT) :: taubeam(nlevs,4)
1652 real(8),
intent(OUT) :: taudiff(nlevs,4)
1653 real(8),
intent(OUT) :: asycl(nlevs )
1676 integer :: k,in,im,it,ia,kk
1677 real(8) :: fm,ft,fa,xai,tauc,asyclt
1679 real(8) :: taucld1,taucld2,taucld3,taucld4
1680 real(8) :: g1,g2,g3,g4
1682 real(8) :: reff_snow
1684 integer,
parameter :: nm=11,nt=9,na=11
1685 real(8),
parameter :: dm=0.1,dt=0.30103,da=0.1,t1=-0.9031
1687 real(8),
intent(in) :: aig_uv(3), awg_uv(3), arg_uv(3)
1688 real(8),
intent(in) :: aib_uv, awb_uv(2), arb_uv(2)
1689 real(8),
intent(in) :: aib_nir, awb_nir(3,2), arb_nir(3,2)
1690 real(8),
intent(in) :: aia_nir(3,3), awa_nir(3,3), ara_nir(3,3)
1691 real(8),
intent(in) :: aig_nir(3,3), awg_nir(3,3), arg_nir(3,3)
1692 real(8),
intent(in) :: caib(11,9,11), caif(9,11)
1693 real(8),
intent(in) :: cons_grav
1713 cc(1)=
max(cc(1),fcld(k))
1716 cc(2)=
max(cc(2),fcld(k))
1719 cc(3)=
max(cc(3),fcld(k))
1734 if (reff(k,1) <= 0.)
then 1737 taucld1=(((dp(k)*1.0e3)/cons_grav)*hydromets(k,1))*aib_uv/reff(k,1)
1740 if (reff(k,2) <= 0.)
then 1743 taucld2=(((dp(k)*1.0e3)/cons_grav)*hydromets(k,2))*(awb_uv(1)+awb_uv(2)/reff(k,2))
1746 taucld3=(((dp(k)*1.0e3)/cons_grav)*hydromets(k,3))*arb_uv(1)
1756 reff_snow =
min(reff(k,4),112.0)
1758 if (reff_snow <= 0.)
then 1761 taucld4=(((dp(k)*1.0e3)/cons_grav)*hydromets(k,4))*aib_uv/reff_snow
1764 if ( ict .ne. 0 )
then 1778 else if (k.ge.ict .and. k.lt.icb)
then 1784 tauc=taucld1+taucld2+taucld3+taucld4
1786 if (tauc.gt.0.02 .and. fcld(k).gt.0.01)
then 1797 ft=(log10(tauc)-t1)/dt
1821 xai= (-caib(im-1,it,ia)*(1.-fm)+&
1822 caib(im+1,it,ia)*(1.+fm))*fm*.5+caib(im,it,ia)*(1.-fm*fm)
1824 xai=xai+(-caib(im,it-1,ia)*(1.-ft)+&
1825 caib(im,it+1,ia)*(1.+ft))*ft*.5+caib(im,it,ia)*(1.-ft*ft)
1827 xai=xai+(-caib(im,it,ia-1)*(1.-fa)+&
1828 caib(im,it,ia+1)*(1.+fa))*fa*.5+caib(im,it,ia)*(1.-fa*fa)
1830 xai=xai-2.*caib(im,it,ia)
1835 taubeam(k,1)=taucld1*xai
1836 taubeam(k,2)=taucld2*xai
1837 taubeam(k,3)=taucld3*xai
1838 taubeam(k,4)=taucld4*xai
1845 xai= (-caif(it-1,ia)*(1.-ft)+&
1846 caif(it+1,ia)*(1.+ft))*ft*.5+caif(it,ia)*(1.-ft*ft)
1848 xai=xai+(-caif(it,ia-1)*(1.-fa)+&
1849 caif(it,ia+1)*(1.+fa))*fa*.5+caif(it,ia)*(1.-fa*fa)
1856 taudiff(k,1)=taucld1*xai
1857 taudiff(k,2)=taucld2*xai
1858 taudiff(k,3)=taucld3*xai
1859 taudiff(k,4)=taucld4*xai
1863 taubeam(k,1)=taucld1
1864 taubeam(k,2)=taucld2
1865 taubeam(k,3)=taucld3
1866 taubeam(k,4)=taucld4
1868 taudiff(k,1)=taucld1
1869 taudiff(k,2)=taucld2
1870 taudiff(k,3)=taucld3
1871 taudiff(k,4)=taucld4
1878 tauc=taucld1+taucld2+taucld3+taucld4
1880 if (tauc.gt.0.02 .and. fcld(k).gt.0.01)
then 1881 g1=(aig_uv(1)+(aig_uv(2)+aig_uv(3)*reff(k,1))*reff(k,1))*taucld1
1882 g2=(awg_uv(1)+(awg_uv(2)+awg_uv(3)*reff(k,2))*reff(k,2))*taucld2
1883 g3= arg_uv(1) *taucld3
1884 g4=(aig_uv(1)+(aig_uv(2)+aig_uv(3)*reff_snow)*reff_snow)*taucld4
1885 asyclt=(g1+g2+g3+g4)/tauc
1899 subroutine getnirtau1(ib,nlevs,cosz,dp,fcld,reff,hydromets,ict,icb, &
1900 taubeam,taudiff,asycl,ssacl, &
1901 aig_uv, awg_uv, arg_uv, &
1902 aib_uv, awb_uv, arb_uv, &
1903 aib_nir, awb_nir, arb_nir, &
1904 aia_nir, awa_nir, ara_nir, &
1905 aig_nir, awg_nir, arg_nir, &
1913 integer,
intent(IN ) :: ib
1914 integer,
intent(IN ) :: nlevs
1915 real(8),
intent(IN ) :: cosz
1916 real(8),
intent(IN ) :: dp(nlevs)
1917 real(8),
intent(IN ) :: fcld(nlevs)
1918 real(8),
intent(IN ) :: reff(nlevs,4)
1919 real(8),
intent(IN ) :: hydromets(nlevs,4)
1920 integer,
intent(IN ) :: ict, icb
1922 real(8),
intent(in) :: aig_uv(3), awg_uv(3), arg_uv(3)
1923 real(8),
intent(in) :: aib_uv, awb_uv(2), arb_uv(2)
1924 real(8),
intent(in) :: aib_nir, awb_nir(3,2), arb_nir(3,2)
1925 real(8),
intent(in) :: aia_nir(3,3), awa_nir(3,3), ara_nir(3,3)
1926 real(8),
intent(in) :: aig_nir(3,3), awg_nir(3,3), arg_nir(3,3)
1927 real(8),
intent(in) :: caib(11,9,11), caif(9,11)
1928 real(8),
intent(in) :: cons_grav
1931 real(8),
intent(OUT) :: taubeam(nlevs,4)
1932 real(8),
intent(OUT) :: taudiff(nlevs,4)
1933 real(8),
intent(OUT) :: ssacl(nlevs )
1934 real(8),
intent(OUT) :: asycl(nlevs )
1936 integer :: k,in,im,it,ia,kk
1937 real(8) :: fm,ft,fa,xai,tauc,asyclt,ssaclt
1939 real(8) :: taucld1,taucld2,taucld3,taucld4
1940 real(8) :: g1,g2,g3,g4
1941 real(8) :: w1,w2,w3,w4
1943 real(8) :: reff_snow
1945 integer,
parameter :: nm=11,nt=9,na=11
1946 real(8),
parameter :: dm=0.1,dt=0.30103,da=0.1,t1=-0.9031
1966 cc(1)=
max(cc(1),fcld(k))
1969 cc(2)=
max(cc(2),fcld(k))
1972 cc(3)=
max(cc(3),fcld(k))
1985 if (reff(k,1) <= 0.)
then 1988 taucld1=(((dp(k)*1.0e3)/cons_grav)*hydromets(k,1))*aib_nir/reff(k,1)
1991 if (reff(k,2) <= 0.)
then 1994 taucld2=(((dp(k)*1.0e3)/cons_grav)*hydromets(k,2))*(awb_nir(ib,1)+awb_nir(ib,2)/reff(k,2))
1997 taucld3=(((dp(k)*1.0e3)/cons_grav)*hydromets(k,3))*arb_nir(ib,1)
2007 reff_snow =
min(reff(k,4),112.0)
2009 if (reff_snow <= 0.)
then 2012 taucld4=(((dp(k)*1.0e3)/cons_grav)*hydromets(k,4))*aib_nir/reff_snow
2015 if ( ict .ne. 0 )
then 2029 else if (k.ge.ict .and. k.lt.icb)
then 2035 tauc=taucld1+taucld2+taucld3+taucld4
2037 if (tauc.gt.0.02 .and. fcld(k).gt.0.01)
then 2040 if (cc(kk).ne.0.0)
then 2051 ft=(log10(tauc)-t1)/dt
2075 xai= (-caib(im-1,it,ia)*(1.-fm)+&
2076 caib(im+1,it,ia)*(1.+fm))*fm*.5+caib(im,it,ia)*(1.-fm*fm)
2078 xai=xai+(-caib(im,it-1,ia)*(1.-ft)+&
2079 caib(im,it+1,ia)*(1.+ft))*ft*.5+caib(im,it,ia)*(1.-ft*ft)
2081 xai=xai+(-caib(im,it,ia-1)*(1.-fa)+&
2082 caib(im,it,ia+1)*(1.+fa))*fa*.5+caib(im,it,ia)*(1.-fa*fa)
2084 xai=xai-2.*caib(im,it,ia)
2089 taubeam(k,1)=taucld1*xai
2090 taubeam(k,2)=taucld2*xai
2091 taubeam(k,3)=taucld3*xai
2092 taubeam(k,4)=taucld4*xai
2099 xai= (-caif(it-1,ia)*(1.-ft)+&
2100 caif(it+1,ia)*(1.+ft))*ft*.5+caif(it,ia)*(1.-ft*ft)
2102 xai=xai+(-caif(it,ia-1)*(1.-fa)+&
2103 caif(it,ia+1)*(1.+fa))*fa*.5+caif(it,ia)*(1.-fa*fa)
2110 taudiff(k,1)=taucld1*xai
2111 taudiff(k,2)=taucld2*xai
2112 taudiff(k,3)=taucld3*xai
2113 taudiff(k,4)=taucld4*xai
2117 taubeam(k,1)=taucld1
2118 taubeam(k,2)=taucld2
2119 taubeam(k,3)=taucld3
2120 taubeam(k,4)=taucld4
2122 taudiff(k,1)=taucld1
2123 taudiff(k,2)=taucld2
2124 taudiff(k,3)=taucld3
2125 taudiff(k,4)=taucld4
2134 tauc=taucld1+taucld2+taucld3+taucld4
2136 if (tauc.gt.0.02 .and. fcld(k).gt.0.01)
then 2138 w1=(1.-(aia_nir(ib,1)+(aia_nir(ib,2)+aia_nir(ib,3)*reff(k,1))*reff(k,1)))*taucld1
2139 w2=(1.-(awa_nir(ib,1)+(awa_nir(ib,2)+awa_nir(ib,3)*reff(k,2))*reff(k,2)))*taucld2
2140 w3=(1.- ara_nir(ib,1)) *taucld3
2141 w4=(1.-(aia_nir(ib,1)+(aia_nir(ib,2)+aia_nir(ib,3)*reff_snow)*reff_snow))*taucld4
2142 ssaclt=(w1+w2+w3+w4)/tauc
2144 g1=(aig_nir(ib,1)+(aig_nir(ib,2)+aig_nir(ib,3)*reff(k,1))*reff(k,1))*w1
2145 g2=(awg_nir(ib,1)+(awg_nir(ib,2)+awg_nir(ib,3)*reff(k,2))*reff(k,2))*w2
2146 g3= arg_nir(ib,1) *w3
2148 g4=(aig_nir(ib,1)+(aig_nir(ib,2)+aig_nir(ib,3)*reff(k,4))*reff(k,4))*w4
2150 if ((w1+w2+w3+w4).ne.0.0)
then 2151 asyclt=(g1+g2+g3+g4)/(w1+w2+w3+w4)
subroutine, public deledd(tau1, ssc1, g01, cza1, rr1, tt1, td1)
real(fp), parameter, public zero
real(fp), parameter, public four
real(fp), parameter, public three
subroutine, public getnirtau1(ib, nlevs, cosz, dp, fcld, reff, hydromets, ict, icb, taubeam, taudiff, asycl, ssacl, aig_uv, awg_uv, arg_uv, aib_uv, awb_uv, arb_uv, aib_nir, awb_nir, arb_nir, aia_nir, awa_nir, ara_nir, aig_nir, awg_nir, arg_nir, caib, caif, CONS_GRAV)
subroutine, public getvistau1(nlevs, cosz, dp, fcld, reff, hydromets, ict, icb, taubeam, taudiff, asycl, aig_uv, awg_uv, arg_uv, aib_uv, awb_uv, arb_uv, aib_nir, awb_nir, arb_nir, aia_nir, awa_nir, ara_nir, aig_nir, awg_nir, arg_nir, caib, caif, CONS_GRAV)
real(kind=kind_real), parameter u1
real(fp), parameter, public one
real(fp), parameter, public two
subroutine, public sorad(m, np, nb, cosz_dev, pl_dev, ta_dev, wa_dev, oa_dev, co2, cwc_dev, fcld_dev, ict, icb, reff_dev, hk_uv, hk_ir, taua_dev, ssaa_dev, asya_dev, rsuvbm_dev, rsuvdf_dev, rsirbm_dev, rsirdf_dev, flx_dev, CONS_GRAV, wk_uv, zk_uv, ry_uv, xk_ir, ry_ir, cah, coa, aig_uv, awg_uv, arg_uv, aib_uv, awb_uv, arb_uv, aib_nir, awb_nir, arb_nir, aia_nir, awa_nir, ara_nir, aig_nir, awg_nir, arg_nir, caib, caif)