Jump to content

Requests for technical support from the VASP team should be posted in the VASP Forum.

Restarting finite differences calculations: Difference between revisions

From VASP Wiki
Csheldon (talk | contribs)
No edit summary
 
(62 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Available|6.6.0}}
It is possible to restart [[phonons from finite differences|finite difference calculations]] using {{TAG|IBRION|6}} and {{TAG|CHECKPOINT_FD}}. The displacements are written to a {{FILE|vaspcheckfd.h5}} file. For details of a general finite difference calculation, see the [[phonons from finite differences]]. Here, we will concern ourselves with restarting and splitting finite difference calculations.  
Since VASP 6.6.0, it has been possible to restart finite difference calculations using {{TAG|IBRION|6}} and {{TAG|CHECKPOINT}}. The displacements are written to a {{FILE|vaspcheck.h5}} file. For details of a general finite difference calculation, see the [[phonons from finite differences]] HowTo. In this HowTo, we will concern ourselves with restarting and splitting finite difference calculations.  
{{NB|mind|This can only be done using {{TAG|IBRION|6}}. We recommend using this generally over {{TAG|IBRION|5}}.}}
{{NB|important|This can only be done using {{TAG|IBRION|6}} currently. We recommend using this generally over {{TAG|IBRION|5}}.}}
There are several options for the {{TAG|CHECKPOINT_FD}} tag. The default is {{TAG|CHECKPOINT_FD|RESET}}, which creates a new {{FILE|vaspcheckfd.h5}} file and updates the file during the calculation after each displacement. {{TAG|CHECKPOINT_FD|CONTINUE}} continues from the last completed displacement and {{TAG|CHECKPOINT_FD|PREPARE}} creates the displacements and stops after the electronic minimization for the equilibrium structure. {{TAG|CHECKPOINT_FD|SINGLE}} is used to run individual displacements.


