ecmwf / atlas

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

Allow zero-sized interpolation target functionspace #206

Closed odlomax closed 4 months ago

odlomax commented 4 months ago

This PR addresses Atlas issue #205, and is needed for jcsda/oops issue #2264.

The SphericalVector and Structured2D interpolation methods can now be called with empty target functionspaces. Also tested are the finite-element and cubedsphere interpolation methods.

odlomax commented 4 months ago

That looks good to me! I think there were already some guards like this in place, but probably only added in the methods where the issues were encountered and tested.

That's all we can do, really! I think the main hurdle was tweaking the adjoint checks so that they're not over reliant on checking for a matrix. I suspect we're the only folks who use that functionally.

fmahebert commented 4 months ago

@odlomax Thanks for this!