top of page

Compile VASPsol codes into VASP

Updated: Apr 25


VASPsol, developed by Kiran Mathew and Dr. Richard Hennig (https://github.com/henniggroup/VASPsol/blob/master/README.md), is an implicit solvation model that describes the effect of electrostatics, cavitation, and dispersion on the interaction between a solute and solvent into the plane-wave DFT code VASP (v. 5.2+).

It provides a efficient approach to estimate the solvation effects for large periodic systems (e.g. catalyst surfaces) with good interoperability with standard ultrasoft pseudopotential and projector-augmented wave potential libraries. For publication purposes, please cite the following papers:

  • Implicit solvation model for density-functional study of nanocrystal surfaces and reaction pathways. K. Mathew, R. Sundararaman, K. Letchworth-Weaver, T. A. Arias, and R. G. Hennig, J. Chem. Phys. 140, 084106 (2014), [doi:10.1063/1.4865107] (https://doi.org/10.1063/1.4865107).

  • Implicit self-consistent electrolyte model in plane-wave density-functional theory. K. Mathew, V. S. C. Kolluru, S. Mula, S. N. Steinmann, and R. G. Hennig, J. Chem. Phys. 151, 234101 (2019), [doi:10.1063/1.5132354] (https://doi.org/10.1063/1.5132354).


Three steps for the compilation of VASPsol

1. Prepare the makefile for normal VASP compilation

Copy one of the makefile.include.arch files in /your_VASP_directory/arch to /your_VASP_directory/makefile.include. Take one that most closely reflects your system (hopefully):

cp /your_VASP_directory/arch/makefile.include.linux_intel  /your_VASP_directory/makefile.include

and make modifications based on the requirements of your complier (for more information, please refer to https://www.vasp.at/wiki/index.php/Category:Installation), including but not limited to the following settings:

FC = mpifort
FCL = mpifort -mkl=sequential -lstdc++
OFLAG = -O3
MKL_PATH = /software/intel/2019.5/compilers_and_libraries_2019.5.281/linux/mkl/lib/intel64

Make sure that the make.include can successfully compile normal VASP codes.

2. Add the VASPsol codes into VASP codes

  • Download VASPsol from

https://github.com/henniggroup/VASPsol/blob/master/README.md.

  • For VASP >= 5.4.4, update the solvation routines by

cp /your_VASPsol_directory/src/solvation.F* /your_VASP_directory/src/.
  • To ensure the solvation module's compatibility with the newer versions of vasp please add **-Dsol_compat** option to the list of precompiler options(CPP_OPTIONS) in the makefile (attached a makefile.include in Section 3).

  • For VASP 5.4.1 and 6+, see below:

---Specifically for VASP 5.4.1---
- To compute the FERMI_SHIFT as mentioned in the documentation in the VASPsol webpage, minor modification is required to the pot.F file. This can be done by cp /your_VASPsol_directory/src/patches/pbz_patch_541 /your_VASP_directory/src/.
- patch src/pot.F < <path to the pbz_patch_541 patch file>
--- Specifically for VASP 6+---
For VASP6 versions >= 6.1.0, there is currently a patch in /your_VASPsol_directory/src/patches/VASPsol6.patch. This patch applies the FERMI_SHIFT patch to the pot.F as well as providing additional subroutines.
- copy solvation.F from path_to_VASPsol/src/solvation.F to path_to_VASP6_install/src/
- Navigate to path_to_VASP6_install/src/ and modify the .objects file by ensuring that “solvation.o” appears before “pot.o”
- Set the CPP option "-Dsol_compat" in the VASP makefile.include file.
- Compile the code as described in the instructions on the VASP wiki.
- cd vasp.6.1.0 and patch -p0 < <path to the pbz_patch_610 patch file>

3. Build VASP with VASPsol codes

When you've finished setting up makefile.include, build VASP:

make all

or

make gam # or std, ncl

Below is an example of the makefile.include on the Quest HPC Cluster at Northwestern University (Take vasp 5.4.4 as an example):

# Precompiler options
CPP_OPTIONS= -DHOST=\"LinuxIFC\"\
             -DMPI -DMPI_BLOCK=8000 \
             -Duse_collective \
             -DscaLAPACK \
             -DCACHE_SIZE=4000 \
             -Davoidalloc \
             -Duse_bse_te \
             -Dtbdyn \
             -Duse_shmem \
             -Dsol_compat # For VASPsol
CPP        = fpp