API reference

Introspection

Agate.Introspection.model_summaryFunction
model_summary(bgc) -> NamedTuple

Return a compact summary of a constructed biogeochemistry instance.

The returned NamedTuple contains:

  • tracers::Vector{Symbol}
  • auxiliary_fields::Vector{Symbol}
  • parameters::Vector{Symbol}
  • has_sinking_velocities::Bool
source
Agate.Introspection.describeFunction
describe([io], bgc; verbose=false)

Print a human-readable summary of bgc.

Set verbose=true to print full tracer / parameter lists.

source
Agate.Introspection.tracer_namesFunction
tracer_names(bgc) -> Vector{Symbol}

Return the ordered tracer symbols required by bgc.

This helper is intended for interactive inspection, so it materializes the underlying tracer-name tuple as a Vector{Symbol}.

The ordering matches Oceananigans / OceanBioME state-vector conventions.

source
Agate.Introspection.auxiliary_field_namesFunction
auxiliary_field_names(bgc) -> Vector{Symbol}

Return the ordered auxiliary field symbols required by bgc.

Auxiliary fields are non-tracer state fields (for example, light or temperature) that appear in tracer tendencies.

source
Agate.Introspection.parameter_namesFunction
parameter_names(bgc) -> Vector{Symbol}

Return the parameter keys available on bgc.parameters.

This list describes the resolved parameter fields available on the constructed biogeochemistry instance.

source
Agate.Introspection.plankton_groupsFunction
plankton_groups(bgc) -> NamedTuple

Return a NamedTuple mapping plankton group symbols to the tracer symbols in each group. The group and tracer order follows the constructed runtime tracer layout.

source
Agate.Introspection.plankton_diametersFunction
plankton_diameters(bgc) -> Vector

Return the equivalent spherical diameters for plankton tracers in the same order as plankton_tracers(bgc). Models without plankton diameter metadata return an empty vector.

source
Agate.Introspection.interaction_matrixFunction
interaction_matrix(bgc, kind::Symbol) -> NamedTuple

Return an interaction matrix with consumer and prey labels.

Supported kind values are the available interaction matrix fields, such as :palatability and :assimilation. The returned NamedTuple contains kind, matrix, rows, columns, row_axis, and column_axis. Matrix orientation follows the runtime container: rows are consumers and columns are prey.

source

Interaction matrix introspection

using Agate
using Agate.Introspection

bgc = Agate.Models.NiPiZD.construct()
pal = interaction_matrix(bgc, :palatability)

pal.rows     # consumer labels
pal.columns  # prey labels
pal.matrix   # consumer-by-prey matrix

Construction API

Agate.Manifests.construct_from_manifestFunction
construct_from_manifest(setup; grid=nothing, arch=nothing) -> bgc
construct_from_manifest(path::AbstractString; grid=nothing, arch=nothing) -> bgc

Reconstruct an Agate biogeochemistry object from an exported model setup.

source
Agate.Equations.CompiledEquationType

Wrap a callable tracer equation in a concrete, type-stable container.

CompiledEquation stores the kernel-callable function used for a single tracer tendency.

source
Agate.Construction.define_tracer_functionsFunction
define_tracer_functions(parameters, tracers; auxiliary_fields=(:PAR,), tracer_index=nothing, sinking_velocities=nothing)

Create an AgateBGCFactory from compiled tracer equations.

tracers must be a NamedTuple that maps tracer names to CompiledEquation values. Each wrapped callable must accept the Oceananigans biogeochemistry kernel signature

f(bgc, x, y, z, t, tracers..., auxiliary_fields...)

Keyword arguments

  • auxiliary_fields: ordered auxiliary values appended to the tracer argument list.
  • tracer_index: explicit positional tracer index. When omitted, a scalar-only index is built from keys(tracers).
  • sinking_velocities: optional prebuilt sinking-velocity fields stored on the resulting factory.
source

Plankton communities and size structure

Agate.Configuration.build_plankton_communityFunction

Build a plankton community from a base community spec.

This helper updates the size structure for one or more plankton groups, leaving all other group fields intact. Size-class counts are inferred from explicit diameter vectors or read from structured size definitions.

The ordering of groups in the returned NamedTuple is the ordering of base (i.e. keys(base)).

Keywords

  • diameters=(; ...): optional per-group size-structure inputs, keyed by group symbol.

Accepted size-structure inputs

Each group size structure must define class diameters either as a generated range or as explicit values. Accepted public forms are:

  • (n=3, min_esd=1, max_esd=10, splitting=:log_splitting) for a generated range.
  • [1.0, 3.2, 10.0] for explicit class diameters.

Examples

community = build_plankton_community(base;
    diameters=(Z=zoo_size_structure, P=phyto_size_structure),
)
source