June 2018: RM and SP Write to file the matrix elements of bvector and their weights This is used by EPW to compute the velocity. You need "write_bvec = .true." in your wannier input
subroutine plot_bvec()
!!
!! June 2018: RM and SP
!! Write to file the matrix elements of bvector and their weights
!! This is used by EPW to compute the velocity.
!! You need "write_bvec = .true." in your wannier input
!!
!============================================!
use w90_parameters, only: wb, bk, num_kpts, nntot
use w90_io, only: io_error, io_file_unit, seedname, io_date
!
implicit none
!
integer :: nkp, nn, file_unit
character(len=33) :: header
character(len=9) :: cdate, ctime
!
file_unit = io_file_unit()
open (file_unit, file=trim(seedname)//'.bvec', form='formatted', status='unknown', err=101)
call io_date(cdate, ctime)
header = 'written on '//cdate//' at '//ctime
!
open (file_unit, file=trim(seedname)//'.bvec', form='formatted', status='unknown', err=101)
write (file_unit, *) header ! Date and time
write (file_unit, *) num_kpts, nntot
do nkp = 1, num_kpts
do nn = 1, nntot
write (file_unit, '(4F12.6)') bk(:, nn, nkp), wb(nn)
enddo
enddo
close (file_unit)
!
return
!
101 call io_error('Error: plot_bvec: problem opening file '//trim(seedname)//'.bvec')
end subroutine plot_bvec