#!/bin/bash
#SBATCH --account=nn4654k
#SBATCH --job-name=modmdrun2_long
#SBATCH --time=1-00:00:00   # Current time limit = 4 days
##SBATCH --mem-per-cpu=256M
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=16
#SBATCH --cpus-per-task=2

# Safety options
set -o errexit  # Recommended for easier debugging
set -o nounset  # Treat unset variables as errors

# Load your modules
module purge   # Recommended for reproducibility
module load GROMACS/2021.5-foss-2021b

######################################################
cp -r step11_production.mdp modmdrun2/{md.gro,md.cpt} system_mod2.top index.ndx toppar $SCRATCH
cd $SCRATCH

mkdir modmdrun2_long
cd modmdrun2_long

cleanup cp -r $SCRATCH/modmdrun2_long $SLURM_SUBMIT_DIR/.

gmx grompp -f ../step11_production.mdp -c ../md.gro -t ../md.cpt -r ../md.gro -p ../system_mod2.top -n ../index.ndx -o md.tpr
srun gmx_mpi mdrun -deffnm md -v -pin on -dlb yes -maxh 24

exit 0
