Skip to content

VASP Workflow

Lin Ziyue

1. Preparing Files

1.1 Pseudopotential POTCAR

POTCAR is generally located in the VASP installation directory on the server (e.g., 6001-ddf6/vasppp). It's recommended to use PBE pseudopotentials. Taking F as an example:

  • F Standard pseudopotential
  • F_s Soft pseudopotential
  • F_h Hard pseudopotential
  • sv / pv Indicate different numbers of valence electrons

Example of merging pseudopotentials (for W₄S₈, only need to merge W and S):

cat POTCAR-W POTCAR-S > POTCAR

Note: The final filename must be POTCAR.

1.2 Structure File POSCAR

  1. Import .cell file into VESTA → Export as VASP format and rename to POSCAR.
  2. It's recommended to first use MS to add symmetry and reduce cell parameters:
  3. Build → Symmetry → Primitive Cell
  4. If the cell becomes larger after adding symmetry, first add symmetry then convert to primitive cell.

2. Generating KPOINTS

Copy a.out createKpoints prodKpts.f90 into the same directory as POSCAR:

chmod +x a.out
./a.out      # Generate KPOINTS

3. Structure Optimization

3.1 Required Files

  • vasp.pbs
  • POSCAR
  • POTCAR

3.2 vasp.pbs Script

#!/bin/bash
#PBS -q CT1
#PBS -l nodes=1:ppn=12
#PBS -j oe
#PBS -V
#PBS -N VASP-opt

cd "$PBS_O_WORKDIR"

for i in 30000    # Pressure (kbar), can write "1000 2000 3000 …" for multiple points
do
cat > INCAR << EOF
PSTRESS = $i
ISTART  = 0
ICHARG  = 2
IBRION  = 2
NSW     = 300
POTIM   = 0.1
NELM    = 60
EDIFF   = 1E-7
EDIFFG  = -0.005
ISMEAR  = 1
SIGMA   = 0.2
ISIF    = 3
ENCUT   = 550
PREC    = Accurate
LWAVE   = .FALSE.
LCHARG  = .TRUE.
NPAR    = 4
LORBIT  = 11
GGA     = PE
EOF

echo "pressure = $i kbar"

# ① Generate KPOINTS directly in script
/public/home/YHY/lzy/Vasp/Gen_kpoints/a.out

# ② If KPOINTS is manually generated, can delete the above line

mpirun -np 12 /share/apps/compiler/VASP-5.3/vasp > log 2>&1

tail -1 OSZICAR                                         >> SUMMARY.dia
grep ' enthalpy is TOTEN' OUTCAR | tail -1              >> zToten.dia
grep 'volume of cell' OUTCAR    | tail -1              >> zVolum.dia
grep 'reached required accuracy - stopping' OUTCAR      >> zWork.dia

cp OUTCAR   outcar_$i
cp OSZICAR  oszicar_$i
cp CONTCAR  CONTCAR_$i
cp KPOINTS  KPOINTS_$i
cp CONTCAR  POSCAR           # Overwrite as starting structure for next round
done

cat SUMMARY.dia zToten.dia zVolum.dia zWork.dia

3.3 Output

After the loop ends, POSCAR in the current directory is the optimized structure.

4. Static Self-Consistent Calculation (SCF)

4.1 INCAR

1
2
3
4
5
6
7
SYSTEM = CoH
PREC   = Accurate
ENCUT  = 700
EDIFF  = 1E-5
ISTART = 0
ISMEAR = 1
SIGMA  = 0.2

4.2 Script Example

#!/bin/bash
#PBS -q CT1
#PBS -l nodes=1:ppn=12
#PBS -j oe
#PBS -V
#PBS -N VASP-scf

cd "$PBS_O_WORKDIR"

for i in 30000      # Pressure (kbar)
do
cat > INCAR << EOF
SYSTEM = F
PREC   = Accurate
ENCUT  = 550
EDIFF  = 1E-5
ISTART = 0
ISMEAR = 1
SIGMA  = 0.2
EOF

/public/home/YHY/lzy/Vasp/Gen_kpoints/a.out
mpirun -np 12 /share/apps/compiler/VASP-5.3/vasp > log 2>&1
done

After completion, use

grep "E-fermi" OUTCAR

to record the Fermi level for subsequent band/DOS calculations.

5. Non-Self-Consistent Calculation — Band Structure

5.1 INCAR

1
2
3
4
5
6
7
8
9
SYSTEM  = CoH
PREC    = Accurate
ENCUT   = 700
ISTART  = 1
ICHARG  = 11
ISMEAR  = 1      # Change to 0 for semiconductor/insulator, SIGMA=0.05
SIGMA   = 0.2
LWAVE   = .FALSE.
NBANDS  = 8      # Increase as needed

5.2 syml File Example

5
20 20 20 20
X 0.500 0.000 0.000
R 0.500 0.500 0.500
M 0.500 0.500 0.000
G 0.000 0.000 0.000
R 0.500 0.500 0.500
# Reciprocal/inverse lattice basis vectors
0.000000000 1.840208159 1.840208159 0.271708392 0.271708392 0.271708392
1.840208159 0.000000000 1.840208159 0.271708392 -0.271708392 0.271708392
1.840208159 1.840208159 0.000000000 0.271708392 0.271708392 -0.271708392
-20 50
5.9036      # Fermi energy

5.3 Generate High-Symmetry Line KPOINTS

Execute in Genq_points directory

chmod +x a.out
./a.out      # Output inp.kpt

Then manually format into VASP KPOINTS, example:

1
2
3
4
5
6
7
k-points along high symmetry lines
141
Reciprocal
0.000000 0.000000 0.000000 1.00
0.000000 0.000000 0.025000 1.00
...
-0.333000 0.667000 0.000000 1.00

5.4 Run Script

#!/bin/bash
#PBS -q CT1
#PBS -l nodes=1:ppn=12
#PBS -j oe
#PBS -V
#PBS -N VASP-band

cd "$PBS_O_WORKDIR"
export PW_ROOT=/share/apps/compiler/VASP-5.3
mpirun -np 12 $PW_ROOT/vasp > log

After completion, run ./a.out to generate bnd.dat, plot with Origin.

Tip: If you see WARNING: small aliasing (wrap around) errors must be expected Please increase ENCUT to 700–800 eV.

6. Non-Self-Consistent Calculation — Density of States (DOS)

6.1 INCAR

SYSTEM = CoH
PREC   = Accurate
ENCUT  = 700
ISTART = 1
ICHARG = 11
ISMEAR = -5
LORBIT = 11
LWAVE  = .TRUE.
ALGO   = Fast
EDIFF  = 1E-5
NEDOS  = 3001

Other script same as 5.4. After completion, run ./a.out or ./split.sh to generate DOS_*.

7. Bader Charge Analysis

7.1 INCAR

SYSTEM = CoH
PREC   = Accurate
ENCUT  = 700
EDIFF  = 1E-5
ISTART = 0
ICHARG = 2
ISMEAR = 1
SIGMA  = 0.2
LWAVE  = .FALSE.
NGXF   = 192   # Corresponding OUTCAR value ×4
NGYF   = 192
NGZF   = 192
LAECHG = .TRUE.

7.2 Analysis Procedure

1
2
3
4
chmod +x bader chgsum.pl
./chgsum.pl AECCAR0 AECCAR2
./bader CHGCAR -ref CHGCAR_sum
vi ACF.dat       # View charge gain/loss

8. Electron Localization Function (ELF)

8.1 INCAR

SYSTEM = CoH
PREC   = Accurate
ENCUT  = 700
EDIFF  = 1E-6
ISMEAR = 1
SIGMA  = 0.2
LWAVE  = .FALSE.
LCHARG = .TRUE.
LELF   = .TRUE.
NGX    = 48
NGY    = 48
NGZ    = 48
NPAR   = 4

After calculation, obtain ELFCAR, add element name and use VESTA: Utilities → 2D Data Display → Slice (Max 1 / Min 0).

9. Phonopy Phonon Spectrum & DOS

9.1 INPHON-in

1
2
3
4
ATOM_NAME = F
DIM       = 1 1 1
PM        = .TRUE.
DIAG      = .FALSE.

9.2 INPHON-band

1
2
3
4
5
6
7
8
9
ATOM_NAME       = F
DIM             = 1 1 1
PM              = .TRUE.
DIAG            = .FALSE.
ND              = 4
FORCE_CONSTANTS = WRITE
NPOINTS         = 51
BAND = 0.500 0.000 0.000  0.500 0.500 0.500  0.500 0.500 0.000 \
       0.000 0.000 0.000  0.500 0.500 0.500

9.3 INPHON-dos

1
2
3
4
5
6
7
8
9
ATOM_NAME       = F
DIM             = 1 1 1
PM              = .TRUE.
DIAG            = .FALSE.
DOS_RANGE       = -20 90 0.1
FORCE_CONSTANTS = WRITE
MP              = 9 9 9
SIGMA           = 0.5
#PDOS = 1 2 3 4 5

9.4 Calculation Steps

phonopy --symmetry --tolerance=0.01 | head   # Check symmetry
phonopy -d INPHON-in                         # Generate displaced supercells POSCAR-***

Then use the following script to calculate forces for each supercell:

#!/bin/bash
#PBS -q CT1
#PBS -l nodes=1:ppn=12
#PBS -j oe
#PBS -V
#PBS -N VASP-phonon

cd "$PBS_O_WORKDIR"

for i in 001 002 003 004 005 006
do
  cp POSCAR-$i POSCAR
  cat > INCAR << EOF
SYSTEM = Phon
ISTART = 0
ICHARG = 2
INIWAV = 1
NELMIN = 2
EDIFF  = 1E-5
EDIFFG = -0.005
NSW    = 0
IBRION = 8
ISMEAR = 0
SIGMA  = 0.05
ADDGRID= .TRUE.
ENCUT  = 550
PREC   = Accurate
IALGO  = 38
LREAL  = .FALSE.
LWAVE  = .FALSE.
LCHARG = .FALSE.
NPAR   = 4
EOF
  mpirun -np 12 /share/apps/compiler/VASP-5.3/vasp > log
  cp vasprun.xml vasprun.xml-$i
done

Merge force constants and plot:

1
2
3
4
phonopy -f vasprun.xml-00*
phonopy INPHON-band
phonopy-bandplot --gnuplot band.yaml > band.dat
phonopy --dos INPHON-dos            # total_dos.dat

10. COHP (LOBSTER)

10.1 INCAR

PREC   = Accurate
ENCUT  = 900
EDIFF  = 1E-7
EDIFFG = -1E-6
ISMEAR = -5
LREAL  = .FALSE.
NSW    = 0
ISIF   = 0
ISYM   = -1
NBANDS = 58
NPAR   = 4
NEDOS  = 801
LORBIT = 12

10.2 lobsterin Example

1
2
3
4
5
COHPstartEnergy  -30
COHPendEnergy     30
basisSet          Bunge
includeOrbitals   spd
cohpGenerator     from 1.886 to 1.887 type F type Rb

10.3 Execution

chmod +x lobster
./lobster

Results:

  • COHPCAR.lobster Column 1: energy, columns 2–7: average/integrated and individual neighbor COHP values
  • ICOHPLIST.lobster Provides ICOHP values for each bond