#!/bin/bash -l

# ============== Batch script for the exosphere simulation code as described in
#                Kegerreis et al. (2016) and the README.pdf documentation.

#BSUB -L /bin/bash

# ============== Number of processors
#BSUB -n 60

# ============== Job name
# ====== Single job
# #BSUB -J exosphere
# ====== Job array
#BSUB -J exosphere[3-11]

# ============== Output files
# ====== Single job
# #BSUB -oo /cosma/home/jkeger/exosphere/outs_and_errs/%J_exosphere.out
# #BSUB -eo /cosma/home/jkeger/exosphere/outs_and_errs/%J_exosphere.err
# ====== Job array
#BSUB -oo /cosma/home/jkeger/exosphere/outs_and_errs/%J_%I_exosphere.out
#BSUB -eo /cosma/home/jkeger/exosphere/outs_and_errs/%J_%I_exosphere.err

# ============== Queue
# #BSUB -q cosma
#BSUB -q bench1

# ============== Project and user
#BSUB -P durham
#BSUB -u jacob.kegerreis@durham.ac.uk
#BSUB -N

# ============== Wall clock time limit
#BSUB -W 0:30

# ============== Ensure that the right MPI module is loaded -- i.e. the same
#                module with which the program was compiled.
module purge
module load gnu_comp/c4/4.7.2
module load platform_mpi/8.2.1

# ============== Run the program
# ====== Single job
# mpirun -np $LSB_DJOB_NUMPROC $HOME/exosphere/exosphere.exe $LSB_JOBID
# ====== Job array
mpirun -np $LSB_DJOB_NUMPROC $HOME/exosphere/exosphere.exe $LSB_JOBID ${LSB_JOBINDEX}

