Skip to content

Conversation

@bouweandela
Copy link
Member

@bouweandela bouweandela commented Jan 5, 2026

Description

Makes a start with #2874. Support for downloading from ESGF has not been implemented yet as no CMIP7 data has been published to ESGF yet. The first CMIP7 data is expected sometime in the next few months.

Works with examples/recipe_python.yml and tas data created with Simple_recmorise_cmip6-cmip7.ipynb after some updates to that notebook: Simple_recmorise_cmip6-cmip7.ipynb

Example datasets recipe entry:

datasets:
  - dataset: PCMDI-test-1-0
    project: CMIP7
    exp: historical
    ensemble: r1i1p1f3
    grid: gn
    activity: CMIP
    institute: PCMDI
    mip: atmos
    frequency: mon
    region: glb
    branding_suffix: tavg-h2m-hxy-u

A copy of examples/recipe_python.yml with the fake CMIP7 dataset generated by the notebook is available under Details.

Details
# ESMValTool
# recipe_python.yml
#
# See https://docs.esmvaltool.org/en/latest/recipes/recipe_examples.html
# for a description of this recipe.
#
# See https://docs.esmvaltool.org/projects/esmvalcore/en/latest/recipe/overview.html
# for a description of the recipe format.
---
documentation:
  description: |
    Example recipe that plots a map and timeseries of temperature.

  title: Recipe that runs an example diagnostic written in Python.

  authors:
    - andela_bouwe
    - righi_mattia

  maintainer:
    - schlund_manuel

  references:
    - acknow_project

  projects:
    - esmval
    - c3s-magic

datasets:
  - dataset: PCMDI-test-1-0
    project: CMIP7
    exp: historical
    ensemble: r1i1p1f3
    grid: gn
    activity: CMIP
    institute: PCMDI
    mip: atmos
    frequency: mon
    region: "*"
    branding_suffix: tavg-h2m-hxy-u
  - dataset: BCC-ESM1
    project: CMIP6
    exp: historical
    ensemble: r1i1p1f1
    grid: gn
  - dataset: bcc-csm1-1
    version: v1
    project: CMIP5
    exp: historical
    ensemble: r1i1p1

preprocessors:
  # See https://docs.esmvaltool.org/projects/esmvalcore/en/latest/recipe/preprocessor.html
  # for a description of the preprocessor functions.

  to_degrees_c:
    convert_units:
      units: degrees_C

  annual_mean_amsterdam:
    extract_location:
      location: Amsterdam
      scheme: linear
    annual_statistics:
      operator: mean
    multi_model_statistics:
      statistics:
        - mean
      span: overlap
    convert_units:
      units: degrees_C

  annual_mean_global:
    area_statistics:
      operator: mean
    annual_statistics:
      operator: mean
    convert_units:
      units: degrees_C

diagnostics:
  map:
    description: Global map of temperature in January 2000.
    themes:
      - phys
    realms:
      - atmos
    variables:
      tas:
        mip: Amon
        preprocessor: to_degrees_c
        timerange: 2000/P1M
        caption: |
          Global map of {long_name} in January 2000 according to {dataset}.
    scripts:
      script1:
        script: examples/diagnostic.py
        quickplot:
          plot_type: pcolormesh
          cmap: Reds

  timeseries:
    description: Annual mean temperature in Amsterdam and global mean since 1850.
    themes:
      - phys
    realms:
      - atmos
    variables:
      tas_amsterdam:
        short_name: tas
        mip: Amon
        preprocessor: annual_mean_amsterdam
        timerange: 1850/2000
        caption: Annual mean {long_name} in Amsterdam according to {dataset}.
      tas_global:
        short_name: tas
        mip: Amon
        preprocessor: annual_mean_global
        timerange: 1850/2000
        caption: Annual global mean {long_name} according to {dataset}.
    scripts:
      script1:
        script: examples/diagnostic.py
        quickplot:
          plot_type: plot

activity and institute are automatically added from the CMIP6_CV.json file for CMIP6, but for CMIP7 this file does not appear to be available yet. I found ESGF/esgf-vocab#150 (comment) describing some initial work to generate it from the controlled vocabulary.

Link to documentation:

Backward incompatible change

It is no longer possible to pass derive as a positional argument to the get_variable method. Please use derive=True or derive=False instead of True or False respectively. Similarly, frequency and check_level are now keyword only arguments for the functions cmor_check_metadata, cmor_check_data, and cmor_check.


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.


To help with the number pull requests:

Allow use of branding_suffix in other projects than CMIP7 to select the right variable from the CMOR table
@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.59%. Comparing base (82b282f) to head (2c9f97f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2935      +/-   ##
==========================================
- Coverage   95.59%   95.59%   -0.01%     
==========================================
  Files         266      266              
  Lines       15573    15593      +20     
==========================================
+ Hits        14887    14906      +19     
- Misses        686      687       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

"rcm_version",
"driver",
"domain",
"activity",
Copy link
Member Author

Choose a reason for hiding this comment

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

The activity is uniquely determined by the exp facet, so this only adds noise and no new information. To keep it readable, I would propose to remove this.

@bouweandela bouweandela changed the title Add CMIP7 support Add preliminary CMIP7 support Jan 8, 2026
@bouweandela bouweandela added this to the v2.14.0 milestone Jan 9, 2026
@bouweandela bouweandela marked this pull request as ready for review January 9, 2026 20:36
@bouweandela bouweandela requested a review from schlunma January 9, 2026 20:37
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.

2 participants