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

Add ClimWIP recipe to reproduce Brunner et al. 2019 #2109

Merged
merged 28 commits into from Jun 22, 2021
Merged

Conversation

lukasbrunner
Copy link
Contributor

@lukasbrunner lukasbrunner commented Mar 29, 2021

Description

This PR adds an additional recipe to the ClimWIP diagnostic with reproduces (part of) the results from an earlier study (Brunner et al. 2019) as proposed in #2105. There are still some open design questions that need resolving, I will discuss those below.


Before you get started

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


@lukasbrunner lukasbrunner requested review from ruthlorenz and removed request for ruthlorenz March 29, 2021 14:36
@lukasbrunner lukasbrunner self-assigned this Mar 29, 2021
@lukasbrunner lukasbrunner added diagnostic EUCP www.eucp-project.eu labels Mar 29, 2021
@Peter9192
Copy link
Contributor

I reckon you're still working on this? If not, you can mark it ready for review.

@lukasbrunner
Copy link
Contributor Author

lukasbrunner commented Mar 29, 2021

Additional discussion:

Different regions: The original study looks at 8 European sub-regions, I've reduced them to 4 as the other 4 were very experimental and should not be used without careful evaluation.

  • Decide how to represent these regions
    • 4 different recipes
    • all in one recipe (requires the pre-processor to run 4 times - slow)
    • all in one recipe but all but one option commented out (current version)
    • only one recipe and documentation how to adapt it

Documentation: The current documentation focuses on explaining the core functionality of ClimWIP and how to write a basic recipe. This needs to be updated to also include this recipe.

  • Decide how to structure the documentation
    • If possible: add another level of headings
-ClimWIP
  |-Basic functionality and testing
    |-Overview
    |-... (current level 2 headings)
  |-Brunner et al. (2019)
  |-additional recipes to come... 
  • Append the documentation to the existing one
  • Restructure the entire documentation and integrate documentation directly

@lukasbrunner
Copy link
Contributor Author

I reckon you're still working on this? If not, you can mark it ready for review.

Yes and no. There are open questions where I'd be happy for feedback. Can you comment on the code already or do I need to hit the ready for review button?

@Peter9192
Copy link
Contributor

* Decide how to represent these regions

I guess it depends on the diagnostic. If the results for the different regions need to be combined in one plot, then you would need a single recipe. If you don't, I would go for 4 different recipes. Although in that case, I would actually just add one recipe, and document how it can be changed in order to analyze a different region. Does that make sense?

@lukasbrunner
Copy link
Contributor Author

* Decide how to represent these regions

I guess it depends on the diagnostic. If the results for the different regions need to be combined in one plot, then you would need a single recipe. If you don't, I would go for 4 different recipes. Although in that case, I would actually just add one recipe, and document how it can be changed in order to analyze a different region. Does that make sense?

Yes totally. I would say the idea here is to provide a template how to recreate the weights from the paper and there is no need to create a combined plot. This is basically what I have now I guess. Are you okay with commented lines (representing the other cases) in the recipe? As of now I would leave them in and describe what lines have to be changed to get each of the options from the paper.

@lukasbrunner
Copy link
Contributor Author

Okay how does this look as template @Peter9192 ? Still needs some cleaning and the corresponding documentation. Will do that once we've settled on a format. I chose the MED SREX region as example to show here as the results are clearest for this region and we show a timeseries plot in the paper that is similar to the one automatically created. (I might update this one a bit to be more similar to the one in the paper)

@Peter9192
Copy link
Contributor

Looks good to me. I left a few small comments.

Copy link
Contributor

@ruthlorenz ruthlorenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot find the shapefile and therefore cannot test this. I think they need to be provided somewhere.

@ruthlorenz
Copy link
Contributor

Works fine with the shapefiles for MED, except the map looks not good, but I guess it needs #2107
Can we provide the shapefiles (at least for MED as this is the example we use here) somehow in ESMValTool? e.g. as in recipes/examples/recipe_extract_shape.yml?

@Peter9192
Copy link
Contributor

Can we provide the shapefiles (at least for MED as this is the example we use here) somehow in ESMValTool?

Maybe @nielsdrost has some idea about that? Otherwise the best I can come up with is to upload them somewhere (maybe as a gist?) and then link to them in the documentation for this recipe.

@lukasbrunner
Copy link
Contributor Author

About the shape files: I more and more get the feeling that it should be possible to include them in the diagnostic.

I've updated to use region ids

    extract_shape:
    shapefile: shapefiles/srex.shp
    decomposed: True
    method: contains
    crop: true
    ids:
      - 'South Europe/Mediterranean [MED:13]'

so we would only need one file for all SREX regions and the files are quite small

ls -hl srex.*
-rw-r--r-- 1 lukbrunn wheel 4.1K Jun 25  2015 srex.dbf
-rw-r--r-- 1 lukbrunn wheel  132 Jun 25  2015 srex.prj
-rw-r--r-- 1 lukbrunn wheel 4.6K Jun 25  2015 srex.shp
-rw-r--r-- 1 lukbrunn wheel  364 Jun 25  2015 srex.shx

These I've downloaded these from http://www.ipcc-data.org/guidelines/pages/ar5_regions.html
The only disadvantage in using this file directly is that it seems it requires the long name (South Europe/Mediterranean [MED:13]) instead of the more common abbreviations (MED) as ID.

@lukasbrunner lukasbrunner marked this pull request as ready for review May 11, 2021 09:52
@Peter9192 Peter9192 changed the title Add recipe to ClimWIP Add ClimWIP recipe to reproduce Brunner et al. 2019 May 12, 2021
Copy link
Contributor

@Peter9192 Peter9192 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good now, but we should make sure the tests pass before we can ask the core team to merge it.

@Peter9192 Peter9192 added the requires new ESMValCore release A new release of ESMValCore is needed to solve this issue/merge this pull request.. label May 12, 2021
@Peter9192
Copy link
Contributor

@ESMValGroup/esmvaltool-coreteam can you help us solve the CI issue?

The PR uses a new feature from ESMValGroup/ESMValCore#764, where the ids argument was added to extract_shape. However, the tests complain that this is not a valid argument. Are they using an old version of ESMValCore? Is this something we can solve in this PR?

@valeriupredoi
Copy link
Contributor

the CI tests are running against an old esmvalcore, if you install the latest esmvalcore from the master development branch, tests pass fine. This is happening because in the CI environment esmvalcore is installed from conda as the released package and I don't think the ID's PR went in before the release?

@valeriupredoi
Copy link
Contributor

yeah no, the ID's stuff went in 12 March, we released 2.2.0 February 9th πŸ‘

@Peter9192
Copy link
Contributor

@valeriupredoi thanks, so this is intended, and the solution is just to wait for the next release of the core?

I might have misunderstood that the container that runs the tests is the development version of the core...

@lukasbrunner
Copy link
Contributor Author

Just to follow up on this (and so that I know what to do with this on my todo list): we have to wait for the next core release? @valeriupredoi

@bouweandela
Copy link
Member

Yes, I thought I had now written this down in the developer documentation, but I cannot find it at the moment. The ESMValTool repo uses the latest released version of ESMValCore in order to provide a stable development environment to diagnostics developers. That way we have the freedom to make changes to the ESMValCore quickly, without worrying too much about breaking everything for everyone, as we'll probably catch the problem before making the next ESMValCore release.

@bouweandela
Copy link
Member

You might want to add this pull request to the v2.3 milestone, to make sure it is visible.

@lukasbrunner lukasbrunner added this to the v2.3.0 milestone May 26, 2021
@lukasbrunner
Copy link
Contributor Author

ping @Peter9192 @valeriupredoi
I guess this should have worked now? It still fails with the same error though...

@lukasbrunner
Copy link
Contributor Author

Here is the logfile from my run with 2.3.0
main_log.txt

@bouweandela
Copy link
Member

You need to pull in ESMValCore 2.3 as a dependency, that will only work #2200 has been merged into main and you merge main into this branch.

@lukasbrunner lukasbrunner removed the requires new ESMValCore release A new release of ESMValCore is needed to solve this issue/merge this pull request.. label Jun 21, 2021
@Peter9192
Copy link
Contributor

@ESMValGroup/esmvaltool-coreteam this PR is ready for merge πŸ‘

@hb326 hb326 merged commit a87d2bc into main Jun 22, 2021
@hb326 hb326 deleted the add_recipe_climwip branch June 22, 2021 07:00
@hb326
Copy link
Contributor

hb326 commented Jun 22, 2021

@ESMValGroup/esmvaltool-coreteam this PR is ready for merge πŸ‘

Done!

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.

Add recipe to ClimWIP reproducing Brunner et al. (2019)
7 participants