Skip to content

Commit 1edd0e4

Browse files
committed
Merge PR #385 (Fix stretched-grid regridding error)
This merge brings PR # (Fix the regridding error when the target latitude or longitude is exactly 0.0, by @1Dandan) into the GCPy 1.7.0 development stream. PR #385 updates an if statement to use test for "None" instead of "not", thus avoiding an error when the target latitude or longitude is exactly zero. Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
2 parents 758c05b + 56c21a0 commit 1edd0e4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3535
- Fixed grid area calculation scripts of `grid_area` in `gcpy/gcpy/cstools.py`
3636
- Fixed various security issues in GitHub Actions workflows
3737
- Fixed colorbar bounds for case of comparing cubed-sphere grids
38+
- Fixed the restart regridding for stretched GCHP when target lat/lon is exactly 0.0 in `gcpy/regrid_restart_file.py`
39+
3840

3941
### Removed
4042
- Removed `PdfMerger()` from `compare_single_level` and `compare_zonal_mean`, it has been removed in pypdf >= 5.0.0

gcpy/regrid_restart_file.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,9 @@ def regrid_restart_file(
559559
logging.info("Creating a stretched-grid restart file")
560560

561561
if (
562-
(not COMMAND_LINE.stretch_factor)
563-
or (not COMMAND_LINE.target_latitude)
564-
or (not COMMAND_LINE.target_longitude)
562+
COMMAND_LINE.stretch_factor is None
563+
or COMMAND_LINE.target_latitude is None
564+
or COMMAND_LINE.target_longitude is None
565565
):
566566
ERROR_MESSAGE = (
567567
"--stretched-grid was set but not all stretched-"

0 commit comments

Comments
 (0)