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

Regridding CMIP5 data #49

Open
DamienIrving opened this issue Mar 28, 2019 · 6 comments
Open

Regridding CMIP5 data #49

DamienIrving opened this issue Mar 28, 2019 · 6 comments

Comments

@DamienIrving
Copy link

DamienIrving commented Mar 28, 2019

I'm regridding CMIP5 ocean temperature data from a curvilinear to rectilinear grid. Following the relevant example in the documentation, I've tried to use xESMF for this task without success:
https://github.com/DamienIrving/ocean-analysis/blob/master/development/xESMF_test.ipynb

I was wondering if there's an obvious mistake I've made in that notebook?

@JiaweiZhuang
Copy link
Owner

The code looks alright; it should be either ESMPy install issues or weird singularities in the input grid. Do you have an example data file (say just one time slice)?

@DamienIrving
Copy link
Author

Yep. No problem - you can download a cut down version of the data file (first timestep only) here.

@DamienIrving
Copy link
Author

GitHub seems to be having issues rendering anything but the initial version of the notebook, so best to use this link: https://github.com/DamienIrving/ocean-analysis/blob/c9d46e50b3171c0000c43a8628b42dba4d9a881f/development/xESMF_test.ipynb

@JiaweiZhuang
Copy link
Owner

The problem is that the grid you pass to xESMF contains multiple disconnected tiles, although they are stored in a single 2D array:

image

So, apparently, xESMF/ESMPy has trouble understanding the connectivity.

The error is fixed by breaking your full grid to several well-defined 2D tiles.

See this GitHub gist for full code:
https://nbviewer.jupyter.org/gist/JiaweiZhuang/7a620ccea7d686891fed0221f386a50b

A very similar issue is #14 (comment)

A more general discussion on multi-tile support is at #21.

@DamienIrving
Copy link
Author

Thanks, @JiaweiZhuang. This is super helpful.

Interestingly, iris (regrid_weighted_curvilinear_to_rectilinear) had similar problems with this particular model/grid, but cdo remapbil handled the regirdding just fine.

@JiaweiZhuang
Copy link
Owner

Yes Iris exactly uses ESMPy under the hood so should have the same issue. CDO seems to use its own, non-ESMF regridding implementation.

aulemahal pushed a commit to Ouranosinc/xESMF that referenced this issue Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants