Slurm batch file for LPJmL

This is a sample SLURM batch file for LPJmL. User must be replaced by your user name.
#!/bin/bash 
###############################################################################
##                                                                           ##
##                     s  l  u  r  m  .  j  c  f                             ##
##                                                                           ##
##  SLURM JCF file for running an Intel MPI job on the HLRS2015 cluster      ##
##  at PIK                                                                   ##
##                                                                           ##
###############################################################################
 
#SBATCH --ntasks=256
#SBATCH --qos=short
#SBATCH -J LPJmL51
#SBATCH --signal=15@120
#SBATCH --comment="LPJmL Version 5.1.001"
#SBATCH --mail-user=user
#SBATCH --mail-type=end

#SBATCH -o  lpjml.%j.out
#SBATCH -e  lpjml.%j.err

module load mpi/intel/5.1.3

# set root, restart and output directory for LPJmL

export LPJROOT=/home/user/lpjml
export LPJOUTPATH=/p/tmp/user/lpjml
export LPJRESTARTPATH=/p/tmp/user/lpjml

# create restart and output directory

mkdir -p $LPJOUTPATH/output
mkdir -p $LPJRESTARTPATH/restart

export I_MPI_PMI_LIBRARY=/p/system/slurm/lib/libpmi.so
ulimit -c unlimited

# run LPJmL for spinup and transient

if srun $LPJROOT/bin/lpjml lpjml.js
then
  srun --propagate $LPJROOT/bin/lpjml -DFROM_RESTART lpjml.js
fi
rc=$?  # save return code of srun

# copy log of LPJmL run to output directory

cp lpjml.$SLURM_JOB_ID.out $LPJOUTPATH/output
cp lpjml.$SLURM_JOB_ID.err $LPJOUTPATH/output

exit $rc # exit with return code
Job can be submitted by invoking the following command:
% sbatch slurm.jcf