Combination PR for #1141, #1152 and ufs/dev #304#1159
Merged
Conversation
the end of subroutines, remove duplicate print statements
statements. More cleanup
"can not" to cannot.
errflg directly. On branch return-on-error
interpolation by routine fixrdc. Fixes NCAR#300.
Combination of 264,265,291 (MERRA2 3-hr, photochem diag, prog closure SFS)
…k that w3emc is using the expected precision
…k that w3emc is using the expected precision
Fix setting of land mask in sfcsub.F
mdtoyNOAA
approved these changes
Sep 2, 2025
climbfuji
reviewed
Sep 3, 2025
Collaborator
climbfuji
left a comment
There was a problem hiding this comment.
Thanks very much for merging this, @grantfirl ! Retrospective approval :-)
Collaborator
Author
I'm going to open up a PR to get this into ufs/dev, probably combining with #1158 once there is some agreement there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes:
This PR combines changes from #1141, #1152, and ufs/dev PR 304
#1141 description:
The issue: Some subroutines do not have return statements after an error occurs. Instead two variables errflg and errmsg are reset or re-initialized in subsequent calls, and if an error occurs it is not captured and the program continues without stopping. Please note that some calls already have if(errflg/=0) return in place.
This PR fixes an issue to return right after an error occurs. Subroutines that use errflg and errmsg should be checked for errflg and abort if necessary. Insert if(errflg/=0) return after such calls.
In addition the following is added:
Remove unnecessary return statements at the end of subroutines. In one case, there were actually two return statements right after each other.
Improve error messages and remove duplicate print statements if they are the same as the errmsg.
Change “can not” to “cannot” and other minor additions.
UPDATE: Thanks to reviewers' feedback, this PR also includes cleanup of GFS_phys_time_vary.fv3.F90 to remove copy_error calls from one-thread region (accessing errmsg and errflg directly).
#1152 description (issue):
The way w3emc is used in GFS_time_vary_pre is not safe, since there is no protection against argument mismatches in case the wrong version of the library (e.g., _4 instead of _d) is used. This came up during the debugging of a w3emc build issue with Intel oneAPI ifx.
A detailed description can be found here: JCSDA/spack-stack#1716
The issue also provides a code snippet that protects against using a wrong kind for the integer and real arguments in the w3difdat routines.
ufs/dev PR304 description:
Fix the setting of the land mask used in interpolating GLDAS soil data to the model grid. For a complete description, see ufs-community#300,
Tests Conducted:
These changes were combined and tested with the top of ufs/dev (only contained one additional MPAS-based PR that shouldn't affect these results). All UFS RTs passed. All SCM RTs passed.
#1141 testing in NRL: None with the current head of the repo. Only quick tests with an older hash with NEPTUNE. We would like to adopt this ccpp error (errflg and errmsg) handling on our next upgrade but we need this PR (once reviewed and approved) to be merged first.
Dependencies:
None
Documentation:
None
Issue (optional):
None
Contributors (optional):
@climbfuji @matusmartini @GeorgeGayno-NOAA