Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with new multi-model statistics and variables on hybrid levels #1222

Closed
axel-lauer opened this issue Jul 13, 2021 · 7 comments · Fixed by #1471
Closed

Problem with new multi-model statistics and variables on hybrid levels #1222

axel-lauer opened this issue Jul 13, 2021 · 7 comments · Fixed by #1471
Labels
bug Something isn't working iris Related to the Iris package
Milestone

Comments

@axel-lauer
Copy link
Contributor

Variables on hybrid vertical levels (e.g. clw) have to be converted to pressure or height levels to be able to be processed by some diagnostics and to be able to calculate meaningful multi-model statistics across different models. For this conversion, some models provide an auxiliary coordinate 'p0'. Calculating the multi-model mean over such datasets converted to pressure or height levels fails because 'p0' is kept after converting the vertical levels but (as expected) not identical in all models:

iris.exceptions.MergeError: failed to merge into a single cube.
  Coordinates in cube.aux_coords (scalar) differ: p0.

p0 contains no useful information any more after vertical coordinate transformation has been done. Yet, this results in a failure to calculate the multi-model mean over such 3-dim variables (e.g. 3-dim cloud variables).

This issue has been introduced with the new multi-model statistics (#1150) and can be reproduced with the following example recipe: recipe_testp0.yml.txt

@axel-lauer axel-lauer added bug Something isn't working iris Related to the Iris package labels Jul 13, 2021
@zklaus
Copy link

zklaus commented Jul 13, 2021

Thanks for reporting this issue, @axel-lauer. Is there a recipe in ESMValTool that is impacted by this?

@axel-lauer
Copy link
Contributor Author

As far as I know, this issue affects recipes under development only.

@zklaus
Copy link

zklaus commented Jul 13, 2021

Ok, in that case I will target 2.4.0 here.

@zklaus zklaus added this to the v2.4.0 milestone Jul 13, 2021
@valeriupredoi
Copy link
Contributor

do we have any recipes that have made it to main @axel-lauer - if not, we can bump this to 2.5.0 😁

@axel-lauer
Copy link
Contributor Author

I don't think we have anything in main yet, so postponing this until v2.5 is fine but we shouldn't forget about it.

@zklaus zklaus modified the milestones: v2.4.0, v2.5.0 Oct 6, 2021
@axel-lauer
Copy link
Contributor Author

Further investigation of this problem showed that in addition to auxiliary coordinate p0, also presence of ptop can cause the same problems and needs to be removed in order to be able to calculate multi-model statistics (again). A fix in _combine (esmvalcore/preprocessor/_multimodel.py) could look like this:

        for auxcoord in cube.aux_coords:
            if (auxcoord.var_name == 'p0' or auxcoord.var_name == 'ptop'):
                cube.remove_coord(auxcoord)

In addition to this, add_plev_from_altitude and add_altitude_from_plev in esmvalcore/cmor/_fixes/shared.py need to be modified in order to work properly by removing definition of var_name and of long_name, e.g. 38c1c01

@schlunma
Copy link
Contributor

schlunma commented Feb 4, 2022

Moving this to v2.6 since there is not open PR yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iris Related to the Iris package
Projects
None yet
4 participants