Shared Utilities
Domains
ClimaLand.Domains.AbstractDomain
— TypeAbstractDomain{FT <:AbstractFloat}
An abstract type for domains.
The domain structs typically hold information regarding the bounds of the domain, the boundary condition type (periodic or not), and the spatial discretization.
Additionally, the domain struct holds the relevant spaces for that domain. For example, a 3D domain holds the center space (in terms of finite difference - the space corresponding to the centers of each element), and the top face space where surface fluxes are computed.
Missing docstring for ClimaLand.Domains.AbstractLSMDomain
. Check Documenter's build log for details.
ClimaLand.Domains.SphericalShell
— Typestruct SphericalShell{FT} <: AbstractDomain{FT}
radius::FT
depth::FT
dz_tuple::Union{Tuple{FT, FT}, Nothing}
nelements::Tuple{Int, Int}
npolynomial::Int
end
A struct holding the necessary information to construct a domain, a mesh, a 2d spectral element space (non-radial directions) x a 1d finite difference space (radial direction), and the resulting coordinate field.
space
is a NamedTuple holding the surface space (in this case, the top face space) and the center space for the subsurface. These are stored using the keys :surface and :subsurface.
Fields
radius
: The radius of the shelldepth
: The radial extent of the shelldz_tuple
: Tuple for mesh stretching specifying target (dzbottom, dztop) (m). If nothing, no stretching is applied.nelements
: The number of elements to be used in the non-radial and radial directionsnpolynomial
: The polynomial order to be used in the non-radial directionsspace
: A NamedTuple of associated ClimaCore spaces: in this case, the surface space and subsurface center space
ClimaLand.Domains.SphericalSurface
— Typestruct SphericalSurface{FT} <: AbstractDomain{FT}
radius::FT
nelements::Tuple{Int, Int}
npolynomial::Int
end
A struct holding the necessary information to construct a domain, a mesh, a 2d spectral element space (non-radial directions) and the resulting coordinate field.
space
is a NamedTuple holding the surface space (in this case, the entire SphericalSurface space).
Fields
radius
: The radius of the surfacenelements
: The number of elements to be used in the non-radial directionsnpolynomial
: The polynomial order to be used in the non-radial directionsspace
: A NamedTuple of associated ClimaCore spaces: in this case, the surface (SphericalSurface) space
ClimaLand.Domains.HybridBox
— Typestruct HybridBox{FT} <: AbstractDomain{FT}
xlim::Tuple{FT, FT}
ylim::Tuple{FT, FT}
zlim::Tuple{FT, FT}
dz_tuple::Union{Tuple{FT, FT}, Nothing}
nelements::Tuple{Int, Int, Int}
npolynomial::Int
periodic::Tuple{Bool, Bool}
end
A struct holding the necessary information to construct a domain, a mesh, a 2d spectral element space (horizontal) x a 1d finite difference space (vertical), and the resulting coordinate field. This domain is not periodic along the z-axis. Note that only periodic domains are supported in the horizontal.
space
is a NamedTuple holding the surface space (in this case, the top face space) and the center space for the subsurface. These are stored using the keys :surface and :subsurface.
Fields
xlim
: Domain interval limits along x axis, in metersylim
: Domain interval limits along y axis, in meterszlim
: Domain interval limits along z axis, in metersdz_tuple
: Tuple for mesh stretching specifying target (dzbottom, dztop) (m). If nothing, no stretching is applied.nelements
: Number of elements to discretize interval, (nx, ny,nz)npolynomial
: Polynomial order for the horizontal directionsperiodic
: Flag indicating periodic boundaries in horizontal. only true is supportedspace
: A NamedTuple of associated ClimaCore spaces: in this case, the surface space and subsurface center space
ClimaLand.Domains.Column
— TypeColumn{FT} <: AbstractDomain{FT}
A struct holding the necessary information to construct a domain, a mesh, a center and face space, etc. for use when a finite difference in 1D is suitable, as for a soil column model.
space
is a NamedTuple holding the surface space (in this case, the top face space) and the center space for the subsurface. These are stored using the keys :surface and :subsurface.
Fields
zlim
: Domain interval limits, (zmin, zmax), in metersnelements
: Number of elements used to discretize the intervaldz_tuple
: Tuple for mesh stretching specifying target (dzbottom, dztop) (m). If nothing, no stretching is applied.boundary_names
: Boundary face identifiersspace
: A NamedTuple of associated ClimaCore spaces: in this case, the surface space and subsurface center space
ClimaLand.Domains.Plane
— TypePlane{FT} <: AbstractDomain{FT}
A struct holding the necessary information to construct a domain, a mesh, a 2d spectral element space, and the resulting coordinate field. Note that only periodic domains are currently supported.
space
is a NamedTuple holding the surface space (in this case, the entire Plane space).
Fields
xlim
: Domain interval limits along x axis, in metersylim
: Domain interval limits along y axis, in metersnelements
: Number of elements to discretize interval, (nx, ny)periodic
: Flags for periodic boundaries; only true is supportednpolynomial
: Polynomial order for both x and yspace
: A NamedTuple of associated ClimaCore spaces: in this case, the surface(Plane) space
ClimaLand.Domains.Point
— TypePoint{FT} <: AbstractDomain{FT}
A domain for single column surface variables. For models such as ponds, snow, plant hydraulics, etc. Enables consistency in variable initialization across all domains.
space
is a NamedTuple holding the surface space (in this case, the Point space).
Fields
z_sfc
: Surface elevation relative to a reference (m)space
: A NamedTuple of associated ClimaCore spaces: in this case, the Point (surface) space
ClimaLand.Domains.coordinates
— Functioncoordinates(domain::AbstractDomain)
Returns the coordinate fields for the domain as a NamedTuple.
The returned coordinates are stored with keys :surface, :subsurface, e.g. as relevant for the domain.
Domains.coordinates(model::AbstractLandModel)
Returns a NamedTuple of the unique set of coordinates for the LSM model
, where the unique set is taken over the coordinates of all of the subcomponents.
For example, an LSM with a single layer snow model, multi-layer soil model, and canopy model would have a coordinate set corresponding to the coordinates of the surface (snow), the subsurface coordinates (soil) and the coordinates of the surface (canopy). This would return the coordinates of the surface and subsurface. These are distinct because the subsurface coordinates correspond to the centers of the layers, while the surface corresponds to the top face of the domain.
ClimaLand.Domains.obtain_face_space
— Functionobtain_face_space(cs::ClimaCore.Spaces.AbstractSpace)
Returns the face space, if applicable, for the center space cs
.
obtain_face_space(cs::ClimaCore.Spaces.CenterExtrudedFiniteDifferenceSpace)
Returns the face space for the CenterExtrudedFiniteDifferenceSpace cs
.
obtain_face_space(cs::ClimaCore.Spaces.CenterFiniteDifferenceSpace)
Returns the face space corresponding to the CenterFiniteDifferenceSpace cs
.
ClimaLand.Domains.obtain_surface_space
— Functionobtain_surface_space(cs::ClimaCore.Spaces.AbstractSpace)
Returns the surface space, if applicable, for the center space cs
.
obtain_surface_space(cs::ClimaCore.Spaces.CenterExtrudedFiniteDifferenceSpace)
Returns the horizontal space for the CenterExtrudedFiniteDifferenceSpace cs
.
obtain_surface_space(cs::ClimaCore.Spaces.CenterFiniteDifferenceSpace)
Returns the top level of the face space corresponding to the CenterFiniteDifferenceSpace cs
.
ClimaLand.Domains.obtain_surface_domain
— Functionobtain_surface_domain(d::AbstractDomain) where {FT}
Default method throwing an error; any domain with a corresponding domain should define a new method of this function.
obtain_surface_domain(c::Column{FT}) where {FT}
Returns the Point domain corresponding to the top face (surface) of the Column domain c
.
obtain_surface_domain(b::HybridBox{FT}) where {FT}
Returns the Plane domain corresponding to the top face (surface) of the HybridBox domain b
.
obtain_surface_domain(s::SphericalShell{FT}) where {FT}
Returns the SphericalSurface domain corresponding to the top face (surface) of the SphericalShell domain s
.
ClimaLand.Domains.top_center_to_surface
— Functiontop_center_to_surface(center_field::ClimaCore.Fields.Field)
Creates and returns a ClimaCore.Fields.Field defined on the space corresponding to the surface of the space on which center_field
is defined, with values equal to the those at the level of the top center.
For example, given a center_field
defined on 1D center finite difference space, this would return a field defined on the Point space of the surface of the column. The value would be the value of the oroginal center_field
at the topmost location. Given a center_field
defined on a 3D extruded center finite difference space, this would return a 2D field corresponding to the surface, with values equal to the topmost level.
ClimaLand.Domains.linear_interpolation_to_surface!
— Functionlinear_interpolation_to_surface!(sfc_field, center_field, z)
Linearly interpolate the center field center_field
to the surface defined by the top face coordinate of z
; updates the sfc_field
on the surface (face) space in place.
ClimaLand.Domains.get_Δz
— Functionget_Δz(z::ClimaCore.Fields.Field)
A function to return a tuple containing the distance between the top boundary and its closest center, and the bottom boundary and its closest center, both as Fields.
Models
ClimaLand.AbstractModel
— Typeabstract type AbstractModel{FT <: AbstractFloat}
An abstract type for all models.
ClimaLand.AbstractImExModel
— TypeAbstractImExModel{FT} <: AbstractModel{FT}
An abstract type for models which must be treated implicitly (and which may also have tendency terms that can be treated explicitly). This inherits all the default function definitions from AbstractModel, as well as make_imp_tendency
and make_compute_imp_tendency
defaults.
ClimaLand.AbstractExpModel
— TypeAbstractExpModel{FT} <: AbstractModel{FT}
An abstract type for models which must be treated explicitly. This inherits all the default function definitions from AbstractModel, as well as a make_imp_tendency
default.
ClimaLand.make_exp_tendency
— Functionmake_exp_tendency(model::AbstractModel)
Returns an exp_tendency
that updates auxiliary variables and updates the prognostic state of variables that are stepped explicitly.
compute_exp_tendency!
should be compatible with SciMLBase.jl solvers.
ClimaLand.make_imp_tendency
— Functionmake_imp_tendency(model::AbstractImExModel)
Returns an imp_tendency
that updates auxiliary variables and updates the prognostic state of variables that are stepped implicitly.
compute_imp_tendency!
should be compatible with SciMLBase.jl solvers.
make_imp_tendency(model::AbstractModel)
Returns an imp_tendency
that does nothing. This model type is not stepped explicity.
ClimaLand.make_compute_exp_tendency
— Functionmake_explicit_tendency(model::Soil.RichardsModel)
An extension of the function make_compute_imp_tendency
, for the Richardson- Richards equation.
Construct the tendency computation function for the explicit terms of the RHS, which are horizontal components and source/sink terms.
make_compute_exp_tendency(model::EnergyHydrology)
An extension of the function make_compute_exp_tendency
, for the integrated soil energy and heat equations, including phase change.
This function creates and returns a function which computes the entire right hand side of the PDE for Y.soil.ϑ_l, Y.soil.θ_i, Y.soil.ρe_int
, and updates dY.soil
in place with those values. All of these quantities will be stepped explicitly.
This has been written so as to work with Differential Equations.jl.
make_compute_exp_tendency(model::BucketModel{FT}) where {FT}
Creates the computeexptendency! function for the bucket model.
make_compute_exp_tendency(model::AbstractModel)
Return a compute_exp_tendency!
function that updates state variables that we will be stepped explicitly.
compute_exp_tendency!
should be compatible with SciMLBase.jl solvers.
ClimaLand.make_compute_exp_tendency(component::AbstractCanopyComponent, canopy)
Creates the computeexptendency!(dY,Y,p,t) function for the canopy component
.
Since component models are not standalone models, other information may be needed and passed in (via the canopy
model itself). The right hand side for the entire canopy model can make use of these functions for the individual components.
make_compute_exp_tendency(canopy::CanopyModel)
Creates and returns the computeexptendency! for the CanopyModel
.
make_compute_exp_tendency(model::SoilCO2Model)
An extension of the function make_compute_exp_tendency
, for the soilco2 equation. This function creates and returns a function which computes the entire right hand side of the PDE for C
, and updates dY.soil.C
in place with that value. These quantities will be stepped explicitly.
This has been written so as to work with Differential Equations.jl.
make_compute_exp_tendency(model::PlantHydraulicsModel, _)
A function which creates the computeexptendency! function for the PlantHydraulicsModel. The computeexptendency! function must comply with a rhs function of SciMLBase.jl.
Below, fa
denotes a flux multiplied by the relevant cross section (per unit area ground, or area index, AI). The tendency for the ith compartment can be written then as: ∂ϑ[i]/∂t = 1/(AI*dz)[fa[i]-fa[i+1]).
Note that if the area_index is zero because no plant is present, AIdz is zero, and the fluxes fa
appearing in the numerator are zero because they are scaled by AI.
To prevent dividing by zero, we change AI/(AI x dz)" to "AI/max(AI x dz, eps(FT))"
ClimaLand.make_compute_imp_tendency
— Functionmake_compute_imp_tendency(model::RichardsModel)
An extension of the function make_compute_imp_tendency
, for the Richardson- Richards equation.
This function creates and returns a function which computes the entire right hand side of the PDE for ϑ_l
, and updates dY.soil.ϑ_l
in place with that value.
make_compute_imp_tendency(model::AbstractModel)
Return a compute_imp_tendency!
function that updates state variables that we will be stepped implicitly.
compute_imp_tendency!
should be compatible with SciMLBase.jl solvers.
ClimaLand.make_update_aux
— Functionmake_update_aux(model::RichardsModel)
An extension of the function make_update_aux
, for the Richardson- Richards equation.
This function creates and returns a function which updates the auxiliary variables p.soil.variable
in place.
This has been written so as to work with Differential Equations.jl.
make_update_aux(model::EnergyHydrology)
An extension of the function make_update_aux
, for the integrated soil hydrology and energy model.
This function creates and returns a function which updates the auxiliary variables p.soil.variable
in place.
This has been written so as to work with Differential Equations.jl.
make_update_aux(model::BucketModel{FT}) where {FT}
Creates the update_aux! function for the BucketModel.
make_update_aux(model::AbstractModel)
Return an update_aux!
function that updates auxiliary parameters p
.
ClimaLand.make_update_aux(canopy::CanopyModel{FT,
<:AutotrophicRespirationModel,
<:Union{BeerLambertModel, TwoStreamModel},
<:FarquharModel,
<:MedlynConductanceModel,
<:PlantHydraulicsModel,},
) where {FT}
Creates the update_aux!
function for the CanopyModel
; a specific method for update_aux!
for the case where the canopy model components are of the type in the parametric type signature: AutotrophicRespirationModel
, AbstractRadiationModel
, FarquharModel
, MedlynConductanceModel
, and PlantHydraulicsModel
.
Please note that the plant hydraulics model has auxiliary variables that are updated in its prognostic compute_exp_tendency!
function. While confusing, this is better for performance as it saves looping over the state vector multiple times.
The other sub-components rely heavily on each other, so the version of the CanopyModel
with these subcomponents has a single update_aux! function, given here.
make_update_aux(model::SoilCO2Model)
An extension of the function make_update_aux
, for the soilco2 equation. This function creates and returns a function which updates the auxiliary variables p.soil.variable
in place. This has been written so as to work with Differential Equations.jl.
ClimaLand.make_update_boundary_fluxes
— Functionmake_update_boundary_fluxes(model::AbstractModel)
Return an update_boundary_fluxes!
function that updates the auxiliary parameters in p
corresponding to boundary fluxes or interactions between componets..
make_update_boundary_fluxes(
land::LandHydrology{FT, SM, SW},
) where {FT, SM <: Soil.RichardsModel{FT}, SW <: Pond.PondModel{FT}}
A method which makes a function; the returned function updates the auxiliary variable p.soil_infiltration
, which is needed for both the boundary condition for the soil model and the source term (runoff) for the surface water model.
This function is called each ode function evaluation.
make_update_boundary_fluxes(
land::SoilCanopyModel{FT, MM, SM, RM},
) where {
FT,
MM <: Soil.Biogeochemistry.SoilCO2Model{FT},
SM <: Soil.RichardsModel{FT},
RM <: Canopy.CanopyModel{FT}
}
A method which makes a function; the returned function updates the additional auxiliary variables for the integrated model, as well as updates the boundary auxiliary variables for all component models.
This function is called each ode function evaluation, prior to the tendency function evaluation.
ClimaLand.make_set_initial_cache
— Functionmake_set_initial_cache(model::AbstractModel)
Returns the setinitialcache! function, which updates the auxiliary state p
in place with the initial values corresponding to Y(t=t0) = Y0.
In principle, this function is not needed, because in the very first evaluation of either explicit_tendency
or implicit_tendency
, at t=t0, the auxiliary state is updated using the initial conditions for Y=Y0. However, without setting the initial p
state prior to running the simulation, the value of p
in the saved output at t=t0 will be unset.
Furthermore, specific methods of this function may be useful for models which store time indepedent spatially varying parameter fields in the auxiliary state. In this case, update_aux!
does not need to do anything, but they do need to be set with the initial (constant) values before the simulation can be carried out.
ClimaLand.make_update_drivers
— Functionmake_update_drivers(a::Union{AbstractAtmosphericDrivers, Nothing},
r::Union{AbstractRadiativeDrivers, Nothing},
)
Creates and returns a function which updates the atmospheric and radiative forcing variables ("drivers").
make_update_drivers(d::Union{AbstractAtmosphericDrivers, AbstractRadiativeDrivers, Nothing})
Creates and returns a function which updates the driver variables in the case of no driver variables. This is also the default.
make_update_drivers(a::PrescribedAtmosphere{FT}) where {FT}
Creates and returns a function which updates the driver variables in the case of a PrescribedAtmosphere.
make_update_drivers(a::PrescribedPrecipitation{FT}) where {FT}
Creates and returns a function which updates the driver variables in the case of a PrescribedPrecipitation.
make_update_drivers(r::PrescribedRadiativeFluxes{FT}) where {FT}
Creates and returns a function which updates the driver variables in the case of a PrescribedRadiativeFluxes.
ClimaLand.prognostic_vars
— Functionprognostic_vars(soil::RichardsModel)
A function which returns the names of the prognostic variables of RichardsModel
.
prognostic_vars(soil::EnergyHydrology)
A function which returns the names of the prognostic variables of EnergyHydrology
.
prognostic_vars(m::AbstractModel)
Returns the prognostic variable symbols for the model in the form of a tuple.
Note that this default suggests that a model has no prognostic variables, which is an invalid model setup. This function is meant to be extended for all models.
ClimaLand.prognostic_vars(::AbstractCanopyComponent)
Returns the prognostic vars of the canopy component passed in as an argument.
prognostic_vars(canopy::CanopyModel)
Returns the prognostic variables for the canopy model by looping over each sub-component name in canopy_components
.
This relies on the propertynames of CanopyModel
being the same as those returned by canopy_components
.
prognostic_vars(model::PlantHydraulicsModel)
A function which returns the names of the prognostic variables of the PlantHydraulicsModel
.
ClimaLand.prognostic_types
— Functionprognostic_types(soil::EnergyHydrology{FT}) where {FT}
A function which returns the types of the prognostic variables of EnergyHydrology
.
prognostic_types(m::AbstractModel{FT}) where {FT}
Returns the prognostic variable types for the model in the form of a tuple.
Types provided must have ClimaCore.RecursiveApply.rzero(T::DataType)
defined. Common examples include
- Float64, Float32 for scalar variables (a scalar value at each
coordinate point)
- SVector{k,Float64} for a mutable but statically sized array of
length k
at each coordinate point.
Here, the coordinate points are those returned by coordinates(model).
Note that this default suggests that a model has no prognostic variables, which is an invalid model setup. This function is meant to be extended for all models.
ClimaLand.prognostic_types(::AbstractCanopyComponent)
Returns the prognostic types of the canopy component passed in as an argument.
prognostic_types(canopy::CanopyModel)
Returns the prognostic types for the canopy model by looping over each sub-component name in canopy_components
.
This relies on the propertynames of CanopyModel
being the same as those returned by canopy_components
.
ClimaLand.prognostic_types(model::PlantHydraulicsModel{FT}) where {FT}
Defines the prognostic types for the PlantHydraulicsModel.
ClimaLand.prognostic_domain_names
— Functionprognosticdomainnames(m::AbstractModel)
Returns the domain names for the prognostic variables in the form of a tuple.
Examples: (:surface, :surface, :subsurface).
Note that this default suggests that a model has no prognostic variables, which is an invalid model setup. This function is meant to be extended for all models.
prognosticdomainnames(m::AbstractCanopyComponent)
Returns the domain names for the prognostic variables in the form of a tuple.
ClimaLand.auxiliary_vars
— Functionauxiliary_vars(soil::RichardsModel)
A function which returns the names of the auxiliary variables of RichardsModel
.
auxiliary_vars(soil::EnergyHydrology)
A function which returns the names of the auxiliary variables of EnergyHydrology
.
auxiliary_vars(m::AbstractModel)
Returns the auxiliary variable symbols for the model in the form of a tuple.
ClimaLand.auxiliary_vars(::AbstractCanopyComponent)
Returns the auxiliary types of the canopy component passed in as an argument.
auxiliary_vars(canopy::CanopyModel)
Returns the auxiliary variables for the canopy model by looping over each sub-component name in canopy_components
.
This relies on the propertynames of CanopyModel
being the same as those returned by canopy_components
.
auxiliary_vars(model::PlantHydraulicsModel)
A function which returns the names of the auxiliary variables of the PlantHydraulicsModel
, the transpiration stress factor β
(unitless), the water potential ψ
(m), the volume fluxcross section fa
(1/s), and the volume fluxroot cross section in the roots fa_roots
(1/s), where the cross section can be represented by an area index.
ClimaLand.auxiliary_types
— Functionauxiliary_types(soil::RichardsModel)
A function which returns the names of the auxiliary types of RichardsModel
.
auxiliary_types(soil::EnergyHydrology{FT}) where {FT}
A function which returns the types of the auxiliary variables of EnergyHydrology
.
auxiliary_types(m::AbstractModel{FT}) where {FT}
Returns the auxiliary variable types for the model in the form of a tuple.
Types provided must have ClimaCore.RecursiveApply.rzero(T::DataType)
defined. Common examples include
- Float64, Float32 for scalar variables (a scalar value at each
coordinate point)
- SVector{k,Float64} for a mutable but statically sized array of
length k
at each coordinate point.
- Note that Arrays, MVectors are not isbits and cannot be used.
Here, the coordinate points are those returned by coordinates(model).
ClimaLand.auxiliary_types(::AbstractCanopyComponent)
Returns the auxiliary types of the canopy component passed in as an argument.
auxiliary_types(canopy::CanopyModel)
Returns the auxiliary types for the canopy model by looping over each sub-component name in canopy_components
.
This relies on the propertynames of CanopyModel
being the same as those returned by canopy_components
.
ClimaLand.auxiliary_types(model::PlantHydraulicsModel{FT}) where {FT}
Defines the auxiliary types for the PlantHydraulicsModel.
ClimaLand.auxiliary_domain_names
— Functionauxiliary_domain_names(soil::RichardsModel)
A function which returns the names of the auxiliary domain names of RichardsModel
.
auxiliarydomainnames(m::AbstractModel)
Returns the domain names for the auxiliary variables in the form of a tuple.
Examples: (:surface, :surface, :subsurface).
auxiliarydomainnames(m::AbstractCanopyComponent)
Returns the domain names for the auxiliary variables in the form of a tuple.
ClimaLand.initialize_prognostic
— Functioninitialize_prognostic(model::AbstractModel, state::NamedTuple)
Returns a FieldVector of prognostic variables for model
with the required structure, with values equal to similar(state)
. This assumes that all prognostic variables are defined over the entire domain, and that all prognostic variables have the same dimension and type.
If a model has no prognostic variables, the returned FieldVector contains only an empty array.
The input state
is an array-like object, usually a ClimaCore Field or a Vector{FT}.
Adjustments to this - for example because different prognostic variables have different dimensions - require defining a new method.
initialize_prognostic(
component::AbstractCanopyComponent,
state,
)
Creates and returns a ClimaCore.Fields.FieldVector with the prognostic variables of the canopy component component
, stored using the name of the component.
The input state
is usually a ClimaCore Field object.
initialize_prognostic(
model::CanopyModel{FT},
coords,
) where {FT}
Creates the prognostic state vector of the CanopyModel
and returns it as a ClimaCore.Fields.FieldVector.
The input state
is usually a ClimaCore Field object.
This function loops over the components of the CanopyModel
and appends each component models prognostic state vector into a single state vector, structured by component name.
ClimaLand.initialize_auxiliary
— Functioninitialize_auxiliary(model::AbstractModel, state::NamedTuple)
Returns a NamedTuple of auxiliary variables for model
with the required structure, with values equal to similar(state)
. This assumes that all auxiliary variables are defined over the entire domain, and that all auxiliary variables have the same dimension and type. The auxiliary variables NamedTuple can also hold preallocated objects which are not Fields.
If a model has no auxiliary variables, the returned NamedTuple contains only an empty array.
The input state
is an array-like object, usually a ClimaCore Field or a Vector{FT}.
Adjustments to this - for example because different auxiliary variables have different dimensions - require defining a new method.
initialize_auxiliary(
component::AbstractCanopyComponent,
state,
)
Creates and returns a ClimaCore.Fields.FieldVector with the auxiliary variables of the canopy component component
, stored using the name of the component.
The input state
is usually a ClimaCore Field object.
initialize_auxiliary(
model::CanopyModel{FT},
coords,
) where {FT}
Creates the auxiliary state vector of the CanopyModel
and returns it as a ClimaCore.Fields.FieldVector.
The input coords
is usually a ClimaCore Field object.
This function loops over the components of the CanopyModel
and appends each component models auxiliary state vector into a single state vector, structured by component name.
ClimaLand.initialize
— Functioninitialize(model::AbstractModel)
Creates the prognostic and auxiliary states structures, but with unset values; constructs and returns the coordinates for the model
domain. We may need to consider this default more as we add diverse components and Simulations
.
ClimaLand.name
— Functionname(model::AbstractModel)
Returns a symbol of the model component name, e.g. :soil or :vegetation.
ClimaLand.AbstractBC
— TypeAbstractBC
An abstract type for types of boundary conditions, which will include prescribed functions of space and time as Dirichlet conditions or Neumann conditions, in addition to other convenient conditions.
ClimaLand.AbstractSource
— TypeAbstractSource{FT <: AbstractFloat}
An abstract type for types of source terms.
ClimaLand.source!
— Function source!(dY::ClimaCore.Fields.FieldVector,
src::PhaseChange{FT},
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
model
)
Computes the source terms for phase change.
source!(dY::ClimaCore.Fields.FieldVector,
src::AbstractSource,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple
)::ClimaCore.Fields.Field
A stub function, which is extended by ClimaLand.
ClimaLand.source!(dY::ClimaCore.Fields.FieldVector,
src::RootExtraction,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple
model::EnergyHydrology)
An extension of the ClimaLand.source!
function, which computes source terms for the soil model; this method returns the water and energy loss/gain due to root extraction.
ClimaLand.source!(dY::ClimaCore.Fields.FieldVector,
src::MicrobeProduction,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
params)
A method which extends the ClimaLand source! function for the case of microbe production of CO2 in soil.
ClimaLand.source!(
dY::ClimaCore.Fields.FieldVector,
src::TOPMODELSubsurfaceRunoff,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
model::AbstractSoilModel,
)
Adjusts dY.soil.ϑ_l in place to account for the loss of water due to subsurface runoff.
The sink term is given by - Rss/h∇ H(ϑl+θi - ν), where H is the Heaviside function, h∇ is the water table thickness (defined to be where ϑl+θi>ν), and Rss is the runoff as a flux(m/s).
The θ_i contribution is not include for RichardsModel.
ClimaLand.AbstractBoundary
— TypeAbstractBoundary
An abstract type to indicate which boundary we are doing calculations for. Currently, we support the top boundary (TopBoundary) and bottom boundary (BottomBoundary).
ClimaLand.TopBoundary
— TypeTopBoundary{} <: AbstractBoundary{}
A simple object which should be passed into a function to indicate that we are considering the top boundary.
ClimaLand.BottomBoundary
— TypeBottomBoundary{} <: AbstractBoundary{}
A simple object which should be passed into a function to indicate that we are considering the bottom boundary.
ClimaLand.boundary_flux
— Functionboundary_flux(bc::WaterFluxBC, _...)::ClimaCore.Fields.Field
A method of boundary fluxes which returns the desired flux.
We add a field of zeros in order to convert the bc (float) into a field.
boundary_flux(bc::RichardsAtmosDrivenFluxBC,
boundary::ClimaLand.AbstractBoundary,
model::RichardsModel{FT},
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)::ClimaCore.Fields.Field where {FT}
A method of boundary fluxes which returns the desired water volume flux for the RichardsModel, at the top of the domain, in the case of a prescribed precipitation flux.
If model.runoff
is not of type NoRunoff
, surface runoff is accounted for when computing the infiltration.
boundary_flux(rre_bc::MoistureStateBC,
::ClimaLand.TopBoundary,
model::AbstractSoilModel,
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)::ClimaCore.Fields.Field
A method of boundary fluxes which converts a state boundary condition on θ_l at the top of the domain into a flux of liquid water.
boundary_flux(rre_bc::MoistureStateBC,
::ClimaLand.BottomBoundary,
model::AbstractSoilModel,
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)::ClimaCore.Fields.Field
A method of boundary fluxes which converts a state boundary condition on θ_l at the bottom of the domain into a flux of liquid water.
boundary_flux(bc::FreeDrainage,
boundary::ClimaLand.BottomBoundary,
model::AbstractSoilModel,
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)::ClimaCore.Fields.Field
A method of boundary fluxes which enforces free drainage at the bottom of the domain.
boundary_flux(bc::HeatFluxBC, _...)::ClimaCore.Fields.Field
A method of boundary fluxes which returns the desired flux.
We add a field of zeros in order to convert the bc (float) into a field.
boundary_flux(heat_bc::TemperatureStateBC,
::ClimaLand.TopBoundary,
model::EnergyHydrology,
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)::ClimaCore.Fields.Field
A method of boundary fluxes which converts a state boundary condition on temperature at the top of the domain into a flux of energy.
boundary_flux(heat_bc::TemperatureStateBC,
::ClimaLand.BottomBoundary,
model::EnergyHydrology,
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)::ClimaCore.Fields.Field
A method of boundary fluxes which converts a state boundary condition on temperature at the bottom of the domain into a flux of energy.
boundary_flux(bc::AbstractBC, bound_type::AbstractBoundary, Δz, _...)::ClimaCore.Fields.Field
A function which returns the correct boundary flux given any boundary condition (BC).
function ClimaLand.boundary_flux(
bc::RunoffBC,
::TopBoundary,
model::Soil.RichardsModel,
Δz::FT,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
params,
)::ClimaCore.Fields.Field
Extension of the ClimaLand.boundary_flux
function, which returns the water volume boundary flux for the soil. At the top boundary, return the soil infiltration (computed each step and stored in p.soil_infiltration
).
ClimaLand.boundary_flux(
bc::SoilCO2FluxBC,
boundary::ClimaLand.AbstractBoundary,
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)::ClimaCore.Fields.Field
A method of ClimaLand.boundary_flux which returns the soilco2 flux (kg CO2 /m^2/s) in the case of a prescribed flux BC at either the top or bottom of the domain.
ClimaLand.boundary_flux(
bc::SoilCO2StateBC,
boundary::ClimaLand.TopBoundary,
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)::ClimaCore.Fields.Field
A method of ClimaLand.boundary_flux which returns the soilco2 flux in the case of a prescribed state BC at top of the domain.
ClimaLand.boundary_flux(
bc::SoilCO2StateBC,
boundary::ClimaLand.BottomBoundary,
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)::ClimaCore.Fields.Field
A method of ClimaLand.boundary_flux which returns the soilco2 flux in the case of a prescribed state BC at bottom of the domain.
ClimaLand.boundary_flux(
bc::AtmosCO2StateBC,
boundary::ClimaLand.TopBoundary,
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)::ClimaCore.Fields.Field
A method of ClimaLand.boundary_flux which returns the soilco2 flux in the case when the atmospheric CO2 is ued at top of the domain.
ClimaLand.diffusive_flux
— Functiondiffusive_flux(K, x_2, x_1, Δz)
Calculates the diffusive flux of a quantity x (water content, temp, etc). Here, x2 = x(z + Δz) and x1 = x(z), so x_2 is at a larger z by convention.
ClimaLand.boundary_vars
— Functionboundary_vars(::RichardsAtmosDrivenFluxBC{<:PrescribedPrecipitation,
<:Runoff.TOPMODELRunoff,
}, ::ClimaLand.TopBoundary)
An extension of the boundary_vars
method for RichardsAtmosDrivenFluxBC with TOPMODELRunoff.
These variables are updated in place in boundary_flux
.
boundary_vars(::RichardsAtmosDrivenFluxBC{<:PrescribedPrecipitation,
<:Runoff.AbstractRunoffModel,
}, ::ClimaLand.TopBoundary)
An extension of the boundary_vars
method for RichardsAtmosDrivenFluxBC with no runoff modeled.
These variables are updated in place in boundary_flux
.
boundary_vars(::AtmosDrivenFluxBC{<:AbstractAtmosphericDrivers,
<:AbstractRadiativeDrivers,
<:AbstractRunoffModel,
}, ::ClimaLand.TopBoundary)
An extension of the boundary_vars
method for AtmosDrivenFluxBC. This adds the surface conditions (SHF, LHF, evaporation, and resistance) and the net radiation to the auxiliary variables.
These variables are updated in place in soil_boundary_fluxes!
.
boundary_vars(::AtmosDrivenFluxBC{<:AbstractAtmosphericDrivers,
<:AbstractRadiativeDrivers,
<:Runoff.TOPMODELRunoff,
}, ::ClimaLand.TopBoundary)
An extension of the boundary_vars
method for AtmosDrivenFluxBC with TOPMODELRunoff. This adds the surface conditions (SHF, LHF, evaporation, and resistance) and the net radiation to the auxiliary variables.
These variables are updated in place in soil_boundary_fluxes!
.
boundary_vars(::AbstractBC , ::ClimaLand.TopBoundary)
The list of symbols for additional variables to add to the model auxiliary state, for models solving PDEs, which defaults to adding storage for the top boundary flux fields, but which can be extended depending on the type of boundary condition used.
For the Soil and SoilCO2 models - which solve PDEs - the tendency functions and updateboundaryfluxes functions are coded to access the field :top_bc
to be present in the model cache, which is why this is the default. If this is not your (PDE) model's desired behavior, you can extend this function with a new method.
Use this function in the exact same way you would use auxiliary_vars
.
boundary_vars(::AbstractBC, ::ClimaLand.BottomBoundary)
The list of symbols for additional variables to add to the model auxiliary state, for models solving PDEs, which defaults to adding storage for the bottom boundary flux fields, but which can be extended depending on the type of boundary condition used.
For the Soil and SoilCO2 models - which solve PDEs - the tendency functions and updateboundaryfluxes functions are coded to access the field :bottom_bc
to be present in the model cache, which is why this is the default. If this is not your (PDE) model's desired behavior, you can extend this function with a new method.
Use this function in the exact same way you would use auxiliary_vars
.
ClimaLand.boundary_var_domain_names
— Functionboundary_var_domain_names(::RichardsAtmosDrivenFluxBC{<:PrescribedPrecipitation,
<:Runoff.TOPMODELRunoff,
},
::ClimaLand.TopBoundary)
An extension of the boundary_var_domain_names
method for RichardsAtmosDrivenFluxBC with TOPMODELRunoff.
boundary_var_domain_names(::RichardsAtmosDrivenFluxBC{<:PrescribedPrecipitation,
<:Runoff.AbstractRunoffModel,
},
::ClimaLand.TopBoundary)
An extension of the boundary_var_domain_names
method for RichardsAtmosDrivenFluxBC with no runoff modeled.
boundary_var_domain_names(::AtmosDrivenFluxBC{<:AbstractAtmosphericDrivers,
<:AbstractRadiativeDrivers,
<:AbstractRunoffModel,
},
::ClimaLand.TopBoundary)
An extension of the boundary_var_domain_names
method for AtmosDrivenFluxBC. This specifies the part of the domain on which the additional variables should be defined.
boundary_var_domain_names(::AtmosDrivenFluxBC{<:AbstractAtmosphericDrivers,
<:AbstractRadiativeDrivers,
<:Runoff.TOPMODELRunoff,
},
::ClimaLand.TopBoundary)
An extension of the boundary_var_domain_names
method for AtmosDrivenFluxBC with TOPMODELRunoff. This specifies the part of the domain on which the additional variables should be defined.
boundary_var_domain_names(::AbstractBC, ::ClimaLand.AbstractBoundary)
The list of domain names for additional variables to add to the model auxiliary state, for models solving PDEs, which defaults to adding storage on the surface domain for the top or bottom boundary flux fields, but which can be extended depending on the type of boundary condition used.
Use in conjunction with boundary_vars
, in the same way you would use auxiliary_var_domain_names
.
ClimaLand.boundary_var_types
— Functionboundary_var_types(::RichardsAtmosDrivenFluxBC{<:PrescribedPrecipitation,
<:Runoff.TOPMODELRunoff{FT},
},
::ClimaLand.TopBoundary,
) where {FT}
An extension of the boundary_var_types
method for RichardsAtmosDrivenFluxBC with TOPMODELRunoff.
boundary_var_types(::RichardsAtmosDrivenFluxBC{<:PrescribedPrecipitation,
<:Runoff.AbstractRunoffModel,
},
::ClimaLand.TopBoundary,
) where {FT}
An extension of the boundary_var_types
method for RichardsAtmosDrivenFluxBC with no runoff modeled.
boundary_var_types(::Soil.EnergyHydrology{FT}, ::AbstractEnergyHydrologyBC, ::ClimaLand.AbstractBoundary) where {FT}
The list of domain names for additional variables added to the EnergyHydrology model auxiliary state, which defaults to adding storage for the boundary flux field.
Because we supply boundary conditions for water and heat, we found it convenient to have these stored as a NamedTuple under the names top_bc
and bottom_bc
.
boundary_var_types(
::AtmosDrivenFluxBC{
<:PrescribedAtmosphere{FT},
<:AbstractRadiativeDrivers{FT},
<:AbstractRunoffModel,
}, ::ClimaLand.TopBoundary,
) where {FT}
An extension of the boundary_var_types
method for AtmosDrivenFluxBC. This specifies the type of the additional variables.
boundary_var_types(
::AtmosDrivenFluxBC{
<:PrescribedAtmosphere{FT},
<:AbstractRadiativeDrivers{FT},
<:Runoff.TOPMODELRunoff{FT},
}, ::ClimaLand.TopBoundary,
) where {FT}
An extension of the boundary_var_types
method for AtmosDrivenFluxBC with TOPMODELRunoff. This specifies the type of the additional variables.
boundary_var_types(model::AbstractModel{FT}, ::AbstractBC, ::ClimaLand.AbstractBoundary) where {FT}
The list of types for additional variables to add to the model auxiliary state, for models solving PDEs, which defaults to adding a scalar variable on the surface domain for the top or bottom boundary flux fields, but which can be extended depending on the type of boundary condition used.
Use in conjunction with boundary_vars
, in the same way you would use auxiliary_var_types
. The use of a scalar is appropriate for models with a single PDE; models with multiple PDEs will need to supply multiple scalar fields.
ClimaLand.make_tendency_jacobian
— Functionmaketendencyjacobian(model::AbstractModel)
Creates and returns a function which updates the auxiliary variables p
in place and then updates the entries of the Jacobian matrix W
for the model
in place.
The default is that no updates are required, no implicit tendency is present, and hence the timestepping is entirely explicit.
Note that the returned function tendency_jacobian!
should be used as Wfact!
in ClimaTimeSteppers.jl
and SciMLBase.jl
.
ClimaLand.make_update_jacobian
— FunctionClimaLand.make_update_jacobian(model::RichardsModel{FT}) where {FT}
Creates and returns the update_jacobian! function for RichardsModel.
Using this Jacobian with a backwards Euler timestepper is equivalent to using the modified Picard scheme of Celia et al. (1990).
make_update_jacobian(model::AbstractModel)
Creates and returns a function which updates the entries of the Jacobian matrix W
in place.
If the implicit tendency function is given by T!(dY, Y, p, t) = make_implicit_tendency(model)
, the Jacobian should be given by W_{i,j}! = ∂T!_i/∂Y_j
, where Y_j
is the j-th
state variable and T!_i
is the implicit tendency of the i-th
state variable.
The default is that no updates are required, no implicit tendency is present, and hence the timestepping is entirely explicit.
ClimaLand.∂tendencyBC∂Y
— FunctionClimaLand.∂tendencyBC∂Y(
model::RichardsModel,
::MoistureStateBC,
boundary::ClimaLand.TopBoundary,
Δz,
Y,
p,
t,
)
Computes and returns the derivative of the part of the implicit tendency in the top layer, due to the boundary condition, with respect to the state variable in the top layer.
For a diffusion equation like Richards equation with a single state variable, this is given by ∂T_N∂Y_N = [-∂/∂z(∂F_bc/∂Y_N)]_N
, where N
indicates the top layer cell index.
ClimaLand.∂tendencyBC∂Y(
::RichardsModel,
::AbstractWaterBC,
boundary::ClimaLand.TopBoundary,
Δz,
Y,
p,
t,
)
A default method which computes and returns the zero for the derivative of the part of the implicit tendency in the top layer, due to the boundary condition, with respect to the state variable in the top layer.
For a diffusion equation like Richards equation with a single state variable, this is given by ∂T_N∂Y_N = [-∂/∂z(∂F_bc/∂Y_N)]_N
, where N
indicates the top layer cell index.
If F_bc
can be approximated as independent of Y_N
, the derivative is zero.
∂tendencyBC∂Y(::AbstractModel,
::AbstractBC,
::AbstractBoundary,
_...)::Union{ClimaCore.Fields.FieldVector, Nothing}
A function stub which returns the derivative of the implicit tendency term of the model
arising from the boundary condition, with respect to the state Y.
ClimaLand.AbstractTridiagonalW
— TypeAbstractTridiagonalW
An abstract type for tridiagonal Jacobian matrices.
ClimaLand.get_drivers
— FunctionClimaLand.get_drivers(model::RichardsModel)
Returns the driver variable symbols for the RichardsModel; these depend on the boundary condition type and currently only are required for the RichardsAtmosDrivenFluxBC, which is driven by a prescribed time and space varying precipitation.
get_drivers(model::AbstractModel)
Returns the driver
objects for the model - atmospheric and radiative forcing - as a tuple (atmos, radiation).
Drivers
ClimaLand.PrescribedAtmosphere
— TypePrescribedAtmosphere{FT, CA, DT} <: AbstractAtmosphericDrivers{FT}
Container for holding prescribed atmospheric drivers and other information needed for computing turbulent surface fluxes when driving land models in standalone mode.
The default CO2 concentration is a constant as a function of time, equal to 4.2e-4 mol/mol.
Since not all models require co2 concentration, the default for that is nothing
.
liquid_precip
: Precipitation (m/s) function of time: positive by definitionsnow_precip
: Snow precipitation (m/s) function of time: positive by definitionT
: Prescribed atmospheric temperature (function of time) at the reference height (K)u
: Prescribed wind speed (function of time) at the reference height (m/s)q
: Prescribed specific humidity (function of time) at the reference height (_)P
: Prescribed air pressure (function of time) at the reference height (Pa)c_co2
: CO2 concentration in atmosphere (mol/mol)ref_time
: Reference time - the datetime corresponding to t=0 for the simulationh
: Reference height (m), relative to surface elevationgustiness
: Minimum wind speed (gustiness; m/s)
ClimaLand.PrescribedPrecipitation
— TypePrescribedPrecipitation{FT, LP} <: AbstractAtmosphericDrivers{FT}
Container for holding prescribed precipitation driver for models which only require precipitation (RichardsModel).
liquid_precip
: Precipitation (m/s) function of time: positive by definition
ClimaLand.PrescribedRadiativeFluxes
— TypePrescribedRadiativeFluxes{FT, SW, LW, DT, T} <: AbstractRadiativeDrivers{FT}
Container for the prescribed radiation functions needed to drive land models in standalone mode.
SW_d
: Downward shortwave radiation function of time (W/m^2): positive indicates towards surfaceLW_d
: Downward longwave radiation function of time (W/m^2): positive indicates towards surfaceref_time
: Reference time - the datetime corresponding to t=0 for the simulationθs
: Sun zenith angle, in radians
ClimaLand.CoupledAtmosphere
— TypeCoupledAtmosphere{FT} <: AbstractAtmosphericDrivers{FT}
To be used when coupling to an atmosphere model.
ClimaLand.CoupledRadiativeFluxes
— TypeCoupledRadiativeFluxes{FT} <: AbstractRadiativeDrivers{FT}
To be used when coupling to an atmosphere model.
ClimaLand.AbstractAtmosphericDrivers
— Type AbstractAtmosphericDrivers{FT <: AbstractFloat}
An abstract type of atmospheric drivers of land models.
ClimaLand.AbstractRadiativeDrivers
— Type AbstractRadiativeDrivers{FT <: AbstractFloat}
An abstract type of radiative drivers of land models.
ClimaLand.turbulent_fluxes
— Functionturbulent_fluxes(atmos::PrescribedAtmosphere,
model::AbstractModel,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t
)
Computes the turbulent surface flux terms at the ground for a standalone simulation, including turbulent energy fluxes as well as the water vapor flux (in units of m^3/m^2/s of water). Positive fluxes indicate flow from the ground to the atmosphere.
It solves for these given atmospheric conditions, stored in atmos
, model parameters, and the surface conditions.
turbulent_fluxes(atmos::CoupledAtmosphere,
model::AbstractModel,
Y,
p,
t)
Computes the turbulent surface fluxes terms at the ground for a coupled simulation.
ClimaLand.turbulent_fluxes_at_a_point
— Functionturbulent_fluxes_at_a_point(T_sfc::FT,
q_sfc::FT,
ρ_sfc::FT,
β_sfc::FT,
h_sfc::FT,
r_sfc::FT,
d_sfc::FT,
ts_in,
u::FT,
h::FT,
gustiness::FT,
z_0m::FT,
z_0b::FT,
earth_param_set::EP,
) where {FT <: AbstractFloat, P}
Computes turbulent surface fluxes at a point on a surface given (1) the surface temperature (Tsfc), specific humidity (qsfc), and air density (ρsfc), (2) Other surface properties, such as the factor βsfc which scales the evaporation from the potential rate (used in bucket models), and the surface resistance rsfc (used in more complex land models), and the topographical height of the surface (hsfc) (3) the roughness lengths z_0m, z_0b
, and the Earth parameter set for the model earth_params
. (4) the prescribed atmospheric state, ts_in
, u, h the height at which these measurements are made, and the gustiness parameter (m/s). (5) the displacement height for the model d_sfc
This returns an energy flux and a liquid water volume flux, stored in a tuple with self explanatory keys.
Missing docstring for ClimaLand.radiative_fluxes_at_a_point
. Check Documenter's build log for details.
ClimaLand.construct_atmos_ts
— Functionconstruct_atmos_ts(
atmos::PrescribedAtmosphere,
p,
thermo_params,
)
A helper function which constructs a Clima.Thermodynamics thermodynamic state given a PrescribedAtmosphere, the cache p
, and a set of Clima.Thermodynamics parameters thermo_params.
ClimaLand.surface_air_density
— Functionsurface_air_density(
atmos::PrescribedAtmosphere,
model::AbstractModel,
Y,
p,
t,
T_sfc,
)
A helper function which returns the surface air density; this assumes that the model
has a property called parameters
containing earth_param_set
.
We additionally include the atmos
type as an argument because the surface air density computation will change between a coupled simulation and a prescibed atmos simulation.
Extending this function for your model is only necessary if you need to compute the air density in a different way.
ClimaLand.surface_air_density(
atmos::CoupledAtmosphere,
model::AbstractModel,
Y,
p,
_...,
)
Returns the air density at the surface in the case of a coupled simulation.
This requires the field ρ_sfc
to be present in the cache p
under the name of the model.
ClimaLand.liquid_precipitation
— Functionliquid_precipitation(atmos::AbstractAtmosphericDrivers, p, t)
Returns the liquid precipitation (m/s) at the surface.
ClimaLand.snow_precipitation
— Functionsnow_precipitation(atmos::AbstractAtmosphericDrivers, p, t)
Returns the precipitation in snow (m of liquid water/s) at the surface.
ClimaLand.surface_temperature
— FunctionClimaLand.surface_temperature(
model::EnergyHydrology{FT},
Y,
p,
t,
) where {FT}
Returns the surface temperature field of the EnergyHydrology
soil model.
The assumption is that the soil surface temperature is the same as the temperature at the center of the first soil layer.
ClimaLand.surface_temperature(model::BucketModel, Y, p)
a helper function which returns the surface temperature for the bucket model, which is stored in the aux state.
surface_temperature(model::AbstractModel, Y, p, t)
A helper function which returns the surface temperature for a given model, needed because different models compute and store surface temperature in different ways and places.
Extending this function for your model is only necessary if you need to compute surface fluxes and radiative fluxes at the surface using the functions in this file.
ClimaLand.surface_temperature(model::CanopyModel, Y, p, t)
A helper function which returns the temperature for the canopy model.
ClimaLand.surface_resistance
— FunctionClimaLand.surface_resistance(
model::EnergyHydrology{FT},
Y,
p,
t,
) where {FT}
Returns the surface resistance field of the EnergyHydrology
soil model.
surface_resistance(model::AbstractModel, Y, p, t)
A helper function which returns the surface resistance for a given model, needed because different models compute and store surface resistance in different ways and places.
Extending this function for your model is only necessary if you need to compute surface fluxes and radiative fluxes at the surface using the functions in this file.
The default is 0, which is no additional resistance aside from the usual aerodynamic resistance from MOST.
ClimaLand.surface_resistance(
model::CanopyModel{FT},
Y,
p,
t,
) where {FT}
Returns the surface resistance field of the CanopyModel
canopy.
ClimaLand.surface_specific_humidity
— FunctionClimaLand.surface_specific_humidity(
model::EnergyHydrology{FT},
Y,
p,
T_sfc,
ρ_sfc
) where {FT}
Returns the surface specific humidity field of the EnergyHydrology
soil model.
This models the surface specific humidity as the saturated value multiplied by the factor exp(ψ_sfc g M_w/(RT_sfc))
in accordance with the Clausius-Clapeyron equation, where ψ_sfc
is the matric potential at the surface, T_sfc
the surface temperature, g
the gravitational acceleration on the surface of the Earth, M_w
the molar mass of water, and R
the universal gas constant.
ClimaLand.surface_specific_humidity(model::BucketModel, Y, p)
a helper function which returns the surface specific humidity for the bucket model, which is stored in the aux state.
surface_specific_humidity(model::AbstractModel, Y, p, T_sfc, ρ_sfc)
A helper function which returns the surface specific humidity for a given model, needed because different models compute and store q_sfc in different ways and places.
Extending this function for your model is only necessary if you need to compute surface fluxes and radiative fluxes at the surface using the functions in this file.
ClimaLand.surface_specific_humidity(model::CanopyModel, Y, p)
A helper function which returns the surface specific humidity for the canopy model, which is stored in the aux state.
Missing docstring for ClimaLand.make_update_drivers
. Check Documenter's build log for details.