-
Notifications
You must be signed in to change notification settings - Fork 67
RRTMGP: gas concentrations
Class ty_gas_concs
from module mo_gas_concentrations
in the RRTMGP library is the means for specifying gas concentrations to ty_gas_optics%gas_optics
. The class has four user-facing procedures. The following examples assume the declaration type(ty_gas_concs) :: gas_concs
function set_vmr(name, value) result(error_msg)
character(len=*), intent(in ) :: name
real(wp), ... intent(in ) :: value
character(len=128) :: error_msg
specifies the absolute volume mixing ratio for the named gas. The routine is invoked as e.g.err_msg = gas_concs%set_vmr("co2", 280._wpE-6)
. Gas names are normally the chemical formula.
Values may be specified as scalars, one-dimensional profiles assumed to apply layer-by-layer to all columns, or as a 2D field dimensioned (columns, layers). The number of columns is set the first time a 1D or 2D field is supplied; the number columns is determined from the first 2D field.
function get_subset(start, n, subset) result(error_msg)
integer, intent(in ) :: start, n
class(ty_gas_concs), intent(inout) :: subset
character(len=128) :: error_msg
extracts columns start
to start+n-1
from the class. Example: err_msg = gas_concs%get_subset(2, n, gas_conc_subset)
call gas_concs%reset()
will return variable gas_concs
to an un-initialized state. This is useful if, for example, the problem size has changed since concentrations were last specified.
gas_concs%get_vmr()
is used within ty_gas_optics%gas_optics()
to extract the gas concentrations.