495 subroutine aer_init &
496 & ( nlay, me, iaermdl, iaerflg, lalw1bd, aeros_file, con_pi, &
497 & con_t0c, con_c, con_boltz, con_plnk, errflg, errmsg)
541 integer,
intent(in) :: nlay, me, iaermdl, iaerflg
542 logical,
intent(in) :: lalw1bd
543 character(len=26),
intent(in) :: aeros_file
544 real(kind_phys),
intent(in) :: con_pi,con_t0c, con_c, con_boltz, &
547 integer,
intent(out) :: errflg
548 character(len=*),
intent(out) :: errmsg
551 real (kind=kind_phys),
dimension(NWVTOT) :: solfwv
552 real (kind=kind_phys),
dimension(NWVTIR) :: eirfwv
566 laswflg= (mod(iaerflg,10) > 0)
567 lalwflg= (mod(iaerflg/10,10) > 0)
568 lavoflg= (mod(iaerflg/100,10) >0)
574 call wrt_aerlog(iaermdl, iaerflg, lalw1bd, errflg, errmsg)
580 if ( iaerflg == 0 )
return
602 nswlwbd = nswbnd + nlwbnd
604 wvn_sw1(:) = wvnsw1(:)
605 wvn_sw2(:) = wvnsw2(:)
606 wvn_lw1(:) = wvnlw1(:)
607 wvn_lw2(:) = wvnlw2(:)
612 if ( iaermdl == 0 )
then
615 wvn_sw1(2:nbdsw-1) = wvn_sw1(2:nbdsw-1) + 1
616 wvn_lw1(2:nbdlw) = wvn_lw1(2:nbdlw) + 1
621 if ( iaerflg /= 100 )
then
626 call set_spectrum(con_pi, con_t0c, con_c, con_boltz, con_plnk, &
633 if ( iaermdl==0 .or. iaermdl==5 )
then
636 & ( solfwv, eirfwv, me, aeros_file, &
640 elseif ( iaermdl==1 .or. iaermdl==2 )
then
642 call gocart_aerinit &
644 & ( solfwv, eirfwv, me, &
650 print *,
' !!! ERROR in aerosol model scheme selection', &
651 &
' iaermdl =',iaermdl
653 errmsg =
'ERROR(aer_init): aerosol model scheme selected'// &
666 call set_volcaer(errflg, errmsg)
679 subroutine wrt_aerlog(iaermdl, iaerflg, lalw1bd, errflg, errmsg)
708 integer,
intent(in) :: iaermdl, iaerflg
709 logical,
intent(in) :: lalw1bd
711 integer,
intent(out) :: errflg
712 character(len=*),
intent(out) :: errmsg
725 if ( iaermdl==0 .or. iaermdl==5 )
then
726 print *,
' - Using OPAC-seasonal climatology for tropospheric', &
728 elseif ( iaermdl == 1 )
then
729 print *,
' - Using GOCART-climatology for tropospheric', &
731 elseif ( iaermdl == 2 )
then
732 print *,
' - Using GOCART-prognostic aerosols for tropospheric', &
735 print *,
' !!! ERROR in selection of aerosol model scheme', &
736 &
' IAER_MDL =',iaermdl
738 errmsg =
'ERROR(wrt_aerlog): Selected aerosol model scheme is'//&
743 print *,
' IAER=',iaerflg,
' LW-trop-aer=',lalwflg, &
744 &
' SW-trop-aer=',laswflg,
' Volc-aer=',lavoflg
746 if ( iaerflg <= 0 )
then
747 print *,
' - No tropospheric/volcanic aerosol effect included'
748 print *,
' Input values of aerosol optical properties to' &
749 & ,
' both SW and LW radiations are set to zeros'
751 if ( iaerflg >= 100 )
then
752 print *,
' - Include stratospheric volcanic aerosol effect'
754 print *,
' - No stratospheric volcanic aerosol effect'
758 print *,
' - Compute multi-band aerosol optical' &
759 & ,
' properties for SW input parameters'
761 print *,
' - No SW radiation aerosol effect, values of' &
762 & ,
' aerosol properties to SW input are set to zeros'
767 print *,
' - Compute 1 broad-band aerosol optical' &
768 & ,
' properties for LW input parameters'
770 print *,
' - Compute multi-band aerosol optical' &
771 & ,
' properties for LW input parameters'
774 print *,
' - No LW radiation aerosol effect, values of' &
775 & ,
' aerosol properties to LW input are set to zeros'
781 end subroutine wrt_aerlog
787 subroutine set_spectrum(con_pi, con_t0c, con_c, con_boltz, &
788 & con_plnk, errflg, errmsg)
830 real(kind_phys),
intent(in) :: con_pi, con_t0c, con_c, con_boltz, &
837 integer,
intent(out) :: errflg
838 character(len=*),
intent(out) :: errmsg
840 real (kind=kind_phys) :: soltot, tmp1, tmp2, tmp3
842 integer :: nb, nw, nw1, nw2, nmax, nmin
864 nw1 = nw1 + nwvns0(nb-1)
867 nw2 = nw1 + nwvns0(nb) - 1
870 solfwv(nw) = s0intv(nb)
881 tmp1 = (con_pi + con_pi) * con_plnk * con_c* con_c
882 tmp2 = con_plnk * con_c / (con_boltz * con_t0c)
887 eirfwv(nw) = (tmp1 * tmp3**3) / (exp(tmp2*tmp3) - 1.0)
892 end subroutine set_spectrum
898 subroutine set_volcaer(errflg, errmsg)
921 integer,
intent(out) :: errflg
922 character(len=*),
intent(out) :: errmsg
934 if ( .not.
allocated(ivolae) )
then
935 allocate ( ivolae(12,4,10) )
940 end subroutine set_volcaer
957 subroutine clim_aerinit &
958 & ( solfwv, eirfwv, me, aeros_file, &
999 real (kind=kind_phys),
dimension(:) :: solfwv
1000 real (kind=kind_phys),
dimension(:) :: eirfwv
1001 integer,
intent(in) :: me
1002 character(len=26),
intent(in) :: aeros_file
1004 integer,
intent(out) :: errflg
1005 character(len=*),
intent(out) :: errmsg
1008 real (kind=kind_phys),
dimension(NAERBND,NCM1) :: &
1009 & rhidext0, rhidsca0, rhidssa0, rhidasy0
1010 real (kind=kind_phys),
dimension(NAERBND,NRHLEV,NCM2):: &
1011 & rhdpext0, rhdpsca0, rhdpssa0, rhdpasy0
1012 real (kind=kind_phys),
dimension(NAERBND) :: straext0
1014 real (kind=kind_phys),
dimension(NSWBND,NAERBND) :: solwaer
1015 real (kind=kind_phys),
dimension(NSWBND) :: solbnd
1016 real (kind=kind_phys),
dimension(NLWBND,NAERBND) :: eirwaer
1017 real (kind=kind_phys),
dimension(NLWBND) :: eirbnd
1019 integer,
dimension(NSWBND) :: nv1, nv2
1020 integer,
dimension(NLWBND) :: nr1, nr2
1031 call set_aercoef(aeros_file, errflg, errmsg)
1045 subroutine set_aercoef(aeros_file,errflg, errmsg)
1125 character(len=26),
intent(in) :: aeros_file
1127 integer,
intent(out) :: errflg
1128 character(len=*),
intent(out) :: errmsg
1131 integer,
dimension(NAERBND) :: iendwv
1133 integer :: i, j, k, m, mb, ib, ii, id, iw, iw1, iw2, ik, ibs, ibe
1135 real (kind=kind_phys) :: sumsol, sumir, fac, tmp, wvs, wve
1137 logical :: file_exist
1138 character :: cline*80
1150 inquire (file=aeros_file, exist=file_exist)
1152 if ( file_exist )
then
1154 open (unit=niaercm,file=aeros_file,status=
'OLD', &
1155 & action=
'read',form=
'FORMATTED')
1158 print *,
' Requested aerosol data file "',aeros_file, &
1160 print *,
' *** Stopped in subroutine aero_init !!'
1162 errmsg =
'ERROR(set_aercoef): Requested aerosol data file '// &
1163 & aeros_file//
' not found'
1170 read (niaercm,12) cline
1182 if ( .not.
allocated( extrhi ) )
then
1183 allocate ( extrhi( ncm1,nswlwbd) )
1184 allocate ( scarhi( ncm1,nswlwbd) )
1185 allocate ( ssarhi( ncm1,nswlwbd) )
1186 allocate ( asyrhi( ncm1,nswlwbd) )
1187 allocate ( extrhd(nrhlev,ncm2,nswlwbd) )
1188 allocate ( scarhd(nrhlev,ncm2,nswlwbd) )
1189 allocate ( ssarhd(nrhlev,ncm2,nswlwbd) )
1190 allocate ( asyrhd(nrhlev,ncm2,nswlwbd) )
1191 allocate ( extstra( nswlwbd) )
1195 read(niaercm,21) cline
1197 read(niaercm,22) iendwv(:)
1201 read(niaercm,21) cline
1202 read(niaercm,24) haer(:,:)
1206 read(niaercm,21) cline
1207 read(niaercm,26) prsref(:,:)
1211 read(niaercm,21) cline
1212 read(niaercm,28) rhidext0(:,:)
1216 read(niaercm,21) cline
1217 read(niaercm,28) rhidsca0(:,:)
1220 read(niaercm,21) cline
1221 read(niaercm,28) rhidssa0(:,:)
1224 read(niaercm,21) cline
1225 read(niaercm,28) rhidasy0(:,:)
1228 read(niaercm,21) cline
1229 read(niaercm,28) rhdpext0(:,:,:)
1232 read(niaercm,21) cline
1233 read(niaercm,28) rhdpsca0(:,:,:)
1236 read(niaercm,21) cline
1237 read(niaercm,28) rhdpssa0(:,:,:)
1240 read(niaercm,21) cline
1241 read(niaercm,28) rhdpasy0(:,:,:)
1244 read(niaercm,21) cline
1245 read(niaercm,28) straext0(:)
1252 sigref(:,:) = 0.001 * prsref(:,:)
1262 solwaer(i,j) = f_zero
1272 mb = ib + nswstr - 1
1273 if ( wvn_sw2(mb) >= wvn550 .and. wvn550 >= wvn_sw1(mb) )
then
1277 if ( wvn_sw1(mb) < wvs )
then
1281 if ( wvn_sw1(mb) > wve )
then
1289 mb = ib + nswstr - 1
1291 iw1 = nint(wvn_sw1(mb))
1292 iw2 = nint(wvn_sw2(mb))
1294 lab_swdowhile :
do while ( iw1 > iendwv(ii) )
1295 if ( ii == naerbnd )
exit lab_swdowhile
1299 if ( lmap_new )
then
1303 sumsol = -0.5 * solfwv(iw1)
1317 solbnd(ib) = solbnd(ib) + solfwv(iw)
1318 sumsol = sumsol + solfwv(iw)
1320 if ( iw == iendwv(ii) )
then
1321 solwaer(ib,ii) = sumsol
1323 if ( ii < naerbnd )
then
1330 if ( iw2 /= iendwv(ii) )
then
1331 solwaer(ib,ii) = sumsol
1334 if ( lmap_new )
then
1335 tmp = fac * solfwv(iw2)
1336 solwaer(ib,ii) = solwaer(ib,ii) + tmp
1337 solbnd(ib) = solbnd(ib) + tmp
1353 eirwaer(i,j) = f_zero
1359 if (nlwbnd > 1 )
then
1363 mb = ib + nlwstr - 1
1364 if ( wvn_lw1(mb) < wvs )
then
1368 if ( wvn_lw1(mb) > wve )
then
1378 if ( nlwbnd == 1 )
then
1383 mb = ib + nlwstr - 1
1384 iw1 = nint(wvn_lw1(mb))
1385 iw2 = nint(wvn_lw2(mb))
1388 lab_lwdowhile :
do while ( iw1 > iendwv(ii) )
1389 if ( ii == naerbnd )
exit lab_lwdowhile
1393 if ( lmap_new )
then
1397 sumir = -0.5 * eirfwv(iw1)
1411 eirbnd(ib) = eirbnd(ib) + eirfwv(iw)
1412 sumir = sumir + eirfwv(iw)
1414 if ( iw == iendwv(ii) )
then
1415 eirwaer(ib,ii) = sumir
1417 if ( ii < naerbnd )
then
1424 if ( iw2 /= iendwv(ii) )
then
1425 eirwaer(ib,ii) = sumir
1428 if ( lmap_new )
then
1429 tmp = fac * eirfwv(iw2)
1430 eirwaer(ib,ii) = eirwaer(ib,ii) + tmp
1431 eirbnd(ib) = eirbnd(ib) + tmp
1490 end subroutine set_aercoef
1542 real (kind=kind_phys) :: sumk, sums, sumok, sumokg, sumreft, &
1543 & sp, refb, reft, rsolbd, rirbd
1545 integer :: ib, nb, ni, nh, nc
1556 rsolbd = f_one / solbnd(nb)
1567 do ni = nv1(nb), nv2(nb)
1568 sp = sqrt( (f_one - rhidssa0(ni,nc)) &
1569 & / (f_one - rhidssa0(ni,nc)*rhidasy0(ni,nc)) )
1570 reft = (f_one - sp) / (f_one + sp)
1571 sumreft = sumreft + reft*solwaer(nb,ni)
1573 sumk = sumk + rhidext0(ni,nc)*solwaer(nb,ni)
1574 sums = sums + rhidsca0(ni,nc)*solwaer(nb,ni)
1575 sumok = sumok + rhidssa0(ni,nc)*solwaer(nb,ni) &
1577 sumokg = sumokg + rhidssa0(ni,nc)*solwaer(nb,ni) &
1578 & * rhidext0(ni,nc)*rhidasy0(ni,nc)
1581 refb = sumreft * rsolbd
1583 extrhi(nc,nb) = sumk * rsolbd
1584 scarhi(nc,nb) = sums * rsolbd
1585 asyrhi(nc,nb) = sumokg / (sumok + 1.0e-10)
1586 ssarhi(nc,nb) = 4.0*refb &
1587 & / ( (f_one+refb)**2 - asyrhi(nc,nb)*(f_one-refb)**2 )
1599 do ni = nv1(nb), nv2(nb)
1600 sp = sqrt( (f_one - rhdpssa0(ni,nh,nc)) &
1601 & / (f_one - rhdpssa0(ni,nh,nc)*rhdpasy0(ni,nh,nc)) )
1602 reft = (f_one - sp) / (f_one + sp)
1603 sumreft = sumreft + reft*solwaer(nb,ni)
1605 sumk = sumk + rhdpext0(ni,nh,nc)*solwaer(nb,ni)
1606 sums = sums + rhdpsca0(ni,nh,nc)*solwaer(nb,ni)
1607 sumok = sumok + rhdpssa0(ni,nh,nc)*solwaer(nb,ni) &
1608 & * rhdpext0(ni,nh,nc)
1609 sumokg = sumokg + rhdpssa0(ni,nh,nc)*solwaer(nb,ni) &
1610 & * rhdpext0(ni,nh,nc)*rhdpasy0(ni,nh,nc)
1613 refb = sumreft * rsolbd
1615 extrhd(nh,nc,nb) = sumk * rsolbd
1616 scarhd(nh,nc,nb) = sums * rsolbd
1617 asyrhd(nh,nc,nb) = sumokg / (sumok + 1.0e-10)
1618 ssarhd(nh,nc,nb) = 4.0*refb &
1619 & / ( (f_one+refb)**2 - asyrhd(nh,nc,nb)*(f_one-refb)**2 )
1626 do ni = nv1(nb), nv2(nb)
1627 sumk = sumk + straext0(ni)*solwaer(nb,ni)
1630 extstra(nb) = sumk * rsolbd
1657 rirbd = f_one / eirbnd(nb)
1666 do ni = nr1(nb), nr2(nb)
1667 sp = sqrt( (f_one - rhidssa0(ni,nc)) &
1668 & / (f_one - rhidssa0(ni,nc)*rhidasy0(ni,nc)) )
1669 reft = (f_one - sp) / (f_one + sp)
1670 sumreft = sumreft + reft*eirwaer(nb,ni)
1672 sumk = sumk + rhidext0(ni,nc)*eirwaer(nb,ni)
1673 sums = sums + rhidsca0(ni,nc)*eirwaer(nb,ni)
1674 sumok = sumok + rhidssa0(ni,nc)*eirwaer(nb,ni) &
1676 sumokg = sumokg + rhidssa0(ni,nc)*eirwaer(nb,ni) &
1677 & * rhidext0(ni,nc)*rhidasy0(ni,nc)
1680 refb = sumreft * rirbd
1682 extrhi(nc,ib) = sumk * rirbd
1683 scarhi(nc,ib) = sums * rirbd
1684 asyrhi(nc,ib) = sumokg / (sumok + 1.0e-10)
1685 ssarhi(nc,ib) = 4.0*refb &
1686 & / ( (f_one+refb)**2 - asyrhi(nc,ib)*(f_one-refb)**2 )
1697 do ni = nr1(nb), nr2(nb)
1698 sp = sqrt( (f_one - rhdpssa0(ni,nh,nc)) &
1699 & / (f_one - rhdpssa0(ni,nh,nc)*rhdpasy0(ni,nh,nc)) )
1700 reft = (f_one - sp) / (f_one + sp)
1701 sumreft = sumreft + reft*eirwaer(nb,ni)
1703 sumk = sumk + rhdpext0(ni,nh,nc)*eirwaer(nb,ni)
1704 sums = sums + rhdpsca0(ni,nh,nc)*eirwaer(nb,ni)
1705 sumok = sumok + rhdpssa0(ni,nh,nc)*eirwaer(nb,ni) &
1706 & * rhdpext0(ni,nh,nc)
1707 sumokg = sumokg + rhdpssa0(ni,nh,nc)*eirwaer(nb,ni) &
1708 & * rhdpext0(ni,nh,nc)*rhdpasy0(ni,nh,nc)
1711 refb = sumreft * rirbd
1713 extrhd(nh,nc,ib) = sumk * rirbd
1714 scarhd(nh,nc,ib) = sums * rirbd
1715 asyrhd(nh,nc,ib) = sumokg / (sumok + 1.0e-10)
1716 ssarhd(nh,nc,ib) = 4.0*refb &
1717 & / ( (f_one+refb)**2 - asyrhd(nh,nc,ib)*(f_one-refb)**2 )
1724 do ni = nr1(nb), nr2(nb)
1725 sumk = sumk + straext0(ni)*eirwaer(nb,ni)
1728 extstra(ib) = sumk * rirbd
1748 end subroutine optavg
2179 & ( prsi,prsl,prslk,tvly,rhlay,slmsk,tracer,aerfld,xlon,xlat, &
2180 & imax,nlay,nlp1, lsswr,lslwr,iaermdl,iaerflg,top_at_1, &
2181 & con_pi,con_rd,con_g,aerosw,aerolw, &
2182 & aerodp, ext550, errflg, errmsg &
2245 integer,
intent(in) :: imax, nlay, nlp1, iaermdl, iaerflg
2246 real (kind=kind_phys),
intent(in) :: con_pi, con_rd, con_g
2247 real (kind=kind_phys),
dimension(:,:),
intent(in) :: prsi, prsl, &
2248 & prslk, tvly, rhlay
2249 real (kind=kind_phys),
dimension(:),
intent(in) :: xlon, xlat, &
2251 real (kind=kind_phys),
dimension(:,:,:),
intent(in):: tracer
2252 real (kind=kind_phys),
dimension(:,:,:),
intent(in):: aerfld
2254 logical,
intent(in) :: lsswr, lslwr, top_at_1
2258 real (kind=kind_phys),
dimension(:,:,:,:),
intent(out) :: &
2261 real (kind=kind_phys),
dimension(:,:) ,
intent(out) :: aerodp
2262 real (kind=kind_phys),
dimension(:,:) ,
intent(out) :: ext550
2263 integer,
intent(out) :: errflg
2264 character(len=*),
intent(out) :: errmsg
2267 real (kind=kind_phys),
parameter :: psrfh = 5.0
2269 real (kind=kind_phys),
dimension(IMAX) :: alon,alat,volcae,rdelp
2271 real (kind=kind_phys) :: prsln(nlp1),hz(imax,nlp1),dz(imax,nlay)
2272 real (kind=kind_phys) :: tmp1, tmp2, psrfl
2274 integer :: kcutl(imax), kcuth(imax)
2275 integer :: i, i1, j, k, m, mb, kh, kl
2277 logical :: laddsw=.false., laersw=.false.
2278 logical :: laddlw=.false., laerlw=.false.
2281 real (kind=kind_phys) :: rdg
2282 real (kind=kind_phys) :: rovg
2285 rdg = 180._kind_phys / con_pi
2286 rovg = 0.001_kind_phys * con_rd / con_g
2296 aerosw(i,k,j,m) = f_zero
2306 aerolw(i,k,j,m) = f_zero
2315 aerodp(i,k) = f_zero
2318 ext550(:,:) = f_zero
2320 if ( .not. (lsswr .or. lslwr) )
then
2324 if ( iaerflg <= 0 )
then
2328 laersw = lsswr .and. laswflg
2329 laerlw = lslwr .and. lalwflg
2334 alon(i) = xlon(i) * rdg
2335 if (alon(i) < f_zero) alon(i) = alon(i) + 360.0
2336 alat(i) = xlat(i) * rdg
2342 if ( laswflg .or. lalwflg )
then
2344 lab_do_imax :
do i = 1, imax
2346 lab_if_flip :
if (.not. top_at_1)
then
2349 prsln(k) = log(prsi(i,k))
2351 prsln(nlp1)= log(prsl(i,nlay))
2354 dz(i,k) = rovg * (prsln(k) - prsln(k+1)) * tvly(i,k)
2356 dz(i,nlay) = 2.0 * dz(i,nlay)
2360 hz(i,k+1) = hz(i,k) + dz(i,k)
2365 prsln(1) = log(prsl(i,1))
2367 prsln(k) = log(prsi(i,k))
2371 dz(i,k) = rovg * (prsln(k+1) - prsln(k)) * tvly(i,k)
2373 dz(i,1) = 2.0 * dz(i,1)
2377 hz(i,k) = hz(i,k+1) + dz(i,k)
2395 if ( iaermdl==0 .or. iaermdl==5 )
then
2399 & ( prsi,prsl,prslk,tvly,rhlay,dz,hz,tracer, &
2400 & alon,alat,slmsk, laersw,laerlw, &
2401 & imax,nlay,nlp1,top_at_1, &
2404 & aerosw,aerolw,aerodp,errflg,errmsg &
2408 elseif ( iaermdl==1 .or. iaermdl==2)
then
2410 call aer_property_gocart &
2412 & ( prsi,prsl,prslk,tvly,rhlay,dz,hz,tracer,aerfld, &
2413 & alon,alat,slmsk,laersw,laerlw,con_rd, &
2416 & aerosw,aerolw,aerodp,ext550,errflg,errmsg &
2470 if ( iaerflg == 100 )
then
2474 laddsw = lsswr .and. laswflg
2475 laddlw = lslwr .and. lalwflg
2478 i1 = mod(kyrsav, 10) + 1
2483 if ( alat(i) > 46.0 )
then
2484 volcae(i) = 1.0e-4 * ivolae(kmonsav,1,i1)
2485 else if ( alat(i) > 44.0 )
then
2486 volcae(i) = 5.0e-5 &
2487 & * (ivolae(kmonsav,1,i1) + ivolae(kmonsav,2,i1))
2488 else if ( alat(i) > 1.0 )
then
2489 volcae(i) = 1.0e-4 * ivolae(kmonsav,2,i1)
2490 else if ( alat(i) > -1.0 )
then
2491 volcae(i) = 5.0e-5 &
2492 & * (ivolae(kmonsav,2,i1) + ivolae(kmonsav,3,i1))
2493 else if ( alat(i) >-44.0 )
then
2494 volcae(i) = 1.0e-4 * ivolae(kmonsav,3,i1)
2495 else if ( alat(i) >-46.0 )
then
2496 volcae(i) = 5.0e-5 &
2497 & * (ivolae(kmonsav,3,i1) + ivolae(kmonsav,4,i1))
2499 volcae(i) = 1.0e-4 * ivolae(kmonsav,4,i1)
2509 tmp1 = abs( alat(i) )
2510 if ( tmp1 > 70.0 )
then
2512 elseif ( tmp1 < 20.0 )
then
2515 psrfl = 110.0 + 2.0*tmp1
2520 rdelp(i) = f_one / prsi(i,2)
2522 lab_do_kcuth0 :
do k = 2, nlay-2
2523 if ( prsi(i,k) >= psrfh )
then
2529 lab_do_kcutl0 :
do k = 2, nlay-2
2530 if ( prsi(i,k) >= psrfl )
then
2532 rdelp(i) = f_one / (prsi(i,k) - prsi(i,kcuth(i)))
2544 if ( wvn_sw1(mb) > 20000 )
then
2546 elseif ( wvn_sw2(mb) < 20000 )
then
2551 tmp1 = (0.275e-4 * (wvn_sw2(mb)+wvn_sw1(mb))) ** tmp2
2557 tmp2 = tmp1 * ((prsi(i,k+1) - prsi(i,k)) * rdelp(i))
2558 aerosw(i,k,m,1) = aerosw(i,k,m,1) + tmp2*volcae(i)
2563 if ( aerosw(i,kl,m,1) > 10.*aerosw(i,kl+1,m,1) )
then
2564 tmp2 = aerosw(i,kl,m,1) + aerosw(i,kl+1,m,1)
2565 aerosw(i,kl ,m,1) = 0.8 * tmp2
2566 aerosw(i,kl+1,m,1) = 0.2 * tmp2
2588 if ( nlwbnd == 1 )
then
2590 tmp1 = (0.55 / 11.0) ** 1.2
2595 tmp2 = tmp1 * ((prsi(i,k+1) - prsi(i,k)) * rdelp(i)) &
2598 aerolw(i,k,m,1) = aerolw(i,k,m,1) + tmp2
2606 tmp1 = (0.275e-4 * (wvn_lw2(m) + wvn_lw1(m))) ** 1.2
2612 tmp2 = tmp1 * ((prsi(i,k+1)-prsi(i,k)) * rdelp(i))
2613 aerolw(i,k,m,1) = aerolw(i,k,m,1) + tmp2*volcae(i)
2627 tmp1 = abs( alat(i) )
2628 if ( tmp1 > 70.0 )
then
2630 elseif ( tmp1 < 20.0 )
then
2633 psrfl = 110.0 + 2.0*tmp1
2638 rdelp(i) = f_one / prsi(i,nlay-1)
2640 lab_do_kcuth1 :
do k = nlay-1, 2, -1
2641 if ( prsi(i,k) >= psrfh )
then
2647 lab_do_kcutl1 :
do k = nlay, 2, -1
2648 if ( prsi(i,k) >= psrfl )
then
2650 rdelp(i) = f_one / (prsi(i,k) - prsi(i,kcuth(i)+1))
2662 if ( wvn_sw1(mb) > 20000 )
then
2664 elseif ( wvn_sw2(mb) < 20000 )
then
2669 tmp1 = (0.275e-4 * (wvn_sw2(mb)+wvn_sw1(mb))) ** tmp2
2675 tmp2 = tmp1 * ((prsi(i,k) - prsi(i,k+1)) * rdelp(i))
2676 aerosw(i,k,m,1) = aerosw(i,k,m,1) + tmp2*volcae(i)
2681 if ( aerosw(i,kl,m,1) > 10.*aerosw(i,kl-1,m,1) )
then
2682 tmp2 = aerosw(i,kl,m,1) + aerosw(i,kl-1,m,1)
2683 aerosw(i,kl ,m,1) = 0.8 * tmp2
2684 aerosw(i,kl-1,m,1) = 0.2 * tmp2
2705 if ( nlwbnd == 1 )
then
2707 tmp1 = (0.55 / 11.0) ** 1.2
2712 tmp2 = tmp1 * ((prsi(i,k) - prsi(i,k+1)) * rdelp(i)) &
2715 aerolw(i,k,m,1) = aerolw(i,k,m,1) + tmp2
2723 tmp1 = (0.275e-4 * (wvn_lw2(m) + wvn_lw1(m))) ** 1.2
2729 tmp2 = tmp1 * ((prsi(i,k)-prsi(i,k+1)) * rdelp(i))
2730 aerolw(i,k,m,1) = aerolw(i,k,m,1) + tmp2*volcae(i)
2775 subroutine aer_property &
2776 & ( prsi,prsl,prslk,tvly,rhlay,dz,hz,tracer, &
2777 & alon,alat,slmsk, laersw,laerlw, &
2778 & imax,nlay,nlp1,top_at_1, &
2779 & aerosw,aerolw,aerodp,errflg,errmsg &
2843 integer,
intent(in) :: IMAX, NLAY, NLP1
2845 logical,
intent(in) :: laersw, laerlw, top_at_1
2847 real (kind=kind_phys),
dimension(:,:),
intent(in) :: prsi, prsl, &
2848 & prslk, tvly, rhlay, dz, hz
2849 real (kind=kind_phys),
dimension(:),
intent(in) :: alon, alat, &
2851 real (kind=kind_phys),
dimension(:,:,:),
intent(in):: tracer
2854 real (kind=kind_phys),
dimension(:,:,:,:),
intent(out) :: &
2856 real (kind=kind_phys),
dimension(:,:) ,
intent(out) :: aerodp
2857 integer,
intent(out) :: errflg
2858 character(len=*),
intent(out) :: errmsg
2861 real (kind=kind_phys),
dimension(NCM) :: cmix
2862 real (kind=kind_phys),
dimension( 2) :: denn
2863 real (kind=kind_phys),
dimension(NSPC) :: spcodp
2865 real (kind=kind_phys),
dimension(NLAY) :: delz, rh1, dz1
2866 integer,
dimension(NLAY) :: idmaer
2868 real (kind=kind_phys),
dimension(NLAY,NSWLWBD):: tauae,ssaae,asyae
2871 real (kind=kind_phys) :: tmp1, tmp2, rps, dtmp, h1
2872 real (kind=kind_phys) :: wi, wj, w11, w12, w21, w22
2874 integer :: i, ii, i1, i2, i3, j1, j2, j3, k, m, m1, &
2878 real (kind=kind_phys),
parameter :: dltg = 360.0 / float(imxae)
2879 real (kind=kind_phys),
parameter :: hdlt = 0.5 * dltg
2880 real (kind=kind_phys),
parameter :: rdlt = 1.0 / dltg
2899 lab_do_imax :
do i = 1, imax
2905 lab_do_imxae :
do while ( i3 <= imxae )
2906 tmp1 = dltg * (i3 - 1)
2907 dtmp = alon(i) - tmp1
2910 if ( dtmp > dltg )
then
2912 if ( i3 > imxae )
then
2913 print *,
' ERROR! In setclimaer alon>360. ipt =',i, &
2914 &
', dltg,alon,tlon,dlon =',dltg,alon(i),tmp1,dtmp
2916 errmsg =
'ERROR(aer_property)'
2919 elseif ( dtmp >= f_zero )
then
2921 i2 = mod(i3,imxae) + 1
2923 if ( dtmp <= hdlt )
then
2933 print *,
' ERROR! In setclimaer alon< 0. ipt =',i, &
2934 &
', dltg,alon,tlon,dlon =',dltg,alon(i),tmp1,dtmp
2936 errmsg =
'ERROR(aer_property)'
2946 lab_do_jmxae :
do while ( j3 <= jmxae )
2947 tmp2 = 90.0 - dltg * (j3 - 1)
2948 dtmp = tmp2 - alat(i)
2951 if ( dtmp > dltg )
then
2953 if ( j3 >= jmxae )
then
2954 print *,
' ERROR! In setclimaer alat<-90. ipt =',i, &
2955 &
', dltg,alat,tlat,dlat =',dltg,alat(i),tmp2,dtmp
2957 errmsg =
'ERROR(aer_property)'
2960 elseif ( dtmp >= f_zero )
then
2964 if ( dtmp <= hdlt )
then
2974 print *,
' ERROR! In setclimaer alat>90. ipt =',i, &
2975 &
', dltg,alat,tlat,dlat =',dltg,alat(i),tmp2,dtmp
2977 errmsg =
'ERROR(aer_property)'
2987 kpa = max( kprfg(i1,j1),kprfg(i1,j2),kprfg(i2,j1),kprfg(i2,j2) )
2992 if ( kp /= kpa )
then
2993 if ( kpa == 6 )
then
2995 if ( slmsk(i) > f_zero )
then
2997 h1 = 0.5*(haer(1,6) + haer(1,7))
3002 elseif ( kpa == 7 )
then
3004 if ( slmsk(i) <= f_zero )
then
3006 h1 = 0.5*(haer(1,6) + haer(1,7))
3020 w11 = (f_one-wi) * (f_one-wj)
3021 w12 = (f_one-wi) * wj
3022 w21 = wi * (f_one-wj)
3037 denn(m) = w11*denng(m,i1,j1) + w12*denng(m,i1,j2) &
3038 & + w21*denng(m,i2,j1) + w22*denng(m,i2,j2)
3047 cmix(ii) = cmix(ii) + w11*cmixg(m,i1,j1)
3051 cmix(ii) = cmix(ii) + w12*cmixg(m,i1,j2)
3055 cmix(ii) = cmix(ii) + w21*cmixg(m,i2,j1)
3059 cmix(ii) = cmix(ii) + w22*cmixg(m,i2,j2)
3075 lab_if_flip :
if (.not. top_at_1)
then
3077 if ( prsi(i,1) > 100.0 )
then
3078 rps = f_one / prsi(i,1)
3080 print *,
' !!! (1) Error in subr radiation_aerosols:', &
3081 &
' unrealistic surface pressure =', i,prsi(i,1)
3083 errmsg =
'ERROR(aer_property): Unrealistic surface pressure'
3089 if (prsi(i,k+1)*rps < sigref(ii,kp))
then
3091 if (ii == 2 .and. prsref(2,kp) == prsref(3,kp))
then
3103 if (tmp1 > f_zero)
then
3105 delz(k) = tmp1 * (exp(-hz(i,k)*tmp2)-exp(-hz(i,k+1)*tmp2))
3113 if ( prsi(i,nlp1) > 100.0 )
then
3114 rps = 1.0 / prsi(i,nlp1)
3116 print *,
' !!! (2) Error in subr radiation_aerosols:', &
3117 &
' unrealistic surface pressure =', i,prsi(i,nlp1)
3122 if (prsi(i,k)*rps < sigref(ii,kp))
then
3124 if (ii == 2 .and. prsref(2,kp) == prsref(3,kp))
then
3136 if (tmp1 > f_zero)
then
3138 delz(k) = tmp1 * (exp(-hz(i,k+1)*tmp2)-exp(-hz(i,k)*tmp2))
3157 call radclimaer(top_at_1)
3165 aerosw(i,k,m,1) = tauae(k,m)
3166 aerosw(i,k,m,2) = ssaae(k,m)
3167 aerosw(i,k,m,3) = asyae(k,m)
3173 aerodp(i,1) = aerodp(i,1) + tauae(k,nv_aod)
3178 aerodp(i,m+1) = spcodp(m)
3185 if ( nlwbnd == 1 )
then
3189 aerolw(i,k,m,1) = tauae(k,m1)
3190 aerolw(i,k,m,2) = ssaae(k,m1)
3191 aerolw(i,k,m,3) = asyae(k,m1)
3198 aerolw(i,k,m,1) = tauae(k,m1)
3199 aerolw(i,k,m,2) = ssaae(k,m1)
3200 aerolw(i,k,m,3) = asyae(k,m1)
3218 subroutine radclimaer(top_at_1)
3250 real (kind=kind_phys) :: crt1, crt2
3251 parameter(crt1=30.0, crt2=0.03333)
3254 logical,
intent(in) :: top_at_1
3258 real (kind=kind_phys) :: cm, hd, hdi, sig0u, sig0l, ratio, tt0, &
3259 & ex00, sc00, ss00, as00, ex01, sc01, ss01, as01, tt1, &
3260 & ex02, sc02, ss02, as02, ex03, sc03, ss03, as03, tt2, &
3261 & ext1, sca1, ssa1, asy1, drh0, drh1, rdrh
3263 integer :: ih1, ih2, kk, idom, icmp, ib, ii, ic, ic1
3272 lab_do_layer :
do kk = 1, nlay
3277 do while ( rh1(kk) > rhlev(ih2) )
3279 if ( ih2 > nrhlev )
exit
3281 ih1 = max( 1, ih2-1 )
3282 ih2 = min( nrhlev, ih2 )
3284 drh0 = rhlev(ih2) - rhlev(ih1)
3285 drh1 = rh1(kk) - rhlev(ih1)
3286 if ( ih1 == ih2 )
then
3296 lab_if_idom :
if (idom == 5)
then
3300 tauae(kk,ib) = f_zero
3301 if ( ib <= nswbnd )
then
3303 asyae(kk,ib) = 0.696
3310 elseif (idom == 4)
then lab_if_idom
3314 tauae(kk,ib) = extstra(ib) * delz(kk)
3315 if ( ib <= nswbnd )
then
3317 asyae(kk,ib) = 0.696
3326 spcodp(idx) = spcodp(idx) + tauae(kk,nv_aod)
3328 elseif (idom == 3)
then lab_if_idom
3343 ex03 = extrhd(ih1,1,ib) &
3344 & + rdrh * (extrhd(ih2,1,ib) - extrhd(ih1,1,ib))
3345 sc03 = scarhd(ih1,1,ib) &
3346 & + rdrh * (scarhd(ih2,1,ib) - scarhd(ih1,1,ib))
3347 ss03 = ssarhd(ih1,1,ib) &
3348 & + rdrh * (ssarhd(ih2,1,ib) - ssarhd(ih1,1,ib))
3349 as03 = asyrhd(ih1,1,ib) &
3350 & + rdrh * (asyrhd(ih2,1,ib) - asyrhd(ih1,1,ib))
3352 ext1 = 0.17e-3*ex01 + 0.4*ex02 + 0.59983*ex03
3353 sca1 = 0.17e-3*sc01 + 0.4*sc02 + 0.59983*sc03
3354 ssa1 = 0.17e-3*ss01*ex01 + 0.4*ss02*ex02 + 0.59983*ss03*ex03
3355 asy1 = 0.17e-3*as01*sc01 + 0.4*as02*sc02 + 0.59983*as03*sc03
3357 tauae(kk,ib) = ext1 * 730.0 * delz(kk)
3358 ssaae(kk,ib) = min(f_one, ssa1/ext1)
3359 asyae(kk,ib) = min(f_one, asy1/sca1)
3362 if ( ib==nv_aod )
then
3363 spcodp(1) = spcodp(1) + 0.17e-3*ex01*730.0*delz(kk)
3364 spcodp(2) = spcodp(2) + 0.4 *ex02*730.0*delz(kk)
3365 spcodp(3) = spcodp(3) + 0.59983*ex03*730.0*delz(kk)
3370 elseif (idom == 1)
then lab_if_idom
3373 lab_do_ib :
do ib = 1, nswlwbd
3379 lab_do_icmp :
do icmp = 1, ncm
3384 lab_if_cm :
if ( cm > f_zero )
then
3386 lab_if_ic :
if ( ic <= ncm1 )
then
3387 tt0 = cm * extrhi(ic,ib)
3389 sca1 = sca1 + cm * scarhi(ic,ib)
3390 ssa1 = ssa1 + cm * ssarhi(ic,ib) * extrhi(ic,ib)
3391 asy1 = asy1 + cm * asyrhi(ic,ib) * scarhi(ic,ib)
3395 ex00 = extrhd(ih1,ic1,ib) &
3396 & + rdrh * (extrhd(ih2,ic1,ib) - extrhd(ih1,ic1,ib))
3397 sc00 = scarhd(ih1,ic1,ib) &
3398 & + rdrh * (scarhd(ih2,ic1,ib) - scarhd(ih1,ic1,ib))
3399 ss00 = ssarhd(ih1,ic1,ib) &
3400 & + rdrh * (ssarhd(ih2,ic1,ib) - ssarhd(ih1,ic1,ib))
3401 as00 = asyrhd(ih1,ic1,ib) &
3402 & + rdrh * (asyrhd(ih2,ic1,ib) - asyrhd(ih1,ic1,ib))
3406 sca1 = sca1 + cm * sc00
3407 ssa1 = ssa1 + cm * ss00 * ex00
3408 asy1 = asy1 + cm * as00 * sc00
3412 if ( ib==nv_aod )
then
3413 spcodp(idx) = spcodp(idx) + tt0*denn(1)*delz(kk)
3419 tauae(kk,ib) = ext1 * denn(1) * delz(kk)
3420 ssaae(kk,ib) = min(f_one, ssa1/ext1)
3421 asyae(kk,ib) = min(f_one, asy1/sca1)
3424 elseif (idom == 2)
then lab_if_idom
3428 tauae(kk,ib) = extrhi(6,ib) * denn(2) * delz(kk)
3429 ssaae(kk,ib) = ssarhi(6,ib)
3430 asyae(kk,ib) = asyrhi(6,ib)
3434 spcodp(1) = spcodp(1) + tauae(kk,nv_aod)
3440 tauae(kk,ib) = f_zero
3441 ssaae(kk,ib) = f_one
3442 asyae(kk,ib) = f_zero
3461 if ( tauae(kk,ib) > f_zero )
then
3462 ratio = tauae(kk-1,ib) / tauae(kk,ib)
3467 tt0 = tauae(kk,ib) + tauae(kk-1,ib)
3471 if ( ratio > crt1 )
then
3473 tauae(kk-1,ib) = tt2
3476 if ( ratio < crt2 )
then
3478 tauae(kk-1,ib) = tt1
3486 do kk = nlay-1, 1, -1
3487 if ( tauae(kk,ib) > f_zero )
then
3488 ratio = tauae(kk+1,ib) / tauae(kk,ib)
3493 tt0 = tauae(kk,ib) + tauae(kk+1,ib)
3497 if ( ratio > crt1 )
then
3499 tauae(kk+1,ib) = tt2
3502 if ( ratio < crt2 )
then
3504 tauae(kk+1,ib) = tt1
3514 end subroutine radclimaer
3531 subroutine gocart_aerinit &
3532 & ( solfwv, eirfwv, me, &
3570 real (kind=kind_phys),
dimension(:) :: solfwv
3571 real (kind=kind_phys),
dimension(:) :: eirfwv
3573 integer,
intent(in) :: me
3576 integer,
intent(out) :: errflg
3577 character(len=*),
intent(out) :: errmsg
3580 real (kind=kind_phys),
dimension(kaerbndi,kcm1) :: &
3581 & rhidext0_grt, rhidsca0_grt, rhidssa0_grt, rhidasy0_grt
3582 real (kind=kind_phys),
dimension(kaerbndd,krhlev,kcm2):: &
3583 & rhdpext0_grt, rhdpsca0_grt, rhdpssa0_grt, rhdpasy0_grt
3585 real (kind=kind_phys),
dimension(nswbnd,kaerbndd) :: solwaer
3586 real (kind=kind_phys),
dimension(nswbnd) :: solbnd
3587 real (kind=kind_phys),
dimension(nlwbnd,kaerbndd) :: eirwaer
3588 real (kind=kind_phys),
dimension(nlwbnd) :: eirbnd
3590 real (kind=kind_phys),
dimension(nswbnd,kaerbndi) :: solwaer_du
3591 real (kind=kind_phys),
dimension(nswbnd) :: solbnd_du
3592 real (kind=kind_phys),
dimension(nlwbnd,kaerbndi) :: eirwaer_du
3593 real (kind=kind_phys),
dimension(nlwbnd) :: eirbnd_du
3595 integer,
dimension(nswbnd) :: nv1, nv2, nv1_du, nv2_du
3596 integer,
dimension(nlwbnd) :: nr1, nr2, nr1_du, nr2_du
3598 integer,
dimension(kaerbndd) :: iendwv
3599 integer,
dimension(kaerbndi) :: iendwv_du
3600 real (kind=kind_phys),
dimension(kaerbndd) :: wavelength
3601 real (kind=kind_phys),
dimension(kaerbndi) :: wavelength_du
3602 real (kind=kind_phys) :: sumsol, sumir, sumsol_du, sumir_du
3604 integer :: i, j, k, mb, ib, ii, iix, iw, iw1, iw2
3617 if (kcm /= ntrcaerm )
then
3618 print *,
'ERROR in # of gocart aer species',kcm
3620 errmsg =
'ERROR(gocart_init): Incorrect # of species'
3626 if ( .not.
allocated( extrhi_grt ) )
then
3627 allocate ( extrhi_grt( kcm1,nswlwbd) )
3628 allocate ( extrhi_grt_550( kcm1,1) )
3629 allocate ( scarhi_grt( kcm1,nswlwbd) )
3630 allocate ( ssarhi_grt( kcm1,nswlwbd) )
3631 allocate ( asyrhi_grt( kcm1,nswlwbd) )
3632 allocate ( extrhd_grt(krhlev,kcm2,nswlwbd) )
3633 allocate ( extrhd_grt_550(krhlev,kcm2,1) )
3634 allocate ( scarhd_grt(krhlev,kcm2,nswlwbd) )
3635 allocate ( ssarhd_grt(krhlev,kcm2,nswlwbd) )
3636 allocate ( asyrhd_grt(krhlev,kcm2,nswlwbd) )
3649 iendwv(i) = int(10000. / wavelength(i))
3653 iendwv_du(i) = int(10000. / wavelength_du(i))
3661 solbnd_du(:)= f_zero
3664 solwaer(i,j) = f_zero
3667 solwaer_du(i,j) = f_zero
3672 mb = ib + nswstr - 1
3675 iw1 = nint(wvnsw1(mb))
3676 iw2 = nint(wvnsw2(mb))
3678 if ( wvnsw2(mb)>=wvn550 .and. wvn550>=wvnsw1(mb) )
then
3683 do while ( iw1 > iendwv(ii) )
3684 if ( ii == kaerbndd )
exit
3691 do while ( iw1 > iendwv_du(iix) )
3692 if ( iix == kaerbndi )
exit
3700 solbnd(ib) = solbnd(ib) + solfwv(iw)
3701 sumsol = sumsol + solfwv(iw)
3703 if ( iw == iendwv(ii) )
then
3704 solwaer(ib,ii) = sumsol
3705 if ( ii < kaerbndd )
then
3712 solbnd_du(ib) = solbnd_du(ib) + solfwv(iw)
3713 sumsol_du = sumsol_du + solfwv(iw)
3715 if ( iw == iendwv_du(iix) )
then
3716 solwaer_du(ib,iix) = sumsol_du
3717 if ( iix < kaerbndi )
then
3724 if ( iw2 /= iendwv(ii) )
then
3725 solwaer(ib,ii) = sumsol
3727 if ( iw2 /= iendwv_du(iix) )
then
3728 solwaer_du(ib,iix) = sumsol_du
3741 eirbnd_du(:) = f_zero
3744 eirwaer(i,j) = f_zero
3747 eirwaer_du(i,j) = f_zero
3754 if ( nlwbnd == 1 )
then
3758 mb = ib + nlwstr - 1
3759 iw1 = nint(wvnlw1(mb))
3760 iw2 = nint(wvnlw2(mb))
3764 do while ( iw1 > iendwv(ii) )
3765 if ( ii == kaerbndd )
exit
3772 do while ( iw1 > iendwv_du(iix) )
3773 if ( iix == kaerbndi )
exit
3781 eirbnd(ib) = eirbnd(ib) + eirfwv(iw)
3782 sumir = sumir + eirfwv(iw)
3784 if ( iw == iendwv(ii) )
then
3785 eirwaer(ib,ii) = sumir
3787 if ( ii < kaerbndd )
then
3794 eirbnd_du(ib) = eirbnd_du(ib) + eirfwv(iw)
3795 sumir_du = sumir_du + eirfwv(iw)
3797 if ( iw == iendwv_du(iix) )
then
3798 eirwaer_du(ib,iix) = sumir_du
3800 if ( iix < kaerbndi )
then
3807 if ( iw2 /= iendwv(ii) )
then
3808 eirwaer(ib,ii) = sumir
3810 if ( iw2 /= iendwv_du(iix) )
then
3811 eirwaer_du(ib,iix) = sumir_du
3876 subroutine rd_gocart_luts
3915 integer :: iradius, ik, ibeg
3916 integer,
parameter :: numspc = 5
3919 real,
dimension(kaerbndd) :: lambda
3920 real,
dimension(kaerbndi) :: lambda_du
3921 real,
dimension(krhlev) :: rh
3922 real,
dimension(kaerbndd,krhlev,numspc) :: bext
3923 real,
dimension(kaerbndd,krhlev,numspc) :: bsca
3924 real,
dimension(kaerbndd,krhlev,numspc) :: g
3925 real,
dimension(kaerbndi,krhlev,numspc) :: bext_du
3926 real,
dimension(kaerbndi,krhlev,numspc) :: bsca_du
3927 real,
dimension(kaerbndi,krhlev,numspc) :: g_du
3929 logical :: file_exist
3930 character*50 :: fin, dummy
3933 fin=
'optics_'//gridcomp(1)//
'.dat'
3934 inquire (file=trim(fin), exist=file_exist)
3935 if ( file_exist )
then
3937 open (unit=niaercm, file=fin, status=
'OLD')
3940 print *,
' Requested luts file ',trim(fin),
' not found'
3941 print *,
' ** Stopped in rd_gocart_luts ** '
3943 errmsg =
'Requested luts file '//trim(fin)//
' not found'
3949 read(niaercm,
'(a40)') dummy
3950 read(niaercm,*) (lambda_du(i), i=1, kaerbndi)
3952 read(niaercm,
'(a40)') dummy
3953 read(niaercm,*) (rh(i), i=1, krhlev)
3956 read(niaercm,
'(a40)') dummy
3958 read(niaercm,*) (bext_du(i,j,k), i=1,kaerbndi)
3963 read(niaercm,
'(a40)') dummy
3965 read(niaercm,*) (bsca_du(i,j,k), i=1, kaerbndi)
3970 read(niaercm,
'(a40)') dummy
3972 read(niaercm,*) (g_du(i,j,k), i=1, kaerbndi)
3979 wavelength_du(j) = 1.e6 * lambda_du(i)
3980 if (int(wavelength_du(j)*100) == 55)
then
3986 ii = kaerbndi -i + 1
3987 rhidext0_grt(ii,k) = bext_du(i,1,k)
3988 rhidsca0_grt(ii,k) = bsca_du(i,1,k)
3989 if ( bext_du(i,1,k) /= f_zero)
then
3990 rhidssa0_grt(ii,k) = bsca_du(i,1,k)/bext_du(i,1,k)
3992 rhidssa0_grt(ii,k) = f_one
3994 rhidasy0_grt(ii,k) = g_du(i,1,k)
4000 fin=
'optics_'//gridcomp(ib)//
'.dat'
4001 inquire (file=trim(fin), exist=file_exist)
4002 if ( file_exist )
then
4004 open (unit=niaercm, file=fin, status=
'OLD')
4007 print *,
' Requested luts file ',trim(fin),
' not found'
4008 print *,
' ** Stopped in rd_gocart_luts ** '
4010 errmsg =
'Requested luts file '//trim(fin)//
' not found'
4014 ibeg = radius_lower(ib) - kcm1
4015 iradius = num_radius(ib)
4018 read(niaercm,
'(a40)') dummy
4019 read(niaercm,*) (lambda(i), i=1, kaerbndd)
4021 read(niaercm,
'(a40)') dummy
4022 read(niaercm,*) (rh(i), i=1, krhlev)
4025 read(niaercm,
'(a40)') dummy
4027 read(niaercm,*) (bext(i,j,k), i=1,kaerbndd)
4032 read(niaercm,
'(a40)') dummy
4034 read(niaercm,*) (bsca(i,j,k), i=1, kaerbndd)
4039 read(niaercm,
'(a40)') dummy
4041 read(niaercm,*) (g(i,j,k), i=1, kaerbndd)
4048 wavelength(j) = 1.e6 * lambda(i)
4049 if (int(wavelength(j)*100) == 55)
then
4056 ii = kaerbndd -i + 1
4058 rhdpext0_grt(ii,j,ik) = bext(i,j,k)
4059 rhdpsca0_grt(ii,j,ik) = bsca(i,j,k)
4060 if ( bext(i,j,k) /= f_zero)
then
4061 rhdpssa0_grt(ii,j,ik) = bsca(i,j,k)/bext(i,j,k)
4063 rhdpssa0_grt(ii,j,ik) = f_one
4065 rhdpasy0_grt(ii,j,ik) = g(i,j,k)
4074 end subroutine rd_gocart_luts
4082 subroutine optavg_gocart
4138 real (kind=kind_phys) :: sumk, sums, sumok, sumokg, sumreft, &
4139 & sp, refb, reft, rsolbd, rirbd
4141 integer :: ib, nb, ni, nh, nc
4149 rsolbd = f_one / solbnd_du(nb)
4157 do ni = nv1_du(nb), nv2_du(nb)
4158 sp = sqrt( (f_one - rhidssa0_grt(ni,nc)) &
4159 & / (f_one - rhidssa0_grt(ni,nc)*rhidasy0_grt(ni,nc)) )
4160 reft = (f_one - sp) / (f_one + sp)
4161 sumreft = sumreft + reft*solwaer_du(nb,ni)
4163 sumk = sumk + rhidext0_grt(ni,nc)*solwaer_du(nb,ni)
4164 sums = sums + rhidsca0_grt(ni,nc)*solwaer_du(nb,ni)
4165 sumok = sumok + rhidssa0_grt(ni,nc)*solwaer_du(nb,ni) &
4166 & * rhidext0_grt(ni,nc)
4167 sumokg = sumokg + rhidssa0_grt(ni,nc)*solwaer_du(nb,ni) &
4168 & * rhidext0_grt(ni,nc)*rhidasy0_grt(ni,nc)
4171 refb = sumreft * rsolbd
4173 extrhi_grt(nc,nb) = sumk * rsolbd
4174 if (nb==nv_aod)
then
4175 extrhi_grt_550(nc,1) = rhidext0_grt(id550,nc)
4177 scarhi_grt(nc,nb) = sums * rsolbd
4178 asyrhi_grt(nc,nb) = sumokg / (sumok + 1.0e-10)
4179 ssarhi_grt(nc,nb) = 4.0*refb &
4180 & / ( (f_one+refb)**2 - asyrhi_grt(nc,nb)*(f_one-refb)**2 )
4183 rsolbd = f_one / solbnd(nb)
4192 do ni = nv1(nb), nv2(nb)
4193 sp = sqrt( (f_one - rhdpssa0_grt(ni,nh,nc)) &
4194 & /(f_one-rhdpssa0_grt(ni,nh,nc)*rhdpasy0_grt(ni,nh,nc)))
4195 reft = (f_one - sp) / (f_one + sp)
4196 sumreft = sumreft + reft*solwaer(nb,ni)
4198 sumk = sumk + rhdpext0_grt(ni,nh,nc)*solwaer(nb,ni)
4199 sums = sums + rhdpsca0_grt(ni,nh,nc)*solwaer(nb,ni)
4200 sumok = sumok + rhdpssa0_grt(ni,nh,nc)*solwaer(nb,ni) &
4201 & * rhdpext0_grt(ni,nh,nc)
4202 sumokg = sumokg + rhdpssa0_grt(ni,nh,nc)*solwaer(nb,ni)&
4203 & * rhdpext0_grt(ni,nh,nc)*rhdpasy0_grt(ni,nh,nc)
4206 refb = sumreft * rsolbd
4208 extrhd_grt(nh,nc,nb) = sumk * rsolbd
4209 if (nb==nv_aod)
then
4210 extrhd_grt_550(nh,nc,1) = rhdpext0_grt(i550,nh,nc)
4212 scarhd_grt(nh,nc,nb) = sums * rsolbd
4213 asyrhd_grt(nh,nc,nb) = sumokg / (sumok + 1.0e-10)
4214 ssarhd_grt(nh,nc,nb) = 4.0*refb &
4215 & /((f_one+refb)**2 - asyrhd_grt(nh,nc,nb)*(f_one-refb)**2)
4231 rirbd = f_one / eirbnd_du(nb)
4239 do ni = nr1_du(nb), nr2_du(nb)
4240 sp = sqrt( (f_one - rhidssa0_grt(ni,nc)) &
4241 & / (f_one - rhidssa0_grt(ni,nc)*rhidasy0_grt(ni,nc)) )
4242 reft = (f_one - sp) / (f_one + sp)
4243 sumreft = sumreft + reft*eirwaer_du(nb,ni)
4245 sumk = sumk + rhidext0_grt(ni,nc)*eirwaer_du(nb,ni)
4246 sums = sums + rhidsca0_grt(ni,nc)*eirwaer_du(nb,ni)
4247 sumok = sumok + rhidssa0_grt(ni,nc)*eirwaer_du(nb,ni) &
4248 & * rhidext0_grt(ni,nc)
4249 sumokg = sumokg + rhidssa0_grt(ni,nc)*eirwaer_du(nb,ni) &
4250 & * rhidext0_grt(ni,nc)*rhidasy0_grt(ni,nc)
4253 refb = sumreft * rirbd
4255 extrhi_grt(nc,ib) = sumk * rirbd
4256 scarhi_grt(nc,ib) = sums * rirbd
4257 asyrhi_grt(nc,ib) = sumokg / (sumok + 1.0e-10)
4258 ssarhi_grt(nc,ib) = 4.0*refb &
4259 & / ( (f_one+refb)**2 - asyrhi_grt(nc,ib)*(f_one-refb)**2 )
4263 rirbd = f_one / eirbnd(nb)
4272 do ni = nr1(nb), nr2(nb)
4273 sp = sqrt( (f_one - rhdpssa0_grt(ni,nh,nc)) &
4274 & /(f_one-rhdpssa0_grt(ni,nh,nc)*rhdpasy0_grt(ni,nh,nc)))
4275 reft = (f_one - sp) / (f_one + sp)
4276 sumreft = sumreft + reft*eirwaer(nb,ni)
4278 sumk = sumk + rhdpext0_grt(ni,nh,nc)*eirwaer(nb,ni)
4279 sums = sums + rhdpsca0_grt(ni,nh,nc)*eirwaer(nb,ni)
4280 sumok = sumok + rhdpssa0_grt(ni,nh,nc)*eirwaer(nb,ni) &
4281 & * rhdpext0_grt(ni,nh,nc)
4282 sumokg = sumokg+ rhdpssa0_grt(ni,nh,nc)*eirwaer(nb,ni) &
4283 & * rhdpext0_grt(ni,nh,nc)*rhdpasy0_grt(ni,nh,nc)
4286 refb = sumreft * rirbd
4288 extrhd_grt(nh,nc,ib) = sumk * rirbd
4289 scarhd_grt(nh,nc,ib) = sums * rirbd
4290 asyrhd_grt(nh,nc,ib) = sumokg / (sumok + 1.0e-10)
4291 ssarhd_grt(nh,nc,ib) = 4.0*refb &
4292 & /((f_one+refb)**2 - asyrhd_grt(nh,nc,ib)*(f_one-refb)**2)
4302 end subroutine optavg_gocart
4337 subroutine aer_property_gocart &
4341 & ( prsi,prsl,prslk,tvly,rhlay,dz,hz,tracer,aerfld, &
4342 & alon,alat,slmsk, laersw,laerlw,con_rd, &
4345 & aerosw,aerolw,aerodp,ext550,errflg,errmsg &
4398 integer,
intent(in) :: IMAX, NLAY, NLP1
4399 logical,
intent(in) :: laersw, laerlw
4400 real (kind=kind_phys),
intent(in) :: con_rd
4401 real (kind=kind_phys),
dimension(:,:),
intent(in) :: prsi, prsl, &
4402 & prslk, tvly, rhlay, dz, hz
4403 real (kind=kind_phys),
dimension(:),
intent(in) :: alon, alat, &
4405 real (kind=kind_phys),
dimension(:,:,:),
intent(in):: tracer
4406 real (kind=kind_phys),
dimension(:,:,:),
intent(in):: aerfld
4409 real (kind=kind_phys),
dimension(:,:,:,:),
intent(out) :: &
4411 real (kind=kind_phys),
dimension(:,:) ,
intent(out) :: aerodp
4412 real (kind=kind_phys),
dimension(:,:) ,
intent(out) :: ext550
4413 integer,
intent(out) :: errflg
4414 character(len=*),
intent(out) :: errmsg
4417 real (kind=kind_phys),
dimension(nlay,nswlwbd):: tauae,ssaae,asyae
4418 real (kind=kind_phys),
dimension(nlay,1):: tauae_550
4419 real (kind=kind_phys),
dimension(nlay,nspc) :: spcodp
4421 real (kind=kind_phys),
dimension(nlay,kcm) :: aerms
4422 real (kind=kind_phys),
dimension(nlay) :: dz1, rh1
4423 real (kind=kind_phys) :: plv, tv, rho
4424 integer :: i, m, m1, k
4434 lab_do_imaxg :
do i = 1, imax
4441 tauae_550(k,1) = f_zero
4457 spcodp(k,m) = f_zero
4463 dz1(k) = 1000.*dz(i,k)
4464 plv = 100.*prsl(i,k)
4466 rho = plv / ( con_rd * tv)
4469 aerms(k,m) = aerfld(i,k,m)*rho
4488 aerosw(i,k,m,1) = tauae(k,m)
4489 aerosw(i,k,m,2) = ssaae(k,m)
4490 aerosw(i,k,m,3) = asyae(k,m)
4496 aerodp(i,1) = aerodp(i,1) + tauae_550(k,1)
4497 ext550(i,k) = tauae_550(k,1)
4499 aerodp(i,m+1) = aerodp(i,m+1)+spcodp(k,m)
4507 if ( nlwbnd == 1 )
then
4511 aerolw(i,k,m,1) = tauae(k,m1)
4512 aerolw(i,k,m,2) = ssaae(k,m1)
4513 aerolw(i,k,m,3) = asyae(k,m1)
4520 aerolw(i,k,m,1) = tauae(k,m1)
4521 aerolw(i,k,m,2) = ssaae(k,m1)
4522 aerolw(i,k,m,3) = asyae(k,m1)
4567 real (kind=kind_phys) :: drh0, drh1, rdrh
4568 real (kind=kind_phys) :: cm, ext01, ext01_550, sca01,asy01,ssa01
4569 real (kind=kind_phys) :: ext1, ext1_550, asy1, ssa1,sca1,tau_550
4570 real (kind=kind_phys) :: sum_tau,sum_asy,sum_ssa,tau,asy,ssa
4571 real (kind=kind_phys) :: sum_tau_550
4572 integer :: ih1, ih2, nbin, ib, ntrc, ktrc
4576 do while ( rh1(k) > rhlev_grt(ih2) )
4578 if ( ih2 > krhlev )
exit
4580 ih1 = max( 1, ih2-1 )
4581 ih2 = min( krhlev, ih2 )
4583 drh0 = rhlev_grt(ih2) - rhlev_grt(ih1)
4584 drh1 = rh1(k) - rhlev_grt(ih1)
4585 if ( ih1 == ih2 )
then
4595 if (ib == nv_aod )
then
4596 sum_tau_550 = f_zero
4610 cm = max(aerms(k,m),0.0) * dz1(k)
4611 ext1 = ext1 + cm*extrhi_grt(m,ib)
4612 if (ib == nv_aod)
then
4613 ext1_550 = ext1_550 + cm*extrhi_grt_550(m,1)
4615 sca1 = sca1 + cm*scarhi_grt(m,ib)
4616 ssa1 = ssa1 + cm*extrhi_grt(m,ib) * ssarhi_grt(m,ib)
4617 asy1 = asy1 + cm*scarhi_grt(m,ib) * asyrhi_grt(m,ib)
4620 if (ext1 > f_zero) ssa=min(f_one, ssa1/ext1)
4621 if (sca1 > f_zero) asy=min(f_one, asy1/sca1)
4624 if ( ib==nv_aod )
then
4626 spcodp(k,1) = tau_550
4627 sum_tau_550 = sum_tau_550 + tau_550
4630 sum_tau = sum_tau + tau
4631 sum_ssa = sum_ssa + tau * ssa
4632 sum_asy = sum_asy + tau * ssa * asy
4637 if ( ib==nv_aod )
then
4643 ktrc = trc_to_aod(ntrc)
4644 do nbin = 1, num_radius(ntrc)
4645 m1 = radius_lower(ntrc) + nbin - 1
4646 m = m1 - num_radius(1)
4647 cm = max(aerms(k,m1),0.0) * dz1(k)
4648 ext01 = extrhd_grt(ih1,m,ib) + &
4649 & rdrh * (extrhd_grt(ih2,m,ib)-extrhd_grt(ih1,m,ib))
4650 if ( ib==nv_aod )
then
4651 ext01_550 = extrhd_grt_550(ih1,m,1) + &
4652 & rdrh * (extrhd_grt_550(ih2,m,1)-extrhd_grt_550(ih1,m,1))
4654 sca01 = scarhd_grt(ih1,m,ib) + &
4655 & rdrh * (scarhd_grt(ih2,m,ib)-scarhd_grt(ih1,m,ib))
4656 ssa01 = ssarhd_grt(ih1,m,ib) + &
4657 & rdrh * (ssarhd_grt(ih2,m,ib)-ssarhd_grt(ih1,m,ib))
4658 asy01 = asyrhd_grt(ih1,m,ib) + &
4659 & rdrh * (asyrhd_grt(ih2,m,ib)-asyrhd_grt(ih1,m,ib))
4660 ext1 = ext1 + cm*ext01
4661 if ( ib==nv_aod )
then
4662 ext1_550 = ext1_550 + cm*ext01_550
4664 sca1 = sca1 + cm*sca01
4665 ssa1 = ssa1 + cm*ext01 * ssa01
4666 asy1 = asy1 + cm*sca01 * asy01
4669 if (ext1 > f_zero) ssa=min(f_one, ssa1/ext1)
4670 if (sca1 > f_zero) asy=min(f_one, asy1/sca1)
4672 if ( ib==nv_aod )
then
4674 spcodp(k,ktrc) = tau_550
4675 sum_tau_550 = sum_tau_550 + tau_550
4678 sum_tau = sum_tau + tau
4679 sum_ssa = sum_ssa + tau * ssa
4680 sum_asy = sum_asy + tau * ssa * asy
4684 tauae(k,ib) = sum_tau
4685 if ( ib==nv_aod )
then
4686 tauae_550(k,1) = sum_tau_550
4688 if (sum_tau > f_zero) ssaae(k,ib) = sum_ssa / sum_tau
4689 if (sum_ssa > f_zero) asyae(k,ib) = sum_asy / sum_ssa
4695 end subroutine aeropt