Skip to content

multi_model_statistics assumes cubes have latitude and longitude #266

@ledm

Description

@ledm

The multi_model_statistics preprocessor still assumes that all cubes have latitude and longitude components.

This is not the case.

There are so many crucial metrics that do not have a spatial component. For instance, stuff like the Global Average Sea Level rise, the Atlantic Current.

We had previously fixed this, but there' been some kind of change recently where this bug was re-instated.

Here's a recipe:

# ESMValTool
# recipe_ocean_scarlar_fields.yml
---
documentation:
  description: |
    Debug recipe

  authors:
    - demora_lee

  maintainer:
    - demora_lee

  references:
    - demora2018gmd

  projects:
    - ukesm


preprocessors:
  # --------------------------------------------------
  # Time series preprocessors
  # --------------------------------------------------
  prep_timeseries_0D: # For 0D fields
    multi_model_statistics:
      span: full
      statistics: [mean ]

diagnostics:

  diag_timeseries_sealevel:
    variables:
      zostoga: # Global Average Thermosteric Sea Level Change
        preprocessor: prep_timeseries_0D
        additional_datasets:
          - {dataset: ACCESS1-0, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1850, end_year: 2005, }
          - {dataset: ACCESS1-3, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1850, end_year: 2005, }
 
    scripts:
      Regional_Ocean_Surface_mean_timeseries:
        script: ocean/diagnostic_timeseries.py

This recipe fails with:

  File "/users/modellers/ledm/workspace/ESMValTool/ESMValCore/esmvalcore/preprocessor/_multimodel.py", line 110, in _put_in_cube
    lats = template_cube.coord('latitude')

As there's no latitude in the cube.

I've made a basic bugfix PR to this file which I'l submit shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions