Configuration
The atmosphere and the solve are described by a single configuration object —
ADConfig in C++ and JAX. The workflow is always the same:
Set the dimensions (
num_layers,num_quadrature) and any flags that change array sizes (use_delta_m,use_thermal_emission).Call
allocate()to size the per-layer / per-level arrays.Fill the arrays and set the boundary/source parameters.
Call
solve(cfg).
allocate() fills the zeroth Legendre moment of every layer with
\(1\) (an isotropic default) and, in thermal mode, sizes the temperature
array to num_layers + 1. solve() calls validate() internally, but
you may call it yourself to fail early.
Tip
Set use_delta_m and use_thermal_emission before allocate():
delta-M provisions one extra Legendre moment per layer (\(2M+1\)
instead of \(2M\)), and thermal mode allocates the temperature array.
Dimensions and flags
Field |
Default |
Meaning |
|---|---|---|
|
|
Number of atmospheric layers (must be |
|
|
Gauss–Legendre streams per hemisphere \(M\) (must be |
|
|
Compute Planck sources internally from temperatures and the wavenumber band. |
|
|
Enable delta-M scaling (Using delta-M scaling). |
|
|
Use the diffusion-approximation lower boundary instead of a surface (Boundary conditions). |
|
|
If |
|
|
Compute analytic temperature Jacobians (thermal only; C++; Temperature Jacobians). |
|
|
Split the net flux into additive thermal and stellar parts (Outputs). |
Boundary and source parameters
Field |
Default |
Meaning |
|---|---|---|
|
|
Lambertian surface albedo in \([0, 1]\). |
|
|
Raw surface thermal emission (only when |
|
|
Surface skin temperature [K]. If |
|
|
Raw isotropic downwelling diffuse radiation at TOA (only when
|
|
|
Top-boundary temperature [K]. If |
|
|
Collimated solar/stellar flux at TOA (set |
|
|
Cosine of the solar zenith angle; must be in \((0, 1]\) when
|
|
|
Band limits [cm⁻¹] over which the Planck function is integrated (thermal mode). |
Layer and level arrays
After allocate() these have the sizes shown. “Layer” arrays have one
entry per layer; “level” arrays have one entry per interface
(num_layers + 1).
Array |
Size |
Meaning |
|---|---|---|
|
|
Optical depth of each layer (\(\geq 0\)). |
|
|
Single-scattering albedo of each layer, in \([0, 1]\). |
|
|
Reduced Legendre moments per layer. |
|
|
Level temperatures [K] (thermal mode). |
|
|
Pre-computed Planck values at levels (an alternative to
|
Validation rules
validate() throws (C++ std::invalid_argument / Python ValueError)
when, among other checks:
num_layers <= 0ornum_quadrature < 2;any array size does not match the declared dimensions;
a
delta_tauis negative or asingle_scat_albedoleaves \([0, 1]\);surface_albedoleaves \([0, 1]\);solar_flux > 0butsolar_muis not in \((0, 1]\);surface_temperatureortop_temperatureis set withoutuse_thermal_emission(use the raw*_emissionfields instead);use_diffusion_lower_bcis set without Planck data.
The RTOutput object
solve() returns an RTOutput whose arrays are all indexed by interface
(0 = TOA … num_layers = surface). See Outputs for the full
list, including the mean-intensity convention and the optional Jacobian and
flux-component arrays.