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

ESMF linear regridding fails with periodic data #87

Closed
golaz opened this Issue Feb 9, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@golaz

golaz commented Feb 9, 2017

Regridding a cmds2 variable with the ESMF 'linear' regridder produces a re-gridded variable with missing values in the last row even with 'periodicity' option:

mod_reg = mod.regrid(obs_grid, regridTool='esmf', regridMethod='linear',
                     periodicity=1)
print(mod_reg[0,:,-1])
[-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --]

ESMF 'conservative' works:

mod_reg = mod.regrid(obs_grid, regridTool='esmf', regridMethod='conservative',
                     periodicity=1)
print(mod_reg[0,:,-1])
[ 0.1775848   0.17194211  0.19889209  0.21295014  0.24867538  0.28324196
  0.69440496  1.32830727  1.50522876  1.56897235  1.68829095  1.88622808
  2.13176775  2.45337605  2.81568313  3.28516364  3.68253398  3.81388021
  3.81694198  3.53876781  2.99395347  2.40873313  1.87455702  1.38764656
  0.90896726  0.63228369  0.4988831   0.40273684  0.3616761   0.35790667
  0.31463447  0.23865385  0.2917757   0.62382942  1.50482094  2.78247166
  4.3944869   5.74536467  4.55221224  4.64323425  4.38701391  3.17413998
  1.74064946  0.8630349   0.54839915  0.40030503  0.31123033  0.32339755
  0.66151059  1.69445014  2.08923626  1.66341853  2.42673993  3.43523192
  3.21942377  2.68930316  2.68675494  2.68433309  2.59466863  2.95403409
  3.43042731  2.47113466  1.81030071  1.57754922  1.41838813  1.22518241
  1.03416896  0.88724566  0.7730062   0.67540711  0.62005973  0.61057758]

Complete example: regrid.zip

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Feb 9, 2017

@rokuingh pinging you here, is that an expected behaviour of esmf? We are still using 6.3 and ESMP. @dnadeau4 and I need to get in touch about esmpy see #57

@rokuingh

This comment has been minimized.

rokuingh commented Feb 13, 2017

Hi Charles, I can't say for sure without seeing the implementation in UV-CDAT. However, it seems like the periodic connection is not turned on in this case. I realize UV-CDAT is using the ESMP prototype code, but that is usually done in ESMPy using coord_sys=ESMF.CoordSys.SPH_DEG (instead of the CoordSys.CART). I believe this setting was handled with similarly named flags ESMP_COORDSYS_CART, ESMP_COORDSYS_SPH_DEG in ESMP. It would be worth a grep through the ESMP implementation in UVCDAT using these two strings to see if you can tell coordinate system is being used for the grids in this case.

@golaz

This comment has been minimized.

golaz commented Feb 16, 2017

@dnadeau4 and @doutriaux1 : did you have a chance to look at the ESMP implementation in UVCDAT to check if the correct coordinate system is being passed?

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Feb 16, 2017

@dnadeau4 is working on esmpy as his next task.

dnadeau4 added a commit that referenced this issue Feb 17, 2017

@dnadeau4 dnadeau4 closed this in f67d07c Feb 24, 2017

doutriaux1 added a commit that referenced this issue Mar 17, 2017

Update ESMP to ESMPy (ESMF 7.0.0) (#103)
* Fix #87 ESMF periodicity

* add Test for regriding periodicity

* add UVCDAT URL to retrieve file remotely

* tear down Downloaded files

* Change array test to string test

* Change array to 1d array

* pass slicelist = () for numpy 1.12

* Fix #4 _FillValue exist and missing_value does not in file

* trigger CI

* First conversion to ESMPy

* ignore degenerate and fix corner problem

* esmpy fix for periodicity test

* esmpy fix for merging issues

* esmpy delete print unMappedAction

* add some 2d and 3D test plus devel

* Continue to convert test from ESMP to ESMF

* conver to ESMF

* continue development for ESMF

* disable SSL_CERTIFICATE from urllib; add ESMF test

* move Test to tests

*  rename test files

* if PLOT import matplolib

* add ESMPy to travis

* add mpi4py to travis and circleci

* Fix more ESMF tests

* fix circleci dep and some tests

* fix circleci dep move anonymous download

* Fix mask in test

@doutriaux1 doutriaux1 modified the milestone: 2.10 May 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment