From 3a544793fefbd7ac797a61dfa1fe4885bccaae2b Mon Sep 17 00:00:00 2001
From: Anne Philipp <anne.philipp@univie.ac.at>
Date: Sun, 14 Jun 2020 22:48:42 +0200
Subject: [PATCH] added automatic python3 loading on ECMWF servers in setup and
 run scripts

---
 Run/run.sh | 6 ++++++
 setup.sh   | 8 +++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/Run/run.sh b/Run/run.sh
index 5c1ec77..aa09ede 100755
--- a/Run/run.sh
+++ b/Run/run.sh
@@ -55,6 +55,12 @@ pyscript=../Source/Python/submit.py
 # INITIALIZE EMPTY PARAMETERLIST
 parameterlist=""
 
+# CHECK IF ON ECMWF SERVER; 
+if [[ $HOST == *"ecgb"* ]] || [[ $HOST == *"cca"* ]] || [[ $HOST == *"ccb"* ]]; then
+# LOAD PYTHON3 MODULE
+  module load python3
+fi 
+
 # CHECK FOR MORE PARAMETER 
 if [ -n "$START_DATE" ]; then
   parameterlist+=" --start_date=$START_DATE"
diff --git a/setup.sh b/setup.sh
index 64b055f..a4c3a4a 100755
--- a/setup.sh
+++ b/setup.sh
@@ -46,6 +46,12 @@ script="Source/Python/install.py"
 # INITIALIZE EMPTY PARAMETERLIST
 parameterlist=""
 
+# CHECK IF ON ECMWF SERVER; 
+if [[ $HOST == *"ecgb"* ]] || [[ $HOST == *"cca"* ]] || [[ $HOST == *"ccb"* ]]; then
+# LOAD PYTHON3 MODULE
+  module load python3
+fi 
+
 # DEFAULT PARAMETERLIST
 if [ -n "$TARGET" ]; then
   parameterlist=" --target=$TARGET"
@@ -56,7 +62,7 @@ else
 fi
 
 # CHECK FOR MORE PARAMETER 
-if [ "$TARGET" == "ecgate" ] || [ "$TARGET" == "cca" ]; then
+if [ "$TARGET" == "ecgate" ] || [ "$TARGET" == "cca" ] || [ "$TARGET" == "ccb" ]; then
   # check if necessary Parameters are set
   if [ -z "$ECUID" ] || [ -z "$ECGID" ] || [ "$ECUID" == "<username>" ] || [ "$ECGID" == "<groupID>" ] ; then
     echo "ERROR: At least one of the following parameters are not properly set: ECUID or ECGID!"
-- 
GitLab