# The result of vasp static calculation is different when NSW= 0 and ≠ 0

I'm doing a static calculation. IBRION is set to-1, but NSW forgot to set it to 0. I found that the energy of the second ion step is not the same as that of the first ion step. The structure has not changed, so why is the energy different? Which result is reliable?

INCAR:

ALGO = Fast
EDIFF = 1E-5
EDIFFG = -2E-2
ENCUT = 520
IBRION = -1
ICHARG = 1
ISIF = 2
ISMEAR = 0
POTIM = 0.05
ISPIN = 2
ISTART = 1
LORBIT = 11
LREAL = Auto
LWAVE = False
LCHARG = False
#MAGMOM = 30*0.6
NELM = 400
NSW = 000
PREC = Accurate
SIGMA = 0.05
#SYMPREC = 1E-4
#ISYM = 0

IVDW = 1

NCORE = 4

LMAXMIX = 4
# DFT+U
LDAU = True
LDAUTYPE = 2
LDAUL = 0 0 2   0
LDAUU = 0 0 5.3 0
LDAUJ = 0 0 0   0
LDAUPRINT = 1


The result is:

   1 F= -.12046558E+04 E0= -.12046422E+04  d E =-.272572E-01  mag=     2.0115
2 F= -.12047406E+04 E0= -.12047334E+04  d E =-.145517E-01  mag=     1.7560
3 F= -.12047407E+04 E0= -.12047334E+04  d E =-.145535E-01  mag=     1.7565
4 F= -.12047407E+04 E0= -.12047334E+04  d E =-.146082E-01  mag=     1.7569
5 F= -.12047407E+04 E0= -.12047333E+04  d E =-.146615E-01  mag=     1.7573
6 F= -.12047407E+04 E0= -.12047334E+04  d E =-.145626E-01  mag=     1.7575
7 F= -.12047407E+04 E0= -.12047334E+04  d E =-.145611E-01  mag=     1.7575
8 F= -.12047407E+04 E0= -.12047334E+04  d E =-.145244E-01  mag=     1.7579


I guess the result may be related to ICHARG=1, which causes the subsequent calculation to read the previous CHGCAR. If so, the energy of static calculation should be set to NSW=0 or NSW>1, and the convergent energy should be used.

• It would really help the audience for your question if you could express it in less VASP specific language - VASP is not the only ab initio code and users of ther ones may have useful insights. What are NSW and IBRION? Oct 27, 2022 at 7:11
• Thank you for your kind reminder. This problem is the one I encountered when using vasp. NSW represents the largest ion step. If set to 0, it means static calculation, and only one ion step is calculated. IBRION is a parameter used to control whether the ions move or not, set to-1 means static calculation, all ions do not move. Oct 27, 2022 at 8:05
• outer loop will still keep on going and will try to optimize electron density again and again. There is no use of doing NSW>0 Oct 27, 2022 at 14:06

Looking at the EDIFF setting from the VASP Wiki (link), my impression is that the SCF terminates at the first instance when the energy difference is below EDIFF = 1E-5, but it is not guaranteed that the next SCF iteration must have an energy difference below EDIFF (this is my understanding, but it would be good for someone more experienced / familiar with VASP's underlying code to weigh in).
You didn't seem to have set NELMIN (link), so it takes the default value of NELMIN = 2, which means that 2 SCF steps will be taken in each subsequent "geometry optimization" step (where the structure actually stays constant). But this means that the orbitals and charge density are likely to continue being optimized at each step, which also explains how you can see the mag parameter getting converged over the fake "geometry optimization" steps.
You could try doing a series of static calculations with EDIFF = 1E-5, EDIFF = 1E-6, EDIFF = 1E-7 and so on to check how the E0 and mag values converge with respect to EDIFF.