Skip to content

Skip VAR005 monotonicity check for auxiliary coordinates#34

Open
JanStreffing wants to merge 1 commit intoESGF:masterfrom
JanStreffing:fix/var005-skip-aux-coords
Open

Skip VAR005 monotonicity check for auxiliary coordinates#34
JanStreffing wants to merge 1 commit intoESGF:masterfrom
JanStreffing:fix/var005-skip-aux-coords

Conversation

@JanStreffing
Copy link
Copy Markdown

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/lon fires 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_Coordinates and plugins/cmip6/cmip6.py::check_Coordinates, gate the check_coordinate_monotonicity invocation behind cname 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) and lon(nod2) as auxiliary coords).

Before the patch: 2 mandatory VAR005 findings. After the patch: 0 VAR005 mentions 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.

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
@sol1105 sol1105 requested a review from Ayoubnac1 April 17, 2026 03:50
@JanStreffing
Copy link
Copy Markdown
Author

Any updates on this review?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VAR005 monotonicity check is applied to auxiliary lat/lon coords on unstructured grids

1 participant