<!– # Shared Utilities

Domains

ClimaLand.Domains.AbstractDomainType
AbstractDomain{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.

source
ClimaLand.Domains.SphericalShellType
struct 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 shell

  • depth: The radial extent of the shell

  • dz_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 directions

  • npolynomial: The polynomial order to be used in the non-radial directions

  • space: A NamedTuple of associated ClimaCore spaces: in this case, the surface space and subsurface center space

  • fields: Fields associated with the coordinates of the domain that are useful to store

source
ClimaLand.Domains.SphericalSurfaceType
struct 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 surface

  • nelements: The number of elements to be used in the non-radial directions

  • npolynomial: The polynomial order to be used in the non-radial directions

  • space: A NamedTuple of associated ClimaCore spaces: in this case, the surface (SphericalSurface) space

source
ClimaLand.Domains.HybridBoxType
struct HybridBox{FT} <: AbstractDomain{FT}
    xlim::Tuple{FT, FT}
    ylim::Tuple{FT, FT}
    zlim::Tuple{FT, FT}
    longlat::Union{Nothing, 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 no-flow boundary conditions are supported in the horizontal.

When longlat is not nothing, assume that the box describes a region on the globe centered around the long and lat.

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 meters or degrees (if latlong != nothing)

  • ylim: Domain interval limits along y axis, in meters or degrees (if latlong != nothing)

  • zlim: Domain interval limits along z axis, in meters

  • longlat: When not nothing, a Tuple that contains the center long and lat.

  • dz_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 directions

  • periodic: Flag indicating periodic boundaries in horizontal

  • space: A NamedTuple of associated ClimaCore spaces: in this case, the surface space and subsurface center space

  • fields: Fields associated with the coordinates of the domain that are useful to store

source
ClimaLand.Domains.ColumnType
Column{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 meters

  • nelements: Number of elements used to discretize the interval

  • dz_tuple: Tuple for mesh stretching specifying target (dzbottom, dztop) (m). If nothing, no stretching is applied.

  • boundary_names: Boundary face identifiers

  • space: A NamedTuple of associated ClimaCore spaces: in this case, the surface space and subsurface center space

  • fields: Fields associated with the coordinates of the domain that are useful to store

source
ClimaLand.Domains.PlaneType
Plane{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.

When longlat is not nothing, the plane is assumed to be centered around these coordinates. In this case, the curvature of the Earth is not accounted for.

longlat are in degrees, with longitude going from -180 to 180.

:warning: Only independent columns are supported! (No lateral flow).

space is a NamedTuple holding the surface space (in this case, the entire Plane space).

Fields

  • xlim: Domain interval limits along x axis, in meters or degrees (if latlong != nothing)

  • ylim: Domain interval limits along y axis, in meters or degrees (if latlong != nothing)

  • longlat: When not nothing, a Tuple that contains the center long and lat (in degrees, with long from -180 to 180).

  • nelements: Number of elements to discretize interval, (nx, ny)

  • periodic: Flags for periodic boundaries. Only periodic or no lateral flow is supported.

  • npolynomial: Polynomial order for both x and y

  • space: A NamedTuple of associated ClimaCore spaces: in this case, the surface(Plane) space

source
ClimaLand.Domains.PointType
Point{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

source
ClimaLand.Domains.coordinatesFunction
coordinates(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.

source
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.

source
ClimaLand.Domains.obtain_face_spaceFunction
obtain_face_space(cs::ClimaCore.Spaces.AbstractSpace)

Returns the face space, if applicable, for the center space cs.

source
obtain_face_space(cs::ClimaCore.Spaces.CenterExtrudedFiniteDifferenceSpace)

Returns the face space for the CenterExtrudedFiniteDifferenceSpace cs.

source
obtain_face_space(cs::ClimaCore.Spaces.CenterFiniteDifferenceSpace)

Returns the face space corresponding to the CenterFiniteDifferenceSpace cs.

source
ClimaLand.Domains.obtain_surface_spaceFunction
obtain_surface_space(cs::ClimaCore.Spaces.AbstractSpace)

Returns the surface space, if applicable, for the center space cs.

source
obtain_surface_space(cs::ClimaCore.Spaces.CenterExtrudedFiniteDifferenceSpace)

Returns the horizontal space for the CenterExtrudedFiniteDifferenceSpace cs.

source
obtain_surface_space(cs::ClimaCore.Spaces.CenterFiniteDifferenceSpace)

Returns the top level of the face space corresponding to the CenterFiniteDifferenceSpace cs.

source
ClimaLand.Domains.obtain_surface_domainFunction
obtain_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.

source
obtain_surface_domain(c::Column{FT}) where {FT}

Returns the Point domain corresponding to the top face (surface) of the Column domain c.

source
obtain_surface_domain(b::HybridBox{FT}) where {FT}

Returns the Plane domain corresponding to the top face (surface) of the HybridBox domain b.

source
obtain_surface_domain(s::SphericalShell{FT}) where {FT}

Returns the SphericalSurface domain corresponding to the top face (surface) of the SphericalShell domain s.

source
ClimaLand.Domains.top_center_to_surfaceFunction
top_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.

source
top_center_to_surface(val)

When val is a scalar (e.g. a single float or struct), returns val.

source
ClimaLand.Domains.top_face_to_surfaceFunction
top_face_to_surface(face_field::ClimaCore.Fields.Field, surface_space)

Creates and returns a ClimaCore.Fields.Field defined on the space corresponding to the surface of the space on which face_field is defined, with values equal to the those at the level of the top face.

Given a face_field defined on a 3D extruded face finite difference space, this would return a 2D field corresponding to the surface, with values equal to the topmost level.

source
ClimaLand.Domains.linear_interpolation_to_surface!Function
linear_interpolation_to_surface!(sfc_field, center_field, z, Δz_top)

Linearly interpolate the center field center_field to the surface defined by the top face coordinate of z with a center to face distance Δz_top in the first layer; updates the sfc_field on the surface (face) space in place.

source
ClimaLand.Domains.get_ΔzFunction
get_Δ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. It also returns the widths of each layer as a field.

source

Models

ClimaLand.AbstractImExModelType
AbstractImExModel{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.

source
ClimaLand.AbstractExpModelType
AbstractExpModel{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.

source
ClimaLand.make_exp_tendencyFunction
make_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.

source
ClimaLand.make_imp_tendencyFunction
make_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.

source
make_imp_tendency(model::AbstractModel)

Returns an imp_tendency that does nothing. This model type is not stepped explicity.

source
ClimaLand.make_compute_exp_tendencyFunction
make_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.

source
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.

source
make_compute_exp_tendency(model::BucketModel{FT}) where {FT}

Creates the computeexptendency! function for the bucket model.

source
make_compute_exp_tendency(model::AbstractModel)

Return a compute_exp_tendency! function that updates state variables that we will be stepped explicitly. This fallback sets all tendencies of this model to zero, which is appropriate for models that do not have any explicit tendencies to update. Note that we cannot set dY .= 0 here because this would overwrite the tendencies of all models in the case of an integrated LSM.

compute_exp_tendency! should be compatible with SciMLBase.jl solvers.

source
 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.

source
make_compute_exp_tendency(canopy::CanopyModel)

Creates and returns the computeexptendency! for the CanopyModel.

source
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.

source
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))"

source
ClimaLand.make_compute_imp_tendencyFunction
make_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.

source
make_compute_imp_tendency(model::EnergyHydrology)

An extension of the function make_compute_imp_tendency, for the integrated soil energy and heat equations, including phase change.

This version of this function computes the right hand side of the PDE for Y.soil.ϑ_l, which is the only quantity we currently step implicitly.

This has been written so as to work with Differential Equations.jl.

source
make_compute_imp_tendency(model::AbstractModel)

Return a compute_imp_tendency! function that updates state variables that we will be stepped implicitly. This fallback sets all tendencies of this model to zero, which is appropriate for models that do not have any implicit tendencies to update. Note that we cannot set dY .= 0 here because this would overwrite the tendencies of all models in the case of an integrated LSM.

compute_imp_tendency! should be compatible with SciMLBase.jl solvers.

source
 ClimaLand.make_compute_imp_tendency(component::AbstractCanopyComponent, canopy)

Creates the computeimptendency!(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.

source
make_compute_imp_tendency(canopy::CanopyModel)

Creates and returns the computeimptendency! for the CanopyModel.

source
ClimaLand.make_update_auxFunction
make_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.

source
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.

source
make_update_aux(model::BucketModel{FT}) where {FT}

Creates the update_aux! function for the BucketModel.

source
make_update_aux(model::AbstractModel)

Return an update_aux! function that updates auxiliary parameters p.

source
 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.

source
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.

source
ClimaLand.make_update_boundary_fluxesFunction
make_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..

source
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.

source
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.

source
make_update_boundary_fluxes(
    land::SoilSnowModel{FT, SnM, SoM},
) where {
    FT,
    SnM <: Snow.SnowModel{FT},
    SoM <: Soil.EnergyHydrology{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.

In this method, we

  1. Compute the ground heat flux between soil and snow. This is required to update the snow and soil boundary fluxes
  2. Update the snow boundary fluxes, which also computes any excess flux of energy or water which occurs when the snow

completely melts in a step. In this case, that excess must go to the soil for conservation

  1. Update the soil boundary fluxes use precomputed ground heat flux and excess fluxes from snow.
  2. Compute the net flux for the atmosphere, which is useful for assessing conservation.
source
make_update_boundary_fluxes(
    land::LandModel{FT, MM, SM, RM, SnM},
) where {
    FT,
    MM <: Soil.Biogeochemistry.SoilCO2Model{FT},
    SM <: Soil.RichardsModel{FT},
    RM <: Canopy.CanopyModel{FT}
    SnM <: Snow.SnowModel{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.

source
ClimaLand.make_set_initial_cacheFunction
make_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.

source
ClimaLand.make_update_driversFunction
make_update_drivers(::AbstractClimaLandDrivers)

Creates and returns a function which updates the driver variables in the default case of no drivers. More generally, this should return a function which updates the driver fields stored in p.drivers.

source
make_update_drivers(driver_tuple)

Creates and returns a function which updates the forcing variables ("drivers"). If no drivers are being used, driver_tuple is empty, and the update function does nothing.

source
make_update_drivers(a::PrescribedAtmosphere{FT}) where {FT}

Creates and returns a function which updates the driver variables in the case of a PrescribedAtmosphere.

source
make_update_drivers(a::PrescribedPrecipitation{FT}) where {FT}

Creates and returns a function which updates the driver variables in the case of a PrescribedPrecipitation.

source
make_update_drivers(r::PrescribedRadiativeFluxes{FT}) where {FT}

Creates and returns a function which updates the driver variables in the case of a PrescribedRadiativeFluxes.

source
make_update_drivers(d::PrescribedSoilOrganicCarbon{FT}) where {FT}

Creates and returns a function which updates the driver variables in the case of a PrescribedSoilOrganicCarbon.

source
ClimaLand.prognostic_varsFunction
prognostic_vars(soil::RichardsModel)

A function which returns the names of the prognostic variables of RichardsModel.

source
prognostic_vars(soil::EnergyHydrology)

A function which returns the names of the prognostic variables of EnergyHydrology.

source
prognostic_vars(::SnowModel)

Returns the prognostic variable names of the snow model.

For this model, we track the snow water equivalent S in meters (liquid water volume per ground area) and the energy per unit ground area U [J/m^2] prognostically.

source

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.

source
ClimaLand.prognostic_vars(::AbstractCanopyComponent)

Returns the prognostic vars of the canopy component passed in as an argument.

source
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.

source
prognostic_vars(model::PlantHydraulicsModel)

A function which returns the names of the prognostic variables of the PlantHydraulicsModel.

source
ClimaLand.prognostic_typesFunction
prognostic_types(soil::EnergyHydrology{FT}) where {FT}

A function which returns the types of the prognostic variables of EnergyHydrology.

source
prognostic_types(::SnowModel{FT})

Returns the prognostic variable types of the snow model; both snow water equivalent and energy per unit area are scalars.

source

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.

source
ClimaLand.prognostic_types(::AbstractCanopyComponent)

Returns the prognostic types of the canopy component passed in as an argument.

source
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.

source
ClimaLand.prognostic_types(model::PlantHydraulicsModel{FT}) where {FT}

Defines the prognostic types for the PlantHydraulicsModel.

source
ClimaLand.prognostic_domain_namesFunction
prognostic_domain_names(::SnowModel)

Returns the prognostic variable domain names of the snow model; both snow water equivalent and energy per unit area are modeling only as a function of (x,y), and not as a function of depth. Therefore their domain name is ":surface".

source

prognosticdomainnames(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.

source

prognosticdomainnames(m::AbstractCanopyComponent)

Returns the domain names for the prognostic variables in the form of a tuple.

source
ClimaLand.auxiliary_varsFunction
auxiliary_vars(soil::RichardsModel)

A function which returns the names of the auxiliary variables of RichardsModel.

source
auxiliary_vars(soil::EnergyHydrology)

A function which returns the names of the auxiliary variables of EnergyHydrology.

source
auxiliary_vars(::SnowModel)

Returns the auxiliary variable names for the snow model. These include the mass fraction in liquid water (q_l, unitless), the thermal conductivity (κ, W/m/K), the bulk temperature (T, K), the surface temperature (T_sfc, K), the bulk snow density (ρ_snow, kg/m^3) the SHF, LHF, and vapor flux (turbulent_fluxes.shf, etc), the net radiation (R_n, J/m^2/s), the energy flux in liquid water runoff (energy_runoff, J/m^2/s), the water volume in runoff (water_runoff, m/s), and the total energy and water fluxes applied to the snowpack.

Since the snow can melt completely in one timestep, we clip the water and energy fluxes such that SWE cannot become negative and U cannot become unphysical. The clipped values are what are actually applied as boundary fluxes, and are stored in applied_ fluxes.

source

auxiliary_vars(m::AbstractModel)

Returns the auxiliary variable symbols for the model in the form of a tuple.

source
ClimaLand.auxiliary_vars(::AbstractCanopyComponent)

Returns the auxiliary types of the canopy component passed in as an argument.

source
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.

source
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.

source
ClimaLand.auxiliary_typesFunction
auxiliary_types(soil::RichardsModel)

A function which returns the names of the auxiliary types of RichardsModel.

source
auxiliary_types(soil::EnergyHydrology{FT}) where {FT}

A function which returns the types of the auxiliary variables of EnergyHydrology.

source

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).

source
ClimaLand.auxiliary_types(::AbstractCanopyComponent)

Returns the auxiliary types of the canopy component passed in as an argument.

source
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.

source
ClimaLand.auxiliary_types(model::PlantHydraulicsModel{FT}) where {FT}

Defines the auxiliary types for the PlantHydraulicsModel.

source
ClimaLand.auxiliary_domain_namesFunction
auxiliary_domain_names(soil::RichardsModel)

A function which returns the names of the auxiliary domain names of RichardsModel.

source

auxiliarydomainnames(m::AbstractModel)

Returns the domain names for the auxiliary variables in the form of a tuple.

Examples: (:surface, :surface, :subsurface).

source

auxiliarydomainnames(m::AbstractCanopyComponent)

Returns the domain names for the auxiliary variables in the form of a tuple.

source
ClimaLand.initialize_prognosticFunction
initialize_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.

source
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.

source
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.

source
ClimaLand.initialize_auxiliaryFunction
initialize_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.

source
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.

source
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.

source
ClimaLand.initializeFunction
initialize(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.

source
ClimaLand.nameFunction
name(model::AbstractModel)

Returns a symbol of the model component name, e.g. :soil or :vegetation.

source
ClimaLand.AbstractBCType
AbstractBC

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.

source
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
 source!(dY::ClimaCore.Fields.FieldVector,
         src::SoilSublimation{FT},
         Y::ClimaCore.Fields.FieldVector,
         p::NamedTuple,
         model
         )

Updates dY.soil.θ_i in place with a term due to sublimation; this only affects the surface layer of soil.

source
 source!(dY::ClimaCore.Fields.FieldVector,
         src::AbstractSource,
         Y::ClimaCore.Fields.FieldVector,
         p::NamedTuple
         )::ClimaCore.Fields.Field

A stub function, which is extended by ClimaLand.

source
 source!(dY::ClimaCore.Fields.FieldVector,
         src::SoilSublimationwithSnow{FT},
         Y::ClimaCore.Fields.FieldVector,
         p::NamedTuple,
         model
         )

Updates dY.soil.θ_i in place with a term due to sublimation; this only affects the surface layer of soil.

source
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.

source
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.

source
ClimaLand.source!(
    dY::ClimaCore.Fields.FieldVector,
    src::TOPMODELSubsurfaceRunoff,
    Y::ClimaCore.Fields.FieldVector,
    p::NamedTuple,
    model::AbstractSoilModel{FT},
) where {FT}

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(twc - ν), where H is the Heaviside function, h∇ is the water table thickness (defined to be where twc>ν), where twc is the total water content, and Rss is the runoff as a flux(m/s).

source
ClimaLand.AbstractBoundaryType
AbstractBoundary

An abstract type to indicate which boundary we are doing calculations for. Currently, we support the top boundary (TopBoundary) and bottom boundary (BottomBoundary).

source
ClimaLand.TopBoundaryType
TopBoundary{} <: AbstractBoundary{}

A simple object which should be passed into a function to indicate that we are considering the top boundary.

source
ClimaLand.BottomBoundaryType
BottomBoundary{} <: AbstractBoundary{}

A simple object which should be passed into a function to indicate that we are considering the bottom boundary.

source
ClimaLand.boundary_flux!Function
boundary_flux!(bc_field, bc::WaterFluxBC,  _...)

A method of boundary fluxes which updates the desired flux.

source
boundary_flux!(bc_field, bc::RichardsAtmosDrivenFluxBC,
                       boundary::ClimaLand.AbstractBoundary,
                       model::RichardsModel{FT},
                       Δz::ClimaCore.Fields.Field,
                       Y::ClimaCore.Fields.FieldVector,
                       p::NamedTuple,
                       t,
                       ) 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.

source
boundary_flux!(bc_field, rre_bc::MoistureStateBC,
                       ::ClimaLand.TopBoundary,
                       model::AbstractSoilModel,
                       Δz::ClimaCore.Fields.Field,
                       Y::ClimaCore.Fields.FieldVector,
                       p::NamedTuple,
                       t,
                       )

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.

source
boundary_flux!(bc_field, rre_bc::MoistureStateBC,
                       ::ClimaLand.BottomBoundary,
                       model::AbstractSoilModel,
                       Δz::ClimaCore.Fields.Field,
                       Y::ClimaCore.Fields.FieldVector,
                       p::NamedTuple,
                       t,
                       )

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.

source
boundary_flux!(bc_field, bc::FreeDrainage,
                       boundary::ClimaLand.BottomBoundary,
                       model::AbstractSoilModel,
                       Δz::ClimaCore.Fields.Field,
                       Y::ClimaCore.Fields.FieldVector,
                       p::NamedTuple,
                       t,
                       )

A method of boundary fluxes which enforces free drainage at the bottom of the domain.

source
boundary_flux!(bc_field, bc::HeatFluxBC,  _...)

A method of boundary fluxes which updates the desired flux.

source
boundary_flux!(bc_field, heat_bc::TemperatureStateBC,
                       ::ClimaLand.TopBoundary,
                       model::EnergyHydrology,
                       Δz::ClimaCore.Fields.Field,
                       Y::ClimaCore.Fields.FieldVector,
                       p::NamedTuple,
                       t,
                       ):

A method of boundary fluxes which converts a state boundary condition on temperature at the top of the domain into a flux of energy.

source
boundary_flux!(bc_field, heat_bc::TemperatureStateBC,
                       ::ClimaLand.BottomBoundary,
                       model::EnergyHydrology,
                       Δz::ClimaCore.Fields.Field,
                       Y::ClimaCore.Fields.FieldVector,
                       p::NamedTuple,
                       t,
                       )

A method of boundary fluxes which converts a state boundary condition on temperature at the bottom of the domain into a flux of energy.

source
boundary_flux!(bc_field, bc::AbstractBC, bound_type::AbstractBoundary, Δz, _...)

A function which updates bc_field with the correct boundary flux given any boundary condition (BC).

source
function ClimaLand.boundary_flux!(bc_field,
    bc::RunoffBC,
    ::TopBoundary,
    model::Soil.RichardsModel,
    Δz::FT,
    Y::ClimaCore.Fields.FieldVector,
    p::NamedTuple,
    t,
    params,
)

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).

source
ClimaLand.boundary_flux!(bc_field,
    bc::SoilCO2FluxBC,
    boundary::ClimaLand.AbstractBoundary,
    Δz::ClimaCore.Fields.Field,
    Y::ClimaCore.Fields.FieldVector,
    p::NamedTuple,
    t,
)

A method of ClimaLand.boundary_flux which updates 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.

source
ClimaLand.boundary_flux!(bc_field,
bc::SoilCO2StateBC,
boundary::ClimaLand.TopBoundary,
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)

A method of ClimaLand.boundary_flux which returns the soilco2 flux in the case of a prescribed state BC at top of the domain.

source
ClimaLand.boundary_flux!(bc_field,
    bc::SoilCO2StateBC,
    boundary::ClimaLand.BottomBoundary,
    Δz::ClimaCore.Fields.Field,
    Y::ClimaCore.Fields.FieldVector,
    p::NamedTuple,
    t,
)

A method of ClimaLand.boundary_flux which returns the soilco2 flux in the case of a prescribed state BC at bottom of the domain.

source
ClimaLand.boundary_flux!(bc_field,
bc::AtmosCO2StateBC,
boundary::ClimaLand.TopBoundary,
Δz::ClimaCore.Fields.Field,
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
)

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.

source
ClimaLand.diffusive_fluxFunction
diffusive_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.

source
ClimaLand.boundary_varsFunction
boundary_vars(::RichardsAtmosDrivenFluxBC{<:PrescribedPrecipitation,
                                          <:Runoff.AbstractRunoffModel,
                                          }, ::ClimaLand.TopBoundary)

An extension of the boundary_vars method for RichardsAtmosDrivenFluxBC with runoff.

These variables are updated in place in boundary_flux!.

source
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!.

source
boundary_vars(::MoistureStateBC, ::ClimaLand.TopBoundary)

An extension of the boundary_vars method for MoistureStateBC at the top boundary.

These variables are updated in place in boundary_flux!.

source
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.

The field top_bc_wvec is created to prevent allocations only; it is used in the tendency function only.

Use this function in the exact same way you would use auxiliary_vars.

source
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.

The field bottom_bc_wvec is created to prevent allocations only; it is used in the tendency function only.

Use this function in the exact same way you would use auxiliary_vars.

source
ClimaLand.boundary_var_domain_namesFunction
boundary_var_domain_names(::RichardsAtmosDrivenFluxBC{<:PrescribedPrecipitation,
                                          <:Runoff.AbstractRunoffModel,
                                          },
                          ::ClimaLand.TopBoundary)

An extension of the boundary_var_domain_names method for RichardsAtmosDrivenFluxBC with runoff.

source
boundary_var_domain_names(::AtmosDrivenFluxBC,
                          ::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.

source
boundary_var_domain_names(::MoistureStateBC, ::ClimaLand.TopBoundary)

An extension of the boundary_var_domain_names method for MoistureStateBC at the top boundary.

source
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.

source
ClimaLand.boundary_var_typesFunction
boundary_var_types(::RichardsModel{FT},
                    ::RichardsAtmosDrivenFluxBC{<:PrescribedPrecipitation,
                                                <: Runoff.AbstractRunoffModel,
                                              },
                    ::ClimaLand.TopBoundary,
                    ) where {FT}

An extension of the boundary_var_types method for RichardsAtmosDrivenFluxBC with runoff.

source
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.

source
boundary_var_types(
    ::EnergyHydrology{FT},
    ::AtmosDrivenFluxBC,
    ::ClimaLand.TopBoundary,
) where {FT}

An extension of the boundary_var_types method for AtmosDrivenFluxBC. This specifies the type of the additional variables.

source
boundary_var_types(::RichardsModel{FT},
                    ::MoistureStateBC,
                    ::ClimaLand.TopBoundary,
                    ) where {FT}

An extension of the boundary_var_types method for MoistureStateBC at the top boundary.

source
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.

source
ClimaLand.make_jacobianFunction

make_jacobian(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 jacobian! should be used as Wfact! in ClimaTimeSteppers.jl and SciMLBase.jl.

source
ClimaLand.make_compute_jacobianFunction
ClimaLand.make_compute_jacobian(model::RichardsModel{FT}) where {FT}

Creates and returns the compute_jacobian! function for RichardsModel. This updates the contribution for the soil liquid water content.

Using this Jacobian with a backwards Euler timestepper is equivalent to using the modified Picard scheme of Celia et al. (1990).

source
ClimaLand.make_compute_jacobian(model::EnergyHydrology{FT}) where {FT}

Creates and returns the compute_jacobian! function for the EnergyHydrology model. This updates the contribution for the soil liquid water content only.

Using this Jacobian with a backwards Euler timestepper is equivalent to using the modified Picard scheme of Celia et al. (1990).

source
make_compute_jacobian(model::AbstractModel)

Creates and returns a function which computes 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, but this function must be extended for models that use implicit timestepping.

source
ClimaLand.make_compute_jacobian(canopy::CanopyModel)

Creates and returns the compute_jacobian! for the CanopyModel.

source
ClimaLand.set_dfluxBCdY!Function
ClimaLand.set_dfluxBCdY!(
    model::RichardsModel,
    ::MoistureStateBC,
    boundary::ClimaLand.TopBoundary,
    Δz,
    Y,
    p,
    t,

)

Computes the derivative of the flux in the top layer (due to the boundary condition), with respect to the state variable in the top layer. This value is then updated in-place in the cache.

For Richards equation (a diffusion equation with a single state variable), this is given by ∂F_bc/∂Y_N= -K_N (∂ψ_bc/∂ϑ_N) / Δz, where N indicates the top layer cell index and ψ_bc is the pressure head at the boundary condition.

source
set_dfluxBCdY!(::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.

source
ClimaLand.get_driversFunction
ClimaLand.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.

source
ClimaLand.get_drivers(model::SnowModel)

Returns the driver variable symbols for the SnowModel.

source
get_drivers(model::AbstractModel)

Returns the driver objects for the model - atmospheric and radiative forcing, etc - as a tuple (atmos, radiation, ...). If no drivers are needed by a model, an empty tuple should be returned

source
ClimaLand.get_drivers(model::LandModel)

Returns the "drivers", or forcing variables, for the LandModel.

These consist of atmospheric and radiative forcing, as well as soil organic carbon.

source

Drivers

ClimaLand.PrescribedAtmosphereType
PrescribedAtmosphere{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 definition

  • snow_precip: Snow precipitation (m/s) function of time: positive by definition

  • T: 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)

  • start_date: Start date - the datetime corresponding to t=0 for the simulation

  • h: Reference height (m), relative to surface elevation

  • gustiness: Minimum wind speed (gustiness; m/s)

  • thermo_params: Thermodynamic parameters

source
ClimaLand.PrescribedPrecipitationType
PrescribedPrecipitation{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
source
ClimaLand.PrescribedRadiativeFluxesType
PrescribedRadiativeFluxes{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 surface

  • LW_d: Downward longwave radiation function of time (W/m^2): positive indicates towards surface

  • start_date: Start date - the datetime corresponding to t=0 for the simulation

  • θs: Sun zenith angle, in radians

source
ClimaLand.turbulent_fluxesFunction
turbulent_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.

source
turbulent_fluxes(atmos::CoupledAtmosphere,
                model::AbstractModel,
                Y,
                p,
                t)

Computes the turbulent surface fluxes terms at the ground for a coupled simulation.

source
function ClimaLand.turbulent_fluxes(
    atmos::PrescribedAtmosphere,
    model::CanopyModel,
    Y::ClimaCore.Fields.FieldVector,
    p::NamedTuple,
    t,
)

A canopy specific function for compute turbulent fluxes with the atmosphere; returns the latent heat flux, sensible heat flux, vapor flux, and aerodynamic resistance.

We cannot use the default version in src/shared_utilities/drivers.jl because the canopy requires a different resistance for vapor and sensible heat fluxes, and the resistances depend on ustar, which we must compute using SurfaceFluxes before adjusting to account for these resistances.

source
ClimaLand.turbulent_fluxes_at_a_pointFunction
turbulent_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.

Please note that this function, if rsfc is set to zero, makes no alteration to the output of the `SurfaceFluxes.surfaceconditions` call, aside from unit conversion of evaporation from a mass to a liquid water volume flux. When r_sfc is nonzero, an additional resistance is applied in series to the vapor flux (and hence also the latent heat flux).

source
ClimaLand.set_atmos_ts!Function
set_atmos_ts!(ts_in, atmos::PrescribedAtmosphere{FT}, p)

Fill the pre-allocated ts_in Field with a thermodynamic state computed from the atmosphere.

source
ClimaLand.surface_air_densityFunction
surface_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.

source
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.

source
ClimaLand.surface_temperatureFunction
ClimaLand.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.

source
ClimaLand.surface_temperature(model::SnowModel, Y, p)

a helper function which returns the surface temperature for the snow model, which is stored in the aux state.

source
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.

source
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.

source
ClimaLand.surface_temperature(model::CanopyModel, Y, p, t)

A helper function which returns the temperature for the canopy model.

source
ClimaLand.surface_resistanceFunction
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.

source
ClimaLand.surface_resistance(
    model::CanopyModel{FT},
    Y,
    p,
    t,
) where {FT}

Returns the stomatal resistance field of the CanopyModel canopy.

source
ClimaLand.surface_specific_humidityFunction
ClimaLand.surface_specific_humidity(model::SnowModel, Y, p)

Computes and returns the specific humidity over snow as a weighted fraction of the saturated specific humidity over liquid and frozen water.

source
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.

source
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.

source

–>