-
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
Deal with x ⇆ y, λ ⇆ φ, etc when filling halos for metrics/coords in ConformalCubedSphereGrid
#3256
Conversation
using Oceananigans
using Oceananigans.MultiRegion: getregion
using GLMakie
Nx, Ny = 5, 5
H = 3
range_with_offset(N, H, offset::Int) = (-H + 1 + offset*N):(N + H + offset*N)
grid = ConformalCubedSphereGrid(panel_size = (Nx, Ny, 1), z = (0, 1), horizontal_direction_halo = H)
j_index = 2
i_index = Nx+1 - j_index
fig = Figure(resolution=(2200, 600), fontsize=30)
ax = Axis(fig[1, 1])
lines!(ax, range_with_offset(Nx, H, 0), parent(getregion(grid, 1).Δxᶜᶜᵃ)[:, j_index+H], linewidth=4, color = (:green, 0.9), label="panel 1")
lines!(ax, range_with_offset(Nx, H, 1), parent(getregion(grid, 2).Δxᶜᶜᵃ)[:, j_index+H], linewidth=8, color = (:red, 0.5), label="panel 2")
lines!(ax, range_with_offset(Ny, H, 2), parent(getregion(grid, 4).Δyᶜᶜᵃ)[i_index+H, :], linewidth=4, color = (:blue, 0.5), label="panel 4")
vlines!(ax, [1, Nx+1, 2Nx+1, 3Nx+1], linewidth=8, color=(:black, 0.3))
fig[1, 2] = Legend(fig, ax, framevisible = false)
fig
save("metrictest.png", fig) while BEFORE THIS PR: |
ConformalCubedSphereGrid
ConformalCubedSphereGrid
ConformalCubedSphereGrid
ConformalCubedSphereGrid
I wanted to add tests but the current test functionality is difficult to adjust to work for 2D arrays. Oceananigans.jl/test/test_multi_region_cubed_sphere.jl Lines 9 to 62 in 39e9b6f
I'd like to rewrite those to use the connectivity property of the |
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.
So the problem is across panel 2 and 4? And there is also a problem across panel 1 and 2, but oddly the coordinates were still continuous originally.
…`ConformalCubedSphereGrid` (#3256) * deal with Δx <-> Δy, etc for nontrivial connections * two halo filling pases * ommit coords/metric halo test as deprecated * add TODO for coords/metric tests that include the halo regions * bit more julian-like * make sides types instead of symbols
I found that the issue #3254 was because while filling the metrics at the halo regions, we didn't took into consideration that Δx ⇆ Δy in non-trivial cubed sphere connections East ⇆ North.
This PR deals with that.
Closes #3254