Skip to content

Move storage space to from MutableVerticalDiscretization to ZStarCoordinate #4686

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

simone-silvestri
Copy link
Collaborator

and while we are at it, also refactor ZStar to ZStarCoordinate

Copy link
Member

@glwagner glwagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ηⁿ needed to compute metrics too? Basically I think the only information that should be in the grid is what is required to compute the metrics. Anything to do with specific evolution rules is a model concept?

@simone-silvestri
Copy link
Collaborator Author

simone-silvestri commented Jul 30, 2025

Yeah, ηⁿ is the surface of the domain, so it is needed for znode to compute the correct z level. It might be considered somewhat a zstar specific quantity, but I guess any vertical coordinate would require the information of the extent of the domain, including the surface height.

@glwagner
Copy link
Member

Yeah, ηⁿ is the surface of the domain, so it is needed for znode to compute the correct z level. It might be considered somewhat a zstar specific quantity, but I guess any vertical coordinate would require the information of the extent of the domain, including the surface height.

Okay, so the main improvement would be better notation if we have it

@glwagner
Copy link
Member

What about the time derivative of the stretching metric? This seems unnecessary for prescribed evolution?

@simone-silvestri
Copy link
Collaborator Author

simone-silvestri commented Jul 30, 2025

What about the time derivative of the stretching metric? This seems unnecessary for prescribed evolution?

I think that is required for any type of mutable grid, but I guess that can also be moved...

Might be annoying to rewrite this operator though

# For moving grids, we include the time-derivative of the grid scaling in the divergence flux.
# If the grid is stationary, `Az_Δr_∂t_σ` evaluates to zero.
@inline δx_U_plus_∂t_σ(i, j, k, grid, u, v) = δxᶜᶜᶜ(i, j, k, grid, Ax_qᶠᶜᶜ, u) + Az_Δr_∂t_σ(i, j, k, grid)
@inline δy_V_plus_∂t_σ(i, j, k, grid, u, v) = δyᶜᶜᶜ(i, j, k, grid, Ay_qᶜᶠᶜ, v) + Az_Δr_∂t_σ(i, j, k, grid)

@navidcy navidcy self-requested a review July 30, 2025 20:34
@navidcy
Copy link
Member

navidcy commented Jul 30, 2025

Suggest bump patch release with this (or straight after) since it breaks this:

https://github.com/CliMA/ClimaOcean.jl/blob/8479089e933f1c8b29b9aaaac11e51437fbd9c64/src/OceanSimulations/ocean_simulation.jl#L80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants