-
Notifications
You must be signed in to change notification settings - Fork 238
(0.96.33) Correct diffusion with a non-linear free surface #4589
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
base: main
Are you sure you want to change the base?
Conversation
Very nice PR @simone-silvestri . Why is it that the curve changes from increasing to decreasing on this PR? I thought that the static grid before was correct, but now we are getting different tendencies. Also, are the equations that describe this written down anywhere? |
Sorry, it's a consequence of the |
Thanks @simone-silvestri ! |
Clarifying question: what is |
end | ||
|
||
params_range(H, N, ::Type{Flat}) = 1:1 | ||
params_range(H, N, T) = -H+2:N+H-1 |
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.
is there any way we can get away from this *_params
design? It doesn't scale because we have to add *_params
for every single addition to the model, getting messy and requiring a lot of remembering the names and places of functions
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.
You prefer having a type that controls the parameters rather than a function?
|
||
@inline rcp_vertical_spacing(i, j, k, grid, ℓx, ℓy, ℓz) = Δz⁻¹(i, j, k, grid, ℓx, ℓy, ℓz) | ||
@inline rcp_vertical_spacing(i, j, k, grid, ::Center, ::Center, ℓz) = Δr⁻¹(i, j, k, grid, c, c, ℓz) | ||
|
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.
👍
PR #4546 changed the implementation of zstar and a nonlinear free surface. In particular, before #4546 we were
σT
σT
σ
T
at the new timestepPR#4546 changed this in
σ
T
from updatingσT
and dividing by the newσ
After #4546, the diffusion is performed on
T
and notσT
, but #4546 did not update the vertically implicit diffusion solver (I also think there was a bug before), for this reason, the non linear free surface solution is way more diffusive now than the same solution with a static grid. This leads to SST increasing drastically using zstar compared to using a static vertical coordinate in ClimaOcean.This PR corrects the formulation and adds a very simple test, where if the free surface does not change, the results should be the same for static and moving grid
(H+η)_moving == H_static
.If we run same test I added in this PR on main:
we get
on main
on this PR
The detailed formulation of the equations we solve is begin added in #4588