-
Notifications
You must be signed in to change notification settings - Fork 68
RTE: source functions
Module mo_source_functions
in the RTE library provides class ty_source_func_lw
to encapsulate Planck source functions computed for each (spectral) g-point at layer, level, and surface temperatures. (The module also contains the class ty_source_func_sw
but this is not currently used). The classes extend ty_optical_props
and inherit those initialization and inquiry methods. Assuming a declaration of the form type(ty_source_func_lw):: src_lw
the class is used as follows:
err_msg = src_lw%alloc(ncol, nlay)
provides memory for a problem with ncol
columns and nlay
layers. If src_lw
has not been previously-initialzed the routine fails and reports an error.
err_msg = src_lw%alloc(ncol, nlay, ops)
, where ops
is a previously-initialized variable of ty_optical_props
, combines initialization and allocation, copying the spectral discretization from ops
to src_lw
.
err_msg = src_lw%subset(ncol, nlay, subset)
, where subset
is a variable of ty_source_func_lw
, extracts columns start
to start+n-1
from the class into variable subset
.
call src_lw%finalize()
returns the variable to its un-initialzed state.