📄 radcswmx.f90
字号:
fsntoac(i) = 0.0_r8 solin(i) = 0.0_r8 sols(i) = 0.0_r8 soll(i) = 0.0_r8 solsd(i) = 0.0_r8 solld(i) = 0.0_r8 do k=1, pver qrs(i,k) = 0.0_r8 end do end do! ! Compute starting, ending daytime loop indices:! *** Note this logic assumes day and night points are contiguous so! *** will not work in general with chunked data structure.! ndayc = 0 do i=1,ncol if (coszrs(i) > 0.0_r8) then ndayc = ndayc + 1 idayc(ndayc) = i end if end do! ! If night everywhere, return:! if (ndayc == 0) return! ! Perform other initializations! tmp1 = 0.5_r8/(gravit*sslp) tmp2 = delta/gravit sqrco2 = sqrt(co2mmr) do n=1,ndayc i=idayc(n)! ! Define solar incident radiation and interface pressures:! solin(i) = scon*eccf*coszrs(i) pflx(i,0) = 0._r8 do k=1,pverp pflx(i,k) = pint(i,k) end do! ! Compute optical paths:! ptop = pflx(i,1) ptho2 = o2mmr * ptop / gravit ptho3 = o3mmr(i,1) * ptop / gravit pthco2 = sqrco2 * (ptop / gravit) h2ostr = sqrt( 1._r8 / h2ommr(i,1) ) zenfac(i) = sqrt(coszrs(i)) pthh2o = ptop**2*tmp1 + (ptop*rga)* & (h2ostr*zenfac(i)*delta) uh2o(i,0) = h2ommr(i,1)*pthh2o uco2(i,0) = zenfac(i)*pthco2 uo2 (i,0) = zenfac(i)*ptho2 uo3 (i,0) = ptho3 uaer(i,0) = 0.0_r8 do k=1,pver pdel = pflx(i,k+1) - pflx(i,k) path = pdel / gravit ptho2 = o2mmr * path ptho3 = o3mmr(i,k) * path pthco2 = sqrco2 * path h2ostr = sqrt(1.0_r8/h2ommr(i,k)) pthh2o = (pflx(i,k+1)**2 - pflx(i,k)**2)*tmp1 + pdel*h2ostr*zenfac(i)*tmp2 uh2o(i,k) = h2ommr(i,k)*pthh2o uco2(i,k) = zenfac(i)*pthco2 uo2 (i,k) = zenfac(i)*ptho2 uo3 (i,k) = ptho3! ! Adjust aerosol amount by relative humidity factor:! if( rh(i,k) .gt. .90 ) then rhfac = 2.8 else if (rh(i,k) .lt. .60 ) then rhfac = 1.0 else rhpc = 100. * rh(i,k) rhfac = (a0 + a1*rhpc + a2*rhpc**2 + a3*rhpc**3) endif uaer(i,k) = aermmr(i,k)*rhfac*path end do! ! Compute column absorber amounts for the clear sky computation:! uth2o(i) = 0.0_r8 uto3(i) = 0.0_r8 utco2(i) = 0.0_r8 uto2(i) = 0.0_r8 do k=1,pver uth2o(i) = uth2o(i) + uh2o(i,k) uto3(i) = uto3(i) + uo3(i,k) utco2(i) = utco2(i) + uco2(i,k) uto2(i) = uto2(i) + uo2(i,k) end do! ! Set cloud properties for top (0) layer; so long as tauxcl is zero,! there is no cloud above top of model; the other cloud properties! are arbitrary:! tauxcl(i,0) = 0._r8 wcl(i,0) = 0.999999_r8 gcl(i,0) = 0.85_r8 fcl(i,0) = 0.725_r8 tauxci(i,0) = 0._r8 wci(i,0) = 0.999999_r8 gci(i,0) = 0.85_r8 fci(i,0) = 0.725_r8! ! Aerosol ! tauxar(i,0) = 0._r8 wa(i,0) = 0.925_r8 ga(i,0) = 0.850_r8 fa(i,0) = 0.7225_r8! ! End do n=1,ndayc! end do! ! Begin spectral loop! do ns=1,nspint! ! Set index for cloud particle properties based on the wavelength,! according to A. Slingo (1989) equations 1-3:! Use index 1 (0.25 to 0.69 micrometers) for visible! Use index 2 (0.69 - 1.19 micrometers) for near-infrared! Use index 3 (1.19 to 2.38 micrometers) for near-infrared! Use index 4 (2.38 to 4.00 micrometers) for near-infrared! ! Note that the minimum wavelength is encoded (with .001, .002, .003)! in order to specify the index appropriate for the near-infrared! cloud absorption properties! if(wavmax(ns) <= 0.7_r8) then indxsl = 1 else if(wavmin(ns) == 0.700_r8) then indxsl = 2 else if(wavmin(ns) == 0.701_r8) then indxsl = 3 else if(wavmin(ns) == 0.702_r8 .or. wavmin(ns) > 2.38_r8) then indxsl = 4 end if! ! Set cloud extinction optical depth, single scatter albedo,! asymmetry parameter, and forward scattered fraction:! abarli = abarl(indxsl) bbarli = bbarl(indxsl) cbarli = cbarl(indxsl) dbarli = dbarl(indxsl) ebarli = ebarl(indxsl) fbarli = fbarl(indxsl)! abarii = abari(indxsl) bbarii = bbari(indxsl) cbarii = cbari(indxsl) dbarii = dbari(indxsl) ebarii = ebari(indxsl) fbarii = fbari(indxsl)! ! adjustfraction within spectral interval to allow for the possibility of! sub-divisions within a particular interval:! psf(ns) = 1.0_r8 if(ph2o(ns)/=0._r8) psf(ns) = psf(ns)*ph2o(ns) if(pco2(ns)/=0._r8) psf(ns) = psf(ns)*pco2(ns) if(po2 (ns)/=0._r8) psf(ns) = psf(ns)*po2 (ns) do n=1,ndayc i=idayc(n) do k=1,pver! ! liquid! tmp1l = abarli + bbarli/rel(i,k) tmp2l = 1._r8 - cbarli - dbarli*rel(i,k) tmp3l = fbarli*rel(i,k)! ! ice! tmp1i = abarii + bbarii/rei(i,k) tmp2i = 1._r8 - cbarii - dbarii*rei(i,k) tmp3i = fbarii*rei(i,k) if (cld(i,k) >= cldmin .and. cld(i,k) >= cldeps) then tauxcl(i,k) = clwp(i,k)*tmp1l*(1._r8-fice(i,k)) tauxci(i,k) = clwp(i,k)*tmp1i*fice(i,k) else tauxcl(i,k) = 0.0 tauxci(i,k) = 0.0 endif! ! Do not let single scatter albedo be 1. Delta-eddington solution! for non-conservative case has different analytic form from solution! for conservative case, and raddedmx is written for non-conservative case.! wcl(i,k) = min(tmp2l,.999999_r8) gcl(i,k) = ebarli + tmp3l fcl(i,k) = gcl(i,k)*gcl(i,k)! wci(i,k) = min(tmp2i,.999999_r8) gci(i,k) = ebarii + tmp3i fci(i,k) = gci(i,k)*gci(i,k)! ! Set aerosol properties! Conversion factor to adjust aerosol extinction (m2/g)! tauxar(i,k) = 1.e4 * ksa(ns) * uaer(i,k)! wa(i,k) = wsa(ns) ga(i,k) = gsa(ns) fa(i,k) = gsa(ns)*gsa(ns)! ! End do k=1,pver! end do! ! End do n=1,ndayc! end do! ! Set reflectivities for surface based on mid-point wavelength! wavmid(ns) = 0.5_r8*(wavmin(ns) + wavmax(ns))! ! Wavelength less than 0.7 micro-meter! if (wavmid(ns) < 0.7_r8 ) then do n=1,ndayc i=idayc(n) albdir(i,ns) = asdir(i) albdif(i,ns) = asdif(i) end do! ! Wavelength greater than 0.7 micro-meter! else do n=1,ndayc i=idayc(n) albdir(i,ns) = aldir(i) albdif(i,ns) = aldif(i) end do end if trayoslp = raytau(ns)/sslp! ! Layer input properties now completely specified; compute the! delta-Eddington solution reflectivities and transmissivities! for each layer! call raddedmx(coszrs ,ndayc ,idayc , & abh2o(ns),abo3(ns) ,abco2(ns),abo2(ns) , & uh2o ,uo3 ,uco2 ,uo2 , & trayoslp ,pflx ,ns , & tauxcl ,wcl ,gcl ,fcl , & tauxci ,wci ,gci ,fci , & tauxar ,wa ,ga ,fa , & rdir ,rdif ,tdir ,tdif ,explay , & rdirc ,rdifc ,tdirc ,tdifc ,explayc )! ! End spectral loop! end do! !----------------------------------------------------------------------! ! Solution for max/random cloud overlap. ! ! Steps:! (1. delta-Eddington solution for each layer (called above)! ! (2. The adding method is used to! compute the reflectivity and transmissivity to direct and diffuse! radiation from the top and bottom of the atmosphere for each! cloud configuration. This calculation is based upon the! max-random overlap assumption.! ! (3. to solve for the fluxes, combine the! bulk properties of the atmosphere above/below the region.! ! Index calculations for steps 2-3 are performed outside spectral! loop to avoid redundant calculations. Index calculations (with! application of areamin & nconfgmax conditions) are performed ! first to identify the minimum subset of terms for the configurations ! satisfying the areamin & nconfgmax conditions. This minimum set is ! used to identify the corresponding minimum subset of terms in ! steps 2 and 3.! do n=1,ndayc i=idayc(n)!----------------------------------------------------------------------! INDEX CALCULATIONS FOR MAX OVERLAP! ! The column is divided into sets of adjacent layers, called regions, ! in which the clouds are maximally overlapped. The clouds are! randomly overlapped between different regions. The number of! regions in a column is set by nmxrgn, and the range of pressures! included in each region is set by pmxrgn. ! ! The following calculations determine the number of unique cloud ! configurations (assuming maximum overlap), called "streams",! within each region. Each stream consists of a vector of binary! clouds (either 0 or 100% cloud cover). Over the depth of the region, ! each stream requires a separate calculation of radiative properties. These! properties are generated using the adding method from! the radiative properties for each layer calculated by raddedmx.! ! The upward and downward-propagating streams are treated! separately.! ! We will refer to a particular configuration of binary clouds! within a single max-overlapped region as a "stream". We will ! refer to a particular arrangement of binary clouds over the entire column! as a "configuration".! ! This section of the code generates the following information:! (1. nrgn : the true number of max-overlap regions (need not = nmxrgn)! (2. nstr : the number of streams in a region (>=1)! (3. cstr : flags for presence of clouds at each layer in each stream
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -