#!/bin/bash # ON ECS or HPC: # start with ecaccess-job-submit -queueName on gateway server # start with sbatch directly on machine #SBATCH --chdir=/scratch/$username #SBATCH --qos=el #SBATCH --job-name=flex_extract #SBATCH --output=flex_extract.%j.out #SBATCH --error=flex_extract.%j.out #SBATCH --mail-type=FAIL #SBATCH --mail-user=$username #SBATCH --time=24:00:00 ## job output is in .ecaccess_DO_NOT_REMOVE set -x export VERSION=$version_number case $$$${EC_CLUSTER} in *ecs*) module purge module load prgenv/gnu gcc/8.4.1 module load python3 module load ecmwf-toolbox module load ecaccess export PATH=$$$${PATH}:$fp_root_path ;; *hpc*) module purge module load prgenv/gnu gcc/8.4.1 module load python3 module load ecmwf-toolbox module load ecaccess export SCRATCH=$$$${TMPDIR} export PATH=$$$${PATH}:$fp_root_path ;; esac cd $$$${SCRATCH} mkdir -p extract$$$$$$$$ cd extract$$$$$$$$ export CONTROL=CONTROL cat >$$$${CONTROL}< prot 2>&1 if [ $? -eq 0 ] ; then l=0 for muser in `grep -i MAILOPS $$$${CONTROL}`; do if [ $$$${l} -gt 0 ] ; then mail -s flex.$$$${HOST}.$$$$$$$$ $$$${muser}