Wannier90 UNK files with spin orbit coupling
Posted: Tue Jun 11, 2024 8:23 am
Dear VASP developers,
I would like to address an issue regarding the UNK****.NC files generated by VASP 6.4.3 when setting LWRITE_UNK=True and LSORBIT=True.
When reading these files to plot the Wannier functions, wannier90 stops with an "end of file while reading" error.
forrtl: severe (24): end-of-file during read, unit 11, file /****/UNK00001.NC
This error occurs because the UNK files are not written correctly. So, I suggest to modify lines 3189-3190 in the mlwf.F file as follows:
3189,3190c3189,3194
< IF (WP%WDES%COMM%NODE_ME==WP%WDES%COMM%IONODE.AND.IU>=0) &
< WRITE(IU) (CMPLX(WVFN(I),KIND=W90_REAL_KIND),I=1,NPW*W%WDES%NRSPINORS)
---
> IF (WP%WDES%COMM%NODE_ME==WP%WDES%COMM%IONODE.AND.IU>=0) THEN
> DO ISPINOR=1,W%WDES%NRSPINORS
> NPWS = NPW*(ISPINOR-1)
> WRITE(IU) (CMPLX(WVFN(I),KIND=W90_REAL_KIND),I=1+NPWS,NPW+NPWS)
> ENDDO
> ENDIF
I would like to address an issue regarding the UNK****.NC files generated by VASP 6.4.3 when setting LWRITE_UNK=True and LSORBIT=True.
When reading these files to plot the Wannier functions, wannier90 stops with an "end of file while reading" error.
forrtl: severe (24): end-of-file during read, unit 11, file /****/UNK00001.NC
This error occurs because the UNK files are not written correctly. So, I suggest to modify lines 3189-3190 in the mlwf.F file as follows:
3189,3190c3189,3194
< IF (WP%WDES%COMM%NODE_ME==WP%WDES%COMM%IONODE.AND.IU>=0) &
< WRITE(IU) (CMPLX(WVFN(I),KIND=W90_REAL_KIND),I=1,NPW*W%WDES%NRSPINORS)
---
> IF (WP%WDES%COMM%NODE_ME==WP%WDES%COMM%IONODE.AND.IU>=0) THEN
> DO ISPINOR=1,W%WDES%NRSPINORS
> NPWS = NPW*(ISPINOR-1)
> WRITE(IU) (CMPLX(WVFN(I),KIND=W90_REAL_KIND),I=1+NPWS,NPW+NPWS)
> ENDDO
> ENDIF