This repository contains the scripts, data, and instructions necessary to perform causal weighting of precipitation projections over land using CMIP6 models. The approach leverages causal inference and performance/independence-based metrics to assess and weight climate model projections:
Debeire, K., Bock, L., Nowack, P., Runge, J. & Eyring, V. (2025). Constraining uncertainty in projected precipitation over land with causal discovery (see article). Earth System Dynamics.
Author of the repository: Kevin Debeire, DLR, kevin.debeire(at)dlr.de
The current release on Zenodo can be found here:
This project is separated in three steps:
- To implement causal network analysis using SLP data of CMIP6 models, PCA-Varimax and the PCMCI algorithm.
- To compute performance and independence scores of CMIP6 models (stored in the
perf_ind_scores
folder). - To use these scores for producing weighted projections across different SSP scenarios.
To reproduce the figures for the precipitation over land, we recommend to directly use the pre-computed performance and indepedence metrics and run the provided ESMValTool recipes.
perf_ind_scores/
: Contains the performance and independence scores as normalized complements of F1-scores..py scripts
: For calculating PCA-Varimax components and estimating causal networks using PCMCI.- Jupyter Notebooks:
- For calculating F1-scores.
- For saving the values in
.nc
files for further use.
- ESMValTool recipe: Produces boxplots, maps, and time series of weighted projections for three different SSP scenarios.
-
Conda Environment
Use the providedenvironment_pca.yml
file to set up the Python environment for running the.py
scripts and Jupyter notebooks:mamba env create -n <your_env_name> -f environment_pca.yml conda activate <your_env_name>
-
ESMValTool Installation
Follow the ESMValTool Quickstart Installation Guide to install ESMValTool.
Ensure that you use thecausal_weighting
branch of ESMValTool:git clone -b causal_weighting https://github.com/ESMValGroup/ESMValTool.git cd ESMValTool mamba env update --file environment.yml pip install --editable '.[develop]'
If you want to produce plots for the weighted precipitation projections: you can use the pre-computed performance and independence metrics directly. To run the ESMValTool recipes included in this repository, follow these steps:
-
Ensure that your environment with ESMValTool is activated and configured with access to the necessary CMIP6 model data (more information here).
conda activate <your_env_name>
-
Navigate to the directory containing the recipe file (e.g.,
recipe_weighting_pcmci_ssp245_60comps_final.yml
) and run the following:esmvaltool run recipe_weighting_pcmci_ssp245_60comps_final.yml
If you want to produce PCA-Varimax weights, run generate_varimax_era5_1979-2014_allseason_timebin1.py
. You can then apply those weights to desired CMIP6 models generate_varimax_for_ALL_CMIP6_MODELS_from_era5_1979-2014_weights_timebin1.py
to create the dimension-reduced data. Then, run run_pcmci_for_CMIP6_MODELS_timebin1x2_taumax20.py
to estimate the causal networks (install tigramite for this). The Jupyter notebook can be run to produce some plots and calculate the metrics from the calculated causal networks.
GNU General Public License v3.0
See license.txt for full text.