Skip to content

Fixes for offline regridding and stretched grid plotting#381

Merged
yantosca merged 4 commits intodevfrom
bugfix/offline_regridding_and_stretch_grid_plotting_fixes
Oct 6, 2025
Merged

Fixes for offline regridding and stretched grid plotting#381
yantosca merged 4 commits intodevfrom
bugfix/offline_regridding_and_stretch_grid_plotting_fixes

Conversation

@lizziel
Copy link
Contributor

@lizziel lizziel commented Oct 2, 2025

Name and Institution (Required)

Name: Lizzie Lundgren
Institution: Harvard University

Describe the update

This update applies the following changes to offline regridding code in function regrid_restart_file. That function is currently used to create GCHP stretched grid restart files via offline regridding.

  1. It removes the call to update_encoding which previously converted all restart variables to floating point precision. Precisions of the source restart file should instead be preserved, e.g. double precision for species concentrations.
  2. It prevents passing an output template file that has different dimension sizes than the target restart file. There is existing code that can resize the template restart file dataset but it currently causes a corrupt output restart file. That code is kept in case future work is done on it, but new error handling now causes exit with an error if it is triggered.

This PR also fixes the names of stretched grid target latitude and longitude attributes used in plotting code. This bug crept in during recent development and is not part of an existing release. It is therefore not mentioned in the changelog.

Expected changes

This update fixes plotting of stretched grid restart variables and makes GCHP restarts regridding using offline regridding better match restart generated using online regridding (GCPy function regrid_file). Note that the restarts for these two methods do not exactly match. That is currently under investigation.

Reference(s)

None

Related Github Issue

None

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
This is a temporary fix to prevent users from passing an output template
file that differs in dimension sizes from the target grid size when
doing offline regridding. Code exists to reside the output template
but it currently does not work.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Native precision of source restart file should be preserved.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
@lizziel lizziel added topic: Regridding Issues pertaining to horizontal & vertical regridding category: Bug Fix Fixes a bug that was previously reported topic: Stretched Grid Pertaining to the cubed-sphere stretched-grid labels Oct 2, 2025
@lizziel lizziel requested a review from yantosca October 2, 2025 14:42
@yantosca yantosca changed the base branch from main to dev October 6, 2025 14:04
@yantosca
Copy link
Contributor

yantosca commented Oct 6, 2025

Thanks @lizziel. Good to merge!

@yantosca yantosca merged commit cda88d6 into dev Oct 6, 2025
21 checks passed
yantosca added a commit that referenced this pull request Oct 6, 2025
This merge brings updates from the "dev" branch (as of PR #381)
back into the "feature/update-constants" branch.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca yantosca deleted the bugfix/offline_regridding_and_stretch_grid_plotting_fixes branch October 15, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: Bug Fix Fixes a bug that was previously reported topic: Regridding Issues pertaining to horizontal & vertical regridding topic: Stretched Grid Pertaining to the cubed-sphere stretched-grid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants