source: flex_extract.git/Testing/Installation/setup_local.sh @ 73308e0

ctbtodev
Last change on this file since 73308e0 was 73308e0, checked in by Anne Philipp <anne.philipp@…>, 4 years ago

updated file execution permissions and removed tabs; corrected output of makefile in local application mode

  • Property mode set to 100755
File size: 2.6 KB
Line 
1#!/bin/bash
2#
3# @Author: Anne Philipp
4#
5# @Date: September, 10 2018
6#
7# @Description:
8#    This file defines the flex_extract's available installation
9#    parameters and puts them together for the call of the actual
10#    python installation script. It also does some checks to
11#    guarantee necessary parameters were set.
12#
13# @Licence:
14#    (C) Copyright 2014-2020.
15#
16#    SPDX-License-Identifier: CC-BY-4.0
17#
18#    This work is licensed under the Creative Commons Attribution 4.0
19#    International License. To view a copy of this license, visit
20#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
21#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
22#
23# -----------------------------------------------------------------
24# AVAILABLE COMMANDLINE ARGUMENTS TO SET
25#
26# THE USER HAS TO SPECIFY THESE PARAMETERS
27#
28TARGET='local'
29MAKEFILE='makefile_local_gfortran'
30ECUID=None
31ECGID=None
32GATEWAY=None
33DESTINATION=None
34INSTALLDIR=None
35JOB_TEMPLATE=''
36CONTROLFILE='CONTROL_CERA'
37# -----------------------------------------------------------------
38#
39# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!!
40#
41# -----------------------------------------------------------------
42
43# PATH TO INSTALLATION SCRIPT
44script="Source/Python/install.py"
45
46# INITIALIZE EMPTY PARAMETERLIST
47parameterlist=""
48
49# CHECK IF ON ECMWF SERVER;
50if [[ $HOST == *"ecgb"* ]] || [[ $HOST == *"cca"* ]] || [[ $HOST == *"ccb"* ]]; then
51# LOAD PYTHON3 MODULE
52  module load python3
53fi 
54
55# DEFAULT PARAMETERLIST
56if [ -n "$TARGET" ]; then
57  parameterlist=" --target=$TARGET"
58else
59  echo "ERROR: No installation target specified."
60  echo "EXIT WITH ERROR"
61  exit
62fi
63
64# CHECK FOR MORE PARAMETER
65if [ "$TARGET" == "ecgate" ] || [ "$TARGET" == "cca" ]; then
66  # check if necessary Parameters are set
67  if [ -z "$ECUID" ] || [ -z "$ECGID" ] || [ -z "$GATEWAY" ] || [ -z "$DESTINATION" ]; then
68    echo "ERROR: At least one of the following parameters are not set: ECUID, ECGID, GATEWAY, DESTINATION!"
69    echo "EXIT WITH ERROR"
70    exit
71  else
72    parameterlist+=" --ecuid=$ECUID --ecgid=$ECGID --gateway=$GATEWAY --destination=$DESTINATION"
73  fi
74fi
75if [ -n "$MAKEFILE" ]; then
76  parameterlist+=" --makefile=$MAKEFILE"
77fi
78if [ -n "$FLEXPARTDIR" ]; then # not empty
79  parameterlist+=" --flexpartdir=$FLEXPARTDIR"
80fi
81if [ -n "$JOB_TEMPLATE" ]; then
82  parameterlist+=" --job_template=$JOB_TEMPLATE"
83fi
84if [ -n "$CONTROLFILE" ]; then
85  parameterlist+=" --controlfile=$CONTROLFILE"
86fi
87
88# -----------------------------------------------------------------
89# CALL INSTALLATION SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS
90
91$script $parameterlist
92
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG