Support z-areas on single-column latitude-longitude grids#5660
Open
simone-silvestri wants to merge 2 commits into
Open
Support z-areas on single-column latitude-longitude grids#5660simone-silvestri wants to merge 2 commits into
simone-silvestri wants to merge 2 commits into
Conversation
The exact spherical z-area formulas for latitude-longitude grids with on-the-fly metrics read neighboring latitude faces (sin φ[j+1] − sin φ[j]). Grids with Flat horizontal topology carry a single coordinate per Flat dimension, so any operator touching Az — for example a turbulence closure's stress divergence through V⁻¹ — threw a BoundsError on single-column grids. The latitudinal sine differences are factored into Δsindφᵃᶠᵃ / Δsindφᵃᶜᵃ helpers that degenerate to a unit factor when both horizontal directions are Flat, mirroring the Δ = 1 convention for Flat spacings. With both directions Flat all horizontal flux divergences vanish and a constant Az cancels between the vertical flux areas and the volume, so the choice is exactly consistent. Single-column hydrostatic models can now use explicit closures. Grids that are Flat in only one horizontal direction still need Δx- or Δy-consistent area definitions and are left for a follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
simone-silvestri
commented
Jun 7, 2026
Member
|
Single column grids should use |
Collaborator
Author
|
well, I guess it is still good to clear an error that could occur. In the end it is a small change to allow supporting a LatitudeLongitudeGrid. |
Member
|
Well, we should decide which one we want to use and support just one way to do it, I think |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The exact spherical z-area formulas for latitude-longitude grids with on-the-fly metrics read neighboring latitude faces (
sin φ[j+1] − sin φ[j]). This throws a BoundsError on single-column grids.The latitudinal sine differences are factored into
Δsindφᵃᶠᵃ / Δsindφᵃᶜᵃhelpers that degenerate to a unit factor when both horizontal directions are Flat, mirroring theΔ = 1convention for Flat spacings.