-
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
Allow Tuple of closures with CATKE #3960
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Was this a numerical bug, or is it just a performance issue as the :e
tendency term was being computed twice? I assume it's done somewhere in the TurbulenceClosures
module.
I think it is a bug because the tracer is advanced in the Line 12 in fe4123f
So with closure tuple it is advanced twice |
Should I add a test for it? |
Always good to add a test! Especially since this issue might come up again in the future with refactors. I'm just trying to think of a good test... Are there analytic solutions to the TKE where we can take one time step and make sure the TKE values are correct (and that only one, not two, time steps were taken)? As a side note: I've been running with CATKE in a tuple of closures and I encountered NaNs at the bottom-most grid cell but the simulations seems to continue time stepping just fine. Maybe it's related to this bug fix? |
We can also brutally just check that we do not step the kinetic energy twice: eⁿ⁺¹ == eⁿ + Δt * Gᵉ # we have to account for the fast parts that depend on uⁿ⁺¹ here and not
|
We do this elsewhere, eg for |
in this way we don't timestep the energy equation twice within a time step when using a tuple of closures containing CATKE