Skip VAR005 monotonicity check for auxiliary coordinates#34
Open
JanStreffing wants to merge 1 commit intoESGF:masterfrom
Open
Skip VAR005 monotonicity check for auxiliary coordinates#34JanStreffing wants to merge 1 commit intoESGF:masterfrom
JanStreffing wants to merge 1 commit intoESGF:masterfrom
Conversation
CF only requires strict monotonicity on dimension coordinates. Auxiliary coordinates attached to a generic cell dimension on unstructured grids (e.g. FESOM2, ICON, MPAS native output) are allowed to be non-monotonic. Previously the per-coord TOML rule fired on any variable matching the rule's name, producing false mandatory failures that block ESGF publication of native unstructured output even when the file is otherwise CF/CMIP7 compliant. Skip the monotonicity invocation when the coord name is not also a dimension name in the dataset. Applied to both CMIP6 and CMIP7 plugins. Verified locally on Levante against an unstructured FESOM2 sample (126 858 nodes, lat/lon as auxiliary coords on nod2 dimension): VAR005 findings drop from 2 -> 0 and no other check changes. Refs ESGF#33
Author
|
Any updates on this review? |
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.
Closes #33.
Problem
CF only requires strict monotonicity for dimension coordinates. Auxiliary coordinates attached to a generic cell dimension on unstructured grids (e.g. FESOM2, ICON, MPAS native output) are explicitly allowed to be non-monotonic (CF 1.11 §5).
Today the per-coordinate TOML rule for
lat/lonfires on any variable matching the rule's name, producing mandatory[VAR005] Coordinate monotonicity for 'lat'/'lon'failures that block ESGF publication of native unstructured output even when the file is otherwise CF / CMIP7 compliant.Fix
In both
plugins/cmip7/cmip7.py::check_Coordinatesandplugins/cmip6/cmip6.py::check_Coordinates, gate thecheck_coordinate_monotonicityinvocation behindcname in ds.dimensions, so the check only runs for dimension coordinates. Auxiliary coordinates with the same name (e.g.lat(nod2)) are silently skipped.Verification
Tested locally on DKRZ Levante against the sample NetCDF described in #33 (
/work/ab0246/a270092/share/cc-plugin-wcrp-issue-33/sample_unstructured.nc, 126 858 unstructured FESOM2 nodes,lat(nod2)andlon(nod2)as auxiliary coords).Before the patch: 2 mandatory
VAR005findings. After the patch: 0VAR005mentions in the report. No other checks changed.The CMIP6 path is left in sync but no equivalent CMIP6 sample was tested; the change is mechanically the same as the CMIP7 path.