== Input ==
We will describe the restart procedure and splitting a calculation below. As an example, we take a 3x3x1 graphene supercell {{FILE|POSCAR}} file from the [https://www.vasp.at/tutorials/latest/phonon/part1/#phonon-e02 phonon tutorials].


There are several options for the {{TAG|CHECKPOINT}} tag:
<div class="toccolours mw-customtoggle-script">'''Click to see POSCAR and INCAR'''</div>
*{{TAG|CHECKPOINT|LEGACY}} - finite difference calculation are performed as those in VASP 6.5.1. No {{FILE|vaspcheck.h5}} is written.
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-script">
*{{TAG|CHECKPOINT|RESET}} ''(default)'' - The {{FILE|vaspcheck.h5}} file is overwritten or created, and the displacements are written to it.
*{{TAG|CHECKPOINT|CONTINUE}} - used for restarting a finite differences calculation from a {{FILE|vaspcheck.h5}} file.
*{{TAG|CHECKPOINT|PREPARE}} - used for splitting a finite differences calculation.
*{{TAG|CHECKPOINT|SINGLE}} - used for running a single displacement after splitting with {{TAG|CHECKPOINT|PREPARE}}.


We will describe the restart procedure and splitting a calculation below. As an example, we take a 3x3x1 graphene supercell {{FILE|POSCAR}} file from the [https://www.vasp.at/tutorials/latest/phonon/part1/#phonon-e02 phonon tutorials]:
<pre>
 
<syntaxhighlight lang="bash">
C18
C18
1.0
1.0
Line 41: Line 35:
   0.8888888888888866    0.4444444444444466    0.0000000000000000 C
   0.8888888888888866    0.4444444444444466    0.0000000000000000 C
   0.8888888888888866    0.7777777777777799    0.0000000000000000 C
   0.8888888888888866    0.7777777777777799    0.0000000000000000 C
</syntaxhighlight>
</pre>
 
along with a 4x4x1 '''k'''-mesh in our {{FILE|KPOINTS}} file:
 
<pre>
K points
0
Gamma
4  4  1
0  0  0
</pre>
 
and <code>PAW C_s 04May1998</code> {{FILE|POTCAR}}.
 
The following {{FILE|INCAR}} file with modifications will be used thoughout:
 
{{TAGBL|SYSTEM}} = graphene
{{TAGBL|ENCUT}} = 400
# electronic
{{TAGBL|PREC}} = Accurate
{{TAGBL|NELMIN}} = 5
{{TAGBL|EDIFF}} = 1e-8
{{TAGBL|ISMEAR}} = -1
{{TAGBL|SIGMA}} = 0.2
{{TAGBL|LREAL}} = .FALSE.
{{TAGBL|LWAVE}} = .FALSE.
{{TAGBL|LCHARG}} = .FALSE.
# ionic (finite differences)
{{TAGBL|IBRION}} = 6
{{TAGBL|POTIM}} = 0.015
</div>
== Restarting a finite difference calculation ==
 
The calculation failed after a certain point or has accidentally been cancelled:
 
DAV:  9    -0.181350430125E+03  -0.25600E-06  -0.38452E-08  848  0.118E-03    0.774E-04
DAV:  10    -0.181350430581E+03  -0.45554E-06  -0.20686E-08  864  0.738E-04    0.208E-04
DAV:  11    -0.181350430676E+03  -0.94857E-07  -0.22346E-09  704  0.354E-04    0.207E-04
srun: Job step aborted: Waiting up to 32 seconds for job step to finish.
slurmstepd-test01: error: *** JOB 254054 ON test01 CANCELLED AT 2026-01-19T16:25:49 ***
slurmstepd-test01: error: *** STEP 254054.0 ON test01 CANCELLED AT 2026-01-19T16:25:49 ***
 
In the directory, you will see the {{FILE|vaspcheckfd.h5}} file. It contains the displacement calculations that have been completed up to the point of the crash:
 
h5ls vaspcheckfd.h5
data-1                  Group
displacements            Group
symmetry                Group
 
Restart the calculation by adding {{TAG|CHECKPOINT_FD|CONTINUE}} to the {{FILE|INCAR}}:
 
{{TAGBL|SYSTEM}} = graphene
{{TAGBL|ENCUT}} = 400
# electronic
{{TAGBL|PREC}} = Accurate
{{TAGBL|NELMIN}} = 5
{{TAGBL|EDIFF}} = 1e-8
{{TAGBL|ISMEAR}} = -1
{{TAGBL|SIGMA}} = 0.2
{{TAGBL|LREAL}} = .FALSE.
{{TAGBL|LWAVE}} = .FALSE.
{{TAGBL|LCHARG}} = .FALSE.
# ionic (finite differences)
{{TAGBL|IBRION}} = 6
{{TAGBL|POTIM}} = 0.015
{{TAGBL|CHECKPOINT_FD}} = CONTINUE
 
and resubmit your calculation in the directory. The finite differences calculation will continue after an SCF step has been done and the ''stdout'' reads
 
Continuing from previous run
 
The calculation finishes as normal when all displacements have been completed and the phonon modes calculated:
 
h5ls vaspcheckfd.h5
data-1                  Group
data-2                  Group
data-3                  Group
data-4                  Group
displacements            Group
symmetry                Group
 
== Splitting a finite difference calculation ==


The selective dynamics mode of the {{FILE|POSCAR}} file is presently only supported for {{TAG|IBRION}}=5; in this case, only those components of the Hessian matrix are calculated for which the selective dynamics tags are set to .TRUE. in the {{FILE|POSCAR}} file.
For large structures, it may be easier to split the displacements into separate calculations. This is done in three steps:
{{NB|important|The selective dynamics always refer to the Cartesian components of the Hessian matrix, contrary to the behavior during ionic relaxation.}} For the following {{FILE|POSCAR}} file, for instance,


Cubic BN
# Preparing the separate displacements - {{TAG|CHECKPOINT_FD|PREPARE}}
    3.57
# Single displacement calculations - {{TAG|CHECKPOINT_FD|SINGLE}}
  0.0 0.5 0.5
# Collected finite differences - {{TAG|CHECKPOINT_FD|CONTINUE}}
  0.5 0.0 0.5
  0.5 0.5 0.0
    1 1
selective
Direct
  0.00 0.00 0.00  F F F
  0.25 0.25 0.25  T F F


atom 2 is displaced in the ''x''-direction only, and only the ''x''-component of the second atom of the Hessian matrix is calculated.
=== 1. Preparing the displacements ===
The displacements can be prepared using the {{TAG|CHECKPOINT_FD|PREPARE}} tag:


If {{TAG|LEPSILON}}=.TRUE. or {{TAG|LCALCEPS}}=.TRUE., additional dielectric properties are computed.
{{TAGBL|SYSTEM}} = graphene
{{TAGBL|ENCUT}} = 400
# electronic
{{TAGBL|PREC}} = Accurate
{{TAGBL|NELMIN}} = 5
{{TAGBL|EDIFF}} = 1e-8
{{TAGBL|ISMEAR}} = -1
{{TAGBL|SIGMA}} = 0.2
{{TAGBL|LREAL}} = .FALSE.
{{TAGBL|LWAVE}} = .FALSE.
# ionic (finite differences)
{{TAGBL|IBRION}} = 6
{{TAGBL|POTIM}} = 0.015
{{TAGBL|CHECKPOINT_FD}} = PREPARE


== Output ==
This creates {{FILE|CONTCAR_disp-N}} files containing each of the displacements in the parent directory and you can see the following in the '''stdout''':


The phonon modes and frequencies are written to the {{TAG|OUTCAR}} file after the following lines:
Creating CONTCAR files for finite difference displacements
  Eigenvectors and eigenvalues of the dynamical matrix
  ----------------------------------------------------


The following lines are repeated for each normal mode and should look like the following example output:
and in the {{FILE|vaspcheckfd.h5}} file:
    1 f  =  14.329944 THz    90.037693 2PiTHz  477.995462 cm-1    59.263905 meV
              X        Y        Z          dx          dy          dz
      0.000000  0.000000  0.000000    0.009046  -0.082007  -0.006117
      0.000000  2.731250  2.731250    0.009046    0.106244    0.006563
      0.000000  5.462500  5.462500    0.009046    0.082007    0.006117
      0.000000  8.193750  8.193750    0.009046  -0.106244  -0.006563
      ...
    2 f  =  14.329944 THz    90.037693 2PiTHz  477.995462 cm-1    59.263905 meV
              X        Y        Z          dx          dy          dz
      0.000000  0.000000  0.000000    0.003458    0.021825  -0.093181
      0.000000  2.731250  2.731250    0.003458    0.005416    0.094689
      0.000000  5.462500  5.462500    0.003458  -0.021825    0.093181
      0.000000  8.193750  8.193750    0.003458  -0.005416  -0.094689
      ...
    ...
The first number is the label of the normal mode. If this number is followed by ''f'' it is a purely real mode, stating the mode is vibrationally stable. Otherwise, if it is followed by ''f/i'', the mode is an imaginary mode ("soft mode"). These labels are followed by the eigenfrequency of the mode in different units.


The following table labeled by (''x,y,z,dx,dy,dz'') contains the Cartesian positions of the atoms and the normalized eigenvectors of the eigenmodes in Cartesian coordinates.  
h5ls vaspcheckfd.h5
metadata                Group
subdir_prefix            Dataset {SCALAR}
total_count              Dataset {SCALAR}


There should be 3<math>N</math> normal modes, where <math>N</math> is the number of atoms in the supercell ({{TAG|POSCAR}}). The modes are ordered in descending order with respect to the eigenfrequency. The last three modes are the translational modes (they are usually disregarded).
=== 2. Single displacement calculations ===
Create directories '''disp-N''' for each of the {{FILE|CONTCAR_disp-N}} file and run the calculations separately. To this end, copy all restart files in the subdirectory, rename {{FILE|CONTCAR_disp-N}} to {{FILE|POSCAR}}, set {{TAG|CHECKPOINT_FD|SINGLE}} in the {{FILE|INCAR}} file and run the calculation:


Finally, {{TAG|IBRION}}=6 and {{TAG|ISIF}}&ge;3 allows to calculate the elastic constants. The elastic tensor is determined by performing six finite distortions of the lattice and deriving the elastic constants from the strain-stress relationship.{{cite|lepage:prb:2002}} The elastic tensor is calculated both, for 'clamped' ions, as well, as allowing for relaxation of the ions. The elastic moduli for rigid ions are written after the line
<syntaxhighlight lang="bash">
max=$(printf "%s\n" CONTCAR_disp-* | sed 's/.*-//' | sort -n | tail -1)


SYMMETRIZED ELASTIC MODULI (kBar)
for i in $(seq 1 $max); do
  mkdir -p disp-$i
  cp CONTCAR_disp-$i disp-$i/POSCAR
  cp INCAR POTCAR KPOINTS vasp.run disp-$i/
  sed -i 's/PREPARE/SINGLE/g' disp-$i/INCAR
  echo """
NCORE = 4
ICHARG = 1
LCHARG = F
""" >> disp-$i/INCAR
  ln -s ../CHGCAR disp-$i/CHGCAR
done
</syntaxhighlight>


The ionic contributions are determined by inverting the ionic Hessian matrix and multiplying with the internal strain tensor,{{cite|wu:prb:2005}} and the corresponding contributions are written after the lines:
Each {{FILE|INCAR}} file in the directories will then look like:  


  ELASTIC MODULI CONTR FROM IONIC RELAXATION (kBar)
  {{TAGBL|SYSTEM}} = graphene
{{TAGBL|ENCUT}} = 400
# electronic
{{TAGBL|PREC}} = Accurate
{{TAGBL|NELMIN}} = 5
{{TAGBL|EDIFF}} = 1e-8
{{TAGBL|ISMEAR}} = -1
{{TAGBL|SIGMA}} = 0.2
{{TAGBL|LREAL}} = .FALSE.
{{TAGBL|LWAVE}} = .FALSE.
# ionic (finite differences)
{{TAGBL|IBRION}} = 6
{{TAGBL|POTIM}} = 0.015
{{TAGBL|CHECKPOINT_FD}} = SINGLE
{{TAGBL|NCORE}} = 4
{{TAGBL|ICHARG}} = 1
{{TAGBL|LCHARG}} = F
{{NB|important|You can set different {{TAG|NCORE}} settings in these calculations, offering parallelization that is not otherwise possible for finite differences.}}
{{NB|tip|It is optional to restart from {{FILE|WAVECAR}} or {{FILE|CHGCAR}} files.}}
In each subdirectory, you can see that a single displacement has been recorded in the '''stdout''':


The final elastic moduli, including both, the contributions for distortions with rigid ions and the contributions from the ionic relaxations, are summarized at the very end:
Computing single independent displacement for finite differences


TOTAL ELASTIC MODULI (kBar)
and to the {{FILE|vaspcheckfd.h5}} file:


There are a few caveats to this approach: most notably, the plane-wave cutoff ({{TAG|ENCUT}}) needs to be sufficiently large to converge the stress tensor. This is usually only achieved if the default cutoff is increased by roughly 30%, but it is strongly recommended to increase the cutoff systematically, (e.g., in steps of 15%), until full convergence is achieved.
h5ls vaspcheckfd.h5
 
data-1                  Group


== Practical hints ==
=== 3. Collected finite differences ===
Return to the parent directory and combine these separate displacements into one finite difference calculation using the {{TAG|CHECKPOINT_FD|CONTINUE}} tag:


The computation of the second-order force constants requires accurate [[:Category:Forces|forces]].
{{TAGBL|SYSTEM}} = graphene
Therefore, the tag {{TAG|PREC}}=Accurate is recommended in the {{FILE|INCAR}}.
{{TAGBL|ENCUT}} = 400
The {{TAG|ADDGRID}}=TRUE should '''not''' be set without careful testing.
# electronic
{{TAGBL|PREC}} = Accurate
{{TAGBL|NELMIN}} = 5
{{TAGBL|EDIFF}} = 1e-8
{{TAGBL|ISMEAR}} = -1
{{TAGBL|SIGMA}} = 0.2
{{TAGBL|LREAL}} = .FALSE.
{{TAGBL|LWAVE}} = .FALSE.
{{TAGBL|LCHARG}} = .FALSE.
# ionic (finite differences)
{{TAGBL|IBRION}} = 6
{{TAGBL|POTIM}} = 0.015
{{TAGBL|CHECKPOINT_FD}} = CONTINUE
{{NB|warning|It is possible to combine the finite difference calculations in a different directory but you must include the {{FILE|vaspcheckfd.h5}} from the '''prepare''' step (as it contains the name of the subdirectories as metadata) and the subdirectories including the corresponding {{FILE|vaspcheckfd.h5}}.}}
Running this calculation, you can see that each of the '''single''' displacements are combined into one calculation in the ''stdout'':


A practical way to check for convergence is to monitor the Γ point ('''q'''=0) optical mode frequencies while varying the {{TAG|ENCUT}}, {{TAG|PREC}}, and '''k''' point density ({{FILE|KPOINTS}}). Additionally, compare the result to [[Phonons from density-functional-perturbation theory|phonons from density-functional-perturbation theory (DFPT)]].
  Combining displacements from subdirectories


To get the phonon frequencies quickly on the command line, simply type the following:
and {{FILE|vaspcheckfd.h5}} file:
grep THz OUTCAR


To get an accurate phonon dispersion, perform the force-constants calculation in a large enough supercell.
h5ls vaspcheckfd.h5
When increasing the size of the supercell, we recommend decreasing the '''k'''-point density in the {{FILE|KPOINTS}} file to yield the same resolution.
For example, for the primitive cell of silicon, a 12x12x12 Gamma-centered '''k'''-point mesh is needed to obtain accurate phonon frequencies at the Gamma point. When replicating the unit cell to a 2x2x2 supercell, a 6x6x6 '''k''' point mesh will produce an equivalent sampling. For a 4x4x4 supercell, a 3x3x3 '''k''' point mesh will suffice.
metadata                Group
subdir_prefix            Dataset {SCALAR}
total_count              Dataset {SCALAR}


It is possible to use phonopy{{cite|phonopy}} to post-process the results of a finite differences calculation done with VASP.{{cite|phonopy_dfpt}}
The information about the computed phonon modes is written to ''stdout'' and {{FILE|OUTCAR}} file below <code>Eigenvectors and eigenvalues of the dynamical matrix</code> in the same way as in [[phonons from finite differences]].
{{NB|tip|In contrast to [[Phonons from density-functional-perturbation theory|computing phonons within DFPT]], the finite difference approach can be used in combination with any [[Exchange-correlation functional]].}}
{{TAG|IBRION}}{{=}}5, is available as of VASP.4.5, {{TAG|IBRION}}{{=}}6 starting from VASP.5.1.
In some older versions (pre VASP.5.1), {{TAG|NSW}} (number of ionic steps) must be set to 1 in the {{FILE|INCAR}} file, since {{TAG|NSW}}{{=}}0 sets the {{TAG|IBRION}}{{=}}&minus;1 regardless of the value supplied in the {{FILE|INCAR}} file.
Although VASP.4.6 supports {{TAG|IBRION}}{{=}}5-6, VASP.4.6 does not change the set of '''k''' points automatically (often the displaced configurations require a different '''k'''-point grid). Hence, the finite difference routine might yield incorrect results in VASP.4.6.


== Related tags and sections ==
== Practical hints ==
{{TAG|IBRION}},
* The phonon frequencies will differ slightly between one run and the split calculation, on the order of the 4th or 5th significant figure. We do not expect this to be significant.
{{TAG|ISIF}},
* You can use this method for any [[:Category:electron-phonon interactions | electron-phonon]] calculations.
{{TAG|POTIM}},
* You can set different {{TAG|NCORE}} settings in these calculations, offering parallelization that is not otherwise available for finite differences.
* Make sure to check that you are using the correct {{FILE|vaspcheckfd.h5}} file with each calculation, particularly the split calculation. If data is read from an inappropriate {{FILE|vaspcheckfd.h5}} file, you will see it with the following warning:


[[Phonons: Theory]]
  -----------------------------------------------------------------------------
|                                                                            |
|    EEEEEEE  RRRRRR  RRRRRR  OOOOOOO  RRRRRR      ###    ###    ###    |
|    E        R    R  R    R  O    O  R    R    ###    ###    ###    |
|    E        R    R  R    R  O    O  R    R    ###    ###    ###    |
|    EEEEE    RRRRRR  RRRRRR  O    O  RRRRRR      #      #      #      |
|    E        R  R    R  R    O    O  R  R                              |
|    E        R    R  R    R  O    O  R    R      ###    ###    ###    |
|    EEEEEEE  R    R  R    R  OOOOOOO  R    R    ###    ###    ###    |
|                                                                            |
|    Checkpoint file vaspcheckfd.h5 is incompatible: NIONS mismatch          |
|    (file=54, current=128). Ensure that your calculational settings are    |
|    identical between runs. In particular, check POSCAR, KPOINTS,          |
|    POTCAR, and INCAR files.                                                |
|                                                                            |
|      ---->  I REFUSE TO CONTINUE WITH THIS SICK JOB ... BYE!!! <----      |
|                                                                            |
  -----------------------------------------------------------------------------
* We recommend using the {{FILE|CHGCAR}} file from the parent directory of the split calculation for the individual displacements to speed up the calculation. Link this with <code>ln -s ../CHGCAR</code>, set {{TAG|LCHARG|.FALSE.}} so that the original charge density is not overwritten. Also set {{TAG|ICHARG|1}} so that the charge density is used, rather than starting from scratch.


[[Phonons from density-functional-perturbation theory]], [[Computing the phonon dispersion and DOS]]
== Related tags and sections ==
{{TAG|CHECKPOINT_FD}},
{{FILE|vaspcheckfd.h5}},
{{TAG|IBRION}},
{{FILE|CONTCAR_disp-N}}


== References==
[[Phonons from finite differences]]
<references/>


[[Category:Phonons]][[Category:Howto]]
[[Category:Phonons]][[Category:Howto]]

Latest revision as of 11:33, 16 March 2026

It is possible to restart finite difference calculations using IBRION = 6 and CHECKPOINT_FD. The displacements are written to a vaspcheckfd.h5 file. For details of a general finite difference calculation, see the phonons from finite differences. Here, we will concern ourselves with restarting and splitting finite difference calculations.

There are several options for the CHECKPOINT_FD tag. The default is CHECKPOINT_FD = RESET, which creates a new vaspcheckfd.h5 file and updates the file during the calculation after each displacement. CHECKPOINT_FD = CONTINUE continues from the last completed displacement and CHECKPOINT_FD = PREPARE creates the displacements and stops after the electronic minimization for the equilibrium structure. CHECKPOINT_FD = SINGLE is used to run individual displacements.

We will describe the restart procedure and splitting a calculation below. As an example, we take a 3x3x1 graphene supercell POSCAR file from the phonon tutorials.

Click to see POSCAR and INCAR
C18
1.0
   7.3521657209830806    0.0000000000000000    0.0000000000000000
  -3.6760828604915403    6.3671622872044793    0.0000000000000000
   0.0000000000000000    0.0000000000000000    8.0000000000000000
C
18
direct
   0.1111111111111133    0.2222222222222200    0.0000000000000000 C
   0.1111111111111133    0.5555555555555532    0.0000000000000000 C
   0.1111111111111133    0.8888888888888866    0.0000000000000000 C
   0.4444444444444466    0.2222222222222200    0.0000000000000000 C
   0.4444444444444466    0.5555555555555532    0.0000000000000000 C
   0.4444444444444466    0.8888888888888866    0.0000000000000000 C
   0.7777777777777801    0.2222222222222200    0.0000000000000000 C
   0.7777777777777799    0.5555555555555532    0.0000000000000000 C
   0.7777777777777799    0.8888888888888866    0.0000000000000000 C
   0.2222222222222200    0.1111111111111133    0.0000000000000000 C
   0.2222222222222200    0.4444444444444466    0.0000000000000000 C
   0.2222222222222199    0.7777777777777799    0.0000000000000000 C
   0.5555555555555532    0.1111111111111133    0.0000000000000000 C
   0.5555555555555534    0.4444444444444466    0.0000000000000000 C
   0.5555555555555532    0.7777777777777799    0.0000000000000000 C
   0.8888888888888866    0.1111111111111133    0.0000000000000000 C
   0.8888888888888866    0.4444444444444466    0.0000000000000000 C
   0.8888888888888866    0.7777777777777799    0.0000000000000000 C

along with a 4x4x1 k-mesh in our KPOINTS file:

K points
 0
Gamma
4  4  1
0  0  0

and PAW C_s 04May1998 POTCAR.

The following INCAR file with modifications will be used thoughout:

SYSTEM = graphene
ENCUT = 400

# electronic
PREC = Accurate
NELMIN = 5
EDIFF = 1e-8
ISMEAR = -1
SIGMA = 0.2
LREAL = .FALSE.
LWAVE = .FALSE.
LCHARG = .FALSE.

# ionic (finite differences)
IBRION = 6
POTIM = 0.015

Restarting a finite difference calculation

The calculation failed after a certain point or has accidentally been cancelled:

DAV:   9    -0.181350430125E+03   -0.25600E-06   -0.38452E-08   848   0.118E-03    0.774E-04
DAV:  10    -0.181350430581E+03   -0.45554E-06   -0.20686E-08   864   0.738E-04    0.208E-04
DAV:  11    -0.181350430676E+03   -0.94857E-07   -0.22346E-09   704   0.354E-04    0.207E-04
srun: Job step aborted: Waiting up to 32 seconds for job step to finish.
slurmstepd-test01: error: *** JOB 254054 ON test01 CANCELLED AT 2026-01-19T16:25:49 ***
slurmstepd-test01: error: *** STEP 254054.0 ON test01 CANCELLED AT 2026-01-19T16:25:49 ***

In the directory, you will see the vaspcheckfd.h5 file. It contains the displacement calculations that have been completed up to the point of the crash:

h5ls vaspcheckfd.h5

data-1                   Group
displacements            Group
symmetry                 Group

Restart the calculation by adding CHECKPOINT_FD = CONTINUE to the INCAR:

SYSTEM = graphene
ENCUT = 400

# electronic
PREC = Accurate
NELMIN = 5
EDIFF = 1e-8
ISMEAR = -1
SIGMA = 0.2
LREAL = .FALSE.
LWAVE = .FALSE.
LCHARG = .FALSE.

# ionic (finite differences)
IBRION = 6
POTIM = 0.015
CHECKPOINT_FD = CONTINUE

and resubmit your calculation in the directory. The finite differences calculation will continue after an SCF step has been done and the stdout reads

Continuing from previous run

The calculation finishes as normal when all displacements have been completed and the phonon modes calculated:

h5ls vaspcheckfd.h5

data-1                   Group
data-2                   Group
data-3                   Group
data-4                   Group
displacements            Group
symmetry                 Group

Splitting a finite difference calculation

For large structures, it may be easier to split the displacements into separate calculations. This is done in three steps:

  1. Preparing the separate displacements - CHECKPOINT_FD = PREPARE
  2. Single displacement calculations - CHECKPOINT_FD = SINGLE
  3. Collected finite differences - CHECKPOINT_FD = CONTINUE

1. Preparing the displacements

The displacements can be prepared using the CHECKPOINT_FD = PREPARE tag:

SYSTEM = graphene
ENCUT = 400

# electronic
PREC = Accurate
NELMIN = 5
EDIFF = 1e-8
ISMEAR = -1
SIGMA = 0.2
LREAL = .FALSE.
LWAVE = .FALSE.

# ionic (finite differences)
IBRION = 6
POTIM = 0.015
CHECKPOINT_FD = PREPARE

This creates CONTCAR_disp-N files containing each of the displacements in the parent directory and you can see the following in the stdout:

Creating CONTCAR files for finite difference displacements

and in the vaspcheckfd.h5 file:

h5ls vaspcheckfd.h5

metadata                 Group
subdir_prefix            Dataset {SCALAR}
total_count              Dataset {SCALAR}

2. Single displacement calculations

Create directories disp-N for each of the CONTCAR_disp-N file and run the calculations separately. To this end, copy all restart files in the subdirectory, rename CONTCAR_disp-N to POSCAR, set CHECKPOINT_FD = SINGLE in the INCAR file and run the calculation:

max=$(printf "%s\n" CONTCAR_disp-* | sed 's/.*-//' | sort -n | tail -1)

for i in $(seq 1 $max); do
  mkdir -p disp-$i
  cp CONTCAR_disp-$i disp-$i/POSCAR
  cp INCAR POTCAR KPOINTS vasp.run disp-$i/
  sed -i 's/PREPARE/SINGLE/g' disp-$i/INCAR
  echo """
NCORE = 4 
ICHARG = 1
LCHARG = F
""" >> disp-$i/INCAR
  ln -s ../CHGCAR disp-$i/CHGCAR
done

Each INCAR file in the directories will then look like:

SYSTEM = graphene
ENCUT = 400

# electronic
PREC = Accurate
NELMIN = 5
EDIFF = 1e-8
ISMEAR = -1
SIGMA = 0.2
LREAL = .FALSE.
LWAVE = .FALSE.

# ionic (finite differences)
IBRION = 6
POTIM = 0.015
CHECKPOINT_FD = SINGLE
NCORE = 4
ICHARG = 1
LCHARG = F

In each subdirectory, you can see that a single displacement has been recorded in the stdout:

Computing single independent displacement for finite differences

and to the vaspcheckfd.h5 file:

h5ls vaspcheckfd.h5
 
data-1                   Group

3. Collected finite differences

Return to the parent directory and combine these separate displacements into one finite difference calculation using the CHECKPOINT_FD = CONTINUE tag:

SYSTEM = graphene
ENCUT = 400

# electronic
PREC = Accurate
NELMIN = 5
EDIFF = 1e-8
ISMEAR = -1
SIGMA = 0.2
LREAL = .FALSE.
LWAVE = .FALSE.
LCHARG = .FALSE.

# ionic (finite differences)
IBRION = 6
POTIM = 0.015
CHECKPOINT_FD = CONTINUE

Running this calculation, you can see that each of the single displacements are combined into one calculation in the stdout:

 Combining displacements from subdirectories

and vaspcheckfd.h5 file:

h5ls vaspcheckfd.h5

metadata                 Group
subdir_prefix            Dataset {SCALAR}
total_count              Dataset {SCALAR}

The information about the computed phonon modes is written to stdout and OUTCAR file below Eigenvectors and eigenvalues of the dynamical matrix in the same way as in phonons from finite differences.

Practical hints

  • The phonon frequencies will differ slightly between one run and the split calculation, on the order of the 4th or 5th significant figure. We do not expect this to be significant.
  • You can use this method for any electron-phonon calculations.
  • You can set different NCORE settings in these calculations, offering parallelization that is not otherwise available for finite differences.
  • Make sure to check that you are using the correct vaspcheckfd.h5 file with each calculation, particularly the split calculation. If data is read from an inappropriate vaspcheckfd.h5 file, you will see it with the following warning:
 -----------------------------------------------------------------------------
|                                                                             |
|     EEEEEEE  RRRRRR   RRRRRR   OOOOOOO  RRRRRR      ###     ###     ###     |
|     E        R     R  R     R  O     O  R     R     ###     ###     ###     |
|     E        R     R  R     R  O     O  R     R     ###     ###     ###     |
|     EEEEE    RRRRRR   RRRRRR   O     O  RRRRRR       #       #       #      |
|     E        R   R    R   R    O     O  R   R                               |
|     E        R    R   R    R   O     O  R    R      ###     ###     ###     |
|     EEEEEEE  R     R  R     R  OOOOOOO  R     R     ###     ###     ###     |
|                                                                             |
|     Checkpoint file vaspcheckfd.h5 is incompatible: NIONS mismatch          |
|     (file=54, current=128). Ensure that your calculational settings are     |
|     identical between runs. In particular, check POSCAR, KPOINTS,           |
|     POTCAR, and INCAR files.                                                |
|                                                                             |
|       ---->  I REFUSE TO CONTINUE WITH THIS SICK JOB ... BYE!!! <----       |
|                                                                             |
 -----------------------------------------------------------------------------
  • We recommend using the CHGCAR file from the parent directory of the split calculation for the individual displacements to speed up the calculation. Link this with ln -s ../CHGCAR, set LCHARG = .FALSE. so that the original charge density is not overwritten. Also set ICHARG = 1 so that the charge density is used, rather than starting from scratch.

Related tags and sections

CHECKPOINT_FD, vaspcheckfd.h5, IBRION, CONTCAR_disp-N

Phonons from finite differences