Index: run/jobscripts/compilejob.ksh
===================================================================
--- run/jobscripts/compilejob.ksh	(revision 34b247b9552a1080e1b5c223a1ab6fa087edbc32)
+++ run/jobscripts/compilejob.ksh	(revision 34b247b9552a1080e1b5c223a1ab6fa087edbc32)
@@ -0,0 +1,68 @@
+#!/bin/ksh
+
+# ON ECGB:
+# start with ecaccess-job-submit -queueName ecgb NAME_OF_THIS_FILE  on gateway server
+# start with sbatch NAME_OF_THIS_FILE directly on machine
+
+#SBATCH --workdir=/scratch/ms/at/km4a
+#SBATCH --qos=normal
+#SBATCH --job-name=flex_ecmwf
+#SBATCH --output=flex_ecmwf.%j.out
+#SBATCH --error=flex_ecmwf.%j.out
+#SBATCH --mail-type=FAIL
+#SBATCH --time=12:00:00
+
+## CRAY specific batch requests
+##PBS -N flex_ecmwf
+##PBS -q ns
+##PBS -S /usr/bin/ksh
+##PBS -o /scratch/ms/at/km4a/flex_ecmwf.${Jobname}.${Job_ID}.out
+# job output is in .ecaccess_DO_NOT_REMOVE
+##PBS -j oe
+##PBS -V
+##PBS -l EC_threads_per_task=1
+##PBS -l EC_memory_per_task=3200MB
+
+set -x
+export VERSION=7.1
+case ${HOST} in
+  *ecg*)
+#  module load python
+#  module unload grib_api
+  module unload emos
+#  module load grib_api/1.14.5
+  module load emos/437-r64
+  export FLEXPART_ROOT_SCRIPTS=${HOME}
+  export MAKEFILE=Makefile.gfortran
+  ;;
+  *cca*)
+  module switch PrgEnv-cray PrgEnv-intel
+  module load grib_api
+  module load emos
+  module load python
+  echo ${GROUP}
+  echo ${HOME}
+  echo ${HOME} | awk -F / '{print $1, $2, $3, $4}'
+  export GROUP=`echo ${HOME} | awk -F / '{print $4}'`
+  export SCRATCH=/scratch/ms/${GROUP}/${USER}
+  export FLEXPART_ROOT_SCRIPTS=${HOME}
+  export MAKEFILE=Makefile.gfortran
+  ;;
+esac
+
+mkdir -p ${FLEXPART_ROOT_SCRIPTS}/flex_extract_v${VERSION}
+cd ${FLEXPART_ROOT_SCRIPTS}/flex_extract_v${VERSION}   # if FLEXPART_ROOT is not set this means cd to the home directory
+tar -xvf ${HOME}/flex_extract_v${VERSION}.tar
+cd source/fortran
+\rm *.o *.mod CONVERT2 
+make -f ${MAKEFILE} >flexcompile 2>flexcompile
+
+ls -l CONVERT2 >>flexcompile
+if [ $? -eq 0 ]; then
+  echo 'SUCCESS!' >>flexcompile
+  mail -s flexcompile.${HOST}.$$ ${USER} <flexcompile
+else
+  echo Environment: >>flexcompile
+  env >> flexcompile
+  mail -s "ERROR! flexcompile.${HOST}.$$" ${USER} <flexcompile
+fi
Index: run/jobscripts/job.ksh
===================================================================
--- run/jobscripts/job.ksh	(revision ca867de340aa450bfbc241b4cae4e578464d6633)
+++ run/jobscripts/job.ksh	(revision 34b247b9552a1080e1b5c223a1ab6fa087edbc32)
@@ -17,5 +17,5 @@
 ##PBS -q np
 ##PBS -S /usr/bin/ksh
-## -o /scratch/ms/spatlh00/lh0/flex_ecmwf.$PBS_JOBID.out
+## -o /scratch/ms/at/km4a/flex_ecmwf.${PBS_JOBID}.out
 ## job output is in .ecaccess_DO_NOT_REMOVE
 ##PBS -j oe
@@ -26,5 +26,5 @@
 set -x
 export VERSION=7.1
-case $HOST in
+case ${HOST} in
   *ecg*)
   module load python
@@ -40,10 +40,10 @@
   module load emos
   module load python
-  export SCRATCH=$TMPDIR
+  export SCRATCH=${TMPDIR}
   export PATH=${PATH}:${HOME}/flex_extract_v7.1/source/python
   ;;
 esac
 
-cd $SCRATCH
+cd ${SCRATCH}
 mkdir -p python$$
 cd python$$
@@ -51,16 +51,20 @@
 export CONTROL=CONTROL
 
