#!/bin/bash
# ---------------------------
#===============================================================
# CLUSTER BITS
#===============================================================
#PBS -N EA_R12
#PBS -l select=21
#PBS -l walltime=02:00:00
#PBS -A n01-ACCORD
#PBS -j oe
#PBS -r n
# mail alert at (b)eginning, (e)nd and (a)bortion of execution
#PBS -m bea

module swap PrgEnv-cray PrgEnv-intel
module load cray-netcdf-hdf5parallel
module load cray-hdf5-parallel

export PBS_O_WORKDIR=$(readlink -f $PBS_O_WORKDIR)
# Change to the direcotry that the job was submitted from
cd $PBS_O_WORKDIR


# Set the number of threads to 1
#   This prevents any system libraries from automatically
#   using threading.
export OMP_NUM_THREADS=1
# Change to the directory that the job was submitted from
ulimit -s unlimited
ulimit -c unlimited

export NEMOproc=480 #550
export XIOSproc=1

#===============================================================
# LAUNCH JOB
#===============================================================
echo `date` : Launch Job
aprun -b -n 5 -N 5 ./xios_server.exe : -n $NEMOproc -N 24 ./opa
exit