-
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
LatitudeLongitudeGrid
may have incorrect metrics for y
-Periodic domains
#3465
Comments
A quick fix is to use @inline metric_worksize(grid::XRegularLLG) = length(grid.φᵃᶠᵃ) - 2 |
Nice catch! |
What's the |
I guess it's the size of the kernel that we use to compute the metrics. Basically it has to be the number of faces - 2, beacause we compute metrics using differences. |
Closed by #3450 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code:
produces a
BoundsError
, if run withjulia --check-bounds=yes
.The problem is the worksize specified here:
Oceananigans.jl/src/Grids/latitude_longitude_grid.jl
Line 443 in 3b02321
I also don't like this code because we cannot read it to understand it. For example, what is
length(grid.φᵃᶜᵃ)
? Is thisNy + Hy
, orNy + Hy + 1
? I think it would be better to be explicit.It appears that for both
Periodic
andBounded
iny
, then we haveWhich looks like
Ny + 2Hy
.I think both the worksize and the metric size is wrong in general --- I think we have hardcoded a
Bounded
y-topology. I think the right thing to do is to go in and usetotal_length
to determine both the correct size of the metrics for any topology, as well as the size of the kernel that is launched to compute them.The text was updated successfully, but these errors were encountered: