Repository navigation
Refactor and expand CI testing system + A few bug fixes. - #319
dustinswales wants to merge 59 commits into
Conversation
New config_landuse_data option 'MODIFIED_IGBP_MODIS_NOAH_LAKES' reads the WPS dataset modis_landuse_20class_30s_with_lakes/ (category 21 = lakes): - Registry: nlcat = 21 for the new option; new mesh field islake_lu (default -1) in the input and output streams. - MMINLU stays 'MODIFIED_IGBP_MODIS_NOAH', so the RUC LSM selects the 21-row MODI-RUC table in VEGPARM.TBL. - interp_landuse returns islake from the dataset index file, and stops if the dataset's category count does not match nlcat. - Lake points keep lu_index = islake_lu (they are no longer converted to iswater_lu by the soil/land use consistency check) and get water soil. - derive_landmask treats lake points as water (landmask = 0). - The static step stops if the new option is used with a dataset that has no lake category. Static files without islake_lu still work: MPAS warns that the variable is not in the input file and keeps the default (-1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kadc7j2btyf9EtMtcXzsmY
…nal fetch smoke_fine_fg, dust_fine_fg and dust_coarse_fg in init_atm_case_gfs and init_atm_case_lbc are only set when config_smoke_scheme / config_dust_scheme are on, but are later tested with associated(). With the schemes off the pointers are undefined, so associated() can return true and the code reads through a garbage descriptor: segfault with optimized gfortran builds, 'index below lower bound' with -fcheck=bounds (mpas_init_atm_cases.F:7357). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kadc7j2btyf9EtMtcXzsmY
New workflow .github/workflows/make_ics.yml builds init_atmosphere_model from the branch under test and creates static, init, lbc and sfc_update files for four 120 km CONUS cases: conus_gfs, conus_raps, conus_rapw (20-class MODIS land use) and conus_rapw_lake (21-class MODIS with lakes). Static files are made once per land-use variant and cached on the init_atmosphere source; each case is checked with check_ics.py (nlcat, islake_lu, lake points are water, no NaN/Inf, LBC times) and uploaded as an artifact. Scripts and namelists are in testing_and_setup/ufs-community/ics/, taken from dustinswales/mpas-ic-factory; inputs come from release init-inputs-v1.0.0 of this repository (copy_inputs_release.sh copies them from the factory). The existing run_mpas* workflows are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kadc7j2btyf9EtMtcXzsmY
Use only the summer RAP case (2024081518), whose ungrib inputs are 1.3 GB against 8 GB for GFS and 16 GB for winter RAP: conus_raps (20-class MODIS) and the new conus_raps_lake (21-class MODIS with lakes). The conus_gfs, conus_rapw and conus_rapw_lake case files stay for running by hand. copy_inputs_release.sh now copies only the bundles the workflow uses by default (about 6 GB); -a copies everything, -b chooses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kadc7j2btyf9EtMtcXzsmY
Run conus_gfs alongside conus_raps and conus_raps_lake, so the GFS init path and the sfc_update step are tested too. conus_gfs shares the 20-class static file with conus_raps, so there are still two static jobs. copy_inputs_release.sh: default destination tag v8.4.2-1.19 (INPUTS_TAG), and the default bundles now include ungrib-gfs.2023031015 and ungrib-sst.2023031015 (about 14 GB in all). Assets already in the release are skipped, so re-running it adds only the GFS bundles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kadc7j2btyf9EtMtcXzsmY
Add conus_gfs_lake: the GFS case (2023031015) with the 21-class MODIS land use with lakes. It shares the lakes static file with conus_raps_lake, so there are still two static jobs, and it exercises the sfc_update step over lake points. No new inputs are needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kadc7j2btyf9EtMtcXzsmY
conus_gfs_noahmp makes GFS ICs for Noah-MP: 4 soil levels, with the NCAR init/lbc/sfc_update namelists from barlage/mpas_testcase (55 levels, 30 km top), as used by the mesoscale_reference_noahmp run tests. It shares the 20-class static file with conus_gfs, which already has the Noah-MP static fields (config_noahmp_static defaults to true). - create_case.sh: optional nml_variant per case selects case_files/<step>/<source>.<date>.<nml_variant> - check_ics.py: check nSoilLevels (4 with --noahmp, 9 otherwise) and, with --noahmp, soilcomp and soilcl1-4 over land - make_ics.yml: add the case; the matrix "lakes" key is now "checks" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kadc7j2btyf9EtMtcXzsmY
init_atmosphere: config_nsoillevels = 10 now gives a 10-layer soil set for Noah-MP (dzs = 0.05 0.10 0.10 0.10 0.30 0.35 0.50 1.00 1.00 1.50 m, 5 m deep), with soil temperature and moisture interpolated as for the 4-layer set. Layers centered below the deepest input level (3 m, the deep soil temperature) take the deepest input values instead of being left unset. The 4- and 9-level sets are unchanged. conus_gfs_noahmp10 is conus_gfs_noahmp with 10 soil layers. check_ics.py gets --soil-levels N and, for Noah-MP cases, checks that every soil level of tslb and smois is plausible over land. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kadc7j2btyf9EtMtcXzsmY
Ice-covered cells are converted to land-ice cells (lu_index = isice_lu, soil category 16, xland = 1, tmn = 271.4, soil state recomputed). That also caught lake cells (lu_index = islake_lu), so frozen lakes lost their lake category in init.nc and were never handed to the lake model. Frozen lake cells now keep their lake land use and water soil categories, landmask, xland and tmn, and only record the ice state: seaice = 1, xice set to 1 when the cell was flagged by the skin-temperature test alone, and the same snow-albedo, vegfra and snow-depth limits as sea ice. Nothing changes when the land use dataset has no lake category (islake_lu = -1). Addresses a Copilot review comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0152ZaH1Z8CTZ76uQA6wxBar
…here on them) - One workflow: build init_atmosphere -> static -> ICs (from make_ics.yml), and atmosphere builds (feature Release/Debug/stoch + noaa/develop and v8.4.2 baselines, cached per source) -> 16 baseline-vs-feature runs on the generated ICs. - Build-only Intel coverage (make/cmake x stochastic) folded into the same workflow; PnetCDF/autotools build moved to a composite action. - get_data.sh: add --tables-only (runs no longer download the staged ICs). - Remove build_mpas*.yml, run_mpas*.yml, make_ics.yml.
Each run job records its result (identical / differs / which step failed) and a final summary job collects them into one table on the run's summary page. Differences from the baseline are reported but do not fail the workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJoyMxrFn2rTCgmEvcorg3
This reverts commit 7bce978.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJoyMxrFn2rTCgmEvcorg3
This reverts commit 8507c26.
- Test list moves to testing_and_setup/ufs-community/ci_tests.json; a plan job (ci_plan.py) makes the build and run matrices from it, crossing each test with the toolchains it lists. oneapi runs the 8 Release tests without stochastic physics (24 runs in all); ICs are still made once with GNU. - build_atmosphere/run take image, make target (gfortran/intel) and MPI launcher from the toolchain; artifacts and the summary table carry the toolchain. - docker/Dockerfile-oneapi-minimal: put Intel MPI on PATH/LD_LIBRARY_PATH, point the generic MPI wrappers at ifx/icx/icpx, and use shm + fork bootstrap for single-node runs in the container. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJoyMxrFn2rTCgmEvcorg3
All issues identified by co-pilot have been addressed. |
|
@clark-evans Can we move forward merging this? I believe I've addressed all issues/comments. |
|
I’m on leave beginning today and will be driving most of the day, but I’ll try to do my final review late tonight US central time.
|
| # plan make the build_atmosphere and run matrices from ci_tests.json | ||
| # build_init make gfortran CORE=init_atmosphere (this branch; GNU container) | ||
| # build_atmosphere make <target> CORE=atmosphere for this branch and the baselines (MPAS-Dev | ||
| # v8.4.2, ufs-community noaa/develop) with each toolchain a test needs. |
There was a problem hiding this comment.
Consider removing the v8.4.2 designator here to avoid having to update this with each upstream version number change.
|
|
||
| env: | ||
| # TEMPORARY: read inputs from the authoritative repository's release. Switch back to | ||
| # ${{ github.repository }} once this repository's release has the input bundles. |
There was a problem hiding this comment.
Just confirming this will come in a follow-up PR?
There was a problem hiding this comment.
This comment is old. I already created the release and this script is pointing to it.
| build_init: | ||
| name: build init_atmosphere | ||
| needs: plan | ||
| runs-on: ubuntu-22.04 |
There was a problem hiding this comment.
I noticed the runs-on tag before this is ubuntu-26.04 whereas this and many subsequent instances are ubuntu-22.04. Can these be made consistent? (Optimally with 26.04 for future-proofing.)
There was a problem hiding this comment.
Good catch. Will do
| with: | ||
| name: ${{ env.BUNDLE }} | ||
| path: ${{ env.BUNDLE }}/ | ||
| retention-days: 7 |
There was a problem hiding this comment.
Can we lengthen this retention, or does it challenge whatever allocation we get for free? Several times I've wished older artifacts were still visible, usually when attempting to debug an issue with either a PR or the CI tests. Would 14 or 30 days be doable?
There was a problem hiding this comment.
(Ditto subsequent instances, though it's really the output of the Python comparison script -- not this instance -- that would be most helpful.)
There was a problem hiding this comment.
I bumped everything to 30-days. We may run into storage space issues, but we'll see.
| @@ -1,3 +1,7 @@ | |||
| # Every physics directory that holds Fortran module files. Some compilers (nvfortran) also need | |||
| # the module files of modules that the physics modules used here use in turn. | |||
| PHYSICS_MODDIRS = $(addprefix -I../physics/, physics_mmm physics_wrf physics_noahmp physics_noahmp/utility physics_noahmp/drivers/mpas physics_noahmp/src physics_noaa/TEMPO physics_noaa/UGWP physics_noaa/MYNN-EDMF/src physics_noaa/MYNN-SFC/src physics_noaa/RUCLSM physics_noaa/GFL physics_noaa/SMOKE) | |||
There was a problem hiding this comment.
I presume that this will need to be modified if any physics submodules/directories are added/removed in the future?
There was a problem hiding this comment.
Removed. Accidentally added with a git add *.
| "develop-release": { "repo": "ufs-community/MPAS-Model", "ref": "noaa/develop", "make_flags": "" }, | ||
| "develop-stoch-release": { "repo": "ufs-community/MPAS-Model", "ref": "noaa/develop", "make_flags": "STOCHASTIC_PHYSICS=true" }, | ||
| "develop-debug": { "repo": "ufs-community/MPAS-Model", "ref": "noaa/develop", "make_flags": "DEBUG=true" }, | ||
| "v8.4.2-release": { "repo": "MPAS-Dev/MPAS-Model", "ref": "v8.4.2", "make_flags": "" }, |
There was a problem hiding this comment.
I'm wondering if we can make this more general; e.g., "authoritative-release", with a "ref" of "master". Doing so would negate the need to update the CI test names/documentation with every upstream release.
There was a problem hiding this comment.
Each build test has a name, codebase (repo), branch/tag (ref), and additional build configurations (make_flags).
We could distill there further by introducing aliases for repo/ref combinations, but I think this makes it more complicated.
There was a problem hiding this comment.
I don't think we need to distill further - I'm just thinking that instead of hard-coding v8.4.2 (or future versions) here, could we instead point to the upstream master?
There was a problem hiding this comment.
I guess this depends on what you want to test?
Currently, we bring over stable versions of MPAS-Dev to ufs-community. The v8.4.2 tag is the latest stable point ported.
Master will move forward at some point, possibly already.
In that case, the authoritative tests will be using MPAS functionality not yet in ufs-community. Our tests are based on the idea of testing MPAS functionality not yet in authoritative.
That's not to say we can't use master instead of a stable tag. Actually, maybe we want to do this? It would inform us and motivate us to sync ufs-community with MPAS-Dev when the authoritative tests break?
I though I replied to this, but I guess I did not - my bad. 310, 314, and 316 have been merged in that order, so now we're here and ready for this PR (which addresses 321)...so perhaps consider this implicit agreement now followed up with explicit agreement? |
|
Sorry for the delay in reviewing this, @dustinswales - I've left several comments for your consideration. I can review late Wednesday US Central time if any further input is needed before merging. |
…Model into feature/ci_refactor
|
@clark-evans I addressed your comments. Let me know if I missed anything. |
clark-evans
left a comment
There was a problem hiding this comment.
Looks good to me pending the one open comment about v8.4.2 vs. master referencing for the CI test matrix.
@clark-evans I think I commented on that one above. We use a mix of stable tags and HEAD of branches that makes this complicated. |
Can the HEAD of the upstream master branch be used for the authoritative tests? Or do we not always want to compare against that -- e.g., when they update before we've had the chance to do so -- and live with having to change the CI test matrix references with each upstream release? I've leaned a bit toward the former than the latter, but I'm OK with the latter if you think it's preferable to do so. |
@clark-evans That's not to say we can't use master instead of a stable tag. Actually, maybe we want to do this? It would inform us and motivate us to sync ufs-community with MPAS-Dev when the authoritative tests break? A simple change if you agree. |
We have good knowledge of when MPAS-Dev/master is updated, from which we prepare our own synchronizing PR, though that PR isn't always the next PR to be merged. We don't need to hold up other PRs just to complete an upstream merge, particularly since we need to improve our vetting of the upstream science changes through testing and evaluation. And, all of this may well change once EPIC takes over lead code management for noaa/develop here. So, thanks for iterating with me on the inquiry, but I think it's helped convince me that the current approach in this PR is the best one for now. If you concur and feel comfortable with me merging this PR, I can go ahead and get it done. |
Description
This PR extensively modifies the CI testing system in several ways.
In previous versions of the CI system, IC/LBCs were generated offline and staged for core_atmosphere tests.
Included in this refactor, we call core_init_atmosphere to generate the static and LBC/IC files. These are then used to drive the core_atmosphere tests.
Grid, IC, and LBC files generated by the tests are stored a GitHub artifacts. These can be directly in MPAS enabled forecasts within the UFS Weather Model.
The test matrix is defined in testing_and_setup/ufs-community/ci_tests.json
Snapshot of test summary board.

32 tests total
The change to the SMOKE submodule has already been merged. As part of this PR we update the SMOKE submodule hash to include this fix.
There is an issue with output_timelevels that was causing a failure in the HRRRv5 tests for a few months, see #318. This is fixed in this PR.
Mandatory Questions
Reviews
@clark-evans @guoqing-noaa @AndersJensen-NOAA