-
Notifications
You must be signed in to change notification settings - Fork 145
Thermosteric sea-level rise patterns #4047
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
base: main
Are you sure you want to change the base?
Conversation
|
I know that I need a scientific and technical reviewer, I am on the hunt for both :) |
|
Hey @valeriupredoi! Was wondering if you could give me a hand with some CircleCI tests failing... it's not clear whether it has anything to do with my code or not. Cheers 😊 |
ehogan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for your contribution @mo-gregmunday! 🥳
| @@ -0,0 +1,96 @@ | |||
| # (C) Crown Copyright 2022-2025, Met Office. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code in this module looks very similar to what was included via #2785! Would it be possible to add a single copy of this code to esmvaltool/diag_scripts/shared and use the functions for both recipes, please? 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this require two additional PR's? One for adding the module to the shared folder and another for updating the other recipe? Or can I just do it in this PR?
| fig.savefig( | ||
| Path(plot_path) | ||
| / f'detrended_{zostoga.attributes["source_id"]}.png', dpi=150) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could esmvaltool.diag_scripts.shared.save_figure be used here? 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(there are other uses of this in this module!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with UKCP18 and AR5, it looks like a quadratic fit is needed for the drift correction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ehogan The save_figure function definitely could be used here but I think saving provenance for each of these figures is overkill, especially since none of them relate to any previously published work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mo-jenniferweeks I think we've discussed this and we agreed to linear drift correction was the correct technique here - let me know if I'm mistaken!
| np.save( | ||
| Path(work_path) | ||
| / f"zos_regression_{scenario}_{model}.npy", slopes) | ||
| np.save(Path(work_path) / f"zos_mask_{scenario}_{model}.npy", mask) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could esmvaltool.diag_scripts.shared.save_data be used here? 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(there are other uses of this in this module!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the function is designed to save iris cubes instead of NumPy arrays!
@mo-gregmunday, run the following command in the directory containing your branch and commit the changes: 😊 |
|
To download (almost all!) the required data for this recipe, I needed to use a specific ESGF node, which I did by creating a I did this both at DKRZ and at the MO 👍 |
|
Currently missing data: |
|
I have opened #4117 for the data issue 👍 |
|
I tried again today to download data and I was able to download the data from LLNL 🥳 The recipe runs at the Met Office (using ESMValTool v2.12.0): However, there are no plots visible via the I'm getting a failure on DKRZ: @mo-gregmunday any thoughts? 🤔 |
…nto steric_patterns
I've sorted this out :) |
I've tried this and pushed the resulting changes up but it's still failing the 'commit' and 'ci/circleci: run_tests'... |
|
Thank you so much for both of your very thorough reviews! I've addressed each of your comments as best I can. Please let me know if you'd like to see anything else from me :) |
|
@gregrmunday I have just ruff-ed the diag for you (hope you don't mind!). The unofficial way is to run the command |
Thanks @valeriupredoi !! This is useful to know, I'll keep this in mind for next time :) |
| # global and local sea level projections | ||
| regr = LinearRegression() | ||
| regr.fit( | ||
| zostoga.data.reshape(-1, 1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linear regression here assumes that global-mean of zos is zero, which is not the case for many models. To ensure that regressions coefficients are correct, it is required to subtract the global-mean value of zos diagnostic at every grid point in zos, just before the linear regression step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've addressed this in the latest commit - see line 171.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gregrmunday.
Description
This PR calculates and evaluates patterns of thermometric sea-level rise from global thermal expansion and local sea-level changes for a range of CMIP6 models and scenarios.
Systematic calculation and evaluation of these patterns will allow for quick and easy pattern creation for future CMIP generations, and allows the patterns to be used in various sea-level rise emulation models.
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