Basically (taking the RichardsonNumber as an example) this PR adds an extra function call that returns the desired diagnostic. There's the traditional model-only call:
Ri = RichardsonNumber(model)
And now there will be calls where the variables are explicitly passed:
Ri = RichardsonNumber(model, u, v, w, b)
This allows for more control, which allows for simpler abstract trees if the need arises. For example a user can write
b_bg = (x, y, z, t) -> 1
model = NonhydrostaticModel(; grid, buoyancy=BuoyancyTracer(), tracers=:b,
background_fields = (; b = BackgroundField(b_bg),))
u, v, w = model.velocities
b = model.tracers.b
B = model.background_fields.tracers.b
using Oceanostics
Ri = RichardsonNumber(model, u, v, w, Field(b+B))
A simple way to allow users to circumvent https://github.com/CliMA/Oceananigans.jl/issues/3140
Closes https://github.com/tomchor/Oceanostics.jl/issues/137
Basically (taking the
RichardsonNumber
as an example) this PR adds an extra function call that returns the desired diagnostic. There's the traditionalmodel
-only call:And now there will be calls where the variables are explicitly passed:
This allows for more control, which allows for simpler abstract trees if the need arises. For example a user can write
which returns a simpler tree than
but produces same result.