#!/bin/bash

#CONFIG FILE FOR PI/global mean scripts
#Paolo Davini (ISAC-CNR) - <p.davini@isac.cnr.it>
#December 2014

#Adapted for IC3 by François Massonnet (UCL/IC3) <francois.massonnet@ic3.cat>
#January 2015

#Adapted for BSC by François Massonnet (UCL/BSC) <francois.massonnet@uclouvain.be>
#November 2017

set -o nounset
set -o errexit


# START TO EDIT HERE

# Where the program is placed
MAINDIR=/home/Earth/$USER/reproducibility/

# Start date of the run (YYYYMMDD)
STARTDATE=19900101 

# Directory where the outputs are located. In this directory one should find the 
# MMO, MMA, tar files and the ICMGG, ICMSH grib files of each year 
DATADIR=/esarchive/exp/ecearth/${exp}/original_files/$STARTDATE/ 

# (Scratch) directory where the processed output can be saved before the climate dianogstics are run
SAVEDIR=/esarchive/scratch/$USER/REPRODUCIBILITY/${exp}/${STARTDATE}/

# Scratch dir where to run the analyses
SCRADIR=/esarchive/scratch/$USER/TMP

# Time frequency of atmosphere output. 
# If you use autosubmit, can be retrieved from expdef_${exp}.conf, variable NFRP
NFRP=`grep NFRP /esnas/autosubmit/${exp}/conf/proj_${exp}.conf | awk {'print $3'}` 

# Functions used during the scripts
# Required programs, including compression options
cdo="/shared/earth/software/CDO/1.8.2-foss-2015a/bin/cdo"
cdozip="$cdo -f nc4c -z zip"
cdonc="$cdo -f nc"

#preferred type of CDO interpolation (curvilinear grids are obliged to use bilinear)
remap="remapcon2"

#T255 masks (or theoretically different resolution) are used by ./global_mean.sh 
#and by ./post2x2.sh scripts. They are computed from the original initial conditions of IFS (using var 172)
#maskfile=/home/hpc/pr45de/di56bov/work/ecearth3/setup/ifs/T255L91/19900101/ICMGGECE3INIT
maskfile=/esnas/releases/models_extracted/ecearth/v3.2beta/inidata/ifs/T255L91/19900101/ICMGGECE3INIT

# Where Reichler and Kim indices will be saved
OUTDIR=${MAINDIR}/EC-Earth_diags/${exp}/
# Where model climatologies will be saved
CLIMDIR=${MAINDIR}/EC-Earth_diags/${exp}/
