VASP编译汇总

VASP编译汇总

1. 正常版本VASP编译

tar -vaxf vasp.5.4.4.tar.gz
cd vasp.5.4.4
cp arch/makefile.include.linux_intel .
mv makefile.include.linux_intel makefile.include
vi makefile.include  在OFLAG = -O2行后加上 -xhost
make all

2. 固定轴版VASP编译

在正常编译的基础上,需要修改vasp.5.4.4/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

按照刘锦程的教程,详见:VASP固定基矢优化结构方法

注意OPTCELL文件的写法,中间是没有空格的

100
110
000

3. 过渡态版VASP编译

下载并解压vtstcode.tgz,将目录内的所有文件复制到vasp.5.4.4/src下

修改src/main.F (5.4.4大概在3146行)

       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)
    !   LATT_CUR%A,LATT_CUR%B,IO%IU6)

修改src/.objects,在chain.o之前添加下面两行(大概在67行)

  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 \

注意 \之后不能有空格

暂无评论

发送评论 编辑评论


				
上一篇
下一篇