source: flex_extract.git/Templates/installscript.template.bologna

dev
Last change on this file was d9afe04, checked in by Anne Tipka <anne.tipka@…>, 18 months ago

corrected setting up module environment in shell script templates

  • Property mode set to 100644
File size: 1.7 KB
Line 
1#!/bin/bash
2
3# ON ECS or HPC servers:
4# start with ecaccss-job-submit -queueName <QUEUENAME> <NAME_OF_THIS_FILE>  on gateway server
5# start with sbatch <NAME_OF_THIS_FILE> directly on machine
6
7#SBATCH --chdir=/scratch/$username
8#SBATCH --qos=el
9#SBATCH --job-name=flex_compile
10#SBATCH --output=flex_compile.%j.out
11#SBATCH --error=flex_compile.%j.out
12#SBATCH --mail-type=FAIL
13#SBATCH --mail-user=$username
14# job output is in .ecaccess_DO_NOT_REMOVE
15
16set -x
17export VERSION=$version_number
18case $${EC_CLUSTER} in
19  *ecs*)
20  module purge
21  module load prgenv/gnu
22  module load gcc/8.4.1
23  module load ecmwf-toolbox
24  module load python3
25  module load ecaccess
26  export FLEXPART_ROOT_SCRIPTS=$fp_root_scripts
27  export MAKEFILE=$makefile
28  ;;
29  *hpc*)
30  module purge
31  module load prgenv/gnu gcc/8.4.1
32  module load python3
33  module load ecmwf-toolbox
34  module load ecaccess
35  echo $${GROUP}
36  echo $${HOME}
37  echo $${HOME} | awk -F / '{print $1, $2, $3, $4}'
38  export GROUP=`echo $${HOME} | awk -F / '{print $4}'`
39  export SCRATCH=$${SCRATCH}
40  export FLEXPART_ROOT_SCRIPTS=$fp_root_scripts
41  export MAKEFILE=$makefile
42  ;;
43esac
44
45mkdir -p $${FLEXPART_ROOT_SCRIPTS}/flex_extract_v$${VERSION}
46cd $${FLEXPART_ROOT_SCRIPTS}/flex_extract_v$${VERSION}   # if FLEXPART_ROOT is not set this means cd to the home directory
47tar -xvf $${HOME}/flex_extract_v$${VERSION}.tar
48cd Source/Fortran
49\rm *.o *.mod $fortran_program 
50make -f $${MAKEFILE} >flexcompile 2>flexcompile
51
52ls -l $fortran_program >>flexcompile
53if [ $$? -eq 0 ]; then
54  echo -e '\nSUCCESS!' >>flexcompile
55  mail -s flexcompile.$${HOST}.$$$$ $${USER} <flexcompile
56  sleep 1
57else
58  echo Environment: >>flexcompile
59  env >> flexcompile
60  mail -s "ERROR! flexcompile.$${HOST}.$$$$" $${USER} <flexcompile
61  sleep 1
62fi
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG