ecmwf / atlas

A library for numerical weather prediction and climate modelling
https://sites.ecmwf.int/docs/atlas
Apache License 2.0
115 stars 42 forks source link

Wrap out-of-bounds source cells into the domain #211

Closed twsearle closed 4 months ago

twsearle commented 4 months ago

Description

Recent work on adding a halo size > 0 to atlas-orca (https://github.com/ecmwf/atlas-orca/issues/19) revealed an issue in the North fold of the orca grid when comparing MPI to non-MPI interpolations.

This issue was traced to the interpolator not properly accounting fully for the wrapping of the source interpolation mesh cell when it crosses the periodic boundary.

This change fixes this issue by properly validating each cell.

The change was proposed by Simon Good, I am just performing the necessary admin to get the change into atlas.

Testing

This is tricky to test, and requires a separate PR in atlas-orca to introduce a ctest to cover the issue.

An example of some of the affected interpolated points that were incorrect before this change and fixed afterwards on an eORCA025_T:

hofx_differences