API Reference

Adapt.adapt — Method
Adapt.adapt(::NumberFormatAdaptor{NF}, obj) where {NF<:Number}

Adaptor that reconstructs arbitrary data structures with all numeric values converted to the specified number format NF.

source
Base.merge — Method

Merges all of the given Variables containers into a single container.

source
Oceananigans.BoundaryConditions.getbc — Method

Implementation of Oceananigans.BoundaryConditions.getbc for variable placeholders that retrieves the input Field from state and returns the value at the given index.

source
Oceananigans.Simulations.run! — Method
run!(integrator; steps, period, Δt)

Run the simulation for steps or a given time period with timestep size Δt (in seconds or Dates.Period).

source
Oceananigans.TimeSteppers.update_state! — Method
update_state!(state::StateVariables, model::AbstractModel, inputs::InputSources; compute_tendencies = true)

Update the state for the given model and inputs; this includes calling update_inputs! and fill_halo_regions! followed by compute_auxiliary! and compute_tendencies!, if compute_tendencies = true.

source
Terrarium.AmbientCO2 — Function

Creates a TracerGas for ambient CO2 with concentration prescribed by an input variable with the given name.

source
Terrarium.FreeDrainage — Method

Alias for PrescribedGradient representing a Neumann-type zero pressure gradient at the bottom of the soil column, thereby allowing free drainage of water.

source
Terrarium.GeothermalHeatFlux — Function

Alias for FluxBoundaryCondition on internal_energy with name geothermal_heat_flux representing the geothermal heat flux at the bottom boundary of the soil column.

source
Terrarium.GroundHeatFlux — Function

Alias for FluxBoundaryCondition on internal_energy with name ground_heat_flux representing the net ground heat flux at the soil surface.

source
Terrarium.adjust_saturation_profile! — Method
adjust_saturation_profile!(
    out,
    i,
    j,
    grid,
    _::SoilHydrology{NF, VerticalFlow, SaturationClosure, SoilHydraulics} where {VerticalFlow<:Terrarium.AbstractVerticalFlow, SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF})}
)

Kernel function that adjusts saturation profiles to account for oversaturation and undersaturation arising due to numerical error. This implementation scans over the saturation profiles at each lateral grid cell and redistributes excess water upward layer-by-layer until reaching the topmost layer, where any remaining excess water is added to the surface_excess_water pool.

source
Terrarium.aerodynamic_resistance — Method
aerodynamic_resistance(i, j, grid, fields, atmos::PrescribedAtmosphere)

Compute the aerodynamic resistance (inverse conductance) at grid cell i, j.

source
Terrarium.aerodynamic_resistance — Method
aerodynamic_resistance(
    i,
    j,
    grid,
    fields,
    atmos::Terrarium.AbstractAtmosphere,
    evtr::PALADYNCanopyEvapotranspiration
) -> Any

Compute the aerodynamic resistance between the ground and canopy as a function of LAI and SAI.

source
Terrarium.air_pressure — Method
air_pressure(i, j, grid, fields, ::PrescribedAtmosphere)

Retrieve or compute the air pressure at the current time step.

source
Terrarium.air_temperature — Method
air_temperature(i, j, grid, fields, ::PrescribedAtmosphere)

Retrieve or compute the air temperature at the current time step.

source
Terrarium.albedo — Method
albedo(i, j, grid, fields, albedo::ConstantAlbedo) -> Any

Return the surface albedo at grid point i, j.

source
Terrarium.albedo — Method
albedo(i, j, grid, fields, ::AbstractAlbedo)

Return the current albedo at the given indices.

source
Terrarium.auxiliary — Function
auxiliary(name, dims; ...)
auxiliary(name, dims, ctor; ...)
auxiliary(name, dims, ctor, params; units, domain, desc)

Convenience constructor method for AuxiliaryVariable.

source
Terrarium.auxiliary_fields — Method
auxiliary_fields(state, components)

Retrieves all Fields from state corresponding to auxiliary variables defined on the given components.

source
Terrarium.canopy_water — Function
canopy_water(i, j, grid, fields, ::AbstractCanopyInterception)

Compute or retrieve the current canopy water storage [kg/m^2].

source
Terrarium.closure! — Method
closure!(state, grid, closure::AbstractClosureRelation, process, args...)

Apply closure for process on the given grid with additional implementation-specific args.

source
Terrarium.closure! — Method
closure!(state, grid, proc::AbstractProcess, args...)

Apply the forward closure mappings for the process proc on the given grid with additional implementation-specific args defined by the coupling interface for the process type. The default implementation calls invclosure! with args for each closure returned by closures.

source
Terrarium.closure! — Method
closure!(state, model::AbstractModel)

Apply all closure relations defined for the given model.

source
Terrarium.closure! — Method
closure!(
    state,
    grid,
    closure::SoilSaturationPressureClosure,
    hydrology::SoilHydrology{NF, RichardsEq, SaturationClosure, SoilHydraulics} where {SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF})},
    soil::Terrarium.AbstractSoil,
    args...
)

Computes pressure_head $Ψ = ψm + ψz + ψh$ from the current saturation_water_ice state.

source
Terrarium.closure_fields — Method
closure_fields(state, components)

Retrieves all Fields from state corresponding to closure variables defined on the given components.

source
Terrarium.closures — Method
closures(proc::AbstractProcess)

Return a tuple of AbstractClosureRelations defined by the given processes type. Note that this is a type-stable, @generated function that is compiled for each argument type.

source
Terrarium.compute_APAR — Method
compute_APAR(
    photo::LUEPhotosynthesis{NF},
    swdown,
    LAI
) -> Any

Computes absorbed PAR limited by the fraction of PAR assimilated at ecosystem level APAR [mol/m²/s], Eq. 62, PALADYN (Willeit 2016).

source
Terrarium.compute_Ag — Method
compute_Ag(
    photo::LUEPhotosynthesis{NF},
    c_1,
    c_2,
    APAR,
    Vc_max,
    β
) -> Any

Computes the gross photosynthesis rate Ag [gC/m²/s], Eqn 2, Haxeltine & Prentice 1996

source
Terrarium.compute_C_veg_tend — Method
compute_C_veg_tend(vegcarbon_dynamics, LAI_b, NPP)

Computes the C_veg tendency based on NPP and the balanced Leaf Area Index LAI_b, Eq. 72, PALADYN (Willeit 2016)

source
Terrarium.compute_GPP — Method
compute_GPP(_::LUEPhotosynthesis{NF}, An) -> Any

Compute the Gross Primary Production rate [kgC/m²/s].

source
Terrarium.compute_JE_JC — Method
compute_JE_JC(
    photo::LUEPhotosynthesis{NF},
    c_1,
    c_2,
    APAR,
    Vc_max
) -> Tuple{Any, Any}

Computes the PAR-limited and the rubisco-activity-limited photosynthesis rates JE and JC [gC/m²/s], Eqn 3+5, Haxeltine & Prentice 1996.

source
Terrarium.compute_LAI_b — Method
compute_LAI_b(vegcarbon_dynamics, C_veg)

Computes LAI_b, the balanced Leaf Area Index based on the vegetation carbon pool C_veg (assuming with bwl = 1), Eqs. 76-79, PALADYN (Willeit 2016).

source
Terrarium.compute_NPP — Method
compute_NPP(autoresp, GPP, Ra)

Computes Net Primary Productivity NPP as the difference between Gross Primary Production GPP and autotrophic respiration Ra in [kgC/m²/s].

source
Terrarium.compute_PAR — Method
compute_PAR(photo::LUEPhotosynthesis{NF}, swdown) -> Any

Computes NET Photosynthetically Active Radiation PAR [mol/m²/s].

source
Terrarium.compute_Ra — Method
compute_Ra(
    autoresp,
    vegcarbon_dynamics,
    T_air,
    T_soil,
    Rd,
    phen,
    C_veg,
    GPP
)

Computes autotrophic respiration Ra as the sum of maintenance respiration Rm and growth respiration Rg in [kgC/m²/s].

source
Terrarium.compute_Rd — Method
compute_Rd(photo::LUEPhotosynthesis, Vc_max, β) -> Any

Computes the leaf respiration rate Rd [gC/m²/s], Eqn 10, Haxeltine & Prentice 1996 and Eq. 10 PALADYN (Willeit 2016).

source
Terrarium.compute_Rm — Method
compute_Rm(
    autoresp,
    vegcarbon_dynamics,
    T_air,
    T_soil,
    Rd,
    phen,
    C_veg
)

Computes maintenance respiration Rm in [kgC/m²/day].

source
Terrarium.compute_Vc_max — Method
compute_Vc_max(
    photo::LUEPhotosynthesis{NF},
    c_1,
    PAR,
    Kc,
    Ko,
    Γ_star,
    pres_i,
    pres_O2
) -> Any

Computes the maximum rate of net photosynthesis Vc_max [gC/m²/s], following the coordination hypothesis (acclimation), see Harrison 2021 Box 2. Note: this is not the same formula in PALADYN paper, this implementaion is taken from the code

source
Terrarium.compute_assimilation_factors — Method
compute_assimilation_factors(
    photo::LUEPhotosynthesis{NF},
    constants::PhysicalConstants{NF},
    Γ_star,
    T_stress,
    Kc,
    Ko,
    pres_i,
    pres_O2
) -> Tuple{Any, Any}

Computes factors for light-limited c_1 [gC/mol] and RuBisCO-limited c_2 [dimensionless] assimilation. Follows Eq. C4-C5 from PALADYN (Willeit 2016) and Haxeltine & Prentice (1996).

  • c1: quantum efficiency × temperature factor × carbon mass / denominator, used in JE = c1 × APAR
  • c2: dimensionless coefficient relating enzyme capacity to assimilation, used in JC = c2 × Vc_max
source
Terrarium.compute_autotrophic_respiration — Function
compute_autotrophic_respiration(
    i, j, grid, fields,
    autoresp::AbstractAutotrophicRespiration,
    vegcarbon::AbstractVegetationCarbonDynamics,
    atmos::AbstractAtmosphere,
    args...
)

Cell-level autotrophic respiration computation. Implementations should compute autotrophic respiration and related diagnostics (e.g. NPP) for the given cell.

source
Terrarium.compute_autotrophic_respiration — Method
compute_autotrophic_respiration(
    i,
    j,
    grid,
    fields,
    autoresp::PALADYNAutotrophicRespiration,
    vegcarbon_dynamics::PALADYNCarbonDynamics,
    atmos::Terrarium.AbstractAtmosphere
) -> Tuple{Any, Any}

Compute autotrophic respiration following the scheme of PALADYN (Willeit 2016).

source
Terrarium.compute_auxiliary! — Function
compute_auxiliary!(
    state,
    grid,
    seb::SurfaceEnergyBalance,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants
)
compute_auxiliary!(
    state,
    grid,
    seb::SurfaceEnergyBalance,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants,
    hydrology::Union{Nothing, Terrarium.AbstractSurfaceHydrology},
    args...
)
source
Terrarium.compute_auxiliary! — Function
compute_auxiliary!(
    state,
    grid,
    evap::PALADYNCanopyEvapotranspiration,
    canopy_interception::Terrarium.AbstractCanopyInterception,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants
)
compute_auxiliary!(
    state,
    grid,
    evap::PALADYNCanopyEvapotranspiration,
    canopy_interception::Terrarium.AbstractCanopyInterception,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants,
    soil::Union{Nothing, Terrarium.AbstractSoil}
)
source
Terrarium.compute_auxiliary! — Function
compute_auxiliary!(state, model::AbstractModel)

Compute updates to all auxiliary variables based on the current prognostic state of the model.

compute_auxiliary!(state, grid, process::AbstractProcess, args...)

Compute all auxiliary state variables for the given process on grid. Implementations of AbstractProcess may define additional args that correspond to different process coupling interfaces.

source
Terrarium.compute_auxiliary! — Function
compute_auxiliary!(
    state,
    grid,
    evap::GroundEvaporation,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants
)
compute_auxiliary!(
    state,
    grid,
    evap::GroundEvaporation,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants,
    soil::Union{Nothing, Terrarium.AbstractSoil}
)
source
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
    state,
    grid,
    rad::DiagnosedRadiativeFluxes,
    seb::Terrarium.AbstractSurfaceEnergyBalance,
    atmos::Terrarium.AbstractAtmosphere,
    consts::PhysicalConstants,
    args...
)
source
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
    state,
    grid,
    tur::DiagnosedTurbulentFluxes,
    seb::Terrarium.AbstractSurfaceEnergyBalance,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants,
    args...
)
source
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
    state,
    grid,
    runoff::DirectSurfaceRunoff,
    canopy_interception::Terrarium.AbstractCanopyInterception,
    soil::Terrarium.AbstractSoil,
    args...
)
source
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
    state,
    grid,
    photo::LUEPhotosynthesis,
    stomcond::Terrarium.AbstractStomatalConductance,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants,
    args...
)
source
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
    state,
    grid,
    stomcond::MedlynStomatalConductance,
    photo::LUEPhotosynthesis,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants,
    args...
)
source
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
    state,
    grid,
    autoresp::PALADYNAutotrophicRespiration,
    vegcarbon::Terrarium.AbstractVegetationCarbonDynamics,
    atmos::Terrarium.AbstractAtmosphere
)
source
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
    state,
    grid,
    rad::PrescribedRadiativeFluxes,
    seb::Terrarium.AbstractSurfaceEnergyBalance,
    atmos::Terrarium.AbstractAtmosphere,
    args...
)
source
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
    state,
    grid,
    hydrology::SurfaceHydrology,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants,
    soil::Terrarium.AbstractSoil
)
source
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
    state,
    grid,
    hydrology::SoilHydrology{NF, RichardsEq, SaturationClosure, SoilHydraulics} where {SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF})},
    soil::Terrarium.AbstractSoil,
    args...
)
source
Terrarium.compute_canopy_interception — Method
compute_canopy_interception(
    canopy_interception::PALADYNCanopyInterception{NF},
    precip,
    LAI,
    SAI
) -> Any

Compute I_can, the canopy rain interception, following Eq. 42, PALADYN (Willeit 2016).

source
Terrarium.compute_energy_tendency — Method
compute_energy_tendency(
    i,
    j,
    k,
    grid,
    fields,
    energy::SoilEnergyBalance{NF, var"#s107", EnergyClosure, ThermalProps} where {var"#s107"<:Terrarium.ExplicitTwoPhaseHeatConduction, EnergyClosure<:Terrarium.AbstractSoilEnergyClosure, ThermalProps<:(SoilThermalProperties{NF})},
    hydrology::Terrarium.AbstractSoilHydrology,
    strat::Terrarium.AbstractStratigraphy,
    bgc::Terrarium.AbstractSoilBiogeochemistry
) -> Any
source
Terrarium.compute_evaporation_canopy — Method
compute_evaporation_canopy(
    _::PALADYNCanopyEvapotranspiration,
    Δq,
    f_can,
    rₐ
) -> Any

Compute evaporation of water intercepted by the canopy from humidity gradient Δq, canopy saturation fraction f_can, and aerodynamic resistance rₐ.

source
Terrarium.compute_evaporation_ground — Method
compute_evaporation_ground(
    _::PALADYNCanopyEvapotranspiration,
    Δq,
    β,
    rₐ,
    rₑ
) -> Any

Compute potential evaporation from the ground below the canopy, following Eq. 5, PALADYN (Willeit 2016); Δq is the humidity gradient, β is the ground evaporation resistance factor, rₐ is aerodynamic resistance, and rₑ is aerodynamic resistance between the ground and canopy.

source
Terrarium.compute_f_temp — Method
compute_f_temp(autoresp, T_air, T_soil)

Computes temperature factors f_temp_air and f_temp_soil for autotrophic respiration.

source
Terrarium.compute_ground_heat_flux! — Method
compute_ground_heat_flux!(
    state,
    grid,
    skinT::Terrarium.AbstractSkinTemperature,
    seb::Terrarium.AbstractSurfaceEnergyBalance
)

Compute ground_heat_flux as the residual R_\text{net} - H_s - H_l.

source
Terrarium.compute_ground_heat_flux — Method
compute_ground_heat_flux(
    i,
    j,
    grid,
    fields,
    skinT::Terrarium.AbstractSkinTemperature,
    _::Terrarium.AbstractRadiativeFluxes,
    _::Terrarium.AbstractTurbulentFluxes
) -> Any

Compute the ground heat flux from the surface net radiation and sensible/latent heat flux at grid cell i, j.

source
Terrarium.compute_ground_heat_flux — Method
compute_ground_heat_flux(
    _::Terrarium.AbstractSkinTemperature,
    R_net,
    H_s,
    H_l
) -> Any

Compute the ground heat flux as the residual of the net radiation R_net and the sensible H_s and latent H_l heat flux.

source
Terrarium.compute_gw_can — Method
compute_gw_can(
    stomcond::MedlynStomatalConductance{NF},
    photo::LUEPhotosynthesis{NF},
    vpd,
    An,
    co2,
    LAI,
    β
) -> Any

Compute canopy-level water conductance [m/s] from the Medlyn et al. (2011) optimal stomatal conductance model. Includes minimum conductance and light extinction effects based on LAI, scaled by soil moisture factor β.

source
Terrarium.compute_humidity_vpd — Function
compute_humidity_vpd(
    i,
    j,
    grid,
    fields,
    atmos::Terrarium.AbstractAtmosphere,
    c::PhysicalConstants
) -> Any
compute_humidity_vpd(
    i,
    j,
    grid,
    fields,
    atmos::Terrarium.AbstractAtmosphere,
    c::PhysicalConstants,
    Ts
) -> Any

Computes the specific humidity (vapor pressure) deficit over a surface at temperature Ts from the current atmospheric fields.

source
Terrarium.compute_hydraulics! — Function
compute_hydraulics!(state, grid, hydrology::SoilHydrology, soil::AbstractSoil, args...)

Compute all state-dependent hydraulic auxiliaries such as hydraulic conductivity and field capacity, and wilting point.

source
Terrarium.compute_hydraulics! — Method
compute_hydraulics!(
    out,
    i,
    j,
    k,
    grid,
    fields,
    hydrology::SoilHydrology,
    strat::Terrarium.AbstractStratigraphy,
    bgc::Terrarium.AbstractSoilBiogeochemistry
)

Kernel function that computes soil hydraulics and unsaturated hydraulic conductivity.

source
Terrarium.compute_infiltration — Method
compute_infiltration(
    runoff::DirectSurfaceRunoff{NF},
    influx,
    sat_top,
    max_infil
) -> Any

Compute infiltration from the given influx (water available for infiltration), saturation of the uppermost soil layer sat_top, and the maximum allowed infiltration max_infil.

source
Terrarium.compute_kinetic_parameters — Method
compute_kinetic_parameters(
    photo::LUEPhotosynthesis{NF},
    T_air
) -> Tuple{Any, Any, Any}

Computes kinetic parameters τ, Kc, Ko based on temperature using Q10 temperature response. Follows enzyme kinetics from Haxeltine & Prentice (1996), Appendix C.

  • τ: Rubisco specificity factor (CO₂ to O₂ carboxylation ratio), dimensionless
  • Kc: Michaelis-Menten constant for CO₂ [Pa]
  • Ko: Michaelis-Menten constant for O₂ [Pa]
source
Terrarium.compute_latent_heat_flux — Method
compute_latent_heat_flux(
    i,
    j,
    grid,
    fields,
    tur::DiagnosedTurbulentFluxes,
    evtr::Terrarium.AbstractEvapotranspiration,
    constants::PhysicalConstants
) -> Any

Compute the latent heat flux at i, j based on the given evapotranspiration scheme. This implementation derives the latent heat flux from the surface_humidity_flux defined by evtr which is assumed to be already computed.

source
Terrarium.compute_latent_heat_flux — Method
compute_latent_heat_flux(
    i,
    j,
    grid,
    fields,
    tur::DiagnosedTurbulentFluxes,
    skinT::Terrarium.AbstractSkinTemperature,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants
) -> Any

Compute the bare ground latent heat flux at i, j based on the current skin temperature and atmospheric conditions. This imlementation assumes that evaporation is the only contributor to the latent heat flux.

source
Terrarium.compute_latent_heat_flux — Method
compute_latent_heat_flux(
    _::DiagnosedTurbulentFluxes,
    Q_h,
    ρₐ,
    Lsl
) -> Any

Compute the latent heat flux as a function of the humidity flux Q_h [m/s], the density ρₐ [kg/m³] of air, and the specific latent heat of fusion Lsl [J/kg].

source
Terrarium.compute_longwave_up — Method
compute_longwave_up(::DiagnosedRadiativeFluxes, constants::PhysicalConstants, surface_longwave_down, Ts, ϵ)

Compute outgoing longwave radiation from incoming surface_longwave_down, surface temperature Ts, and emissivity ϵ.

source
Terrarium.compute_phenology — Function
compute_phenology(i, j, grid, fields, phenol::AbstractPhenology)

Cell-level phenology computation. Implementations return phenology factors and derived LAI at the given index i, j.

source
Terrarium.compute_phenology — Method
compute_phenology(
    i,
    j,
    grid,
    fields,
    phenol::PALADYNPhenology
) -> Tuple{Any, Any}

Compute the phenology factor and instantaneous leaf area index (LAI).

source
Terrarium.compute_photosynthesis — Function
compute_photosynthesis(i, j, grid, fields, photo::AbstractPhotosynthesis, atmos::AbstractAtmosphere)

Cell-level photosynthesis computation. Implementations compute leaf respiration and net assimilation for a single horizontal cell and return the pair (Rd, An, GPP) or similar outputs as required by the photosynthesis scheme.

source
Terrarium.compute_photosynthesis — Method
compute_photosynthesis(
    i,
    j,
    grid,
    fields,
    photo::LUEPhotosynthesis,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants
) -> Tuple{Any, Any, Any}

Compute photosynthesis, leaf respiration, and gross primary production at a single grid point. Returns instantaneous rates in [gC/m²/s] and [kgC/m²/s] for integration by the timestepper.

source
Terrarium.compute_plant_available_water — Function
compute_plant_available_water(
    i, j, k, grid, fields,
    paw::AbstractPlantAvailableWater,
    soil::AbstractSoil
)

Comptue the plant-available water fraction for grid cell i, j and soil layer k.

source
Terrarium.compute_plant_available_water! — Method
compute_plant_available_water!(
    out,
    i,
    j,
    k,
    grid,
    fields,
    paw::FieldCapacityLimitedPAW{NF},
    strat::Terrarium.AbstractStratigraphy,
    hydrology::Terrarium.AbstractSoilHydrology,
    bgc::Terrarium.AbstractSoilBiogeochemistry,
    args...
) -> Any

Mutating wrapper for compute_plant_available_water that stores the result in out.

source
Terrarium.compute_plant_available_water — Method
compute_plant_available_water(
    i,
    j,
    k,
    grid,
    fields,
    paw::FieldCapacityLimitedPAW{NF},
    strat::Terrarium.AbstractStratigraphy,
    hydrology::Terrarium.AbstractSoilHydrology,
    bgc::Terrarium.AbstractSoilBiogeochemistry
) -> Any

Compute the plant avaialble water given the current soil stratigraphy, hydrology, and biogeochemistry state in fields.

source
Terrarium.compute_precip_ground — Method
compute_precip_ground(_, precip, I_can, R_can)

Compute precip_ground, the rate of rain reaching the ground, following a modified version of Eq. 44, PALADYN (Willeit 2016). Instead of subtracting the tendency, we just directly subtract interception and add the removal rate R_can.

source
Terrarium.compute_pres_i — Method
compute_pres_i(photo::LUEPhotosynthesis, λc, pres_a) -> Any

Computes intercellular CO2 partial pressure [Pa], Eq. 67, PALADYN (Willeit 2016).

source
Terrarium.compute_radiative_fluxes! — Method
compute_radiative_fluxes!(
    out,
    i,
    j,
    grid,
    fields,
    rad::PrescribedRadiativeFluxes,
    atmos::Terrarium.AbstractAtmosphere,
    args...
) -> Any

Compute net radiation and store in auxiliary fields at a grid point.

source
Terrarium.compute_respiration_assimilation — Method
compute_respiration_assimilation(
    photo::LUEPhotosynthesis{NF},
    constants::PhysicalConstants{NF},
    T_air,
    swdown,
    pres,
    co2,
    LAI,
    λc,
    β
) -> Tuple{Any, Any}

Compute and return leaf respiration [gC/m²/s] and net assimilation [gC/m²/s] rates.

source
Terrarium.compute_saturation_tendency! — Method
compute_saturation_tendency!(
    saturation_water_ice_tendency,
    i,
    j,
    k,
    grid,
    clock,
    fields,
    hydrology::SoilHydrology,
    strat::Terrarium.AbstractStratigraphy,
    bgc::Terrarium.AbstractSoilBiogeochemistry,
    constants::PhysicalConstants,
    evtr::Union{Nothing, Terrarium.AbstractEvapotranspiration}
)
source
Terrarium.compute_sensible_heat_flux — Method
compute_sensible_heat_flux(
    i,
    j,
    grid,
    fields,
    tur::DiagnosedTurbulentFluxes,
    skinT::Terrarium.AbstractSkinTemperature,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants
) -> Any

Compute the sensible heat flux at i, j based on the current skin temperature and atmospheric conditions.

source
Terrarium.compute_sensible_heat_flux — Method
compute_sensible_heat_flux(
    _::DiagnosedTurbulentFluxes,
    Q_T,
    ρₐ,
    cₐ
) -> Any

Compute the sensible heat flux as a function of the bulk aerodynamic temperature gradient Q_T [K m/s] and the density ρₐ [kg/m³] and specific heat capacity cₐ [J/kg K] of air.

source
Terrarium.compute_shortwave_up — Method
compute_shortwave_up(::DiagnosedRadiativeFluxes, surface_shortwave_down, α)

Compute outgoing shortwave radiation from the incoming surface_shortwave_down and albedo α.

source
Terrarium.compute_skin_temperature — Method
compute_skin_temperature(
    i,
    j,
    grid,
    fields,
    skinT::ImplicitSkinTemperature
) -> Any

Estimate the skin temperature from the current ground_heat_flux at grid cell i, j.

source
Terrarium.compute_skin_temperature — Method
compute_skin_temperature(
    skinT::ImplicitSkinTemperature,
    Tg,
    G,
    Δz
) -> Any

Compute the implicit update of the skin temperature from the given ground surface temperature Tg, ground heat flux G, and distance Δz.

source
Terrarium.compute_stomatal_conductance — Function
compute_stomatal_conductance(
    i, j, grid, fields,
    stomcond::AbstractStomatalConductance,
    photo::AbstractPhotosynthesis,
    atmos::AbstractAtmosphere,
    constants::PhysicalConstants,
    args...
)

Cell-level stomatal conductance computation. Returns stomatal/canopy conductance and internal CO₂ ratio for the specified cell.

source
Terrarium.compute_stomatal_conductance — Method
compute_stomatal_conductance(
    i,
    j,
    grid,
    fields,
    stomcond::MedlynStomatalConductance{NF},
    photo::LUEPhotosynthesis{NF},
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants,
    args...
) -> Tuple{Any, Any}

Compute stomatal conductance (gwcan) and leaf-to-air CO₂ ratio (λc) at a grid point. Returns tuple (gwcan, λc) for use in photosynthesis and transpiration calculations.

source
Terrarium.compute_surface_drainage — Method
compute_surface_drainage(
    runoff::DirectSurfaceRunoff{NF},
    surface_excess_water
) -> Any

Compute surface drainage flux from the current surface_excess_water resevoir state.

source
Terrarium.compute_surface_energy_fluxes! — Function
compute_surface_energy_fluxes!(
    out,
    i,
    j,
    grid,
    fields,
    seb::SurfaceEnergyBalance,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants
)
compute_surface_energy_fluxes!(
    out,
    i,
    j,
    grid,
    fields,
    seb::SurfaceEnergyBalance,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants,
    evtr::Union{Nothing, Terrarium.AbstractEvapotranspiration},
    args...
)

Fused kernel function that computes the radiative and turbulent fluxes, as well as the ground heat flux.

source
Terrarium.compute_surface_energy_fluxes! — Function
compute_surface_energy_fluxes!(state, grid, ::AbstractSurfaceEnergyBalance, args...)

Compute the surface energy fluxes and skin temperature from the current state and grid. The required args are implementation dependent.

source
Terrarium.compute_surface_energy_fluxes! — Function
compute_surface_energy_fluxes!(
    state,
    grid,
    seb::SurfaceEnergyBalance,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants
)
compute_surface_energy_fluxes!(
    state,
    grid,
    seb::SurfaceEnergyBalance,
    atmos::Terrarium.AbstractAtmosphere,
    constants::PhysicalConstants,
    hydrology::Union{Nothing, Terrarium.AbstractSurfaceHydrology},
    args...
)

Compute the surface energy fluxes on grid based on the current atmospheric state.

source
Terrarium.compute_surface_excess_water_tendency — Method
compute_surface_excess_water_tendency(
    i,
    j,
    k,
    grid,
    clock,
    fields,
    hydrology::SoilHydrology,
    runoff::Union{Nothing, Terrarium.AbstractSurfaceRunoff}
) -> Any

Kernel function for computing the tendency of the prognostic surface_excess_water variable in all grid cells.

source
Terrarium.compute_surface_runoff — Method
compute_surface_runoff(
    runoff::DirectSurfaceRunoff,
    precip_ground,
    surface_drainage,
    infil
) -> Any

Compute surface runoff as precipitation + surface_drainage - infiltration.

source
Terrarium.compute_surface_upwelling_radiation — Method
compute_surface_upwelling_radiation(
    i,
    j,
    grid,
    fields,
    rad::PrescribedRadiativeFluxes,
    args...
) -> NamedTuple{(:surface_shortwave_up, :surface_longwave_up), <:Tuple{Any, Any}}

Compute upwelling shortwave and longwave radiation at a grid point.

source
Terrarium.compute_tendencies! — Function
compute_tendencies!(state, model::AbstractModel)

Compute tendencies for all prognostic state variables for model stored in the given state. This method should be called after compute_auxiliary!.

compute_tendencies!(state, grid, process::AbstractProcess, args...)

Compute the tendencies of all prognostic state variables for the given process on grid. Implementations of AbstractProcess may define additional args that correspond to different process coupling interfaces.

source
Terrarium.compute_tendencies! — Method
compute_tendencies!(
    state,
    grid,
    canopy_interception::PALADYNCanopyInterception,
    evapotranspiration::Terrarium.AbstractEvapotranspiration,
    args...
)
source
Terrarium.compute_tendencies! — Method
compute_tendencies!(
    state,
    grid,
    hydrology::SoilHydrology{NF, RichardsEq, SaturationClosure, SoilHydraulics} where {SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF})},
    soil::Terrarium.AbstractSoil,
    constants::PhysicalConstants
)
compute_tendencies!(
    state,
    grid,
    hydrology::SoilHydrology{NF, RichardsEq, SaturationClosure, SoilHydraulics} where {SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF})},
    soil::Terrarium.AbstractSoil,
    constants::PhysicalConstants,
    evtr::Union{Nothing, Terrarium.AbstractEvapotranspiration}
)
compute_tendencies!(
    state,
    grid,
    hydrology::SoilHydrology{NF, RichardsEq, SaturationClosure, SoilHydraulics} where {SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF})},
    soil::Terrarium.AbstractSoil,
    constants::PhysicalConstants,
    evtr::Union{Nothing, Terrarium.AbstractEvapotranspiration},
    runoff::Union{Nothing, Terrarium.AbstractSurfaceRunoff},
    args...
)
source
Terrarium.compute_thermal_conductivity — Method
compute_thermal_conductivity(
    i,
    j,
    k,
    grid,
    fields,
    energy::SoilEnergyBalance,
    hydrology::Terrarium.AbstractSoilHydrology,
    strat::Terrarium.AbstractStratigraphy,
    bgc::Terrarium.AbstractSoilBiogeochemistry
) -> Any
source
Terrarium.compute_transpiration — Method
compute_transpiration(
    _::PALADYNCanopyEvapotranspiration{NF},
    Δq,
    rₐ,
    gw_can
) -> Any

Compute potential transpiration from the given humidity gradient, aerodynamic resistance rₐ and stomatal conductance gw_can.

source
Terrarium.compute_veg_carbon_tendency — Function
compute_veg_carbon_tendency(i, j, grid, fields, vegcarbon::AbstractVegetationCarbonDynamics)

Cell-level vegetation-carbon tendency computation. Implementations compute the tendency for the total vegetation carbon pool at the given index i, j.

source
Terrarium.compute_veg_carbon_tendency — Method
compute_veg_carbon_tendency(
    i,
    j,
    grid,
    fields,
    vegcarbon_dynamics::PALADYNCarbonDynamics
) -> Any

Compute the tendency for the carbon vegetation pool given fields LAI_b and NPP.

source
Terrarium.compute_volumetric_water_content_tendency — Method
compute_volumetric_water_content_tendency(
    i,
    j,
    k,
    grid,
    clock,
    fields,
    hydrology,
    constants,
    evapotranspiration
)

Compute the volumetric water content (VWC) tendency at grid cell i, j k according to the Richardson-Richards equation. Note that the VWC tendency is not scaled by the porosity and is thus not the same as the saturation tendency.

source
Terrarium.compute_volumetric_water_content_tendency — Method
compute_volumetric_water_content_tendency(
    i,
    j,
    k,
    grid,
    clock,
    fields,
    hydrology::SoilHydrology{NF, VerticalFlow, SaturationClosure, SoilHydraulics} where {VerticalFlow<:Terrarium.AbstractVerticalFlow, SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF})},
    constants::PhysicalConstants,
    evtr::Union{Nothing, Terrarium.AbstractEvapotranspiration}
) -> Any

Compute the volumetric water content (VWC) tendency at grid cell i, j k f. Note that the VWC tendency is not scaled by the porosity and is thus not the same as the saturation tendency.

source
Terrarium.compute_vpd — Function
compute_vpd(
    i,
    j,
    grid,
    fields,
    atmos::Terrarium.AbstractAtmosphere,
    c::PhysicalConstants
) -> Any
compute_vpd(
    i,
    j,
    grid,
    fields,
    atmos::Terrarium.AbstractAtmosphere,
    c::PhysicalConstants,
    Ts
) -> Any

Computes the vapor pressure deficit over a surface at temperature Ts from the current atmospheric fields.

source
Terrarium.compute_vpd — Method
compute_vpd(c, pres, q_air, T)

Computes the vapor pressure deficit over a surface at temperature T from the given surface pressure pres and specific humidity of air q_air.

source
Terrarium.compute_w_can_tendency — Method
compute_w_can_tendency(
    _::PALADYNCanopyInterception{NF},
    I_can,
    E_can,
    R_can
) -> Any

Compute the w_can tendency and removal rate following Eq. 41, PALADYN (Willeit 2016).

source
Terrarium.compute_water_table! — Method
compute_water_table!(
    water_table,
    i,
    j,
    grid,
    sat,
    _::SoilHydrology{NF, VerticalFlow, SaturationClosure, SoilHydraulics} where {VerticalFlow<:Terrarium.AbstractVerticalFlow, SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF})}
)

Kernel function that diagnoses the water table at grid cell i, j given the current soil saturation profile.

source
Terrarium.compute_Γ_star — Method
compute_Γ_star(
    photo::LUEPhotosynthesis{NF},
    τ,
    pres_O2
) -> Any

Computes the CO₂ compensation point Γ_star [Pa]. The intercellular CO₂ partial pressure at which gross photosynthesis equals respiration. Follows Eq. C6, PALADYN (Willeit 2016).

source
Terrarium.compute_Λ_loc — Method
compute_Λ_loc(vegcarbon_dynamics, LAI_b)

Computes the local litterfall rate Λ_loc based on the balanced Leaf Area Index LAI_b (assuming evergreen PFTs), Eq. 75, PALADYN (Willeit 2016).

source
Terrarium.compute_λ_NPP — Method
compute_λ_NPP(vegcarbon_dynamics, LAI_b)

Computes λ_NPP,a factor determining the partitioning of NPP between increase of vegetation carbon of the existing vegetated area and spreading of the given PFT based on the balanced Leaf Area Index LAI_b, Eq. 74, PALADYN (Willeit 2016).

source
Terrarium.compute_λc — Method
compute_λc(stomcond, vpd)

Computes the ratio of leaf-internal and air CO2 concentration λc, derived from the optimal stomatal conductance model (Medlyn et al. 2011), Eq. 71, PALADYN (Willeit 2016).

source
Terrarium.compute_ν_star — Method
compute_ν_star(veg_dynamics, ν)

Computes ν_star which is the maximum of the current vegetation fraction ν and the seed fraction ν_seed [-], to ensure that a PFT is always seeded.

source
Terrarium.compute_ν_tendency — Function
compute_ν_tendency(
    i, j, grid, fields,
    veg_dynamics::AbstractVegetationDynamics,
    vegcarbon::AbstractVegetationCarbonDynamics
)

Cell-level vegetation-fraction tendency computation used by vegetation dynamics. Implementations compute the local tendency value for ν at the given index i, j.

source
Terrarium.compute_ν_tendency — Method
compute_ν_tendency(
    i,
    j,
    grid,
    fields,
    veg_dynamics::PALADYNVegetationDynamics,
    vegcarbon_dynamics::PALADYNCarbonDynamics
) -> Any

Compute vegetation area fraction tendency at a single grid point from NPP-productivity and disturbance rates.

source
Terrarium.compute_ν_tendency — Method
compute_ν_tendency(
    veg_dynamics,
    vegcarbon_dynamics,
    LAI_b,
    C_veg,
    NPP,
    ν
)

Computes the vegetation fraction tendency for a single PFT, Eq. 73, PALADYN (Willeit 2016).

source
Terrarium.convert_dt — Method
convert_dt(Δt)

Convert Δts of type Period to a numeric value in seconds. Return Δt if already a number.

source
Terrarium.darcy_flux — Method
darcy_flux(i, j, k, grid, ψ, K)

Kernel function for computing the Darcy flux over layer faces from the pressure head ψ and hydraulic conductivity K.

source
Terrarium.daytime_length — Method
daytime_length(i, j, grid, fields, ::AbstractAtmosphere{PR, <:LongShortWaveRadiation})

Retrieve the length of the day (in hours) at grid cell i, j. Defaults to a constant 12 hours if no input is provided.

source
Terrarium.debug! — Method
debug!(debug::Bool)

Enable or disable global debug mode for Terrarium. Debug mode

source
Terrarium.debughook! — Method
debughook!(args)

Provides a "hook" for handling debug calls from relevant callsites. Default implementations for Field and NamedTuple (assumed to be of Fields) simply forward to nancheck!.

source
Terrarium.debugsite! — Method
debugsite!(args)

Utility method that forwards args to debughook! if and only if debug mode is enabled. Debug mode is set by the global variable DEBUG which can be toggled by the user facing API debug!.

source
Terrarium.deduplicate — Method
deduplicate(values)

Filter out duplicates from the given tuple. Note that this method is not type stable or allocation-free!

source
Terrarium.default_dt — Function
default_dt(timestepper::AbstractTimeStepper)

Get the current timestep size for the time stepper.

source
Terrarium.density_soc — Function
density_soc(i, j, k, grid, fields, bgc::AbstractSoilBiogeochemistry)

Compute or return the soil organic carbon density at grid cell index i, j, k.

source
Terrarium.density_soc — Method
density_soc(i, j, k, grid, fields, bgc)

Calculate the organic solid fraction based on the prescribed SOC and natural porosity/density of the organic material.

source
Terrarium.drag_coefficient — Method
drag_coefficient(i, j, grid, fields, aero::AbstractAerodynamics)

Compute the bulk drag coefficient for heat and moisture transfer at grid cell i, j.

source
Terrarium.emissivity — Method
emissivity(
    i,
    j,
    grid,
    fields,
    albedo::ConstantAlbedo
) -> Any

Return the surface emissivity at grid point i, j.

source
Terrarium.emissivity — Method
emissivity(i, j, grid, fields, ::AbstractAlbedo)

Return the current emissivity at the given indices.

source
Terrarium.energy_to_temperature — Method

Calculate the inverse enthalpy function given the internal energy, latent heat content, and heat capacity under the free water freezing characteristic.

source
Terrarium.explicit_step! — Method
explicit_step!(state, grid, timestepper, Δt)

Evaluate an explicit update u += ∂u∂t*Δt for all prognostic fields and their corresponding tendencies. By default, this is implemented as a simple Euler update u += dudt*Δt which can serve as a building block for more complex, multi-stage timesteppers. Where necessary, additional dispatches of explicit_step_kernel!(field, tendency, ::AbstractLandGrid, ::TimeStepper, Δt) can be defined to implement more specialized time-stepping schemes.

source
Terrarium.explicit_step! — Method

Accumulate tendency*Δt in the given prognostic field. This method can be overridden by specialized timestepping schemes as needed.

source
Terrarium.fastiterate — Method
fastiterate(f!::F, iters::NTuple{N,Any}...) where {F,N}

Same as fastmap but simply invokes f! on each argument set without constructing a tuple.

source
Terrarium.fastmap — Method
fastmap(f::F, iter::NamedTuple...) where {F}

Same as map for NamedTuples but with guaranteed type stability. fastmap is a @generated function which unrolls calls to f into a loop-free tuple construction expression. All named tuples must have the same keys but in no particular order. The returned NamedTuple

source
Terrarium.fastmap — Method
fastmap(f::F, iter::NTuple{N,Any}...) where {F,N}

Same as map for NTuples but with guaranteed type stability. fastmap is a @generated function which unrolls calls to f into a loop-free tuple construction expression.

source
Terrarium.findfirst_z — Method
findfirst_z(i, j, condition_func, z_nodes, field)

2D kernel function that finds the first coordinate in z_nodes where condition_func(field[i, j, k]). This implementation performs a linear scan over the z-axis and thus has time complexity O(N_z).

source
Terrarium.forcing — Method
forcing(i, j, k, grid, clock, fields, evtr::AbstractEvapotranspiration, ::AbstractSoilHydrology)

Compute and return the evapotranspiration forcing for soil moisture at the given indices i, j, k. The ET forcing is just the surface_humidity_flux rescaled by the thickness of layer k.

source
Terrarium.forcing — Method
forcing(i, j, k, grid, clock, fields, forcing::AbstractForcing, target::AbstractProcess, args...)

Return the value computed by the given Oceananigans forcing type, which should be an instance of either DiscreteForcing or ContinuousForcing. Note that target and additional args are only included for interface consistency and are not passed through to forcing.

source
Terrarium.get_albedo — Method
get_albedo(seb)

Return the albedo parameterization associated with the surface energy balance.

source
Terrarium.get_closure — Method
get_closure(
    hydrology::SoilHydrology
) -> Terrarium.AbstractSoilWaterClosure

Return the saturation-pressure closure defined by the given hydrology process, or nothing if not defined for the given configuration.

source
Terrarium.get_constants — Method
get_constants(model::AbstractModel)::PhysicalConstants

Return the PhysicalConstants associated with the given model.

source
Terrarium.get_field — Method
get_field(
    state,
    var::Terrarium.AbstractVariable{name}
) -> Any

Retrieves the Field from state matching the name of the given variable.

source
Terrarium.get_field_grid — Function
get_field_grid(grid::AbstractLandGrid)::Oceananigans.AbstractGrid

Returns the underlying Oceananigans grid type for Fields defined on the given land grid.

source
Terrarium.get_fields — Method
get_fields(
    state,
    vars::Tuple{Vararg{Terrarium.AbstractVariable}}
) -> NamedTuple

Retrieves all Fields from state matching the names of the given variables.

source
Terrarium.get_fields — Method
get_fields(state, components; except)

Retrieves all non-tendency Fields from state defined on the given components.

source
Terrarium.get_fields — Method
get_fields(state, queries::Union{Symbol, Pair}...)

Retrieves fields with names given in queries and returns them in a NamedTuple. Each argument in queries can either be a Symbol corresponding to a field/variable defined in the namespace of state or a Pair{Symbol, Tuple} where the key is the child namespace and the value is a tuple of queries from that namespace.

Warning

This method relies on runtime dispatch and thus should not be used in performance-critical code. If you need to query fields for specific sets of variables or components, use one of the type-stable variants instead.

# initialize model
state = initialize(model)
# get the temperature and saturation_water_ice fields
fields = get_fields(state, :temperature, :saturation_water_ice)
# extract temperature as well as variables from a namespace
nested_fields = get_fields(state, :temperature, :namespace => (:subvar1, :subvar2))
source
Terrarium.get_grid — Method
get_grid(model::AbstractModel)::AbstractLandGrid

Return the spatial grid associated with the given model.

source
Terrarium.get_hydraulic_properties — Method
get_hydraulic_properties(
    hydrology::SoilHydrology
) -> Terrarium.AbstractSoilHydraulics

Return the soil hydraulic properties defined by the given hydrology process.

source
Terrarium.get_initializer — Method
get_initializer(model::AbstractModel)::AbstractInitializer

Return the initializer associated with the given model.

source
Terrarium.get_spacing — Method
get_spacing(spacing)

Return a Vector of vertical layer thicknesses according to the given discretization.

source
Terrarium.get_swrc — Function
get_swrc(::AbstractUnsatK)

Return the soil water retention curve associated with the given unsaturated hydraulic conductivity scheme.

source
Terrarium.get_swrc — Method
get_swrc(hydrology::SoilHydrology) -> Any

Return the soil water retention curve from the hydraulic_properties associated with the given SoilHydrology configuration.

source
Terrarium.get_swrc — Method
get_swrc(hydrology::AbstractSoilHydrology)

Return the soil water retention curve from the hydraulic_properties associated with the given soil hydrology configuration.

source
Terrarium.get_thermal_properties — Function
get_thermal_properties(energy::AbstractSoilEnergyBalance)

Return the thermal properites associated with the given soil energy balance process.

source
Terrarium.ground_evaporation_resistance_factor — Function
ground_evaporation_resistance_factor(i, j, grid, fields, :AbstractGroundEvaporationResistanceFactor, args...)

Compute the resistance factor against ground evaporation [-] based on the current state and implementation-specific process dependencies in args.

source
Terrarium.ground_heat_flux — Method
ground_heat_flux(i, j, grid, fields, ::AbstractSkinTemperature)

Return the current ground heat flux at the given indices.

source
Terrarium.ground_precipitation — Function
ground_precipitation(i, j, grid, fields, ::AbstractCanopyInterception)

Compute or retrieve the current rate of precipitation reaching the ground [m/s].

source
Terrarium.hydraulic_conductivity — Function

Compute (variably saturated) hydraulic conductivity based on the given hydraulic properties, soil water retention curve (SWRC), and volumetric fractions.

source
Terrarium.hydraulic_conductivity — Method
hydraulic_conductivity(
    i,
    j,
    k,
    grid,
    fields,
    hydrology,
    strat,
    bgc
)

Compute the hydraulic conductivity at the center of the grid cell i, j, k.

source
Terrarium.initialize! — Function
initialize!(state, model::AbstractModel)

Initialize all variables defined in state which are defined by model. This defaults to simply calling initialize!(state, model, get_initializer(model)).

initialize!(state, model::AbstractModel, initializer::AbstractInitializer)

Initialize the model state variables using the corresponding initializer. This method only needs to be implemented if initialization routines are necessary in addition to direct field/variable initializers.

initialize!(state, grid, process::AbstractProcess, args...)

Initialize all state variables associated with the given process on grid. Implementations of AbstractProcess may define additional args that correspond to different process coupling interfaces.

source
Terrarium.initialize! — Method
initialize!(
    state,
    grid,
    energy::SoilEnergyBalance,
    soil::Terrarium.AbstractSoil,
    constants::PhysicalConstants,
    args...
)
source
Terrarium.initialize! — Method
initialize!(fields, _::InputSource, clock)

Initializes the input source. Default implementation does nothing.

source
Terrarium.initialize! — Method

Resets the simulation clock and calls initialize!(state, model) on the underlying model which should reset all state variables to their values as defiend by the model initializer.

source
Terrarium.initialize! — Method
initialize!(
    state,
    grid,
    hydrology::SoilHydrology{NF, RichardsEq, SaturationClosure, SoilHydraulics} where {SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF})},
    soil::Terrarium.AbstractSoil,
    constants::PhysicalConstants,
    args...
)
source
Terrarium.initialize! — Method
initialize!(state, inits::NamedTuple{names}) -> Any

Initialize the state with Field initializers (any valid argument to set!) in inits.

source
Terrarium.initialize — Method
initialize(
    var::AuxiliaryVariable,
    grid::Terrarium.AbstractLandGrid,
    clock::Clock,
    boundary_conditions::NamedTuple,
    fields::NamedTuple
) -> Any

Initialize a Field on grid for the given AuxiliaryVariable.

source
Terrarium.initialize — Method
initialize(::AbstractTimeStepper, model, state) where {NF}

Initialize and return the time stepping state cache for the given time stepper.

source
Terrarium.initialize — Method
initialize(
    var::Terrarium.AbstractVariable,
    grid::Terrarium.AbstractLandGrid,
    clock::Clock,
    boundary_conditions::NamedTuple,
    fields::NamedTuple
) -> Any

Initialize a Field on grid based on the given var metadata. The named tuple of boundary_conditions should follow the standard convention of (var1 = (; top, bottom, ...), var2 = (; top, bottom, ...)). If fields contains a Field matching the name of var, this field will be directly returned. Otherwise, the new Field is constructed using the given boundary_conditions with the other fields being made available to the constructor for auxiliary variables.

source
Terrarium.initialize — Method
initialize(
    model::Terrarium.AbstractModel{NF, Grid} where Grid<:(Terrarium.AbstractLandGrid{NF}),
    timestepper::Terrarium.AbstractTimeStepper,
    inputs::InputSource...;
    clock,
    boundary_conditions,
    initializers,
    fields
) -> ModelIntegrator{_A, Arch, _B, _C, _D, StateVars, @NamedTuple{}} where {_A, Arch<:Oceananigans.Architectures.AbstractArchitecture, _B<:Terrarium.AbstractLandGrid{_A, Arch}, _C<:Terrarium.AbstractTimeStepper{_A}, _D<:Terrarium.AbstractModel{_A, _B}, StateVars<:(StateVariables{NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, ClockType} where {NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, ClockType<:(Clock{_A, Float64, Int64, Int64} where _A)})}

Creates and initializes a ModelIntegrator for the given model and timestepper with input variables populated by the given inputs. This method allocates all necessary Fields for the state variables and subsequently calls initialize!(::ModelIntegrator).

Note that this method is not type stable and thus should not be called from Enzyme autodiff. To reinitialize the model for an existing state, use initialize!(state, model).

See the docstring for initialize(::AbstractModel) for further details.

source
Terrarium.initialize — Method
initialize(
    process::Terrarium.AbstractProcess{NF},
    grid::Terrarium.AbstractLandGrid{NF};
    clock,
    input_variables,
    boundary_conditions,
    initializers,
    fields
) -> StateVariables{NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, ClockType} where {NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, ClockType<:(Clock{_A, Float64, Int64, Int64} where _A)}

Initialize a StateVariables data structure containing Fields defined on the given grid for all variables defined by process. Any predefined boundary_conditions and fields will be passed through to initialize for each variable.

source
Terrarium.initialize — Method
initialize(
    vars::Terrarium.Variables,
    grid::Terrarium.AbstractLandGrid{NF};
    clock,
    boundary_conditions,
    initializers,
    fields
) -> StateVariables{NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, Clock{Float64, Float64, Int64, Int64}} where {NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J}

Initialize a StateVariables data structure containing Fields defined on the given grid for all variables in vars. Any predefined boundary_conditions and fields will be passed through to initialize for each variable.

source
Terrarium.initialize — Method
initialize(
    model::Terrarium.AbstractModel{NF, Grid} where Grid<:(Terrarium.AbstractLandGrid{NF});
    clock,
    input_variables,
    boundary_conditions,
    initializers,
    fields
) -> StateVariables{NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, ClockType} where {NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, ClockType<:(Clock{_A, Float64, Int64, Int64} where _A)}

Initialize a StateVariables data structure containing Fields for all variables defined by model defined on its associated grid. The clock specifies the initial simulation time and is mutated on each time step. User-specified boundary_conditions and initializers can be provided as NamedTuples with keys corresponding to the names of state variables to which they should be applied. If the state variables are defined within namespaces, the given NamedTuple must follow the same structure. The fields argument allows for manual preconstruction of Fields for the named state variables.

source
Terrarium.initialize — Method
initialize(
    vars::NamedTuple{names, <:Tuple{Vararg{Terrarium.AbstractVariable}}},
    grid::Terrarium.AbstractLandGrid,
    clock::Clock,
    boundary_conditions::NamedTuple,
    fields::NamedTuple
) -> @NamedTuple{}

Initialize Fields on grid for each of the variables in the given named tuple vars. Any predefined boundary_conditions and fields will be passed through to initialize for each variable.

source
Terrarium.input — Method
input(name, dims; default, units, domain, desc)

Convenience constructor method for InputVariable.

source
Terrarium.input_fields — Method
input_fields(state, components)

Retrieves all Fields from state corresponding to input variables defined on the given components.

source
Terrarium.invclosure! — Method
invclosure!(state, grid, closure::AbstractClosureRelation, process::AbstractProcess, args...)

Apply the inverse of closure for the process proc on the given grid with additional implementation-specific args defined by the coupling interface for the process type.

source
Terrarium.invclosure! — Method
invclosure!(state, grid, proc::AbstractProcess, args...)

Apply the inverse closure mappings for the process proc on the given grid with additional implementation-specific args defined by the coupling interface for the process type. The default implementation calls invclosure! with args for each closure returned by closures.

source
Terrarium.invclosure! — Method
invclosure!(state, model::AbstractModel)

Apply the inverse of all closure relations defined for the given model.

source
Terrarium.invclosure! — Method
invclosure!(
    state,
    grid,
    closure::SoilSaturationPressureClosure,
    hydrology::SoilHydrology{NF, RichardsEq, SaturationClosure, SoilHydraulics} where {SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF})},
    soil::Terrarium.AbstractSoil,
    args...
)

Computes saturation_water_ice from the current pressure_head state.

source
Terrarium.is_adaptive — Function
is_adaptive(timestepper::AbstractTimeStepper)

Return true if the given time stepper is adaptive, false otherwise.

source
Terrarium.is_initialized — Function
is_initialized(timestepper::AbstractTimeStepper)

Return true if the timestepper is initialized, false otherwise.

source
Terrarium.latent_heat_flux — Method
latent_heat_flux(i, j, grid, fields, ::AbstractTurbulentFluxes)

Return the current latent heat flux at the given indices.

source
Terrarium.liquid_water_fraction — Function
liquid_water_fraction(i, j, k, grid, fields, ::AbstractSoilHydrology)

Compute or retrieve the current fraction of unfrozen water in the pore space.

source
Terrarium.longwave_down — Method
longwave_down(i, j, grid, fields, ::AbstractAtmosphere{NF, PR, <:LongShortWaveRadiation})

Retrieve or compute the incoming/downwelling longwave radiation at the current time step.

source
Terrarium.longwave_up — Method
longwave_up(i, j, grid, fields, ::AbstractRadiativeFluxes)

Return the current outgoing (upwelling) longwave radiation at the given indices i, j.

source
Terrarium.min_zᵃᵃᶠ — Method
min_zᵃᵃᶠ(i, j, k, grid, x)
min_zᵃᵃᶠ(i, j, k, grid, f, args...)

Computes the field or function at the vertical (z-axis) face by taking the min of the two adjacent vertical layers.

source
Terrarium.mineral_porosity — Function
mineral_porosity(::AbstractSoilPorosity, texture::SoilTexture)

Compute or retrieve the natural porosity of the mineral soil constitutents, i.e. excluding organic material.

source
Terrarium.mineral_texture — Function
organic_fraction(::AbstractSoilMatrix)

Return the SoilTexture describing the mineral component of the soil matrix.

source
Terrarium.nancheck! — Function
nancheck!(field)
nancheck!(field, name)

Check whether the given field has any NaN values using Diagnostics.hasnan and raise an error if NaNs are detected.

source
Terrarium.ntdiff — Method
ntdiff(
    nt::NamedTuple,
    other::NamedTuple{excluded}
) -> NamedTuple

Filters out all entries from nt that exist in other; like setdiff but for NamedTuple.

source
Terrarium.organic_fraction — Method
organic_fraction(
    i,
    j,
    k,
    grid,
    fields,
    strat::HomogeneousStratigraphy,
    bgc::Terrarium.AbstractSoilBiogeochemistry
) -> Any

Compute the organic fraction of solid material in the soil volume at index i, j, k.

source
Terrarium.organic_porosity — Function
organic_porosity(::AbstractSoilPorosity, texture::SoilTexture)

Compute or retrieve the natural porosity of the organic soil constitutents, i.e. excluding mineral material.

source
Terrarium.porosity — Method
porosity(
    i,
    j,
    k,
    grid,
    fields,
    strat::HomogeneousStratigraphy,
    bgc::Terrarium.AbstractSoilBiogeochemistry
) -> Any

Compute the porosity of the soil volume at the given indices.

source
Terrarium.processes — Method
processes(obj::Union{AbstractCoupledProcesses, AbstractModel})

Return a tuple of AbstractProceses contained in the given model or coupled processes type. Note that this is a type-stable, @generated function that is compiled for each argument type.

source
Terrarium.prognostic — Method
prognostic(name, dims; units, closure, domain, desc)

Convenience constructors for PrognosticVariable.

source
Terrarium.prognostic_fields — Method
prognostic_fields(state, components)

Retrieves all Fields from state corresponding to prognostic variables defined on the given components.

source
Terrarium.rainfall — Method
rainfall(i, j, grid, fields, ::AbstractAtmosphere{NF, <:RainSnow})

Retrieve or compute the liquid precipitation (rainfall) at the current time step.

source
Terrarium.root_density — Function
root_density(::AbstractRootDistribution, z, args...)

Compute the continuous density function of the given root distirbution as a function of depth z. Note that this function must be integrated and normalized over the root zone in order to obtain the cumulative root fraction in each soil layer.

source
Terrarium.root_density — Method
root_density(
    rd::StaticExponentialRootDistribution{NF},
    z
) -> Any

Compute the continuous density function of the root distirbution as a function of depth z.

source
Terrarium.safediv — Method
safediv(x, y)

Evaluates x / (y + eps(NF)) if and only if y != zero(y); returns Inf otherwise.

source
Terrarium.saturation_vapor_pressure — Method
saturation_vapor_pressure(T, a₁, a₂, a₃)

August-Roche-Magnus equation for saturation vapor pressure at temperature T with empirical coefficients a₁, a₂, and a₃.

source
Terrarium.saturation_vapor_pressure — Method
saturation_vapor_pressure(T, Ts=T)

Saturation vapor pressure at the given temperature T, accounting for both frozen (T < 0°C) and unfrozen conditions.

Coefficients taken from Alduchov and Eskridge (1997).

source
Terrarium.saturation_water_ice — Function
saturation_water_ice(i, j, k, grid, fields, ::AbstractSoilHydrology)

Compute or retrieve the current saturation level of water + ice in the pore space.

source
Terrarium.shortwave_down — Method
shortwave_down(i, j, grid, fields, ::AbstractAtmosphere{NF, PR, <:LongShortWaveRadiation})

Retrieve or compute the incoming/downwelling shortwave radiation at the current time step.

source
Terrarium.shortwave_up — Method
shortwave_up(i, j, grid, fields, ::AbstractRadiativeFluxes)

Return the current outgoing (upwelling) shortwave radiation at the surface.

source
Terrarium.skin_temperature — Method
skin_temperature(i, j, grid, fields, ::AbstractSkinTemperature)

Return the current skin temperature at the given indices.

source
Terrarium.snowfall — Method
snowfall(i, j, grid, fields, ::AbstractAtmosphere{NF, <:RainSnow})

Retrieve or compute the frozen precipitation (snowfall) at the current time step.

source
Terrarium.soil_matrix — Function
soil_matrix(i, j, k, grid, fields, ::AbstractStratigraphy, args...)

Return the solid matrix of the soil at index i, j, k for the given stratigraphy parameterization.

source
Terrarium.soil_matrix — Method
soil_matrix(
    i,
    j,
    k,
    grid,
    fields,
    strat::Terrarium.AbstractStratigraphy,
    bgc::Terrarium.AbstractSoilBiogeochemistry
) -> MineralOrganic

Compute and return the soil solid matrix at index i, j, k on grid. The default implementation assumes a simple MineralOrganic parameterization of the solid material.

source
Terrarium.soil_moisture_limiting_factor — Method
soil_moisture_limiting_factor(
    _::FieldCapacityLimitedPAW,
    grid,
    clock,
    fields
) -> Field{LX, LY, LZ, O, G, I, D, T, B, Oceananigans.Fields.FieldStatus{Float64}} where {LX, LY, LZ, O, G, I, D, T, B}

Field constructor for the soil moisture limiting factor. Returns a derived Field that calculates the integral of W(z) * r(z) where W is the water availability coefficient and r is the root fraction.

source
Terrarium.soil_texture — Function
soil_texture(i, j, k, grid, fields, ::AbstractStratigraphy, args...)

Return the texture of the soil at index i, j, k for the given stratigraphy parameterization.

source
Terrarium.soil_volume — Function
soil_volume(i, j, k, grid, fields, ::AbstractStratigraphy, args...)

Return a SoilVolume describing the full material composition of the soil volume at index i, j, k for the given stratigraphy parameterization.

source
Terrarium.soil_volume — Method
soil_volume(i, j, k, grid, fields, strat, hydrology, bgc)

Construct a SoilVolume object summarizing the material composition of the soil volume at the given indices i, j, k on grid.

source
Terrarium.specific_humidity — Method
specific_humidity(i, j, grid, fields, ::PrescribedAtmosphere{PR, IR, <:SpecificHumidity})

Retrieve or compute the specific_humidity at the current time step.

source
Terrarium.stefan_boltzmann — Method
stefan_boltzmann(c::PhysicalConstants, T, ϵ)

Stefan-Boltzmann law $M = \epsilon \sigma T^4$ where T is the surface temperature in Kelvin and ϵ is the emissivity.

source
Terrarium.surface_excess_water — Function
surface_excess_water(i, j, k, grid, fields, ::AbstractSoilHydrology)

Retrieve the current saturation level of water + ice in the pore space.

source
Terrarium.surface_humidity_flux — Function
surface_humidity_flux(i, j, grid, fields, ::AbstractEvapotranspiration)

Compute the surface humidity flux [m/s] at cell i, j based on the current state.

source
Terrarium.tendency — Method
tendency(var)

Creates an AuxiliaryVariable for the tendency of a prognostic variable with the given name, dimensions, and physical units. This constructor is primarily used internally by other constructors and does not usually need to be called by implementations of variables.

source
Terrarium.tendency_fields — Method
tendency_fields(state, components)

Retrieves all Fields from state corresponding to tendencies defined on the given components.

source
Terrarium.timestep! — Function
timestep!(integrator::ModelIntegrator, timestepper::AbstractTimeStepper, Δt)

Advance prognostic variables of the integrator model by one time step based on the current state, or by Δt units of time.

source
Terrarium.timestep! — Method
timestep!(state, model::AbstractModel, timestepper::AbstractTimeStepper, Δt)

Apply any necessary corrections or model-specific time stepping logic after applying timestepper to the prognostic state variables defined by model.

source
Terrarium.timestep! — Method
timestep!(integrator::ModelIntegrator; finalize)

Advance the model forward by one timestep with optional timestep size Δt. If finalize = true, compute_auxiliary! is called after the time step in order to update the values of auxiliary/diagnostic variables.

source
Terrarium.update_inputs! — Method
update_inputs!(fields, _::InputSource, _::Clock)

Updates the values of input variables stored in fields from the given input source. Default implementation simply returns nothing.

source
Terrarium.var — Function
var(name, dims)
var(name, dims, units)

Convenience constructor for Variable.

source
Terrarium.variables — Function
variables(model::AbstractModel)
variables(process::AbstractProcess)

Return a Tuple of AbstractVariables (i.e. PrognosticVariable, AuxiliaryVariable, etc.) defined by the model or process.

source
Terrarium.variables — Method
variables(
    _::InputSource
) -> Tuple{InputVariable{_A, VD, UT, _B, DomainSets.RealLine{Float64}, Nothing} where {_A, VD<:Terrarium.VarDims, UT<:Unitful.Units, _B<:Terrarium.Variable{_A, VD, UT}}}

Returns a tuple of Symbols corresponding to variable names supported by this InputSource.

source
Terrarium.varname — Method
varname(_)

Retrieve the name of the given variable or closure. For closure relations, varname should return the name of the variable returned by the closure relation.

source
Terrarium.volumetric_fractions — Method
volumetric_fractions(soil::SoilVolume) -> NamedTuple

Calculates the volumetric fractions of all constituents in the given soil volume and returns them as a named tuple of the form (; water, ice, air, solids...), where solids corresponds to the volumetric fractions defined by the solid phase soil.solid.

source
Terrarium.volumetric_fractions — Method
volumetric_fractions(
    solid::MineralOrganic{NF},
    solid_frac
) -> NamedTuple{(:organic, :mineral), <:Tuple{Any, Any}}

Compute the volumetric fractions of the solid phase scaled by the overall solid fraction of the soil solid_frac.

source
Terrarium.water_table — Function
water_table(i, j, k, grid, fields, ::AbstractSoilHydrology)

Compute or retrieve the current water table level relative to the surface.

source
Terrarium.windspeed — Method
windspeed(i, j, grid, fields, ::PrescribedAtmosphere)

Retrieve or compute the windspeed at the current time step.

source
Core.Type — Method
(::Type{Model})(grid::AbstractLandGrid, args...; kwargs...) where {Model <: AbstractModel}

Convenience constructor for all AbstractModel types that allows the grid to be passed as the first positional argument.

source
Oceananigans.Fields.Field — Type
Field(
    grid::AbstractLandGrid,
    dims::VarDims,
    boundary_conditions = nothing,
    args...;
    kwargs...
)

Auxiliary constructor for an Oceananigans Field on grid with the given Terrarium variable dims and boundary conditions. Additional arguments are passed direclty to the Field constructor. The location of the Field is determined by VarDims defined on var.

source
Oceananigans.Fields.Field — Method
Field(ring_field, grid; default_value)

Converts a RingGrids.Field to an Oceananigans Field using the given ColumnRingGrid. Only masked grid points are copied to the Oceananigans field. For 2D RingGrids fields, returns a 2D Oceananigans field. For 3D fields, returns a 3D field.

source
RingGrids.Field — Method
Field(field, grid; fill_value)

Converts the given Oceananigans Field to a RingGrids.Field with a ring grid matching that of the given ColumnRingGrid.

source
Terrarium.AbstractAerodynamics — Type
abstract type AbstractAerodynamics{NF}

Base type for aerodynamic parameterizations that compute the bulk drag coefficient for turbulent heat and moisture exchange between the land surface and atmosphere.

source
Terrarium.AbstractAtmosphere — Type
abstract type AbstractAtmosphere{NF, PR<:Terrarium.AbstractPrecipitation, IR<:Terrarium.AbstractIncomingRadiation, HM<:Terrarium.AbstractHumidity, AD<:Terrarium.AbstractAerodynamics{NF}} <: Terrarium.AbstractProcess{NF}

Base type for representations of the atmosphere that provide meterological state variables such as air temperature and pressure, humidity, precipitation, incoming solar radiation, tracer gas concentrations, wind speed, and near-surface aerodynamics.

source
Terrarium.AbstractClosureRelation — Type
abstract type AbstractClosureRelation

Base type for prognostic variable closure relations for differential equations of the form:

\[\frac{\partial g(u)}{\partial t} = F(u)\]

where F represents the RHS tendency as a function of the state variable u, and g(u) is a closure or constitutive relation that maps u to the physical units matching the tendency. Common examples in soil hydrothermal modeling are temperature-enthalpy and saturation-pressure relations.

source
Terrarium.AbstractCoupledProcesses — Type
abstract type AbstractCoupledProcesses{NF} <: Terrarium.AbstractProcess{NF}

Base type for AbstractProces implementations that define a coupling interface for (typically two or more) sub-processes.

source
Terrarium.AbstractGround — Type
abstract type AbstractGround{NF} <: Terrarium.AbstractCoupledProcesses{NF}

Base type for coupled ground processes.

source
Terrarium.AbstractHumidity — Type
abstract type AbstractHumidity

Base type for representations of near-surface atmospheric humidity. Subtypes define which form of humidity (e.g. specific or relative humidity) is used as input.

source
Terrarium.AbstractIncomingRadiation — Type
abstract type AbstractIncomingRadiation

Base type for representations of downwelling (incoming) radiation. Subtypes define which spectral components are provided as inputs (e.g. split into shortwave and longwave).

source
Terrarium.AbstractInitializer — Type

Base type for model initializers. Implementations should provide a dispatch of the initialize!(state, model::M, init::I) method where M corresponds to the model type and I to the initializer. An implementation of get_field_initializers can also be provided which returns a NamedTuple of initializer functions for individual state variable fields.

source
Terrarium.AbstractModel — Type
abstract type AbstractModel{NF, Grid<:(Terrarium.AbstractLandGrid{NF})}

Base type for all Terrarium "models". Models are standalone representations of a system that consist of

(i) a spatial grid characterizing the model domain, (ii) zero or more AbstractProcesses defining the dynamics, and (iii) an AbstractInitializer responsible for defining the initial state of the model.

Implementations of AbstractModel are required to implement, at minimum, three methods:

  • variables which declares the state variables requried by the model,
  • compute_auxiliary! which is responsible for computing all auxiliary (non-prognostic) variables,
  • compute_tendencies! which is responsible for computing the tendencies of all prognostic variables.

Note that a default implementation of variables is provided which automatically collects all variables declared by AbstractProcesses defined as fields (properties) of structs that subtype AbstractModel.

source
Terrarium.AbstractPlantAvailableWater — Type
abstract type AbstractPlantAvailableWater{NF} <: Terrarium.AbstractProcess{NF}

Base type for processes that comptue the plant available water fraction in each soil layer.

source
Terrarium.AbstractPrecipitation — Type
abstract type AbstractPrecipitation

Base type for representations of atmospheric precipitation. Subtypes define which variables describe the precipitation input (e.g. rain and snow as separate fields).

source
Terrarium.AbstractProcess — Type
abstract type AbstractProcess{NF}

Base type for all "processes". Implementations of AbstractProcess define equations, state variables, and parameterizations which characterize the dynamics of a system at for any given transient state. Note that processes should be largely agnostic to the details regarding spatial and temporal discretization of the model; i.e. they should not require specification of a specific grid or time stepping scheme but rather should be able to operate on any given set of Fields and parameters representing the state of a model at any point in time. Note that process types may also wrap/orchestrate one or more other process types.

source
Terrarium.AbstractSoilEnergyBalance — Type
abstract type AbstractSoilEnergyBalance{NF} <: Terrarium.AbstractProcess{NF}

Base type for soil energy balance process implementations. Subtypes should define state variables for soil temperature, internal_energy, and any other relevant thermal properties or state variables.

source
Terrarium.AbstractSoilEnergyClosure — Type
abstract type AbstractSoilEnergyClosure <: Terrarium.AbstractClosureRelation

Base type for closure relations between energy and temperature in soil volumes.

source
Terrarium.AbstractSoilHydraulics — Type
abstract type AbstractSoilHydraulics{NF, RC<:SWRC, UnsatK<:Terrarium.AbstractUnsatK}

Base type for soil hydraulic properties and parameterization schemes.

source
Terrarium.AbstractSoilHydrology — Type
abstract type AbstractSoilHydrology{NF} <: Terrarium.AbstractProcess{NF}

Base type for soil hydrology implementations. Subtypes should define state variables for saturation_water_ice, hydraulic_conductivity, liquid_water_fraction, and the current water_table level, along with any other implementation-specific state variables.

source
Terrarium.AbstractSoilWaterClosure — Type
abstract type AbstractSoilWaterClosure <: Terrarium.AbstractClosureRelation

Base type for closure relations between water saturation and potential in soil volumes.

source
Terrarium.AuxiliaryVariable — Type
struct AuxiliaryVariable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units, Var<:Terrarium.Variable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units}, DT<:IntervalSets.AbstractInterval, FC<:Union{Nothing, Function}} <: Terrarium.AbstractProcessVariable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units}

Represents an auxiliary (a.k.a "diagnostic") state variable with the given name and spatial dims. Auxiliary variables are those which are diagnosed directly or indirectly from the values of one or more prognostic variables.

source
Terrarium.ColumnGrid — Type
ColumnGrid{NF, Arch<:AbstractArchitecture, RectGrid<:Oceananigans.Grids.RectilinearGrid} <: AbstractLandGrid

Represents a set of laterally independent vertical columns with dimensions (x, y, z) where x is the column dimension, y=1 is constant, and z is the vertical axis.

source
Terrarium.ColumnRingGrid — Type
struct ColumnRingGrid{NF, Arch, RingGrid<:RingGrids.AbstractGrid, RectGrid<:Oceananigans.Grids.RectilinearGrid, Mask<:AbstractArray} <: Terrarium.AbstractColumnGrid{NF, Arch}

Represents a global (spherical) grid of independent, vertical columns where the spatial discretization in the horizontal direction is defined by a RingGrids.AbstractGrid.

source
Terrarium.ConstantAerodynamics — Type
struct ConstantAerodynamics{NF} <: Terrarium.AbstractAerodynamics{NF}

Dummy implementation of aerodynamics that simply returns constant values for all drag coefficients.

source
Terrarium.ConstantAlbedo — Type
struct ConstantAlbedo{NF} <: Terrarium.AbstractAlbedo{NF}

Properties:

  • albedo::Any: Surface albedo, i.e. ratio of outgoing to incoming shortwave radiation [-]

  • emissivity::Any: Surface emissivity, i.e. fraction of thermal radiation emitted from the surface [-]

source
Terrarium.ConstantSaturation — Type
struct ConstantSaturation{NF} <: Terrarium.AbstractInitializer{NF}

Initializer for soil water/ice sets the saturation profile to a constant value.

Properties:

  • sat::Any
source
Terrarium.ConstantSoilCarbonDensity — Type
struct ConstantSoilCarbonDensity{NF} <: Terrarium.AbstractSoilBiogeochemistry{NF}

Naive implementation of soil biogeochemistry that just assumes there to be a constant organic content in all soil layers.

Properties:

  • ρ_soc::Any: Soil organic carbon density [kg/m^3]

  • ρ_org::Any: Pure organic matter density [kg/m^3]

source
Terrarium.ConstantSoilHydraulics — Type
struct ConstantSoilHydraulics{NF, RC, UnsatK<:Terrarium.AbstractUnsatK{NF}} <: Terrarium.AbstractSoilHydraulics{NF, RC, UnsatK<:Terrarium.AbstractUnsatK{NF}}

Represents a simple case where soil hydraulic properties are given as constant values. This is mostly provided just for testing, although it may be useful in certain cases where direct measurements of hydraulic properites are available.

Properties:

  • swrc::Any: Soil water retention curve

  • unsat_hydraulic_cond::Terrarium.AbstractUnsatK: Unsaturated hydraulic conductivity formulation; defaults to sat_hydraulic_cond

  • sat_hydraulic_cond::Any: Hydraulic conductivity at saturation [m/s]

  • field_capacity::Any: Prescribed field capacity [-]

  • wilting_point::Any: Prescribed wilting point [-]

source
Terrarium.ConstantSoilPorosity — Type
struct ConstantSoilPorosity{NF} <: Terrarium.AbstractSoilPorosity{NF}

Parameterization of soil porosity that simply specifies constant values for the mineral and organic components.

source
Terrarium.ConstantSoilTemperature — Type
struct ConstantSoilTemperature{NF} <: Terrarium.AbstractInitializer{NF}

Initializer for soil/ground temperature that sets the temperature profile to a constant value.

Properties:

  • T₀::Any
source
Terrarium.DiagnosedRadiativeFluxes — Type
struct DiagnosedRadiativeFluxes{NF} <: Terrarium.AbstractRadiativeFluxes{NF}

Computes outgoing shortwave and longwave radiation according to separately specified schemes for the albedo, skin temperature, and atmospheric inputs.

source
Terrarium.DiagnosedTurbulentFluxes — Type
struct DiagnosedTurbulentFluxes{NF} <: Terrarium.AbstractTurbulentFluxes{NF}

Represents the standard case where the turbulent (sensible and latent) heat fluxes are diagnosed from atmosphere and soil conditions.

source
Terrarium.DirectSurfaceRunoff — Type
struct DirectSurfaceRunoff{NF} <: Terrarium.AbstractSurfaceRunoff{NF}

Simple surface runoff scheme that computes runoff as

\[R = P + D - I\]

where P is precipitation reaching the ground, D is drainage from accumualted excess water at the surface, and I is infiltration into the soil.

Properties:

  • τ_r: Surface water removal timescale
source
Terrarium.ExplicitTwoPhaseHeatConduction — Type
struct ExplicitTwoPhaseHeatConduction <: Terrarium.AbstractHeatOperator

Represents an explicit formulation of the two-phase heat conduction operator in 1D:

\[\frac{\partial U(T,\phi)}{\partial t} = \boldsymbol{\nabla} \cdot \left[ \kappa(T) \boldsymbol{\nabla}_x T(x,t) \right]\]

where $T$ is temperature [K], $U$ is internal energy [J m⁻³], and $\kappa$ is the thermal conductivity [W m K⁻¹].

source
Terrarium.ExponentialSpacing — Type
struct ExponentialSpacing{NF, ST<:Union{Nothing, Integer}} <: Terrarium.AbstractVerticalSpacing{NF}

Variably-spaced vertical discretization with N layers increasing quasi-exponentially in thickness from Δz_min at the top (surface) to Δz_max at the bottom. The integer property sig determines to what significant digit each layer thickness should be rounded.

Properties:

  • Δz_min::Any: Minimum layer thickness at the surface

  • Δz_max::Any: Maximum layer thickness at the bottom

  • N::Int64: Number of layers

  • sig::Union{Nothing, Integer}: Number of significant digits for rounding or nothing

source
Terrarium.FieldBCs — Type

Alias for a NamedTuple of FieldBC types where the keys correspond to field/variable names.

source
Terrarium.FieldCapacityLimitedPAW — Type
struct FieldCapacityLimitedPAW{NF} <: Terrarium.AbstractPlantAvailableWater{NF}

Implementation of vegetation water availability (a.k.a "plant available water") that computes the wilting fraction

\[W_i = \min\left(\frac{\theta_{\text{w},i} - \theta_{\text{wp},i}}{\theta_{\text{fc},i} - \theta_{\text{wp},i}} , 1\right)\]

where $\theta_{\text{w},i}$ is the volumetric water content of the $i$'th soil layer, $\theta_{\text{fc},i}$ is the "field capacity", and $\theta_{\text{wp},i}$ is the "wilting point". The water availability

Properties:

source
Terrarium.FieldInputSource — Type
struct FieldInputSource{NF, name, VD<:Terrarium.VarDims, FS<:(Oceananigans.Fields.AbstractField{LX, LY, LZ, G, NF} where {LX, LY, LZ, G}), UT} <: InputSource{NF, name}

Input source that defines input state variables with the given names which can then be directly modified by the user.

source
Terrarium.FieldTimeSeriesInputSource — Type
struct FieldTimeSeriesInputSource{NF, name, VD<:Terrarium.VarDims, FTS<:(FieldTimeSeries{LX, LY, LZ, TI, K, I, D, G, NF} where {LX, LY, LZ, TI, K, I, D, G}), UT} <: InputSource{NF, name}

Input source that reads input fields from pre-specified Oceananigans FieldTimeSeries.

source
Terrarium.GroundEvaporation — Type
struct GroundEvaporation{NF, GR<:Terrarium.AbstractGroundEvaporationResistanceFactor} <: Terrarium.AbstractEvapotranspiration{NF}

Evaporation scheme for bare ground that calculates the humidity flux as

\[E = \beta \frac{\Delta q}{r_a}\]

where Δq is the vapor pressure deficit in terms of specific humidity, rₐ is aerodynamic resistance, and β is an evaporation limiting factor.

source
Terrarium.Heun — Type
struct Heun{NF, Stage} <: Terrarium.AbstractTimeStepper{NF}

Simple forward 2nd order Heun / improved Euler time stepping scheme.

source
Terrarium.HomogeneousStratigraphy — Type
struct HomogeneousStratigraphy{NF, SoilPorosity<:Terrarium.AbstractSoilPorosity{NF}} <: Terrarium.AbstractStratigraphy{NF}

Represents a soil stratigraphy of well mixed material with homogeneous soil texture.

Properties:

  • texture::SoilTexture: Material composition of mineral soil component

  • porosity::Terrarium.AbstractSoilPorosity: Parameterization of soil porosity

source
Terrarium.ImplicitSkinTemperature — Type
struct ImplicitSkinTemperature{NF} <: Terrarium.AbstractSkinTemperature{NF}

Scheme for an implicit skin temperature $T_s$ satisfying:

\[R_{\text{net}}(T_s) = H_s(T_s) + H_l(T_s) + G(T_s, T_g)\]

where $R_{\text{net}}$ is the net radiation budget, $H_s$ is the sensible heat flux, $H_l$ is the latent heat flux from sublimation and evapotranspiration, $G$ is the ground heat flux, and $T_g$ is the ground temperature, or temperature of the uppermost subsurface (soil or snow) layer.

Properties:

  • κₛ: Assumed thermal conductivity at the surface [W m⁻¹ K⁻¹]
source
Terrarium.InputSource — Type
abstract type InputSource{NF, name}

Base type for input data sources. Implementations of InputSource are free to load data from any arbitrary backend. They expect an initialize!(fields, ::InputSource) that is called once at model initialization and an update_inputs!(fields, ::InputSource, ::Clock) method that is called at every time step. Both default to doing nothing. Implementations should additionally provide a constructor as a dispatch of InputSource.

The type argument NF corresponds to the numeric type of the input data, name to its name that's also used in its variables definition.

source
Terrarium.InputSource — Method
InputSource(
    grid::Terrarium.AbstractLandGrid{NF},
    field::Oceananigans.Fields.AbstractField{LX, LY, LZ, G, NF} where {LX, LY, LZ, G};
    name,
    units
)

Create a FieldInputSource with the given grid and input variable fields. Use it for static input fields.

source
Terrarium.InputSource — Method
InputSource(
    grid::ColumnRingGrid{NF},
    ring_field::RingGrids.AbstractField;
    name,
    units
)

Convenience function to create a FieldInputSource from a RingGrids.Field. Converts the RingGrids field to an Oceananigans field and then creates the input source.

source
Terrarium.InputVariable — Type
struct InputVariable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units, Var<:Terrarium.Variable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units}, DT<:IntervalSets.AbstractInterval, Def<:Union{Nothing, Function, Number}} <: Terrarium.AbstractProcessVariable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units}

Represents a spatially varying input (e.g. forcing) variable with the given name and spatial dims. Input variables can also be made to vary in time through the use of InputSources.

source
Terrarium.InverseQuadratic — Type

The inverse quadratic (or "quadratic parallel") bulk thermal conductivity formula (Cosenza et al. 2003):

\[k = \left[\sum_{i=1}^N θᵢ\sqrt{kᵢ}\right]^2\]

Cosenza, P., Guérin, R., and Tabbagh, A.: Relationship between thermal conductivity and water content of soils using numerical modelling, European Journal of Soil Science, 54, 581–588, https://doi.org/10.1046/j.1365-2389.2003.00539.x, 2003.

source
Terrarium.LUEPhotosynthesis — Type
struct LUEPhotosynthesis{NF} <: Terrarium.AbstractPhotosynthesis{NF}

Photosynthesis implementation from PALADYN (Willeit 2016) for C3 PFTs following the mechanistic approach of Haxeltine and Prentice (1996). Computes instantaneous photosynthetic rates as differential equations that are integrated over arbitrary timesteps by the timestepper.

Authors: Maha Badri and Matteo Willeit

Properties:

  • τ25::Any: Rubisco specificity factor at 25°C [dimensionless]. Ratio of carboxylation to oxygenation rates.

  • Kc25::Any: Michaelis-Menten constant for CO₂ at 25°C [Pa]. PALADYN value for needleleaf trees.

  • Ko25::Any: Michaelis-Menten constant for O₂ at 25°C [Pa]. PALADYN value for needleleaf trees.

  • q10_τ::Any: Q10 temperature sensitivity for τ [dimensionless]. Controls temperature dependence of specificity.

  • q10_Kc::Any: Q10 temperature sensitivity for Kc [dimensionless]. Controls temperature dependence of CO₂ affinity.

  • q10_Ko::Any: Q10 temperature sensitivity for Ko [dimensionless]. Controls temperature dependence of O₂ affinity.

  • α_leaf::Any: Leaf albedo in PAR range [-]

  • α_a::Any: Fraction of PAR assimilated at ecosystem level, relative to leaf level [-]

  • α_C3::Any: Intrinsic quantum efficiency of CO2 uptake in C3 plants [mol/mol]

  • cq::Any: Conversion factor for solar radiation at 550 nm from J/m² to mol/m² [mol/J]

  • k_ext::Any: Extinction coefficient for radiation through vegetation [-]

  • T_CO2_high::Any: Upper temperature threshold for CO₂/O₂ specificity factor [°C]. Above this, photosynthesis rapidly declines. PFT-specific, needleleaf tree value.

  • T_CO2_low::Any: Lower temperature threshold for CO₂/O₂ specificity factor [°C]. Below this, photosynthesis rapidly declines. PFT-specific, needleleaf tree value.

  • T_photos_high::Any: Upper temperature threshold for light-limited photosynthesis rate [°C]. Peak photosynthesis capacity. PFT-specific, needleleaf tree value.

  • T_photos_low::Any: Lower temperature threshold for light-limited photosynthesis rate [°C]. Minimum for photosynthesis. PFT-specific, needleleaf tree value.

  • θ_r::Any: Root of quadratic mean shape parameter [-]. Controls smoothness of interpolation between light and RuBisCO limitations (0.7 for smooth, 0.5 for arithmetic mean).

source
Terrarium.LongShortWaveRadiation — Type
struct LongShortWaveRadiation <: Terrarium.AbstractIncomingRadiation

Incoming radiation parameterization in which downwelling shortwave [W/m²] and longwave [W/m²] radiation are provided as separate input fields, along with daytime length [hr].

source
Terrarium.MedlynStomatalConductance — Type
struct MedlynStomatalConductance{NF} <: Terrarium.AbstractStomatalConductance{NF}

Stomatal conductance implementation from PALADYN (Willeit 2016) following the optimal stomatal conductance model (Medlyn et al. 2011).

Authors: Maha Badri and Matteo Willeit

Properties:

  • g₁::Any: Parameter in optimal stomatal conductance formulation representing the quasi-linear relationship between conductance and net assimilation, Lin et al. 2015 [-], PFT specific

  • g_min::Any: Minimum stomatal condutance parameter [mm s⁻¹]

source
Terrarium.MineralOrganic — Type
struct MineralOrganic{NF} <: Terrarium.AbstractSoilMatrix{NF}

Soil matrix consisting of a simple, homogeneous mixture of mineral and organic material.

Properties:

  • texture::SoilTexture: Mineral soil texture

  • organic::Any: Organic soil fraction

source
Terrarium.ModelIntegrator — Type
struct ModelIntegrator{NF, Arch<:Oceananigans.Architectures.AbstractArchitecture, Grid<:Terrarium.AbstractLandGrid{NF, Arch<:Oceananigans.Architectures.AbstractArchitecture}, TimeStepper<:Terrarium.AbstractTimeStepper{NF}, Model<:Terrarium.AbstractModel{NF, Grid<:Terrarium.AbstractLandGrid{NF, Arch<:Oceananigans.Architectures.AbstractArchitecture}}, StateVars<:Terrarium.AbstractStateVariables, Inits<:NamedTuple, Inputs<:InputSources} <: Oceananigans.AbstractModel{TimeStepper<:Terrarium.AbstractTimeStepper{NF}, Arch<:Oceananigans.Architectures.AbstractArchitecture}

Represents a "integrator" for a simulation of a given model. ModelIntegrator consists of a clock, a model, and an initialized StateVariables data structure, as well as a stage for the timestepper and any relevant inputs provided by a corresponding InputProvider. The ModelIntegrator implements the Oceananigans.AbstractModel interface and can thus be treated as a "model" in Oceananigans Simulations and output reading/writing utilities.

source
Terrarium.Namespace — Type
struct Namespace{name, Vars}

Represents a new variable namespace, typically from a subcomponent of the model.

source
Terrarium.NoFlow — Type
struct NoFlow <: Terrarium.AbstractVerticalFlow

Represents a hydrology scheme where soil water is immobile.

source
Terrarium.PALADYNAutotrophicRespiration — Type
struct PALADYNAutotrophicRespiration{NF} <: Terrarium.AbstractAutotrophicRespiration{NF}

Autotrophic respiration implementation from PALADYN (Willeit 2016).

Authors: Maha Badri and Matteo Willeit

Properties:

  • cn_sapwood::Any: Sapwood parameter

  • cn_root::Any: Root parameter

  • aws::Any: Ratio of total to respiring stem carbon, Cox 2001, PFT specific [-]

source
Terrarium.PALADYNCanopyEvapotranspiration — Type
struct PALADYNCanopyEvapotranspiration{NF, GR<:Terrarium.AbstractGroundEvaporationResistanceFactor} <: Terrarium.AbstractEvapotranspiration{NF}

Canopy evapotranspiration scheme from PALADYN (Willeit 2016) that includes a canopy evaporation term based on the saturation fraction of canopy water defined by the canopy hydrology scheme.

\[E_g &= \beta \frac{\Delta q}{r_a} \ E_c &= f_{\text{can}} \frac{\Delta q}{r_a} \ T_c &= \frac{\Delta q}{r_a + r_s} \\]

Properties:

  • C_can: Drag coefficient for the traansfer of heat and water between the ground and canopy

  • ground_resistance: Parameterization for ground resistance to evaporation/sublimation

source
Terrarium.PALADYNCanopyInterception — Type
struct PALADYNCanopyInterception{NF} <: Terrarium.AbstractCanopyInterception{NF}

Canopy interception and storage implementation following PALADYN (Willeit 2016) considering only liquid water (no snow).

Properties:

  • α_int: Canopy water interception factor for tree PFTs

  • k_ext: Extinction coefficient for radiation through vegetation [-]

  • w_can_max: Canopy interception capacity parameter, Verseghy 1991 [m]

  • τ_w: Canopy water removal timescale [s]

source
Terrarium.PALADYNCarbonDynamics — Type
struct PALADYNCarbonDynamics{NF} <: Terrarium.AbstractVegetationCarbonDynamics{NF}

Vegetation carbon dynamics implementation following PALADYN (Willeit 2016) but considering only the sum of the vegetation carbon pools. The subsequent splitting into Cleaf, Cstem, C_root is not implemented for now.

Authors: Maha Badri

Properties:

  • SLA::Any: Specific leaf area (Kattge et al. 2011) [m²/kgC], PFT specific

  • awl::Any: Allometric coefficient, modified from Cox 2001 to account for bwl=1 [kgC/m²], PFT specific

  • LAI_min::Any: Minimum Leaf Area Index modified from Clark et al. 2011 [m²/m²], PFT specific

  • LAI_max::Any: Maximum Leaf Area Index modified from Clark et al. 2011 [m²/m²], PFT specific

  • γL::Any: Leaf turnover rate (Kattge et al. 2011) [1/year], PFT specific

  • γR::Any: Root turnover rate [1/year], PFT specific

  • γS::Any: Stem turnover rate modified from Clark et al. 2011 [1/year], PFT specific

source
Terrarium.PALADYNPhenology — Type
struct PALADYNPhenology{NF} <: Terrarium.AbstractPhenology{NF}

Vegetation phenology implementation from PALADYN (Willeit 2016).

Authors: Maha Badri and Matteo Willeit

Properties:

source
Terrarium.PALADYNVegetationDynamics — Type
struct PALADYNVegetationDynamics{NF} <: Terrarium.AbstractVegetationDynamics{NF}

Vegetation dynamics implementation following PALADYN (Willeit 2016) for a single PFT based on the Lotka–Volterra approach.

Authors: Maha Badri

Properties:

  • ν_seed::Any: Vegetation seed fraction [-]

  • γv_min::Any: Minimum vegetation disturbance rate [1/year]

source
Terrarium.PhysicalConstants — Type
struct PhysicalConstants{NF}

A collection of general physical constants that do not (usually) need to be varied in parameter calibration.

Properties:

  • ρw: Density of water in kg/m^3

  • ρi: Density of ice in kg/m^3

  • ρₐ: Density of air at standard pressure and 0°C in kg/m^3

  • cₐ: Specific heat capacity of dry air at standard pressure and 0°C in J/(m^3*K)

  • Lsl: Sepcific latent heat of fusion of water in J/kg

  • Llg: Specific latent heat of vaporization of water in J/kg

  • Lsg: Specific latent heat of sublimation of water in J/kg

  • g: Gravitational constant in m/s^2

  • Tref: Reference temperature (0°C in Kelvin)

  • σ: Stefan-Boltzmann constant in J/(sm^2K^4)

  • κ: von Kármán constant

  • ε: Ratio of molecular weight of water vapor to dry air

  • Rₐ: Specific gas constant of air in J/(kg*K)

  • C_mass: Atomic mass of carbon [gC/mol]

source
Terrarium.PiecewiseLinearInitialSoilTemperature — Type
struct PiecewiseLinearInitialSoilTemperature{NF, N}

Represents a piecewise linear temperature initializer specified from the given knots.

initializer = PiecewiseLinearInitialSoilTemperature(
    0.0u"m" => 5.0, # always in °C!
    0.5u"m" => 2.0,
    1.0u"m" => 1.0,
    10.0u"m" => 1.5,
    ...
)

Properties:

  • knots::NTuple{N, NF} where {NF, N}
source
Terrarium.PrescribedAtmosphere — Type
struct PrescribedAtmosphere{NF, tracernames, Precip<:Terrarium.AbstractPrecipitation, IncomingRad<:Terrarium.AbstractIncomingRadiation, Humidity<:Terrarium.AbstractHumidity, Aerodynamics<:Terrarium.AbstractAerodynamics, Tracers<:(NamedTuple{tracernames, <:Tuple{Vararg{TracerGas}}})} <: Terrarium.AbstractAtmosphere{NF, Precip<:Terrarium.AbstractPrecipitation, IncomingRad<:Terrarium.AbstractIncomingRadiation, Humidity<:Terrarium.AbstractHumidity, Aerodynamics<:Terrarium.AbstractAerodynamics}

Represents prescribed atmospheric conditions given by the following input variables: - Air temperature - Humidity - Atmospheric pressure - Windspeed - Precipitation - Solar radiation - Zero or more tracer gases (defaults to CO2 only)

Precpitation and solar radiation are specified according to specialized subtypes which dictate the form of the input data; for precipitation, this defaults to RainSnow, i.e. rain- and snowfall given as separate inputs, while for solar radiation, the default is LongShortWaveRadiation which partitions downwelling radiation into the common short- and long wave lengths representing solar and thermal (infrared) radiation.

source
Terrarium.PrescribedRadiativeFluxes — Type
struct PrescribedRadiativeFluxes{NF} <: Terrarium.AbstractRadiativeFluxes{NF}

Represents the simplest scheme for the radiative budget where outgoing shortwave and longwave radiation are given as input variables. Net radiation is diagnosed by summing all radiative fluxes:

\[R_{\text{net}} = S_{\uparrow} - S_{\downarrow} + L_{\uparrow} - L_{\downarrow}\]

source
Terrarium.PrescribedSkinTemperature — Type
struct PrescribedSkinTemperature{NF} <: Terrarium.AbstractSkinTemperature{NF}

Simple scheme for prescribed skin temperatures from input variables.

Properties:

  • κₛ: Assumed thermal conductivity at the surface [W m⁻¹ K⁻¹]
source
Terrarium.PrescribedSpacing — Type
struct PrescribedSpacing{NF} <: Terrarium.AbstractVerticalSpacing{NF}

Vertical discretization with prescribed thicknesses for each layer. The number of layers is equal to the length of the given vector.

Properties:

  • Δz::Vector
source
Terrarium.PrescribedTurbulentFluxes — Type
struct PrescribedTurbulentFluxes{NF} <: Terrarium.AbstractTurbulentFluxes{NF}

Represents the simplest case where the turbulent (sensible and latent) heat fluxes are prescribed via input variables.

source
Terrarium.PrognosticVariable — Type
struct PrognosticVariable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units, Var<:Terrarium.Variable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units}, CL<:Union{Nothing, Terrarium.AbstractClosureRelation}, TV<:Union{Nothing, AuxiliaryVariable}, DT<:IntervalSets.AbstractInterval} <: Terrarium.AbstractProcessVariable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units}

Represents a prognostic state variable with the given name and spatial dims. Prognostic variables are those which are integrated by the timestepper and fully define the state of the system at any given point in (simulation) time. From a computational perspective, they can be seen as the "roots" of the computational graph for update_state!/timestep!. Prognostic variables generally should not be modified by any code not belonging to the timestepper or user. They automatically define a tendency (auxiliary) variable which is used to hold the value of their instantaneous time derivative computed by compute_tendencies!.

source
Terrarium.QuasiThermalSteadyState — Type
struct QuasiThermalSteadyState{NF} <: Terrarium.AbstractInitializer{NF}

Initializer that sets soil/ground temperature to a thermal quasi-steady state based on the given surface temperature, geothermal heat flux, and bulk (constant) thermal conductivity. Note that this is not a true thermal steady state, which would require iterative calculation of the thermal conductivity from the soil properties and initial temperature profile.

Properties:

  • T₀::Any

  • Qgeo::Any

  • k_eff::Any

source
Terrarium.RainSnow — Type
struct RainSnow <: Terrarium.AbstractPrecipitation

Precipitation parameterization in which liquid rainfall [m/s] and frozen snowfall [m/s] are provided as separate input fields.

source
Terrarium.RichardsEq — Type
RichardsEq{PS} <: AbstractVerticalFlow

SoilHydrology flow operator implementing the mixed saturation-pressure form of the Richardson-Richards equation.

