Skip to content

Conversation

@thomaskroi1996
Copy link

@thomaskroi1996 thomaskroi1996 commented Oct 27, 2025

Description

Hello everyone!

At the Wegener Center in Graz, Austria, we have been doing some research with Lamb Weathertypes for quite some while now, and recently started developing a diagnostic for ESMValTool to make things easier, and potentially be of use for others!

The features are:

  • Calculate the 27 Lamb Weathertypes over a region specified in the corresponding recipe
  • Plot means, anomalies as well as standard deviations for those weathertypes for psl, tas and prcp
  • Combining the weathertypes based on precipitation patterns over an area specified in the corresponding recipe as done here: https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2020JD032824 (Table 2)
  • Create the same plots for those combined weathertypes

The weathertypes are calculated for ERA5 and model data, and the precipitation data for correlation calculations are taken from ERA5 and E-OBS.

The branch we are working on is called weathertyping_wegc.

We are happy to discuss this project with the community, get some feedback and features you would like to see!

If this PR seems like a deja vu, it is probably because it is! Last year I worked on this project, and since then not much has happened, and the old PR got outdated! I decided to open a new PR and already have the first commits be much cleaner! Hope that is okay, the old one is closed now, here is the link for reference! #3691


Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.

New or updated recipe/diagnostic


@valeriupredoi
Copy link
Contributor

hi @thomaskroi1996 and very many thanks for contributing 🍻 Please ping me here when this is ready for review, I shall do a technical reviwe, then we'll look for a scientific reviewer. Cheers!

@bouweandela
Copy link
Member

If you run into any issues with CORDEX data, we (NLeSC and BSC) may have some time available to help you as part of WP2 of the ESO4clima project, where we're working on improving CORDEX support. You can see some of the current issues in ESO4clima WP2 and @sloosvel has already created an example recipe using CORDEX data in #4199 that may be useful for inspiration.

thomaskroi1996 and others added 16 commits December 17, 2025 11:27
@thomaskroi1996
Copy link
Author

@bettina-gier alright! do you think it's fine if i let it just run for a few CMIP6 models? that way the folder wont be too big!

As for the hardcoded observations, I think there is definitely a way to generalise that, but it would require some refactoring, and i am not sure i would be able to finish before my contract runs out!

@bettina-gier
Copy link
Contributor

Oh yes that's absolutely fine, and no need to upload the preprocessed data, just the output of the diagnostic and provenance! Thanks for all the great work!

and if you wouldn't be able to finish then we can keep it as is with the observations. Maybe mention in the Documentation that it ONLY runs for those observations? Usually the OBS we mention in the recipe explanations are suggestions and interchangeable.

@thomaskroi1996
Copy link
Author

okay yes sounds good! i can even write a little guide somewhere on what would have to be changed for it to be more generalised/have different OBS!

i will upload to my google drive and let you know then!

@thomaskroi1996
Copy link
Author

@bettina-gier
Copy link
Contributor

bettina-gier commented Dec 17, 2025

Well it seems the run you uploaded failed in the diagnostic:

esmvalcore._task.DiagnosticError: Diagnostic script weathertyping/weathertyping.py failed with return code 1. See the log in /data/reloclim/normal/PREVAL/ESMValTool_output/v2-13_new/recipe_weathertyping_CMIP6_20251217_111357/run/weathertyping/weathertyping/log.txt
  File "/home/thk/ESMValTool/esmvaltool/diag_scripts/weathertyping/calc_utils.py", line 836, in get_wt_array
    wt_array = lwt_cube.core_data[:]
               ~~~~~~~~~~~~~~~~~~^^^
TypeError: 'method' object is not subscriptable

So it never gets to writing the provenance files

@thomaskroi1996
Copy link
Author

oh i think what happened is that i fixed an issue, and then had it rerun with the cd command, instead of starting a new run, so maybe then it doesnt write out log files? i am rerunning it now anyway, thanks for the info!

@valeriupredoi
Copy link
Contributor

@thomaskroi1996 we sould add you as contributor/developer of ESMValTool - if that's okay with you, that is. When this PR gets merged, you will be the owner and maintainer, so any sort of further work on itwe'll ask you to do it 😄

If you are happy to be a contributor and be added to the developers' list please ask @axel-lauer kindly, he'll then send you a welcome email with all the info 🍺

@valeriupredoi
Copy link
Contributor

Well it seems the run you uploaded failed in the diagnostic:

esmvalcore._task.DiagnosticError: Diagnostic script weathertyping/weathertyping.py failed with return code 1. See the log in /data/reloclim/normal/PREVAL/ESMValTool_output/v2-13_new/recipe_weathertyping_CMIP6_20251217_111357/run/weathertyping/weathertyping/log.txt
  File "/home/thk/ESMValTool/esmvaltool/diag_scripts/weathertyping/calc_utils.py", line 836, in get_wt_array
    wt_array = lwt_cube.core_data[:]
               ~~~~~~~~~~~~~~~~~~^^^
TypeError: 'method' object is not subscriptable

So it never gets to writing the provenance files

ah I missed that at re-review - just replace with core_data() 👍

@thomaskroi1996
Copy link
Author

@valeriupredoi sure, sounds good, thank you!

@axel-lauer if you would be so kind to add me as a developer, i will be glad to help future users! thank you!

@bettina-gier https://drive.google.com/drive/folders/1xJynJ_1wKaOoA2KoUsMN4gT-T4R4ueCK?usp=drive_link sorry about that!

@bettina-gier
Copy link
Contributor

That already looks much better! The references in the recipe are all nicely picked up, no issues there! ^__^
The provenance for the mean plots is working, I think the caption should mention the weathertype as well, otherwise without the picture it just keeps repeating "psl mean for lwt" but not the weather type it's for.

The seasonal occurrence folder does not give the provenance though, need to double check that, and I don't see the correlation matrix you show in the documentation.

@thomaskroi1996
Copy link
Author

@bettina-gier alright thank you so much! :) i will look over it again tomorrow!

@thomaskroi1996
Copy link
Author

just a little update, i resolved the issues you mentioned! the reason for the correlation matrix not being there was that it is only plotted when the predefined_slwt is set to false, since only then will it be automatically calculated!

so the next link will be with a automatically calculated slwt mapping! however, i ran into a little issue with the code there that i want to fix! since my holiday starts soon i am not sure i will get it done until the end of the year!

@bettina-gier
Copy link
Contributor

Glad we tested it first then ;)

Take your time, and poke me when you're done with the changes you want to make. Happy Holidays in the meantime!

@thomaskroi1996
Copy link
Author

thank you, you too! :) @bettina-gier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lamb weathertypes for CMIP5, CMIP6, SMILES and EURO-CORDEX

5 participants