Skip to content

Allow excluding fields from ncdata_check - #517

Merged
nusbaume merged 8 commits into
ESCOMP:developmentfrom
jimmielin:hplin/exclude_check_data
Sep 18, 2026
Merged

nusbaume merged 8 commits into
ESCOMP:developmentfrom
jimmielin:hplin/exclude_check_data

Conversation

@jimmielin

@jimmielin jimmielin commented Jul 2, 2026 •

Copy link
Copy Markdown
Collaborator

Tag name (required for release branches): sima0_21_001
Originator(s): @jimmielin
AI tools used (if applicable; please also add the "AI-generated code" label to the PR):
What: claude-fable:5
How: Discussed the implementation, wrote most of the logic and tests.

Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number):

  • Allows excluding certain fields based on a .gitignore-like glob pattern from physics_check_data.
  • This feature is expected to be used so ncdata_check_err=.true. can be turned on in tests that read multi-stage snapshots where some variables are explicitly intended to be ignored as they would not match.

Describe any changes made to build system: N/A

Describe any changes made to the namelist: host-side ncdata_check_exclude option - default empty

List any changes to the defaults for the input datasets (e.g. boundary datasets): N/A

List all files eliminated and why: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the changes:
(Helpful git command: git diff --name-status development...<your_branch_name>)

M       cime_config/namelist_definition_cam.xml
  - add ncdata_check_exclude

M       src/core_utils/string_core_utils.F90
  - pure core_glob_match and core_glob_list_excluded

M       src/physics/utils/phys_comp.F90
  - add &physics_nl ncdata_check_exclude

M       src/physics/utils/physics_data.F90
  - check_field_2d/3d/4d skip rows whose report label matches the exclusion list
  - write out the excluded list always so it is not a silent drop.

M       test/unit/fortran/src/core_utils/test_string_core_utils.pf
  - comprehensive tests for the added glob matching string utils.

M       test/fortitude.toml
  - silence nuisance trip for public accessibility on pfUnit .pf files

If there are new failures (compared to the test/existing-test-failures.txt file),
have them OK'd by the gatekeeper, note them here, and add them to the file.
If there are baseline differences, include the test and the reason for the
diff. What is the nature of the change? Roundoff?

All tests have expected NLCOMP failures due to the presence of the new ncdata_check_exclude namelist variable.

derecho/intel/aux_sima:

SMS_Ln9.ne3pg3_ne3pg3_mg37.F2000_C7.derecho_intel.cam-outfrq_se_cslam_analy_ic (Overall: FAIL)

  • expected failure

derecho/gnu/aux_sima:

SMS_Ln9.ne3pg3_ne3pg3_mg37.F2000_C7.derecho_gnu.cam-outfrq_se_cslam_analy_ic (Overall: FAIL)

  • expected failure

derecho/nvhpc/aux_sima (test is run via Github workflow. Only run the test manually if we need to save new baselines):

If this changes climate describe any run(s) done to evaluate the new
climate in enough detail that it(they) could be reproduced:

CAM-SIMA date used for the baseline comparison tests if different than latest:

…check

Adds an ordered glob-pattern exclusion list for physics_check_data rows,
so test configurations can exclude variables that hold a different
pipeline stage than the check snapshot by design (with the reason
recorded next to the patterns, e.g. in a testmod). With all expected
differences excluded, ncdata_check_err=.true. turns the check into a
hard pass/fail test.

- string_core_utils: core_glob_match ('*'-only wildcard matcher) and
  core_glob_list_excluded (gitignore-style ordered first-match-wins
  decision; a leading '!' keeps a matching name). Both pure; pfUnit
  tests added (14 cases, passing).
- physics_data: check_field_2d/3d/4d skip rows whose report label
  matches the exclusion list; patterns are stored module-side via new
  set_check_field_exclusions, so the generated physics_check_data is
  unchanged. Excluded rows are buffered and listed in the check output
  by flush_check_field_verbose -- exclusion is never silent. Matching
  is on the label a row is reported under, which for
  constituent-dimensioned fields is the per-constituent file variable
  name (e.g. aerochem_vmr_bc_a1).
- phys_comp: new physics_nl entry ncdata_check_exclude (char*256(200)),
  broadcast and handed to physics_data; active patterns echoed at init.
- namelist_definition_cam.xml: entry with semantics and example.
@jimmielin jimmielin self-assigned this Jul 2, 2026
@jimmielin jimmielin added enhancement New feature or request AI-generated code labels Jul 2, 2026
@nusbaume
nusbaume requested a review from peverwhee July 8, 2026 16:24
Haipeng Lin and others added 2 commits July 22, 2026 17:17
Constituent check-row names no longer have stable case: capgen lowercases
derived constituent standard names, while registry-enumerated ones keep
their case. Patterns like '*SO2' stopped matching rows now registered as
'so2', so those rows were compared (and diffed) instead of excluded.
Lowercase the stored patterns and the row name at match time, consistent
with the framework treating standard names differing only in case as the
same.
… is how pfUnit units are structured throughout
@nusbaume
nusbaume self-requested a review September 14, 2026 15:47

@nusbaume nusbaume left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Applied what would have been my change requests in the latest commit!

@peverwhee
peverwhee deployed to CI-tests-on-CIRRUS September 16, 2026 21:16 — with GitHub Actions Active

@peverwhee peverwhee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

committed the one small comment change i had.

@nusbaume
nusbaume merged commit 044477b into ESCOMP:development Sep 18, 2026
24 checks passed
jimmielin pushed a commit to jimmielin/CAM-SIMA that referenced this pull request Oct 1, 2026
Brings in conv_water_4rad/cloud_water_paths (ESCOMP#531), ncdata_check_exclude
(ESCOMP#517), the IC-read set-before-use skip (ESCOMP#547), misc code fixes (ESCOMP#507) and
the atmos_phys0_29_001 pin.

Conflict resolution:
- ncdata_check_exclude (namelist definition, string_core_utils, phys_comp,
  physics_data) and write_init_files set-before-use: take the landed
  upstream versions; drop the branch's duplicate exclusion declarations.
- registry.xml: keep the MAM wetdep/drydep/concld_old entries alongside
  the conv_water entries; drop the branch's duplicate icwmrsh.
- write_init_files samples regenerated with the merged generator.

Assisted-by: claude-opus:5.5

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-generated code enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants