ClimaLand 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.
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 spacefields
: Fields and field data associated with the coordinates of the domain that are useful to store
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}
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 (iflatlong != nothing
)ylim
: Domain interval limits along y axis, in meters or degrees (iflatlong != nothing
)zlim
: Domain interval limits along z axis, in meterslonglat
: When notnothing
, a Tuple that contains the centerlong
andlat
.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 directionsperiodic
: Flag indicating periodic boundaries in horizontalspace
: A NamedTuple of associated ClimaCore spaces: in this case, the surface space and subsurface center spacefields
: Fields and field data associated with the coordinates of the domain that are useful to store
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 spacefields
: Fields and field data associated with the coordinates of the domain that are useful to store
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.
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 (iflatlong != nothing
)ylim
: Domain interval limits along y axis, in meters or degrees (iflatlong != nothing
)longlat
: When notnothing
, a Tuple that contains the centerlong
andlat
(in degrees, withlong
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 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_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.FiniteDifferenceSpace)
Returns the top level of the face space corresponding to the input space 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.
top_center_to_surface(val)
When val
is a scalar (e.g. a single float or struct), returns val
.
ClimaLand.Domains.top_face_to_surface
— Functiontop_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.
ClimaLand.Domains.linear_interpolation_to_surface!
— Functionlinear_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.
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. It also returns the widths of each layer as a field.