ecmwf / atlas

A library for numerical weather prediction and climate modelling
https://sites.ecmwf.int/docs/atlas
Apache License 2.0
115 stars 42 forks source link

Avoid silent errors accessing Fieldset fields by ambiguous names #210

Closed wdeconinck closed 4 months ago

wdeconinck commented 4 months ago

This should address #194

An exception is thrown when accessing a field by name in the fieldset, when the name is ambiguous. A unit-test is created that demonstrates the exception.

github-actions[bot] commented 4 months ago

Private downstream CI failed. Workflow name: private-downstream-ci-hpc View the logs at https://github.com/ecmwf-actions/private-downstream-ci/actions/runs/9482632345.

DJDavies2 commented 4 months ago

I seem to be getting a number of failures in downstream codes with this like so:

Exception: FieldSet: cannot get field with ambiguous name height_levels". 2 fields are registered with same name. Access field by index or iterator instead. (/home/h01/david.davies/cylc-run/atlas-210/share/mo-bundle/atlas/src/atlas/field/FieldSet.cc +120 field) FieldSet: cannot get field with ambiguous name height_levels". 2 fields are registered with same name. Access field by index or iterator instead. caught in (/home/h01/david.davies/cylc-run/atlas-210/share/mo-bundle/oops/src/oops/runs/Run.cc +197 execute) Exception: oops::ErrorCovarianceToolbox terminating... Exception stack: FieldSet: cannot get field with ambiguous name height_levels". 2 fields are registered with same name. Access field by index or iterator instead.

wdeconinck commented 4 months ago

Thanks @DJDavies2 , this are exactly the silent errors mentioned in #194 (notifying @fmahebert @svahl991)

wdeconinck commented 4 months ago

@svahl991 I updated the testing :)

github-actions[bot] commented 4 months ago

Private downstream CI succeeded. Workflow name: private-downstream-ci View the logs at https://github.com/ecmwf-actions/private-downstream-ci/actions/runs/9543986415.

fmahebert commented 4 months ago

@wdeconinck Thanks for this!