subroutine w90_wannier90_readwrite_read_pw90_kpath(settings, pw90_calculation, pw90_kpath, &
kpoint_path, error, comm)
!================================================!
use w90_error, only: w90_error_type
use w90_comms, only: w90_comm_type
implicit none
type(pw90_calculation_type), intent(in) :: pw90_calculation
type(pw90_kpath_mod_type), intent(inout) :: pw90_kpath
type(kpoint_path_type), intent(in) :: kpoint_path
type(w90_error_type), allocatable, intent(out) :: error
type(w90_comm_type), intent(in) :: comm
type(settings_type), intent(inout) :: settings
logical :: found
call w90_readwrite_get_keyword(settings, 'kpath_task', found, error, comm, &
c_value=pw90_kpath%task)
if (allocated(error)) return
if (pw90_calculation%kpath .and. index(pw90_kpath%task, 'bands') == 0 .and. &
index(pw90_kpath%task, 'curv') == 0 .and. &
index(pw90_kpath%task, 'morb') == 0 .and. &
index(pw90_kpath%task, 'shc') == 0) then
call set_error_input(error, 'Error: value of kpath_task not recognised in w90_wannier90_readwrite_read', comm)
return
end if
if (.not. allocated(kpoint_path%labels) .and. pw90_calculation%kpath) then
call set_error_input(error, 'Error: a kpath plot has been requested but there is no kpoint_path block', comm)
return
end if
call w90_readwrite_get_keyword(settings, 'kpath_num_points', found, error, comm, &
i_value=pw90_kpath%num_points)
if (allocated(error)) return
if (pw90_kpath%num_points < 0) then
call set_error_input(error, 'Error: kpath_num_points must be positive', comm)
return
end if
call w90_readwrite_get_keyword(settings, 'kpath_bands_colour', found, error, comm, &
c_value=pw90_kpath%bands_colour)
if (allocated(error)) return
if (pw90_calculation%kpath .and. index(pw90_kpath%bands_colour, 'none') == 0 .and. &
index(pw90_kpath%bands_colour, 'spin') == 0 .and. &
index(pw90_kpath%bands_colour, 'shc') == 0) then
call set_error_input(error, 'Error: value of kpath_bands_colour not recognised in w90_wannier90_readwrite_read', comm)
return
end if
if (pw90_calculation%kpath .and. index(pw90_kpath%task, 'shc') > 0 .and. &
index(pw90_kpath%task, 'spin') > 0) then
call set_error_input(error, "Error: kpath_task cannot include both 'shc' and 'spin'", comm)
return
end if
end subroutine w90_wannier90_readwrite_read_pw90_kpath