Skip to main content

Crate tpt_sci_climate

Crate tpt_sci_climate 

Source
Expand description

§tpt-sci-climate

Simple climate modelling for the tpt-science pillar, built on tpt_sci_ode. It provides reduced-order models suitable for coupling and teaching:

  • A 0-D energy-balance model EnergyBalanceModel — global-mean surface temperature under incoming shortwave, grey-body longwave outgoing, and a CO₂ radiative-forcing term (ΔF = 5.35·ln(C/C0) W/m²).
  • Multi-band longwave radiative transfer (radiative_transfer) — a simplified multi-band grey-slab scheme MultiBandRadiativeTransfer and a k-distribution CorrelatedKRt, replacing the single grey band of grey_radiative_transfer.
  • A tiny atmospheric chemistry box ChemistryBox for a linear production–loss tracer (e.g. OH-driven CH₄ decay), extended to a 3-D advection–diffusion–reaction tracer field Tracer3D.
  • A genuine primitive-equation atmospheric GCM dynamical core AtmosphereGcm — a 3-D hydrostatic (optionally non-hydrostatic) primitive equation solver, coupled to the EnergyBalanceModel.

These close out the v1 “out of scope” climate items: the single grey band is replaced by a multi-band/correlated-k scheme, chemistry is extended to 3-D transport, and the EBM is backed by a working GCM dynamical core.

§Example

use tpt_sci_climate::EnergyBalanceModel;

let mut ebm = EnergyBalanceModel::new(1.0, 0.3, 0.61, 280.0).unwrap();
// Integrate temperature for a year; it relaxes to equilibrium.
for _ in 0..100 {
    ebm.step(1.0);
}
assert!(ebm.temperature().is_finite());

Structs§

AtmosphereGcm
A 3-D primitive-equation atmospheric dynamical core on a uniform grid.
Band
One spectral band of a simplified (single-slab) multi-band longwave scheme.
ChemistryBox
A minimal atmospheric-chemistry box: dC/dt = P − k·C (constant production P, first-order loss k). Models e.g. a well-mixed CH₄-like tracer.
CorrelatedKBand
One spectral band of a correlated-k longwave scheme: a k-distribution quadrature over g-points.
CorrelatedKRt
A correlated-k longwave radiation scheme: a stack of k-distribution bands, each evaluated at a common column path length m.
EnergyBalanceModel
0-D global energy-balance climate model.
MultiBandRadiativeTransfer
A simplified multi-band longwave radiation scheme (a stack of grey slabs).
Tracer3D
A 3-D atmospheric tracer (e.g. CH₄, OH, aerosol) on a uniform tensor grid.

Enums§

ClimateError
Errors raised by the climate model.

Constants§

CO2_PREINDUSTRIAL
Pre-industrial CO₂ reference (ppm).
SIGMA
Stefan–Boltzmann constant (W·m⁻²·K⁻⁴).

Functions§

grey_radiative_transfer
Single-layer grey-atmosphere radiative temperature: with a grey gas of emissivity eps, the surface temperature Ts = (S·(1−α)/(4·σ·(1−eps/2)))^(1/4).