Research Profile

Seek and you shall find...

VASP 5.4.4 and Wannier90 Version 3.x

In this post, I am going to have some comments on the compilation of VASP 5.4.4 with Wannier90 3.1.0.

For those who are familiar with VASP, in order to include the interface to Wannier90, one needs to specify:

• '-DVASP2WANNIER90' pre-compiler flag to interface with version 1.
• '-DVASP2WANNIER90v2' pre-compiler flag to interface with version 2 (from VASP 5.4.4).

(In addition to the linking with Wannier90 library libwannier.a, see here for details).

How about the pre-compiler flag for the interface to version 3?

If we look at the subroutine wannier_setup of Wannier90 (in file wannier_lib.F90):
• For version 1:
subroutine wannier_setup(seed__name, mp_grid_loc, num_kpts_loc, &
real_lattice_loc, recip_lattice_loc, kpt_latt_loc, num_bands_tot, &
num_atoms_loc, atom_symbols_loc, atoms_cart_loc, gamma_only_loc, spinors_loc, &
nntot_loc, nnlist_loc, nncell_loc, num_bands_loc, num_wann_loc, &
proj_site_loc, proj_l_loc, proj_m_loc, proj_radial_loc, proj_z_loc, &
proj_x_loc, proj_zona_loc, exclude_bands_loc)
...

• For version 2:
subroutine wannier_setup(seed__name, mp_grid_loc, num_kpts_loc, &
real_lattice_loc, recip_lattice_loc, kpt_latt_loc, num_bands_tot, &
num_atoms_loc, atom_symbols_loc, atoms_cart_loc, gamma_only_loc, spinors_loc, &
nntot_loc, nnlist_loc, nncell_loc, num_bands_loc, num_wann_loc, &
proj_site_loc, proj_l_loc, proj_m_loc, proj_radial_loc, proj_z_loc, &
proj_x_loc, proj_zona_loc, exclude_bands_loc, proj_s_loc, proj_s_qaxis_loc)
...
integer, dimension(num_bands_tot), optional, intent(out) :: proj_s_loc
real(kind=dp), dimension(3, num_bands_tot), optional, intent(out) :: proj_s_qaxis_loc
...

We can see that the subroutine in version 2 has two additional variables as compared to version 1: proj_s_loc and proj_s_qaxis_loc (spinor channel and quantization axis for spinor projection). As stated in the variable declaration, they are specified as "optional, intent(out)". Up to version 5.4.4, VASP does not use these quantities yet, and as such, there should not be a problem in calling the subroutine of version 2. In VASP 5.4.4, the '-DVASP2WANNIER90v2' flag was added for Wannier90 2.x to distinguish from the '-DVASP2WANNIER90' flag for Wannier90 1.x (in file mlwf.F):
...
#ifdef VASP2WANNIER90
INTERFACE
subroutine wannier_setup( &
seed_name_, mp_grid_, num_kpts_, real_lattice_, recip_lattice_, &
...
#ifdef VASP2WANNIER90v2
, proj_s_, proj_s_qaxis_ &
#endif
...
#ifdef VASP2WANNIER90v2
integer, dimension(num_bands_tot_), optional, intent(out) :: proj_s_
real(kind=dp), dimension(3, num_bands_tot_), optional, intent(out) :: proj_s_qaxis_
#endif
end subroutine wannier_setup
...

Now, for Wannier90 version 3, the variable list of the subroutine wannier_setup is identical to that of version 2. Therefore, to interface VASP 5.4.4 with Wannier90 version 3, the use of '-DVASP2WANNIER90v2' pre-compiler flag is still valid.

Final note: If the spin-orbit coupling is turned on, the number of projections cannot be calculated correctly. In this case, a fix to VASP/Wannier90 interface might be needed before compiling VASP. For more details, please refer to this patch.