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 ...@@ -32,7 +32,7 @@ workdir=/scratch/m/$USER/MPI-ESM-GE
# set default values # set default values
experiment=hist # hist | onepct | rcp26 | rcp45 | rcp85 experiment=hist # hist | onepct | rcp26 | rcp45 | rcp85 | pictrl
#first run in sequence #first run in sequence
run_0=1 run_0=1
#last run in sequence #last run in sequence
...@@ -87,6 +87,17 @@ if [[ $experiment == onepct ]]; then ...@@ -87,6 +87,17 @@ if [[ $experiment == onepct ]]; then
elif [[ $experiment == hist ]]; then elif [[ $experiment == hist ]]; then
yearstart=1850 yearstart=1850
yearend=2005 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 elif [[ $experiment == rcp26 ]] || [[ $experiment == rcp45 ]] || [[ $experiment == rcp85 ]]; then
yearstart=2006 yearstart=2006
yearend=2099 yearend=2099
...@@ -185,19 +196,25 @@ for rrr in $(seq $run_0 $run_n); do ...@@ -185,19 +196,25 @@ for rrr in $(seq $run_0 $run_n); do
done done
# merge ensemble into one file # merge ensemble into one file
ensfile=${outdir}/${varstring}_${experiment}_${yearstart}-${yearend}_ens_${run_0}-${run_n}.nc if [[ $experiment -ne pictrl ]] ; then
if [ ! -f $ensfile ]; then ensfile=${outdir}/${varstring}_${experiment}_${yearstart}-${yearend}_ens_${run_0}-${run_n}.nc
#concatenate the files and introduces a new record dimension called ens (order matters!) if [ ! -f $ensfile ]; then
ncecat -O -u ens ${tmpdir}/*/*${varstring}*.nc $ensfile #concatenate the files and introduces a new record dimension called ens (order matters!)
#Switch record and time dimension (so that time gets unlimited and record gets fixed) ncecat -O -u ens ${tmpdir}/*/*${varstring}*.nc $ensfile
ncpdq -O -a time,ens $ensfile $ensfile #Switch record and time dimension (so that time gets unlimited and record gets fixed)
else ncpdq -O -a time,ens $ensfile $ensfile
echo "merged ensemble file found, skipping step" else
echo "merged ensemble file found, skipping step"
fi
echo "file created: $ensfile"
fi fi
echo "file created: $ensfile"
echo "Splitting variables into files..." 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}" 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