API

Initial conditions

General

ClimaAtmos.InitialConditions.InitialConditionType
InitialCondition

A mechanism for specifying the LocalState of an AtmosModel at every point in the domain. Given some initial_condition, calling initial_condition(params) returns a function of the form local_state(local_geometry)::LocalState.

source
ClimaAtmos.InitialConditions.hydrostatic_pressure_profileFunction
hydrostatic_pressure_profile(; thermo_params, p_0, [T, θ, q_tot, z_max])

Solves the initial value problem p'(z) = -g * ρ(z) for all z ∈ [0, z_max], given p(0), either T(z) or θ(z), and optionally also q_tot(z). If q_tot(z) is not given, it is assumed to be 0. If z_max is not given, it is assumed to be 30 km. Note that z_max should be the maximum elevation to which the specified profiles T(z), θ(z), and/or q_tot(z) are valid.

source

Plane / Box

ClimaAtmos.InitialConditions.ConstantBuoyancyFrequencyProfileType
ConstantBuoyancyFrequencyProfile()

An InitialCondition with a constant Brunt-Vaisala frequency and constant wind velocity, where the pressure profile is hydrostatically balanced. This is currently the only InitialCondition that supports the approximation of a steady-state solution.

source

Sphere

Cases from literature

Jacobian

ClimaAtmos.JacobianType
Jacobian(alg, Y, atmos)

Wrapper for a JacobianAlgorithm and its cache, which it uses to update and invert the Jacobian.

source
ClimaAtmos.JacobianAlgorithmType
JacobianAlgorithm

A description of how to compute the matrix $∂R/∂Y$, where $R(Y)$ denotes the residual of an implicit step with the state $Y$. Concrete implementations of this abstract type should define 3 methods:

  • jacobian_cache(alg::JacobianAlgorithm, Y, atmos)
  • update_jacobian!(alg::JacobianAlgorithm, cache, Y, p, dtγ, t)
  • invert_jacobian!(alg::JacobianAlgorithm, cache, ΔY, R)

See Implicit Solver for additional background information.

source
ClimaAtmos.ManualSparseJacobianType
ManualSparseJacobian(
    topography_flag,
    diffusion_flag,
    sgs_advection_flag,
    sgs_entr_detr_flag,
    sgs_mass_flux_flag,
    sgs_nh_pressure_flag,
    approximate_solve_iters,
)

A JacobianAlgorithm that approximates the Jacobian using analytically derived tendency derivatives and inverts it using a specialized nested linear solver. Certain groups of derivatives can be toggled on or off by setting their DerivativeFlags to either UseDerivative or IgnoreDerivative.

Arguments

  • topography_flag::DerivativeFlag: whether the derivative of vertical contravariant velocity with respect to horizontal covariant velocity should be computed
  • diffusion_flag::DerivativeFlag: whether the derivatives of the grid-scale diffusion tendency should be computed
  • sgs_advection_flag::DerivativeFlag: whether the derivatives of the subgrid-scale advection tendency should be computed
  • sgs_entr_detr_flag::DerivativeFlag: whether the derivatives of the subgrid-scale entrainment and detrainment tendencies should be computed
  • sgs_mass_flux_flag::DerivativeFlag: whether the derivatives of the subgrid-scale mass flux tendency should be computed
  • sgs_nh_pressure_flag::DerivativeFlag: whether the derivatives of the subgrid-scale non-hydrostatic pressure drag tendency should be computed
  • approximate_solve_iters::Int: number of iterations to take for the approximate linear solve required when the diffusion_flag is UseDerivative
source

Helper

ClimaAtmos.InitialConditions.ColumnInterpolatableFieldType
ColumnInterpolatableField(::Fields.ColumnField)

A column field object that can be interpolated in the z-coordinate. For example:

cif = ColumnInterpolatableField(column_field)
z = 1.0
column_field_at_z = cif(z)
Warn

This function allocates and is not GPU-compatible so please avoid using this inside step! only use this for initialization.

source