Sylvain Schmitt - Dec 6, 2023
snakemake
workflow to downscale climate projections.
Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.
Description.
This workflow is built on:
- Python ≥3.5
- Mambaforge
- Snakemake ≥5.24.1
conda activate base
mamba create -c conda-forge -c bioconda -n snakemake snakemake
conda activate snakemake
snakemake --help
Once installed simply clone the workflow:
git clone git@github.com:sylvainschmitt/DownClim.git
cd DownClim
snakemake -np
To further update following the get_cordex
rule with pyesgf
.
Data are retrieve from the Institut Pierre-Simon Laplace node. You need first to create an account on this page (create account link at corner right).
Then you’ll need to register credentials locally to use the workflow. A
help
page
is available. In linux, you need myproxy-logon
installed and to run
this command line (with your user name):
myproxy-logon -sesgf-node.ipsl.upmc.fr -l {user_name} -b -T -t 72 -o ~/.esg/credentials.pem
To run the workflow on a cluster, you can simply copy your local credentials to the cluster. For instance:
cp ~/.esg/credentials.pem /my_cluster/
module load bioinfo/Snakemake/7.20.0 # for test on nod depending on your HPC
snakemake -np # dry run
snakemake --dag | dot -Tsvg > dag/dag.svg # dag
snakemake -j 1 --resources mem_mb=10000 # local run (test)
sbatch job_muse.sh # HPC run with slurm
- Script:
get_area.py
- Environment:
gadm.yml
Python script to get area limits with GADM if country or continent, or based simply on a user-defined bounding-box. Sampling points are further defined on the land for evaluation.
- Script:
get_chelsa.py
- Environment:
xarray.yml
Python script to download, crop, adjust CHELSA monthly variables.
- Script:
get_cordex.py
- Environment:
xarray.yml
Python script to download, crop, reproject, and adjust CORDEX monthly variables.
- Script:
downscale_bc.py
- Environment: to be defined
Python script to compute downscaled projection with bias correction (delta or change-factor method). Baseline and projections are summarised by means across an historical and a projected period (e.g. monthly means over 30 years). Anomalies between historical and projected periods are computed for the projections. Anomalies are interpolated and added to the historical period of the baseline.
- Script:
evaluate_bc.py
- Environment: to be defined
Python script to evaluate downscaled versus raw projection against a baseline on the defined evaluation period for bias correctino downscaling.
CORDEX: Coordinated Regional Climate Downscaling Experiment
The CORDEX vision is to advance and coordinate the science and application of regional climate downscaling through global partnerships.
CHELSA V2.1.1: Climatologies at high resolution for the earth’s land surface areas
CHELSA (Climatologies at high resolution for the earth’s land surface areas) is a very high resolution (30 arc sec, ~1km) global downscaled climate data set currently hosted by the Swiss Federal Institute for Forest, Snow and Landscape Research WSL. It is built to provide free access to high resolution climate data for research and application, and is constantly updated and refined.
Develop how-to dev with envs/dev.yml and mamba.