Open mberdahl-uw opened 1 month ago
Hi @mberdahl-uw, thanks for the very complete issue.
The bug is quite subtle and needs some fix as fast as possible... It has to do with the dimension order of your data. Your ds_input
has a lon
coordinate of dimensions x, y
, while ESMF expects y, x
. xESMF should have taken care of this, dimension order is not supposed to be a problem in the xarray-world. But it has failed to do so and for some reason this has made the periodic
feature fail, while the rest of the regridding seems to work anyway.
On my side, I was able to produce the correct figures by adding original_dataset = original_dataset.transpose('y', 'x')
before initialising the Regridder
.
Please confirm if this fixes your problem, we'll work on a way to fix this.
Hi @aulemahal , thanks so much for looking into this. Your fix works for me too, so that is great. I'll look out for a fix on your end when you get around to it. In the meantime I'll do this piecemeal approach for the models that require this transpose.
Hi,
I'm trying to regrid some cmip6 models with xesmf regridder. The operation works, but upon plotting some (not all) of the regridded models have a seam in the output at the 0 dateline. I am using periodic=True. Appreciate any help!
Here is a small bit of code that illustrates the issue with one model: Data.zip