Constructors
Agate.Constructors.NPZD_size_structured.construct_size_structured_NPZD
— FunctionConstruct an instance of an size-structured NPZD model.
This constructor builds a size-structured plankton model with two plankton functional types: phytoplankton (P) and zooplankton (Z), each of which can be specified to have any number of size classes (n_phyto
and n_zoo
). In addition to plankton, the constructor implements idealized detritus (D) and nutrient (N) cycling by default, although more complex N and D cycling can also be defined using the nutrient_dynamics
and detritus_dynamics
arguments.
During model construction, the size of each plankton determines photosynthetic growth rates, nutrient half saturation constants, predation rates, and optionally predator-prey assimilation and palatability values. Alternatively, if manually defined predator-prey assimilation and palatability values are desired, these can be defined using the palatability_matrix
and assimilation_efficiency_matrix
arguments.
Note that if non-default *_dynamics
expressions are passed, the relevant *_args
also need to be specified.
Arguments
n_phyto
: number of phytoplankton to include in the modeln_zoo
: number of zooplankton to include in the modelphyto_diameters
: dictionary from whichn_phyto
diameters can be computed or a list of values to usezoo_diameters
: dictionary from whichzoo
diameters can be computed or a list of values to usenutrient_dynamics
: expression describing how nutrients change over time, seeAgate.Models.Tracers
detritus_dynamics
: expression describing how detritus evolves over time, seeAgate.Models.Tracers
phyto_dynamics
: expression describing how phytoplankton grow, seeAgate.Models.Tracers
zoo_dynamics
: expression describing how zooplankton grow, seeAgate.Models.Tracers
phyto_args
: Dictionary of phytoplankton parameters, for default values seeAgate.Models.Constructors.DEFAULT_PHYTO_ARGS
zoo_args
: Dictionary of zooplankton parameters, for default values seeAgate.Models.Constructors.DEFAULT_ZOO_ARGS
interaction_args
: Dictionary of arguments from which a palatability and assimilation efficiency matrix between all plankton can be computed, for default values seeAgate.Models.Constructors.DEFAULT_INTERACTION_ARGS
bgc_args
: biogeochemistry parameters related to nutrient and detritus, for default values seeAgate.Models.Constructors.DEFAULT_BGC_ARGS
palatability_matrix
: optional palatability matrix passed as a NamedArray, if provided theninteraction_args
are not used to compute thisassimilation_efficiency_matrix
: optional assimilation efficiency matrix passed as a NamedArray, if provided theninteraction_args
are not used to compute this
Low level API
Agate.Models.Biogeochemistry.define_tracer_functions
— Functiondefine_tracer_functions(
parameters,
tracers;
auxiliary_fields=[:PAR],
helper_functions=nothing,
sinking_tracers=nothing,
grid=nothing,
open_bottom=false,
) -> DataType
Create an Oceananigans.Biogeochemistry model type.
Arguments
parameters
: named sequence of values of the form ((<field name> = <default value>, ...)tracers
: dictionary of the form (<name> => <expression>, ...)
Keywords
auxiliary_fields
: an iterable of auxiliary field variables, defaults to[:PAR,]
helper_functions
: optional path to a file of helper functions used in tracer expressionssinking_tracers
: optional NamedTuple of sinking speeds (passed as positive values) of the form (<tracer name> = <speed>, ...)grid
: optional Oceananigans grid object defining the geometry to build the model on, must be passed ifsinking_tracers
is definedopen_bottom
: indicates whether the sinking velocity should be smoothly brought to zero at the bottom to prevent the tracers leaving the domain, defaults totrue
, which means the bottom is open and the tracers leave (i.e., no slowing of velocity to 0 is applied)
Note that the field names defined in parameters
can't be any of [:x, :y, :z, :t], as these are reserved for coordinates, and they must include all parameters used in the tracers
expressions. The expressions must use methods that are either defined within this module or passed in the helper_functions
file.
Example
parameters = (α=2 / 3, β=4 / 3, δ=1, γ=1)
tracers = Dict("R" => :(α * R - β * R * F), "F" => :(-γ * F + δ * R * F))
LV = define_tracer_functions(parameters, tracers)