Agate.jl-DARWIN model
Agate.Models.DARWIN.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"
),
DIC_dynamics=DIC_geider_light,
PO4_dynamics=PO4_geider_light,
DIN_dynamics=DIN_geider_light,
POC_dynamics=POC_default,
DOC_dynamics=DOC_default,
PON_dynamics=PON_default,
DON_dynamics=DON_default,
POP_dynamics=POP_default,
DOP_dynamics=DOP_default,
phyto_dynamics=phytoplankton_growth_two_nutrients_geider_light,
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 an Agate.jl-DARWIN model abstract type.
TRACERS:
∂t cⱼ = $Uⱼ$DIC - $Mⱼ$ + $Gⱼ$ - $gⱼ$
∂t DIC = ∑($Uⱼ$ DIC) + $R$DOC + $R$POC
∂t DIN = ∑($Uⱼ$DIC * $Qⱼ$N) + $R$DON + $R$PON
∂t PO4 = ∑($Uⱼ$DIC * $Qⱼ$P) + $R$DOP + $R$POP
∂t DOC = ∑($Mⱼ$DOC) + $g$DOC - $R$DOC
∂t DON = ∑($Mⱼ$DOC * $Qⱼ$N) + $g$DON - $R$DON
∂t DOP = ∑($Mⱼ$DOC * $Qⱼ$P) + $g$DOP - $R$DOP
∂t POC = ∑($Mⱼ$POC) + $g$POC - $R$POC
∂t PON = ∑($Mⱼ$POC * $Qⱼ$N) + $g$PON - $R$PON
∂t POP = ∑($Mⱼ$POC * $Qⱼ$P) + $g$POP - $R$POP
where:
- $U$ = uptake
- $R$ = remineralization
- $M$ = mortality
- $g, G$ = grazing losses and gains
- $Q$ = plankton elemental ratios
TRAITS:
μmax, KR, gmax = a*Volume^b
palat = η/(1+($ratio$-$opt$)^2)^σ
where:
- μmax = maximum photosynthetic growth
- KR = nutrient half saturation
- gmax = maximum predation rate
- palat = palatability
- $ratio$ = predator to prey size ratio (diameter)
- $opt$ = predator to prey size optimum (diameter)
- η = prey protection
- σ = predator specificity
This constructor builds an Agate.jl-DARWIN 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 dissolved inorganic carbon (DIC), particulate organic matter (POC, POP, PON), dissolved organic matter (DOC, DOP, DON) and two nutrients (DIN and PO4) cycling by default, although more complex elemental 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.
The type specification includes a photosynthetic active radiation (PAR) auxiliary field.
Arguments
n_phyto: number of phytoplankton to include in the modeln_zoo: number of zooplankton to include in the modelphyto_diameters: dictionary from whichn_phytodiameters can be computed or a list of values to usezoo_diameters: dictionary from whichzoodiameters can be computed or a list of values to useDIC_dynamics: expression describing how DIC changes over time, seeAgate.Models.TracersPO4_dynamics: expression describing how PO4 changes over time, seeAgate.Models.TracersDIN_dynamics: expression describing how DIN changes over time, seeAgate.Models.TracersPOC_dynamics: expression describing how POC changes over time, seeAgate.Models.TracersDOC_dynamics: expression describing how DOC changes over time, seeAgate.Models.TracersPON_dynamics: expression describing how PON changes over time, seeAgate.Models.TracersDON_dynamics: expression describing how DON changes over time, seeAgate.Models.TracersPOP_dynamics: expression describing how POP changes over time, seeAgate.Models.TracersDOP_dynamics: expression describing how DOP changes over time, seeAgate.Models.Tracersphyto_dynamics: expression describing how phytoplankton grow, seeAgate.Models.Tracerszoo_dynamics: expression describing how zooplankton grow, seeAgate.Models.Tracersphyto_args: Dictionary of phytoplankton parameters, for default values seeDARWIN.DEFAULT_PHYTO_ARGSzoo_args: Dictionary of zooplankton parameters, for default values seeDARWIN.DEFAULT_ZOO_ARGSinteraction_args: Dictionary of arguments from which a palatability and assimilation efficiency matrix between all plankton can be computed, for default values seeDARWIN.DEFAULT_INTERACTION_ARGSbgc_args: biogeochemistry parameters related to nutrient and detritus, for default values seeDARWIN.DEFAULT_BGC_ARGSpalatability_matrix: optional palatability matrix passed as an Array, if provided theninteraction_argsare not used to compute thisassimilation_efficiency_matrix: optional assimilation efficiency matrix passed as an Array, if provided theninteraction_argsare 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_tracersis 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: DARWIN
darwin_2p_2z = DARWIN.construct()
darwin_2p_2z_model_obj = darwin_2p_2z()Agate.Models.DARWIN.Constructor.instantiate — Functioninstantiate(
bgc_type;
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"
),
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 DARWIN.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.
Changing the parameter values of an existing DARWIN model type using instantiate() is useful in dynamic programming contexts such as for loops.
Arguments
bgc_type: subtype of Oceananigans.Biogeochemistry returned byDARWIN.construct()with a specified number of phytoplankton and zooplankton
Keywords
phyto_diameters: dictionary from whichphytodiameters can be computed or a list of values to use (as many as the model expects)zoo_diameters: dictionary from whichzoodiameters 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.Tracersdetritus_dynamics: expression describing how detritus evolves over time, seeAgate.Models.Tracersphyto_dynamics: expression describing how phytoplankton grow, seeAgate.Models.Tracerszoo_dynamics: expression describing how zooplankton grow, seeAgate.Models.Tracersphyto_args: Dictionary of phytoplankton parameters, for default values seeDARWIN.DEFAULT_PHYTO_ARGSzoo_args: Dictionary of zooplankton parameters, for default values seeDARWIN.DEFAULT_ZOO_ARGSinteraction_args: Dictionary of arguments from which a palatability and assimilation efficiency matrix between all plankton can be computed, for default values seeDARWIN.DEFAULT_INTERACTION_ARGSbgc_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 seeDARWIN.DEFAULT_CONSTANT_ARGSpalatability_matrix: optional palatability matrix passed as an Array, if provided theninteraction_argsare not used to compute thisassimilation_efficiency_matrix: optional assimilation efficiency matrix passed as an Array, if provided theninteraction_argsare 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_tracersis 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: DARWIN
darwin_2p_2z = DARWIN.construct()
# change some parameter values
phyto_args = deepcopy(DARWIN.DEFAULT_PHYTO_ARGS)
phyto_args["allometry"]["maximum_growth_rate"]["a"] = 2
darwin_2p_2z_model_obj = DARWIN.instantiate(darwin_2p_2z; phyto_args=phyto_args)