Skip to content

Combination PR for #1141, #1152 and ufs/dev #304#1159

Merged
grantfirl merged 21 commits into
NCAR:mainfrom
grantfirl:NRL_combo_2025_09_02
Sep 3, 2025
Merged

Combination PR for #1141, #1152 and ufs/dev #304#1159
grantfirl merged 21 commits into
NCAR:mainfrom
grantfirl:NRL_combo_2025_09_02

Conversation

@grantfirl
Copy link
Copy Markdown
Collaborator

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

matusmartini and others added 21 commits June 5, 2025 04:48
the end of subroutines, remove duplicate print statements
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
@grantfirl grantfirl merged commit 2bd74ba into NCAR:main Sep 3, 2025
2 of 3 checks passed
Copy link
Copy Markdown
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

Thanks very much for merging this, @grantfirl ! Retrospective approval :-)

@grantfirl
Copy link
Copy Markdown
Collaborator Author

Thanks very much for merging this, @grantfirl ! Retrospective approval :-)

I'm going to open up a PR to get this into ufs/dev, probably combining with #1158 once there is some agreement there.

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.

6 participants