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

FMS2: Safe inspection of unlimited dim name #386

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

marshallward
Copy link
Member

The FMS2 function get_unlimited_dimension_name raises a netCDF error if no unlimited dimension is found. This is problematic for legacy or externally created input files which may have not identifed their time axis as unlimited.

This patch adds a new function, find_unlimited_dimension_name which mirrors the FMS2 function but returns an empty string if none are found.

This is an internal function, not intended for use outside of the module.

The FMS2 function `get_unlimited_dimension_name` raises a netCDF error
if no unlimited dimension is found.  This is problematic for legacy or
externally created input files which may have not identifed their time
axis as unlimited.

This patch adds a new function, `find_unlimited_dimension_name` which
mirrors the FMS2 function but returns an empty string if none are found.

This is an internal function, not intended for use outside of the
module.
@codecov
Copy link

codecov bot commented Jun 24, 2023

Codecov Report

Merging #386 (cc7335e) into dev/gfdl (cc1784c) will decrease coverage by 9.23%.
The diff coverage is n/a.

❗ Current head cc7335e differs from pull request most recent head 0c667c8. Consider uploading reports for the commit 0c667c8 to get more accurate results

@@             Coverage Diff              @@
##           dev/gfdl     #386      +/-   ##
============================================
- Coverage     47.45%   38.22%   -9.23%     
============================================
  Files            41      269     +228     
  Lines          4550    76359   +71809     
  Branches        798    14025   +13227     
============================================
+ Hits           2159    29192   +27033     
- Misses         2210    41928   +39718     
- Partials        181     5239    +5058     

see 254 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@marshallward
Copy link
Member Author

Based on @jiandewang's comments, I think this is ready to merge (assuming no regressions).

Copy link
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a simple and elegant solution to the problems with using FMS2 to read a restart (or other) file without an unlimited time axis that are discussed at github.com//issues/380. Given the reports from EMC in the discussion of that issue that this commit addresses their problems, I am satisfied that these fairly simple changes have been adequately tested.

@marshallward
Copy link
Member Author

@marshallward marshallward merged commit 042eee7 into NOAA-GFDL:dev/gfdl Jun 27, 2023
@marshallward marshallward deleted the safe_no_unlim branch May 8, 2024 14:54
@marshallward marshallward restored the safe_no_unlim branch May 8, 2024 14:55
@marshallward marshallward deleted the safe_no_unlim branch May 8, 2024 14:55
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

Successfully merging this pull request may close these issues.

2 participants