Common Community Physics Package (CCPP) Scientific Documentation  Version 2.0
subroutine rrtmg_lw::setcoef ( real (kind=kind_phys), dimension(nlay), intent(in)  pavel,
real (kind=kind_phys), dimension(nlay), intent(in)  tavel,
real (kind=kind_phys), dimension(0:nlay), intent(in)  tz,
real (kind=kind_phys), intent(in)  stemp,
real (kind=kind_phys), dimension(nlay), intent(in)  h2ovmr,
real (kind=kind_phys), dimension(nlay,maxgas), intent(in)  colamt,
real (kind=kind_phys), dimension(nlay), intent(in)  coldry,
real (kind=kind_phys), dimension(nlay), intent(in)  colbrd,
integer, intent(in)  nlay,
integer, intent(in)  nlp1,
integer, intent(out)  laytrop,
real (kind=kind_phys), dimension(nbands,0:nlay), intent(out)  pklay,
real (kind=kind_phys), dimension(nbands,0:nlay), intent(out)  pklev,
integer, dimension(nlay), intent(out)  jp,
integer, dimension(nlay), intent(out)  jt,
integer, dimension(nlay), intent(out)  jt1,
real (kind=kind_phys), dimension(nlay,nrates,2), intent(out)  rfrate,
real (kind=kind_phys), dimension(nlay), intent(out)  fac00,
real (kind=kind_phys), dimension(nlay), intent(out)  fac01,
real (kind=kind_phys), dimension(nlay), intent(out)  fac10,
real (kind=kind_phys), dimension(nlay), intent(out)  fac11,
real (kind=kind_phys), dimension(nlay), intent(out)  selffac,
real (kind=kind_phys), dimension(nlay), intent(out)  selffrac,
integer, dimension(nlay), intent(out)  indself,
real (kind=kind_phys), dimension(nlay), intent(out)  forfac,
real (kind=kind_phys), dimension(nlay), intent(out)  forfrac,
integer, dimension(nlay), intent(out)  indfor,
real (kind=kind_phys), dimension(nlay), intent(out)  minorfrac,
real (kind=kind_phys), dimension(nlay), intent(out)  scaleminor,
real (kind=kind_phys), dimension(nlay), intent(out)  scaleminorn2,
integer, dimension(nlay), intent(out)  indminor 
)
private
Parameters
pavellayer pressure (mb)
tavellayer temperature (K)
tzlevel(interface) temperatures (K)
stempsurface ground temperature (K)
h2ovmrlayer w.v. volumn mixing ratio (kg/kg)
colamtcolumn amounts of absorbing gases. 2nd indices range: 1-maxgas, for watervapor,carbon dioxide, ozone, nitrous oxide, methane,oxigen, carbon monoxide,etc. \((mol/cm^2)\)
coldrydry air column amount
colbrdcolumn amount of broadening gases
nlaytotal number of vertical layers
nlp1total number of vertical levels
laytroptropopause layer index (unitless)
pklayintegrated planck func at lay temp
pklevintegrated planck func at lev temp
jpindices of lower reference pressure
jt,jt1indices of lower reference temperatures
rfrateref ratios of binary species param
(:,m,:)m=1-h2o/co2,2-h2o/o3,3-h2o/n2o, 4-h2o/ch4,5-n2o/co2,6-o3/co2
(:,:,n)n=1,2: the rates of ref press at the 2 sides of the layer
facijfactors multiply the reference ks, i,j=0/1 for lower/higher of the 2 appropriate temperatures and altitudes.
selffacscale factor for w. v. self-continuum equals (w. v. density)/(atmospheric density at 296k and 1013 mb)
selffracfactor for temperature interpolation of reference w. v. self-continuum data
indselfindex of lower ref temp for selffac
forfacscale factor for w. v. foreign-continuum
forfracfactor for temperature interpolation of reference w.v. foreign-continuum data
indforindex of lower ref temp for forfac
minorfracfactor for minor gases
scaleminor,scaleminorn2scale factors for minor gases
indminorindex of lower ref temp for minor gases

setcoef General Algorithm

  1. Calculate information needed by the radiative transfer routine that is specific to this atmosphere, especially some of the coefficients and indices needed to compute the optical depths by interpolating data from stored reference atmospheres.
  2. Calculate the integrated Planck functions for each band at the surface, level, and layer temperatures.
  3. Find the two reference pressures on either side of the layer pressure. store them in jp and jp1. store in fp the fraction of the difference (in ln(pressure)) between these two values that the layer pressure lies.
  4. Determine, for each reference pressure (jp and jp1), which reference temperature (these are different for each reference pressure) is nearest the layer temperature but does not exceed it. store these indices in jt and jt1, resp. store in ft (resp. ft1) the fraction of the way between jt (jt1) and the next highest reference temperature that the layer temperature falls.
  5. We have now isolated the layer ln pressure and temperature, between two reference pressures and two reference temperatures (for each reference pressure). we multiply the pressure fraction fp with the appropriate temperature fractions to get the factors that will be needed for the interpolation that yields the optical depths (performed in routines taugbn for band n).
  6. Set up factors needed to separately include the minor gases in the calculation of absorption coefficient.
  7. If the pressure is less than ~100mb, perform a different set of species interpolations.
  8. Set up factors needed to separately include the water vapor self-continuum in the calculation of absorption coefficient.
  9. Setup reference ratio to be used in calculation of binary species parameter in lower atmosphere.
  10. Setup reference ratio to be used in calculation of binary species parameter in upper atmosphere.
  11. Rescale selffac and forfac for use in taumol.

Referenced by rrtmg_lw_run().