VASP.6.3.0版本新增一步法(Single-shot)计算能带。在实际测试时中当KPOINTS_OPT文件存在时,VASP的确会继续计算KPOINTS_OPT文件K点的本征值,但是如果不激活HDF5格式输出功能则不会输出PROCAR_OPT文件,因此VASPKIT现有版本不能处理一步法能带计算结果。可修改VASP代码使在不激活HDF5格式输出功能的情况下,当KPOINTS_OPT文件存在并执行VASP计算时自动输出PROCAR_OPT和EIGENVAL_OPT(新增)文件。具体操作如下:
第一步:删除vasp.6.3.0/src/linear_response.F文件中的1804-1827行代码;
#ifdef VASP_HDF5
CALL VH5_WRITE_DOS(IH5OUTFILEID, WDES_INTER, KPOINTS_INTER, DOS, DOSI, DOSPAR, EFERMI, &
T_INFO%NIONP, -1,SUBGROUP="electron_dos_kpoints_opt")
CALL VH5_WRITE_EIGENVAL(IH5OUTFILEID, WDES_INTER, W_INTER, KPOINTS_INTER, &
SUBGROUP="electron_eigenvalues_kpoints_opt")
! Write projections
IF (JOBPAR/=0 .OR. IO%LORBIT>=10) THEN
IF (IO%LORBIT==11.OR.IO%LORBIT==12) THEN
CALL VH5_WRITE_PROJECTORS(IH5OUTFILEID, T_INFO, WDES_INTER, W_INTER, IO%LORBIT, LPAR, PAR_INTER, LMCHAR, PHAS_INTER, &
SUBGROUP="projectors_kpoints_opt")
ELSE
CALL VH5_WRITE_PROJECTORS(IH5OUTFILEID, T_INFO, WDES_INTER, W_INTER, IO%LORBIT, LPAR, PAR_INTER, LCHAR, PHAS_INTER, &
SUBGROUP="projectors_kpoints_opt")
ENDIF
IF (IO%IU6>=0) THEN
CALL XML_PROCAR(PAR, W_INTER%CELTOT, W_INTER%FERTOT, WDES_INTER%NB_TOT, WDES_INTER%NKPTS, LPAR,&
T_INFO%NIONP, WDES_INTER%NCDIJ, TAG="projected_kpoints_opt")
OPEN(UNIT=99,FILE='PROCAR_OPT',STATUS='UNKNOWN')
CALL WRITE_PROCAR(99,W_INTER,WDES_INTER,IO%LORBIT,LPAR,LMDIMP,PAR_INTER,PHAS_INTER,T_INFO,KPOINTS%EMIN,KPOINTS%EMAX)
CLOSE(99)
ENDIF
ENDIF
#endif
并在此处新增以下代码
! Added support to VASPKIT
OPEN(UNIT=99,FILE='EIGENVAL_OPT',STATUS='UNKNOWN')
WRITE(99,'(4I5)') T_INFO%NIONS,T_INFO%NIONS,0.0,WDES_INTER%ISPIN
WRITE(99,'(5E15.7)') 0.d0,0.d0,0.d0,0.d0,0.d0
WRITE(99,'(1E15.7)') 0.d0
WRITE(99,*) ' CAR '
WRITE(99,*) INFO%SZNAM1
WRITE(99,'(3I7)') NINT(INFO%NELECT),WDES_INTER%NKPTS,WDES_INTER%NB_TOT
DO IK=1,WDES_INTER%NKPTS
WRITE(99,*)
WRITE(99,'((4E15.7))') WDES_INTER%VKPT(1,IK),WDES_INTER%VKPT(2,IK),WDES_INTER%VKPT(3,IK),WDES_INTER%WTKPT(IK)
DO I=1,WDES_INTER%NB_TOT
IF (WDES_INTER%ISPIN==1) WRITE(99,852) I,REAL( W_INTER%CELTOT(I,IK,1) ,KIND=q),W%FERTOT(I,IK,1)
IF (WDES_INTER%ISPIN==2) WRITE(99,853) I,(REAL( W_INTER%CELTOT(I,IK,ISP) ,KIND=q),ISP=1,WDES_INTER%ISPIN),(W%FERTOT(I,IK,ISP),ISP=1,WDES_INTER%ISPIN)
ENDDO
ENDDO
CLOSE(99)
852 FORMAT(1X,I6,4X,F14.6,2X,F9.6)
853 FORMAT(1X,I6,4X,F14.6,2X,F14.6,2X,F9.6,2X,F9.6)
IF (JOBPAR/=0 .OR. IO%LORBIT>=10) THEN
IF (IO%IU6>=0) THEN
CALL XML_PROCAR(PAR, W_INTER%CELTOT, W_INTER%FERTOT, WDES_INTER%NB_TOT, WDES_INTER%NKPTS, LPAR,&
T_INFO%NIONP, WDES_INTER%NCDIJ, TAG="projected_kpoints_opt")
OPEN(UNIT=99,FILE='PROCAR_OPT',STATUS='UNKNOWN')
CALL WRITE_PROCAR(99,W_INTER,WDES_INTER,IO%LORBIT,LPAR,LMDIMP,PAR_INTER,PHAS_INTER,T_INFO,KPOINTS%EMIN,KPOINTS%EMAX)
CLOSE(99)
ENDIF
ENDIF
#ifdef VASP_HDF5
CALL VH5_WRITE_DOS(IH5OUTFILEID, WDES_INTER, KPOINTS_INTER, DOS, DOSI, DOSPAR, EFERMI, &
T_INFO%NIONP, -1,SUBGROUP="electron_dos_kpoints_opt")
CALL VH5_WRITE_EIGENVAL(IH5OUTFILEID, WDES_INTER, W_INTER, KPOINTS_INTER, &
SUBGROUP="electron_eigenvalues_kpoints_opt")
! Write projections
IF (JOBPAR/=0 .OR. IO%LORBIT>=10) THEN
IF (IO%LORBIT==11.OR.IO%LORBIT==12) THEN
CALL VH5_WRITE_PROJECTORS(IH5OUTFILEID, T_INFO, WDES_INTER, W_INTER, IO%LORBIT, LPAR, PAR_INTER, LMCHAR, PHAS_INTER, &
SUBGROUP="projectors_kpoints_opt")
ELSE
CALL VH5_WRITE_PROJECTORS(IH5OUTFILEID, T_INFO, WDES_INTER, W_INTER, IO%LORBIT, LPAR, PAR_INTER, LCHAR, PHAS_INTER, &
SUBGROUP="projectors_kpoints_opt")
ENDIF
! IF (IO%IU6>=0) THEN
! CALL XML_PROCAR(PAR, W_INTER%CELTOT, W_INTER%FERTOT, WDES_INTER%NB_TOT, WDES_INTER%NKPTS, LPAR,&
! T_INFO%NIONP, WDES_INTER%NCDIJ, TAG="projected_kpoints_opt")
! OPEN(UNIT=99,FILE='PROCAR_OPT',STATUS='UNKNOWN')
! CALL WRITE_PROCAR(99,W_INTER,WDES_INTER,IO%LORBIT,LPAR,LMDIMP,PAR_INTER,PHAS_INTER,T_INFO,KPOINTS%EMIN,KPOINTS%EMAX)
! CLOSE(99)
! ENDIF
ENDIF
#endif
第二步:重新编译VASP.6.3.0;
第三步:cp KPATH.in KPOINTS_OPT并执行VASP计算,等计算结束后VASP修改版会自动生成EIGENVAL_OPT和PROCAR_OPT(LORBIT=10或11)文件;
第四步:如果正在使用VASPKIT.1.3.1或更旧版本,等VASP计算完成后还需执行cp KPOINTS_OPT KPOINTS,cp EIGENVAL_OPT EIGENVAL,cp PROCAR_OPT PROCAR
操作。VASPKIT.1.3.2或更新版本支持直接读取PROCAR_OPT和EIGENVAL_OPT,因此这一步可省略;
第五步:调用VASPKIT-21X提取(投影)能带计算结果。
如果您使用VASPKIT,请记得引用哦。
V. Wang, N. Xu, J.-C. Liu, G. Tang, W.-T. Geng, VASPKIT: A User-Friendly Interface Facilitating High-Throughput Computing and Analysis Using VASP Code, Computer Physics Communications 267, 108033, (2021), https://doi.org/10.1016/j.cpc.2021.108033
欢迎关注VASPKIT公众号
「感觉有帮助?一键投喂 牛奶/咖啡/冰阔乐!」
(๑>ڡ<)☆哇~太棒了!
使用微信扫描二维码完成支付