#!/bin/bash

runvasp="mpirun -np 8 executable_path/vasp_gam" 

# make sure to always start with the same structure
cp POSCAR.init POSCAR

i=1

while [ $i -le 50 ] 
do
  # start vasp
  $runvasp

  # use the last configuration generated in the previous
  # run as initial configuration for the next run
  cp CONTCAR POSCAR

  # backup some important files
  cp REPORT REPORT.$i
  cp vasprun.xml vasprun.xml.$i

  let i=i+1
done
