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

Extended ICON CMORizer #1549

Merged
merged 37 commits into from
Jun 1, 2022
Merged

Extended ICON CMORizer #1549

merged 37 commits into from
Jun 1, 2022

Conversation

schlunma
Copy link
Contributor

@schlunma schlunma commented Mar 21, 2022

Description

I could get my hands on further ICON data which allowed me to extend the ICON CMORizer (the current version wasn't quite able to read this new data). In particular, the following features have been implemented:

  • Added variables areacello and siconc.
  • Added support for true height coordinates. If a true height coordinate (i.e., one with units of m) is already present in the file, the CMORizer does not try to convert that to a general height coordinate anymore. In addition, air_pressure coordinates are only added now if possible (i.e., if the corresponding variable is present in the input files).
  • Added support for CMOR variables that only use latitude and not longitude by adding checks a la if 'longitude' in self.vardef.dimensions: before fixing coordinates (and vice versa). In these cases no spatial index coordinate is added.
  • Added automatic addition of time dimension if required by the CMOR standard but not provided by the model output. An example is the variable zg which is time-invariant for ICON but a time dimension is required by CMOR.
  • Added automatic addition of grid information (in particular latitude and longitude coordinates) to files which do not include this. This is done by downloading the corresponding ICON grid file (using the attribute grid_file_uri given by each ICON file). If present and not older than 7 days, this downloaded grid file is reused.
  • Added automatic addition of positive attribute to variables (based on self.vardef.positive).
  • Fixed bounds of air_pressure coordinate (they were reversed along the trailing dimension).

Doc: https://esmvaltool--1549.org.readthedocs.build/projects/ESMValCore/en/1549/quickstart/find_data.html#icon

I tested the CMORizer on the old and new ICON data I have. It works well in both cases. I also added lots of new tests, but the old ones weren't changed.

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.


To help with the number pull requests:

@schlunma schlunma added this to the v2.6.0 milestone Mar 21, 2022
@schlunma schlunma self-assigned this Mar 21, 2022
@codecov
Copy link

codecov bot commented Mar 21, 2022

Codecov Report

Merging #1549 (780c985) into main (fb048eb) will increase coverage by 0.12%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1549      +/-   ##
==========================================
+ Coverage   91.23%   91.36%   +0.12%     
==========================================
  Files         203      204       +1     
  Lines       10978    11141     +163     
==========================================
+ Hits        10016    10179     +163     
  Misses        962      962              
Impacted Files Coverage Δ
esmvalcore/cmor/_fixes/icon/_base_fixes.py 100.00% <100.00%> (ø)
esmvalcore/cmor/_fixes/icon/icon.py 100.00% <100.00%> (ø)
esmvalcore/iris_helpers.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb048eb...780c985. Read the comment docs.

@schlunma schlunma changed the title Updated ICON CMORizer Extended ICON CMORizer Mar 22, 2022
@schlunma schlunma marked this pull request as ready for review March 22, 2022 16:21
@schlunma
Copy link
Contributor Author

Is there anything I can do about that Codacy issue (Library stubs not installed for "requests" (or incompatible with Python 3.9) (error))?

@valeriupredoi
Copy link
Contributor

OK the Codacy issue has been reported before, most recently by @bouweandela and we don't really have a solid fix for it in mind, I reckon we can brush it under the proverbial carpet 👍

Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

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

looking good and a lot of work too, just a couple minor comments from me, of course I couldn't test anything, this was just a walk through the code 🍺

esmvalcore/cmor/_fixes/icon/_base_fixes.py Show resolved Hide resolved
esmvalcore/iris_helpers.py Show resolved Hide resolved
@schlunma schlunma merged commit fd5488e into main Jun 1, 2022
@schlunma schlunma deleted the update_icon_cmorizer branch June 1, 2022 15:39
@sloosvel sloosvel added the cmor Related to the CMOR standard label Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmor Related to the CMOR standard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants