📄 radcswmx.f90
字号:
#include <misc.h>#include <params.h>subroutine radcswmx(lchnk ,ncol , & pint ,pmid ,h2ommr ,rh ,o3mmr , & aermmr ,cld ,clwp ,rel ,rei , & fice ,eccf ,coszrs ,scon ,solin , & asdir ,asdif ,aldir ,aldif ,nmxrgn , & pmxrgn ,qrs ,fsnt ,fsntc ,fsntoa , & fsntoac ,fsnirtoa,fsnrtoac,fsnrtoaq,fsns , & fsnsc ,fsdsc ,fsds ,sols ,soll , & solsd ,solld )!-----------------------------------------------------------------------! ! Purpose: ! Solar radiation code! ! Method: ! Basic method is Delta-Eddington as described in:! ! Briegleb, Bruce P., 1992: Delta-Eddington! Appoximation for Solar Radiation in the NCAR Community Climate Model,! Journal of Geophysical Research, Vol 97, D7, pp7603-7612).! ! Four changes to the basic method described above are:! (1) addition of sulfate aerosols (Kiehl and Briegleb, 1993)! (2) the distinction between liquid and ice particle clouds ! (Kiehl et al, 1996);! (3) provision for calculating TOA fluxes with spectral response to! match Nimbus-7 visible/near-IR radiometers (Collins, 1998);! (4) max-random overlap (Collins and Truesdale, 2000)! ! The treatment of maximum-random overlap is described in the! comment block "INDEX CALCULATIONS FOR MAX OVERLAP".! ! Divides solar spectrum into 19 intervals from 0.2-5.0 micro-meters.! solar flux fractions specified for each interval. allows for! seasonally and diurnally varying solar input. Includes molecular,! cloud, aerosol, and surface scattering, along with h2o,o3,co2,o2,cloud, ! and surface absorption. Computes delta-eddington reflections and! transmissions assuming homogeneously mixed layers. Adds the layers ! assuming scattering between layers to be isotropic, and distinguishes ! direct solar beam from scattered radiation.! ! Longitude loops are broken into 1 or 2 sections, so that only daylight! (i.e. coszrs > 0) computations are done.! ! Note that an extra layer above the model top layer is added.! ! cgs units are used.! ! Special diagnostic calculation of the clear sky surface and total column! absorbed flux is also done for cloud forcing diagnostics.! !----------------------------------------------------------------------- use precision use ppgrid implicit none integer nspint ! Num of spctrl intervals across solar spectrum parameter ( nspint = 19 )!-----------------------Constants for new band (640-700 nm)------------- real(r8) v_raytau_35 real(r8) v_raytau_64 real(r8) v_abo3_35 real(r8) v_abo3_64 real(r8) v_ksa_35 real(r8) v_ksa_64 real(r8) v_gsa_35 real(r8) v_gsa_64 parameter( & v_raytau_35 = 0.155208, & v_raytau_64 = 0.0392, & v_abo3_35 = 2.4058030e+01, & v_abo3_64 = 2.210e+01, & v_ksa_35 = 5.64884, & v_ksa_64 = 3.6771, & v_gsa_35 = .699326, & v_gsa_64 = .663642 & )!-------------Parameters for accelerating max-random solution-------------! ! The solution time scales like prod(j:1->N) (1 + n_j) where ! N = number of max-overlap regions (nmxrgn)! n_j = number of unique cloud amounts in region j! ! Therefore the solution cost can be reduced by decreasing n_j.! cldmin reduces n_j by treating cloud amounts < cldmin as clear sky.! cldeps reduces n_j by treating cloud amounts identical to log(1/cldeps)! decimal places as identical! ! areamin reduces the cost by dropping configurations that occupy! a surface area < areamin of the model grid box. The surface area! for a configuration C(j,k_j), where j is the region number and k_j is the! index for a unique cloud amount (in descending order from biggest to! smallest clouds) in region j, is! ! A = prod(j:1->N) [C(j,k_j) - C(j,k_j+1)]! ! where C(j,0) = 1.0 and C(j,n_j+1) = 0.0.! ! nconfgmax reduces the cost and improves load balancing by setting an upper! bound on the number of cloud configurations in the solution. If the number! of configurations exceeds nconfgmax, the nconfgmax configurations with the! largest area are retained, and the fluxes are normalized by the total area! of these nconfgmax configurations. For the current max/random overlap ! assumption (see subroutine cldovrlap), 30 levels, and cloud-amount ! parameterization, the mean and RMS number of configurations are ! both roughly 5. nconfgmax has been set to the mean+2*RMS number, or 15.! ! Minimum cloud amount (as a fraction of the grid-box area) to ! distinguish from clear sky! real(r8) cldmin parameter (cldmin = 1.0e-80_r8)! ! Minimimum horizontal area (as a fraction of the grid-box area) to retain ! for a unique cloud configuration in the max-random solution! real(r8) areamin parameter (areamin = 0.01_r8)! ! Decimal precision of cloud amount (0 -> preserve full resolution;! 10^-n -> preserve n digits of cloud amount)! real(r8) cldeps parameter (cldeps = 0.0_r8)! ! Maximum number of configurations to include in solution! integer nconfgmax parameter (nconfgmax = 15)!------------------------------Commons----------------------------------#include <crdcon.h>! ! Input arguments! integer, intent(in) :: lchnk ! chunk identifier integer, intent(in) :: ncol ! number of atmospheric columns real(r8), intent(in) :: pmid(pcols,pver) ! Level pressure real(r8), intent(in) :: pint(pcols,pverp) ! Interface pressure real(r8), intent(in) :: h2ommr(pcols,pver) ! Specific humidity (h2o mass mix ratio) real(r8), intent(in) :: o3mmr(pcols,pver) ! Ozone mass mixing ratio real(r8), intent(in) :: aermmr(pcols,pver) ! Aerosol mass mixing ratio real(r8), intent(in) :: rh(pcols,pver) ! Relative humidity (fraction)! real(r8), intent(in) :: cld(pcols,pver) ! Fractional cloud cover real(r8), intent(in) :: clwp(pcols,pver) ! Layer liquid water path real(r8), intent(in) :: rel(pcols,pver) ! Liquid effective drop size (microns) real(r8), intent(in) :: rei(pcols,pver) ! Ice effective drop size (microns) real(r8), intent(in) :: fice(pcols,pver) ! Fractional ice content within cloud! real(r8), intent(in) :: eccf ! Eccentricity factor (1./earth-sun dist^2) real(r8), intent(in) :: coszrs(pcols) ! Cosine solar zenith angle real(r8), intent(in) :: asdir(pcols) ! 0.2-0.7 micro-meter srfc alb: direct rad real(r8), intent(in) :: aldir(pcols) ! 0.7-5.0 micro-meter srfc alb: direct rad real(r8), intent(in) :: asdif(pcols) ! 0.2-0.7 micro-meter srfc alb: diffuse rad real(r8), intent(in) :: aldif(pcols) ! 0.7-5.0 micro-meter srfc alb: diffuse rad real(r8), intent(in) :: scon ! solar constant ! ! IN/OUT arguments! real(r8), intent(inout) :: pmxrgn(pcols,pverp) ! Maximum values of pressure for each! ! maximally overlapped region. ! ! 0->pmxrgn(i,1) is range of pressure for! ! 1st region,pmxrgn(i,1)->pmxrgn(i,2) for! ! 2nd region, etc integer, intent(inout) :: nmxrgn(pcols) ! Number of maximally overlapped regions! ! Output arguments! real(r8), intent(out) :: solin(pcols) ! Incident solar flux real(r8), intent(out) :: qrs(pcols,pver) ! Solar heating rate real(r8), intent(out) :: fsns(pcols) ! Surface absorbed solar flux real(r8), intent(out) :: fsnt(pcols) ! Total column absorbed solar flux real(r8), intent(out) :: fsntoa(pcols) ! Net solar flux at TOA real(r8), intent(out) :: fsds(pcols) ! Flux shortwave downwelling surface! real(r8), intent(out) :: fsnsc(pcols) ! Clear sky surface absorbed solar flux real(r8), intent(out) :: fsdsc(pcols) ! Clear sky surface downwelling solar flux real(r8), intent(out) :: fsntc(pcols) ! Clear sky total column absorbed solar flx real(r8), intent(out) :: fsntoac(pcols) ! Clear sky net solar flx at TOA real(r8), intent(out) :: sols(pcols) ! Direct solar rad on surface (< 0.7) real(r8), intent(out) :: soll(pcols) ! Direct solar rad on surface (>= 0.7) real(r8), intent(out) :: solsd(pcols) ! Diffuse solar rad on surface (< 0.7) real(r8), intent(out) :: solld(pcols) ! Diffuse solar rad on surface (>= 0.7) real(r8), intent(out) :: fsnirtoa(pcols) ! Near-IR flux absorbed at toa real(r8), intent(out) :: fsnrtoac(pcols) ! Clear sky near-IR flux absorbed at toa real(r8), intent(out) :: fsnrtoaq(pcols) ! Net near-IR flux at toa >= 0.7 microns! !---------------------------Local variables-----------------------------! ! Max/random overlap variables! real(r8) asort(pverp) ! 1 - cloud amounts to be sorted for max ovrlp. real(r8) atmp ! Temporary storage for sort when nxs = 2 real(r8) cld0 ! 1 - (cld amt) used to make wstr, cstr, nstr real(r8) totwgt ! Total of xwgts = total fractional area of ! grid-box covered by cloud configurations! included in solution to fluxes real(r8) wgtv(nconfgmax) ! Weights for fluxes! 1st index is configuration number real(r8) wstr(pverp,pverp) ! area weighting factors for streams! 1st index is for stream #, ! 2nd index is for region # real(r8) xexpt ! solar direct beam trans. for layer above real(r8) xrdnd ! diffuse reflectivity for layer above real(r8) xrupd ! diffuse reflectivity for layer below real(r8) xrups ! direct-beam reflectivity for layer below real(r8) xtdnt ! total trans for layers above real(r8) xwgt ! product of cloud amounts real(r8) yexpt ! solar direct beam trans. for layer above real(r8) yrdnd ! diffuse reflectivity for layer above real(r8) yrupd ! diffuse reflectivity for layer below real(r8) ytdnd ! dif-beam transmission for layers above real(r8) ytupd ! dif-beam transmission for layers below real(r8) zexpt ! solar direct beam trans. for layer above real(r8) zrdnd ! diffuse reflectivity for layer above real(r8) zrupd ! diffuse reflectivity for layer below real(r8) zrups ! direct-beam reflectivity for layer below real(r8) ztdnt ! total trans for layers above logical new_term ! Flag for configurations to include in fluxes logical region_found ! flag for identifying regions integer ccon(0:pverp,nconfgmax) ! flags for presence of clouds! 1st index is for level # (including ! layer above top of model and at surface)! 2nd index is for configuration # integer cstr(0:pverp,pverp) ! flags for presence of clouds! 1st index is for level # (including ! layer above top of model and at surface)! 2nd index is for stream # integer icond(0:pverp,nconfgmax)! Indices for copying rad. properties from! one identical downward cld config.! to another in adding method (step 2)! 1st index is for interface # (including ! layer above top of model and at surface)! 2nd index is for configuration # range integer iconu(0:pverp,nconfgmax)! Indices for copying rad. properties from! one identical upward configuration! to another in adding method (step 2)! 1st index is for interface # (including ! layer above top of model and at surface)! 2nd index is for configuration # range integer iconfig ! Counter for random-ovrlap configurations integer irgn ! Index for max-overlap regions integer is0 ! Lower end of stream index range integer is1 ! Upper end of stream index range integer isn ! Stream index integer istr(pverp+1) ! index for stream #s during flux calculation integer istrtd(0:pverp,0:nconfgmax+1)! indices into icond ! 1st index is for interface # (including ! layer above top of model and at surface)! 2nd index is for configuration # range integer istrtu(0:pverp,0:nconfgmax+1)! indices into iconu ! 1st index is for interface # (including ! layer above top of model and at surface)! 2nd index is for configuration # range integer j ! Configuration index integer k1 ! Level index integer k2 ! Level index integer ksort(pverp) ! Level indices of cloud amounts to be sorted integer ktmp ! Temporary storage for sort when nxs = 2 integer kx1(0:pverp) ! Level index for top of max-overlap region integer kx2(0:pverp) ! Level index for bottom of max-overlap region integer l ! Index integer l0 ! Index integer mrgn ! Counter for nrgn integer mstr ! Counter for nstr integer n0 ! Number of configurations with ccon(k,:)==0 integer n1 ! Number of configurations with ccon(k,:)==1 integer nconfig ! Number of random-ovrlap configurations integer nconfigm ! Value of config before testing for areamin,! nconfgmax integer npasses ! number of passes over the indexing loop integer nrgn ! Number of max overlap regions at current ! longitude integer nstr(pverp) ! Number of unique cloud configurations! ("streams") in a max-overlapped region! 1st index is for region # integer nuniq ! # of unique cloud configurations integer nuniqd(0:pverp) ! # of unique cloud configurations: TOA ! to level k integer nuniqu(0:pverp) ! # of unique cloud configurations: surface! to level k integer nxs ! Number of cloudy layers between k1 and k2 integer ptr0(nconfgmax) ! Indices of configurations with ccon(k,:)==0 integer ptr1(nconfgmax) ! Indices of configurations with ccon(k,:)==1 integer ptrc(nconfgmax) ! Pointer for configurations sorted by wgtv integer findvalue ! Function for finding kth smallest element! in a vector external findvalue! ! Other! integer ns ! Spectral loop index integer i ! Longitude loop index integer k ! Level loop index integer km1 ! k - 1 integer kp1 ! k + 1 integer n ! Loop index for daylight integer ndayc ! Number of daylight columns integer idayc(pcols) ! Daytime column indices integer indxsl ! Index for cloud particle properties! ! A. Slingo's data for cloud particle radiative properties (from 'A GCM! Parameterization for the Shortwave Properties of Water Clouds' JAS! vol. 46 may 1989 pp 1419-1427)! real(r8) abarl(4) ! A coefficient for extinction optical depth real(r8) bbarl(4) ! B coefficient for extinction optical depth
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -