Open radka-j opened 6 days ago
Really the user should be specifying an Oceananigans grid (0D, 1D, 2D or 3D) and then define a function for each field which is also defined on that grid.
We could implement an additional add_auxiliary_fields
method that adds things like PAR and we could rename add_bgc_methods
to add_tracers
.
An issue with this is that the tracer methods have to include auxiliary fields as inputs so the variables have to defined beforehand. But maybe we can redefine the functions within the add_auxiliary_fields
call?
Note that a BGC model needs to have a
biogeochemical_auxiliary_fields
method that returns a NamedTuple of the form(field_name = Oceananigans Field object,...)
.Currently, in Agate the user can add auxiliary field names (e.g., PAR) when creating a model but they don't actually pass the field specification anywhere. Instead, we create the PAR field within the
run_box_model
function and thebiogeochemical_auxiliary_fields
method is defined within theOceanBioME.Biogeochemistry
object instantiated within that function.This is clearly suboptimal. Either, the user should actually define auxiliary fields in the model specification or we should not let them append aux field variable names to the model and instead handle everything inside a wrapper like
run_box_model
.