From 27cec82b9afdb02ca0da0e7c245e37eac2806a2b Mon Sep 17 00:00:00 2001
From: Michael <m.langguth@fz-juelich.de>
Date: Fri, 25 Sep 2020 14:30:49 +0200
Subject: [PATCH] Corrected calculation of min and max year in runscript
 'preprocess_data_era5_step1_template.sh'

---
 .../HPC_scripts/preprocess_data_era5_step1_template.sh        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/video_prediction_tools/HPC_scripts/preprocess_data_era5_step1_template.sh b/video_prediction_tools/HPC_scripts/preprocess_data_era5_step1_template.sh
index 5c5392ee..afee9a57 100644
--- a/video_prediction_tools/HPC_scripts/preprocess_data_era5_step1_template.sh
+++ b/video_prediction_tools/HPC_scripts/preprocess_data_era5_step1_template.sh
@@ -41,8 +41,8 @@ declare -a years=(
                  "2017"
                   )
 
-max_year=`echo "${years[*]}" | sort -nr | head -n1`
-min_year=`echo "${years[*]}" | sort -nr | tail -n1`
+max_year=$( printf "%d\n" "${years[@]}" | sort -n | tail -1 )
+min_year=$( printf "%d\n" "${years[@]}" | sort -nr | tail -1 )
 # set some paths
 # note, that destination_dir is used during runtime to set a proper experiment directory
 exp_id=xxx                                          # experiment identifier is set by 'generate_workflow_runscripts.sh'
-- 
GitLab