Size-structured NPZD model

Agate.Models.NiPiZD.Constructor.constructFunction
construct(;
    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 model
  • n_zoo: number of zooplankton in the model
  • phyto_diameters: dictionary from which phyto diameters can be computed or a list of values to use (as many as the model expects)
  • zoo_diameters: dictionary from which zoo 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, see Agate.Models.Tracers
  • detritus_dynamics: expression describing how detritus evolves over time, see Agate.Models.Tracers
  • phyto_dynamics: expression describing how phytoplankton grow, see Agate.Models.Tracers
  • zoo_dynamics: expression describing how zooplankton grow, see Agate.Models.Tracers
  • phyto_args: Dictionary of phytoplankton parameters, for default values see NiPiZD.DEFAULT_PHYTO_ARGS
  • zoo_args: Dictionary of zooplankton parameters, for default values see NiPiZD.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 see NiPiZD.DEFAULT_INTERACTION_ARGS
  • bgc_args: Dictionary of biogeochemistry parameters related to nutrient and detritus, for default values see NiPiZD.DEFAULT_BGC_ARGS
  • palatability_matrix: optional palatability matrix passed as an Array, if provided then interaction_args are not used to compute this
  • assimilation_efficiency_matrix: optional assimilation efficiency matrix passed as an Array, if provided then interaction_args are not used to compute this
  • sinking_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 if sinking_tracers is defined, defaults to BoxModelGrid
  • open_bottom: indicates whether the sinking velocity should be smoothly brought to zero at the bottom to prevent the tracers leaving the domain, defaults to true, 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()
source
Agate.Models.NiPiZD.Constructor.instantiateFunction
instantiate(
    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 by NiPiZD.construct() with a specified number of phytoplankton and zooplankton

Keywords

  • phyto_diameters: dictionary from which phyto diameters can be computed or a list of values to use (as many as the model expects)
  • zoo_diameters: dictionary from which zoo 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, see Agate.Models.Tracers
  • detritus_dynamics: expression describing how detritus evolves over time, see Agate.Models.Tracers
  • phyto_dynamics: expression describing how phytoplankton grow, see Agate.Models.Tracers
  • zoo_dynamics: expression describing how zooplankton grow, see Agate.Models.Tracers
  • phyto_args: Dictionary of phytoplankton parameters, for default values see NiPiZD.DEFAULT_PHYTO_ARGS
  • zoo_args: Dictionary of zooplankton parameters, for default values see NiPiZD.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 see NiPiZD.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 see NiPiZD.DEFAULT_CONSTANT_ARGS
  • palatability_matrix: optional palatability matrix passed as an Array, if provided then interaction_args are not used to compute this
  • assimilation_efficiency_matrix: optional assimilation efficiency matrix passed as an Array, if provided then interaction_args are not used to compute this
  • sinking_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 if sinking_tracers is defined, defaults to BoxModelGrid
  • open_bottom: indicates whether the sinking velocity should be smoothly brought to zero at the bottom to prevent the tracers leaving the domain, defaults to true, 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)
source