Taylor Diagram with observations and multi-case #435
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main objective of this PR is to provide Taylor Diagrams with observation/reanalysis reference data, and thus to address #426.
Since Taylor Diagrams are especially useful for comparing multiple simulations to a common reference, I also prioritized being able to run with multiple test cases.
Refactoring the original
cam_taylor_diagram.pymostly needed moving to use more ofadf_dataset. The other key part was allowing for the potential need to regrid obs-to-obs for derived variables that the Taylor diagram uses. I also refactored theregrid_and_vert_interp.pymodule. Both use xESMF for regridding, defaulting to conservative methods. The regridding weights are currently being stored in a subdirectory of the regrid location.For cases when we need to regrid from pressure levels to pressure levels, I added a plev_to_plev method in
adf_utils. Elsewhere in that module I made some modifications to try to keep metadata.I was running in to a hang when creating climo files, and I tracked it down to our use of multiprocessing. I think I've implemented a fix for that (which I think we've had to work around before). The main thing seems to be
mp.get_context('spawn')but there's also some dask stuff to try to prevent zombie processes being made. This seems to work, but isn't crucial for this PR.There are some updates to
adf_info.pythat help to deal with the multi-case configurations. This has to do with handling the specification of history files from the YAML file. This could break previously working configurations because it might make some assumptions about how those history files are specified.To read nested lists correctly (i.e., [['h0a', 'h1a'],['h0a', 'h1a']]), I also needed to modify
adf_config.py.I added the ERA5 land fraction to the observations repository and included it in the variable defaults file.
A few modifications are included in
adf_dataset, but mainly just trying to apply unit transformations more carefully. These might not be super necessary, but I don't think they will hurt anything.