From 7c4bd597fbe146d14a72012b1e20d8e71866310c Mon Sep 17 00:00:00 2001 From: Anne Tipka <anne.tipka@ctbto.org> Date: Fri, 21 Oct 2022 08:46:10 +0000 Subject: [PATCH] adapted run.sh script for bologna env --- Run/run.sh | 122 +-------------------------------------------- Run/run_bologna.sh | 121 ++++++++++++++++++++++++++++++++++++++++++++ Run/run_reading.sh | 121 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 243 insertions(+), 121 deletions(-) mode change 100755 => 120000 Run/run.sh create mode 100755 Run/run_bologna.sh create mode 100755 Run/run_reading.sh diff --git a/Run/run.sh b/Run/run.sh deleted file mode 100755 index e8ae9c4..0000000 --- a/Run/run.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash -# -# @Author: Anne Philipp -# -# @Date: October, 4 2018 -# -# @Description: -# This script defines the available command-line parameters -# for running flex_extract and combines them for the execution -# of the Python program. It also does some checks to -# guarantee necessary parameters were set and consistent. -# -# @Licence: -# (C) Copyright 2014-2020. -# -# SPDX-License-Identifier: CC-BY-4.0 -# -# This work is licensed under the Creative Commons Attribution 4.0 -# International License. To view a copy of this license, visit -# http://creativecommons.org/licenses/by/4.0/ or send a letter to -# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. -# -# ----------------------------------------------------------------- -# AVAILABLE COMMANDLINE ARGUMENTS TO SET -# -# THE USER HAS TO SPECIFY THESE PARAMETERS: - -QUEUE='ecgate' -START_DATE=None -END_DATE=None -DATE_CHUNK=None -JOB_CHUNK=3 -BASETIME=None -STEP=None -LEVELIST=None -AREA=None -INPUTDIR=None -OUTPUTDIR=None -PP_ID=None -JOB_TEMPLATE='submitscript.template' -CONTROLFILE='CONTROL_EA5' -DEBUG=0 -REQUEST=2 -PUBLIC=0 - -# ----------------------------------------------------------------- -# -# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!! -# -# ----------------------------------------------------------------- - -# PATH TO SUBMISSION SCRIPT -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" -fi -if [ -n "$END_DATE" ]; then - parameterlist+=" --end_date=$END_DATE" -fi -if [ -n "$DATE_CHUNK" ]; then - parameterlist+=" --date_chunk=$DATE_CHUNK" -fi -if [ -n "$JOB_CHUNK" ]; then - parameterlist+=" --job_chunk=$JOB_CHUNK" -fi -if [ -n "$BASETIME" ]; then - parameterlist+=" --basetime=$BASETIME" -fi -if [ -n "$STEP" ]; then - parameterlist+=" --step=$STEP" -fi -if [ -n "$LEVELIST" ]; then - parameterlist+=" --levelist=$LEVELIST" -fi -if [ -n "$AREA" ]; then - parameterlist+=" --area=$AREA" -fi -if [ -n "$INPUTDIR" ]; then - parameterlist+=" --inputdir=$INPUTDIR" -fi -if [ -n "$OUTPUTDIR" ]; then - parameterlist+=" --outputdir=$OUTPUTDIR" -fi -if [ -n "$PP_ID" ]; then - parameterlist+=" --ppid=$PP_ID" -fi -if [ -n "$JOB_TEMPLATE" ]; then - parameterlist+=" --job_template=$JOB_TEMPLATE" -fi -if [ -n "$QUEUE" ]; then - parameterlist+=" --queue=$QUEUE" -fi -if [ -n "$CONTROLFILE" ]; then - parameterlist+=" --controlfile=$CONTROLFILE" -fi -if [ -n "$DEBUG" ]; then - parameterlist+=" --debug=$DEBUG" -fi -if [ -n "$REQUEST" ]; then - parameterlist+=" --request=$REQUEST" -fi -if [ -n "$PUBLIC" ]; then - parameterlist+=" --public=$PUBLIC" -fi - -# ----------------------------------------------------------------- -# CALL SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS - -$pyscript $parameterlist - diff --git a/Run/run.sh b/Run/run.sh new file mode 120000 index 0000000..34731d7 --- /dev/null +++ b/Run/run.sh @@ -0,0 +1 @@ +run_bologna.sh \ No newline at end of file diff --git a/Run/run_bologna.sh b/Run/run_bologna.sh new file mode 100755 index 0000000..a06cf2d --- /dev/null +++ b/Run/run_bologna.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# +# @Author: Anne Philipp +# +# @Date: October, 4 2018 +# +# @Description: +# This script defines the available command-line parameters +# for running flex_extract and combines them for the execution +# of the Python program. It also does some checks to +# guarantee necessary parameters were set and consistent. +# +# @Licence: +# (C) Copyright 2014-2020. +# +# SPDX-License-Identifier: CC-BY-4.0 +# +# This work is licensed under the Creative Commons Attribution 4.0 +# International License. To view a copy of this license, visit +# http://creativecommons.org/licenses/by/4.0/ or send a letter to +# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. +# +# ----------------------------------------------------------------- +# AVAILABLE COMMANDLINE ARGUMENTS TO SET +# +# THE USER HAS TO SPECIFY THESE PARAMETERS: + +QUEUE='ecs' +START_DATE=None +END_DATE=None +DATE_CHUNK=None +JOB_CHUNK=3 +BASETIME=None +STEP=None +LEVELIST=None +AREA=None +INPUTDIR=None +OUTPUTDIR=None +PP_ID=None +JOB_TEMPLATE='submitscript.template' +CONTROLFILE='CONTROL_EA5' +DEBUG=0 +REQUEST=2 +PUBLIC=0 + +# ----------------------------------------------------------------- +# +# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!! +# +# ----------------------------------------------------------------- + +# PATH TO SUBMISSION SCRIPT +pyscript=../Source/Python/submit.py + +# INITIALIZE EMPTY PARAMETERLIST +parameterlist="" + +# CHECK IF ON ECMWF SERVER; +if [[ $EC_CLUSTER == "ecs"* ]] || [[ $EC_CLUSTER == "aa"* ]] || [[ $EC_CLUSTER == "ab"* ]] || [[ $EC_CLUSTER == "ac"* ]] || [[ $EC_CLUSTER == "ad"* ]]; then +# LOAD PYTHON3 AND ECACCESS MODULES + module load python3 ecaccess +fi + +# CHECK FOR MORE PARAMETER +if [ -n "$START_DATE" ]; then + parameterlist+=" --start_date=$START_DATE" +fi +if [ -n "$END_DATE" ]; then + parameterlist+=" --end_date=$END_DATE" +fi +if [ -n "$DATE_CHUNK" ]; then + parameterlist+=" --date_chunk=$DATE_CHUNK" +fi +if [ -n "$JOB_CHUNK" ]; then + parameterlist+=" --job_chunk=$JOB_CHUNK" +fi +if [ -n "$BASETIME" ]; then + parameterlist+=" --basetime=$BASETIME" +fi +if [ -n "$STEP" ]; then + parameterlist+=" --step=$STEP" +fi +if [ -n "$LEVELIST" ]; then + parameterlist+=" --levelist=$LEVELIST" +fi +if [ -n "$AREA" ]; then + parameterlist+=" --area=$AREA" +fi +if [ -n "$INPUTDIR" ]; then + parameterlist+=" --inputdir=$INPUTDIR" +fi +if [ -n "$OUTPUTDIR" ]; then + parameterlist+=" --outputdir=$OUTPUTDIR" +fi +if [ -n "$PP_ID" ]; then + parameterlist+=" --ppid=$PP_ID" +fi +if [ -n "$JOB_TEMPLATE" ]; then + parameterlist+=" --job_template=$JOB_TEMPLATE" +fi +if [ -n "$QUEUE" ]; then + parameterlist+=" --queue=$QUEUE" +fi +if [ -n "$CONTROLFILE" ]; then + parameterlist+=" --controlfile=$CONTROLFILE" +fi +if [ -n "$DEBUG" ]; then + parameterlist+=" --debug=$DEBUG" +fi +if [ -n "$REQUEST" ]; then + parameterlist+=" --request=$REQUEST" +fi +if [ -n "$PUBLIC" ]; then + parameterlist+=" --public=$PUBLIC" +fi + +# ----------------------------------------------------------------- +# CALL SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS + +$pyscript $parameterlist + diff --git a/Run/run_reading.sh b/Run/run_reading.sh new file mode 100755 index 0000000..e8ae9c4 --- /dev/null +++ b/Run/run_reading.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# +# @Author: Anne Philipp +# +# @Date: October, 4 2018 +# +# @Description: +# This script defines the available command-line parameters +# for running flex_extract and combines them for the execution +# of the Python program. It also does some checks to +# guarantee necessary parameters were set and consistent. +# +# @Licence: +# (C) Copyright 2014-2020. +# +# SPDX-License-Identifier: CC-BY-4.0 +# +# This work is licensed under the Creative Commons Attribution 4.0 +# International License. To view a copy of this license, visit +# http://creativecommons.org/licenses/by/4.0/ or send a letter to +# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. +# +# ----------------------------------------------------------------- +# AVAILABLE COMMANDLINE ARGUMENTS TO SET +# +# THE USER HAS TO SPECIFY THESE PARAMETERS: + +QUEUE='ecgate' +START_DATE=None +END_DATE=None +DATE_CHUNK=None +JOB_CHUNK=3 +BASETIME=None +STEP=None +LEVELIST=None +AREA=None +INPUTDIR=None +OUTPUTDIR=None +PP_ID=None +JOB_TEMPLATE='submitscript.template' +CONTROLFILE='CONTROL_EA5' +DEBUG=0 +REQUEST=2 +PUBLIC=0 + +# ----------------------------------------------------------------- +# +# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!! +# +# ----------------------------------------------------------------- + +# PATH TO SUBMISSION SCRIPT +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" +fi +if [ -n "$END_DATE" ]; then + parameterlist+=" --end_date=$END_DATE" +fi +if [ -n "$DATE_CHUNK" ]; then + parameterlist+=" --date_chunk=$DATE_CHUNK" +fi +if [ -n "$JOB_CHUNK" ]; then + parameterlist+=" --job_chunk=$JOB_CHUNK" +fi +if [ -n "$BASETIME" ]; then + parameterlist+=" --basetime=$BASETIME" +fi +if [ -n "$STEP" ]; then + parameterlist+=" --step=$STEP" +fi +if [ -n "$LEVELIST" ]; then + parameterlist+=" --levelist=$LEVELIST" +fi +if [ -n "$AREA" ]; then + parameterlist+=" --area=$AREA" +fi +if [ -n "$INPUTDIR" ]; then + parameterlist+=" --inputdir=$INPUTDIR" +fi +if [ -n "$OUTPUTDIR" ]; then + parameterlist+=" --outputdir=$OUTPUTDIR" +fi +if [ -n "$PP_ID" ]; then + parameterlist+=" --ppid=$PP_ID" +fi +if [ -n "$JOB_TEMPLATE" ]; then + parameterlist+=" --job_template=$JOB_TEMPLATE" +fi +if [ -n "$QUEUE" ]; then + parameterlist+=" --queue=$QUEUE" +fi +if [ -n "$CONTROLFILE" ]; then + parameterlist+=" --controlfile=$CONTROLFILE" +fi +if [ -n "$DEBUG" ]; then + parameterlist+=" --debug=$DEBUG" +fi +if [ -n "$REQUEST" ]; then + parameterlist+=" --request=$REQUEST" +fi +if [ -n "$PUBLIC" ]; then + parameterlist+=" --public=$PUBLIC" +fi + +# ----------------------------------------------------------------- +# CALL SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS + +$pyscript $parameterlist + -- GitLab