Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions plugins/cmip6/cmip6.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,15 +712,19 @@ def _sev(x, default=BaseCheck.HIGH) -> int:

# monotonicity
if getattr(rule, "monotonicity", None):
sev = _sev(rule.monotonicity.severity, default=BaseCheck.MEDIUM)
res.extend(
check_coordinate_monotonicity(
ds,
coord_name=cname,
direction=rule.monotonicity.direction,
severity=sev,
# CF allows auxiliary coordinates (e.g. lat/lon attached to a
# generic cell dimension on unstructured grids) to be non-monotonic.
# Only apply the strict-monotonicity check to dimension coords.
if cname in ds.dimensions:
sev = _sev(rule.monotonicity.severity, default=BaseCheck.MEDIUM)
res.extend(
check_coordinate_monotonicity(
ds,
coord_name=cname,
direction=rule.monotonicity.direction,
severity=sev,
)
)
)

# TIME001
if getattr(rule, "squareness", None):
Expand Down
20 changes: 12 additions & 8 deletions plugins/cmip7/cmip7.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,15 +689,19 @@ def check_Coordinates(self, ds):

# monotonicity
if rule.monotonicity:
sev = self.get_severity(rule.monotonicity.severity)
res.extend(
check_coordinate_monotonicity(
ds,
coord_name=cname,
direction=rule.monotonicity.direction,
severity=sev,
# CF allows auxiliary coordinates (e.g. lat/lon attached to a
# generic cell dimension on unstructured grids) to be non-monotonic.
# Only apply the strict-monotonicity check to dimension coords.
if cname in ds.dimensions:
sev = self.get_severity(rule.monotonicity.severity)
res.extend(
check_coordinate_monotonicity(
ds,
coord_name=cname,
direction=rule.monotonicity.direction,
severity=sev,
)
)
)

# TIME001
if rule.squareness:
Expand Down