-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TendencyTermField (or something like it) for diagnosing exact tendency terms and fluxes #1073
Comments
If diagnosing all the different terms for various budgets (momentum, tracer, TKE, etc.) is an important use case then I don't think we can escape the boilerplate associated with that: https://mitgcm.readthedocs.io/en/latest/outp_pkgs/outp_pkgs.html#mitgcm-kernel-available-diagnostics-list
We might be able to get away with clever Maybe we can start with a barebones list of I'd probably advocate for growing the list in Oceananigans.jl if we think the list contains useful terms that other users would be interested in using. But since it is always possible for power users (or any user with some help) to define their own Growing the list inside Oceananigans.jl (not relying on users to define all terms) has the added benefit that we can keep functions like |
Perhaps to start we can implement
Oceananigans.jl/src/TimeSteppers/velocity_and_tracer_tendencies.jl Lines 233 to 238 in c5f47e0
That's a total of 17 This still does omit a large number of terms that are part of the momentum budgets, so we do save something by not implementing every term. |
A related feature would be fields like Ideally these terms could be written out using |
I wonder if it makes sense to spend some effort to try and get more complex operations to compile on the GPU (e.g. so we can see if it's even performant: #870) so if it's performant we can start using them to work on issues like this. |
We would use |
As being discussed over on CliMA/LESbrary.jl#25, and also as discussed with @christophernhill and @ali-ramadhan separately, we need a way to diagnose the terms that arise in the velocity and tracer tendency equations, as well as the fluxes that give rise to the flux divergences that appear there.
One way to achieve this purpose is to define new types of
operand
s forComputedField
s. Currently,operand
is always anAbstractOperation
. However, we can come up with a new type that looks something likeThis works because the kernel that computes a
ComputedField
's data isOceananigans.jl/src/Fields/computed_field.jl
Lines 85 to 88 in c5f47e0
Then with a bit of boilerplate we can define constructors for all the terms we might need, eg
We probably want to define aliases for all the terms that appear in our tendency equations, as well as the advective and diffusive fluxes, so that we can ensure they are correct and correctly located on the staggered grid. Unfortunately this does involve a lot of boiler plate and introduces a maintenance and testing burden. If we can push responsibility more to users I am open to that, but I'm not 100% how to make this process more programmatic. Ideas very welcome.
If functions like
momentum_flux_uu
are going to emerge from darkness into users' scripts, we may want to have a discussion about whether our names / naming convention is sensible.By the way,
ComputedField
seems to assume thatoperand
has a property calledgrid
:Oceananigans.jl/src/Fields/computed_field.jl
Lines 43 to 47 in c5f47e0
We could create a type called
AbstractOperand
, of whichAbstractOperation
(and other concrete operands) are subtypes.cc @qingli411, @BrodiePearson
The text was updated successfully, but these errors were encountered: