1. 环境搭建

VASP安装教程

vasp安装

计算软件安装笔记

Exported on May 29, 2022

Table of Contents

No table of contents entries found.


1.基本

cd

tar -vzxf vasp.5.4.4.tar.gz(解压vasp)

cd vasp.5.4.4

cp arch/makefile.include.linux_intel .(把子文件夹makefile.include.linux_intel复制到本文件夹,注意句末的点)

mv makefile.include.linux_intel makefile.include(重命名)

vi makefile.include

i(打开编译模式)

在 OFLAG=-O2 行后加上 -xhost

OFLAG=-O2 行后加上 -xhost是针对AVX指令集的CPU。对于AMD的CPU,建议不加;对于至强E5 V4以上的版本,建议加;对于intel gold及以上,建议加AVX512


Esc

:(英文状态下)

wq!

待测试

在修改第30行,并在后面加上

OBJECTS = fftmpiw.o fftmpi_map.o fft3dlib.o fftw3d.o \

$(MKLROOT)/interfaces/fftw3xf/libfftw3xf_intel.a

2.固定晶格基矢

在对称性允许的条件下,VASP的晶胞优化(ISIF = 3)是允许在9个自由度上自由弛豫的,如果想要固定其中几个自由度需要用重新编译过的vasp。

重写constr_cell_relax.F,直接覆盖./src/的文件即可

constr_cell_relax.F

!———————————————————————–

!

! At present, VASP does not allow to relax the cellshape selectively

! i.e. for instance only cell relaxation in x direction.

! To be more precisse, this behaviour can not be achived via the INCAR

! or POSCAR file.

! However, it is possible to set selected components of the stress tensor

! to zero.

! The most conveninent position to do this is the routines

! CONSTR_CELL_RELAX (constraint cell relaxation).

! FCELL contains the forces on the basis vectors.

! These forces are used to modify the basis vectors according

! to the following equations:

!

! A_OLD(1:3,1:3)=A(1:3,1:3) ! F90 style

! DO J=1,3

! DO I=1,3

! DO K=1,3

! A(I,J)=A(I,J) + FCELL(I,K)*A_OLD(K,J)*STEP_SIZE

! ENDDO

! ENDDO

! ENDDO

! where A holds the basis vectors (in cartesian coordinates).

!

!———————————————————————–

SUBROUTINE CONSTR_CELL_RELAX(FCELL)

USE prec

REAL(q) FCELL(3,3)

! just one simple example

! relaxation in x directions only

! SAVE=FCELL(1,1)

! FCELL=0 ! F90 style: set the whole array to zero

! FCELL(1,1)=SAVE

! relaxation in z direction only

! SAVE=FCELL(3,3)

! FCELL=0 ! F90 style: set the whole array to zero

! FCELL(3,3)=SAVE

LOGICAL FILFLG

INTEGER ICELL(3,3)

INQUIRE(FILE=’OPTCELL’,EXIST=FILFLG)

IF (FILFLG) THEN

OPEN(67,FILE=’OPTCELL’,FORM=’FORMATTED’,STATUS=’OLD’)

DO J=1,3

READ(67,”(3I1)”) (ICELL(I,J),I=1,3)

ENDDO

CLOSE(67)

DO J=1,3

DO I=1,3

IF (ICELL(I,J)==0) FCELL(I,J)=0.0

ENDDO

ENDDO

ENDIF

RETURN

END SUBROUTINE

3.编译带wannier的vasp

https://github.com/Chengcheng-Xiao/VASP2WAN90_v2_fix

https://rehnd.github.io/tutorials/vasp/vasp-wannier90

先编译wannier,使用make lib生成libwannier.a库文件

再在vasp主文件夹makefile.include文件中添加以下两行

CPP_OPTIONS+=-DVASP2WANNIER90v2

LLIBS+=/public/software/wannier/libwannier.a



make all

多核编译可能会出问题,所以不使用make all -j 8

(完成)

使用mpirun -np 2 /root/vasp.5.4.4/bin/vasp_std运行vasp

参考文献 https://www.bilibili.com/video/BV1MJ411q7mB

vasp+vtst

{+}https://theory.cm.utexas.edu/vtsttools/installation.html+

1 解压vasp

tar -zxvf vasp.5.4.4.tar.gz

或初始化vasp

make veryclean

2 解压vtst软件

tar -zxvf vtstcode-184.tgz

3 修改vasp编译文件

修改 (home-vasp)/src/main.F 文件



CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &

LATT_CUR%A,LATT_CUR%B,IO%IU6)

修改为

CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &

TSIF,LATT_CUR%A,LATT_CUR%B,IO%IU6)

备份(home-vasp)/src/ chain.F文件

cp chain.F chain.F_back

修改(home-vasp)/src/. objects文件

在chain.o \ 关键词前添加

bfgs.o dynmat.o instanton.o lbfgs.o sd.o cg.o dimer.o bbm.o \

fire.o lanczos.o neb.o qm.o opt.o \

将(home-vtst)/vtstcode5/下的文件复制到(home-vasp)/src/文件夹下

cp (home-vtst)/vtstcode5/* (home-vasp)/src/

4 编译vasp

cp arch/makefile.include.linux_intel makefile.include

修改makefile.include文件

在 OFLAG=-O2 行后加上 -xhost


make all

vasp544+beef

beef安装包名:libbeef-0.1.1.tar.gz vasp.5.4.4.tar.gz

homedir=/public/software/vasp

  1. 安装beef

module load intel/2018

tar -zxvf vasp.5.4.4.tar.gz

tar -zxvf libbeef-0.1.1.tar.gz

cd libbeef-0.1.1

./configure –prefix=/public/software/vasp/beef

make

make install

(检查在/public/software/vasp/beef/lib文件夹内有无libbeef.a)

  1. 配置vasp

cd $homedir/vasp.5.4.4

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

(修改makefile.include)


-Dlibbeef


-L/public/software/vasp/beef/lib -lbeef

  1. 编译

make all

  1. 简单使用

(INCAR添加参数)

GGA = BF

LUSE_VDW = .TRUE.

Zab_VDW = -1.8867

LBEEFENS = .TRUE.

参考资料

http://wiki.tangzeyuan.com/software/vasp-compilation.html

https://confluence.slac.stanford.edu/display/SUNCAT/BEEF+Functional+Software

vasp544+sol

安装包名:VASPsol-master.zip vasp.5.4.4.tar.gz

homedir=homedir=/public/software/vasp

  1. sol准备

unzip VASPsol-master.zip

  1. 配置vasp

tar -zxvf vasp.5.4.4.tar.gz

cd $homedir/vasp.5.4.4

cp $homedir/VASPsol-master/src/solvation.F ./src


-Dsol_compat

cp ./src/pot.F ./src/pot.F_back

patch ./src/pot.F < $homedir/VASPsol-master/src/patches/pbz_patch_541

  1. 编译

make all

参考资料

https://mp.weixin.qq.com/s/pWLNZknUvLcYKw5IAlSaZg

https://github.com/henniggroup/VASPsol

安装完之后加可执行权限,不然没法运行
1、加最高权限

chmod 775  文件名

2、加可执行权限

chmod +x   文件名
Comments to: VASP安装教程

您的邮箱地址不会被公开。 必填项已用 * 标注