INCAR: Difference between revisions

From Wiki
Jump to navigation Jump to search
Rgarcia (talk | contribs)
 
(61 intermediate revisions by 4 users not shown)
Line 1: Line 1:
go back to [[Main Page]], [[Group Pages]], [[Núria López and Group]]
go back to [[Main Page]], [[Group Pages]], [[Núria López and Group]], [[Scripts_for_VASP]]




Line 5: Line 5:
By controling some parameters in the INCAR file, you can greatly increase the efficiency of your calculations.
By controling some parameters in the INCAR file, you can greatly increase the efficiency of your calculations.


=Basic parameters=
=Parameters that all INCAR files should have=  
ISTART


ICHARG
The minimum INCAR file must contain at least the following parameters:


general:           
  SYSTEM = name-of-the-system
  ISTART =  0    # 0: new, 2: read WC
  ICHARG =  2    # 0: get from WC , 1: get from CHGCAR, 2: new
  GGA    =  PE    # PE: PBE
  ISPIN  =  1    # Use 2 for spin-polarized calculations
                     
electronic steps:   
  ENCUT  = 450    # Energy cutoff. 
  ISMEAR =  0    # Smearing: 0: Gaussian; 1+: MP.
  SIGMA  =  0.03  # Smearing width 
  LREAL  =  Auto  #
  EDIFF  =  1E-5  #
                     
ionic steps:       
  IBRION =  2    # 0: MD; 1,2,3: relaxations; 5: frq.; 44: IDM.
  POTIM  =  0.15  #                 
  EDIFFG =  -0.03  # Positive in eV; negative in eV/Å
  NSW    =  50    #     


The '''general''' section has the name of the system, the starting parameters for the wavefunctions and electronic density, the density functional (PBE in the example), and the spin. Optional flags: MAGMOM, NUPDOWN. For [[#DFT+U|DFT+U]] and [[hybrid functionals]], additional flags may be needed. 


Back to [[Núria López and Group]] page.
The '''electronic steps''' section has the energy cutoff, the smearing, the algorithm, the projection scheme, and finishes with the electronic convergence threshold. Optional flags: Maximum/minimum number of electronic cycles (NELM, NELMIN, NELMDL); modifications of mixing scheme (AMIX, BMIX, AMIN).  
=Ionic movement parameters=
   
You can find more information about this topic in the VASP manual [http://cms.mpi.univie.ac.at/vasp/vasp/IBRION_tag_NFREE_tag.html]
The '''ionic steps''' section contains the algorithm, the stepsize, the convergence threshold for ionic steps, and the maximum number of ionic steps. Its structure differs for NEB, CI-NEB, and IDM calculations, see below.


For a static calculation (e.g. No ions update), set:
Back to [[Núria López and Group]] / [[Scripts_for_VASP]].
NSW    = 1


==Ionic relaxation==
=Ionic steps=


There are five ionic relaxation algorithms implemented in VASP 5.x:
==Static (single-point) calculations==
For a static calculation (e.g. No ions update), set:
ionic steps:       
  IBRION =  -1    # 
  NSW    =  1    #
NSW values larger than 1 can be use to converge particularly difficult electronic structures without updating the ions.


====DIIS algorithm (IBRION=1)====
==Ionic relaxations==


===DIIS algorithm (IBRION=1)===
The DIIS algorithm converges fast in systems that:
The DIIS algorithm converges fast in systems that:
*Are close to an energy minimum (or maximum).
*Are close to an energy minimum (or maximum).
*Have low degrees of freedom.
*Have low degrees of freedom.
Examples of those systems are:
Examples of those systems are:
*Molecules in vacuum with short backbones (e.g. tert-butanol is one of the largest).
*Molecules in vacuum with short backbones (tert-butanol or shorter).
*Bare metal slabs representing closed surfaces.  
*Bare metal slabs representing closed surfaces.  
*Pre-converged transition states.
For relaxations use:
ionic steps:       
  IBRION =  1    # 
  POTIM  =  0.25  # Between 0.10 and 0.40.
  EDIFFG =  -0.02  # In eV/Å.
  NSW    = 100    # Between 50 and 100.     


The algorithm builds up an approximation of the Hessian matrix, taking the last NFREE steeps. The forces should be calculated precisely, therefore you'd better set NELM=4 or even NELM=8. This forces a minimum of 4 to 8 electronic steps between each ionic step, and guarantees that the forces are well converged at each step. The NFREE number should be [[lower]] than the number of degrees of freedom, and it is set by VASP considering several constrains, unless it is specified by the user. For large values of NFREE this algorithm may diverge. For more information: [http://dx.doi.org/10.1016/0009-2614(80)80396-4] [http://cms.mpi.univie.ac.at/vasp/vasp/IBRION_1_I.html].
For '''already pre-converged transition states''' use:
ionic steps:       
  IBRION =   1    # 
  POTIM  =   0.01  # Lower than 0.03.                
  EDIFFG =  -0.05  # In eV/Å
  NSW    =  50    # Between 25 and 50.    


A test made with a gas-phase molecule in different conditions established that good POTIM values are between 0.15-0.40, with an optimum of '''POTIM=0.25'''. The algorithm is stable up to POTIM=0.80, even for weird, high-stressed structures. POTIM values smaller than 0.15, or larger than 0.40, only decrease the speed of convergence.  
For more information: [http://dx.doi.org/10.1016/0009-2614(80)80396-4] [http://cms.mpi.univie.ac.at/vasp/vasp/IBRION_1_I.html].


====Conjugated Gradient algorithm (IBRION=2)====
Back to [[Núria López and Group]] / [[Scripts_for_VASP]].


Is the recommended algorithm if you don't know what to do (See Ionic Relaxation Methods in [http://www.vasp.at/index.php?option=com_content&view=article&id=49&Itemid=57]). It is faster and more stable than DIIS for medium and large systems, and always converges into a minimum (?).
===CG algorithm (IBRION=2)===


The CG algorithm less sensitive to POTIM, and is stable for both stressed and pre-converged structures up to POTIM=1.00 (No larger values tested). However, the optimal value for both conditions is '''POTIM=0.15~0.20'''. Values lower than 0.15 reduces the speed of convergence.
Is the recommended algorithm if you don't know what to do (See Ionic Relaxation Methods in [http://www.vasp.at/index.php?option=com_content&view=article&id=49&Itemid=57]). It is faster and more stable than DIIS for medium and large systems, and always converges into a minimum.  


====Damped MD and QUICKMIN (IBRION=3)====
ionic steps:       
  IBRION =   2    # 
  POTIM  =   0.150 # Between 0.15 and 0.25.                 
  EDIFFG = -0.020 # In eV/Å
  NSW    = 100    # 


Recomended for big systems, with many degrees of freedom.
===Damped MD and QUICKMIN (IBRION=3)===


If IBRION=3 is selected, VASP will use the QUICKMIN algorithm by default. If a SMASS value is feet in INCAR, VASP will switch to the damped Molecular Dynamic algorithm.  
Recomended to use along NEBs for big systems or in conjunction with NEBs.
Both suppose to be more efficient than CG and DIIS in large systems, but dMD can be faster than QUICKMIN if a good set of SMASS and POTIM is selected.  
ionic steps:       
  IBRION =   3     # 
  POTIM  =  0.011 # Always lower than 0.020.                  
  EDIFFG =  -0.020 # In eV/Å
  NSW    = 100    # 


A good set of values for adsorption systems (tested on methanol on Pt(111) 2×2 surface) with reasonable initial guests is '''SMASS=0.20 and POTIM=0.16 ~ 0.20'''. The optimal set of values may change according to the size and nature of the system. Therefore, you'd better do a fast test in very soft conditions (Γ-point, ENCUT<250eV, NSW=10~20) to find the optimal parameters for your system. A good selection of SMASS can speed up the ionic convergence by one order of magnitude after 50 steps.
POTIM should be very small, lower than the reciprocal of the highest eigenvalue in the Hessian Matrix. For hydrogen-containing systems, this value is around 0.025. Values lower than 0.017 are usually very safe.  
Back to [[Núria López and Group]] / [[Scripts_for_VASP]].


For IBRION=1,2 and 3 (dMD), POTIM is defined as a scaling constant for the forces. For QUICKMIN algorith, the IBRION flag has units (proportional to s/kg).
==Frequencies (IBRION=5,6)==
See [http://cms.mpi.univie.ac.at/vasp/vasp/IBRION_5_IBRION_6.html]. After calculating frequencies, you can visualize them with [[Jmol]].  


To set the stepest decend method, use IBRION=3 and SMASS=2.
ionic steps:
  IBRION =   5    # 
  POTIM  =   0.02  # Always lower than 0.020.                 
  NFREE  =  2     #


====Transition state optimization (IBRION=44)====
Tip: If your system was obtained with a tight convergence criteria (eg: EDIFFG=-0.02), you can use NFREE=1 instead of 2. You will have a reasonable accuracy in the frequencies with half the computational cost.


Dimer method of G. Henkelman and H. Jónsson (J.Chem.Phys.,111,7010(1999)), implemented by Heyden ''et al''[http://cms.mpi.univie.ac.at/vasp/vasp/IBRION_44.html].
Back to [[Núria López and Group]] / [[Scripts_for_VASP]].
Use these parametres:


IBRION = 44   
==Finding transition states==  
EDIFFG = -0.050 #
NSW    = 100    # Never use more than 200. Check periodically for divergence. 
POTIM  =   0.010 #   
NFREE  =  5    # 
FINDIFF=  2    #   
DIMER_DIST=0.010 #   
MINROT =  0.010 #   
STEP_SIZE= 0.010 #   
STEP_MAX=  0.100 #


To check that it is converging well, (1) check with p4vasp that all forces are small, and (2) Check that the curvature is always negative. Normal values are between -1.0 and -30.0:
A robust search for transition states starts by preconverging using a [[NEB]]. To run a NEB, please make sure you are using a VTST-modified version of VASP and put these flags on your INCAR file:
  grep curv OUTCAR
ionic steps:       
  IMAGES =  4    #
  LCLIMB =  F    #
  IBRION =  3    #
  POTIM  =  0.011 #
  SPRING = -5    #
  NSW    = 100    # Use less than 200 steps for NEBs


==Others ionic updates==
IBRION=3 works very well for NEBs. Do never use IBRION=2. If you have more than one local maximum, modify your initial and final states and repeat the NEB. If the initial and final states are too different, you can also do a zoom or increase the number of images. Avoid using more than 6 images. You can [[INCAR#Tips_for_efficient_electronic_relaxations|tweak EDIFF and NELMIN]] in the ''electronic steps'' section to make it run faster.   


===Molecular Dynamics (MD) (IBRION=0)===
Once the NEB is pre-converged, launch a CI-NEB:
See [[Molecular Dynamics with VASP]]
ionic steps:       
  IMAGES =   4    #
  LCLIMB =   T    #
  IBRION =   1    #
  POTIM  =   0.150 #
  SPRING = -5    #
  NSW    = 50    # Use less than 100 steps for CI-NEB
 
After 50 steps, you should have a high-quality transition state localized as the image with highest energy. CI-NEB works best with IBRION=1. 
 
Finally, do a [[INCAR#Frequencies_.28IBRION.3D5.2C6.29|frequencies calculation]] to check that all frequencies are real except by one that represents the transition state.
 
The transition staten can be further refined by applying [[INCAR#DIIS_algorithm_.28IBRION.3D1.29|IBRION=1]] with a very small POTIM and by using the [[IDM|Improved Dimer Method]].
 
Back to [[Núria López and Group]] / [[Scripts_for_VASP]].
 
==Ab-Initio Molecular Dynamics==
VASP manual: [http://cms.mpi.univie.ac.at/vasp/vasp/IBRION_0.html]
VASP manual: [http://cms.mpi.univie.ac.at/vasp/vasp/IBRION_0.html]


===Thermodynamics (IBRION=5,6)===
To avoid unphysical variations in the temperature of your BOMD, start with a pre-heating from 0K to your working temperature. Also break the symmetry, which is particularly important if your initial structure is highly symmetric. The following text replaces the '''ionic steps''' section in your INCAR file: 
See [http://cms.mpi.univie.ac.at/vasp/vasp/IBRION_5_IBRION_6.html]
 
# molecular dynamics
  IBRION =  0
  POTIM  =  1.00  # timestep in fs.
  NSW    = 100    # 3700*3.00 = 11000 fs = 11.1 ps 
  SMASS  =  0    # thermal bath NVT
  TEBEG  =   0    # initial temperature
  TEEND  = 300    # final temperature
  ISYM  =   0    # symmetry off, here it is compulsory
 
Then, for the rest of the runs keep constant the thermal bath. For BOMD you can do long runs. Be careful that they finish before the time-limit is reached, for instance in MareNostrum4:
# molecular dynamics
  IBRION =   0
  POTIM  =  1.00  # timestep in fs.
  NSW    =1000    #
  SMASS  =  0    # thermal bath NVT
  TEBEG  = 300    # initial temperature
  TEEND  = 300    # final temperature
  ISYM  =  0    # symmetry off, here it is optional
 
Back to [[Núria López and Group]] / [[Scripts_for_VASP]].
 
=Corrections=
 
==Dipole corrections==
To include dipole corrections for surfaces, include the following flags in your INCAR file and cite remember to cite this paper[[https://journals.aps.org/prb/abstract/10.1103/PhysRevB.51.4014]]:
Dipole corrections: 
  IDIPOL =  3    #
  LDIPOL =  T    #


Tip: If your system was obtained with a tight convergence criteria (eg: EDIFFG=-0.01), you can use NFREE=1 instead of 2 and reach a reasonable accuracy in the frequencies calculation with half of the computational cost.
==van der Waals contributions==


Back to [[Núria López and Group]] page.
Check [[VdW_forces|here]]
=Electronic relaxation parameters=
For each ionic position, the electronic density and wave functions are updated (Born-Oppenheimer approximation). There are two control commands for this loop, EDIFF and NELM.
EDIFF  = 1E-5 ! Default: 1E-4. [http://cms.mpi.univie.ac.at/vasp/guide/node105.html]
NELM  = 150  ! Default: 60. [http://cms.mpi.univie.ac.at/vasp/guide/node104.html]
'''tip''': Use values of NELM larger than 60 if you do not reach the energy threshold after 3 ionic steps.


For pre-converge a calculation, set:
==DFT+U==
EDIFF  = 1E-3 ! Or 1E-4 for each moving nucleus in your POSCAR file
To activate DFT+U calculation you will need these 2 flags:
ENCUT  = 250  ! Or the higher ENMIN value in your POTCAR file
NELMIN = 4    ! Or 5. To increase this value further may rise computational burden without adding precision to the forces. 


For converge a calculation, set:
  LDAU    = T              # Switch on LDA+U
EDIFF  = 1E-5 !
  LDAUTYPE = 2              # LSDA + U Dudarev's approach = type 2 in vasp
ENCUT  = 450  ! This value must be consistent with all your converged calculations.
NELMIN = 3    ! Or 2, that is the default.


A thumb rule is EDIFF=EDDIFG*0.01 if EDDIFG is positive, or EDIFF=-EDDIFG*0.001 if using the force criterion.
You will need to add the U and J term for each atom type. For example to put an effective U=1 for the second type of atom, you will put LDAUU=2 and LDAUJ=1 as follow:
  # Add on-site interaction for the respective atoms (same order as in POSCAR)
  LDAUL =  -1  2    -1      # 2 for d-orbital interactions, -1 no on-site interaction
  LDAUU =  0.0  2.0  0      # Define U-parameters for on-site Coulomb interaction
  LDAUJ = 0.0  1.0  0      # Define J-parameters for on-site Exchange interaction
  LDAUPRINT = 0              # 0 to ignore, 1 to print occupation matrix in OUTC
Finally, this flag is used to speed up DFT+U calculation:
  LMAXMIX = 4  #DFT+U calculations may require LMAXMIX to 4 for d-electrons (or 6 for f-elements) for faster convergence to the groundstate
Back to [[Núria López and Group]] / [[Scripts_for_VASP]].


==What to do when experiencing convergence problems==
=Additional parameters=
If you have problems to reach convergence in the first electronic loop, and you are not reading WAVECAR, set:
 
  NELMDL = -9   # Number of non self-consistent electronic steps at the beginning (w/o CHG update)
==Verbosity==
 
'''Tip''': Add this segment in your INCAR file to reduce verbosity and avoid writing WAVECAR and CHG(CAR) files:  
  # Verbosity: 
  NWRITE =  0    # Verbosity
  LWAVE  F    # WAVECAR     
  LCHARG =  F    # CHG / CHGCAR


Otherwise, vary these mixing scheme parameters (you can play with them):
Other flags that affect the files being written:  
  AMIX   = 0.1
  '''FLAG    DEFAULT # FILE'''
  BMIX   = 0.01
  NWRITE =  2    # Verbosity of the OUTCAR file
  LWAVE =   T    # WAVECAR      [http://cms.mpi.univie.ac.at/vasp/guide/node64.html]
  LCHARG =   T    # CHG / CHGCAR  [http://cms.mpi.univie.ac.at/vasp/guide/node63.html] [http://cms.mpi.univie.ac.at/vasp/vasp/CHGCAR_file.html]
  LVTOT  =  F    # LOCPOT        [http://cms.mpi.univie.ac.at/vasp/vasp/LOCPOT_file.html] 
  LELF  =  F    # ELFCAR        [http://cms.mpi.univie.ac.at/vasp/guide/node72.html]  
  PARCHG =   F    # PARCHG       
  LAECHG =   F    # Bader AECCAR files 
  LORBIT =  0     # PDOS/LDOS     


If problems persist, increase BMIX:
Back to [[Núria López and Group]] / [[Scripts_for_VASP]].
BMIX  = 3.0
AMIN  = 0.01  # Do not confuse with AMIX


If problems persist, read this [[http://www.vasp.at/vasp-workshop/slides/optelectron.pdf]]
==Parallelization==


For further reading: [[http://www.vasp.at/vasp-workshop/slides/optelectron.pdf]]
Tune '''NPAR''' (or '''NCORE''', never both), '''NSIM''', '''KPAR''', and  '''NBANDS''' to parallelive well.
Changing the parameter '''NPAR''' could increase the speed of calculation without affecting the global energy. Please see [http://cms.mpi.univie.ac.at/vasp/guide/node138.html] and made some test before set large systems.
NPAR must be exactly equal to (1) the number of cores per node if you are using one node, or (2) the number of nodes if you are using more than one node. NEVER USE THE SQUARE ROOT RULE PROPOSED IN THE VASP MANUAL, it is two-decades outdated! 


Back to [[Núria López and Group]] page.
Optimal '''NPAR''' values:


=Aditional parameters=
  Nº Queue
  4 c4m8        ==> NPAR =  4
  8 c4m8        ==> NPAR =  2
  12 c4m8        ==> NPAR =  3
etc.
   
  8 c8m24        ==> NPAR =  8
  16 c8m24        ==> NPAR =  2
  24 c8m24        ==> NPAR =  3
etc.
  12 c12m48ib    ==> NPAR = 12
  24 c12m48ib    ==> NPAR =  2
  36 c12m48ib    ==> NPAR =  3
  48 c12m48ib    ==> NPAR =  4
etc.
  48 MareNostrum4 ==> NPAR = 48
  96 MareNostrum4 ==> NPAR =  2
144 MareNostrum4 ==> NPAR =  3
192 MareNostrum4 ==> NPAR =  4
etc.
  16 MareNostrum3 ==> NPAR = 16
  32 MareNostrum3 ==> NPAR =  2
  48 MareNostrum3 ==> NPAR =  3
  64 MareNostrum3 ==> NPAR =  4
etc.


==Speeding up with NSIM==
A calculation running on 8 processors-c8m24 will finish around 30% faster than on 8 processors-c4m8.


If your INCAR file states the following:
'''NSIM''' can be set if your INCAR file states the following:


  IALGO=48  or  ALGO=Fast  or  ALGO=VeryFast
  IALGO=48  or  ALGO=Fast  or  ALGO=VeryFast
Line 144: Line 274:
For more information [http://cms.mpi.univie.ac.at/vasp/guide/node130.html]
For more information [http://cms.mpi.univie.ac.at/vasp/guide/node130.html]


==Improving Parallelisation==
You can further increase the efficiency of your parallelization by setting '''KPAR''' and '''NBANDS'''. You must know the kind of processors you are working with, the number of electrons/bands in your calculation, and to read the VASP manual.


Changing the parameter NPAR could increase the speed of calculation without affecting the global energy. Please see [http://cms.mpi.univie.ac.at/vasp/guide/node138.html] and made some test before set large systems.
It is a must to use advanced parallelization when working in MareNostrum and for big projects where lots of computational hours are spent.  


Test results (Nº=Number of processors):
Back to [[Núria López and Group]] / [[Scripts_for_VASP]].


Nº Queue
==Tips for efficient electronic relaxations==
  4 c4m8        ==> NPAR = 1
 
  8 c4m8        ==> NPAR = 2
*Some simple systems, such as molecules and conductors, allow you to use the Fast algorithm. This algorithm parallelizes well.  
12 c4m8        ==> NPAR = 3
   ALGO  =   Fast # Normal: general purpouse; Fast: Good for conductors.  
etc.
   
  8 c8m24      ==> NPAR = 1
16 c8m24      ==> NPAR = 2
24 c8m24      ==> NPAR = 3
etc.
12 c12m48ib   ==> NPAR = 2
  24 c12m48ib    ==> NPAR = 2
36 c12m48ib    ==> NPAR = 3
48 c12m48ib    ==> NPAR = 4
etc.
16 MareNostrum ==> NPAR = 2
32 MareNostrum ==> NPAR = 2
48 MareNostrum ==> NPAR = 3
64 MareNostrum ==> NPAR = 4
etc.


A calculation runing on 8 processors-c8m24 will finish around 30% faster than on 8 processors-c4m8.
*For relaxations in big systems and NEBs, lowering the threshold for electronic convergence can save a lot of cpu-hours. Increase NELMIN to preserve accuracy after several ionic steps:
  EDIFF  =  1E-3  # Or 1E-4 for each moving nucleus in your POSCAR file
  NELMIN =  5    # Or 5. To increase this value further may rise computational burden without adding precision to the forces.


==van der Waals contributions==
*For very precise calculations, a rule-of-thumb is EDIFF=EDDIFG*0.1 if EDDIFG is positive (energy criterion), or EDIFF=-EDDIFG*0.001 if EDIFFG is negative (force criterion).




[[VdW_forces]]
Back to [[Núria López and Group]] / [[Scripts_for_VASP]].


==Improving stability: Mixing parameters==
If you have problems to reach convergence in the first electronic loop, and you are not reading WAVECAR, set:
NELMDL = -9  # Number of non self-consistent electronic steps at the beginning (w/o CHG update)


==Files to write==
Otherwise, vary these mixing scheme parameters (you can play with them):
There are several flags to state what files to be written.
AMIX   = 0.10           
  '''FLAG      FILE          DEFAULT'''
  BMIX   = 0.01         
   LWAVE  => WAVECAR      .TRUE.  [http://cms.mpi.univie.ac.at/vasp/guide/node64.html]
  AMIN   = 0.10         
  LCHARG => CHG / CHGCAR .TRUE.  [http://cms.mpi.univie.ac.at/vasp/guide/node63.html] [http://cms.mpi.univie.ac.at/vasp/vasp/CHGCAR_file.html]
   LVTOT  => LOCPOT        .FALSE. [http://cms.mpi.univie.ac.at/vasp/vasp/LOCPOT_file.html] 
  LELF  => ELFCAR        .FALSE. [http://cms.mpi.univie.ac.at/vasp/guide/node72.html]  
   PARCHG => PARCHG        .FALSE.  


'''Tip''': Set LWAVE=.FALSE. and LCHARG=.FALSE. to avoid that VASP writes WAVECAR, CHG & CHGCAR files. Set those values to .TRUE. if you plan to start a new calculation based on those results.
If problems persist, increase BMIX and reduce AMIN:  
AMIX  = 0.10           
BMIX  = 3.00           
AMIN  = 0.01           


==Mixing scheme==
If problems persist, read this [[http://www.vasp.at/vasp-workshop/slides/optelectron.pdf]]
Please refer to [http://cms.mpi.univie.ac.at/vasp/guide/node131.html] and  [http://cms.mpi.univie.ac.at/vasp/vasp/Mixing_tags_IMIX_INIMIX_MAXMIX_AMIX_BMIX_AMIX_MAG_BMIX_MAG_AMIN_MIXPRE_WC.html]


References: [http://cms.mpi.univie.ac.at/vasp/guide/node131.html] and  [http://cms.mpi.univie.ac.at/vasp/vasp/Mixing_tags_IMIX_INIMIX_MAXMIX_AMIX_BMIX_AMIX_MAG_BMIX_MAG_AMIN_MIXPRE_WC.html]


Back to [[Núria López and Group]] page.
Back to [[Núria López and Group]] / [[Scripts_for_VASP]].

Latest revision as of 17:06, 27 November 2019

go back to Main Page, Group Pages, Núria López and Group, Scripts_for_VASP


By controling some parameters in the INCAR file, you can greatly increase the efficiency of your calculations.

Parameters that all INCAR files should have[edit]

The minimum INCAR file must contain at least the following parameters:

general:            
  SYSTEM = name-of-the-system
  ISTART =   0     # 0: new, 2: read WC
  ICHARG =   2     # 0: get from WC , 1: get from CHGCAR, 2: new
  GGA    =   PE    # PE: PBE 
  ISPIN  =   1     # Use 2 for spin-polarized calculations
                     
electronic steps:    
  ENCUT  = 450     # Energy cutoff.   
  ISMEAR =   0     # Smearing: 0: Gaussian; 1+: MP. 
  SIGMA  =   0.03  # Smearing width   
  LREAL  =   Auto  # 
  EDIFF  =   1E-5  # 
                      
ionic steps:         
  IBRION =   2     # 0: MD; 1,2,3: relaxations; 5: frq.; 44: IDM. 
  POTIM  =   0.15  #                  
  EDIFFG =  -0.03  # Positive in eV; negative in eV/Å
  NSW    =  50     #      

The general section has the name of the system, the starting parameters for the wavefunctions and electronic density, the density functional (PBE in the example), and the spin. Optional flags: MAGMOM, NUPDOWN. For DFT+U and hybrid functionals, additional flags may be needed.

The electronic steps section has the energy cutoff, the smearing, the algorithm, the projection scheme, and finishes with the electronic convergence threshold. Optional flags: Maximum/minimum number of electronic cycles (NELM, NELMIN, NELMDL); modifications of mixing scheme (AMIX, BMIX, AMIN).

The ionic steps section contains the algorithm, the stepsize, the convergence threshold for ionic steps, and the maximum number of ionic steps. Its structure differs for NEB, CI-NEB, and IDM calculations, see below.

Back to Núria López and Group / Scripts_for_VASP.

Ionic steps[edit]

Static (single-point) calculations[edit]

For a static calculation (e.g. No ions update), set:

ionic steps:         
  IBRION =  -1     #  
  NSW    =   1     # 

NSW values larger than 1 can be use to converge particularly difficult electronic structures without updating the ions.

Ionic relaxations[edit]

DIIS algorithm (IBRION=1)[edit]

The DIIS algorithm converges fast in systems that:

  • Are close to an energy minimum (or maximum).
  • Have low degrees of freedom.

Examples of those systems are:

  • Molecules in vacuum with short backbones (tert-butanol or shorter).
  • Bare metal slabs representing closed surfaces.
  • Pre-converged transition states.

For relaxations use:

ionic steps:         
  IBRION =   1     #  
  POTIM  =   0.25  # Between 0.10 and 0.40. 
  EDIFFG =  -0.02  # In eV/Å. 
  NSW    = 100     # Between 50 and 100.      

For already pre-converged transition states use:

ionic steps:         
  IBRION =   1     #  
  POTIM  =   0.01  # Lower than 0.03.                  
  EDIFFG =  -0.05  # In eV/Å
  NSW    =  50     # Between 25 and 50.      

For more information: [1] [2].

Back to Núria López and Group / Scripts_for_VASP.

CG algorithm (IBRION=2)[edit]

Is the recommended algorithm if you don't know what to do (See Ionic Relaxation Methods in [3]). It is faster and more stable than DIIS for medium and large systems, and always converges into a minimum.

ionic steps:         
  IBRION =   2     #  
  POTIM  =   0.150 # Between 0.15 and 0.25.                  
  EDIFFG =  -0.020 # In eV/Å
  NSW    = 100     #  

Damped MD and QUICKMIN (IBRION=3)[edit]

Recomended to use along NEBs for big systems or in conjunction with NEBs.

ionic steps:         
  IBRION =   3     #  
  POTIM  =   0.011 # Always lower than 0.020.                   
  EDIFFG =  -0.020 # In eV/Å
  NSW    = 100     #  

POTIM should be very small, lower than the reciprocal of the highest eigenvalue in the Hessian Matrix. For hydrogen-containing systems, this value is around 0.025. Values lower than 0.017 are usually very safe.

Back to Núria López and Group / Scripts_for_VASP.

Frequencies (IBRION=5,6)[edit]

See [4]. After calculating frequencies, you can visualize them with Jmol.

ionic steps: 
  IBRION =   5     #  
  POTIM  =   0.02  # Always lower than 0.020.                   
  NFREE  =   2     # 

Tip: If your system was obtained with a tight convergence criteria (eg: EDIFFG=-0.02), you can use NFREE=1 instead of 2. You will have a reasonable accuracy in the frequencies with half the computational cost.

Back to Núria López and Group / Scripts_for_VASP.

Finding transition states[edit]

A robust search for transition states starts by preconverging using a NEB. To run a NEB, please make sure you are using a VTST-modified version of VASP and put these flags on your INCAR file:

ionic steps:         
  IMAGES =   4     # 
  LCLIMB =   F     # 
  IBRION =   3     # 
  POTIM  =   0.011 # 
  SPRING =  -5     # 
  NSW    = 100     # Use less than 200 steps for NEBs

IBRION=3 works very well for NEBs. Do never use IBRION=2. If you have more than one local maximum, modify your initial and final states and repeat the NEB. If the initial and final states are too different, you can also do a zoom or increase the number of images. Avoid using more than 6 images. You can tweak EDIFF and NELMIN in the electronic steps section to make it run faster.

Once the NEB is pre-converged, launch a CI-NEB:

ionic steps:         
  IMAGES =   4     # 
  LCLIMB =   T     # 
  IBRION =   1     # 
  POTIM  =   0.150 # 
  SPRING =  -5     # 
  NSW    =  50     # Use less than 100 steps for CI-NEB 

After 50 steps, you should have a high-quality transition state localized as the image with highest energy. CI-NEB works best with IBRION=1.

Finally, do a frequencies calculation to check that all frequencies are real except by one that represents the transition state.

The transition staten can be further refined by applying IBRION=1 with a very small POTIM and by using the Improved Dimer Method.

Back to Núria López and Group / Scripts_for_VASP.

Ab-Initio Molecular Dynamics[edit]

VASP manual: [5]

To avoid unphysical variations in the temperature of your BOMD, start with a pre-heating from 0K to your working temperature. Also break the symmetry, which is particularly important if your initial structure is highly symmetric. The following text replaces the ionic steps section in your INCAR file:

# molecular dynamics
  IBRION =   0
  POTIM  =   1.00  # timestep in fs. 
  NSW    = 100     # 3700*3.00 = 11000 fs = 11.1 ps  
  SMASS  =   0     # thermal bath NVT 
  TEBEG  =   0     # initial temperature
  TEEND  = 300     # final temperature 
  ISYM   =   0     # symmetry off, here it is compulsory

Then, for the rest of the runs keep constant the thermal bath. For BOMD you can do long runs. Be careful that they finish before the time-limit is reached, for instance in MareNostrum4:

# molecular dynamics
  IBRION =   0
  POTIM  =   1.00  # timestep in fs. 
  NSW    =1000     # 
  SMASS  =   0     # thermal bath NVT 
  TEBEG  = 300     # initial temperature
  TEEND  = 300     # final temperature 
  ISYM   =   0     # symmetry off, here it is optional

Back to Núria López and Group / Scripts_for_VASP.

Corrections[edit]

Dipole corrections[edit]

To include dipole corrections for surfaces, include the following flags in your INCAR file and cite remember to cite this paper[[6]]:

Dipole corrections:   
  IDIPOL =   3     # 
  LDIPOL =   T     #

van der Waals contributions[edit]

Check here

DFT+U[edit]

To activate DFT+U calculation you will need these 2 flags:

  LDAU     = T               # Switch on LDA+U
  LDAUTYPE = 2               # LSDA + U Dudarev's approach = type 2 in vasp

You will need to add the U and J term for each atom type. For example to put an effective U=1 for the second type of atom, you will put LDAUU=2 and LDAUJ=1 as follow:

  # Add on-site interaction for the respective atoms (same order as in POSCAR) 
  LDAUL =  -1   2    -1      # 2 for d-orbital interactions, -1 no on-site interaction
  LDAUU =  0.0  2.0   0      # Define U-parameters for on-site Coulomb interaction
  LDAUJ =  0.0  1.0   0      # Define J-parameters for on-site Exchange interaction
  LDAUPRINT = 0              # 0 to ignore, 1 to print occupation matrix in OUTC

Finally, this flag is used to speed up DFT+U calculation:

  LMAXMIX = 4  #DFT+U calculations may require LMAXMIX to 4 for d-electrons (or 6 for f-elements) for faster convergence to the groundstate

Back to Núria López and Group / Scripts_for_VASP.

Additional parameters[edit]

Verbosity[edit]

Tip: Add this segment in your INCAR file to reduce verbosity and avoid writing WAVECAR and CHG(CAR) files:

# Verbosity:  
  NWRITE =   0     # Verbosity 
  LWAVE  =   F     # WAVECAR      
  LCHARG =   F     # CHG / CHGCAR

Other flags that affect the files being written:

  FLAG     DEFAULT # FILE
  NWRITE =   2     # Verbosity of the OUTCAR file 
  LWAVE  =   T     # WAVECAR       [7]
  LCHARG =   T     # CHG / CHGCAR  [8] [9]
  LVTOT  =   F     # LOCPOT        [10]  
  LELF   =   F     # ELFCAR        [11]  
  PARCHG =   F     # PARCHG         
  LAECHG =   F     # Bader AECCAR files  
  LORBIT =   0     # PDOS/LDOS       

Back to Núria López and Group / Scripts_for_VASP.

Parallelization[edit]

Tune NPAR (or NCORE, never both), NSIM, KPAR, and NBANDS to parallelive well. Changing the parameter NPAR could increase the speed of calculation without affecting the global energy. Please see [12] and made some test before set large systems. NPAR must be exactly equal to (1) the number of cores per node if you are using one node, or (2) the number of nodes if you are using more than one node. NEVER USE THE SQUARE ROOT RULE PROPOSED IN THE VASP MANUAL, it is two-decades outdated!

Optimal NPAR values:

 Nº Queue
  4 c4m8         ==> NPAR =  4
  8 c4m8         ==> NPAR =  2
 12 c4m8         ==> NPAR =  3
etc.
   
  8 c8m24        ==> NPAR =  8
 16 c8m24        ==> NPAR =  2
 24 c8m24        ==> NPAR =  3
etc.

 12 c12m48ib     ==> NPAR = 12
 24 c12m48ib     ==> NPAR =  2
 36 c12m48ib     ==> NPAR =  3
 48 c12m48ib     ==> NPAR =  4
etc.

 48 MareNostrum4 ==> NPAR = 48
 96 MareNostrum4 ==> NPAR =  2
144 MareNostrum4 ==> NPAR =  3
192 MareNostrum4 ==> NPAR =  4
etc.

 16 MareNostrum3 ==> NPAR = 16
 32 MareNostrum3 ==> NPAR =  2
 48 MareNostrum3 ==> NPAR =  3
 64 MareNostrum3 ==> NPAR =  4
etc. 

A calculation running on 8 processors-c8m24 will finish around 30% faster than on 8 processors-c4m8.

NSIM can be set if your INCAR file states the following:

IALGO=48   or   ALGO=Fast   or   ALGO=VeryFast

You can speed up your calculation by ~15% varying the NSIM parameter. There should be no difference in the total energy and the convergence behavior in setting NSIM>1, only the performance should improve. The default value is 4.

 In c4m8        ==> NSIM = between 6 and 16
 In c8m24       ==> NSIM = between 8 and 16
 In c12m48ib    ==> NSIM = between 8 and 16
 In MareNostrum ==> NSIM = between 10 and 42

Recomended values:

NSIM =  8   for c4m8 & c8m24
NSIM = 12   for c12m48ib
NSIM = 32   for MareNostrum

For more information [13]

You can further increase the efficiency of your parallelization by setting KPAR and NBANDS. You must know the kind of processors you are working with, the number of electrons/bands in your calculation, and to read the VASP manual.

It is a must to use advanced parallelization when working in MareNostrum and for big projects where lots of computational hours are spent.

Back to Núria López and Group / Scripts_for_VASP.

Tips for efficient electronic relaxations[edit]

  • Some simple systems, such as molecules and conductors, allow you to use the Fast algorithm. This algorithm parallelizes well.
  ALGO   =   Fast  # Normal: general purpouse; Fast: Good for conductors. 
  • For relaxations in big systems and NEBs, lowering the threshold for electronic convergence can save a lot of cpu-hours. Increase NELMIN to preserve accuracy after several ionic steps:
  EDIFF  =   1E-3  # Or 1E-4 for each moving nucleus in your POSCAR file
  NELMIN =   5     # Or 5. To increase this value further may rise computational burden without adding precision to the forces.  
  • For very precise calculations, a rule-of-thumb is EDIFF=EDDIFG*0.1 if EDDIFG is positive (energy criterion), or EDIFF=-EDDIFG*0.001 if EDIFFG is negative (force criterion).


Back to Núria López and Group / Scripts_for_VASP.

Improving stability: Mixing parameters[edit]

If you have problems to reach convergence in the first electronic loop, and you are not reading WAVECAR, set:

NELMDL = -9   # Number of non self-consistent electronic steps at the beginning (w/o CHG update)

Otherwise, vary these mixing scheme parameters (you can play with them):

AMIX   = 0.10            
BMIX   = 0.01           
AMIN   = 0.10          

If problems persist, increase BMIX and reduce AMIN:

AMIX   = 0.10            
BMIX   = 3.00            
AMIN   = 0.01             

If problems persist, read this [[14]]

References: [15] and [16]

Back to Núria López and Group / Scripts_for_VASP.