Fix nominal_resolution = "none" for realms with no dedicated model component - #633
Merged
rbeucher merged 2 commits intoAug 24, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #633 +/- ##
=======================================
+ Coverage 76.9% 77.0% +0.1%
=======================================
Files 40 40
Lines 8509 8518 +9
Branches 1588 1593 +5
=======================================
+ Hits 6547 6562 +15
+ Misses 1629 1624 -5
+ Partials 333 332 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fix #632
Summary
_get_nominal_resolution()returned the source-CV value verbatim. Source CVs use"none"to record that a model has no dedicated component for a realm — it isnot a resolution, and it is not a permitted
nominal_resolutionvalue in any CMIPera. ACCESS has no land-ice model, so every
landIce-realm variable wrotenominal_resolution = "none"and failed[ATTR004].This PR treats
"none"as "no such component" and falls through to the realm thatactually produced the field.
Problem
mrfso/snc/snwdeclaremodeling_realm = "landIce land". The lookup tookrealms[0](landIce), found"none", and wrote it unchanged:The value itself is factually correct — ACCESS-ESM1-6 has no ice-sheet component,
and PCMDI's own CMIP7 reference source entry writes
"none"the same way. The bugis that a source-registration field was used as the file-level
nominal_resolutionattribute, which must be one of the 15 CV terms.These fields are produced by CABLE on the atmosphere grid, so the correct value is
the land resolution,
"250 km"— which is exactly what the published CMIP6ACCESS-ESM1-5
LImonfiles carry.Not CMIP7-only
The same defect exists in
CMIP6Vocabulary, verified on an existing output file:wcrp_cmip6:1.0reports the identical[ATTR004]failure. It went unnoticed onlybecause
compliance_checkpost-dates those runs. CMIP6 exposure is narrower —mrfsosits inLmonas"land landIce", sorealms[0]islandand it passesby luck. CMIP7 organises tables by realm, so all three variables break.
Fix
A shared module-level helper replaces the duplicated lookup tail in both classes:
Only the literal
"none"triggers fall-through. A component that exists but omitsnative_nominal_resolutionstill returnsNone, preserving current behaviour.Realm selection, the multi-realm warning and
target_realmvalidation areuntouched.
CMIP6VocabularyandCMIP7Vocabularywere line-for-line duplicateshere, which is why the bug existed in both; the helper removes that duplication.
Why raising is correct
The fall-through boundary lands exactly where it should:
modeling_realmlandIce landland= 250 kmlandIceatmosChem aerosolaerosol= 250 kmatmosChemThe
landIce-only set is ice-sheet-specific (acabf,licalvf,topg,sftgrf,xvelbase, …) — fields ACCESS cannot produce at all. A clear error isthe right answer there, not a borrowed 250 km.
Why the CV data is left alone
"none"is a true statement about the model;"250 km"under alandIcekeywould assert an ice-sheet component that does not exist. Editing data also cannot
fix CMIP6: ACCESS-ESM1-5 and ACCESS-CM2 read from the upstream
CMIP6_CVsgitsubmodule. The code-level fix covers all three vocabulary classes.
Scope
CMIP6Vocabulary,CMIP6PlusVocabulary(list-valued realms) andCMIP7Vocabulary. No CV data, no submodules, no defaults changed.