VASP

Webpages: VASP Wiki and VASP Forum

A VASP job requires 4 key files to run (details taken from various sources including VASP wiki):

INCAR   : The central input file of VASP. It determines "what to do and how"?
POSCAR  : Comprises the lattice geometry and the ionic positions.
POTCAR  : Contains the pseudopotential for each atomic species used in the calculation.
KPOINTS : Used to specify the Bloch vectors (k-points) that will be used to sample the Brillouin zone in your calculation.

File_1. Sample INCAR:

! Initialization and performance settings
! -------------------------------------------------------------------------
System  = CsPbBr3
#KPAR    = 2          ! KPAR must divide both the total number of cores and the number of k-points exactly;
                     ! a starting point could be KPAR=# of compute nodes
NCORE   = 12         ! Recommended to be SQRT of total no. of cores employed for the job.
LREAL   = Auto       ! Real space projection; slightly less accurate but faster for large supercell; don't use to compute SCF energy

! Restart settings
! --------------------------------------------------------------------------
ISTART  = 0          ! 0 = from scratch; 1 = orbitals from WAVECAR
ICHARG  = 2          ! 1 = from CHGCAR; 2 = from atomic charge densities during a fresh calc from scratch
                     !11 = To obtain eigenvalues (for band str. plots) or DOS for a given charge density *read* from CHGCAR

! Writing files
! ----------------------------------------------------------------------------
LCHARG  = F          ! CHGCAR file generation T/F
LWAVE   = F          ! WAVECAR file generation T/F

! Electronic minimization
! -----------------------------------------------------------------------------
ALGO    = Fast       ! Fast; Normal; Conjugate
PREC    = Normal     ! Accurate
ENCUT   = 520        ! recommended: 1.3*ENMAX
ISMEAR  = 0          ! 0: Gaussian smearing; -5: tetrahedron method with Blöchl corrections
SIGMA   = 0.02       ! 0.01 or 0.05
NELM    = 200        ! maximum number of electronic SCF steps
NELMIN  = 3          ! minimum number of electronic SCF steps
ADDGRID = T          ! Adds additional support grid for augmentation charge evaluation
LASPH   = T          ! Non-spherical contributions from gradient corrections inside the PAW spheres will be included
                     ! Essential for accurate total energies and band structure calculations for f-elements (e.g. ceria),
                     ! all 3d-elements and magnetic atoms in the 2nd row (B-F atom), in particular if LDA+U, meta-GGAs,
                     ! hybrid functionals or vdW-DFT are used, since they often result in aspherical charge densities.

! DFT and symmetry
!----------------
GGA     = PE         ! PE = PBE; PS = PBEsol
IVDW    = 11         ! 11 = DFT-D3(0); 12 = DFT-D3(BJ)
SYMPREC = 1.0E-8
ISYM    = 0          ! do not use symmetry

! Ionic/Cell relaxation
! -----------------------------------------------------------------------------
IBRION  = 2          ! 2 = CG algorithm for difficult relaxation problem
                     ! 1 = RMM-DIIS if close to the local minima; 3 = Damped molecular dynamics if starting from *very* bad initial guesses
POTIM   = 0.5        ! step for ionic-motion (for MD in fs); POTIM = 0.5 if IBRION= 1, 2, or 3
ISIF    = 2          ! 2 = atoms only; 3 = both atoms and cell volume
NSW     = 300        ! 300 ionic steps
EDIFFG  = -0.02      ! forces smaller 0.02 eV/A
#EDIFF   = 1.0e-06

! SCF settings
! -------------------------------------------------------------------------------
#IBRION  = -1
#NSW     = 0
#EDIFF   = 1.0E-8
#BMIX    = 3.0
#AMIN    = 0.01

! Spin polarization
! -------------------------------------------------------------------------------
#NELECT  = 948                         ! Total # of valence electrons in your system.
                                       ! Not required unless constraining charge for studying defect/doping etc.
#ISPIN   = 2
#MAGMOM  = 2*0.2 24*0.2 20*0.2 64*0.2  ! (no of ions of type-A) * (spin of type-A)
#SAXIS   = 0 0 1

! For BADER charges
! --------------------------------------------------------------------------------
#LAECHG  = .TRUE.      ! generate the AECCAR0 and AECCAR2 files

! Work function calculation
! --------------------------------------------------------------------------------
#LVHAR   = .TRUE.      ! Write electrostatic potential to LOCPOT file for plotting planar average of the potential

! BAND/DOS Settings
! --------------------------------------------------------------------------------
#LORBIT = 11           ! output DOSCAR and PROCAR (total DOS and l,m partial DOS)
#NEDOS =  2500         ! number of points for DOS

File_2. Getting a starting geometry can sometime be tricky if you don’t have direct access to a .cif file, e.g. from your collaborator. Fortunately, there are various databases, like the Materials Project, NOMAD Laboratory, HybriD³ materials database, 2D Perovskites Database and others that provide easy access to structures. Here is a sample POSCAR file (in Cartesian):

CsPbBr3_mp-567681_computed
1.0
        4.6641898155         0.0000000000         0.0000000000
        0.0000000000        10.0410900116         0.0000000000
        0.0000000000         0.0000000000        17.1981544495
   Cs   Pb   Br
    4    4   12
Cartesian
1.166047454   9.15476291      11.54592978     Cs
1.166047454   4.134217904     14.2513019      Cs
3.498142362   5.906872107     2.946852294     Cs
3.498142362   0.886327027     5.652225187     Cs
3.498142362   8.406480615     16.12099922     Pb
1.166047454   1.634609097     1.077154843     Pb
1.166047454   6.655154402     7.52192251      Pb
3.498142362   3.385935909     9.676232452     Pb
1.166047454   5.279474553     10.51919974     Br
3.498142362   2.003498745     12.21039714     Br
1.166047454   6.700730441     17.18995066     Br
1.166047454   1.680185585     8.607281019     Br
3.498142362   8.360904577     8.590873943     Br
3.498142362   9.782160465     1.920122391     Br
1.166047454   3.017046261     3.611320171     Br
3.498142362   7.024043751     13.58683454     Br
1.166047454   0.258929584     15.27803193     Br
3.498142362   4.761615459     6.678954706     Br
3.498142362   3.340359272     0.00820352      Br
1.166047454   8.037591267     4.98775731      Br

--------------------------------------------------
Note that the 4th column specifying the atoms are not necessary, and are only shown for easy understanding of which coordinate is for which atom.
In reality, coordinates are read according to these two lines:
  Cs   Pb   Br
   4    4   12
So the first 4 coordinates are read for Cs, next 4 are for Pb and the last 12 are for Br, irrespective of what is written in the fourth column!

File_3. Details on POTCAR:

VASP POTCAR files are proprietary, so one can not post them online!
If your system contains Cs, Pb, and Br ions for example, and you want to generate the POTCAR file for your calculation,
simply concatenate the POTCAR files of the individual ions to generate the final POTCAR file (in the order they appear in POSCAR, of course):

cat ~/pot/Cs/POTCAR ~/pot/Pb/POTCAR ~/pot/Br/POTCAR > POTCAR

Here "~/pot/" is the actual path where VASP PAW potentials are stored in your computing facility!

File_4. Sample KPOINTS:

Automatic mesh
0              ! number of k-points = 0 -> automatic generation scheme
G              ! G = Gamma-centered grid; M = Monkhorst-Pack grid
4  4  4        ! subdivisions N_1, N_2 and N_3 along recipr. latt. vectors
0. 0. 0.       ! optional shift of the mesh (s_1, s_2, s_3)

File_4x. KPOINTS: Some post processing tools may dislike the commenting in KPOINTS file. Hence:

Automatic mesh
0
Gamma
4  4  4
0. 0. 0.

-------------------

Automatic mesh
0
Monkhorst-pack
4  4  4
0. 0. 0.

Here is an example script that runs VASP job on MPCDF Cluster RAVEN:

#!/bin/bash -l
#
#SBATCH -J vasp_script_raven
#SBATCH --output=vasp_script_raven.o
#SBATCH --error=vasp_script_raven.e
#
#SBATCH --partition=medium
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=72
#SBATCH --mem=230000
#
# Allocated time
#SBATCH --time=24:00:00

ulimit -s unlimited

# Load the module files
#-------------------------------
module purge
module load intel/21.2.0 impi/2021.2 vasp/6.1.1

export VASP_HOME=/mpcdf/soft/SLE_15/packages/skylake/vasp/intel_21.2.0-2021.2.0-impi_2021.2-2021.2.0/6.1.1
export PATH=$VASP_HOME/bin:$PATH

# Define name of the job and working directory (current folder)
#--------------------------------------------------------------
job=$SLURM_JOB_NAME
workdir=$SLURM_SUBMIT_DIR

# Define TMP directory and JOB directory
# -----------------------------------------
TMPDIR=/ptmp/$USER
mkdir $TMPDIR/$SLURM_JOB_ID
JOBDIR=$TMPDIR/$SLURM_JOB_ID

# Write job run details at the begining of output
#------------------------------------------------------------
echo "TEMP Job directory is: ${JOBDIR}" >> $workdir/$job.o
echo "PWD is: ${workdir}" >> $workdir/$job.o
echo "Slurm Job ID is: ${SLURM_JOB_ID}" >>  $workdir/$job.o
echo " " >> $workdir/$job.o
echo "----------Output from VASP starts now----------" >> $workdir/$job.o
echo " " >> $workdir/$job.o

# Copy required files to JOBDIR
#------------------------------------------------------------
cp $workdir/*CAR      $JOBDIR
cp $workdir/KPOINTS   $JOBDIR

cd $JOBDIR

# Gamma-Point only calculation
#------------------------------------------------------------
#srun vasp_gam

# Running Standard VASP binary
#------------------------------------------------------------
srun vasp_std

# Copy required files back to working directory and then delete JOBDIR
#---------------------------------------------------------------------
cp  **  $workdir
rm -r $JOBDIR

joberror=$?
exit $joberror