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

Possibly incorrect sampling with periodic kernel #78

Open
angus-g opened this issue Feb 27, 2023 · 0 comments
Open

Possibly incorrect sampling with periodic kernel #78

angus-g opened this issue Feb 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@angus-g
Copy link
Owner

angus-g commented Feb 27, 2023

The periodic kernel wraps around at the extreme gridpoints in the direction of periodicity. If a sample variable is specified on tracer points, this means that the half a grid cell on the outside is ignored, leading to artifacts in the output. We need to actually wrap the particles around only when they completely exit the grid, e.g.

ff.fieldset.add_constant("halo_west", ff._output_grid.lon[0] - (ff._output_grid.lon[1] - ff._output_grid.lon[0]) / 2)
ff.fieldset.add_constant("halo_east", ff._output_grid.lon[-1] + (ff._output_grid.lon[1] - ff._output_grid.lon[0]) / 2)
ff.fieldset.add_periodic_halo(zonal=True)

To do this correctly, we'd probably need the full supergrid (corners and centres) specification. Because of the halo cells added by the call to add_periodic_halo(), there is a bit of a buffer to make sure we're sufficiently outside the real grid before wrapping.

@angus-g angus-g added the bug Something isn't working label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant