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.
Base.merge — Method
Merges all of the given Variables containers into a single container.
Oceananigans.BoundaryConditions.compute_z_bcs! — Method
compute_z_bcs!(tendency, progvar, grid::AbstractLandGrid, state)Convenience alias for Oceananigans.BoundaryConditions.compute_z_bcs! that adds flux BCs for progvar to its corresponding tendency.
Oceananigans.BoundaryConditions.fill_halo_regions! — Method
Invoke fill_halo_regions! for all prognostic Fields in state.
Oceananigans.BoundaryConditions.getbc — Method
getbc(::Variable{name}, i::Integer, j::Integer, grid::Oceananigans.Grids.AbstractGrid, clock, fields) where {name}Implementation of Oceananigans.BoundaryConditions.getbc for variable placeholders that retrieves the input Field from fields and returns the value at the given index.
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).
Oceananigans.TimeSteppers.reset! — Method
Reset all Fields in state to zero.
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.
Terrarium.AmbientCO2 — Method
Creates a TracerGas for ambient CO2 with concentration prescribed by an input variable with the given name.
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.
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.
Terrarium.HomogeneousSoilStratigraphy — Method
HomogeneousSoilStratigraphy(
::Type{NF};
texture,
porosity
) -> SoilStratigraphy{NF, 1, Horizons} where {NF, Horizons<:Tuple{ConstantSoilHorizon{NF, _B, ConstantSoilPorosity{NF}} where _B}}
Convenience constructor that creates a SoilStratigraphy with a single ConstantSoilHorizon.
Terrarium.ImpermeableBoundary — Method
Alias for NoFlux representing a zero-flux bottom boundary condition for water flow (prognostic variable saturation_water_ice).
Terrarium.InfiltrationFlux — Function
Alias for PrescribedFlux with name infiltration representing liquid water infiltration at the soil surface.
Terrarium.PrescribedBottomTemperature — Function
Alias for ValueBoundaryCondition on top temperature (in °C) with the given variable name.
Terrarium.PrescribedSurfaceTemperature — Function
Alias for ValueBoundaryCondition on top temperature (in °C) with the given variable name.
Terrarium.SoilGridsStratigraphy — Method
SoilGridsStratigraphy(
::Type{NF};
porosity,
horizon1,
horizon2,
horizon3,
horizon4,
horizon5,
horizon6
) -> SoilStratigraphy{NF, 6, _B} where {NF, _B<:NTuple{6, Terrarium.AbstractSoilHorizon{NF}}}
Convenience constructor that creates a SoilStratigraphy with six horizons corresponding to the six depth intervals defined by the SoilGridsV2 dataset. The porosity parameterization is applied to all six default horizons; pass explicit horizon* arguments to override individual horizons (in which case porosity does not apply to those).
Terrarium.SoilHeatFlux — Function
Alias for FluxBoundaryCondition on internal_energy with name soil_heat_flux representing the net heat flux into the top of the soil column. Without snow this equals the surface energy balance ground_heat_flux; with snow it is the (blended) conductive flux across the snow base.
Terrarium.TracerGases — Method
Creates a NamedTuple from the given tracer gas types.
Terrarium._get_fields_expr — Method
Generation-time helper for get_fields. Given the type Vars of a tuple of AbstractVariables and Namespaces, builds an expression that retrieves all matching fields from state_ex (an expression evaluating to the state container) and vars_ex (an expression evaluating to the variable tuple). The recursion over namespaces is performed here, at expansion time, so that the generated body for get_fields contains no self-call. This is what makes the method type stable: a runtime self-recursive get_fields would otherwise trigger inference's recursion limiting and widen the return type of the nested namespace lookups to an abstract NamedTuple.
Terrarium.adjust_saturation_profile! — Method
adjust_saturation_profile!(
out,
i,
j,
grid,
hydrology::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.
Terrarium.aerodynamic_resistance — Method
aerodynamic_resistance(i, j, grid, fields, atmos::PrescribedAtmosphere)Compute the aerodynamic resistance (inverse conductance) at grid cell i, j.
Terrarium.aerodynamic_resistance — Method
aerodynamic_resistance(
i,
j,
grid,
fields,
atmos::Terrarium.AbstractAtmosphere,
evapotranspiration::PALADYNCanopyEvapotranspiration{NF},
_::Terrarium.AbstractVegetation
) -> Any
Compute the aerodynamic resistance between the ground and canopy as a function of LAI and SAI.
Terrarium.air_pressure — Method
air_pressure(i, j, grid, fields, ::PrescribedAtmosphere)Retrieve or compute the air pressure at the current time step.
Terrarium.air_temperature — Method
air_temperature(i, j, grid, fields, ::PrescribedAtmosphere)Retrieve or compute the air temperature at the current time step.
Terrarium.albedo — Method
albedo(i, j, grid, fields, albedo::ConstantAlbedo) -> Any
Return the surface albedo at grid point i, j.
Terrarium.albedo — Method
albedo(i, j, grid, fields, ::AbstractAlbedo)Return the current albedo at the given indices.
Terrarium.ambient_co2 — Method
ambient_co2(i, j, grid, fields, ::PrescribedAtmosphere)Return the current prescribed ambient CO2 concentration level.
Terrarium.auxiliary — Function
auxiliary(name, dims; ...)
auxiliary(name, dims, ctor; ...)
auxiliary(name, dims, ctor, params; units, bounds, desc)
Convenience constructor method for AuxiliaryVariable.
Terrarium.auxiliary_fields — Method
auxiliary_fields(state, components)
Retrieves all Fields from state corresponding to auxiliary variables defined on the given components.
Terrarium.auxiliary_variables — Method
Helper method that selects only auxiliary variables declared on obj.
Terrarium.canopy_evaporation_conductance — Method
canopy_evaporation_conductance(
_::PALADYNCanopyEvapotranspiration,
f_can,
rₐ
) -> Any
Compute the canopy evaporation vapor conductance [m/s] from canopy saturation fraction f_can and aerodynamic resistance rₐ. The canopy evaporation flux is this conductance times the humidity gradient.
Terrarium.canopy_water — Function
canopy_water(i, j, grid, fields, ::AbstractCanopyInterception)Compute or retrieve the current canopy water storage [m].
Terrarium.celsius_to_kelvin — Method
celsius_to_kelvin(c::ThermodynamicConstants, T)Convert the given temperature in °C to Kelvin based on the constant temperature_water_freeze.
Terrarium.check_duplicates — Method
Check for variables/namespaces with duplicate names and raise an error if duplicates are detected.
Terrarium.checkfinite! — Function
checkfinite!(field)
checkfinite!(field, name)
Check whether the given field has any NaN or Inf values and raise an error if NaNs are detected.
Terrarium.closure! — Method
closure!(
state,
grid,
closure::SnowEnergyTemperatureClosure,
snow::SingleLayerSnow,
constants::PhysicalConstants,
args...
)
Forward closure: recover snow_temperature and snow_liquid_fraction from the prognostic snow_energy.
Terrarium.closure! — Method
Compute the forward closure mapping for soil hydrology and energy, in that order.
Terrarium.closure! — Method
closure!(state, grid, closure::AbstractClosureRelation, process, args...)Apply closure for process on the given grid with additional implementation-specific args.
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.
Terrarium.closure! — Method
closure!(state, model::AbstractModel)Apply all closure relations defined for the given model.
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.
Terrarium.closure_fields — Method
closure_fields(state, components)
Retrieves all Fields from state corresponding to closure variables defined on the given components.
Terrarium.closure_variables — Method
Helper method that selects only closure (auxiliary) variables declared on obj.
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.
Terrarium.compute_APAR — Method
compute_APAR(
photo::LUEPhotosynthesis{NF},
traits::PlantTraits{NF},
swdown,
LAI
) -> Any
Computes absorbed PAR limited by the fraction of PAR assimilated at ecosystem level APAR [mol/m²/s], [16, Eq. (62)].
References
- [16] Willeit & Ganopolski, Geoscientific Model Development (2016)
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], [17, Eq. (2)].
References
- [17] Haxeltine & Prentice, Global Biogeochemical Cycles (1996)
Terrarium.compute_C_veg_tend — Method
compute_C_veg_tend(vegcarbon_dynamics, traits, LAI_b, NPP)
Computes the C_veg tendency based on NPP and the balanced Leaf Area Index LAI_b, [16, Eq. (72)]
References
- [16] Willeit & Ganopolski, Geoscientific Model Development (2016)
Terrarium.compute_GPP — Method
compute_GPP(_::LUEPhotosynthesis{NF}, An) -> Any
Compute the Gross Primary Production rate [kgC/m²/s].
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], [17, Eqs. (3, 5)].
References
- [17] Haxeltine & Prentice, Global Biogeochemical Cycles (1996)
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].
Terrarium.compute_PAR — Method
compute_PAR(photo::LUEPhotosynthesis{NF}, swdown) -> Any
Computes NET Photosynthetically Active Radiation PAR [mol/m²/s].
Terrarium.compute_Ra — Method
compute_Ra(
autoresp,
vegcarbon_dynamics,
traits,
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].
Terrarium.compute_Rd — Method
compute_Rd(photo::LUEPhotosynthesis, Vc_max, β) -> Any
Computes the leaf respiration rate Rd [gC/m²/s], [17, Eq. (10)] and [16, Eq. (10)].
References
Terrarium.compute_Rg — Method
compute_Rg(autoresp, GPP, Rm)
Computes growth respiration Rg in [kgC/m²/s].
Terrarium.compute_Rm — Method
compute_Rm(
autoresp,
vegcarbon_dynamics,
traits,
T_air,
T_soil,
Rd,
phen,
C_veg
)
Computes maintenance respiration Rm in [kgC/m²/day].
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 [18] Box 2. Note: this is not the same formula as in the [16] paper, this implementaion is taken from the code
References
Terrarium.compute_albedo! — Method
compute_albedo!(
out,
i,
j,
grid,
fields,
albedo::DiagnosticAlbedo,
vegetation::Union{Nothing, Terrarium.AbstractVegetation},
snow::Union{Nothing, Terrarium.AbstractSnow},
args...
)
Terrarium.compute_albedo — Method
compute_albedo(
i,
j,
grid,
fields,
snow::Terrarium.AbstractSnow
) -> Any
Terrarium.compute_albedo — Method
compute_albedo(
i,
j,
grid,
fields,
albedo::Terrarium.ConstantSnowAlbedo
) -> Any
Terrarium.compute_assimilation_factors — Method
compute_assimilation_factors(
photo::LUEPhotosynthesis{NF},
constants::MaterialConstants{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 [16, Eqs. (C4-C5)] and [17].
- 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
References
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.
Terrarium.compute_autotrophic_respiration! — Method
compute_autotrophic_respiration!(
out,
i,
j,
grid,
fields,
autoresp::Terrarium.AbstractAutotrophicRespiration,
args...
) -> Any
Mutating wrapper for compute_autotrophic_respiration that stores the results in out.
Terrarium.compute_autotrophic_respiration — Method
compute_autotrophic_respiration(
i,
j,
grid,
fields,
autoresp::PALADYNAutotrophicRespiration,
vegcarbon_dynamics::PALADYNCarbonDynamics,
phenology::Terrarium.AbstractPhenology,
traits::PlantTraits,
atmos::Terrarium.AbstractAtmosphere
) -> Tuple{Any, Any}
Compute autotrophic respiration following the scheme of [16].
References
- [16] Willeit & Ganopolski, Geoscientific Model Development (2016)
Terrarium.compute_auxiliary! — Function
compute_auxiliary!(
state,
grid,
seb::SurfaceEnergyBalance,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
)
compute_auxiliary!(
state,
grid,
seb::SurfaceEnergyBalance,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
hydrology::Union{Nothing, Terrarium.AbstractSurfaceHydrology}
)
compute_auxiliary!(
state,
grid,
seb::SurfaceEnergyBalance,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
hydrology::Union{Nothing, Terrarium.AbstractSurfaceHydrology},
vegetation::Union{Nothing, Terrarium.AbstractVegetation}
)
compute_auxiliary!(
state,
grid,
seb::SurfaceEnergyBalance,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
hydrology::Union{Nothing, Terrarium.AbstractSurfaceHydrology},
vegetation::Union{Nothing, Terrarium.AbstractVegetation},
snow::Union{Nothing, Terrarium.AbstractSnow},
args...
)
Terrarium.compute_auxiliary! — Function
compute_auxiliary!(
state,
grid,
hydrology::SurfaceHydrology,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
)
compute_auxiliary!(
state,
grid,
hydrology::SurfaceHydrology,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Union{Nothing, Terrarium.AbstractSoil}
)
compute_auxiliary!(
state,
grid,
hydrology::SurfaceHydrology,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Union{Nothing, Terrarium.AbstractSoil},
vegetation::Union{Nothing, Terrarium.AbstractVegetation}
)
compute_auxiliary!(
state,
grid,
hydrology::SurfaceHydrology,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Union{Nothing, Terrarium.AbstractSoil},
vegetation::Union{Nothing, Terrarium.AbstractVegetation},
snow::Union{Nothing, Terrarium.AbstractSnow},
args...
)
Terrarium.compute_auxiliary! — Function
compute_auxiliary!(
state,
grid,
veg::VegetationCarbonCycle,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
)
compute_auxiliary!(
state,
grid,
veg::VegetationCarbonCycle,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Union{Nothing, Terrarium.AbstractSoil},
args...
)
Compute auxiliary variables for all vegetation component processes based on the given atmospheric inputs defined by atmos and (optionally) soil state. If soil = nothing, stress factors due to soil temperature and moisture availability will be ignored.
Terrarium.compute_auxiliary! — Function
compute_auxiliary!(state, grid, albedo::DiagnosticAlbedo)
compute_auxiliary!(
state,
grid,
albedo::DiagnosticAlbedo,
vegetation::Union{Nothing, Terrarium.AbstractVegetation}
)
compute_auxiliary!(
state,
grid,
albedo::DiagnosticAlbedo,
vegetation::Union{Nothing, Terrarium.AbstractVegetation},
snow::Union{Nothing, Terrarium.AbstractSnow},
args...
)
Diagnose the blended surface albedo and emissivity, weighting the snow-free background and snow values by the snow-covered area fraction of the optional snow component.
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.
Terrarium.compute_auxiliary! — Function
compute_auxiliary!(
state,
grid,
veg::PrescribedVegetation,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
)
compute_auxiliary!(
state,
grid,
veg::PrescribedVegetation,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Union{Nothing, Terrarium.AbstractSoil},
args...
)
Compute auxiliary variables for all vegetation component processes based on the given atmospheric inputs defined by atmos and (optionally) soil state. If soil = nothing, stress factors due to soil temperature and moisture availability will be ignored.
Terrarium.compute_auxiliary! — Function
compute_auxiliary!(
state,
grid,
runoff::DirectSurfaceRunoff,
canopy_interception::Terrarium.AbstractCanopyInterception,
soil::Terrarium.AbstractSoil
)
compute_auxiliary!(
state,
grid,
runoff::DirectSurfaceRunoff,
canopy_interception::Terrarium.AbstractCanopyInterception,
soil::Terrarium.AbstractSoil,
snow::Union{Nothing, Terrarium.AbstractSnow},
args...
)
Terrarium.compute_auxiliary! — Function
compute_auxiliary!(
state,
grid,
evaporation::BareGroundEvaporation,
::NoCanopyInterception,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
)
compute_auxiliary!(
state,
grid,
evaporation::BareGroundEvaporation,
::NoCanopyInterception,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Union{Nothing, Terrarium.AbstractSoil}
)
compute_auxiliary!(
state,
grid,
evaporation::BareGroundEvaporation,
::NoCanopyInterception,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Union{Nothing, Terrarium.AbstractSoil},
snow::Union{Nothing, Terrarium.AbstractSnow}
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
rad::DiagnosedRadiativeFluxes,
seb::Terrarium.AbstractSurfaceEnergyBalance,
consts::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
args...
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
tur::DiagnosedTurbulentFluxes,
seb::Terrarium.AbstractSurfaceEnergyBalance,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
args...
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
paw::FieldCapacityLimitedPAW,
soil::Terrarium.AbstractSoil,
args...
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
skinT::ImplicitSkinTemperature,
seb::Terrarium.AbstractSurfaceEnergyBalance,
args...
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
photo::LUEPhotosynthesis,
stomcond::Terrarium.AbstractStomatalConductance,
traits::PlantTraits,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
args...
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
stomcond::MedlynStomatalConductance,
traits::PlantTraits,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
args...
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
autoresp::PALADYNAutotrophicRespiration,
vegcarbon::Terrarium.AbstractVegetationCarbonDynamics,
phenology::Terrarium.AbstractPhenology,
traits::PlantTraits,
atmos::Terrarium.AbstractAtmosphere
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
evapotranspiration::PALADYNCanopyEvapotranspiration,
canopy_interception::Terrarium.AbstractCanopyInterception,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Terrarium.AbstractSoil,
vegetation::Terrarium.AbstractVegetation,
args...
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
canopy_interception::PALADYNCanopyInterception,
atmos::Terrarium.AbstractAtmosphere
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
vegcarbon_dynamics::PALADYNCarbonDynamics,
traits::PlantTraits,
args...
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
phenol::PALADYNPhenology,
vegcarbon::PALADYNCarbonDynamics,
atmos::Terrarium.AbstractAtmosphere
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
veg_dynamics::PALADYNVegetationDynamics,
args...
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
rad::PrescribedRadiativeFluxes,
seb::Terrarium.AbstractSurfaceEnergyBalance,
atmos::Terrarium.AbstractAtmosphere,
args...
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
snow::SingleLayerSnow,
constants::PhysicalConstants,
args...
)
Diagnose the snow geometric and thermal properties (snow_depth, snow_cover_fraction, snow_thermal_conductivity) from the current snow water equivalent and bulk density. The enthalpy closure (snow_temperature, snow_liquid_fraction) is added in a later phase.
Terrarium.compute_auxiliary! — Method
Compute auxiliary variables for soil energy, water, and carbon state variables on grid based on the given values in constants.
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
hydrology::SoilHydrology,
soil::Terrarium.AbstractSoil,
args...
)
Terrarium.compute_auxiliary! — Method
compute_auxiliary!(
state,
grid,
energy::SoilThermodynamics,
soil::Terrarium.AbstractSoil,
args...
)
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...
)
Terrarium.compute_balanced_leaf_area_index — Method
compute_balanced_leaf_area_index(
vegcarbon_dynamics,
traits,
C_veg
)
Computes LAI_b, the balanced Leaf Area Index based on the vegetation carbon pool C_veg (assuming with bwl = 1), [16, Eqs. (76-79)].
References
- [16] Willeit & Ganopolski, Geoscientific Model Development (2016)
Terrarium.compute_canopy_interception — Method
compute_canopy_interception(
canopy_interception::PALADYNCanopyInterception{NF},
precip,
LAI,
SAI
) -> Any
Compute I_can, the canopy rain interception, following [16, Eq. (42)].
References
- [16] Willeit and Ganopolski, Geoscientific Model Development (2016)
Terrarium.compute_canopy_saturation_fraction — Method
compute_canopy_saturation_fraction(
canopy_interception::PALADYNCanopyInterception{NF},
W_can,
LAI,
SAI
) -> Any
Compute the canopy saturation fraction as W_can / W_can_max.
Terrarium.compute_canopy_water_removal — Method
compute_canopy_water_removal(
canopy_interception::PALADYNCanopyInterception{NF},
W_can
) -> Any
Compute the canopy water removal rate as W_can / τw.
Terrarium.compute_canopy_water_tendency — Method
compute_canopy_water_tendency(
_::PALADYNCanopyInterception{NF},
I_can,
E_can,
R_can
) -> Any
Compute the W_can tendency and removal rate following [16, Eq. (41)].
References
- [16] Willeit and Ganopolski, Geoscientific Model Development (2016)
Terrarium.compute_emissivity — Method
compute_emissivity(
i,
j,
grid,
fields,
snow::Terrarium.AbstractSnow
) -> Any
Terrarium.compute_emissivity — Method
compute_emissivity(
i,
j,
grid,
fields,
albedo::Terrarium.ConstantSnowAlbedo
) -> Any
Terrarium.compute_energy_tendencies! — Method
compute_energy_tendencies!(
tendencies,
i,
j,
k,
grid,
fields,
energy::SoilThermodynamics,
args...
)
Terrarium.compute_energy_tendency — Function
compute_energy_tendency(i, j, k, grid, ::AbstractThermodynamics, args...)Compute the internal energy tendency ∂U∂t at index i, j, k.
Terrarium.compute_energy_tendency — Method
compute_energy_tendency(
i,
j,
k,
grid,
fields,
energy::Terrarium.AbstractThermodynamics,
args...
) -> Any
Compute the internal energy tendency ∂U∂t as the divergence of the diffusive heat flux for the explicit two-phase heat conduction operator.
Terrarium.compute_evaporation_flux — Method
compute_evaporation_flux(
_::Terrarium.AbstractEvapotranspiration,
Δq,
g
) -> Any
Compute an evapotranspiration flux (m/s, positive upwards) as the product of a vapor conductance g (m/s) and a specific humidity difference Δq (kg/kg). All evapotranspiration components — soil/canopy evaporation and transpiration — share the functional form $E = Δq · g$, differing only in which conductance and humidity difference are supplied.
Terrarium.compute_evapotranspiration_conductances — Function
compute_evapotranspiration_conductances(
i,
j,
grid,
fields,
evaporation::BareGroundEvaporation,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
) -> Any
compute_evapotranspiration_conductances(
i,
j,
grid,
fields,
evaporation::BareGroundEvaporation,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Union{Nothing, Terrarium.AbstractSoil}
) -> Any
Compute the skin-driven ground evaporation vapor conductance β/rₐ at grid cell i, j for the given bare-ground evaporation scheme. This conductance is independent of the skin temperature.
Terrarium.compute_evapotranspiration_conductances! — Function
compute_evapotranspiration_conductances!(
out,
i,
j,
grid,
fields,
evaporation::BareGroundEvaporation,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
) -> Any
compute_evapotranspiration_conductances!(
out,
i,
j,
grid,
fields,
evaporation::BareGroundEvaporation,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Union{Nothing, Terrarium.AbstractSoil}
) -> Any
Compute and store the skin-driven ground evaporation vapor conductance on grid for the given bare-ground evaporation scheme.
Terrarium.compute_evapotranspiration_conductances! — Method
compute_evapotranspiration_conductances!(
out,
i,
j,
grid,
fields,
evapotranspiration::PALADYNCanopyEvapotranspiration,
canopy_interception::Terrarium.AbstractCanopyInterception,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Terrarium.AbstractSoil,
vegetation::Terrarium.AbstractVegetation,
args...
) -> Any
Compute and store the skin-driven vapor conductances on grid for the given scheme evapotranspiration and process dependencies.
Terrarium.compute_evapotranspiration_conductances — Method
compute_evapotranspiration_conductances(
i,
j,
grid,
fields,
evapotranspiration::PALADYNCanopyEvapotranspiration,
canopy_interception::Terrarium.AbstractCanopyInterception,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
soil::Terrarium.AbstractSoil,
vegetation::Terrarium.AbstractVegetation,
args...
) -> Tuple{Any, Any, Any}
Compute the skin-driven vapor conductances (ground_evaporation_conductance, canopy_evaporation_conductance, and transpiration_conductance) at grid cell i, j for the given scheme evapotranspiration and process dependencies. These conductances are independent of the skin temperature.
Terrarium.compute_evapotranspiration_fluxes! — Method
Compute transpiration, evaporation_ground, and evaporation_canopy fluxes on grid for the given scheme evapotranspiration and process dependencies.
Terrarium.compute_evapotranspiration_fluxes — Method
Compute transpiration, evaporation_ground, and evaporation_canopy fluxes on grid for the given scheme evapotranspiration and process dependencies.
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.
Terrarium.compute_gdd_tendency! — Method
compute_gdd_tendency!(
tend,
i,
j,
grid,
fields,
phenol::PALADYNPhenology,
atmos::Terrarium.AbstractAtmosphere
) -> Any
Mutating wrapper for compute_gdd_tendency that stores the growing-degree-day tendency in tend.
Terrarium.compute_gdd_tendency — Method
compute_gdd_tendency(phenol, gdd, T_air)
Compute the growing-degree-day tendency d(gdd)/dt [K⋅day/s] at a single grid point.
Heat above the base temperature is accumulated (in degree-days per second) and, below the base temperature, the accumulator relaxes toward zero with timescale gdd_relaxation_time. The relaxation provides a continuous surrogate for the discrete annual reset of the original scheme.
Terrarium.compute_ground_heat_flux! — Method
compute_ground_heat_flux!(
out,
i,
j,
grid,
fields,
skinT::Terrarium.AbstractSkinTemperature,
seb::Terrarium.AbstractSurfaceEnergyBalance
)
Per-cell mutating variant used by the fused surface-energy-balance kernel: store the ground heat flux into the auxiliary output field out.
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$ (all fluxes positive upward).
Terrarium.compute_ground_heat_flux — Method
compute_ground_heat_flux(
i,
j,
grid,
fields,
skinT::Terrarium.AbstractSkinTemperature,
_::Terrarium.AbstractSurfaceEnergyBalance
) -> Any
Compute the ground heat flux from the surface net radiation and sensible/latent heat flux at grid cell i, j.
Terrarium.compute_ground_heat_flux — Method
compute_ground_heat_flux(
_::Terrarium.AbstractSkinTemperature,
R_net,
H_s,
H_l
) -> Any
Compute the ground heat flux G that closes the surface energy balance. With all fluxes positive upward (aligned with +z), the energy arriving at the skin from below must balance the radiative and turbulent losses above, so G = R_net + H_s + H_l.
Terrarium.compute_heat_capacity — Method
compute_heat_capacity(props, soil)
Compute the bulk heat capacity of the given soil volume.
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.
Terrarium.compute_hydraulics! — Method
compute_hydraulics!(
out,
i,
j,
k,
grid,
fields,
hydrology::SoilHydrology,
args...
)
Kernel function that computes dynamic soil hydraulic properties.
Terrarium.compute_hydraulics! — Method
compute_hydraulics!(
out,
i,
j,
k,
grid,
fields,
hydrology::SoilHydrology{NF, RichardsEq, SaturationClosure, SoilHydraulics} where {SaturationClosure<:Terrarium.AbstractSoilWaterClosure, SoilHydraulics<:(Terrarium.AbstractSoilHydraulics{NF})},
strat::Terrarium.AbstractStratigraphy,
bgc::Terrarium.AbstractSoilBiogeochemistry
)
Computes the unsaturated hydraulic conductivity for RichardsEq configurations of SoilHydrology.
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.
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 [17], 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]
References
- [17] Haxeltine & Prentice, Global Biogeochemical Cycles (1996)
Terrarium.compute_latent_heat_flux — Function
compute_latent_heat_flux(
i,
j,
grid,
fields,
tur::DiagnosedTurbulentFluxes,
skinT::Terrarium.AbstractSkinTemperature,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
) -> Any
compute_latent_heat_flux(
i,
j,
grid,
fields,
tur::DiagnosedTurbulentFluxes,
skinT::Terrarium.AbstractSkinTemperature,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
evtr::Union{Nothing, Terrarium.AbstractEvapotranspiration}
) -> Any
compute_latent_heat_flux(
i,
j,
grid,
fields,
tur::DiagnosedTurbulentFluxes,
skinT::Terrarium.AbstractSkinTemperature,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
evtr::Union{Nothing, Terrarium.AbstractEvapotranspiration},
snow::Union{Nothing, Terrarium.AbstractSnow}
) -> Any
Compute the latent heat flux at i, j based on the current skin temperature and atmospheric conditions. When an evapotranspiration scheme is provided, uses the ET-aware humidity flux; otherwise uses bare ground evaporation.
With a snow component, the flux is partitioned by snow-covered area fraction f_snow: the snow-free fraction (1 − f_snow) evaporates from the ground/canopy (latent heat of vaporization), while the snow-covered fraction sublimates from the snowpack (latent heat of sublimation, see compute_snow_sublimation_flux). Without snow it reduces to the bare ground/canopy latent flux.
Terrarium.compute_latent_heat_flux — Method
compute_latent_heat_flux(
_::DiagnosedTurbulentFluxes,
Q_h,
ρₐ,
L
) -> 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 vaporization or sublimation L [J/kg].
Terrarium.compute_leaf_area_index — Method
compute_leaf_area_index(phenol, ϕ, LAI_b)
Compute the instantaneous leaf area index LAI = ϕ·LAI_b from the phenology factor ϕ and the balanced leaf area index LAI_b.
Terrarium.compute_longwave_up — Method
compute_longwave_up(::DiagnosedRadiativeFluxes, constants::PhysicalConstants, L_down, Ts, ϵ)Compute outgoing longwave radiation from incoming longwave radiation L_down, surface temperature Ts, and emissivity ϵ.
Terrarium.compute_meltwater_outflow — Method
compute_meltwater_outflow(
hydraulics::ConstantSnowHydraulics,
θ_liq
) -> Any
Darcy-type meltwater outflow M_r (m/s, SWE). Liquid water in excess of the capillary retention L_c drains from the snowpack with a cubic conductivity [3] (in excess-saturation form): M_r = K_sat · S*³ with S* = max(θ_liq − L_c, 0) / (1 − L_c), where θ_liq is the liquid fraction of the water substance. Outflow vanishes smoothly as θ_liq → L_c and saturates at K_sat as θ_liq → 1.
References
- [3] Tarboton et al., Report (1994)
Terrarium.compute_phenology — Function
compute_phenology(i, j, grid, fields, phenol::AbstractPhenology, atmos::AbstractAtmosphere)Cell-level phenology computation. Implementations return phenology factors and derived LAI at the given index i, j, using atmospheric inputs (e.g. air temperature) where required by the scheme.
Terrarium.compute_phenology! — Method
compute_phenology!(
out,
i,
j,
grid,
fields,
phenol::PALADYNPhenology,
atmos::Terrarium.AbstractAtmosphere
) -> Any
Mutating wrapper for compute_phenology that stores the result in out.
Terrarium.compute_phenology — Method
compute_phenology(
i,
j,
grid,
fields,
phenol::PALADYNPhenology,
atmos::Terrarium.AbstractAtmosphere
) -> Tuple{Any, Any}
Compute the phenology factor and instantaneous leaf area index (LAI) at a single grid point.
Terrarium.compute_phenology_factor — Method
compute_phenology_factor(phenol, gdd, T_air)
Compute the phenology factor ϕ [-] from accumulated growing degree days gdd and air temperature T_air.
The cold-deciduous factor combines the growth-phase ramp gdd / gdd_crit [16, Eq. (83)] with a senescence ramp that declines linearly from 1 at T_gdd_base to 0 at T_gdd_base − T_senescence_range. Taking the minimum reproduces all three PALADYN regimes (linear green-up, held at 1 when mature and warm, temperature-driven senescence). The result is then blended with the evergreen value of 1 via the prescribed deciduous fraction.
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.
Terrarium.compute_photosynthesis! — Method
compute_photosynthesis!(
out,
i,
j,
grid,
fields,
photo::LUEPhotosynthesis,
stomcond::Terrarium.AbstractStomatalConductance,
traits::PlantTraits,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
) -> Any
Calls compute_photosynthesis and stores the results in out.
Terrarium.compute_photosynthesis — Method
compute_photosynthesis(
i,
j,
grid,
fields,
photo::LUEPhotosynthesis,
stomcond::Terrarium.AbstractStomatalConductance,
traits::PlantTraits,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
) -> 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.
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.
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.
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.
Terrarium.compute_precip_ground — Method
compute_precip_ground(_, precip, I_can, R_can)
Compute rainfall_ground, the rate of rain reaching the ground, following a modified version of [16, Eq. (44)]. Instead of subtracting the tendency, we just directly subtract interception and add the removal rate R_can.
References
- [16] Willeit and Ganopolski, Geoscientific Model Development (2016)
Terrarium.compute_pres_i — Method
compute_pres_i(photo::LUEPhotosynthesis, λc, pres_a) -> Any
Computes intercellular CO2 partial pressure [Pa], [16, Eq. (67)].
References
- [16] Willeit & Ganopolski, Geoscientific Model Development (2016)
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.
Terrarium.compute_resp10 — Method
compute_resp10(autoresp)
Computes resp10
Terrarium.compute_respiration_assimilation — Method
compute_respiration_assimilation(
photo::LUEPhotosynthesis{NF},
traits::PlantTraits{NF},
constants::MaterialConstants{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.
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}
)
Terrarium.compute_sensible_heat_flux — Method
compute_sensible_heat_flux(
i,
j,
grid,
fields,
tur::DiagnosedTurbulentFluxes,
skinT::Terrarium.AbstractSkinTemperature,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
) -> Any
Compute the sensible heat flux at i, j based on the current skin temperature and atmospheric conditions.
Terrarium.compute_sensible_heat_flux — Method
compute_sensible_heat_flux(
_::DiagnosedTurbulentFluxes,
Q_T,
ρₐ,
cₐ
) -> Any
Compute the sensible heat flux [W/m²] 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.
Terrarium.compute_shortwave_up — Method
compute_shortwave_up(::DiagnosedRadiativeFluxes, S_down, α)Compute outgoing shortwave radiation from the incoming shortwave radiation S_down and albedo α.
Terrarium.compute_skin_temperature — Function
compute_skin_temperature(
i,
j,
grid,
fields,
skinT::ImplicitSkinTemperature,
constants::PhysicalConstants
) -> Any
compute_skin_temperature(
i,
j,
grid,
fields,
skinT::ImplicitSkinTemperature,
constants::PhysicalConstants,
snow::Union{Nothing, Terrarium.AbstractSnow}
) -> Any
Estimate the skin temperature from the current ground_heat_flux at grid cell i, j, using the effective conduction target of the medium below the skin. The optional snow argument enables the snow-covered blend (see ground_thermal_interface); with snow === nothing this is the snow-free soil conduction.
Terrarium.compute_skin_temperature! — Function
compute_skin_temperature!(
state,
grid,
skinT::ImplicitSkinTemperature,
constants::PhysicalConstants
)
compute_skin_temperature!(
state,
grid,
skinT::ImplicitSkinTemperature,
constants::PhysicalConstants,
snow::Union{Nothing, Terrarium.AbstractSnow}
)
Compute skin_temperature from the current ground_heat_flux using the (optionally snow-aware) conduction target. constants supplies the material properties for the conduction blend; passing a snow component (default nothing) selects the snow-covered ground_thermal_interface, while snow === nothing recovers the snow-free soil conduction.
Terrarium.compute_skin_temperature! — Function
compute_skin_temperature!(
out,
i,
j,
grid,
fields,
skinT::ImplicitSkinTemperature,
seb::Terrarium.AbstractSurfaceEnergyBalance,
constants::PhysicalConstants
)
compute_skin_temperature!(
out,
i,
j,
grid,
fields,
skinT::ImplicitSkinTemperature,
seb::Terrarium.AbstractSurfaceEnergyBalance,
constants::PhysicalConstants,
snow::Union{Nothing, Terrarium.AbstractSnow},
seb_args...
)
Recompute surface energy fluxes using compute_surface_energy_fluxes! and update the skin temperature based on the resulting ground heat flux.
Terrarium.compute_skin_temperature — Method
compute_skin_temperature(
_::ImplicitSkinTemperature,
Tg,
G,
Δz,
κ
) -> Any
Compute the implicit update of the skin temperature from the sub-surface temperature Tg, ground heat flux G, half-cell distance Δz, and effective conductivity κ, by equating G to the half-cell conductive flux 2κ(Tg − Ts)/Δz.
Terrarium.compute_skin_temperature_residual! — Method
compute_skin_temperature_residual!(
out,
i,
j,
grid,
fields,
skinT::ImplicitSkinTemperature,
seb::Terrarium.AbstractSurfaceEnergyBalance,
snow,
constants,
seb_args...
) -> Any
Same as compute_skin_temperature! but returns the residual instead of updating the skin_temperature Field.
Terrarium.compute_snow_basal_heat_flux — Method
compute_snow_basal_heat_flux(
κ_snow,
T_soil,
T_snow,
d_snow
) -> Any
Snow→soil basal conductive heat flux Q_base [W/m²], positive upward (soil → snow). The snowpack is a strong insulator, so only its resistance is retained (snow-resistance-only closure): Q_base = 2·κ_snow·(T_soil − T_snow)/d_snow. The depth is regularized with a machine-eps offset so the flux stays finite as the snowpack vanishes.
Terrarium.compute_snow_cover_fraction — Method
compute_snow_cover_fraction(
cover::FractionalSnowCover{NF},
swe
) -> Any
Sub-grid snow-covered area fraction f_snow = W_snow/(W_snow + W_ref) ∈ [0,1) from the snow water equivalent W_snow [m] and the reference level W_ref (half_coverage), clamping negative SWE (which can occur transiently in the prognostic state) to zero cover.
Terrarium.compute_snow_density — Function
snow_density(i, j, grid, fields, ::AbstractSnowDensity)Compute or retrieve the bulk snow density ρ_snow [kg/m³].
Terrarium.compute_snow_depth — Method
compute_snow_depth(
_::Terrarium.AbstractSnow,
W_snow,
ρ_snow,
ρ_w
) -> Any
Snow layer depth d_snow = W_snow·ρ_w/ρ_snow [m], converting the water-equivalent depth W_snow [m] to the physical snow depth using the water density ρ_w and the bulk snow density ρ_snow.
Terrarium.compute_snow_energy_tendency — Method
compute_snow_energy_tendency(
i,
j,
grid,
fields,
snow::SingleLayerSnow,
atmos::Terrarium.AbstractAtmosphere,
constants::PhysicalConstants
) -> Any
Depth-integrated snow energy tendency [W/m²] at grid cell i, j (all fluxes positive upward):
dŪ_snow/dt = Q_base − Q_top + Q_precip + Q_sublwhere Q_top/Q_base are the surface/basal heat fluxes, Q_precip the advected precipitation heat (see compute_snow_precip_heat_flux), and Q_subl an advective correction for sublimation.
The sublimation correction Q_subl = ρ_w·L_sl·E_subl is required because the latent heat flux carries the full sublimation enthalpy ρ_w·L_sg·E_subl, whereas the mass leaving the snowpack departs as ice, whose specific enthalpy relative to the liquid-water reference is −L_sl. Adding back ρ_w·L_sl·E_subl leaves the snowpack with a net loss of ρ_w·(L_sg − L_sl)·E_subl = ρ_w·L_lg·E_subl, the vaporization enthalpy carried by the departing vapor.
Note that no explicit meltwater energy term appears because meltwater drains as liquid water at 0 °C, which is the zero-enthalpy reference (U = 0) of the FreeWater closure, so it carries no enthalpy out of the snowpack.
Terrarium.compute_snow_interface_fluxes! — Method
compute_snow_interface_fluxes!(
out,
i,
j,
grid,
fields,
snow::SingleLayerSnow,
seb::Terrarium.AbstractSurfaceEnergyBalance,
soil::Terrarium.AbstractSoil,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
)
Diagnose the snow↔surface/soil coupling fluxes at grid cell i, j, run after the surface energy balance: the blended soil-top heat flux (see compute_snow_soil_heat_flux) and the snow surface sublimation rate (see compute_snow_sublimation_flux, the same snow-fraction vapor flux the surface energy balance uses for the latent-flux partition).
Terrarium.compute_snow_interface_fluxes! — Method
compute_snow_interface_fluxes!(
state,
grid,
_::Nothing,
args...
)
Launch compute_snow_interface_fluxes! to diagnose the snow↔surface/soil coupling fluxes from the snow state and the surface energy balance outputs: the blended soil-top heat flux (soil_heat_flux) and the snow surface sublimation rate (sublimation, the snow-fraction bulk-aerodynamic vapor flux at the converged skin temperature). Must run after the surface energy balance (which sets ground_heat_flux and the skin temperature). No-op when there is no snowpack (snow === nothing).
Terrarium.compute_snow_precip_heat_flux — Method
compute_snow_precip_heat_flux(
_::Terrarium.AbstractSnow,
constants::PhysicalConstants,
P_s,
R_on_snow,
T_air
) -> Any
Advected heat flux [W/m²] carried into the snowpack by precipitation, relative to liquid water at 0 °C (the U = 0 reference of the FreeWater enthalpy closure). Fresh snow P_s arrives as ice, which sits L_sl below the liquid reference, plus sensible heat for T_air < 0; rain-on-snow R_on_snow arrives as liquid carrying only its sensible heat for T_air > 0. The latent heat released when rain refreezes in a cold pack is captured implicitly by the enthalpy closure, so it is not added here (adding L_sl would double-count relative to the liquid-water reference).
Terrarium.compute_snow_properties! — Method
compute_snow_properties!(
out,
i,
j,
grid,
fields,
snow::SingleLayerSnow,
constants::PhysicalConstants
)
Compute the snow depth, cover fraction, and thermal conductivity at grid cell i, j.
Terrarium.compute_snow_soil_heat_flux — Method
compute_snow_soil_heat_flux(
i,
j,
grid,
fields,
snow::SingleLayerSnow,
constants::PhysicalConstants,
soil::Terrarium.AbstractSoil
) -> Any
Blended soil-top heat flux [W/m²] at grid cell i, j: the snow-cover-fraction-weighted combination of the snow→soil basal conductive flux Q_base and the bare-ground surface energy balance closure flux G (ground_heat_flux), f_snow·Q_base + (1 − f_snow)·G. The bulk snow thermal conductivity entering Q_base is recovered lazily from the density scheme rather than stored.
Terrarium.compute_snow_sublimation_flux — Method
compute_snow_sublimation_flux(
i,
j,
grid,
fields,
_::Nothing,
atmos,
constants,
skinT
) -> Any
Snow-surface sublimation rate [m/s SWE] at grid cell i, j, area-weighted by the snow-covered fraction f_snow. The snow surface is treated as saturated: a bulk-aerodynamic vapor flux Δq/rₐ evaluated at the skin temperature, with Δq taken over ice for a sub-freezing surface (the saturation humidity already dispatches over ice for T ≤ 0 — see saturation_specific_humidity_vapor). The water-vapor mass flux ρₐ·Δq/rₐ is converted to a snow-water-equivalent rate via ρ_w. Zero without snow (snow === nothing).
Terrarium.compute_snow_tendencies! — Method
compute_snow_tendencies!(
tendencies,
i,
j,
grid,
fields,
snow::SingleLayerSnow,
atmos::Terrarium.AbstractAtmosphere,
constants::PhysicalConstants
)
Accumulate the snow water-equivalent and depth-integrated energy tendencies at grid cell i, j from the mass and energy balances (see compute_snow_water_tendency and compute_snow_energy_tendency).
Terrarium.compute_snow_volumetric_heat_capacity — Method
compute_snow_volumetric_heat_capacity(
_::Terrarium.AbstractSnow{NF},
constants::PhysicalConstants,
ρ_snow,
liq
) -> Any
Bulk volumetric heat capacity C_snow [J/m³/K] of the snowpack treated as an ice–liquid–air mixture, given the bulk snow density ρ_snow [kg/m³] and the liquid water fraction liq ∈ [0,1] of the water substance. The water-substance mass per unit snow volume is ρ_snow, of which (1 − liq) is ice and liq is liquid; the remaining void space is dry air. The corresponding constituent volume fractions are
\[\begin{aligned} θ_{ice} &= ρ_{snow}·(1 − liq)/ρ_i,\ θ_{liq} &= ρ_{snow}·liq/ρ_w,\ θ_{air} &= 1 − θ_{ice} − θ_{liq} \end{aligned}\]
and the heat capacity is the volume-weighted sum over the ice and liquid constituents, C_snow = cp_i·ρ_i·θ_ice + cp_w·ρ_w·θ_liq. The air's own sensible-heat storage (≈0.1%) is neglected; note the air is still reflected in the bulk density ρ_snow < ρ_ice.
Terrarium.compute_snow_water_tendency — Method
compute_snow_water_tendency(
i,
j,
grid,
fields,
snow::SingleLayerSnow,
atmos::Terrarium.AbstractAtmosphere
) -> Any
Snow water equivalent (SWE) tendency (m/s) at grid cell i, j:
dW_snow/dt = S + R_snow − M − E_sublwhere S is snowfall, R_snow = f_snow · rainfall the rain intercepted by the snow-covered fraction, M the Darcy meltwater outflow (see snow_meltwater_flux), and E_subl the sublimation rate.
Terrarium.compute_specific_humidity_difference — Method
compute_specific_humidity_difference(
i,
j,
grid,
fields,
atmos::Terrarium.AbstractAtmosphere,
c::PhysicalConstants,
T
) -> Any
Computes the specific humidity difference [kg/kg] between a saturated surface at temperature T [°C] and the current atmospheric fields.
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.
Terrarium.compute_stomatal_conductance! — Method
compute_stomatal_conductance!(
out,
i,
j,
grid,
fields,
stomcond::MedlynStomatalConductance{NF},
traits::PlantTraits{NF},
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
args...
) -> Any
Calls compute_stomatal_conductance and stores the result in out.
Terrarium.compute_stomatal_conductance — Method
compute_stomatal_conductance(
i,
j,
grid,
fields,
stomcond::MedlynStomatalConductance{NF},
traits::PlantTraits{NF},
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
args...
) -> Any
Compute stomatal conductance (gstm) and leaf-to-air CO₂ ratio (λc) at a grid point. Returns tuple (gstm, λc) for use in photosynthesis and transpiration calculations.
Terrarium.compute_stomatal_conductance — Method
compute_stomatal_conductance(
stomcond::MedlynStomatalConductance{NF},
traits::PlantTraits{NF},
vpd,
An,
co2,
LAI,
β
) -> Any
Compute canopy-level water conductance [m/s] from the [19] optimal stomatal conductance model. Includes minimum conductance and light extinction effects based on LAI, scaled by soil moisture factor β.
References
- [19] Medlyn et al., Global Change Biology (2011)
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.
Terrarium.compute_surface_energy_fluxes! — Function
compute_surface_energy_fluxes!(
state,
grid,
seb::SurfaceEnergyBalance,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
)
compute_surface_energy_fluxes!(
state,
grid,
seb::SurfaceEnergyBalance,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
hydrology::Union{Nothing, Terrarium.AbstractSurfaceHydrology},
args...
)
Compute the surface energy fluxes on grid based on the current atmospheric state.
Terrarium.compute_surface_energy_fluxes! — Function
compute_surface_energy_fluxes!(
out,
i,
j,
grid,
fields,
seb::SurfaceEnergyBalance,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
)
compute_surface_energy_fluxes!(
out,
i,
j,
grid,
fields,
seb::SurfaceEnergyBalance,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
evtr::Union{Nothing, Terrarium.AbstractEvapotranspiration}
)
compute_surface_energy_fluxes!(
out,
i,
j,
grid,
fields,
seb::SurfaceEnergyBalance,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
evtr::Union{Nothing, Terrarium.AbstractEvapotranspiration},
snow::Union{Nothing, Terrarium.AbstractSnow},
args...
)
Fused kernel function that computes the radiative and turbulent fluxes, as well as the ground heat flux based on the current skin temperature and humidity fluxes.
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.
Terrarium.compute_surface_excess_water_tendency! — Method
compute_surface_excess_water_tendency!(
surface_excess_water_tendency,
i,
j,
k,
grid,
clock,
fields,
hydrology::SoilHydrology,
runoff::Union{Nothing, Terrarium.AbstractSurfaceRunoff}
) -> Any
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.
Terrarium.compute_surface_humidity_flux — Method
compute_surface_humidity_flux(
i,
j,
grid,
fields,
_::BareGroundEvaporation,
atmos::Terrarium.AbstractAtmosphere,
constants::PhysicalConstants
) -> Any
Evaluate the bare-ground surface humidity flux [m/s] from the current skin temperature and evaporation conductance in fields.
Terrarium.compute_surface_humidity_flux — Method
compute_surface_humidity_flux(
i,
j,
grid,
fields,
evtr::PALADYNCanopyEvapotranspiration,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
args...
) -> Any
Compute the surface humidity flux [m/s] from the current skin temperature and conductances in fields.
Terrarium.compute_surface_net_radiation — Method
Compute the net radiation budget given incoming and outgoing shortwave and longwave radiation.
Terrarium.compute_surface_runoff! — Function
compute_surface_runoff!(
out, i, j, grid, fields,
runoff::DirectSurfaceRunoff{NF},
canopy_interception::AbstractCanopyInterception,
soil_hydrology::AbstractSoilHydrology
) where {NF}Compute surface runoff in grid cell i, j and store the result in out.surface_runoff. Runoff is computed based on the ground-reaching precipitation rate provided by canopy_interception and the soil saturation state provided by soil_hydrology.
Terrarium.compute_surface_runoff — Method
compute_surface_runoff(
runoff::DirectSurfaceRunoff,
influx,
surface_drainage,
infil
) -> Any
Compute surface runoff as precipitation + surface_drainage - infiltration.
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.
Terrarium.compute_temperature_stress — Method
compute_temperature_stress(
photo::LUEPhotosynthesis{NF},
T_air
) -> Any
Computes the temperature stress factor T_stress based on the air temperature.
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.
Terrarium.compute_tendencies! — Method
compute_tendencies!(
state,
grid,
canopy_interception::PALADYNCanopyInterception,
evapotranspiration::Terrarium.AbstractEvapotranspiration,
args...
)
Terrarium.compute_tendencies! — Method
compute_tendencies!(
state,
grid,
vegcarbon_dynamics::PALADYNCarbonDynamics,
traits::PlantTraits,
args...
)
Terrarium.compute_tendencies! — Method
compute_tendencies!(
state,
grid,
phenol::PALADYNPhenology,
atmos::Terrarium.AbstractAtmosphere
)
Terrarium.compute_tendencies! — Method
compute_tendencies!(
state,
grid,
veg_dynamics::PALADYNVegetationDynamics,
vegcarbon_dynamics::PALADYNCarbonDynamics,
traits::PlantTraits,
args...
)
Terrarium.compute_tendencies! — Method
compute_tendencies!(
state,
grid,
snow::SingleLayerSnow,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
args...
)
Compute the snow water-equivalent and depth-integrated energy tendencies (see compute_snow_tendencies!), driven by the atmospheric precipitation inputs and the prescribed surface/basal heat fluxes and sublimation.
Terrarium.compute_tendencies! — Method
Compute tendencies for soil energy, water, and carbon state variables on grid based on the given values in constants.
Terrarium.compute_tendencies! — Method
compute_tendencies!(
state,
grid,
hydrology::SoilHydrology,
soil::Terrarium.AbstractSoil,
args...
)
Terrarium.compute_tendencies! — Method
compute_tendencies!(
state,
grid,
energy::SoilThermodynamics,
soil::Terrarium.AbstractSoil,
args...
)
Terrarium.compute_tendencies! — Method
compute_tendencies!(
state,
grid,
hydrology::SurfaceHydrology,
args...
)
Terrarium.compute_tendencies! — Method
compute_tendencies!(
state,
grid,
veg::VegetationCarbonCycle,
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
args...
)
Compute tendencies for carbon and vegetation dynamics.
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...
)
Terrarium.compute_thermal_conductivity — Function
compute_thermal_conductivity(i, j, k, grid, ::AbstractThermodynamics, args...)Compute the thermal conductivity at index i, j, k.
Terrarium.compute_thermal_conductivity — Method
compute_thermal_conductivity(
i,
j,
k,
grid,
fields,
energy::SoilThermodynamics,
hydrology::Terrarium.AbstractSoilHydrology,
strat::Terrarium.AbstractStratigraphy,
bgc::Terrarium.AbstractSoilBiogeochemistry
) -> Any
Terrarium.compute_thermal_conductivity — Method
compute_thermal_conductivity(
i,
j,
k,
grid,
fields,
energy::Terrarium.AbstractThermodynamics,
args...
) -> Any
Terrarium.compute_thermal_conductivity — Method
compute_thermal_conductivity(
snow::SingleLayerSnow,
constants::MaterialConstants,
ρ_snow
) -> Any
Bulk snow thermal conductivity κ_snow [W/m/K], delegating to the process's thermal conductivity scheme with the bulk density ρ_snow.
Terrarium.compute_thermal_conductivity — Method
compute_thermal_conductivity(props, soil)
Compute the bulk thermal conductivity of the given soil volume.
Terrarium.compute_thermal_conductivity — Method
compute_thermal_conductivity(
cond::PowerLawSnowThermalConductivity{NF},
constants::MaterialConstants{NF},
ρ_snow
) -> Any
Bulk snow thermal conductivity via the density power law κ_snow = a·(ρ_snow/ρ_w)^b ([13]).
Terrarium.compute_turbulent_fluxes! — Method
compute_turbulent_fluxes!(
out,
i,
j,
grid,
fields,
tur::DiagnosedTurbulentFluxes,
skinT,
constants,
atmos,
evtr,
snow
)
Compute the turbulent (sensible and latent) heat fluxes from the current skin temperature and store them into the auxiliary output fields out.
Terrarium.compute_turbulent_fluxes! — Method
compute_turbulent_fluxes!(
out,
i,
j,
grid,
fields,
_::PrescribedTurbulentFluxes,
skinT,
constants,
atmos,
evtr,
snow
)
Prescribed turbulent fluxes are input fields supplied by an external coupler (already present in fields), so there is nothing to compute or store.
Terrarium.compute_vapor_pressure_deficit — Method
compute_vapor_pressure_deficit(
i,
j,
grid,
fields,
atmos::Terrarium.AbstractAtmosphere,
c::PhysicalConstants
) -> Any
Computes the vapor pressure deficit (VPD) [Pa] at atmospheric reference level given the current atmospheric fields
Terrarium.compute_vapor_pressure_difference — Method
compute_vapor_pressure_difference(
i,
j,
grid,
fields,
atmos::Terrarium.AbstractAtmosphere,
c::PhysicalConstants,
T
) -> Any
Computes the vapor pressure difference [Pa] between a saturated surface at temperature T [°C] and the current atmospheric fields.
Terrarium.compute_veg_carbon_auxiliary! — Method
compute_veg_carbon_auxiliary!(
out,
i,
j,
grid,
fields,
vegcarbon_dynamics::PALADYNCarbonDynamics,
traits::PlantTraits
)
Mutating wrapper for compute_balanced_leaf_area_index that stores the result in out.balanced_leaf_area_index.
Terrarium.compute_veg_carbon_tendencies! — Method
compute_veg_carbon_tendencies!(
tend,
i,
j,
grid,
fields,
vegcarbon_dynamics::PALADYNCarbonDynamics,
traits::PlantTraits
)
Calls compute_veg_carbon_tendency and stores the result in out.
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.
Terrarium.compute_veg_carbon_tendency — Method
compute_veg_carbon_tendency(
i,
j,
grid,
fields,
vegcarbon_dynamics::PALADYNCarbonDynamics,
traits::PlantTraits
) -> Any
Compute the tendency for the carbon vegetation pool given fields LAI_b and NPP.
Terrarium.compute_volumetric_snow_energy — Method
compute_volumetric_snow_energy(Ū_snow, d_snow) -> Any
Volumetric snow internal energy U_snow = Ū_snow/d_snow [J/m³] from the depth-integrated energy Ū_snow [J/m²] and the snow depth d_snow [m]. The denominator is regularized with a machine-eps offset so the result stays finite (and differentiable) as W_snow → 0: with Ū_snow → 0 and d_snow → 0 together, U_snow → 0. The thin-snow indeterminacy is additionally masked downstream by f_snow → 0. A finite offset is used rather than safediv because safediv returns Inf at exactly d_snow = 0 (even for Ū_snow = 0), which would produce NaN when multiplied by f_snow = 0 in the surface energy balance blend.
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.
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.
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.
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 [16, Eq. (C6)].
References
- [16] Willeit & Ganopolski, Geoscientific Model Development (2016)
Terrarium.compute_Λ_loc — Method
compute_Λ_loc(vegcarbon_dynamics, traits, LAI_b)
Computes the local litterfall rate Λ_loc based on the balanced Leaf Area Index LAI_b (assuming evergreen PFTs), [16, Eq. (75)].
References
- [16] Willeit & Ganopolski, Geoscientific Model Development (2016)
Terrarium.compute_γv — Method
compute_γv(veg_dynamics)
Computes the disturbance rateγv, [16, Eq. (80)].
References
- [16] Willeit & Ganopolski, Geoscientific Model Development (2016)
Terrarium.compute_λ_NPP — Method
compute_λ_NPP(vegcarbon_dynamics, traits, 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, [16, Eq. (74)].
References
- [16] Willeit & Ganopolski, Geoscientific Model Development (2016)
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 ([19]), [16, Eq. (71)].
References
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.
Terrarium.compute_ν_tendencies! — Method
compute_ν_tendencies!(
tend,
i,
j,
grid,
fields,
veg_dynamics::PALADYNVegetationDynamics,
vegcarbon_dynamics::PALADYNCarbonDynamics,
traits::PlantTraits
) -> Any
Mutating wrapper for compute_ν_tendency that stores the result in tend.
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.
Terrarium.compute_ν_tendency — Method
compute_ν_tendency(
i,
j,
grid,
fields,
veg_dynamics::PALADYNVegetationDynamics,
vegcarbon_dynamics::PALADYNCarbonDynamics,
traits::PlantTraits
) -> Any
Compute vegetation area fraction tendency at a single grid point from NPP-productivity and disturbance rates.
Terrarium.compute_ν_tendency — Method
compute_ν_tendency(
veg_dynamics,
vegcarbon_dynamics,
traits,
LAI_b,
C_veg,
NPP,
ν
)
Computes the vegetation fraction tendency for a single PFT, [16, Eq. (73)].
References
- [16] Willeit & Ganopolski, Geoscientific Model Development (2016)
Terrarium.convert_dt — Method
convert_dt(Δt)
Convert Δts of type Period to a numeric value in seconds. Return Δt if already a number.
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.
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.
Terrarium.debug! — Method
debug!(debug::Bool)Enable or disable global debug mode for Terrarium. Debug mode
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 checkfinite!.
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!.
Terrarium.deduplicate — Method
deduplicate(values)
Filter out duplicates from the given tuple. Note that this method is not type stable or allocation-free!
Terrarium.deduplicate_vars — Method
deduplicate_vars(vars::Tuple{Vararg{Union{AbstractVariable, Namespace}}})Type-stable equivalent of deduplicate for tuples of AbstractVariables and Namespaces.
Terrarium.default_clock — Method
default_clock(
model::Terrarium.AbstractModel{NF, Grid} where Grid<:(Terrarium.AbstractLandGrid{NF})
) -> Clock{_A, _B, Float64, Int64, Int64} where {_A, _B}
Return the default Clock used by initialize for the given model. The generic method returns a plain host clock starting at time zero; architecture extensions may specialize on the model's grid to return an architecture-specific clock (e.g. TerrariumReactantExt returns a traced ConcreteRNumber-backed clock so that time advances inside the compiled step).
Terrarium.default_dt — Function
default_dt(timestepper::AbstractTimeStepper)Get the current timestep size for the time stepper.
Terrarium.default_dt — Method
default_dt(integrator::ModelIntegrator)Return the default timestep size for the given integrator, taken from its model's timestepper.
Terrarium.default_skin_temperature_solver — Method
default_skin_temperature_solver(
_::Type{NF}
) -> Terrarium.RootSolver{NF, RootSolvers.NewtonsMethod{T}, RootSolvers.CompactSolution, RootSolvers.ResidualTolerance{NF}} where {NF, T<:Union{Real, AbstractArray}}
Construct the default solver for the implicit skin temperature: a Newton root-finder (RootSolver backed by RootSolvers.jl) with a small iteration budget.
Terrarium.default_timestepper — Method
default_timestepper(_)
Default timestepper for models: a single explicit ForwardEuler time stepper.
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.
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.
Terrarium.diffusive_heat_flux — Method
diffusive_heat_flux(
i,
j,
k,
grid,
fields,
energy::Terrarium.AbstractThermodynamics,
args...
) -> Any
Compute the diffusive (Fourier) heat flux q = -κ ∂T/∂z at the cell face i, j, k, interpolating the medium-specific thermal conductivity to the face.
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.
Terrarium.emissivity — Method
emissivity(
i,
j,
grid,
fields,
albedo::ConstantAlbedo
) -> Any
Return the surface emissivity at grid point i, j.
Terrarium.emissivity — Method
emissivity(i, j, grid, fields, ::AbstractAlbedo)Return the current emissivity at the given indices.
Terrarium.energy_to_temperature! — Method
energy_to_temperature!(
out,
i,
j,
grid,
fields,
_::SnowEnergyTemperatureClosure,
snow::SingleLayerSnow,
constants::PhysicalConstants
)
Recover the snow temperature and liquid water fraction from the depth-integrated energy at grid cell i, j.
Terrarium.energy_to_temperature — Method
energy_to_temperature(_::FreeWater, U, ρLθ, C) -> Any
Calculate the inverse enthalpy function given the internal energy U (J/m³), volumetric latent heat content ρLθ (J/m³), and volumetric heat capacity C (J/m³/K) under the free water freezing characteristic.
Terrarium.explicit_step! — Method
explicit_step!(state, grid, timestepper, Δt, names)
Evaluate an explicit update u += ∂u∂t*Δt for the prognostic fields of state listed in names 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.
Terrarium.explicit_step! — Method
Accumulate tendency*Δt in the given prognostic field. This method can be overridden by specialized timestepping schemes as needed.
Terrarium.explicit_timestepper — Method
explicit_timestepper(imex::AbstractIMEX)Return the explicit sub-stepper of the AbstractIMEX timestepper imex.
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.
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
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.
Terrarium.field_capacity — Function
Compute the empirical field capacity of the soil.
Terrarium.field_indices — Method
field_indices(
indices::Tuple{Integer, Integer, Integer}
) -> Tuple{Integer, Integer, Integer}
Pad the grid indices to the three indices required to write to a Field. A 2D (XY) solve passes (i, j), but Oceananigans only defines setindex!(::Field, val, i, j, k) for exactly three indices.
Terrarium.file_extension — Method
file_extension(_::Terrarium.NetCDF) -> String
File extension (including the leading dot) used by files of the given FileFormat.
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).
Terrarium.forcing — Method
forcing(i, j, k, grid, clock, fields, evapotranspiration::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.
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.
Terrarium.get_albedo — Method
get_albedo(seb)Return the albedo parameterization associated with the surface energy balance.
Terrarium.get_artifact — Method
get_artifact(name::String) -> String
Retrieve the path to the artifact with the given name. Throws an AssertionError if no artifact with name exists in Artifacts.toml.
Terrarium.get_asset — Method
get_asset(asset::Terrarium.AbstractLandAsset) -> String
Download (if necessary) the given asset and return the path to its data file within the installed artifact directory. The artifact is installed via get_artifact and the data file is located by its file_extension. Reading the file is left to the caller; use load_asset to read a variable into a data Field wrapped on the asset's native_grid.
Terrarium.get_biogeochemistry — Method
get_biogeochemistry(soil::AbstractSoil)Return the biogeochemistry scheme associated with soil.
Terrarium.get_cache — Method
get_cache(cache::AbstractTimeStepperCache, timestepper::AbstractTimeStepper)Return the working cache for timestepper given the model's state.timestepper_cache. For a single timestepper this is the cache itself; an IMEX cache returns the sub-cache matching the timestepper's class.
Terrarium.get_closure — Method
get_closure(snow::SingleLayerSnow) -> Any
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.
Terrarium.get_constants — Method
get_constants(model::AbstractModel)::PhysicalConstantsReturn the PhysicalConstants associated with the given model.
Terrarium.get_energy_balance — Method
get_energy_balance(soil::AbstractSoil)Return the energy balance scheme associated with soil.
Terrarium.get_field — Method
get_field(
state,
_::Union{Terrarium.AbstractVariable{name}, Terrarium.Namespace{name}}
) -> Any
Retrieves the Field from state matching the name of the given variable.
Terrarium.get_field_grid — Function
get_field_grid(grid::AbstractLandGrid)::Oceananigans.AbstractGridReturns the underlying Oceananigans grid type for Fields defined on the given land grid.
Terrarium.get_field_grid — Method
get_field_grid(grid)Return the underlying Oceananigans grid stored in ColumnGrid.
Terrarium.get_fields — Method
get_fields(state, ns::Terrarium.Namespace) -> Any
Retrieves all Fields declared by the given Namespace from state, where state is assumed to correspond to the (nested) StateVariables of the namespace itself.
Terrarium.get_fields — Method
get_fields(state, vars)
Retrieves all Fields from state matching the names of the given variables. Any Namespaces in vars are resolved recursively and their fields are merged into the returned NamedTuple keyed by namespace name, with the namespace's own fields collected into a nested NamedTuple.
Terrarium.get_fields — Method
get_fields(state, components; except)
Retrieves all non-tendency Fields from state defined on the given components.
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.
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
state = StateVariables(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))Terrarium.get_grid — Method
get_grid(model::AbstractModel)::AbstractLandGridReturn the spatial grid associated with the given model.
Terrarium.get_hydraulic_properties — Function
get_hydraulic_properties(hydrology::AbstractSoilHydrology)Return the soil hydraulic properties defined by the given soil hydrology configuration.
Terrarium.get_hydraulic_properties — Method
get_hydraulic_properties(
hydrology::SoilHydrology
) -> Terrarium.AbstractSoilHydraulics
Return the soil hydraulic properties defined by the given hydrology process.
Terrarium.get_hydrology — Method
get_hydrology(soil::AbstractSoil)Return the hydrology scheme associated with soil.
Terrarium.get_initializer — Method
get_initializer(model::AbstractModel)::AbstractInitializerReturn the initializer associated with the given model.
Terrarium.get_radiative_fluxes — Method
get_radiative_fluxes(seb)Return the radiative_fluxes component of the surface energy balance.
Terrarium.get_skin_temperature — Method
get_skin_temperature(seb)Return the skin_temperature process from the surface energy balance.
Terrarium.get_spacing — Method
get_spacing(spacing)
Return a Vector of vertical layer thicknesses according to the given discretization.
Terrarium.get_stratigraphy — Method
get_stratigraphy(soil::AbstractSoil)Return the stratigraphy parameterization associated with soil.
Terrarium.get_swrc — Function
get_swrc(::AbstractUnsatK)Return the soil water retention curve associated with the given unsaturated hydraulic conductivity scheme.
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.
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.
Terrarium.get_thermal_properties — Function
get_thermal_properties(energy::AbstractThermodynamics)Return the thermal properties associated with the given energy balance process.
Terrarium.get_timestepper — Method
get_timestepper(model::AbstractModel)::AbstractTimeStepperReturn the timestepper associated with the given model. All AbstractModels are required to define a timestepper field holding an AbstractTimeStepper (e.g. ForwardEuler, Heun, or IMEX).
Terrarium.get_turbulent_fluxes — Method
get_turbulent_fluxes(seb)Return the turbulent_fluxes component of the surface energy balance.
Terrarium.get_workspec — Method
Returns the appropriate workspec for the given AbstractField or based on the given field locations.
Terrarium.ground_evaporation_conductance — Method
ground_evaporation_conductance(
ET::Terrarium.AbstractEvapotranspiration,
β,
rₐ
) -> Any
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.
Terrarium.ground_heat_flux — Method
ground_heat_flux(i, j, grid, fields, ::AbstractSkinTemperature)Return the current ground heat flux at the given indices.
Terrarium.ground_thermal_interface — Function
ground_thermal_interface(
i,
j,
grid,
fields,
skinT::ImplicitSkinTemperature,
snow::Nothing
) -> Tuple{Any, Any, Any}
ground_thermal_interface(
i,
j,
grid,
fields,
skinT::ImplicitSkinTemperature,
snow::Nothing,
constants
) -> Tuple{Any, Any, Any}
Return the effective conduction target (Tg, κ, Δz) seen by the skin-temperature solve: the temperature of the medium directly beneath the skin, its thermal conductivity, and the half-cell thickness. Without snow (snow === nothing) these are the uppermost ground layer's ground_temperature, the assumed surface conductivity κₛ, and the top ground cell thickness — i.e. the snow-free behavior is unchanged.
Terrarium.ground_thermal_interface — Method
ground_thermal_interface(
i,
j,
grid,
fields,
skinT::ImplicitSkinTemperature,
snow::Terrarium.AbstractSnow,
constants::PhysicalConstants
) -> Tuple{Any, Any, Any}
Snow-covered variant: the conduction target is the snow-cover-fraction-weighted blend of the snow layer and the underlying ground, x_eff = (1 − f_snow)·x_ground + f_snow·x_snow for the temperature, conductivity, and half-cell thickness.
Terrarium.hydraulic_conductivity — Function
Compute (variably saturated) hydraulic conductivity based on the given hydraulic properties, soil water retention curve (SWRC), and volumetric fractions.
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.
Terrarium.implicit_timestepper — Method
implicit_timestepper(imex::AbstractIMEX)Return the implicit sub-stepper of the AbstractIMEX timestepper imex.
Terrarium.initialize! — Function
Initialize input variables from the given input sources. The scope corresponds to the path of namespace names from the root namespace to state and is used to match namespaced input sources to their target variables; see varpath.
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.
Terrarium.initialize! — Method
initialize!(inputs, grid, clock, fields, _::InputSource)
Initializes the input source, writing into the input inputs fields at model start. The grid and the full model state fields (read-only) are provided so that sources may compute their inputs from the grid geometry or other state variables. Namespace routing is handled by the caller (see [InputSources]). Default implementation does nothing.
Terrarium.initialize! — Method
initialize!(
state,
grid,
_::ImplicitSkinTemperature,
args...
)
Seed the prognostic skin_temperature with the current ground_temperature so the implicit nonlinear solve starts from a physically sensible guess close to the root.
Terrarium.initialize! — Method
initialize!(
state,
grid,
snow::SingleLayerSnow,
constants::PhysicalConstants,
args...
)
Initialize the snow internal energy by evaluating the inverse closure (temperature → energy). Assumes snow_temperature and snow_water_equivalent have already been initialized.
Terrarium.initialize! — Method
Initialize the soil energy, water, and carbon state variables on grid given the parameter values in constants.
Terrarium.initialize! — Method
initialize!(
state,
grid,
hydrology::SoilHydrology,
soil::Terrarium.AbstractSoil,
args...
)
Terrarium.initialize! — Method
initialize!(
state,
grid,
energy::SoilThermodynamics,
soil::Terrarium.AbstractSoil,
constants::PhysicalConstants,
args...
)
Terrarium.initialize! — Method
initialize!(state, grid, seb::SurfaceEnergyBalance, args...)
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.
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...
)
Terrarium.initialize! — Method
initialize!(state, inits::NamedTuple{names}) -> Any
Initialize the state with Field initializers (any valid argument to set!) in inits.
Terrarium.initialize — Method
initialize(integrator, params; clock, inputs)
Reconstruct the given integrator using the same underlying model populated with the given params. The clock and inputs can also optionally be updated via their respective keyword arguments.
Terrarium.initialize — Method
initialize(timestepper::AbstractTimeStepper, state, progvars, model)Allocate the time stepper cache for timestepper against the given state. progvars is the named tuple of prognostic variable metadata and model the owning AbstractModel; both are needed e.g. by AbstractIMEX timesteppers to resolve each variable's timestepping class.
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.
Terrarium.initialize — Method
initialize(
var::Terrarium.AuxiliaryVariable,
grid::Terrarium.AbstractLandGrid,
clock::Clock,
boundary_conditions::NamedTuple,
fields::NamedTuple
) -> Any
Initialize a Field on grid for the given AuxiliaryVariable.
Terrarium.initialize — Method
initialize(::AbstractTimeStepper, state)Initialize and return the AbstractTimeStepperCache holding any intermediate fields/state required by the given timestepper. Time steppers that need no working state fall back to the default implementation, which returns an EmptyCache.
Terrarium.initialize — Method
initialize(
model::Terrarium.AbstractModel{NF, Grid} where Grid<:(Terrarium.AbstractLandGrid{NF});
...
) -> Union{ModelIntegrator{_A, _B, _C, _D, var"#s179", StateVariables{NF, prognames, closurenames, auxnames, inputnames, nsnames, ProgFields, TendFields, AuxFields, InputFields, Namespaces, Cache, ClockType}, Clock{_A1, _B1, Float64, Int64, Int64}, @NamedTuple{}, InputSources{NF1, name, Sources}} where {_B<:Oceananigans.Architectures.AbstractArchitecture, _C<:Terrarium.AbstractLandGrid{_A, _B}, _D<:Terrarium.AbstractTimeStepper{_A}, var"#s179"<:Terrarium.AbstractModel{_A, _C}, NF, prognames, closurenames, auxnames, inputnames, nsnames, ProgFields, TendFields, AuxFields, InputFields, Namespaces, Cache, ClockType, _A1, _B1, NF1, name, Sources<:Tuple{Vararg{InputSource{NF1}}}}, ModelIntegrator{_A, Arch, _C, _D, var"#s179", StateVariables{NF, prognames, closurenames, auxnames, inputnames, nsnames, ProgFields, TendFields, AuxFields, InputFields, Namespaces, Cache, ClockType}, Clock{_A1, _B, Float64, Int64, Int64}, @NamedTuple{}, InputSources{NF1, name, Sources}} where {Arch<:Oceananigans.Architectures.AbstractArchitecture, _C<:Terrarium.AbstractLandGrid{_A, Arch}, _D<:Terrarium.AbstractTimeStepper{_A}, var"#s179"<:Terrarium.AbstractModel{_A, _C}, NF, prognames, closurenames, auxnames, inputnames, nsnames, ProgFields, TendFields, AuxFields, InputFields, Namespaces, Cache, ClockType, _A1, _B, NF1, name, Sources<:Tuple{Vararg{InputSource{NF1}}}}} where _A
initialize(
model::Terrarium.AbstractModel{NF, Grid} where Grid<:(Terrarium.AbstractLandGrid{NF}),
params;
clock,
inputs,
boundary_conditions,
initializers,
fields
) -> Union{ModelIntegrator{_A, _B, _C, _D, var"#s179", StateVariables{NF, prognames, closurenames, auxnames, inputnames, nsnames, ProgFields, TendFields, AuxFields, InputFields, Namespaces, Cache, ClockType}, Clock{_A1, _B1, Float64, Int64, Int64}, @NamedTuple{}, InputSources{NF1, name, Sources}} where {_B<:Oceananigans.Architectures.AbstractArchitecture, _C<:Terrarium.AbstractLandGrid{_A, _B}, _D<:Terrarium.AbstractTimeStepper{_A}, var"#s179"<:Terrarium.AbstractModel{_A, _C}, NF, prognames, closurenames, auxnames, inputnames, nsnames, ProgFields, TendFields, AuxFields, InputFields, Namespaces, Cache, ClockType, _A1, _B1, NF1, name, Sources<:Tuple{Vararg{InputSource{NF1}}}}, ModelIntegrator{_A, Arch, _C, _D, var"#s179", StateVariables{NF, prognames, closurenames, auxnames, inputnames, nsnames, ProgFields, TendFields, AuxFields, InputFields, Namespaces, Cache, ClockType}, Clock{_A1, _B, Float64, Int64, Int64}, @NamedTuple{}, InputSources{NF1, name, Sources}} where {Arch<:Oceananigans.Architectures.AbstractArchitecture, _C<:Terrarium.AbstractLandGrid{_A, Arch}, _D<:Terrarium.AbstractTimeStepper{_A}, var"#s179"<:Terrarium.AbstractModel{_A, _C}, NF, prognames, closurenames, auxnames, inputnames, nsnames, ProgFields, TendFields, AuxFields, InputFields, Namespaces, Cache, ClockType, _A1, _B, NF1, name, Sources<:Tuple{Vararg{InputSource{NF1}}}}} where _A
Creates and initializes a ModelIntegrator for the given model with input variables populated by the given inputs and optionally params . InputSources can be specified via the inputs keyword argument. 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.
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.
Terrarium.input — Method
input(name, dims; default, units, bounds, desc)
Convenience constructor method for InputVariable.
Terrarium.input_fields — Method
input_fields(state, components)
Retrieves all Fields from state corresponding to input variables defined on the given components.
Terrarium.input_variables — Method
Helper method that selects only input variables declared on obj.
Terrarium.invclosure! — Method
invclosure!(
state,
grid,
closure::SnowEnergyTemperatureClosure,
snow::SingleLayerSnow,
constants::PhysicalConstants,
args...
)
Inverse closure: compute the prognostic snow_energy from a prescribed snow_temperature (used for initialization). snow_water_equivalent must be initialized first, since the snow depth d_snow enters the depth-integrated energy.
Terrarium.invclosure! — Method
Compute the inverse closure mapping for soil hydrology and energy, in that order.
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.
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.
Terrarium.invclosure! — Method
invclosure!(state, model::AbstractModel)Apply the inverse of all closure relations defined for the given model.
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.
Terrarium.is_adaptive — Function
is_adaptive(timestepper::AbstractTimeStepper)Return true if the given time stepper is adaptive, false otherwise.
Terrarium.kernel — Method
kernel(func, args...; clock = false)Return a KernelFunction that lazily constructs a KernelFunctionOperation from the given func and tuple of args when invoked, i.e:
ctor = kerenl(my_function, arg1, arg2)
...
kfo = ctor(grid, clock, fields)This is intended to be used as a constructor for AuxiliaryVariables:
myvar(i, j, k, grid, fields) = clamp(fields.x[i, j, k], zero(eltype(grid)), one(eltype(grid)))
auxvar = auxiliary(:myvar, XYZ(), kernel(myvar))Terrarium.latent_heat_flux — Method
latent_heat_flux(i, j, grid, fields, ::AbstractTurbulentFluxes)Return the current latent heat flux at the given indices.
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.
Terrarium.liquid_water_fraction — Method
liquid_water_fraction(_::FreeWater, U, ρLθ) -> Any
Calculate the unfrozen water content from the given internal energy U (J/m³) and volumetric latent heat content ρLθ (J/m³).
Terrarium.load_asset — Method
load_asset(
asset::Terrarium.AbstractLandAsset,
name::String;
NF,
fill_value
) -> Union{RingGrids.FullGaussianField{_A, _B, <:AbstractArray{T, N}, RingGrids.FullGaussianGrid{SpeedyWeatherInternals.Architectures.CPU{KernelAbstractions.CPU}, Vector{UnitRange{Int64}}, Vector{Int64}, Int64}} where {_A, _B}, RingGrids.FullClenshawField{_A, _B, <:AbstractArray{T, N}, RingGrids.FullClenshawGrid{SpeedyWeatherInternals.Architectures.CPU{KernelAbstractions.CPU}, Vector{UnitRange{Int64}}, Vector{Int64}, Int64}} where {_A, _B}}
Download (if necessary) the given asset via get_asset and read the variable name from its data file, returning a suitable Field based on the asset's native_grid with element type NF. The asset's indices are applied when reading (e.g. to select a single time record), and fill_value replaces missing data; it defaults to NF(NaN).
The underlying read is dispatched to an I/O extension based on the asset's format; load Rasters.jl and NCDatasets.jl to enable reading NetCDF and other raster files.
Terrarium.locate_asset_file — Method
locate_asset_file(
dir::String,
format::Terrarium.FileFormat
) -> String
Locate the single data file of the given format within an installed artifact directory dir, searching recursively. Errors unless exactly one matching file is found.
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.
Terrarium.longwave_up — Method
longwave_up(i, j, grid, fields, ::AbstractRadiativeFluxes)Return the current outgoing (upwelling) longwave radiation at the given indices i, j.
Terrarium.matches_scope — Method
matches_scope(
source::InputSource,
scope::Tuple{Vararg{Symbol}}
) -> Union{Missing, Bool}
Determine whether the given source provides an input variable for the namespace at the given scope, where scope is the path of namespace names from the root namespace, i.e. () for the root namespace itself, (:ns1,) for its child namespace ns1, and so on.
Terrarium.merge_boundary_conditions — Method
merge_boundary_conditions(bcs::FieldBCs...)Recursively merge an arbitrary number of field/variable boundary conditions.
Terrarium.merge_namespaces — Method
merge_namespaces(namespaces)
Merge all Namespaces with matching names into a single Namespace containing the union of their variables.
Terrarium.merge_recursive — Method
merge_recursive(nt1::NamedTuple, nt2::NamedTuple)Recursively merge two nested named tuples. This implementation is loosely based on the one in NamedTupleTools authored by Jeffrey Sarnoff.
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.
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.
Terrarium.mineral_texture — Function
organic_fraction(::AbstractSoilMatrix)Return the SoilTexture describing the mineral component of the soil matrix.
Terrarium.mineral_thermal_conductivity — Method
mineral_thermal_conductivity(conductivities, texture)
Compute the thermal conductivity of the mineral grains for the given texture as the quartz-weighted geometric mean of the quartz and non-quartz mineral endpoints ([31]; [32]):
\[\lambda_{\text{min}} = \lambda_q^{\,q} \, \lambda_o^{\,1 - q}\]
where the quartz volume fraction $q$ is assumed equal to the sand fraction.
Terrarium.namespace — Method
namespace(name, vars)
Convenience constructor method for variable Namespaces.
Terrarium.namespaces — Method
namespaces(nt)
Convert the given NamedTuple of variables into a tuple of Namespaces.
Terrarium.normalize_texture! — Method
normalize_texture!(
sand::Oceananigans.Fields.AbstractField{LX, LY, LZ, G, NF},
silt::Oceananigans.Fields.AbstractField{LX, LY, LZ, G, NF},
clay::Oceananigans.Fields.AbstractField{LX, LY, LZ, G, NF};
default
)
Normalize the given sand, silt, and clay fraction Fields in place such that the fractions sum to unity in each element, as required by the SoilTexture constructor.
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.
Terrarium.num_layers — Method
Return the number of vertical layers defined by the given grid.
Terrarium.num_layers — Method
num_layers(spacing)
Return the number of vertical layers defined by this discretization.
Terrarium.organic_fraction — Function
organic_fraction(::AbstractSoilMatrix)Return the fraction of the soil matrix that is organic material.
Terrarium.organic_fraction — Method
organic_fraction(
i,
j,
k,
grid,
fields,
strat::SoilStratigraphy,
bgc::Terrarium.AbstractSoilBiogeochemistry
) -> Any
Compute the organic fraction of solid material in the soil volume at index i, j, k.
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.
Terrarium.partial_pressure_CO2 — Method
partial_pressure_CO2(pres, conc_co2)
Compute partial pressure of CO2 from surface pressure and CO2 concentration in Pa.
Terrarium.partial_pressure_O2 — Method
partial_pressure_O2(pres)
Compute partial pressure of oxygen from surface pressure in Pa.
Terrarium.piecewise_linear — Method
piecewise_linear(knots; extrapolation)
Return a function f(z) that linearly interpolates between the given knots.
Terrarium.porosity — Method
porosity(
i,
j,
k,
grid,
fields,
strat::SoilStratigraphy,
bgc::Terrarium.AbstractSoilBiogeochemistry
) -> Any
Compute the porosity of the soil volume at the given indices.
Terrarium.porosity — Method
porosity(horizon::Terrarium.AbstractSoilHorizon) -> Any
Return the porosity parameterization for the given soil horizon.
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.
Terrarium.prognostic — Method
prognostic(name, dims; units, closure, bounds, desc)
Convenience constructors for PrognosticVariable.
Terrarium.prognostic_fields — Method
prognostic_fields(state, components)
Retrieves all Fields from state corresponding to prognostic variables defined on the given components.
Terrarium.prognostic_variables — Method
Helper method that selects only prognostic variables declared on obj.
Terrarium.psychrometric_constant — Method
psychrometric_constant(c::ThermodynamicConstants, p)Calcualte the psychrometric constant at the given atmospheric pressure p.
Terrarium.rainfall — Method
rainfall(i, j, grid, fields, ::AbstractAtmosphere{NF, <:RainSnow})Retrieve or compute the liquid precipitation (rainfall) at the current time step.
Terrarium.rainfall_ground — Function
rainfall_ground(i, j, grid, fields, ::AbstractCanopyInterception)Compute or retrieve the current rate of precipitation reaching the ground [m/s].
Terrarium.relative_to_specific_humidity — Method
relative_to_specific_humidity(r_h, pr, T, c::ThermodynamicConstants)Derives specific humidity from measured relative humidity r_h [%], air pressure pr [Pa], air temperature T [°C], and physical constants c. Assumes saturation over ice for T <= 0°C and over liquid water otherwise. Wrapper around q_vap_from_RH.
Terrarium.relaxed_update — Method
relaxed_update(
relax::Terrarium.RelaxationFactor{NF},
x_target,
x_old
) -> Any
Apply the under-relaxed fixed-point update to the skin temperature.
Terrarium.reset_tendencies! — Method
Reset all tendencies in state to zero.
Terrarium.residual_saturation — Function
Compute the (numerical) residual saturation level of the soil.
Terrarium.resolve_timestepping — Method
resolve_timestepping(imex, progvars, model)
Resolve the timestepping class of each prognostic variable in progvars (a NamedTuple of PrognosticVariables) for the IMEX timestepper imex and owning model, returned as a tuple of Explicit/Implicit instances in the same order as progvars. Each variable's class is given by timestepping(var, model, imex).
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.
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.
Terrarium.root_fraction — Method
Returns a FunctionField that lazily computes the static root distribution on a 1D column grid.
Terrarium.run_timesteps! — Function
run_timesteps!(integrator, Δt, Nt, checkpointing = false)Advance integrator by Nt steps of size Δt.
The generic (host) implementation is a plain loop and ignores checkpointing. ReactantState integrators override this method in TerrariumReactantExt, compiling the loop into a single traced program in which checkpointing selects the reverse-mode-AD checkpointing scheme (false, or a scheme such as Reactant.Periodic(n)).
Terrarium.safediv — Method
safediv(x, y)
Evaluates x / (y + eps(NF)) if and only if y != zero(y); returns Inf otherwise.
Terrarium.saturated_hydraulic_conductivity — Function
Compute hydraulic conductivity at saturation.
Terrarium.saturation_canopy_water — Function
saturation_canopy_water(i, j, grid, fields, ::AbstractCanopyInterception)Compute or retrieve the current canopy water saturation fraction [-].
Terrarium.saturation_specific_humidity_vapor — Method
saturation_specific_humidity_vapor(c::ThermodynamicConstants, T, ρ)Saturation specific humidity at temperature T [°C] and density ρ [kg/m³]. Dispatches over ice for T <= 0°C and over liquid water otherwise. Wrapper around q_vap_saturation.
Terrarium.saturation_vapor_pressure — Method
saturation_vapor_pressure(T)Saturation vapor pressure of an air parcel at the given temperature T in °C. By default, the saturation vapor pressure is computed over ice for T <= 0°C and over water for T > 0°C. Wrapper around saturation_vapor_pressure.
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.
Terrarium.seconds_per_day — Method
Return the number of seconds per day in the given number format.
Terrarium.seconds_per_hour — Method
Return the number of seconds per hour in the given number format.
Terrarium.sensible_heat_flux — Method
sensible_heat_flux(i, j, grid, fields, ::AbstractTurbulentFluxes)Return the current sensible heat flux at the given indices.
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.
Terrarium.shortwave_up — Method
shortwave_up(i, j, grid, fields, ::AbstractRadiativeFluxes)Return the current outgoing (upwelling) shortwave radiation at the surface.
Terrarium.skin_temperature — Method
skin_temperature(i, j, grid, fields, ::AbstractSkinTemperature)Return the current skin temperature at the given indices.
Terrarium.snow_cover_fraction — Function
snow_cover_fraction(i, j, grid, fields, ::AbstractSnow)Compute or retrieve the sub-grid snow-covered area fraction f_snow ∈ [0,1].
Terrarium.snow_density — Method
snow_density(density::ConstantSnowDensity) -> Any
Return the constant bulk snow density ρ_snow [kg/m³].
Terrarium.snow_density — Method
snow_density(snow::SingleLayerSnow) -> Any
Bulk snow density ρ_snow [kg/m³] of the snowpack, delegating to the process's density scheme.
Terrarium.snow_depth — Function
snow_depth(i, j, grid, fields, ::AbstractSnow)Compute or retrieve the snow layer depth d_snow [m].
Terrarium.snow_energy — Function
snow_energy(i, j, grid, fields, ::AbstractSnow)Retrieve the depth-integrated (column) snow internal energy Ū_snow [J/m²] relative to ice at 0°C.
Terrarium.snow_meltwater_flux — Method
snow_meltwater_flux(
i,
j,
grid,
fields,
snow::SingleLayerSnow
) -> Any
Snow meltwater outflow M_r [m/s SWE] at grid cell i, j: the Darcy-type drainage (see compute_meltwater_outflow) evaluated at the diagnosed liquid water fraction.
Terrarium.snow_thermal_conductivity — Function
snow_thermal_conductivity(i, j, grid, fields, ::AbstractSnow)Compute or retrieve the bulk snow thermal conductivity κ_snow [W/m/K].
Terrarium.snow_water_equivalent — Function
snow_water_equivalent(i, j, grid, fields, ::AbstractSnow)Retrieve the snow water equivalent (SWE) W (m) — the total water substance (ice + retained liquid).
Terrarium.snowfall — Method
snowfall(i, j, grid, fields, ::AbstractAtmosphere{NF, <:RainSnow})Retrieve or compute the frozen precipitation (snowfall) at the current time step.
Terrarium.soil_horizon — Method
soil_horizon(
i,
j,
k,
grid,
fields,
strat::SoilStratigraphy{NF, N, Horizons} where {N, Horizons<:NTuple{N, Terrarium.AbstractSoilHorizon{NF}}}
) -> Any
Retrieve the soil horizon for the soil volume at index i, j, k. The last soil horizon in strat is assumed to extend to the bottom of the vertical column regardless of its associated thickness. Note that, since SoilStratigraphy uses namespaces for the state variables of each horizon, any methods defined on AbstractSoilHorizon types should be passed the namespace, e.g:
horizon = soil_horizon(i, j, k, grid, fields, strat)
texture = soil_texture(i, j, grid, getproperty(fields, nameof(horizon)), horizon)Terrarium.soil_matrix — Function
soil_matrix(i, j, grid, fields, ::AbstractSoilHorizon, args...)
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.
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.
Terrarium.soil_moisture_limiting_factor — Method
soil_moisture_limiting_factor(
grid,
clock,
fields,
_::FieldCapacityLimitedPAW
) -> 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.
Terrarium.soil_surface_water_flux — Function
soil_surface_water_flux(
i,
j,
grid,
fields,
canopy_interception::Terrarium.AbstractCanopyInterception
) -> Any
soil_surface_water_flux(
i,
j,
grid,
fields,
canopy_interception::Terrarium.AbstractCanopyInterception,
snow::Union{Nothing, Terrarium.AbstractSnow}
) -> Any
Meltwater flux [m/s] reaching the soil surface, accounting for the snowpack. Without snow this is just the rainfall reaching the ground; with snow the snow-covered fraction f_snow intercepts rain into the snowpack, so only the bare-ground fraction (1 − f_snow)·rain_ground reaches the soil directly, plus the snow meltwater outflow M draining from the snowpack base.
Terrarium.soil_texture — Function
soil_texture(i, j, grid, fields, ::AbstractSoilHorizon, args...)
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.
Terrarium.soil_texture — Method
soil_texture(
i,
j,
k,
grid,
fields,
strat::SoilStratigraphy{NF, N, Horizons} where {N, Horizons<:NTuple{N, Terrarium.AbstractSoilHorizon{NF}}}
) -> Any
Retrieve the soil texture of the soil volume at index i, j, k in the given stratigraphy strat.
Terrarium.soil_volume — Function
soil_volume(i, j, k, grid, fields, ::AbstractStratigraphy, args...)Return a SoilComposition describing the full material composition of the soil volume at index i, j, k for the given stratigraphy parameterization.
Terrarium.soil_volume — Method
soil_volume(i, j, k, grid, fields, strat, hydrology, bgc)
Construct a SoilComposition object summarizing the material composition of the soil volume at the given indices i, j, k on grid.
Terrarium.solve! — Function
solve!(out, indices, grid, fields, objective_func!::ObjectiveFunction, solver, args...; kwargs...)Solve the nonlinear problem defined by objective_func! for its target field at the given indices, mutating out in place. The objective returns the residual F(x) whose root is sought; on return, the target field holds the converged estimate and the method returns the root (and, for some solvers, the number of iterations performed). Dispatches on the concrete solver type, e.g. RootSolver or FixedPointSolver.
Terrarium.solve_skin_temperature! — Method
solve_skin_temperature!(
out,
i,
j,
grid,
fields,
skinT::ImplicitSkinTemperature,
seb::Terrarium.AbstractSurfaceEnergyBalance,
snow,
seb_args...
) -> Any
Run a full nonlinear solve to determine the skin_temperature at grid cell i, j that solves the surface energy balance.
Terrarium.solve_surface_energy_balance! — Method
solve_surface_energy_balance!(
state,
grid,
seb::SurfaceEnergyBalance{NF, SkinTemperature, TurbulentFluxes, RadiativeFluxes, Albedo} where {SkinTemperature<:Terrarium.AbstractSkinTemperature{NF}, TurbulentFluxes<:Terrarium.AbstractTurbulentFluxes{NF}, RadiativeFluxes<:Terrarium.AbstractRadiativeFluxes{NF}, Albedo<:Terrarium.AbstractAlbedo{NF}},
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere
)
solve_surface_energy_balance!(
state,
grid,
seb::SurfaceEnergyBalance{NF, SkinTemperature, TurbulentFluxes, RadiativeFluxes, Albedo} where {SkinTemperature<:Terrarium.AbstractSkinTemperature{NF}, TurbulentFluxes<:Terrarium.AbstractTurbulentFluxes{NF}, RadiativeFluxes<:Terrarium.AbstractRadiativeFluxes{NF}, Albedo<:Terrarium.AbstractAlbedo{NF}},
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
hydrology::Union{Nothing, Terrarium.AbstractSurfaceHydrology}
)
solve_surface_energy_balance!(
state,
grid,
seb::SurfaceEnergyBalance{NF, SkinTemperature, TurbulentFluxes, RadiativeFluxes, Albedo} where {SkinTemperature<:Terrarium.AbstractSkinTemperature{NF}, TurbulentFluxes<:Terrarium.AbstractTurbulentFluxes{NF}, RadiativeFluxes<:Terrarium.AbstractRadiativeFluxes{NF}, Albedo<:Terrarium.AbstractAlbedo{NF}},
constants::PhysicalConstants,
atmos::Terrarium.AbstractAtmosphere,
hydrology::Union{Nothing, Terrarium.AbstractSurfaceHydrology},
snow::Union{Nothing, Terrarium.AbstractSnow},
args...
)
Solve the surface energy balance for skin temperature on grid based on the current atmospheric and surface hydrology state.
Terrarium.specific_heat_capacity_moist_air — Method
specific_heat_capacity_moist_air(c::ThermodynamicConstants, q)Compute the isobaric specific heat capacity [J/(kg*K)] of moist air as a function of the total specific humidity q [kg/kg]. Wrapper around cp_m.
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.
Terrarium.specific_humidity_difference — Method
specific_humidity_difference(
c::ThermodynamicConstants,
p,
q_air,
T
) -> Any
Computes the difference in specific humidity between a saturated surface at temperature T [°C] and the atmosphere, defined by its specific humidity q_air [kg/kg] and pressure p [Pa].
Terrarium.stefan_boltzmann — Method
stefan_boltzmann(c::UniversalConstants, T, ϵ)Stefan-Boltzmann law $M = \epsilon \sigma T^4$ where T is the surface temperature in Kelvin and ϵ is the emissivity and σ is the Stefan-Boltzmann constant.
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.
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.
Terrarium.surface_net_radiation — Method
surface_net_radiation(i, j, grid, fields, ::AbstractRadiativeFluxes)Return the current surface net radiation at the given indices i, j.
Terrarium.temperature_to_energy! — Method
temperature_to_energy!(
out,
i,
j,
grid,
fields,
_::SnowEnergyTemperatureClosure,
snow::SingleLayerSnow,
constants::PhysicalConstants
)
Compute the depth-integrated snow energy from a prescribed temperature at grid cell i, j.
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.
Terrarium.tendency_fields — Method
tendency_fields(state, components)
Retrieves all Fields from state corresponding to tendencies defined on the given components.
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.
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.
Terrarium.timestep! — Method
timestep!(integrator::ModelIntegrator, timestepper::AbstractIMEX, Δt)Advance the model forward by one timestep of size Δt using an AbstractIMEX timestepper. Each prognostic variable is routed to the explicit or implicit sub-stepper according to the resolved classes stored in the IMEXCache type; each sub-stepper fetches its own sub-cache via get_cache. The clock is advanced once for the whole step.
Terrarium.timestep! — Method
timestep!(integrator::ModelIntegrator, timestepper::AbstractTimeStepper, Δt)Advance the model forward by one timestep of size Δt using a single timestepper, which integrates all prognostic variables. Dispatches on the timestepper's timestepping trait (Explicit/Implicit) to timestep!(integrator, timestepper, ::Timestepping, Δt).
Terrarium.timestep! — Method
timestep!(integrator::ModelIntegrator, timestepper::AbstractTimeStepper, ::Timestepping, Δt)Trait-dispatched single-timestepper step: forward the prognostic variable names to the scheme's timestep!(integrator, timestepper, Δt, names) method and advance the clock once for the whole step.
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.
Terrarium.timestepping — Method
timestepping(timestepper::AbstractTimeStepper)::TimesteppingReturn the Timestepping trait — Explicit or Implicit — of the given timestepper. Every concrete timestepper must define this trait (e.g. timestepping(::ForwardEuler) = Explicit()); there is no default so that a new scheme declares its class explicitly. It is used, among other things, to route each sub-stepper of an AbstractIMEX to its slice of the IMEXCache.
timestepping(var::AbstractVariable, model::AbstractModel, timestepper::AbstractTimeStepper)::TimesteppingReturn the Timestepping class with which the prognostic variable var of model is integrated under timestepper. Defaults to Explicit() for all variables; specialize this method (typically on an AbstractIMEX timestepper together with particular variable and/or model types) to route selected variables to the implicit sub-stepper.
Terrarium.timestepping — Method
timestepping(cache::IMEXCache)Return the resolved timestepping class of every prognostic variable (a tuple of Explicit/Implicit instances, in prognostic-variable order) held in the IMEXCache type parameter.
Terrarium.transpiration_conductance — Method
transpiration_conductance(
_::PALADYNCanopyEvapotranspiration{NF},
rₐ,
g_stm
) -> Any
Compute the transpiration vapor conductance [m/s] from aerodynamic resistance rₐ and stomatal conductance g_stm. The transpiration flux is this conductance times the humidity gradient.
Terrarium.tuplejoin — Method
tuplejoin()
Concatenate one or more tuples together.
Terrarium.update_inputs! — Function
Update input variables from the given input sources. The scope corresponds to the path of namespace names from the root namespace to state and is used to match namespaced input sources to their target variables; see varpath.
Terrarium.update_inputs! — Method
update_inputs!(inputs, grid, clock, fields, _::InputSource)
Updates the values of the input variables stored in inputs from the given input source, called at every time step. The grid and the full model state fields (read-only) are provided so that sources may compute their inputs from the grid geometry or other state variables. Namespace routing is handled by the caller (see [InputSources]). Default implementation returns nothing.
Terrarium.vapor_pressure_deficit — Method
vapor_pressure_deficit(c, T, pres, q_air)
Computes the vapor pressure deficit for an air parcel at temperature T [°C] with pressure pres [Pa] and specific humidity q_air [kg/kg]. Assumes that air parcel is over water when T > 0°C and over ice when T < 0°C. Wrapper around vapor_pressure_deficit.
Terrarium.vapor_pressure_difference — Method
vapor_pressure_difference(
c::ThermodynamicConstants,
p,
q_air,
T
) -> Any
Computes the difference in vapor pressure between a saturated surface at temperature T [°C] and the atmosphere, defined by its specific humidity q_air [kg/kg] and pressure p [Pa]. Relies on Thermodynamics.jl via partial_pressure_vapor and saturation_vapor_pressure.
Terrarium.vapor_pressure_to_specific_humidity — Method
vapor_pressure_to_specific_humidity(c::ThermodynamicConstants, e, pr)Derives specific humidity from measured vapor pressure e [Pa] and air pressure pr [Pa].
Terrarium.var — Function
var(name, dims)
var(name, dims, units)
Convenience constructor for Variable.
Terrarium.vardims — Method
vardims(var)
Retrieve the grid dimensions on which this variable is defined.
Terrarium.vardims — Method
vardims(_)
Infer the appropriate VarDims from the given Field.
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.
Terrarium.variables — Method
variables(
_::InputSource
) -> Tuple{Union{Terrarium.InputVariable{_A, VD, UT, _B, DomainSets.RealLine{Float64}, Nothing} where {_A, VD<:Terrarium.VarDims, UT<:Unitful.Units, _B<:Terrarium.Variable{_A, VD, UT}}, Terrarium.Namespace}}
Returns a tuple of Symbols corresponding to variable names supported by this InputSource.
Terrarium.variables — Method
Defines temperature as the closure variable for SoilEnergyTemperatureClosure.
Terrarium.variables — Method
variables(obj::Union{AbstractCoupledProcesses, AbstractModel})Default implementation of variables for composite AbstractModel and AbstractCoupledProcesses types that automatically collects all variables from all processes defined as properties/fields on the given obj.
Terrarium.variables — Method
Alias for Variables(vars...)
Terrarium.varname — Method
varname(source::InputSource)
Returns the name of the input variable provided by this source, i.e. the last entry of its varpath.
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.
Terrarium.varpath — Method
varpath(name::Symbol)
varpath(path::Pair)
varpath(path::Tuple{Vararg{Symbol}})Normalize the given variable name into a path of the form (namespace_1, ..., namespace_N, varname). Plain Symbol names correspond to variables in the root namespace, i.e. the path (varname,). Namespaced variables can be specified either as Pairs, e.g. :ns1 => :ns2 => :varname, or directly as a tuple of Symbols, e.g. (:ns1, :ns2, :varname).
Terrarium.varunits — Method
varunits(var)
Retrieve the physical units for the given variable.
Terrarium.vegetation_area_fraction — Function
vegetation_area_fraction(i, j, grid, fields, ::AbstractVegetationDynamics)Return the fraction of the grid cell i, j covered by vegetation of any type.
Terrarium.volumetric_fractions — Method
volumetric_fractions(soil::SoilComposition) -> 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.
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.
Terrarium.water_table — Function
water_table(i, j, k, grid, fields, ::AbstractSoilHydrology)Compute or retrieve the current water table level relative to the surface.
Terrarium.wilting_point — Function
Compute the empirical wilting point of the soil.
Terrarium.windspeed — Method
windspeed(i, j, grid, fields, ::PrescribedAtmosphere)Retrieve or compute the windspeed at the current time step.
Terrarium.with_scope — Method
with_scope(path, var)
Wrap the given variable var in nested Namespaces according to the path, where path is the namespace scope (i.e. the sequence of enclosing namespace names, excluding the variable's own name). An empty path returns var unwrapped.
Terrarium.with_soil_horizon — Method
with_soil_horizon(
func,
i,
j,
k,
grid,
fields,
strat::SoilStratigraphy,
args...;
kwargs...
) -> Any
Convenience method that invokes func(i, j, grid, horizon_fields, horizon, args...; kwargs...) where horizon is the soil horizon returned by soil_horizon and horizon_fields is getproperty(fields, nameof(horizon)).
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.
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.
Oceananigans.OutputReaders.FieldTimeSeries — Type
FieldTimeSeries(
grid::AbstractLandGrid,
dims::VarDims,
times=eltype(grid)[]
)Construct a FieldTimeSeries on the given land grid with the given dims and times.
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.
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.
Terrarium.AbstractAlbedo — Type
Base type for surface albedo and emissivity parameterizations.
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.
Terrarium.AbstractAutotrophicRespiration — Type
abstract type AbstractAutotrophicRespiration{NF} <: Terrarium.AbstractProcess{NF}Base type for autotrophic respiration schemes.
Terrarium.AbstractBulkWeighting — Type
Base type for bulk weighting/mixing schemes that calculate weighted mixture of material properties such as conductivities or densities.
Terrarium.AbstractCanopyInterception — Type
Base type for canopy interception process implementations.
Terrarium.AbstractClosureRelation — Type
abstract type AbstractClosureRelationBase 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.
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.
Terrarium.AbstractEnergyClosure — Type
abstract type AbstractEnergyClosure <: Terrarium.AbstractClosureRelationBase type for closure relations between internal energy and temperature in a material volume.
Terrarium.AbstractEvapotranspiration — Type
Base type for evapotranspiration processes.
Terrarium.AbstractGroundEvaporationResistanceFactor — Type
Base type for evaporation resistance parameterizations.
Terrarium.AbstractHeatOperator — Type
abstract type AbstractHeatOperatorBase type for formulations of the heat transfer operator.
Terrarium.AbstractHumidity — Type
abstract type AbstractHumidityBase type for representations of near-surface atmospheric humidity. Subtypes define which form of humidity (e.g. specific or relative humidity) is used as input.
Terrarium.AbstractHydrologyModel — Type
abstract type AbstractHydrologyModel{NF, GR} <: Terrarium.AbstractModel{NF, GR}Base type for surface hydrology models.
Terrarium.AbstractIMEX — Type
abstract type AbstractIMEX{NF} <: Terrarium.AbstractTimeStepper{NF}Base type for implicit-explicit (IMEX) time steppers. An AbstractIMEX integrates each prognostic variable with one of two sub-steppers depending on its timestepping class: variables of class Explicit are stepped by the explicit sub-stepper and those of class Implicit by the implicit sub-stepper.
Concrete subtypes (e.g. IMEX) must provide the explicit and implicit sub-steppers via explicit_timestepper and implicit_timestepper; most other behavior is defined here against AbstractIMEX.
Terrarium.AbstractIncomingRadiation — Type
abstract type AbstractIncomingRadiationBase type for representations of downwelling (incoming) radiation. Subtypes define which spectral components are provided as inputs (e.g. split into shortwave and longwave).
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.
Terrarium.AbstractLandAsset — Type
abstract type AbstractLandAssetLightweight base type for Terrarium land data assets.
Terrarium.AbstractLandModel — Type
AbstractLandModel <: AbstractModelBase type for full land models which couple together multiple component models.
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:
variableswhich 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.
Terrarium.AbstractPhenology — Type
abstract type AbstractPhenology{NF} <: Terrarium.AbstractProcess{NF}Base type for vegetation phenology schemes.
Terrarium.AbstractPhotosynthesis — Type
abstract type AbstractPhotosynthesis{NF} <: Terrarium.AbstractProcess{NF}Base type for photosynthesis schemes.
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.
Terrarium.AbstractPrecipitation — Type
abstract type AbstractPrecipitationBase type for representations of atmospheric precipitation. Subtypes define which variables describe the precipitation input (e.g. rain and snow as separate fields).
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.
Terrarium.AbstractProcessVariable — Type
Baste type for process state variables with specific intents, e.g. prognostic, auxiliary, or input.
Terrarium.AbstractRadiativeFluxes — Type
Base type for radiative flux parameterizations.
Terrarium.AbstractRootDistribution — Type
abstract type AbstractRootDistribution{NF} <: Terrarium.AbstractProcess{NF}Base type for vegetation root distribution schemes.
Terrarium.AbstractSkinTemperature — Type
Base type for skin temperature and ground heat flux schemes.
Terrarium.AbstractSnow — Type
abstract type AbstractSnow{NF} <: Terrarium.AbstractCoupledProcesses{NF}Base type for coupled snow processes. Implementations should typically couple an energy balance and a mass (water equivalent) balance for a snowpack overlying the ground surface. Snow is modeled as its own coupled process (a sibling of soil), reusing the medium-agnostic FreeWater enthalpy relations for the energy↔temperature closure (the same closure used for the soil; see Soil energy balance).
Terrarium.AbstractSnowCover — Type
abstract type AbstractSnowCover{NF}Base type for snow areal-coverage parameterizations.
Terrarium.AbstractSnowDensity — Type
abstract type AbstractSnowDensity{NF}Base type for snow density schemes.
Terrarium.AbstractSnowHydraulics — Type
abstract type AbstractSnowHydraulics{NF}Base type for snow hydraulic properties and parameterization schemes.
Terrarium.AbstractSnowModel — Type
abstract type AbstractSnowModel{NF, GR} <: Terrarium.AbstractModel{NF, GR}Base type for snow models.
Terrarium.AbstractSoil — Type
abstract type AbstractSoil{NF} <: Terrarium.AbstractCoupledProcesses{NF}Base type for coupled soil processes.
Terrarium.AbstractSoilBiogeochemistry — Type
abstract type AbstractSoilBiogeochemistry{NF} <: Terrarium.AbstractProcess{NF}Base type for soil biogeochemistry process implementations.
Terrarium.AbstractSoilHorizon — Type
abstract type AbstractSoilHorizon{NF, name}Base type for soil "horizons", i.e. vertical segments of soil with homogeneous soil properties and a user-defined name.
Terrarium.AbstractSoilHydraulics — Type
abstract type AbstractSoilHydraulics{NF, RC<:SWRC, UnsatK<:Terrarium.AbstractUnsatK}Base type for soil hydraulic properties and parameterization schemes.
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.
Terrarium.AbstractSoilMatrix — Type
abstract type AbstractSoilMatrix{NF}Base type for representing the solid material composition of the soil.
Terrarium.AbstractSoilModel — Type
abstract type AbstractSoilModel{NF, GR} <: Terrarium.AbstractModel{NF, GR}Base type for soil models.
Terrarium.AbstractSoilPorosity — Type
abstract type AbstractSoilPorosity{NF}Base type for parameterizations of soil porosity.
Terrarium.AbstractSoilThermodynamics — Type
abstract type AbstractSoilThermodynamics{NF} <: Terrarium.AbstractThermodynamics{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. Soil energy balances evolve the soil internal energy and therefore subtype AbstractThermodynamics.
Terrarium.AbstractSoilWaterClosure — Type
abstract type AbstractSoilWaterClosure <: Terrarium.AbstractClosureRelationBase type for closure relations between water saturation and potential in soil volumes.
Terrarium.AbstractStomatalConductance — Type
abstract type AbstractStomatalConductance{NF} <: Terrarium.AbstractProcess{NF}Base type for stomatal conductance schemes.
Terrarium.AbstractStratigraphy — Type
abstract type AbstractStratigraphy{NF} <: Terrarium.AbstractProcess{NF}Base type for soil stratigraphy parameterizations.
Terrarium.AbstractSurfaceEnergyBalance — Type
Base type for surface energy balance schemes which couple together the relevant processes for radiative and turbulent surface fluxes.
Terrarium.AbstractSurfaceEnergyModel — Type
abstract type AbstractSurfaceEnergyModel{NF, GR} <: Terrarium.AbstractModel{NF, GR}Base type for land-atmosphere energy exchange models.
Terrarium.AbstractSurfaceHydrology — Type
Base type for coupled surface hydrology processes.
Terrarium.AbstractSurfaceRunoff — Type
Base type for surface runoff processes.
Terrarium.AbstractThermodynamics — Type
abstract type AbstractThermodynamics{NF} <: Terrarium.AbstractProcess{NF}Base type for energy balance process implementations that evolve the internal energy of a solid or porous material medium.
Terrarium.AbstractTimeStepper — Type
Base type for time steppers.
Terrarium.AbstractTimeStepperCache — Type
abstract type AbstractTimeStepperCache{NF}Base type for time stepper caches. Each AbstractTimeStepper allocates a corresponding AbstractTimeStepperCache subtype (via initialize) to hold any working state it needs between stages/steps.
Terrarium.AbstractTurbulentFluxes — Type
Base type for turbulent (latent and sensible) heat flux parameterizations.
Terrarium.AbstractUnsatK — Type
abstract type AbstractUnsatK{NF}Base type for unsaturated hydraulic conductivity parameterizations.
Terrarium.AbstractVariable — Type
Base type for state variable placeholder types.
Terrarium.AbstractVegetation — Type
abstract type AbstractVegetation{NF} <: Terrarium.AbstractCoupledProcesses{NF}Base type for coupled vegetation (carbon) processes.
Terrarium.AbstractVegetationCarbonDynamics — Type
abstract type AbstractVegetationCarbonDynamics{NF} <: Terrarium.AbstractProcess{NF}Base type for vegetation carbon dynamics schemes.
Terrarium.AbstractVegetationDynamics — Type
abstract type AbstractVegetationDynamics{NF} <: Terrarium.AbstractProcess{NF}Base type for vegetation dynamics schemes.
Terrarium.AbstractVegetationModel — Type
abstract type AbstractVegetationModel{NF, GR} <: Terrarium.AbstractModel{NF, GR}Base type for vegetation models.
Terrarium.AbstractVerticalFlow — Type
abstract type AbstractVerticalFlowBase type for implementations of soil water flow dynamics.
Terrarium.AbstractVerticalSpacing — Type
abstract type AbstractVerticalSpacing{NF}Base type for vertical discretizations.
Terrarium.AnyField — Type
Type alias for an AbstractField with any X, Y, Z location or grid.
Terrarium.AnyFieldTimeSeries — Type
Type alias for a FieldTimeSeries with any X, Y, Z location or grid.
Terrarium.AuxiliaryVariable — Type
struct AuxiliaryVariable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units, Var<:Terrarium.Variable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units}, BT<:IntervalSets.AbstractInterval, FC} <: 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.
Terrarium.BCType — Type
Alias for Oceananigans AbstractBoundaryConditionClassification
Terrarium.BareGroundEvaporation — Type
BareGroundEvaporation{NF, GR} <: AbstractEvapotranspirationEvaporation scheme for bare ground that calculates the humidity flux as
\[E = \beta \frac{\Delta q}{r_a}\]
where Δq is the specific humidity difference, rₐ is aerodynamic resistance, and β is an evaporation limiting factor.
Terrarium.ColumnGrid — Type
ColumnGrid{NF, Arch<:AbstractArchitecture, RectGrid<:Oceananigans.Grids.RectilinearGrid} <: AbstractLandGridRepresents 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.
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.
Terrarium.ConstantAerodynamics — Type
struct ConstantAerodynamics{NF} <: Terrarium.AbstractAerodynamics{NF}Dummy implementation of aerodynamics that simply returns constant values for all drag coefficients.
Terrarium.ConstantAlbedo — Type
struct ConstantAlbedo{NF} <: Terrarium.AbstractAlbedo{NF}Properties:
albedo::Any: Surface albedo, i.e. ratio of outgoing to incoming shortwave radiationemissivity::Any: Surface emissivity, i.e. fraction of thermal radiation emitted from the surface
Terrarium.ConstantEvaporationResistanceFactor — Type
struct ConstantEvaporationResistanceFactor{NF} <: Terrarium.AbstractGroundEvaporationResistanceFactorRepresents a spatiotemporally constant ground evaporation resistance factor.
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
Terrarium.ConstantSnowAlbedo — Type
struct ConstantSnowAlbedo{NF}Basic constant albedo scheme for snow that treats both albedo and emissivity as both spatially and temporally constants. The default values are for freshly fallen snow, taken from [12].
Terrarium.ConstantSnowDensity — Type
struct ConstantSnowDensity{NF} <: Terrarium.AbstractSnowDensity{NF}Constant, spatially homogeneous bulk snow density ρ_snow. This is the default (and currently only) snow density scheme for SingleLayerSnow. Default bulk snow density follows [12].
Properties:
density::Any: Bulk snow densityρ_snow
References
- [12] Westermann et al., Geoscientific Model Development (2016)
Terrarium.ConstantSnowHydraulics — Type
struct ConstantSnowHydraulics{NF} <: Terrarium.AbstractSnowHydraulics{NF}Constant, spatially homogeneous snow hydraulic properties: a saturated hydraulic conductivity K_sat and a capillary retention L_c, setting the Darcy-type meltwater outflow (see compute_meltwater_outflow). Default values follow [3].
Properties:
saturated_conductivity::Any: Hydraulic conductivity at saturationcapillary_retention::Any: Capillary retentionliq_c: liquid fraction held against gravity before meltwater drains
References
- [3] Tarboton, Chowdhury and Jackson (1994)
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ρ_org::Any: Pure organic matter density
Terrarium.ConstantSoilHorizon — Type
struct ConstantSoilHorizon{NF, name, Porosity<:Terrarium.AbstractSoilPorosity{NF}} <: Terrarium.AbstractSoilHorizon{NF, name}Represents an arbitrary soil horizon whose properties (texture and porosity) are assumed to be constant across both space and time.
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 curveunsat_hydraulic_cond::Terrarium.AbstractUnsatK: Unsaturated hydraulic conductivity formulation; defaults tosaturated_conductivitysaturated_conductivity::Any: Hydraulic conductivity at saturationfield_capacity::Any: Constant field capacitywilting_point::Any: Constant wilting pointresidual::Any: Residual (minimum) saturation level
Terrarium.ConstantSoilPorosity — Type
struct ConstantSoilPorosity{NF} <: Terrarium.AbstractSoilPorosity{NF}Parameterization of soil porosity that simply specifies constant values for the mineral and organic components.
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
Terrarium.ConstantSoilTemperature — Method
Creates a constant soil temperature initializer.
Terrarium.DefaultInitializer — Type
Marker type for a no-op initializer that leaves all Fields set to their default values.
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.
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.
Terrarium.DiagnosticAlbedo — Type
struct DiagnosticAlbedo{NF} <: Terrarium.AbstractAlbedo{NF}Diagnosed surface albedo and emissivity. The values are computed in compute_auxiliary! as a snow-cover-weighted blend of a snow-free background and snow, α = (1 − f_snow)·α_bg + f_snow·α_snow (and likewise for emissivity), where f_snow is the snow-covered area fraction of the optional snow component passed to compute_auxiliary!. Without a snow component (snow === nothing), f_snow = 0 and the background values are used.
Properties:
background_albedo::Any: Snow- and vegetation-free (background) albedo of bare groundbackground_emissivity::Any: Snow- and vegetation-free (background) emissivity of bare ground
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
Terrarium.ERA5LandForcings — Type
struct ERA5LandForcings <: Terrarium.AbstractLandAssetOne year of ERA5-Land hourly meterological variables regridded to approximately 1° x 1° resolution (72 Gaussian rings).
| Variable | Description | Units |
|---|---|---|
t2m | 2 metre air temperature | K |
d2m | 2 metre dewpoint temperature | K |
tp | Total precipitation | m |
sf | Snowfall (water equivalent) | m |
sp | Surface pressure | Pa |
ssrd | Surface solar (shortwave) radiation downwards | J/m² |
strd | Surface thermal (longwave) radiation downwards | J/m² |
u10 | 10 metre eastward (U) wind component | m/s |
v10 | 10 metre northward (V) wind component | m/s |
Terrarium.ERA5LandInvariants — Type
struct ERA5LandInvariants <: Terrarium.AbstractLandAssetTime-invariant spatial fields from ERA5-Land at the native 0.1° x 0.1° resolution.
| Variable | Description | Units |
|---|---|---|
cvh | High vegetation cover | fraction (0–1) |
lsm | Land-sea mask (fraction of land) | fraction (0–1) |
tvl | Type of low vegetation | categorical index |
cvl | Low vegetation cover | fraction (0–1) |
z | Surface geopotential (orography × g) | m²/s² |
slt | Soil type | categorical index |
dl | Lake total depth | m |
cl | Lake cover | fraction (0–1) |
si10 | 10 metre wind speed | m/s |
tvh | Type of high vegetation | categorical index |
Terrarium.ERA5LandLeafAreaIndex — Type
struct ERA5LandLeafAreaIndex <: Terrarium.AbstractLandAssetLeaf area index daily climatology for 1980-2010 from ERA5-Land at the native 0.1° x 0.1° resolution.
| Variable | Description | Units |
|---|---|---|
lai_lv | Leaf area index, low vegetation | m²/m² |
lai_hv | Leaf area index, high vegetation | m²/m² |
Terrarium.EmptyCache — Type
struct EmptyCache{NF} <: Terrarium.AbstractTimeStepperCache{NF}Trivial cache for time steppers that require no working state (e.g. ForwardEuler).
Terrarium.Explicit — Type
struct Explicit <: TimesteppingTimestepping trait marking explicit integration. It is the trait of explicit timesteppers (e.g. ForwardEuler, Heun) and the default class of every prognostic variable — i.e. the sub-stepper an AbstractIMEX routes the variable to.
Terrarium.ExplicitTwoPhaseHeatConduction — Type
struct ExplicitTwoPhaseHeatConduction <: Terrarium.AbstractHeatOperatorRepresents 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⁻¹].
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 bottomN::Int64: Number of layerssig::Union{Nothing, Integer}: Number of significant digits for rounding ornothing
Terrarium.FieldBCs — Type
Alias for a NamedTuple of FieldBC types where the keys correspond to field/variable names.
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:
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.
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.
Terrarium.FixedPointSolver — Type
struct FixedPointSolver{NF, R}Fixed-point (Picard) iteration solver. Repeatedly applies the update g(x) = x - F(x), where F is the residual returned by the ObjectiveFunction, optionally under-relaxed via a RelaxationFactor, until the change in the iterate falls below tolerance or max_iterations is reached.
Properties:
tolerance: Numerical tolerance of the fixed point iterationrelax: Relaxation schememax_iterations: Maximum number of iterations to run
Terrarium.ForwardEuler — Type
struct ForwardEuler{NF} <: Terrarium.AbstractTimeStepper{NF}Simple forward Euler time stepping scheme.
Terrarium.FractionalSnowCover — Type
struct FractionalSnowCover{NF} <: Terrarium.AbstractSnowCover{NF}Simple fractional snow cover parameterization f_snow = W_snow/(W_snow + W_ref) where W_snow is the current snow water equivalent (SWE) within any given finite area and W_ref is the reference SWE at which the area would be expected to be 50% covered. The function is smooth and differentiable, with f_snow → 0 as W_snow → 0 and f_snow → 1 as W_snow → ∞.
Default SWE level for half_coverage is set to 0.01 m following [11].
Properties:
half_coverage::Any: Reference snow water equivalent levelW_ref
References
- [11] Douville et al., Climate Dynamics (1995)
Terrarium.Heun — Type
struct Heun{NF} <: Terrarium.AbstractTimeStepper{NF}Simple forward 2nd order Heun / improved Euler time stepping scheme.
Terrarium.HeunCache — Type
struct HeunCache{NF, P, T, NS} <: Terrarium.AbstractTimeStepperCache{NF}Cache for the Heun scheme, holding copies of the prognostic state u₀ and the predictor tendencies ∂u∂t₀ (Heun steps in-place on state, so only these two are needed). The cache mirrors the namespace tree of the state: namespaces holds a sub-HeunCache per namespace so that namespaced prognostic variables are staged (saved/restored/averaged) consistently with how explicit_step! recurses into namespaces.
Terrarium.IMEX — Type
struct IMEX{NF, E<:Terrarium.AbstractTimeStepper{NF}, I<:Terrarium.AbstractTimeStepper{NF}} <: AbstractIMEX{NF}Implicit-explicit (IMEX) time stepper that integrates each prognostic variable with one of two sub-steppers depending on its timestepping class: variables of class Explicit are stepped by explicit, and those of class Implicit by implicit.
Each variable's class is resolved from timestepping(var, model, imex), which defaults to Explicit() for all variables. To integrate selected variables implicitly, specialize timestepping on the relevant variable and/or model types together with the IMEX timestepper. The resolved per-variable classes are stored in the IMEXCache type parameter and used to route variables at each step.
Properties:
explicit::Terrarium.AbstractTimeStepper: Sub-stepper for prognostic variables of classExplicit(should havetimestepping(explicit) == Explicit())implicit::Terrarium.AbstractTimeStepper: Sub-stepper for prognostic variables of classImplicit(should havetimestepping(implicit) == Implicit())
Terrarium.IMEX — Method
IMEX(explicit, implicit)
IMEX(; explicit, implicit)Construct an IMEX time stepper from an explicit and an implicit sub-stepper (which must share the same numerical type NF). Which prognostic variables are integrated implicitly is controlled by specializing timestepping.
Terrarium.IMEXCache — Type
struct IMEXCache{classes, NF, EC<:Terrarium.AbstractTimeStepperCache{NF}, IC<:Terrarium.AbstractTimeStepperCache{NF}} <: Terrarium.AbstractTimeStepperCache{NF}Cache for an AbstractIMEX time stepper. Holds each sub-stepper's own cache; the resolved per-variable timestepping classes are stored as the leading type parameter classes (a tuple of Explicit/Implicit instances, in prognostic-variable order) so that routing each variable to its sub-stepper is type stable.
Properties:
explicit::Terrarium.AbstractTimeStepperCache: Cache for the explicit sub-stepperimplicit::Terrarium.AbstractTimeStepperCache: Cache for the implicit sub-stepper
Terrarium.Implicit — Type
struct Implicit <: TimesteppingTimestepping trait marking implicit integration. It is the trait of implicit timesteppers and, under an AbstractIMEX, of prognostic variables routed to the implicit sub-stepper.
Terrarium.ImplicitSkinTemperature — Type
struct ImplicitSkinTemperature{NF, Solver} <: 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) = 0 \]
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. All fluxes follow the positive upwards convention. For $G$, this means from the deeper soil towards the surface is positive. For the other fluxes, this means from the surface towards the atmosphere is positive.
Properties:
κₛ: Assumed thermal conductivity at the surfacesolver: Numerical solver for the implicit skin temperature
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!(inputs, grid, clock, fields, ::InputSource) that is called once at model initialization and an update_inputs!(inputs, grid, clock, fields, ::InputSource) method that is called at every time step, where inputs are the input Fields to be written, grid is the model grid, clock the simulation clock, and fields the full (read-only) model state. Both default to doing nothing. Implementations should additionally provide a constructor as a dispatch of InputSource. Namespace routing (scope) is handled by the enclosing [InputSources] container.
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.
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. The name can either be a plain Symbol or a namespaced path; see varpath.
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.
Terrarium.InputSources — Type
Container type for wrapping multiple InputSources.
Terrarium.InputVariable — Type
struct InputVariable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units, Var<:Terrarium.Variable{name, VD<:Terrarium.VarDims, UT<:Unitful.Units}, BT<: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.
Terrarium.InverseQuadratic — Type
struct InverseQuadratic <: Terrarium.AbstractBulkWeightingThe inverse quadratic (or "quadratic parallel") bulk weighting formula for thermal conductivity ([33]):
\[k = \left[\sum_{i=1}^N θᵢ\sqrt{kᵢ}\right]^2\]
References
- [33] Cosenza et al., European Journal of Soil Science (2003)
Terrarium.LUEPhotosynthesis — Type
struct LUEPhotosynthesis{NF} <: Terrarium.AbstractPhotosynthesis{NF}Photosynthesis implementation from PALADYN [16] for C3 PFTs following the mechanistic approach of [17]. 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. Ratio of carboxylation to oxygenation rates.Kc25::Any: Michaelis-Menten constant for CO₂ at 25°C. PALADYN value for needleleaf trees.Ko25::Any: Michaelis-Menten constant for O₂ at 25°C. PALADYN value for needleleaf trees.q10_τ::Any: Q10 temperature sensitivity for τ. Controls temperature dependence of specificity.q10_Kc::Any: Q10 temperature sensitivity for Kc. Controls temperature dependence of CO₂ affinity.q10_Ko::Any: Q10 temperature sensitivity for Ko. 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 plantscq::Any: Conversion factor for solar radiation at 550 nm from J/m² to mol/m²T_CO2_high::Any: Upper temperature threshold for CO₂/O₂ specificity factor. Above this, photosynthesis rapidly declines. PFT-specific, needleleaf tree value.T_CO2_low::Any: Lower temperature threshold for CO₂/O₂ specificity factor. Below this, photosynthesis rapidly declines. PFT-specific, needleleaf tree value.T_photos_high::Any: Upper temperature threshold for light-limited photosynthesis rate. Peak photosynthesis capacity. PFT-specific, needleleaf tree value.T_photos_low::Any: Lower temperature threshold for light-limited photosynthesis rate. 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).
References
Terrarium.LandModel — Type
struct LandModel{NF, GridType<:(Terrarium.AbstractLandGrid{NF}), Vegetation<:Union{Nothing, Terrarium.AbstractVegetation{NF}}, Soil<:Terrarium.AbstractSoil{NF}, Snow<:Union{Nothing, Terrarium.AbstractSnow{NF}}, SEB<:Terrarium.AbstractSurfaceEnergyBalance, Hydrology<:Terrarium.AbstractSurfaceHydrology, Atmosphere<:Terrarium.AbstractAtmosphere, Initializer<:Terrarium.AbstractInitializer, Timestepper<:Terrarium.AbstractTimeStepper{NF}} <: Terrarium.AbstractLandModel{NF, GridType<:(Terrarium.AbstractLandGrid{NF})}Fully-coupled land model integrating atmosphere, surface energy balance, surface hydrology, vegetation, and soil processes.
Properties:
grid::Terrarium.AbstractLandGrid: Spatial discretizationvegetation::Union{Nothing, Terrarium.AbstractVegetation{NF}} where NF: Vegetation processessoil::Terrarium.AbstractSoil: Soil processessnow::Union{Nothing, Terrarium.AbstractSnow{NF}} where NF: Snow processes (defaultnothing: no snowpack)surface_energy_balance::Terrarium.AbstractSurfaceEnergyBalance: Surface energy balancesurface_hydrology::Terrarium.AbstractSurfaceHydrology: Surface hydrology schemeatmosphere::Terrarium.AbstractAtmosphere: Near-surface atmospheric conditionsconstants::PhysicalConstants: Physical constantsinitializer::Terrarium.AbstractInitializer: State variable initializertimestepper::Terrarium.AbstractTimeStepper: Time stepper: a singleAbstractTimeStepper(e.g.ForwardEuler,Heun) or anIMEX
Terrarium.LengthQuantity — Type
Alias for numeric Quantity with type NF and units U
Terrarium.LogarithmicSnowThermalConductivity — Type
struct LogarithmicSnowThermalConductivity{NF} <: Terrarium.AbstractSnowThermalConductivity{NF}Logarithmic snow thermal conductivity parameterization of [14].
Properties:
scale::Anyshift::Any
References
- [14]
Terrarium.LongShortWaveRadiation — Type
struct LongShortWaveRadiation <: Terrarium.AbstractIncomingRadiationIncoming radiation parameterization in which downwelling shortwave [W/m²] and longwave [W/m²] radiation are provided as separate input fields, along with daytime length [hr].
Terrarium.MaterialConstants — Type
struct MaterialConstants{NF}Material constants for water, ice, and carbon used in soil energy, hydrology, and vegetation process implementations.
julia> show(MaterialConstants(Float64))
MaterialConstants{Float64}(1000.0, 916.7, 12.0)Properties:
density_water: Density of water in kg/m^3density_ice: Density of ice in kg/m^3atomic_weight_carbon: Atomic mass of carbon [gC/mol]
Terrarium.MedlynStomatalConductance — Type
struct MedlynStomatalConductance{NF} <: Terrarium.AbstractStomatalConductance{NF}Stomatal conductance implementation from [16] following the optimal stomatal conductance model of [19].
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, [20]. PFT specific.g_min::Any: Minimum stomatal conductance parameter
References
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 textureorganic::Any: Organic soil fraction
Terrarium.MineralOrganic — Method
MineralOrganic(; texture, organic)
Validating keyword constructor for MineralOrganic; enforces that organic lies in the unit interval.
Terrarium.MineralOrganicSoil — Type
Alias for SoilComposition{T, MineralOrganic{T}}
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, ClockType<:Clock, 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 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.
Terrarium.Namespace — Type
struct Namespace{name, Vars}Represents a new variable namespace, typically from a subcomponent of the model.
Terrarium.NoCanopyInterception — Type
struct NoCanopyInterception{NF} <: Terrarium.AbstractCanopyInterception{NF}No-op canopy interception that routes all rainfall directly to the ground (open sky). This is necessary since downstream processes consume rainfall_ground rather than the rainfall directly; this no-op implementation allows for a unified interface.
Terrarium.NoFlow — Type
struct NoFlow <: Terrarium.AbstractVerticalFlowRepresents a hydrology scheme where soil water is immobile.
Terrarium.ObjectiveFunction — Type
struct ObjectiveFunction{target, F, DF}Represents an objective function for nonlinear solvers. The name target refers to the output Field which should updated on each iteration. The objective function should have the signature
func(out, indices..., grid, fields, func_args...; func_kwargs...)where indices are the grid indices passed to solve! and directly return the scalar residual. If an analytical derivative is provided via dfunc, it should follow the same signature as func and return the derivative of the residual with respect to the target.
Terrarium.PALADYNAutotrophicRespiration — Type
struct PALADYNAutotrophicRespiration{NF} <: Terrarium.AbstractAutotrophicRespiration{NF}Autotrophic respiration implementation from [16].
Authors: Maha Badri and Matteo Willeit
Properties:
cn_sapwood::Any: Sapwood parametercn_root::Any: Root parameteraws::Any: Ratio of total to respiring stem carbon, [21]. PFT specific.
References
Terrarium.PALADYNCanopyEvapotranspiration — Type
struct PALADYNCanopyEvapotranspiration{NF, GR<:Terrarium.AbstractGroundEvaporationResistanceFactor} <: Terrarium.AbstractEvapotranspiration{NF}Canopy evapotranspiration scheme from PALADYN ([16, Eq. (5)]) that includes a canopy evaporation term based on the saturation fraction of canopy water defined by the canopy hydrology scheme.
\[E_{\text{ground}} = \beta \frac{\Delta q}{r_a + r_e}\]
\[E_{\text{can}} = f_{\text{can}} \frac{\Delta q}{r_a}\]
\[T_{\text{can}} = \frac{\Delta q}{r_a + r_s}\]
Properties:
C_can: Drag coefficient for the transfer of heat and water between the ground and canopyground_resistance: Parameterization for ground resistance to evaporation/sublimation
References
- [16] Willeit and Ganopolski, Geoscientific Model Development (2016)
Terrarium.PALADYNCanopyInterception — Type
struct PALADYNCanopyInterception{NF} <: Terrarium.AbstractCanopyInterception{NF}Canopy interception and storage implementation following PALADYN ([16]) considering only liquid water (no snow).
Properties:
α_int: Canopy water interception factor for tree PFTsk_ext: Extinction coefficient for radiation through vegetationW_can_max: Canopy interception capacity parameter, [26]τ_w: Canopy water removal timescale
References
Terrarium.PALADYNCarbonDynamics — Type
struct PALADYNCarbonDynamics{NF} <: Terrarium.AbstractVegetationCarbonDynamics{NF}Vegetation carbon dynamics implementation following [16] 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:
γL::Any: Leaf turnover rate ([22]). PFT specific.γR::Any: Root turnover rate. PFT specific.γS::Any: Stem src/processes/vegetation/hydraulicsturnover rate modified from [23]. PFT specific.
References
Terrarium.PALADYNPhenology — Type
struct PALADYNPhenology{NF} <: Terrarium.AbstractPhenology{NF}Prognostic, growing-degree-day (GDD) based vegetation phenology following the cold-deciduous scheme of [16] and [24].
The instantaneous leaf area index is LAI = ϕ·LAI_b, where LAI_b is the balanced (annual-maximum) leaf area index and ϕ is the phenology factor. For a cold-deciduous PFT, ϕ ramps up linearly with accumulated growing degree days above a base temperature T_gdd_base at a rate set by gdd_crit [16, Eq. (83)], holds at 1 once fully leafed out, and declines linearly during senescence as air temperature falls from T_gdd_base to T_gdd_base − T_senescence_range.
Unlike the discrete daily accumulation of the original scheme in PALADYN, the growing degree days are integrated as a prognostic state variable, so no history of past inputs needs to be stored. To recover a periodic seasonal cycle without a discrete annual reset (which would violate the continuous-time design), a cold-season relaxation term drains the accumulator with timescale gdd_relaxation_time whenever air temperature is below T_gdd_base.
The deciduous/evergreen distinction, set in PALADYN by the coldest-month temperature, is represented here by the prescribed f_deciduous fraction: ϕ = f_deciduous·ϕ_deciduous + (1 − f_deciduous), so an evergreen PFT (f_deciduous = 0) has ϕ = 1 (and LAI = LAI_b) independent of temperature.
Authors: Maha Badri and Matteo Willeit
Properties:
T_gdd_base::Any: Base temperature for growing-degree-day accumulation and senescence onsetgdd_crit::Any: Critical growing-degree-day sum for full leaf-outT_senescence_range::Any: Air-temperature range belowT_gdd_baseover which leaves fully senescegdd_relaxation_time::Any: Cold-season relaxation timescale for the continuous growing-degree-day resetf_deciduous::Any: Deciduous fraction (0 = evergreen, 1 = fully deciduous); prescribed per PFT via the coldest-month-temperature criterion
References
Terrarium.PALADYNVegetationDynamics — Type
struct PALADYNVegetationDynamics{NF} <: Terrarium.AbstractVegetationDynamics{NF}Vegetation dynamics implementation following [16] 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
References
- [16] Willeit & Ganopolski, Geoscientific Model Development (2016)
Terrarium.PhysicalConstants — Type
struct PhysicalConstants{NF}Top-level container for all physical constants used in Terrarium. Groups three sub-structs by category:
ThermodynamicConstants— thermodynamic and atmospheric constantsMaterialConstants— material properties of water, ice, and carbonUniversalConstants— universal constants (gravity, Stefan-Boltzmann, von Kármán)
Construction
julia> show(PhysicalConstants())
PhysicalConstants{Float64}(ThermodynamicConstants{Float64}(1004.5, 2070.0, 4181.0, 1859.0, 333550.0, 2.5008e6, 2.83435e6, 273.16, 273.15, 273.16, 611.657, 287.0, 461.5), MaterialConstants{Float64}(1000.0, 916.7, 12.0), UniversalConstants{Float64}(9.80665, 5.6704e-8, 0.4))To override individual constants, pass a customised sub-struct:
julia> tc = ThermodynamicConstants(Float64; temperature_reference = 273.15);
julia> c = PhysicalConstants(Float64; thermodynamics = tc);
julia> c.thermodynamics.temperature_reference
273.15Properties:
thermodynamicsmaterialuniversal
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}
Terrarium.PlantTraits — Type
struct PlantTraits{NF}Plant-specific parameters for a single functional type. This is a temporary, partial construct that will be soon be replaced will full support for PFTs and other trait parameterizations.
Terrarium.PowerLawSnowThermalConductivity — Type
struct PowerLawSnowThermalConductivity{NF} <: Terrarium.AbstractSnowThermalConductivity{NF}Power law parameterization for snow thermal conductivity as a function of density following [13, Eq. (34)].
Properties:
conductivity_coefficient::Any: Coefficientain the thermal conductivity power lawκ = a·(ρ_snow/ρ_w)^bconductivity_exponent::Any: Exponentbin the thermal conductivity power lawκ = a·(ρ_snow/ρ_w)^b
References
- [13] Yen et al. 1981
Terrarium.PrescribedAlbedo — Type
struct PrescribedAlbedo{NF} <: Terrarium.AbstractAlbedo{NF}Properties:
Terrarium.PrescribedAtmosphere — Type
struct PrescribedAtmosphere{NF, tracernames, Precip<:Terrarium.AbstractPrecipitation, IncomingRad<:Terrarium.AbstractIncomingRadiation, Humidity<:Terrarium.AbstractHumidity, Aerodynamics<:Terrarium.AbstractAerodynamics, Gases<:Tuple{Vararg{TracerGas{NF}}}} <: 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.
Terrarium.PrescribedPhenology — Type
struct PrescribedPhenology{NF} <: Terrarium.AbstractPhenology{NF}Prescribed vegetation phenology where leaf_area_index is treated as a (possibly time-varying) input variable.
Properties:
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}\]
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
Terrarium.PrescribedSoilHorizon — Type
struct PrescribedSoilHorizon{NF, name, Porosity<:Terrarium.AbstractSoilPorosity{NF}} <: Terrarium.AbstractSoilHorizon{NF, name}Represents an arbitrary soil horizon whose properties (texture and porosity) are prescribed via input Fields and can therefore vary across space and (less commonly) time.
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
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.
Terrarium.PrescribedVegetation — Type
struct PrescribedVegetation{NF, Phenology, Photosynthesis, StomatalConductance, RootDistribution, PAW} <: Terrarium.AbstractVegetation{NF}Coupled vegetation process representing natural vegetation with a prescribed leaf area index. Unlike VegetationCarbonCycle, the vegetation carbon pool and leaf area are not prognostic: leaf area index is imposed externally (via the PrescribedPhenology scheme) and drives photosynthesis, stomatal conductance, and the associated water/energy exchange. There is consequently no prognostic carbon-pool or vegetation-dynamics component and no autotrophic respiration; compute_tendencies! is a no-op. Plant functional-type parameters (including the maximum leaf area index used to derive the phenology factor) are supplied through the traits component.
Properties:
phenology::Any: Phenology schemephotosynthesis::Any: Photosynthesis schemestomatal_conductance::Any: Stomatal conductance schemeroot_distribution::Any: Plant vertical root distributionplant_available_water::Any: Plant available water determining soil moisture stresstraits::PlantTraits: Plant physical traits
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, Terrarium.AuxiliaryVariable}, BT<: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!.
Terrarium.QuadraticSnowThermalConductivity — Type
struct QuadraticSnowThermalConductivity{NF} <: Terrarium.AbstractSnowThermalConductivity{NF}Piecewise quadratic snow thermal conductivity parameterization of [14]. Default conductivity of ice from [15].
Properties:
func_hi::Terrarium.QuadraticFunctionfunc_lo::Terrarium.QuadraticFunctionthreshold::Anyκ_max::Any
References
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₀::AnyQgeo::Anyk_eff::Any
Terrarium.RainSnow — Type
struct RainSnow <: Terrarium.AbstractPrecipitationPrecipitation parameterization in which liquid rainfall [m/s] and frozen snowfall [m/s] are provided as separate input fields.
Terrarium.RelaxationFactor — Type
struct RelaxationFactor{NF}Simple relaxation scheme for iterative solvers.
Terrarium.RichardsEq — Type
RichardsEq{PS} <: AbstractVerticalFlowSoilHydrology 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.
Terrarium.RootSolver — Type
struct RootSolver{NF, M, S, Tolerance<:RootSolvers.AbstractTolerance{NF}}Wrapper for RootSolvers.jl root-finding methods.
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::Anywater_table_depth::Any
Terrarium.SingleLayerSnow — Type
struct SingleLayerSnow{NF, Cover, Density, Conductivity, Hydraulics, Albedo, Closure} <: Terrarium.AbstractSnow{NF}Simple single-layer snow scheme (loosely based on the Utah Energy Balance model, [3]). The snowpack is represented as a single lumped layer with a bulk density ρ_snow supplied by a snow-density scheme (constant by default), from which the thermal properties follow. The prognostic state is the depth-integrated (column) internal energy snow_energy Ū_snow [J/m²] and the snow_water_equivalent W_snow [m]; snow depth, cover fraction, and thermal conductivity are diagnosed from these and the bulk density.
Properties:
cover: Snow areal coverage parameterizationdensity: Bulk snow density parameterizationthermal_conductivity: Snow thermal conductivity parameterizationhydraulic_properties: Snow hydraulic propertiesalbedo: Snow albedo parameterizationclosure: Snow energy-temperature closure
References
- [3] Tarboton, Chowdhury and Jackson (1994)
Terrarium.SnowEnergyTemperatureClosure — Type
struct SnowEnergyTemperatureClosure{NF} <: Terrarium.AbstractEnergyClosureEnergy–temperature closure for snow volumes. For SingleLayerSnow, the depth-averaged snow temperature T_snow (°C) and liquid water fraction θ_liq are recovered from the depth-integrated internal energy Ū_snow (J/m²) using the medium-agnostic FreeWater enthalpy relations, treating the bulk snowpack as an ice-water-air mixture. The internal energy is defined as:
\[U(T) = T_{ ext{snow}} \times C(T) - \rho_{snow} L_{sl} (1 - F(T))\]
with C(T) the temperature-dependent volumetric heat capacity of the snowpack (J/m³/K), ρ_snow L_sl = ρ_w L_sl θ the volumetric latent heat of fusion (J/m³), and F(T) = θ_liq/θ the fraction of the total (liquid water + ice) volumetric water content that is liquid.
Terrarium.SnowModel — Type
struct SnowModel{NF, GridType<:(Terrarium.AbstractLandGrid{NF}), Snow<:Terrarium.AbstractSnow{NF}, Atmosphere<:Terrarium.AbstractAtmosphere, Initializer<:Terrarium.AbstractInitializer, Timestepper<:Terrarium.AbstractTimeStepper{NF}} <: Terrarium.AbstractSnowModel{NF, GridType<:(Terrarium.AbstractLandGrid{NF})}Minimal standalone model of a single-layer snowpack, intended for unit and differentiability testing. Couples an AbstractSnow process with a prescribed atmosphere providing precipitation and air temperature. The surface and basal heat fluxes (surface_heat_flux, basal_heat_flux) and the sublimation rate are prescribed input fields; in a coupled land model these are supplied by the surface energy balance and the snow→soil conduction.
Properties:
grid::Terrarium.AbstractLandGrid: Spatial grid typesnow::Terrarium.AbstractSnow: Snow processesatmosphere::Terrarium.AbstractAtmosphere: Near-surface atmospheric conditionsconstants::PhysicalConstants: Physical constantsinitializer::Terrarium.AbstractInitializer: State variable initializertimestepper::Terrarium.AbstractTimeStepper: Time stepper: a singleAbstractTimeStepper(e.g.ForwardEuler,Heun) or anIMEX
Terrarium.SoilComposition — Type
struct SoilComposition{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 soilsaturation: Fraction of the soil pores occupied by water or iceliquid: Liquid (unfrozen) fraction of pore watersolid: Parameterization of the solid phase (matrix) of the soil
Terrarium.SoilComposition — Method
SoilComposition(; porosity, saturation, liquid, solid)
Validating keyword constructor for SoilVolume; enforces that porosity, saturation, and liquid lie in the unit interval.
Terrarium.SoilEnergyTemperatureClosure — Type
struct SoilEnergyTemperatureClosure <: Terrarium.AbstractEnergyClosureDefines the constitutive relationship between the the internal energy and temperature of a soil volume, i.e.
\[U(T) = T\times C(T) - \rho_w L_{sl} \theta (1 - F(T))\]
where T is temperature (°C), C(T) is the temperature-dependent heat capacity (J/m³/K), ρw L{sl} θ is the volumetric latent heat of fusion (J/m³), and F(T) = θ_w/θ is the constitutive relation between T and the unfrozen fraction of pore water with θ the sum of the volumetric fractions of water and ice. 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).
Terrarium.SoilEnergyWaterCarbon — Type
struct SoilEnergyWaterCarbon{NF, Stratigraphy<:Terrarium.AbstractStratigraphy{NF}, Energy<:Terrarium.AbstractSoilThermodynamics{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.
Terrarium.SoilHeatCapacities — Type
struct SoilHeatCapacities{NF}Properties:
water::Any: Volumetric heat capacity of waterice::Any: Volumetric heat capacity of iceair::Any: Volumetric heat capacity of airmineral::Any: Volumetric heat capacity of mineral soilorganic::Any: Volumetric heat capacity of organic soil
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 [4, Eq. (28-29)] formulation of field capacity and wilting point as a function of soil texture.
Properties:
swrc::Any: Soil water retention curveunsat_hydraulic_cond::Terrarium.AbstractUnsatK: Unsaturated hydraulic conductivity formulation; defaults tosaturated_conductivitysaturated_conductivity::Any: Hydraulic conductivity at saturationwilting_point_effect::Any: Linear coefficient of wilting point adjustment due to clay contentfield_capacity_effect::Any: Linear coefficient of field capacity adjustment due to clay contentfield_capacity_exp::Any: Exponent of field capacity adjustment due to clay contentresidual::Any: Residual (minimum) saturation level
References
- [4] Noilhan & Mahfouf, Global and Planetary Change (1996)
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:
vertical_flow::Terrarium.AbstractVerticalFlow: Soil water vertical flow operatorclosure::Terrarium.AbstractSoilWaterClosure: Closure relation for the soil hydrology statehydraulic_properties::Terrarium.AbstractSoilHydraulics: Soil hydraulic properties parameterizationvwc_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)
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.
Terrarium.SoilModel — Type
struct SoilModel{NF, GridType<:(Terrarium.AbstractLandGrid{NF}), Soil<:Terrarium.AbstractSoil{NF}, Initializer<:Terrarium.AbstractInitializer, Timestepper<:Terrarium.AbstractTimeStepper{NF}} <: 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 typesoil::Terrarium.AbstractSoil: Soil processesconstants::PhysicalConstants: Physical constantsinitializer::Terrarium.AbstractInitializer: State variable initializertimestepper::Terrarium.AbstractTimeStepper: Time stepper: a singleAbstractTimeStepper(e.g.ForwardEuler,Heun) or anIMEX
Terrarium.SoilMoistureResistanceFactor — Type
struct SoilMoistureResistanceFactor{NF} <: Terrarium.AbstractGroundEvaporationResistanceFactorImplements the soil moisture limiting resistance factor of [28],
\[\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$.
References
- [28] Lee and Pielke, Journal of Applied Meteorology (1992)
Terrarium.SoilPorositySURFEX — Type
struct SoilPorositySURFEX{NF} <: Terrarium.AbstractSoilPorosity{NF}SURFEX parameterization of mineral soil porosity [4, Eq. (27)].
References
- [4] Noilhan & Mahfouf, Global and Planetary Change (1996)
Terrarium.SoilSaturationPressureClosure — Type
struct SoilSaturationPressureClosure <: Terrarium.AbstractSoilWaterClosureRepresents 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.
Terrarium.SoilStratigraphy — Type
struct SoilStratigraphy{NF, N, Horizons<:NTuple{N, Terrarium.AbstractSoilHorizon{NF}}} <: Terrarium.AbstractStratigraphy{NF}Represents a soil stratigraphy as a stack of named soil horizons. Each soil horizon is assumed to have internally homogeneous soil properties. The number of horizons and their respective names are defined by the user.
Properties:
horizons::NTuple{N, Terrarium.AbstractSoilHorizon{NF}} where {NF, N}: Named tuple of soil horizons ordered from top to bottom
Terrarium.SoilTexture — Type
struct SoilTexture{NF}Represents soil texture as a fractional mixture of sand, silt, and clay.
Terrarium.SoilThermalConductivities — Type
struct SoilThermalConductivities{NF}Properties:
water::Any: Thermal conductivity of waterice::Any: Thermal conductivity of iceair::Any: Thermal conductivity of airquartz::Any: Thermal conductivity of quartz (sand) mineral grainsmineral::Any: Thermal conductivity of non-quartz (silt/clay) mineral grainsorganic::Any: Thermal conductivity of organic soil constituents
Default values from [34].
References
- [34] Hillel, Academic Press (1982)
Terrarium.SoilThermalProperties — Type
struct SoilThermalProperties{NF, FC, CondWeight, Cond}Properties:
conductivities::Any: Thermal conductivities for all constituentsconductivity_weighting::Any: Method for computing bulk thermal conductivity from constituentsheat_capacities::SoilHeatCapacities: Thermal conductivities for all constituentsfreezecurve::Any: Freezing characteristic curve needed for energy-temperature closure
Terrarium.SoilThermodynamics — Type
struct SoilThermodynamics{NF, HeatOperator<:Terrarium.AbstractHeatOperator, EnergyClosure<:Terrarium.AbstractEnergyClosure, ThermalProps<:(SoilThermalProperties{NF})} <: Terrarium.AbstractSoilThermodynamics{NF}Standard implementation of the soil thermal dynamics 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 operatorclosure::Terrarium.AbstractEnergyClosure: Closure relating energy and temperaturethermal_properties::SoilThermalProperties: Soil thermal properties
Terrarium.SpecificHumidity — Type
struct SpecificHumidity <: Terrarium.AbstractHumidityHumidity parameterization in which the near-surface specific humidity [kg/kg] is provided directly as an input field.
Terrarium.StateVariables — Type
struct StateVariables{NF, prognames, closurenames, auxnames, inputnames, nsnames, ProgFields, TendFields, AuxFields, InputFields, Namespaces, Cache, ClockType} <: Terrarium.AbstractStateVariablesContainer 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.
Terrarium.StateVariables — Method
StateVariables(
process::Terrarium.AbstractProcess{NF},
grid::Terrarium.AbstractLandGrid{NF};
...
) -> StateVariables{NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, Cache, ClockType} where {NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, Cache<:Terrarium.EmptyCache, ClockType<:(Clock{_A, _B, Float64, Int64, Int64} where {_A, _B})}
StateVariables(
process::Terrarium.AbstractProcess{NF},
grid::Terrarium.AbstractLandGrid{NF},
params;
clock,
input_variables,
timestepper,
boundary_conditions,
initializers,
fields
) -> StateVariables{NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, Cache, ClockType} where {NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, Cache<:Terrarium.EmptyCache, ClockType<:(Clock{_A, _B, Float64, Int64, Int64} where {_A, _B})}
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.
Terrarium.StateVariables — Method
StateVariables(
vars::Terrarium.Variables,
grid::Terrarium.AbstractLandGrid{NF};
clock,
timestepper,
model,
boundary_conditions,
initializers,
fields
) -> StateVariables{NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, Cache, Clock{Float64, Float64, Float64, Int64, Int64}} where {NF, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, Cache<:Terrarium.EmptyCache}
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. The timestepper's cache is allocated via initialize(timestepper, state, progvars).
Terrarium.StateVariables — Method
StateVariables(
model::Terrarium.AbstractModel{NF, Grid} where Grid<:(Terrarium.AbstractLandGrid{NF});
...
) -> StateVariables
StateVariables(
model::Terrarium.AbstractModel{NF, Grid} where Grid<:(Terrarium.AbstractLandGrid{NF}),
params;
clock,
input_variables,
boundary_conditions,
initializers,
fields
) -> StateVariables
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. The time stepper cache is allocated from the model's timestepper.
Terrarium.StaticExponentialRootDistribution — Type
struct StaticExponentialRootDistribution{NF} <: Terrarium.AbstractRootDistribution{NF}Static vegetation root distribution implementation in [16] based on the scheme proposed by [25]. 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 distributionb: Second empirical rate parameter for root distribution
References
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.
Terrarium.SurfaceEnergyModel — Type
struct SurfaceEnergyModel{NF, GridType<:(Terrarium.AbstractLandGrid{NF}), SEB<:Terrarium.AbstractSurfaceEnergyBalance, Atmosphere<:Terrarium.AbstractAtmosphere, Initializer<:Terrarium.AbstractInitializer, Timestepper<:Terrarium.AbstractTimeStepper{NF}} <: 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.
Terrarium.SurfaceHydrology — Type
struct SurfaceHydrology{NF, CanopyInterception<:Terrarium.AbstractCanopyInterception{NF}, Evapotranspiration<:Terrarium.AbstractEvapotranspiration{NF}, SurfaceRunoff<:Terrarium.AbstractSurfaceRunoff{NF}} <: Terrarium.AbstractSurfaceHydrology{NF}Default representation of coupled surface hydrology processes including canopy rain/snow interception, evapotranspiration, and surface runoff.
Properties:
canopy_interception: Canopy hydrology schemeevapotranspiration: Canopy evapotranspiration schemesurface_runoff: Surface runoff scheme
Terrarium.ThermodynamicConstants — Type
struct ThermodynamicConstants{NF} <: Thermodynamics.Parameters.AbstractThermodynamicsParameters{NF}Thermodynamic and atmospheric constants used in surface energy, turbulent flux, and vegetation process implementations. Subtypes AbstractThermodynamicsParameters so that it integrates directly with Thermodynamics.jl.
julia> show(ThermodynamicConstants(Float64))
ThermodynamicConstants{Float64}(1004.5, 2070.0, 4181.0, 1859.0, 333550.0, 2.5008e6, 2.83435e6, 273.16, 273.15, 273.16, 611.657, 287.0, 461.5)Properties:
specific_heat_capacity_dry_air: Isobaric specific heat capacity of dry air at standard pressure and 0°C in J/(m^3*K)specific_heat_capacity_ice: Isobaric specific heat capacity of ice at standard pressure and 0°C in J/(m^3*K)specific_heat_capacity_liquid_water: Isobaric specific heat capacity of liquid water at standard pressure and 0°C in J/(m^3*K)specific_heat_capacity_water_vapor: Isobaric specific heat capacity of water vapor at standard pressure and 0°C in J/(m^3*K)latent_heat_fusion: Specific latent heat of fusion of water in J/kg at 0°Clatent_heat_vaporization: Specific latent heat of vaporization of water in J/kg at 0°Clatent_heat_sublimation: Specific latent heat of sublimation of water in J/kg at 0°Ctemperature_reference: Reference temperature (0°C in Kelvin)temperature_water_freeze: Freezing temperature of water in Kelvintemperature_water_triple_point: Triple point temperature of water in Kelvinpressure_water_triple_point: Triple point pressure of water in Pagas_constant_dry_air: Specific gas constant of dry air in J/(kg*K)gas_constant_water_vapor: Specific gas constant of water vapor in J/(kg*K)
Terrarium.Timestepping — Type
abstract type TimesteppingTrait supertype classifying how a timestepper or prognostic variable is integrated in time, either Explicit or Implicit. See timestepping.
Terrarium.TracerGas — Type
Generic type representing the concentration of a particular tracer gas in the atmosphere.
Terrarium.UniformSpacing — Type
struct UniformSpacing{NF} <: Terrarium.AbstractVerticalSpacing{NF}Uniform vertical discretization with N layers of size Δz.
Properties:
Δz::AnyN::Int64
Terrarium.UniversalConstants — Type
struct UniversalConstants{NF}Universal physical constants used in surface energy and turbulent flux process implementations.
julia> show(UniversalConstants(Float64))
UniversalConstants{Float64}(9.80665, 5.6704e-8, 0.4)Properties:
gravitational_acceleration: Gravitational constant in m/s^2stefan_boltzmann_constant: Stefan-Boltzmann constant in J/(sm^2K^4)von_karman_constant: von Kármán constant
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).
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, following the van Genuchten formulation [7] extended with an ice impedance factor [8].
References
Terrarium.ValType — Type
Alias for Type{Val{x}}
Terrarium.VarPath — Type
VarPathType alias for namespaced variable paths of the form (namespace_1, ..., namespace_N, varname). Used to specify the location of variables in nested namespaces.
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.
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.
Terrarium.VegetationCarbonCycle — Type
struct VegetationCarbonCycle{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}, PAW<:Union{Nothing, Terrarium.AbstractPlantAvailableWater}} <: Terrarium.AbstractVegetation{NF}Coupled process type representing the major carbon cycle processes for natural vegetation.
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}), Initializer<:Terrarium.AbstractInitializer, Timestepper<:Terrarium.AbstractTimeStepper{NF}} <: 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 typeatmosphere::Terrarium.AbstractAtmosphere: Atmospheric input configurationvegetation::Terrarium.AbstractVegetation: Vegetation processesconstants::PhysicalConstants: Physical constantsinitializer::Terrarium.AbstractInitializer: State variable initializertimestepper::Terrarium.AbstractTimeStepper: Time stepper: a singleAbstractTimeStepper(e.g.ForwardEuler,Heun) or anIMEX
Terrarium.WeightedAverage — Type
struct WeightedAverage <: Terrarium.AbstractBulkWeightingSimple weighted average formula for computing bulk quantities:
\[\bar{x} = \sum_{i=1}^N \theta_i x_i\]
Terrarium.XY — Type
XY <: VarDimsIndicator type for variables that should be assigned a 2D (lateral only) field on their associated grid.
Terrarium.XYZ — Type
XYZ <: VarDimsIndicator type for variables that should be assigned a 3D field on their associated grid.
Terrarium.AbstractForcing — Type
Type alias for a UnionAll over DiscreteForcing and ContinuousForcing types from Oceananigans.
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.)
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.
Terrarium.UnitInterval — Constant
Alias for DomainSets.UnitInterval()