Source set_strict rather than call it as a function (#4690)#4697
Conversation
# Description To adhere to NWS operational standards, we must, rather than define and execute bash functions to set and unset strict mode, source `ush` scripts that set and unset strict mode. This PR removes the functions and instead creates simplified bash that can be sourced, and all places that previously called the functions have been replaced by a source of the scripts. Additionally, the set_strict has been removed from jjob_shell_setup and is now explicitly called at the top of every j-job. Resolves #NOAA-EMC#4682 # Type of change - [ ] Bug fix (fixes something broken) - [ ] New feature (adds functionality) - [x] Maintenance (code refactor, clean-up, new CI test, etc.) # Change characteristics <!-- Choose YES or NO from each of the following and delete the other --> - Is this change expected to change outputs (e.g. value changes to existing outputs, new files stored in COM, files removed from COM, filename changes, additions/subtractions to archives)? NO - Is this a breaking change (a change in existing functionality)? NO - Does this change require a documentation update? NO - Does this change require an update to any of the following submodules? No - [ ] EMC verif-global <!-- NOAA-EMC/EMC_verif-global#1234 --> - [ ] GDAS <!-- NOAA-EMC/GDASApp#1234 --> - [ ] GFS-utils <!-- NOAA-EMC/gfs-utils#1234 --> - [ ] GSI <!-- NOAA-EMC/GSI#1234 --> - [ ] GSI-monitor <!-- NOAA-EMC/GSI-Monitor#1234 --> - [ ] GSI-utils <!-- NOAA-EMC/GSI-Utils#1234 --> - [ ] UFS-utils <!-- ufs-community/UFS_UTILS#1234 --> - [ ] UFS-weather-model <!-- ufs-community/ufs-weather-model#1234 --> - [ ] wxflow <!-- NOAA-EMC/wxflow#1234 --> # How has this been tested? <!-- Please list any test you conducted, including the machine. Include the output of `gw_cistat -r /path/to/RUNTESTS/directory` for the tests you ran. `gw_cistat` is available after sourcing the `gw_setup.sh` script in `dev/ush/`. Example: - Clone and build on WCOSS - Cycled test on Orion - Forecast-only on Hera --> On Ursa: ``` ############################### C48_ATM ################################ CYCLE STATE ACTIVATED DEACTIVATED 202103231200 Done Mar 20 2026 19:10:07 Mar 20 2026 20:20:05 ############################### C48_S2SW ############################### CYCLE STATE ACTIVATED DEACTIVATED 202103231200 Done Mar 20 2026 19:10:07 Mar 20 2026 20:20:05 ########################## C48_gsienkf_atmDA ########################### CYCLE STATE ACTIVATED DEACTIVATED 202402231800 Done Mar 20 2026 19:10:07 Mar 20 2026 19:30:07 202402240000 Done Mar 20 2026 19:10:07 Mar 20 2026 20:25:06 202402240600 Done Mar 20 2026 19:10:07 Mar 20 2026 21:10:05 ########################## C48_ufsenkf_atmDA ########################### CYCLE STATE ACTIVATED DEACTIVATED 202402231800 Done Mar 20 2026 19:10:07 Mar 20 2026 19:30:07 202402240000 Done Mar 20 2026 19:10:07 Mar 20 2026 20:40:07 202402240600 Done Mar 20 2026 19:10:07 Mar 20 2026 21:30:08 ######################### C48mx500_3DVarAOWCDA ######################### CYCLE STATE ACTIVATED DEACTIVATED 202103241800 Done Mar 20 2026 19:10:07 Mar 20 2026 20:25:06 202103250000 Done Mar 20 2026 19:10:07 Mar 20 2026 21:05:07 ########################## C48mx500_hybAOWCDA ########################## CYCLE STATE ACTIVATED DEACTIVATED 202103241800 Done Mar 20 2026 19:10:07 Mar 20 2026 19:40:06 202103250000 Done Mar 20 2026 19:10:07 Mar 20 2026 20:45:07 ########################### C96C48_hybatmDA ############################ CYCLE STATE ACTIVATED DEACTIVATED 202112201800 Done Mar 20 2026 19:10:07 Mar 20 2026 19:35:07 202112210000 Done Mar 20 2026 19:10:07 Mar 20 2026 21:05:07 202112210600 Done Mar 20 2026 19:10:07 Mar 20 2026 21:40:07 ######################### C96C48_hybatmsnowDA ########################## CYCLE STATE ACTIVATED DEACTIVATED 202112201200 Done Mar 20 2026 19:10:07 Mar 20 2026 19:40:06 202112201800 Done Mar 20 2026 19:10:07 Mar 20 2026 21:10:05 202112210000 Done Mar 20 2026 19:10:07 Mar 20 2026 21:30:08 ######################### C96C48_hybatmsoilDA ########################## CYCLE STATE ACTIVATED DEACTIVATED 202205150600 Done Mar 20 2026 19:10:07 Mar 20 2026 19:40:06 202205151200 Done Mar 20 2026 19:10:07 Mar 20 2026 21:20:06 202205151800 Done Mar 20 2026 19:10:07 Mar 20 2026 21:45:08 ######################### C96C48_ufs_hybatmDA ########################## CYCLE STATE ACTIVATED DEACTIVATED 202402231800 Done Mar 20 2026 19:10:07 Mar 20 2026 19:40:05 202402240000 Done Mar 20 2026 19:10:07 Mar 20 2026 21:25:07 202402240600 Done Mar 20 2026 19:10:07 Mar 20 2026 21:30:08 ######################## C96C48_ufsgsi_hybatmDA ######################## CYCLE STATE ACTIVATED DEACTIVATED 202402231800 Done Mar 20 2026 19:10:07 Mar 20 2026 19:40:05 202402240000 Done Mar 20 2026 19:10:07 Mar 20 2026 21:25:07 202402240600 Done Mar 20 2026 19:10:07 Mar 20 2026 21:35:06 ####################### C96C48mx500_S2SW_cyc_gfs ####################### CYCLE STATE ACTIVATED DEACTIVATED 202112201200 Done Mar 20 2026 19:10:07 Mar 20 2026 20:50:07 202112201800 Done Mar 20 2026 19:10:07 Mar 20 2026 22:10:06 202112210000 Done Mar 20 2026 19:10:07 Mar 20 2026 22:35:06 ############################# C96_atm3DVar ############################# CYCLE STATE ACTIVATED DEACTIVATED 202112201800 Done Mar 20 2026 19:10:07 Mar 20 2026 19:35:07 202112210000 Done Mar 20 2026 19:10:07 Mar 20 2026 21:15:07 202112210600 Done Mar 20 2026 19:10:07 Mar 20 2026 21:40:07 ########################### C96_gcafs_cycled ########################### CYCLE STATE ACTIVATED DEACTIVATED 202112201200 Done Mar 20 2026 19:10:07 Mar 20 2026 19:30:06 202112201800 Done Mar 20 2026 19:10:07 Mar 20 2026 21:20:06 202112210000 Done Mar 20 2026 19:10:07 Mar 20 2026 21:05:07 ######################## C96_gcafs_cycled_noDA ######################### CYCLE STATE ACTIVATED DEACTIVATED 202112201200 Done Mar 20 2026 19:10:07 Mar 20 2026 19:30:06 202112201800 Done Mar 20 2026 19:10:07 Mar 20 2026 21:00:08 202112210000 Done Mar 20 2026 19:10:07 Mar 20 2026 20:40:07 ``` # Checklist - [x] Any dependent changes have been merged and published - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have documented my code, including function, input, and output descriptions - [x] My changes generate no new warnings - [x] New and existing tests pass with my changes - [x] This change is covered by an existing CI test or a new one has been added - [x] Any new scripts have been added to the .github/CODEOWNERS file with owners - [x] I have made corresponding changes to the system documentation if necessary
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
shellcheck
This } is literal. Check expression (missing ;/\n?) or quote it. SC1083
🚫 [shellcheck] reported by reviewdog 🐶
Couldn't parse this brace group. Fix to allow more checks. SC1073
🚫 [shellcheck] reported by reviewdog 🐶
You need a space after the '{'. SC1054
This } is literal. Check expression (missing ;/\n?) or quote it. SC1083
🚫 [shellcheck] reported by reviewdog 🐶
Expected a '}'. If you have one, try a ; or \n in front of it. SC1056
🚫 [shellcheck] reported by reviewdog 🐶
Missing '}'. Fix any mentioned problems and try again. SC1072
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
shellcheck
This } is literal. Check expression (missing ;/\n?) or quote it. SC1083
🚫 [shellcheck] reported by reviewdog 🐶
Couldn't parse this brace group. Fix to allow more checks. SC1073
🚫 [shellcheck] reported by reviewdog 🐶
You need a space after the '{'. SC1054
This } is literal. Check expression (missing ;/\n?) or quote it. SC1083
🚫 [shellcheck] reported by reviewdog 🐶
Expected a '}'. If you have one, try a ; or \n in front of it. SC1056
🚫 [shellcheck] reported by reviewdog 🐶
Missing '}'. Fix any mentioned problems and try again. SC1072
TravisElless-NOAA
left a comment
There was a problem hiding this comment.
Looks fine to me
Description
To adhere to NWS operational standards, we must, rather than define and execute bash functions to set and unset strict mode, source
ushscripts that set and unset strict mode. This PR removes the functions and instead creates simplified bash that can be sourced, and all places that previously called the functions have been replaced by a source of the scripts.Additionally, the set_strict has been removed from jjob_shell_setup and is now explicitly called at the top of every j-job.
Resolves ##4682
Type of change
Change characteristics
How has this been tested?
On Ursa:
Checklist
Description
Type of change
Change characteristics
How has this been tested?
Checklist