Commit bee0b77b authored by Sebastian Milinski's avatar Sebastian Milinski
Browse files

Solves #3. Some 1% files are now processed with cdo selname and mergetime instead of cdo select.

parent 061c4c4d
......@@ -28,7 +28,7 @@ module load nco
module load cdo
basedir=/work/mh1007/MPI-ESM-GE # directory with symlinks to all runs
workdir=/scratch/m/$USER
workdir=/scratch/m/$USER/MPI-ESM-GE
# set default values
......@@ -110,7 +110,7 @@ echo "Using ECHAM $echam_filetype files"
echo "running up to $pjobs parallel jobs"
# derive some variables to be used
outdir=${workdir}/MPI-ESM-GE/${experiment}
outdir=${workdir}/${experiment}
tmpdir=$SCRATCH/tmp/${experiment}
varstring=$(echo $vars | sed "s/,/_/g") # replace , with _ so that variable list can be used in filename
......@@ -132,7 +132,20 @@ for rrr in $(seq $run_0 $run_n); do
# vertsum=${curtmpdir}/${expid}_echam6_${varstring}_mm_vertsum.nc
# if [ ! -f $merged ] && [ ! -f $vertsum ]; then
if [ ! -f $merged ]; then
cdo -t echam6 -f nc select,name=${vars},year=${yearstart}/${yearend} ${ifiles} ${merged}
# different number of variables in some BOT files does not allow use of cdo select (only applies to 1%CO2 69-100)
if [ $experiment == onepct ] && [ $rrr -ge 69 ]; then
# loop over all years, extract variables and use mergetime in the end
for year in $(seq $yearstart $yearend); do
ifile_year=${datdir}/${expid}_echam6_${echam_filetype}_mm_${year}.grb
tmpfile_year=${curtmpdir}/${expid}_echam6_${varstring}_mm_${year}.nc
cdo -t echam6 -f nc selname,${vars} $ifile_year $tmpfile_year
done
ifiles_years=${curtmpdir}/${expid}_echam6_${varstring}_mm_????.nc
cdo mergetime ${ifiles_years} ${merged}
rm ${ifiles_years}
else
cdo -t echam6 -f nc select,name=${vars},year=${yearstart}/${yearend} ${ifiles} ${merged}
fi
else
echo "processed file found, skipping processing step."
fi
......
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