Skip to content

CMIP7 Pressure coordinates have various long_names #3093

@bettina-gier

Description

@bettina-gier

Using the data in ESMValGroup/ESMValTool#4439 to run the recipe_ref_ozone.yml with fake CMIP7 and ESACCI-OZONE data @hb326 and me got an error when trying to calculate the bias plot:

Traceback (most recent call last):
  File "/work/bd0854/b309137/esmval/ESMValTool/esmvaltool/diag_scripts/monitor/multi_datasets.py", line 2401, in <module>
    main(config)
  File "/work/bd0854/b309137/esmval/ESMValTool/esmvaltool/diag_scripts/monitor/multi_datasets.py", line 2396, in main
    MultiDatasets(cfg).compute()
  File "/work/bd0854/b309137/esmval/ESMValTool/esmvaltool/diag_scripts/monitor/multi_datasets.py", line 2384, in compute
    plot_function(datasets)
  File "/work/bd0854/b309137/esmval/ESMValTool/esmvaltool/diag_scripts/monitor/multi_datasets.py", line 2239, in create_2d_plot
    fig = self._plot_2d_data_3_panel(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/bd0854/b309137/esmval/ESMValTool/esmvaltool/diag_scripts/monitor/multi_datasets.py", line 1844, in _plot_2d_data_3_panel
    dataset_bottom = self._get_bias_dataset(dataset_left, dataset_right)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/bd0854/b309137/esmval/ESMValTool/esmvaltool/diag_scripts/monitor/multi_datasets.py", line 1338, in _get_bias_dataset
    bias_cube = dataset_1["cube"] - dataset_2["cube"]
                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
  File "/work/bd0854/b309137/esmval/ESMValTool/.pixi/envs/esmvalcore-dev/lib/python3.12/site-packages/iris/cube.py", line 4507, in __sub__
    return iris.analysis.maths.subtract(self, other)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/bd0854/b309137/esmval/ESMValTool/.pixi/envs/esmvalcore-dev/lib/python3.12/site-packages/iris/common/lenient.py", line 127, in lenient_client_inner
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/work/bd0854/b309137/esmval/ESMValTool/.pixi/envs/esmvalcore-dev/lib/python3.12/site-packages/iris/analysis/maths.py", line 313, in subtract
    return _add_subtract_common(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/work/bd0854/b309137/esmval/ESMValTool/.pixi/envs/esmvalcore-dev/lib/python3.12/site-packages/iris/analysis/maths.py", line 359, in _add_subtract_common
    result = _binary_op_common(
             ^^^^^^^^^^^^^^^^^^
  File "/work/bd0854/b309137/esmval/ESMValTool/.pixi/envs/esmvalcore-dev/lib/python3.12/site-packages/iris/analysis/maths.py", line 857, in _binary_op_common
    resolver = Resolve(cube, other)
               ^^^^^^^^^^^^^^^^^^^^
  File "/work/bd0854/b309137/esmval/ESMValTool/.pixi/envs/esmvalcore-dev/lib/python3.12/site-packages/iris/common/resolve.py", line 334, in __init__
    self(lhs, rhs)
  File "/work/bd0854/b309137/esmval/ESMValTool/.pixi/envs/esmvalcore-dev/lib/python3.12/site-packages/iris/common/resolve.py", line 388, in __call__
    self._metadata_mapping()
  File "/work/bd0854/b309137/esmval/ESMValTool/.pixi/envs/esmvalcore-dev/lib/python3.12/site-packages/iris/common/resolve.py", line 1223, in _metadata_mapping
    self._free_mapping(
  File "/work/bd0854/b309137/esmval/ESMValTool/.pixi/envs/esmvalcore-dev/lib/python3.12/site-packages/iris/common/resolve.py", line 1097, in _free_mapping
    raise ValueError(emsg)
ValueError: Insufficient matching coordinate metadata to resolve cubes, cannot map dimension (0,) of the RHS cube 'mole_fraction_of_ozone_in_air' to the LHS cube 'mole_fraction_of_ozone_in_air'.

printing the pressure coordinate metadata shows

DimCoordMetadata(standard_name=air_pressure, long_name=Pressure Levels (19), var_name=plev, units=hPa, attributes={'positive': 'down'}, climatological=False, circular=False)
DimCoordMetadata(standard_name=air_pressure, long_name=pressure, var_name=plev, units=hPa, attributes={'positive': 'down'}, climatological=False, circular=False)

Looking at the CMIP7 tables, this will be occuring for many 3D variables with distinct long_name for each possible pressure level coordinate, which will make it harder to do calculations with OBS and the CMIP7 vars.

"plev19": {
"axis": "Z",
"bounds_values": "",
"climatology": "",
"formula": "",
"generic_level_name": "",
"long_name": "Pressure Levels (19)",
"must_have_bounds": "no",
"out_name": "plev",
"positive": "down",
"requested": [
"100000.0",
"92500.0",
"85000.0",
"70000.0",
"60000.0",
"50000.0",
"40000.0",
"30000.0",
"25000.0",
"20000.0",
"15000.0",
"10000.0",
"7000.0",
"5000.0",
"3000.0",
"2000.0",
"1000.0",
"500.0",
"100.0"
],
"requested_bounds": "",
"standard_name": "air_pressure",
"stored_direction": "decreasing",
"tolerance": "1",
"type": "double",
"units": "Pa",
"valid_max": "",
"valid_min": "",
"value": "",
"z_bounds_factors": "",
"z_factors": ""
},
"plev27": {
"axis": "Z",
"bounds_values": "",
"climatology": "",
"formula": "",
"generic_level_name": "",
"long_name": "Pressure Levels (27)",
"must_have_bounds": "no",
"out_name": "plev",
"positive": "down",
"requested": [
"100000.0",
"97500.0",
"95000.0",
"92500.0",
"90000.0",
"87500.0",
"85000.0",
"82500.0",
"80000.0",
"77500.0",
"75000.0",
"70000.0",
"65000.0",
"60000.0",
"55000.0",
"50000.0",
"45000.0",
"40000.0",
"35000.0",
"30000.0",
"25000.0",
"22500.0",
"20000.0",
"17500.0",
"15000.0",
"12500.0",
"10000.0"
],
"requested_bounds": "",
"standard_name": "air_pressure",
"stored_direction": "decreasing",
"tolerance": "1",
"type": "double",
"units": "Pa",
"valid_max": "",
"valid_min": "",
"value": "",
"z_bounds_factors": "",
"z_factors": ""
},
"plev3": {
"axis": "Z",
"bounds_values": "",
"climatology": "",
"formula": "",
"generic_level_name": "",
"long_name": "Pressure Levels (3)",
"must_have_bounds": "no",
"out_name": "plev",
"positive": "down",
"requested": [
"85000.0",
"50000.0",
"25000.0"
],
"requested_bounds": "",
"standard_name": "air_pressure",
"stored_direction": "decreasing",
"tolerance": "1",
"type": "double",
"units": "Pa",
"valid_max": "",
"valid_min": "",
"value": "",
"z_bounds_factors": "",
"z_factors": ""
},
"plev39": {
"axis": "Z",
"bounds_values": "",
"climatology": "",
"formula": "",
"generic_level_name": "",
"long_name": "Pressure Levels (39)",
"must_have_bounds": "no",
"out_name": "plev",
"positive": "down",
"requested": [
"100000.0",
"92500.0",
"85000.0",
"70000.0",
"60000.0",
"50000.0",
"40000.0",
"30000.0",
"25000.0",
"20000.0",
"17000.0",
"15000.0",
"13000.0",
"11500.0",
"10000.0",
"9000.0",
"8000.0",
"7000.0",
"5000.0",
"3000.0",
"2000.0",
"1500.0",
"1000.0",
"700.0",
"500.0",
"300.0",
"200.0",
"150.0",
"100.0",
"70.0",
"50.0",
"40.0",
"30.0",
"20.0",
"15.0",
"10.0",
"7.0",
"5.0",
"3.0"
],
"requested_bounds": "",
"standard_name": "air_pressure",
"stored_direction": "decreasing",
"tolerance": "1",
"type": "double",
"units": "Pa",
"valid_max": "",
"valid_min": "",
"value": "",
"z_bounds_factors": "",
"z_factors": ""
},
"plev4": {
"axis": "Z",
"bounds_values": "",
"climatology": "",
"formula": "",
"generic_level_name": "",
"long_name": "Pressure Levels (4)",
"must_have_bounds": "no",
"out_name": "plev",
"positive": "down",
"requested": [
"92500.0",
"85000.0",
"50000.0",
"25000.0"
],
"requested_bounds": "",
"standard_name": "air_pressure",
"stored_direction": "decreasing",
"tolerance": "1",
"type": "double",
"units": "Pa",
"valid_max": "",
"valid_min": "",
"value": "",
"z_bounds_factors": "",
"z_factors": ""
},
"plev5u": {
"axis": "Z",
"bounds_values": "",
"climatology": "",
"formula": "",
"generic_level_name": "",
"long_name": "Pressure Levels (5 UTLS)",
"must_have_bounds": "no",
"out_name": "plev",
"positive": "down",
"requested": [
"25000.0",
"22500.0",
"20000.0",
"17500.0",
"15000.0"
],
"requested_bounds": "",
"standard_name": "air_pressure",
"stored_direction": "decreasing",
"tolerance": "1",
"type": "double",
"units": "Pa",
"valid_max": "",
"valid_min": "",
"value": "",
"z_bounds_factors": "",
"z_factors": ""
},
"plev6": {
"axis": "Z",
"bounds_values": "",
"climatology": "",
"formula": "",
"generic_level_name": "",
"long_name": "Pressure Levels (6 boundary layer)",
"must_have_bounds": "no",
"out_name": "plev",
"positive": "down",
"requested": [
"95000.0",
"90000.0",
"85000.0",
"80000.0",
"75000.0",
"70000.0"
],
"requested_bounds": "",
"standard_name": "air_pressure",
"stored_direction": "decreasing",
"tolerance": "1",
"type": "double",
"units": "Pa",
"valid_max": "",
"valid_min": "",
"value": "",
"z_bounds_factors": "",
"z_factors": ""
},
"plev7c": {
"axis": "Z",
"bounds_values": "",
"climatology": "",
"formula": "",
"generic_level_name": "",
"long_name": "Pressure Levels (7 for ISCCP)",
"must_have_bounds": "yes",
"out_name": "plev",
"positive": "down",
"requested": [
"90000.0",
"74000.0",
"62000.0",
"50000.0",
"37500.0",
"24500.0",
"9000.0"
],
"requested_bounds": [
"100000.0",
"80000.0",
"80000.0",
"68000.0",
"68000.0",
"56000.0",
"56000.0",
"44000.0",
"44000.0",
"31000.0",
"31000.0",
"18000.0",
"18000.0",
"0.0"
],
"standard_name": "air_pressure",
"stored_direction": "decreasing",
"tolerance": "1",
"type": "double",
"units": "Pa",
"valid_max": "",
"valid_min": "",
"value": "",
"z_bounds_factors": "",
"z_factors": ""
},
"plev7h": {
"axis": "Z",
"bounds_values": "",
"climatology": "",
"formula": "",
"generic_level_name": "",
"long_name": "Pressure Levels (7 Tropospheric)",
"must_have_bounds": "no",
"out_name": "plev",
"positive": "down",
"requested": [
"92500.0",
"85000.0",
"70000.0",
"60000.0",
"50000.0",
"25000.0",
"5000.0"
],
"requested_bounds": "",
"standard_name": "air_pressure",
"stored_direction": "decreasing",
"tolerance": "1",
"type": "double",
"units": "Pa",
"valid_max": "",
"valid_min": "",
"value": "",
"z_bounds_factors": "",
"z_factors": ""
},
"plev8": {
"axis": "Z",
"bounds_values": "",
"climatology": "",
"formula": "",
"generic_level_name": "",
"long_name": "Pressure Levels (8)",
"must_have_bounds": "no",
"out_name": "plev",
"positive": "down",
"requested": [
"100000.0",
"85000.0",
"70000.0",
"50000.0",
"25000.0",
"10000.0",
"5000.0",
"1000.0"
],
"requested_bounds": "",
"standard_name": "air_pressure",
"stored_direction": "decreasing",
"tolerance": "1",
"type": "double",
"units": "Pa",
"valid_max": "",
"valid_min": "",
"value": "",
"z_bounds_factors": "",
"z_factors": ""
},

How should we tackle this for ESMValTool? Remove the long_name/set it to plain "pressure" in the preprocessor? That specific recipe uses extract_levels, could just add it to any vertical level preprocessor? Have an auxilliary function to be used in diagnostic for equalising coordinate metadata?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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