Reference
Contents
Index
TethysChlorisCore.ModelComponents.AbstractAuxiliaryVariableSetTethysChlorisCore.ModelComponents.AbstractAuxiliaryVariablesTethysChlorisCore.ModelComponents.AbstractForcingInputSetTethysChlorisCore.ModelComponents.AbstractForcingInputsTethysChlorisCore.ModelComponents.AbstractHeightDependentAuxiliaryVariablesTethysChlorisCore.ModelComponents.AbstractHeightDependentForcingInputsTethysChlorisCore.ModelComponents.AbstractHeightDependentModelComponentTethysChlorisCore.ModelComponents.AbstractHeightDependentParametersTethysChlorisCore.ModelComponents.AbstractHeightDependentStateVariablesTethysChlorisCore.ModelComponents.AbstractIndividualModelComponentTethysChlorisCore.ModelComponents.AbstractModelComponentTethysChlorisCore.ModelComponents.AbstractModelComponentSetTethysChlorisCore.ModelComponents.AbstractParameterSetTethysChlorisCore.ModelComponents.AbstractParametersTethysChlorisCore.ModelComponents.AbstractStateVariableSetTethysChlorisCore.ModelComponents.AbstractStateVariablesTethysChlorisCore.ODEOptionsTethysChlorisCore.StreamTaskTethysChlorisCore.TimeBuffersTethysChlorisCore.TimeEntryTethysChlorisCore.VariableSpecTethysChlorisCore.ZeroFindingStrategiesTethysChlorisCore.SimpleBrentStrategyTethysChlorisCore._default_tolerances_simpleTethysChlorisCore.add_variable!TethysChlorisCore.assign_average_slice!TethysChlorisCore.assign_slice!TethysChlorisCore.axis_namesTethysChlorisCore.cell_statsTethysChlorisCore.check_extraneous_fieldsTethysChlorisCore.chunksizesTethysChlorisCore.domain_statsTethysChlorisCore.find_rootTethysChlorisCore.flush_buffers!TethysChlorisCore.flush_tasks!TethysChlorisCore.get_calculated_fieldsTethysChlorisCore.get_dimensionsTethysChlorisCore.get_optional_fieldsTethysChlorisCore.get_required_fieldsTethysChlorisCore.init_buffers!TethysChlorisCore.initializeTethysChlorisCore.initialize_fieldTethysChlorisCore.make_taskTethysChlorisCore.output_specsTethysChlorisCore.outputs_to_saveTethysChlorisCore.preprocess_fieldsTethysChlorisCore.preprocess_fieldsTethysChlorisCore.storage_frequencyTethysChlorisCore.storage_sizeTethysChlorisCore.store_buffer!TethysChlorisCore.store_task!TethysChlorisCore.validate_fields
Core Documentation
TethysChlorisCore.ODEOptions — Type
ODEOptions <: AbstractODEOptionsFields
abstol::AbstractFloat: Absolute tolerance for the ODE solver (default: 1e-6)reltol::AbstractFloat: Relative tolerance for the ODE solver (default: 1e-3)
Notes
The default values for the absolute and relative tolerances are chosen to replicate the behavior of the MATLAB odeset defaults.
TethysChlorisCore.StreamTask — Type
StreamTaskPrecomputed per-variable save task for a manager's flat hot loop: the source instance, the extractor, the slot buffer and the NetCDF variable handle are all captured at task-creation time. The per-timestep loop then does one call per task — no reflection, no dict lookups, no string allocation.
A task set is stepped as for t in tasks; x = t.extract(t.source); isnothing(x) || store_task!(t, x, slot); end and flushed with flush_tasks!. make_task builds tasks from variable handles.
Fields
source: component-set instance supplying the valuesextract:x -> valuefor the source instancebuf: slot buffer, shaped by the variable layoutvar: target NetCDF variabletimelast::Bool:truewhen the time-like dimension of the variable is trailing
TethysChlorisCore.TimeBuffers — Type
TimeBuffers(; buffer_len = 32)In-memory per-variable step buffers for streamed NetCDF writing. Writing hundreds of small NetCDF variables at every timestep is prohibitive with the HDF5 backend, so values are buffered for at most buffer_len timesteps and written chunk-wise. Entries are allocated lazily on first store_buffer! (or in advance with init_buffers!).
Fields
buffers::Dict{Tuple{String,Symbol},TimeEntry}: buffer entry per variablebuffer_len::Int: number of buffered timesteps per flushfill::Int: slots filled since the last flush
TethysChlorisCore.TimeEntry — Type
TimeEntry{V}Single slot buffer for one streamed variable: the in-RAM buffer plus its layout.
Fields
buf::V: slot buffer; variables whose time-like dimension comes first are shaped(buffer_len, dims...), variables with a trailingtime/naverdimension are shaped(dims..., buffer_len)timelast::Bool:truewhen the time-like dimension of the variable is trailing
TethysChlorisCore.VariableSpec — Type
VariableSpecSpecification of a single output variable streamed by the writers built on this module.
Fields
name::Symbol: NetCDF variable namegroup::Symbol: component/subsystem of the source (e.g.:hydrologic,:meteorological)source::Symbol: top-level source set (e.g.:state,:auxiliary,:forcing,:parameters,:derived)dims::Vector{Symbol}: trailing dimensions of the saved values, left empty by the spec enumeration and filled from the extracted shapesacc_op::Symbol::mean|:sumaccumulation of time-average-style groupsextractor::Function:x -> raw field valuefor a component-set instancex
TethysChlorisCore.ZeroFindingStrategies — Type
ZeroFindingStrategies{M} <: AbstractZeroFindingStrategiesFields
method::M: Method for root findingkwargs::NamedTuple: Keyword arguments for the root finding method
Example
strategy = SimpleBrentStrategy(Float64; abstol=1e-8, reltol=1e-6, maxiters=500)TethysChlorisCore.SimpleBrentStrategy — Method
function SimpleBrentStrategy(
::Type{FT};
abstol::Union{FT,Missing}=missing,
reltol::Union{FT,Missing}=missing,
maxiters::Union{Signed,Missing}=missing,
) where {FT<:AbstractFloat}Creates a ZeroFindingStrategies object using the Simple Brent method from the BracketingNonlinearSolve.jl package.
Arguments
::Type{FT}: Floating point type for the root finding method (e.g.,Float32orFloat64)abstol::Union{FT,Missing}: Absolute tolerance for the root finding. Ifmissing, the default value for the method is used.reltol::Union{FT,Missing}: Relative tolerance for the root finding. Ifmissing, the default value for the method is used.maxiters::Union{Signed,Missing}: Maximum number of iterations. Ifmissing, the default value for the method is used.
TethysChlorisCore._default_tolerances_simple — Method
default_tolerances(
method::M,
::Type{FT},
) where {FT<:AbstractFloat}Get default tolerances for SimpleNonlinearSolve.jl and BracketingNonlinearSolve.jl methods. The default tolerances are hard-coded based on the documentation of NonlinearSolve.jl.
Arguments
method::M: The root-finding method::Type{FT}: Floating point type
Returns
(abstol, reltol, maxiters): Tuple containing the default absolute tolerance, relative tolerance, and maximum iterations
TethysChlorisCore.add_variable! — Method
add_variable!(parent, name, FT, dims; chunksizes, compress, attrib, fillvalue)Add a NetCDF variable with NaN fill value. Variable-dependent dimensions must exist beforehand; an unlimited time or naver dimension switches storage to chunked with the given chunksizes, and compress enables deflate level 4.
TethysChlorisCore.assign_average_slice! — Method
assign_average_slice!(var, acc, idx, reshape_dims...)Reshape the accumulator acc to reshape_dims and assign it into variable var at index idx of its trailing (naver-like) dimension.
TethysChlorisCore.assign_slice! — Method
assign_slice!(v, x, tidx)Assign one value or slice of x into variable v at index tidx, dispatching on the rank of x for variables whose time dimension comes first.
TethysChlorisCore.axis_names — Method
axis_names(shape; known = (;)) -> Vector{Symbol}Trailing axis symbols for a value of shape shape. known is an ordered name-length named tuple; each axis takes the first unused name whose length matches, otherwise axisL. Names never repeat within one variable. The axes are supplied by the caller (e.g. model attributes such as layer and crown-area counts), so no axis naming is hardcoded here.
TethysChlorisCore.cell_stats — Method
cell_stats(vals, ::Type{FT}) -> (mean, std)NaN-aware mean and standard deviation (N−1) of a vector.
TethysChlorisCore.check_extraneous_fields — Method
check_extraneous_fields(::Type{T}, data::Dict{String,Any}) where {T<:AbstractModelComponent}Check if the input dictionary contains any keys that are not part of the required fields for type T.
Arguments
T: Type of model component to check fields againstdata: Dictionary containing fields to validaterequired_fields: List of required fields for the model component. This is typically obtained fromget_required_fields(T)orfieldnames(T)
Throws
ArgumentError: If any extraneous keys are found in the data dictionary
TethysChlorisCore.chunksizes — Method
chunksizes(dimspecs; time_chunk = 32, naver_chunk = 1) -> TupleChunk sizes for a NetCDF variable whose dimensions are given as ordered (name, size) pairs. Dimensions named :time or :days (unlimited) get time_chunk; dimensions named :naver get naver_chunk.
TethysChlorisCore.domain_stats — Method
domain_stats(values, ::Type{FT}) -> (means, stds)NaN-aware means and standard deviations (N−1) of an array reduced over its first (instance) axis. Scalar inputs return a single pair.
TethysChlorisCore.find_root — Method
find_root(
f,
x0,
strategy::ZeroFindingStrategies{M};
search_range = 10.0,
) where {M}Wrapper function to find a root of the function f using the specified strategy, given an initial guess x0. Current implementation uses bracketing-based SimpleNonlinearSolve.jl` strategies.
Arguments
f: Function for which to find a rootx0: Initial guess for the rootstrategy::ZeroFindingStrategies{M}: Strategy for root findingsearch_range: Optional search range for bracketing methods (default:nothing)
TethysChlorisCore.flush_buffers! — Method
flush_buffers!(tb, getvar, window) -> BoolWrite all buffered values into their NetCDF variables. getvar(group, name) returns the variable handle; window is the timestep range covered by the buffered slots. The entries are kept allocated and reused across flushes; every store overwrites the full slot, so stale slots are never flushed. Returns whether anything was flushed.
TethysChlorisCore.flush_tasks! — Method
flush_tasks!(tasks, window) -> BoolWrite every task's buffered slots into its NetCDF variable; window is the timestep range covered by the buffered slots. Returns whether anything was flushed.
TethysChlorisCore.get_calculated_fields — Method
get_calculated_fields(::Type{T}) where {T<:AbstractModelComponent}Get a list of calculated fields for a given model component type. Calculated fields are those that are computed based on other fields and should not be provided when creating a model component. By default, returns an empty list. Components should override this method if they have calculated fields.
Arguments
T: Type of model component to get calculated fields for
Returns
Vector{Symbol}: List of calculated field names
TethysChlorisCore.get_dimensions — Method
get_dimensions(::Type{T}, data) where {T<:AbstractModelComponent}Return a dictionary of dimension specifications for a given model component type. By default returns an empty dictionary. This method should be overridden by concrete types to specify their required dimensions.
Arguments
T: Type of the model componentdata: Data source containing dimension information
Returns
Dict: Dictionary mapping variable names to their dimension specifications
TethysChlorisCore.get_optional_fields — Method
get_optional_fields(::Type{T}) where {T<:AbstractModelComponent}Get a list of optional fields for a given model component type. Optional fields are those that can be omitted when creating a model component. By default, returns an empty list. Components should override this method if they have optional fields.
Arguments
T: Type of model component to get optional fields for
Returns
Vector{Symbol}: List of optional field names
TethysChlorisCore.get_required_fields — Method
get_required_fields(::Type{T}) where {T<:AbstractModelComponent}Returns an empty array of symbols representing required fields for a given AbstractModelComponent type. This is a default method that can be specialized for specific subtypes that need to define their own required fields.
Returns
Vector{Symbol}: A vector of symbols with the fields required to initialize the AbstractModelComponent type
TethysChlorisCore.init_buffers! — Method
init_buffers!(tb, getvar, keys, ::Type{FT})Allocate the buffer entries of all keys in advance; lazily allocated otherwise on first store_buffer!. Already initialized entries are left untouched.
TethysChlorisCore.initialize — Method
initialize(
::Type{FT}, ::Type{T}, data, params::Tuple=(FT,), args...
) where {FT<:AbstractFloat, T<:AbstractModelComponent}Initialize model components with optional fields. The model component requires a keyword constructor.
Arguments
::Type{FT}: Floating point precision type (e.g., Float32 or Float64)::Type{T}: Component type constructor that subclasses AbstractModelComponentdata: Data source (e.g., Dict for Parameters, NCDataset for State/Auxiliary variables)params: Tuple of parameters for the model componentargs...: Additional arguments passed to preprocess_fields
Returns
T{FT}: Initialized component struct of type T with floating point precision FT
TethysChlorisCore.initialize_field — Method
initialize_field(
::Type{FT},
data::NCDataset,
name::String,
dims::Tuple;
default::Union{Nothing,Number} = nothing
) where {FT<:AbstractFloat}Initialize a field array with specified dimensions and optionally set initial conditions.
Arguments
FT: Float type to use for the field array (e.g., Float32, Float64)data: NCDataset containing source dataname: Name of the variable in the datasetdims: Tuple specifying the dimensions of the field arraydefault: Optional default value to use if no initial condition is found
Returns
Array{FT}: Initialized array with the specified dimensions, filled with initial conditions if available
TethysChlorisCore.make_task — Method
make_task(getvar, group, name, source, extract, buffer_len, ::Type{FT}) -> StreamTaskBuild a StreamTask for variable (group, name), allocating its slot buffer eagerly from the variable's shape.
TethysChlorisCore.output_specs — Method
output_specs(::Type{T}, ::Type{OL}; source = :state) -> Vector{VariableSpec}Enumerate the VariableSpecs that the outputs_to_save traits select for the component set type T at output level OL (pass the level instance type, e.g. AllOutputs, NoBiogeochemistryOutputs).
The traversal is generic over any user-defined set: define outputs_to_save for the set type and its nested components to select which fields to save. Fields of components with both a high and a low field receive the _H/_L suffixes. Components with no outputs_to_save defined for the level are skipped (strict mode). On name collisions between output levels, the less restrictive level wins (decreasing recursion order).
The returned extractors take a component-set instance and return the raw field value; the trailing dims are left empty for the writer to fill from the shapes. Boolean, string and other non-numeric leaves are left to the writer to drop.
TethysChlorisCore.outputs_to_save — Method
outputs_to_save(::Type{T}, ::Type{O}) where {T, O <: AbstractOutputsToSave}Get the outputs to save for type T corresponding to the outputs level O.
This function is called recursively at each level of the type hierarchy to enable fine-grained control over which fields to save. For types with height-dependent structure (containing both :high and :low fields), this function is called at multiple levels:
- At the parent level: returns which components to include (e.g.,
(:scalar_field, :high, :low)) - At the height-dependent level: returns which fields from the nested type (e.g.,
(:field1,))
The accessor system uses these specifications to create accessor functions with appropriate suffixes for height-dependent fields (_H for high, _L for low).
Arguments
T::Type{T}: The model component typeO::Type{O}: The outputs to save type (subtype ofAbstractOutputsToSave)
Returns
Tuple{Vararg{Symbol}}: Tuple of field names to save from typeT- Empty tuple
()means no fields from this type (strict mode: no accessors created)
Strict Mode
If outputs_to_save returns () for a type that has been selected at a parent level, no accessors will be created for that component. This requires explicit specification of which fields to save at each level of the hierarchy.
Examples
# Example type hierarchy
struct HeightDependentHydrologicStateVariables{FT}
field1::Vector{FT}
field2::Vector{FT}
field3::Vector{FT}
end
struct HydrologicStateVariables{FT}
scalar_field::Vector{FT}
high::HeightDependentHydrologicStateVariables{FT}
low::HeightDependentHydrologicStateVariables{FT}
end
struct StateVariableSet{FT}
hydrologic::HydrologicStateVariables{FT}
end
# Define output levels
struct SimpleOutputs <: AbstractOutputsToSave end
struct ExtendedOutputs <: AbstractOutputsToSave end
# Level 1: Select which top-level components
outputs_to_save(::Type{StateVariableSet}, ::Type{SimpleOutputs}) = (:hydrologic,)
# Level 2: Select which fields from the component (including :high, :low)
outputs_to_save(::Type{HydrologicStateVariables}, ::Type{SimpleOutputs}) =
(:scalar_field, :high, :low)
# Level 3: Select which fields from height-dependent component
outputs_to_save(::Type{HeightDependentHydrologicStateVariables}, ::Type{SimpleOutputs}) =
(:field1,)
# For ExtendedOutputs, include more fields at level 3
outputs_to_save(::Type{HeightDependentHydrologicStateVariables}, ::Type{ExtendedOutputs}) =
(:field1, :field2)
# Result for SimpleOutputs:
# Dict(:hydrologic => Dict(:scalar_field => fn, :field1_H => fn, :field1_L => fn))
# Result for ExtendedOutputs:
# Dict(:hydrologic => Dict(:scalar_field => fn, :field1_H => fn, :field1_L => fn,
# :field2_H => fn, :field2_L => fn))Independent Control
Direct fields (not in :high/:low) and height-dependent fields can be controlled independently:
# Include only direct fields, no height layers
outputs_to_save(::Type{HydrologicStateVariables}, ::Type{DirectOnly}) = (:scalar_field,)
# Include only height layers, no direct fields
outputs_to_save(::Type{HydrologicStateVariables}, ::Type{HeightOnly}) = (:high, :low)
outputs_to_save(::Type{HeightDependentHydrologicStateVariables}, ::Type{HeightOnly}) = (:field1,)
# Include only high layer, not low
outputs_to_save(::Type{HydrologicStateVariables}, ::Type{HighOnly}) = (:scalar_field, :high)
outputs_to_save(::Type{HeightDependentHydrologicStateVariables}, ::Type{HighOnly}) = (:field1,)Note
This function is expected to be overloaded for specific types and output levels. The default implementation returns an empty tuple ().
TethysChlorisCore.preprocess_fields — Method
preprocess_fields(::Type{FT}, ::Type{T}, data, args...) where {FT<:AbstractFloat,T<:AbstractModelComponent}Preprocess fields before the initialization of a given AbstractModelComponent type.
Arguments
FT: Type parameter for floating point precisionT: Type parameter for model componentsdata: Input data to be preprocessedparams: Tuple of parameters for the model componentargs...: Additional arguments
Returns
- Returns the input data without modifications
This is a default implementation that passes through the input data unchanged. Custom preprocessing can be implemented by defining methods for specific types.
TethysChlorisCore.preprocess_fields — Method
preprocess_fields(
::Type{FT},
::Type{T},
data::NCDataset
) where {FT<:AbstractFloat,T<:AbstractAuxiliaryVariables}Initialize fields for auxiliary variables based on their dimension specifications.
Arguments
FT: Float type to use for the fieldsT: Type of auxiliary variablesdata: NCDataset containing the source data
Returns
Dict{String,Any}: Dictionary of initialized fields
TethysChlorisCore.storage_frequency — Method
storage_frequency(::Type{T}) where {T <: AbstractModelComponent}Return the storage frequency for component type T.
This trait function determines how often component outputs should be stored during simulation. Components can be stored at different temporal frequencies:
HourlyStorage(): Store values every timestep (hourly data)DailyStorage(): Store values once per day (daily aggregates)NoStorage(): Do not store this component (default)
Default Behavior
By default, components return NoStorage(), implementing an opt-in approach where only components with explicitly defined storage frequencies will be saved.
Examples
# Define storage frequency for specific component types
storage_frequency(::Type{HydrologicState}) = hourly_storage
storage_frequency(::Type{VegetationState}) = daily_storage
storage_frequency(::Type{AuxiliaryVariables}) = no_storage # Not stored
# Components without explicit definitions default to no_storage
storage_frequency(::Type{SomeOtherComponent}) # Returns no_storageTethysChlorisCore.storage_size — Method
storage_size(frequency::AbstractStorageFrequency, n_timesteps::Int) -> IntCalculate the required array size based on storage frequency and total timesteps.
Arguments
frequency::AbstractStorageFrequency: The storage frequency (Hourly, Daily, or NoStorage)n_timesteps::Int: Total number of hourly timesteps in the simulation
Returns
Int: The required array size for the given frequency
Sizing Logic
HourlyStorage:n_timesteps(one entry per hourly timestep)DailyStorage:div(n_timesteps, 24, RoundUp) + 2(one entry per day plus buffer)NoStorage:0(no storage needed)
Daily Storage Buffer
The +2 buffer in daily storage provides extra space for:
- Index 1: Initialization values
- Index N+1: Boundary/final day handling
This matches the pattern used in TethysChloris.jl for consistency.
Examples
# Hourly storage for 720 timesteps (30 days)
storage_size(HourlyStorage(), 720) # Returns 720
# Daily storage for 720 timesteps (30 days)
storage_size(DailyStorage(), 720) # Returns 32 (30 days + 2 buffer)
# Daily storage for 721 timesteps (30 days + 1 hour)
storage_size(DailyStorage(), 721) # Returns 33 (31 days + 2 buffer, rounded up)
# No storage
storage_size(NoStorage(), 1000) # Returns 0TethysChlorisCore.store_buffer! — Method
store_buffer!(tb, getvar, group, name, x, slot, ::Type{FT})Store one value for variable (group, name) in the buffer at slot slot. The entry is fetched through a single dictionary lookup; the variable handle is only used through getvar(group, name) on lazily-init (shape and layout).
TethysChlorisCore.store_task! — Method
store_task!(t::StreamTask, x, slot)Store the step value x for the task into its buffer at slot slot.
TethysChlorisCore.validate_fields — Method
validate_fields(::Type{T}, data) where {T<:AbstractModelComponent}
validate_fields(::Type{T}, data::Dict{String,Any}) where {T<:AbstractModelComponent}Performs some checks on the fields passed to initialize the AbstractModelComponent type.
Returns
nothing: If all fields are valid, the function returns nothing
Model Components
TethysChlorisCore.ModelComponents.AbstractModelComponent — Type
AbstractModelComponent{FT<:AbstractFloat}The base abstract type for all model components. Parametrized by the floating-point type FT used for numerical calculations.
TethysChlorisCore.ModelComponents.AbstractIndividualModelComponent — Type
AbstractIndividualModelComponent{FT<:AbstractFloat} <: AbstractModelComponent{FT}Abstract type for individual model components that represent discrete entities in the model. These components operate on single points or objects without height-dependency.
Subtypes include parameters, state variables, forcing inputs, and auxiliary variables for individual model elements.
TethysChlorisCore.ModelComponents.AbstractHeightDependentModelComponent — Type
AbstractHeightDependentModelComponent{FT<:AbstractFloat} <: AbstractIndividualModelComponent{FT}Abstract type for model components that vary with height or depth in a vertical profile. These components represent quantities that change along a vertical dimension and typically contain values at different height/depth levels.
TethysChlorisCore.ModelComponents.AbstractModelComponentSet — Type
AbstractModelComponentSet{FT<:AbstractFloat} <: AbstractModelComponent{FT}Abstract type for collections of related model components. Component sets group multiple individual components of the same category together, providing organization and encapsulation of related model elements.
Auxiliary variables
TethysChlorisCore.ModelComponents.AbstractAuxiliaryVariables — Type
AbstractAuxiliaryVariables{FT<:AbstractFloat} <: AbstractIndividualModelComponent{FT}Abstract type for auxiliary variables that provide additional information or intermediate calculations in the model. These variables are not part of the core model state but are used to support model calculations.
See AbstractAuxiliaryVariableSet for an example of usage.
TethysChlorisCore.ModelComponents.AbstractHeightDependentAuxiliaryVariables — Type
AbstractHeightDependentAuxiliaryVariables{FT<:AbstractFloat} <: AbstractHeightDependentModelComponent{FT}Abstract type for height-dependent auxiliary variables. These variables provide additional information or intermediate calculations that vary with height in the model.
See AbstractAuxiliaryVariableSet for an example of usage.
TethysChlorisCore.ModelComponents.AbstractAuxiliaryVariableSet — Type
AbstractAuxiliaryVariableSet{FT<:AbstractFloat} <: AbstractModelComponentSet{FT}Abstract type for collections of auxiliary variables. Auxiliary variable groups multiple auxiliary variables together, providing organization and encapsulation of related model elements.
Examples
Base.@kwdef struct HeightDependentHydrologicStateVariables{FT<:AbstractFloat} <:
AbstractHeightDependentModelComponent{FT}
An::Matrix{FT} # Net CO₂ assimilation [μmol m⁻² s⁻¹]
Dr::Matrix{FT} # Root distribution [-]
end
Base.@kwdef struct HydrologicAuxiliaryVariables{FT<:AbstractFloat} <:
AbstractAuxiliaryVariables{FT}
high::HeightDependentHydrologicStateVariables{FT}
low::HeightDependentHydrologicStateVariables{FT}
alp_soil::Vector{FT} # Soil albedo [-]
b_soil::Vector{FT} # Soil retention curve parameter [-]
end
Base.@kwdef struct BiogeochemistryAuxiliaryVariables{FT<:AbstractFloat} <:
AbstractAuxiliaryVariables{FT}
BLit::Matrix{FT}
NavlI::Matrix{FT}
end
Base.@kwdef struct AuxiliaryVariableSet{FT<:AbstractFloat} <:
AbstractAuxiliaryVariableSet{FT}
hydrologic::HydrologicAuxiliaryVariables{FT}
biogeochemistry::BiogeochemistryAuxiliaryVariables{FT}
endForcing inputs
TethysChlorisCore.ModelComponents.AbstractForcingInputs — Type
AbstractForcingInputs{FT<:AbstractFloat} <: AbstractIndividualModelComponent{FT}Abstract type for forcing inputs that drive the model. Forcing inputs represent external factors that influence the model behavior, such as meteorological or anthropogenic data.
See AbstractForcingInputSet for an example of usage.
TethysChlorisCore.ModelComponents.AbstractHeightDependentForcingInputs — Type
AbstractHeightDependentForcingInputs{FT<:AbstractFloat} <: AbstractHeightDependentModelComponent{FT}Abstract type for height-dependent forcing inputs. These inputs vary with height or depth in the model and control the behavior of the model at different levels.
See AbstractForcingInputSet for an example of usage.
TethysChlorisCore.ModelComponents.AbstractForcingInputSet — Type
AbstractForcingInputSet{FT<:AbstractFloat} <: AbstractModelComponentSet{FT}Abstract type for collections of forcing inputs. Forcing input sets group multiple forcing inputs together, providing organization and encapsulation of related model elements.
Examples
Base.@kwdef struct AnthropogenicInputs{FT<:AbstractFloat} <: AbstractForcingInputs{FT}
Salt::Vector{FT} # Salt concentration
IrD::Vector{FT} # Drip irrigation
end
Base.@kwdef struct MeteorologicalInputs{FT<:AbstractFloat} <: AbstractForcingInputs{FT}
Pr::Vector{FT} # Precipitation
Ta::Vector{FT} # Air temperature at reference height
Ws::Vector{FT} # Wind speed at reference height
end
Base.@kwdef struct ForcingInputSet{FT<:AbstractFloat} <: AbstractForcingInputSet{FT}
anthropogenic::AnthropogenicInputs{FT}
meteorological::MeteorologicalInputs{FT}
endParameters
TethysChlorisCore.ModelComponents.AbstractParameters — Type
AbstractParameters{FT<:AbstractFloat} <: AbstractIndividualModelComponent{FT}Abstract type for model parameters that define the model structure and behavior. Parameters are fixed values or coefficients that control the model dynamics.
See AbstractParameterSet for an example of usage.
TethysChlorisCore.ModelComponents.AbstractHeightDependentParameters — Type
AbstractHeightDependentParameters{FT<:AbstractFloat} <: AbstractHeightDependentModelComponent{FT}Abstract type for height-dependent model parameters. These parameters vary with height or depth in the model and control the behavior of the model at different levels.
See AbstractParameterSet for an example of usage.
TethysChlorisCore.ModelComponents.AbstractParameterSet — Type
AbstractParameterSet{FT<:AbstractFloat} <: AbstractModelComponentSet{FT}Abstract type for collections of model parameters. Parameter sets group multiple parameters together, providing organization and encapsulation of related model elements.
Examples
Base.@kwdef struct SoilParameters{FT<:AbstractFloat} <: AbstractParameters{FT}
Osat::FT # Saturation moisture 0 kPa
Ohy::FT # Hygroscopic Moisture Evaporation cessation 10000 kPa
end
Base.@kwdef struct HeightDependentVegetationParameters{FT<:AbstractFloat} <:
AbstractHeightDependentParameters{FT}
Knit::FT # Canopy nitrogen decay coefficient
FI::FT # Intrinsic quantum efficiency
end
Base.@kwdef struct VegetationParameters{FT<:AbstractFloat} <: AbstractParameters{FT}
high::HeightDependentParameters{FT}
low::HeightDependentParameters{FT}
KcI::FT # Interception drainage rate coefficient.
Sllit::FT # Specific leaf area of litter
end
Base.@kwdef struct ParameterSet{FT<:AbstractFloat} <: AbstractParameterSet{FT}
soil::SoilParameters{FT}
vegetation::VegetationParameters{FT}
endState variables
TethysChlorisCore.ModelComponents.AbstractStateVariables — Type
AbstractStateVariables{FT<:AbstractFloat} <: AbstractIndividualModelComponent{FT}Abstract type for model state variables that represent the internal state of the model. State variables are dynamic quantities that change over time and are used to track the model evolution.
See AbstractStateVariableSet for an example of usage.
TethysChlorisCore.ModelComponents.AbstractHeightDependentStateVariables — Type
AbstractHeightDependentStateVariables{FT<:AbstractFloat} <: AbstractHeightDependentModelComponent{FT}Abstract type for height-dependent model state variables. These variables represent the internal state of the model that varies with height or depth in the model.
See AbstractStateVariableSet for an example of usage.
TethysChlorisCore.ModelComponents.AbstractStateVariableSet — Type
AbstractStateVariableSet{FT<:AbstractFloat} <: AbstractModelComponentSet{FT}Abstract type for collections of model state variables. State variable sets group multiple state variables together, providing organization and encapsulation of related model elements.
Examples
Base.@kwdef struct HydrologicStateVariables{FT<:AbstractFloat} <:
AbstractStateVariables{FT}
V::Matrix{FT} # Liquid water volume [mm]
Tdp::Matrix{FT} # Soil temperature [°C]
end
Base.@kwdef struct HeightDependentVegetationStateVariables{FT<:AbstractFloat} <:
AbstractHeightDependentModelComponent{FT}
AgeDL::Matrix{FT} # Average age of dead leaves
B::Matrix{FT} # Biomass/carbon pools
end
Base.@kwdef struct VegetationStateVariables{FT<:AbstractFloat} <:
AbstractStateVariables{FT}
high::HeightDependentVegetationStateVariables{FT}
low::HeightDependentVegetationStateVariables{FT}
end
Base.@kwdef struct StateVariableSet{FT<:AbstractFloat} <:
AbstractStateVariableSet{FT}
hydrologic::HydrologicStateVariables{FT}
vegetation::VegetationStateVariables{FT}
end