-cat >$CONTROL<<EOF
-accuracy 16
+cat >${CONTROL}<<EOF
+accmaxstep 12
+acctime 06/18
+acctype FC
+accuracy 24
 addpar 186 187 188 235 139 39 
 area 
 basetime None
-controlfile CONTROL.temp
+controlfile CONTROL_EA5.testgrid
 cwc 0
+dataset None
 date_chunk 3
 debug 1
 destination annep@genericSftp
 dpdeta 1
-dtime 3
+dtime 1
 ecfsdir ectmp:/${USER}/econdemand/
 ecgid at
@@ -68,6 +72,6 @@
 ectrans 1
 ecuid km4a
-end_date 20120908
-eta 0
+end_date 20180108
+eta 1
 etadiff 0
 etapar 77
@@ -75,58 +79,59 @@
 format GRIB1
 gateway srvx8.img.univie.ac.at
-gauss 1
+gauss 0
+gaussian 
 grib2flexpart 0
-grid 5000
-inputdir ../../run/workspace/test
+grid 1000
+inputdir /raid60/nas/tmc/Anne/Interpolation/flexextract/flex_extract_v7.1/run/workspace
 install_target None
 job_template job.temp
-left -15000
-level 60
-levelist 40/to/60
-logicals gauss omega omegadiff eta etadiff dpdeta cwc wrf grib2flexpart ecstorage ectrans debug request 
-lower 30000
+left -5000
+level 137
+levelist 100/to/137
+logicals gauss omega omegadiff eta etadiff dpdeta cwc wrf grib2flexpart ecstorage ectrans debug request public 
+lower 10000
 mailfail ${USER} 
 mailops ${USER} 
 makefile Makefile.gfortran
-marsclass EI
-maxstep 11
+marsclass EA
+maxstep 0
 number OFF
 omega 0
 omegadiff 0
-outputdir ../../run/workspace/test
-ppid 41511
-prefix EI
-queue local
-request 1
-resol 63
-right 45000
+outputdir /raid60/nas/tmc/Anne/Interpolation/flexextract/flex_extract_v7.1/run/workspace
+prefix EA
+public 0
+queue ecgate
+request 2
+resol 159
+right 5000
 smooth 0
-start_date 20120908
-step 00 01 02 03 04 05 00 07 08 09 10 11 00 01 02 03 04 05 00 07 08 09 10 11 
+start_date 20180108
+step 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 stream OPER
-time 00 00 00 00 00 00 06 00 00 00 00 00 12 12 12 12 12 12 18 12 12 12 12 12 
-type AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC 
-upper 75000
+time 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 
+type AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN 
+upper 20000
 wrf 0
 EOF
 
 
-submit.py --controlfile=$CONTROL --inputdir=./work --outputdir=./work 1> prot 2>&1
+submit.py --controlfile=${CONTROL} --inputdir=./work --outputdir=./work 1> 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 <prot
+  for muser in `grep -i MAILOPS ${CONTROL}`; do
+      if [ ${l} -gt 0 ] ; then 
+         mail -s flex.${HOST}.$$ ${muser} <prot
       fi
-      l=$(($l+1))
+      l=$((${l}+1))
   done
 else
   l=0
-  for muser in `grep -i MAILFAIL $CONTROL`; do
-      if [ $l -gt 0 ] ; then 
-         mail -s "ERROR! flex.${HOST}.$$" $muser <prot
+  for muser in `grep -i MAILFAIL ${CONTROL}`; do
+      if [ ${l} -gt 0 ] ; then 
+         mail -s "ERROR! flex.${HOST}.$$" ${muser} <prot
       fi
-      l=$(($l+1))
+      l=$((${l}+1))
   done
 fi
Index: run/run.sh
===================================================================
--- run/run.sh	(revision 0e576fcaf0dab8e7e586efa1a4b9b194ee90f8bb)
+++ run/run.sh	(revision 34b247b9552a1080e1b5c223a1ab6fa087edbc32)
@@ -15,6 +15,6 @@
 #
 
-QUEUE=None
-START_DATE='20120908'
+QUEUE='ecgate'
+START_DATE='20180108'
 END_DATE=None
 DATE_CHUNK=None
@@ -23,10 +23,10 @@
 LEVELIST=None
 AREA=None
-INPUTDIR='/nas/tmc/Anne/Interpolation/flexextract/flex_extract_v7.1/run/workspace/test3'
+INPUTDIR=''
 OUTPUTDIR=None
 FLEXPART_ROOT_SCRIPTS=None 
 PP_ID=None
 JOB_TEMPLATE='job.temp' 
-CONTROLFILE='CONTROL_EA5' 
+CONTROLFILE='CONTROL_EA5.testgrid' 
 DEBUG=1 
 REQUEST=2
