Size-structured NPZD model
Agate.Models.NiPiZD.Constructor.construct
— Functionconstruct(;
n_phyto=2,
n_zoo=2,
phyto_diameters=Dict(
"min_diameter" => 2, "max_diameter" => 10, "splitting" => "log_splitting"
),
zoo_diameters=Dict(
"min_diameter" => 20, "max_diameter" => 100, "splitting" => "linear_splitting"
),
nutrient_dynamics=nutrients_default,
detritus_dynamics=detritus_default,
phyto_dynamics=phytoplankton_default,
zoo_dynamics=zooplankton_default,
phyto_args=DEFAULT_PHYTO_ARGS,
zoo_args=DEFAULT_ZOO_ARGS,
interaction_args=DEFAULT_INTERACTION_ARGS,
bgc_args=DEFAULT_BGC_ARGS,
palatability_matrix=nothing,
assimilation_efficiency_matrix=nothing,
sinking_tracers=nothing,
grid=BoxModelGrid(),
open_bottom=true,
)
Construct a size-structured NiPiZD model abstract type.
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 predator-prey assimilation and palatability values. Alternatively, if manually defined predator-prey assimilation and palatability values are desired, these can be specified 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.
The type specification includes a photosynthetic active radiation (PAR) auxiliary field.
Keywords
n_phyto
: number of phytoplankton in the modeln_zoo
: number of zooplankton in the modelphyto_diameters
: dictionary from whichphyto
diameters can be computed or a list of values to use (as many as the model expects)zoo_diameters
: dictionary from whichzoo
diameters can be computed or a list of values to use (as many as the model expects)nutrient_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 seeNiPiZD.DEFAULT_PHYTO_ARGS
zoo_args
: Dictionary of zooplankton parameters, for default values seeNiPiZD.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 seeNiPiZD.DEFAULT_INTERACTION_ARGS
bgc_args
: Dictionary of biogeochemistry parameters related to nutrient and detritus, for default values seeNiPiZD.DEFAULT_BGC_ARGS
palatability_matrix
: optional palatability matrix passed as an Array, if provided theninteraction_args
are not used to compute thisassimilation_efficiency_matrix
: optional assimilation efficiency matrix passed as an Array, if provided theninteraction_args
are not used to compute thissinking_tracers
: optional NamedTuple of sinking speeds (passed as positive values) of the form (<tracer name expressed as symbol> = <speed>, ...)grid
: optional Oceananigans grid object defining the geometry to build the model on, must be passed ifsinking_tracers
is defined, defaults to BoxModelGridopen_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)
Example
using Agate.Constructors: NiPiZD
n2p2zd = NiPiZD.construct()
n2p2zd_model_obj = n2p2zd()
Agate.Models.NiPiZD.Constructor.instantiate
— Functioninstantiate(
bgc_type;
phyto_diameters=Dict(
"min_diameter" => 2, "max_diameter" => 10, "splitting" => "log_splitting"
),
zoo_diameters=Dict(
"min_diameter" => 20, "max_diameter" => 100, "splitting" => "linear_splitting"
),
phyto_args=DEFAULT_PHYTO_ARGS,
zoo_args=DEFAULT_ZOO_ARGS,
interaction_args=DEFAULT_INTERACTION_ARGS,
bgc_args=DEFAULT_BGC_ARGS,
palatability_matrix=nothing,
assimilation_efficiency_matrix=nothing,
sinking_tracers=nothing,
grid=BoxModelGrid(),
open_bottom=true,
)
A function to instantiate an object of bgc_type
returned by NiPiZD.construct()
.
The type specifies the number of phytoplankton and zooplankton in the model and includes default parameter values. The instantiate method is used to override the default values of any of the model parameters or plankton diameters.
Arguments
bgc_type
: subtype of Oceananigans.Biogeochemistry returned byNiPiZD.construct()
with a specified number of phytoplankton and zooplankton
Keywords
phyto_diameters
: dictionary from whichphyto
diameters can be computed or a list of values to use (as many as the model expects)zoo_diameters
: dictionary from whichzoo
diameters can be computed or a list of values to use (as many as the model expects)nutrient_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 seeNiPiZD.DEFAULT_PHYTO_ARGS
zoo_args
: Dictionary of zooplankton parameters, for default values seeNiPiZD.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 seeNiPiZD.DEFAULT_INTERACTION_ARGS
bgc_args
: Dictionary of constant parameters used in growth functions (i.e., not size dependant plankton parameters as well as biogeochemistry parameters related to nutrient and detritus, for default values seeNiPiZD.DEFAULT_CONSTANT_ARGS
palatability_matrix
: optional palatability matrix passed as an Array, if provided theninteraction_args
are not used to compute thisassimilation_efficiency_matrix
: optional assimilation efficiency matrix passed as an Array, if provided theninteraction_args
are not used to compute thissinking_tracers
: optional NamedTuple of sinking speeds (passed as positive values) of the form (<tracer name expressed as symbol> = <speed>, ...)grid
: optional Oceananigans grid object defining the geometry to build the model on, must be passed ifsinking_tracers
is defined, defaults to BoxModelGridopen_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)
Example
using Agate.Constructors: NiPiZD
n2p2zd = NiPiZD.construct()
# change some parameter values
phyto_args = deepcopy(NiPiZD.DEFAULT_PHYTO_ARGS)
phyto_args["allometry"]["maximum_growth_rate"]["a"] = 2
n2p2zd_model_obj = NiPiZD.instantiate(n2p2zd; phyto_args=phyto_args)