Skip to content
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

Correct vorticity computation at the corners of cubed sphere panels #3325

Closed
wants to merge 5 commits into from

Conversation

siddharthabishnu
Copy link
Contributor

Closes #1584.

Corrected the vorticity computed at the corners of the cubed sphere panels by
applying the multiplicative factor of (4/3).
@navidcy navidcy added cubed sphere 🧊🌎 bug 🐞 Even a perfect program still has bugs labels Oct 10, 2023
@@ -8,6 +8,20 @@
"""
@inline ζ₃ᶠᶠᶜ(i, j, k, grid, u, v) = Γᶠᶠᶜ(i, j, k, grid, u, v) / Azᶠᶠᶜ(i, j, k, grid)

@inline function ζ₃ᶠᶠᶜ(i, j, k, grid::OrthogonalSphericalShellGrid{FT}, u, v) where FT
scaling = ifelse(on_corner(i, j, grid), convert(FT, 4/3), one(grid))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
scaling = ifelse(on_corner(i, j, grid), convert(FT, 4/3), one(grid))
scaling = ifelse(on_corner(i, j, grid), convert(FT, 4/3), 1)

@navidcy
Copy link
Collaborator

navidcy commented Oct 10, 2023

I think we can't move forward with this until we have a working validation script that uses it. So let's wait until #3306 is merged.

Comment on lines 36 to 37

ifelse(on_south_west_corner(i, j) | on_north_west_corner(i, j, grid),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ifelse(on_south_west_corner(i, j) | on_north_west_corner(i, j, grid),
ifelse(on_south_west_corner(i, j) | on_north_west_corner(i, j, grid),

@navidcy
Copy link
Collaborator

navidcy commented Oct 10, 2023

As it is now, it assumes that the ConformalCubedSphereGrid has 1 region per panel. Could we generalize it?

Perhaps these are useful?

@inline function region_corners(r, p::CubedSpherePartition)
pᵢ = intra_panel_index_x(r, p)
pⱼ = intra_panel_index_y(r, p)
bottom_left = pᵢ == 1 && pⱼ == 1 ? true : false
bottom_right = pᵢ == p.Rx && pⱼ == 1 ? true : false
top_left = pᵢ == 1 && pⱼ == p.Ry ? true : false
top_right = pᵢ == p.Rx && pⱼ == p.Ry ? true : false
return (; bottom_left, bottom_right, top_left, top_right)
end
@inline function region_edge(r, p::CubedSpherePartition)
pᵢ = intra_panel_index_x(r, p)
pⱼ = intra_panel_index_y(r, p)
west = pᵢ == 1 ? true : false
east = pᵢ == p.Rx ? true : false
south = pⱼ == 1 ? true : false
north = pⱼ == p.Ry ? true : false
return (; west, east, south, north)
end

@navidcy
Copy link
Collaborator

navidcy commented Oct 12, 2023

Closing this in favor of #3306

@navidcy navidcy closed this Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Even a perfect program still has bugs cubed sphere 🧊🌎
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Circulation and vorticity operators need to be updated at the cubed sphere corners
2 participants