Skip to content

Conversation

schlunma
Copy link
Contributor

@julienboussard

Description

This PR adds support to read and process input4MIPs data with ESMValCore. If necessary, these data can also be automatically downloaded from ESGF. Since we already support various other ESGF projects, implementing this was rather straightforward.

Unfortunately, it seems that the input4MIPs CMOR tables are not complete and many (maybe most) variables and datasets are not listed in the tables. For example, the controlled vocabulary (CV) lists 28 different dataset (i.e., source_id elements), but the search on ESGF reveals much more (e.g., IAMC-MESSAGE-GLOBIOM-ssp245-1-1 shows in the search, but not in the CV). In addition, most of the variables do not appear in any of the tables (e.g., CO2_em_anthro shows in the search, but cannot be found in any of the tables).

It doesn't seem to be a CMIP7-specific problem because data with mip_era=CMIP6 is also not described in the CV.

Currently, there's no way to read these missing data with ESMValCore.

Code Examples

Recipe interface

# ESMValTool
---
documentation:
  description: Test
  authors:
    - schlund_manuel
  title: Test.

datasets:
  - {project: input4MIPs, mip_era: CMIP6, target_mip: CMIP, dataset: PCMDI-AMIP-1-1-8, grid: gn}

diagnostics:
  test:
    scripts:
      null
    variables:
      tos:
        mip: Omon

Python API:

from ncdata.iris_xarray import cubes_to_xarray
from esmvalcore.dataset import Dataset

dataset = Dataset(
    project="input4MIPs",
    dataset="PCMDI-AMIP-1-1-8",
    mip_era="CMIP6",
    target_mip="CMIP",
    grid="gn",
    short_name="tos",
    mip="Omon",
)

cube = dataset.load()  # this is an iris.cube.Cube
print(cube)

ds = cubes_to_xarray(cube)
print(ds)  # this is an xarray.Dataset

Closes #2770

Link to documentation: TBA


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:

Copy link

codecov bot commented Jul 14, 2025

Codecov Report

Attention: Patch coverage is 94.02985% with 4 lines in your changes missing coverage. Please review.

Project coverage is 95.29%. Comparing base (2cb0787) to head (508452f).

Files with missing lines Patch % Lines
esmvalcore/cmor/table.py 94.11% 3 Missing ⚠️
esmvalcore/dataset.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2774      +/-   ##
==========================================
- Coverage   95.29%   95.29%   -0.01%     
==========================================
  Files         260      260              
  Lines       15357    15396      +39     
==========================================
+ Hits        14635    14671      +36     
- Misses        722      725       +3     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrating Input4MIPs
1 participant