geoschem / gcpy

Python toolkit for GEOS-Chem. Contains basic plotting scripts, plus the suite of GEOS-Chem benchmarking utilities.
https://gcpy.readthedocs.io
Other
51 stars 24 forks source link

Fixed online regridding code (file_regrid.py) for restart-to-restart file regridding only #266

Closed yantosca closed 1 year ago

yantosca commented 1 year ago

This PR fixes several issues with GCPy's online regridding program using xESMF in GCPy module gcpy/file_regrid.py. Several utility functions have been added to the gcpy/grid.py, gcpy/regrid.py, and gcpy/cstools.py modules.

NOTE: At this point, regridding between restart files has been tested. There are some issues with diagnostic regridding (involving the ordering of vertical levels not being consistent with the lev:positive attribute, see: https://github.com/geoschem/GCHP/issues/21). We do not recommend regridding between GCHP diagnostic files.

Regridding 4x5 GCClassic to 2x2.5 GCClassic

NOTE: The grayscale came in when converting from PDF to PNG. Not sure why. classic-to-classic sfc

Regridding C24 checkpoint to 4x5 GCClassic

checkpoint-to-classic sfc

Regridding 4x5 GCClassic to C24 checkpoint

classic-to-checkpoint sfc

Regridding C48 checkpoint to C24 checkpoint

checkpoint-to-checkpoint sfc

Regridding C48 checkpoint to C24 stretched grid

@lizziel: Not sure if the regridding is wrong or the plotting is wrong checkpoint-to-stretched sfc

lizziel commented 1 year ago

There is definitely something weird going on with CS comparison plots, probably related to this issue: https://github.com/geoschem/gcpy/issues/167. Regridding both C24 and C48 to lat-lon would probably be better for validation. Regardless, that stretched grid plot looks strange, but maybe a separate issue.

yantosca commented 1 year ago

Thanks @lizziel. I will address your comments. In the meantime I made the comparison plots of c48 -> 2x25 and c24-> 2x25. Regridding looks OK there. c24 -> 2x2.5

Screenshot 2023-10-11 at 11 32 46 AM

c48 -> 2x2.5 (note: Ref is mislabeled but the resolution is OK)

Screenshot 2023-10-11 at 11 34 10 AM