-
Notifications
You must be signed in to change notification settings - Fork 191
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
Bug when adding the interior of fields with non-trivial indices in OutputWriters #3260
Comments
cc @josuemtzmo |
@josuemtzmo is running on the same issue. Is there a quick fix to this so they can at least use it temporarily to output free surface elevation? |
Thanks @navidcy! |
I actually saw the linked PR and from its title I inferred that if you give |
When using
|
I think this is the same bug as #2770 |
I'm a bit confused, I managed to solve the issue by changing manually the grid passed to Oceananigans.jl/src/OutputWriters/output_construction.jl Lines 32 to 42 in e243e5b
For example, in the example provided by @navidcy:
That is passed to the
Before I do any of this changes, I don't understand how are the halos (applied in all directions) implemented in a surface such as Do you have any other way to fix this? |
There is definitely a wrong assumption somewhere in this pipeline. Maybe we can focus on this:
First of all I think this means that we are using Second there is a typo right @josuemtzmo ? You meant to say that the indices should be This is maybe where the incorrect assumption is. If we need @josuemtzmo can you show the whole stack trace of your error so we can see where the indexing issue comes in? |
I had a typo here, the indexes that it tries to access are
Nope, that is without the halo (
When I print the indexes I get
That's likely the case, since it seems that we are accessing the indexes of the view. For example, doing
Meanwhile if I set the indices to
|
As far as I can tell, I think this is related to the issue @jagoosw mentioned too, where the indices that the output is trying to access does not match the size of the sliced fields, similar to what we are seeing here. |
A simple fix to manage to output
|
Sorry, I meant |
Good to know but definitely we want to fix the underlying issue |
I stumbled on this trying to save the free surface for a
HydrostaticFreeSurfaceModel
. Here's an example:However, if I include halos in the output everything seems OK...
The text was updated successfully, but these errors were encountered: