Commit 35cf9eb9 authored by Sebastian Milinski's avatar Sebastian Milinski
Browse files

Included option to process pictrl

parent 406ce045
......@@ -32,7 +32,7 @@ workdir=/scratch/m/$USER/MPI-ESM-GE
# set default values
experiment=hist # hist | onepct | rcp26 | rcp45 | rcp85
experiment=hist # hist | onepct | rcp26 | rcp45 | rcp85 | pictrl
#first run in sequence
run_0=1
#last run in sequence
......@@ -87,6 +87,17 @@ if [[ $experiment == onepct ]]; then
elif [[ $experiment == hist ]]; then
yearstart=1850
yearend=2005
elif [[ $experiment == pictrl ]] && [[ $run_0 == 1 ]]; then
yearstart=1850
yearend=3850
run_n=1
elif [[ $experiment == pictrl ]] && [[ $run_0 == 2 ]]; then
yearstart=1850
yearend=2870
run_n=2
elif [[ $experiment == pictrl ]] ; then
echo "for pictrl, choose -r0 1 OR -r0 2 (-run_n option will be ignored, control runs can only be processed separately.))"
exit
elif [[ $experiment == rcp26 ]] || [[ $experiment == rcp45 ]] || [[ $experiment == rcp85 ]]; then
yearstart=2006
yearend=2099
......@@ -185,19 +196,25 @@ for rrr in $(seq $run_0 $run_n); do
done
# merge ensemble into one file
ensfile=${outdir}/${varstring}_${experiment}_${yearstart}-${yearend}_ens_${run_0}-${run_n}.nc
if [ ! -f $ensfile ]; then
#concatenate the files and introduces a new record dimension called ens (order matters!)
ncecat -O -u ens ${tmpdir}/*/*${varstring}*.nc $ensfile
#Switch record and time dimension (so that time gets unlimited and record gets fixed)
ncpdq -O -a time,ens $ensfile $ensfile
else
echo "merged ensemble file found, skipping step"
if [[ $experiment -ne pictrl ]] ; then
ensfile=${outdir}/${varstring}_${experiment}_${yearstart}-${yearend}_ens_${run_0}-${run_n}.nc
if [ ! -f $ensfile ]; then
#concatenate the files and introduces a new record dimension called ens (order matters!)
ncecat -O -u ens ${tmpdir}/*/*${varstring}*.nc $ensfile
#Switch record and time dimension (so that time gets unlimited and record gets fixed)
ncpdq -O -a time,ens $ensfile $ensfile
else
echo "merged ensemble file found, skipping step"
fi
echo "file created: $ensfile"
fi
echo "file created: $ensfile"
echo "Splitting variables into files..."
cdo splitname $ensfile ${outdir}/${filestring}.
if [[ $experiment -ne pictrl ]] ; then
cdo splitname $ensfile ${outdir}/${filestring}.
else
cdo splitname $curtmpdir/*${varstring}*.nc ${outdir}/${filestring}.
fi
echo "Created output files in ${outdir}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment