OceanBioME / OceanBioME.jl

🌊 🦠 🌿 A fast and flexible modelling environment written in Julia for modelling the coupled interactions between ocean biogeochemistry, carbonate chemistry, and physics
https://oceanbiome.github.io/OceanBioME.jl/
MIT License
40 stars 20 forks source link

Why does `CenterField` contain no data for `BoxModelGrid`? #165

Closed glwagner closed 7 months ago

glwagner commented 8 months ago

I noticed that CenterField is defined as nothing on BoxModelGrid:

https://github.com/OceanBioME/OceanBioME.jl/blob/4b7b1202c99107d7475a84feb7bd5b084b229f4d/src/BoxModel/boxmodel.jl#L190

But if I understand this correctly, a box model grid is effectively 0-dimensional. That means that any field would actually have 1 point (not 0 points). Otherwise, what is the prognostic state of a BoxModel?

I'm asking because I think the concept of a 0D grid could be possibly useful in Oceananigans (but right now we use a triply-Flat grid for the same purpose when we need it).

iuryt commented 8 months ago

I am curious about the utility of having 0D grid. Can you explain that?

glwagner commented 8 months ago

There are non-trivial dynamics on a 0D grid --- inertial oscillations, chemical and biological reactions, etc

jagoosw commented 8 months ago

This is a good question, I think at the time of writing it was just a workaround to allow models to be constructed (through the default setup of the BGC models light attenuation models get constructed which setup fields I think). I'll have a look at how it's used.

Tbh all of the box model code could do with some rethinking to be better aligned with the rest of the code. No one's used it much so it's not had a lot of testing or thought.

glwagner commented 8 months ago

How is the prognostic state of a BoxModel stored?

jagoosw commented 8 months ago

Just as a Tuple of Floats (vs a tuple of fields in Oceananigans)

glwagner commented 8 months ago

Ah, I realize that you are not using an Oceananigans model in this case. So the question is really why / where CenterField gets called at all.

navidcy commented 7 months ago

@jagoosw this was resolved with #164, right?

jagoosw commented 7 months ago

yeah, sorry should have said!