State variables defined by the Richards' formulation of SoilHydrology:

  • saturation_water_ice: saturation level of water and ice in the pore space.
  • surface_excess_water: excess water at the soil surface (m^3/m^2).
  • hydraulic_conductivity: hydraulic conductivity at cell centers (m/s).
  • water_table`: elevation of the water table (m).
  • liquid_water_fraction: fraction of unfrozen liquid water in the pore space (dimensionless).

See also SoilSaturationPressureClosure and AbstractSoilHydraulics for details regarding the closure relating saturation and pressure head.

source
Terrarium.SaturationWaterTable — Type
struct SaturationWaterTable{NF} <: Terrarium.AbstractInitializer{NF}

Simple initialization scheme for soil/ground saturation that sets the initial water table at the given depth and the saturation level in all layers in the vadose (unsaturated) to a constant value.

Properties:

  • vadose_zone_saturation::Any

  • water_table_depth::Any

source
Terrarium.SoilEnergyBalance — Type
struct SoilEnergyBalance{NF, HeatOperator<:Terrarium.AbstractHeatOperator, EnergyClosure<:Terrarium.AbstractSoilEnergyClosure, ThermalProps<:(SoilThermalProperties{NF})} <: Terrarium.AbstractSoilEnergyBalance{NF}

Standard implementation of the soil energy balance accounting for freezing and thawing of pore water/ice. The closure field represents the temperature-energy closure $U(T,\phi)$ which relates temperature to internal energy via an arbitrary set of additional parameters $\phi$ which are determined by the model configuration.

Properties:

  • operator::Terrarium.AbstractHeatOperator: Heat transport operator

  • closure::Terrarium.AbstractSoilEnergyClosure: Closure relating energy and temperature

  • thermal_properties::SoilThermalProperties: Soil thermal properties

source
Terrarium.SoilEnergyTemperatureClosure — Type
struct SoilEnergyTemperatureClosure <: Terrarium.AbstractSoilEnergyClosure

Defines the constitutive relationship between the the internal energy and temperature of a soil volume, i.e.

\[U(T) = T\times C(T) - L_f \theta_{wi} (1 - F(T))\]

where T is temperature, C(T) is the temperature-dependent heat capacity, L_f is the volumetric latent heat of fusion, and F(T) is the constitutive relation between temperature and the unfrozen fraction of pore water. Note that, under this formulation, zero energy corresponds to 0°C with no ice, i.e. all pore water fully thawed.

The closure relation is defined as being a mapping from the conserved quantity (energy) to the continuous quantity (temperature), i.e. the inverse of U(T).

source
Terrarium.SoilEnergyWaterCarbon — Type
struct SoilEnergyWaterCarbon{NF, Stratigraphy<:Terrarium.AbstractStratigraphy{NF}, Energy<:Terrarium.AbstractSoilEnergyBalance{NF}, Hydrology<:Terrarium.AbstractSoilHydrology{NF}, Biogeochemistry<:Terrarium.AbstractSoilBiogeochemistry{NF}} <: Terrarium.AbstractSoil{NF}

Coupled process type that encapsulates the coupling of soil energy, water, and carbon dynamics. The stratigraphy parameterization determines how the vertical layering of the soil is parameterized.

source
Terrarium.SoilHydraulicsSURFEX — Type
struct SoilHydraulicsSURFEX{NF, RC, UnsatK<:Terrarium.AbstractUnsatK{NF}} <: Terrarium.AbstractSoilHydraulics{NF, RC, UnsatK<:Terrarium.AbstractUnsatK{NF}}

Soil hydraulics parameterization that includes the SURFEX (Masson et al. 2013) formulation of field capacity and wilting point as a function of soil texture.

Properties:

  • swrc::Any: Soil water retention curve

  • unsat_hydraulic_cond::Terrarium.AbstractUnsatK: Unsaturated hydraulic conductivity formulation; defaults to sat_hydraulic_cond

  • sat_hydraulic_cond::Any: Hydraulic conductivity at saturation [m/s]

  • wilting_point_coef::Any: Linear coeficient of wilting point adjustment due to clay content [-]

  • field_capacity_coef::Any: Linear coeficient of field capacity adjustment due to clay content [-]

  • field_capacity_exp::Any: Exponent of field capacity adjustment due to clay content [-]

source
Terrarium.SoilHydrology — Type
struct SoilHydrology{NF, VerticalFlow<:Terrarium.AbstractVerticalFlow, SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF}), VWCForcing<:Union{Nothing, Oceananigans.Forcings.ContinuousForcing{LX, LY, LZ, P} where {P, LX, LY, LZ}, Oceananigans.Forcings.DiscreteForcing}} <: Terrarium.AbstractSoilHydrology{NF}

Properties:

  • vertflow::Terrarium.AbstractVerticalFlow: Soil water vertical flow operator

  • closure::Terrarium.AbstractSoilWaterClosure: Closure relation for the soil hydrology state

  • hydraulic_properties::Terrarium.AbstractSoilHydraulics: Soil hydraulic properties parameterization

  • vwc_forcing::Union{Nothing, Oceananigans.Forcings.ContinuousForcing{LX, LY, LZ, P} where {P, LX, LY, LZ}, Oceananigans.Forcings.DiscreteForcing}: Forcing for soil moisture (volumetric water content)

source
Terrarium.SoilInitializer — Type
struct SoilInitializer{NF, EnergyInit<:Terrarium.AbstractInitializer{NF}, HydrologyInit<:Terrarium.AbstractInitializer{NF}, BGCInit<:Terrarium.AbstractInitializer{NF}} <: Terrarium.AbstractInitializer{NF}

Initializer for coupled soil energy/hydrology/biogeochemistry models.

source
Terrarium.SoilModel — Type
struct SoilModel{NF, GridType<:(Terrarium.AbstractLandGrid{NF}), Soil<:Terrarium.AbstractSoil{NF}, Constants<:PhysicalConstants{NF}, Initializer<:Terrarium.AbstractInitializer} <: Terrarium.AbstractSoilModel{NF, GridType<:(Terrarium.AbstractLandGrid{NF})}

General implementation of a 1D column model of soil energy, water, and carbon transport.

Properties:

  • grid::Terrarium.AbstractLandGrid: Spatial grid type

  • soil::Terrarium.AbstractSoil: Soil processes

  • constants::PhysicalConstants: Physical constants

  • initializer::Terrarium.AbstractInitializer: State variable initializer

source
Terrarium.SoilMoistureResistanceFactor — Type
struct SoilMoistureResistanceFactor{NF} <: Terrarium.AbstractGroundEvaporationResistanceFactor

Implements the soil moisture limiting resistance factor of Lee and Pielke (1992),

\[\beta = \frac{1}{4} \left[1 - \cos\left(π \theta_1/\theta_{\text{fc}} \right)\right] \quad \text{for } \theta_1 < \theta_{\text{fc}}\]

otherwise $\beta=1$.

source
Terrarium.SoilPorositySURFEX — Type
struct SoilPorositySURFEX{NF} <: Terrarium.AbstractSoilPorosity{NF}

SURFEX parameterization of mineral soil porosity (Masson et al. 2013).

source
Terrarium.SoilSaturationPressureClosure — Type
struct SoilSaturationPressureClosure <: Terrarium.AbstractSoilWaterClosure

Represents a closure relating saturation of water/ice in soil pores to a corresponding pressure (or hydraulic) head. Note that here "pressure head" is defined to be synonymous with hydraulic head, i.e. including all both elevation and hydrostatic pressure contributions. This relation is typically described by soil property-dependent soil-water retention curve (SWRC) which is here defined in implementations of AbstractSoilHydraulics.

source
Terrarium.SoilTexture — Type
struct SoilTexture{NF}

Represents soil texture as a fractional mixture of sand, silt, and clay. Accepts values

source
Terrarium.SoilThermalProperties — Type
struct SoilThermalProperties{NF, FC, CondBulk}

Properties:

  • conductivities::SoilThermalConductivities: Thermal conductivities for all constituents

  • bulk_conductivity::Any: Method for computing bulk thermal conductivity from constituents

  • heat_capacities::SoilHeatCapacities: Thermal conductivities for all constituents

  • freezecurve::Any: Freezing characteristic curve needed for energy-temperature closure

source
Terrarium.SoilVolume — Type
struct SoilVolume{NF, Solid<:Terrarium.AbstractSoilMatrix{NF}}

Represents the material composition of an elementary volume of soil. The volume is decomposed into the key constitutents of water, ice, air, and a mixture of organic and mineral solid material.

Properties:

  • porosity: Natural porosity or void space of the soil

  • saturation: Fraction of the soil pores occupied by water or ice

  • liquid: Liquid (unfrozen) fraction of pore water

  • solid: Parameterization of the solid phase (matrix) of the soil

source
Terrarium.SpecificHumidity — Type
struct SpecificHumidity <: Terrarium.AbstractHumidity

Humidity parameterization in which the near-surface specific humidity [kg/kg] is provided directly as an input field.

source
Terrarium.StateVariables — Type
struct StateVariables{NF, prognames, closurenames, auxnames, inputnames, nsnames, ProgFields, TendFields, AuxFields, InputFields, Namespaces, ClockType} <: Terrarium.AbstractStateVariables

Container type for all Fields corresponding to state variables defined by a model. StateVariables partitions the fields into three categories: prognostic, tendencies, and auxiliary. Prognostic variables are those which characterize the state of the system and are assigned tendencies to be integrated by the timestepper. Auxiliary fields are additional state variables derived from the prognostic state variables but which are conditionally independent of their values at the previous time step given the current prognostic state. It is worth noting that tendencies are also treated internally as auxiliary variables; however, they are assigned their own category here since they need to be handled separately by the timestepping scheme.

source
Terrarium.StaticExponentialRootDistribution — Type
struct StaticExponentialRootDistribution{NF} <: Terrarium.AbstractRootDistribution{NF}

Static vegetation root distribution implementation in PALADYN (Willeit 2016) based on the scheme proposed by Zeng (2001). The continuous density of the root distribution is modeled as

\[\frac{\partial R}{\partial z} = \frac{1}{2} \left[ a \exp(a z) + b \exp(b z) \right]\]

which is then integrated over the soil column and normalized to sum to unity. Note that this is effectively the average of two exponential distributions with rates a and b, both with units m⁻¹. The resulting CDF of this distribution determines the root distribution.

Properties:

  • a: First empirical rate parameter for root distribution

  • b: Second empirical rate parameter for root distribution

source
Terrarium.SurfaceEnergyBalance — Type
struct SurfaceEnergyBalance{NF, SkinTemperature<:Terrarium.AbstractSkinTemperature{NF}, TurbulentFluxes<:Terrarium.AbstractTurbulentFluxes{NF}, RadiativeFluxes<:Terrarium.AbstractRadiativeFluxes{NF}, Albedo<:Terrarium.AbstractAlbedo{NF}} <: Terrarium.AbstractSurfaceEnergyBalance{NF}

Standard implementation of the surface energy balance (SEB) that computes the radiative, turbulent, and ground energy fluxes at the surface. The SEB is also responsible for defining and solving the so-called skin temperature (effective emission temperature of the land surface) as well as the albedo.

source
Terrarium.SurfaceEnergyModel — Type
struct SurfaceEnergyModel{NF, GridType<:(Terrarium.AbstractLandGrid{NF}), SEB<:Terrarium.AbstractSurfaceEnergyBalance, Atmosphere<:Terrarium.AbstractAtmosphere, Initializer<:Terrarium.AbstractInitializer} <: Terrarium.AbstractSurfaceEnergyModel{NF, GridType<:(Terrarium.AbstractLandGrid{NF})}

Simple model wrapper for the SurfaceEnergyBalance that couples it with an AbstractAtmosphere to provide meteorological inputs. This model type is mostly intended for testing but could also be used for simple energy balance calculations from prescribed meteorological and ground temperature conditions.

source
Terrarium.SurfaceHydrology — Type
struct SurfaceHydrology{NF, CanopyInterception<:Terrarium.AbstractCanopyInterception{NF}, Evapotranspiration<:Terrarium.AbstractEvapotranspiration{NF}, SurfaceRunoff<:Terrarium.AbstractSurfaceRunoff{NF}} <: Terrarium.AbstractSurfaceHydrology{NF}

Properties:

  • canopy_interception: Canopy hydrology scheme

  • evapotranspiration: Canopy evapotranspiration scheme

  • surface_runoff: Surface runoff scheme

source
Terrarium.UniformSpacing — Type
struct UniformSpacing{NF} <: Terrarium.AbstractVerticalSpacing{NF}

Uniform vertical discretization with N layers of size Δz.

Properties:

  • Δz::Any

  • N::Int64

source
Terrarium.UnsatKLinear — Type
struct UnsatKLinear{NF} <: Terrarium.AbstractUnsatK{NF}

Simple formulation of hydraulic conductivity as a linear function of the liquid water saturated fraction, i.e. soil.water / (soil.water + soil.ice + soil.air).

source
Terrarium.UnsatKVanGenuchten — Type
struct UnsatKVanGenuchten{NF} <: Terrarium.AbstractUnsatK{NF}

Formulation of hydraulic conductivity as a function of saturated hydraulic conductivity K_sat and volumetric fractions, assumed to include those of water, ice, and air.

See van Genuchten (1980) and Westermann et al. (2023).

source
Terrarium.Variable — Type
struct Variable{name, VD, UT} <: Terrarium.AbstractVariable{name, VD, UT}

Represents metadata for a generic state variable with the given name and spatial dims.

source
Terrarium.Variables — Type
struct Variables{ProgVars, TendVars, AuxVars, InputVars, Namespaces}

Container for abstract state variable definitions. Automatically collates and merges all variables and namespaces passed into the constructor.

source
Terrarium.VegetationCarbon — Type
struct VegetationCarbon{NF, Photosynthesis<:Terrarium.AbstractPhotosynthesis{NF}, StomatalConductance<:Terrarium.AbstractStomatalConductance{NF}, AutotrophicRespiration<:Terrarium.AbstractAutotrophicRespiration{NF}, Phenology<:Terrarium.AbstractPhenology{NF}, CarbonDynamics<:Terrarium.AbstractVegetationCarbonDynamics{NF}, VegetationDynamics<:Union{Nothing, Terrarium.AbstractVegetationDynamics}, RootDistribution<:Union{Nothing, Terrarium.AbstractRootDistribution}} <: Terrarium.AbstractVegetation{NF}

Represents a generic coupling of vegetation carbon processes.

source
Terrarium.VegetationModel — Type
struct VegetationModel{NF, Vegetation<:Terrarium.AbstractVegetation{NF}, Atmosphere<:(Terrarium.AbstractAtmosphere{NF, PR, IR, HM, AD} where {PR<:Terrarium.AbstractPrecipitation, IR<:Terrarium.AbstractIncomingRadiation, HM<:Terrarium.AbstractHumidity, AD<:Terrarium.AbstractAerodynamics{NF}}), GridType<:(Terrarium.AbstractLandGrid{NF}), Constants<:PhysicalConstants{NF}, Initializer<:Terrarium.AbstractInitializer} <: Terrarium.AbstractVegetationModel{NF, GridType<:(Terrarium.AbstractLandGrid{NF})}

Model for natural (unmanaged) vegetation processes for a single plant functional type (PFT). Multiple PFTs can be later handled with a TiledVegetationModel type that composes multiple VegetationModels with different parameters for each PFT.

Properties:

  • grid::Terrarium.AbstractLandGrid: Spatial grid type

  • atmosphere::Terrarium.AbstractAtmosphere: Atmospheric input configuration

  • vegetation::Terrarium.AbstractVegetation: Vegetation processes

  • constants::PhysicalConstants: Physical constants

  • initializer::Terrarium.AbstractInitializer: State variable initializer

source
Terrarium.XY — Type
XY <: VarDims

Indicator type for variables that should be assigned a 2D (lateral only) field on their associated grid.

source
Terrarium.XYZ — Type
XYZ <: VarDims

Indicator type for variables that should be assigned a 3D field on their associated grid.

source
Terrarium.FieldBC — Type

Alias for union type of FieldBoundaryConditions or a named tuple of BoundaryConditions with keys corresponding to boundary locations (i.e. top, bottom, etc.)

source
Terrarium.Optional — Type

Alias for Union{Nothing, T} indicating that an argument or field of type T is optional and can be replaced with nothing.

source