Single Stack Utils

Functions

ClimateMachine.SingleStackUtils.get_vars_from_nodal_stackFunction
get_vars_from_nodal_stack(
    grid::DiscontinuousSpectralElementGrid{T, dim, N},
    Q::MPIStateArray,
    vars;
    vrange::UnitRange = 1:size(Q, 3),
    i::Int = 1,
    j::Int = 1,
    exclude::Vector{String} = String[],
) where {T, dim, N}

Return a dictionary whose keys are the flattenednames() of the variables specified in vars (as returned by e.g. vars_state), and whose values are arrays of the values for that variable along the vertical dimension in Q. Only a single element is expected in the horizontal as this is intended for the single stack configuration and i and j identify the horizontal nodal coordinates.

Variables listed in exclude are skipped.

source
ClimateMachine.SingleStackUtils.get_horizontal_meanFunction
get_horizontal_mean(
    grid::DiscontinuousSpectralElementGrid{T, dim, N},
    Q::MPIStateArray,
    vars;
    vrange::UnitRange = 1:size(Q, 3),
    exclude::Vector{String} = String[],
) where {T, dim, N}

Return a dictionary whose keys are the flattenednames() of the variables specified in vars (as returned by e.g. vars_state), and whose values are arrays of the horizontal averages for that variable along the vertical dimension in Q. Only a single element is expected in the horizontal as this is intended for the single stack configuration.

Variables listed in exclude are skipped.

source
ClimateMachine.SingleStackUtils.get_horizontal_varianceFunction
get_horizontal_variance(
    grid::DiscontinuousSpectralElementGrid{T, dim, N},
    Q::MPIStateArray,
    vars;
    vrange::UnitRange = 1:size(Q, 3),
    exclude::Vector{String} = String[],
) where {T, dim, N}

Return a dictionary whose keys are the flattenednames() of the variables specified in vars (as returned by e.g. vars_state), and whose values are arrays of the horizontal variance for that variable along the vertical dimension in Q. Only a single element is expected in the horizontal as this is intended for the single stack configuration.

Variables listed in exclude are skipped.

source
ClimateMachine.SingleStackUtils.reduce_nodal_stackFunction
reduce_nodal_stack(
    op::Function,
    grid::DiscontinuousSpectralElementGrid{T, dim, N},
    Q::MPIStateArray,
    vars::NamedTuple,
    var::String;
    vrange::UnitRange = 1:size(Q, 3),
) where {T, dim, N}

Reduce var from vars within Q over all nodal points in the specified vrange of elements with op. Return a tuple (result, z) where result is the final value returned by op and z is the index within vrange where the result was determined.

source
ClimateMachine.SingleStackUtils.reduce_element_stackFunction
reduce_element_stack(
    op::Function,
    grid::DiscontinuousSpectralElementGrid{T, dim, N},
    Q::MPIStateArray,
    vars::NamedTuple,
    var::String;
    vrange::UnitRange = 1:size(Q, 3),
) where {T, dim, N}

Reduce var from vars within Q over all nodal points in the specified vrange of elements with op. Return a tuple (result, z) where result is the final value returned by op and z is the index within vrange where the result was determined.

source
ClimateMachine.SingleStackUtils.horizontally_average!Function
horizontally_average!(
    grid::DiscontinuousSpectralElementGrid{T, dim, N},
    Q::MPIStateArray,
    i_vars,
) where {T, dim, N}

Horizontally average variables, from variable indexes i_vars, in MPIStateArray Q.

Note

These are not proper horizontal averages– the main purpose of this method is to ensure that there are no horizontal fluxes for a single stack configuration.

source
ClimateMachine.SingleStackUtils.dict_of_nodal_statesFunction
dict_of_nodal_states(
    solver_config,
    aux_excludes = [],
    state_types = (Prognostic(), Auxiliary())
    )

A dictionary of single stack prognostic and auxiliary variables at the i=1,j=1 node given

  • solver_config a SolverConfiguration
  • aux_excludes a vector of strings containing the variables to exclude from the auxiliary state.
source