#!/usr/bin/env bash

#SBATCH -n 1
#SBATCH -w gustafson
#SBATCH --time 72:00:00
#SBATCH --error=job.%J.err
#SBATCH --output=job.%J.out

set -xv

PATH_TO_CONF_FILE=~/earthdiagnostics/diags.conf
PATH_TO_DIAGNOSTICS=~/earthdiagnostics
PATH_TO_VIRTUALENV=~jvegas/virtualenvs/diags/bin

module purge
module load NCO/4.5.4-foss-2015a
module load CDO/1.7.2-foss-2015a
module load CDFTOOLS/3.0a2-foss-2015a

source ${PATH_TO_VIRTUALENV}/activate

export PYTHONPATH=${PATH_TO_DIAGNOSTICS}:${PYTHONPATH}
cd ${PATH_TO_DIAGNOSTICS}/earthdiagnostics/
./earthdiags.py -lc DEBUG -f ${PATH_TO_CONF_FILE}
