Skip to content

Commit

Permalink
add notebook 'basic' and a joj for that; add job for selecting data
Browse files Browse the repository at this point in the history
  • Loading branch information
senesis committed Apr 5, 2021
1 parent a466064 commit 54446ca
Show file tree
Hide file tree
Showing 4 changed files with 416 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ Introduction
------------
CAMMAC : Climate Change Analysis using Multi-Model outputs and `CliMAF <https://climaf.readthedocs.io>`_

**This version is tagged AR6_FGD and was used for producing figures
for the First Governemental Draft of the 6th IPCC/WGI Assessment
Report. It is not the most recent one, and not the best documented
one, and is here for reference and reproducibility. Please look in the
home repository for a more advanced one.**

This document describes a software funded by Météo-France and
originally developped by Stéphane Sénési, for helping with analyses
and figures based on `CMIP6
Expand Down
55 changes: 55 additions & 0 deletions jobs/basic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

D=${CAMMAC:-/home/ssenesi/CAMMAC}

ssp=${1:-ssp245}
season=${2:-DJF}
scheme=${3:-KS} # Can also be AR6S
threshold=${4:-0.9}
variable=${5:-pr}


# Create a working directory specific to this figure. It will hold cached data and figures
figname=$(basename $0)
figname=${figname/.sh/}
figname=${figname}_${variable}_${ssp}_${season}_${scheme}_${threshold}
mkdir -p $figname
cd $figname

# Create input parameters file
cat <<EOF >fig.yaml
do_test : False
scheme : ${scheme}
version : ""
#
variable : ${variable}
threshold : ${threshold}
table : Amon
figure_mask : null
included_models : null
#excluded_models : [ IITM-ESM, CAMS-CSM1-0 ]
excluded_models : [ ]
#
season : $season
experiment : $ssp
proj_period : "2081-2100"
ref_experiment : historical
ref_period : "1995-2014"
#
common_grid : "r360x180"
EOF

# Launch a job in which papermill will execute the notebook, injecting above parameters
jobname=$figname
output=$figname
# Tell job_pm.sh to use co-located environment setting
export ENV_PM=$(cd $(dirname $0); pwd)/job_env.sh

# Tell job_pm.sh to use co-located parameters file
commons=$(cd $(dirname $0); pwd)/common_parameters.yaml
[ ! -f $commons ] && $commons = ""

hours=2 $D/jobs/job_pm.sh $D/notebooks/basic.ipynb fig.yaml $jobname $output $commons
60 changes: 60 additions & 0 deletions jobs/select_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

D=${CAMMAC:-/home/ssenesi/CAMMAC}

# Create a working directory specific to this script.
scriptname=$(basename $0)
scriptname=${scriptname/.sh/}

mkdir -p $scriptname
cd $scriptname

# Create input parameters file
cat <<"EOF" >param.yaml
do_test : False
data_versions_dir : /home/ssenesi/CAMMAC/select_data_versions
data_versions_tag : "20210201"
experiments : [ piControl , historical , ssp126 , ssp245 , ssp585 , ssp119, ssp370 ]
variables :
Amon : [ pr , tas , prw , evspsbl ]
Lmon : [ mrro , mrso , mrsos ]
Omon : [ sos ]
day : [ pr ]
#experiments : [ piControl , historical , ssp370 ]
#variables :
# Amon : [ pr ]
piControl_minimum_duration : 200
preferred_grids :
CESM2-WACCM : gn
CESM2-WACCM-FV : gn
CESM2-WACCM-FV2 : gn
CESM2-FV2 : gn
CESM2 : gn
CNRM-CM6-1 : gr1
CNRM-ESM2-1 : gr1
GFDL-ESM4 : gn
GFDL-CM4 : [ gn , gr1 ]
IPSL-CM6A-LR : gr1
MIROC-ES2L : gr1
MRI-ESM2-0 : gn
EOF

# Launch a job in which papermill will execute the notebook, injecting above parameters
jobname=$scriptname
output=$scriptname
# Tell job_pm.sh to use co-located environment setting
export ENV_PM=$(cd $(dirname $0); pwd)/job_env.sh

# Tell job_pm.sh to use co-located parameters file
commons=$(cd $(dirname $0); pwd)/common_parameters.yaml
[ ! -f $commons ] && $commons = ""

hours=23 $D/jobs/job_pm.sh $D/select_data_versions/data_selection.ipynb param.yaml $jobname $output $commons
Loading

0 comments on commit 54446ca

Please sign in to comment.