Skip to content

Give lev_bnds its own formula_terms from z_bounds_factors (CF §4.3.3) - #641

Merged
rbeucher merged 1 commit into
mainfrom
fix_remaining_compliance_reported_issue
Aug 24, 2026
Merged

Give lev_bnds its own formula_terms from z_bounds_factors (CF §4.3.3)#641
rbeucher merged 1 commit into
mainfrom
fix_remaining_compliance_reported_issue

Conversation

@rhaegar325

Copy link
Copy Markdown
Collaborator

A parametric vertical coordinate's bounds variable needs its own formula_terms, referencing the bounds of each term. For hybrid-height variables (cl, cli, clw) lev_bnds carried none, failing the CF-1.11 check:

§4.3.2: lev_bnds's formula_terms is a required attribute
        and must be a non-empty string

lev itself gets formula_terms by inheritance from the UM source coordinate (theta_level_height), retargeted to the post-rename names. Its bounds variable has no attributes in the source, and the CF §7.1 loop in update_attributes() replaces bounds attrs wholesale from an INHERIT_KEYS subset that never included formula_terms.

The correct value was already in the coordinate table as z_bounds_factors ("a: lev_bnds b: b_bnds orog: orog"), until now read only to decide which bounds variables to create. Apply it after the §7.1 loop, which would otherwise wipe it. Adding formula_terms to INHERIT_KEYS would instead copy the parent's "a: lev b: b orog: orog", which points at the coordinates rather than their bounds and is equally non-compliant.

Skipped when z_bounds_factors is empty (hybrid_height_half) or when any referenced variable is absent, so no dangling reference is written.

Verified end to end on cl: §4.3 Vertical Coordinate goes from [5, 6] with the message above to [10, 10] clean.

A parametric vertical coordinate's bounds variable needs its own
formula_terms, referencing the bounds of each term. For hybrid-height
variables (cl, cli, clw) lev_bnds carried none, failing the CF-1.11 check:

    §4.3.2: lev_bnds's formula_terms is a required attribute
            and must be a non-empty string

lev itself gets formula_terms by inheritance from the UM source coordinate
(theta_level_height), retargeted to the post-rename names. Its bounds
variable has no attributes in the source, and the CF §7.1 loop in
update_attributes() replaces bounds attrs wholesale from an INHERIT_KEYS
subset that never included formula_terms.

The correct value was already in the coordinate table as z_bounds_factors
("a: lev_bnds b: b_bnds orog: orog"), until now read only to decide which
bounds variables to create. Apply it after the §7.1 loop, which would
otherwise wipe it. Adding formula_terms to INHERIT_KEYS would instead copy
the parent's "a: lev b: b orog: orog", which points at the coordinates
rather than their bounds and is equally non-compliant.

Skipped when z_bounds_factors is empty (hybrid_height_half) or when any
referenced variable is absent, so no dangling reference is written.

Verified end to end on cl: §4.3 Vertical Coordinate goes from [5, 6] with
the message above to [10, 10] clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.2%. Comparing base (3ccc6ca) to head (094a53d).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #641   +/-   ##
=====================================
  Coverage   77.2%   77.2%           
=====================================
  Files         40      40           
  Lines       8514    8522    +8     
  Branches    1590    1593    +3     
=====================================
+ Hits        6575    6583    +8     
  Misses      1610    1610           
  Partials     329     329           
Flag Coverage Δ
unit 77.2% <100.0%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rbeucher
rbeucher merged commit 9d78ebd into main Aug 24, 2026
4 checks passed
@rbeucher

Copy link
Copy Markdown
Member

Fixes #642

@rbeucher
rbeucher deleted the fix_remaining_compliance_reported_issue branch August 24, 2026 10:21
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.

2 participants