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

xco2 derivation #913

Merged
merged 4 commits into from
Jan 14, 2021
Merged

xco2 derivation #913

merged 4 commits into from
Jan 14, 2021

Conversation

bettina-gier
Copy link
Contributor

@bettina-gier bettina-gier commented Dec 18, 2020

Before you start, please read our contribution guidelines.

Tasks

  • Create an issue to discuss what you are going to do, if you haven't done so already (and add the link at the bottom)
  • This pull request has a descriptive title that can be used in a changelog
  • Add unit tests
  • Circle/CI tests pass. Status can be seen below your pull request. If the tests are failing, click the link to find out why.
  • Codacy code quality checks pass. Status can be seen below your pull request. If there is an error, click the link to find out why. If you suspect Codacy may be wrong, please ask by commenting.

If you need help with any of the tasks above, please do not hesitate to ask by commenting in the issue or pull request.


Closes #912

Now that XCH4 is merged, let's add XCO2!

Sample recipe with some data available on mistral:

xco2_test:
    description: XCO2 test
    variables:
      xco2:
        project: CMIP6
        mip: Amon
        exp: esm-hist
        start_year: 2003
        end_year: 2005
        derive: true
    additional_datasets:
      - {dataset: CDS-XCO2, project: OBS, type: sat, version: L3,
         tier: 3, derive: false}
      - {dataset: CNRM-ESM2-1, ensemble: r1i1p1f3, grid: gr}
      - {dataset: GFDL-ESM4, ensemble: r1i1p1f1, grid: gr1}
      - {dataset: MPI-ESM1-2-LR, ensemble: r1i1p1f1, grid: gn}
    scripts: null

Using some additional fixes, and other models, as well as diagnostics from an open pull request for a comparison:
xco2_esm-hist_global_time_series_panels_2003-2014_obs

@bettina-gier bettina-gier requested a review from hb326 December 18, 2020 12:31
@bettina-gier bettina-gier self-assigned this Dec 18, 2020
@jvegreg jvegreg added enhancement New feature or request variable derivation Related to variable derivation functions labels Dec 22, 2020
@jvegreg jvegreg added this to the v2.2.0 milestone Dec 22, 2020
Copy link
Contributor

@jvegreg jvegreg left a comment

Choose a reason for hiding this comment

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

Code-wise, it looks great. Thanks!

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.

nice plots&code @bettina-gier - could you pls ping @hb326 or @axel-lauer or whoever else you reckon as appropriate for a sci review? 🍺

@bettina-gier
Copy link
Contributor Author

Both of them work, I just don't know if they're back from christmas vacation - but consider them pinged with your message ;)
I did add Birgit as a reviewer when I opened the pull request.

@hb326
Copy link
Contributor

hb326 commented Jan 13, 2021

@bettina-gier: I found some "ch4" reference remnants in the code, of which I am not sure if they should still be in there or if they are just leftovers from the xch4 derivation code that you used as a guideline for the xco2 code.
I also ran the test recipe to derive xco2 from the models. It seemed to work fine, although one of the models you had in the list does not have data on DKRZ anymore...

@bettina-gier
Copy link
Contributor Author

You're right they're leftovers, thanks for spotting these! Maybe I should have just used find and replace =D
and yes I have noticed the one model having missing data as well.. I will write that mail soon, we realized in a group meeting today that most of us had the same issue so I'll included samples of missing data from all of us working on different topics.

@hb326
Copy link
Contributor

hb326 commented Jan 13, 2021

Not sure why there is now a check failing...

@bettina-gier
Copy link
Contributor Author

Seems to be an era5 thing that is failing now:

=========================== short test summary info ============================
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[uas_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[zg_Amon]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[clt_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[evspsbl_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[evspsblpot_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[mrro_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[orog_fx]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[pr_Amon]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[pr_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[prsn_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[ptype_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[rlds_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[rls_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[rsds_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[rsdt_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[rss_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[tas_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[tas_Amon]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[tasmax_E1hr]
FAILED tests/integration/cmor/_fixes/native6/test_era5.py::test_cmorization[tasmin_E1hr]
= 20 failed, 1678 passed, 7 skipped, 2 xfailed, 82 warnings in 158.27s (0:02:38) =

@valeriupredoi
Copy link
Contributor

it's the hardcoded 2020 crap year in era5 that has been fixed upstream 👍

@hb326 hb326 merged commit ec9499e into master Jan 14, 2021
@hb326 hb326 deleted the derive_xco2 branch January 14, 2021 09:47
@jvegreg jvegreg added the preprocessor Related to the preprocessor label Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request preprocessor Related to the preprocessor variable derivation Related to variable derivation functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XCO2 derivation
4 participants