Skip to content

[BUG] Ocean variables missing time_bnds, failing CMIP6 compliance check (ATTR004/VAR004) #454

Description

@rhaegar325

Summary

After CMORisation, all ocean variables (Omon + Oyr) produce output files whose
time coordinate carries the attribute bounds = "time_bounds", yet no
time_bounds (or time_bnds) variable exists in the file. The compliance-checker
therefore reports a HIGH-severity error ATTR004/VAR004: the variable
referenced by time:bounds does not exist in the file.

Affected scope

13 files affected (all Omon + Oyr variables):

Table Variables
Omon intpp, mlotst, so, thetao, tos, uo, vo, zos
Oyr detoc, dissic, no3, o2, talk

Atmosphere (Amon) variables are unaffected — they follow a separate, already-working
code path.

Root cause

Three compounding issues:

  1. Naming mismatch: the raw MOM model files contain a time_bounds(time, nv)
    variable with time:bounds = "time_bounds". The code, however, expects the
    CMOR-convention name time_bnds (_get_required_bounds_variables builds the
    name as input_dim + "_bnds").

  2. Dropped during loading: _preprocess in load_dataset keeps only
    required_vars & ds.data_vars. required_vars contains time_bnds, while the
    file has time_bounds, so the raw time_bounds is silently dropped — yet the
    bounds = "time_bounds" attribute on the time coordinate is preserved and
    written to the output file.

  3. Bounds calculation disabled: in ocean.py the call
    calculate_missing_bounds_variables(required_bounds) was double-commented out,
    and the method was defined only on Atmosphere_CMORiserOcean_CMORiser did
    not have it at all.

Net result: the output file has a dangling time:bounds attribute with no
corresponding bounds variable.

Relevant code locations

  • src/access_moppy/ocean.py — the commented-out bounds calculation call
  • src/access_moppy/atmosphere.pycalculate_missing_bounds_variables (originally defined only here)
  • src/access_moppy/base.pyload_dataset / _preprocess
  • src/access_moppy/vocabulary_processors.py_get_required_bounds_variables

Expected behaviour

Ocean output files should contain a time_bnds(time, bnds) variable with
time:bounds = "time_bnds", and bnds should be a pure dimension with no index
values — consistent with atmosphere output and passing the compliance check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions