w90_readwrite_read_kpath Subroutine

public subroutine w90_readwrite_read_kpath(settings, kpoint_path, path_found, bands_plot, error, comm)

Uses

  • proc~~w90_readwrite_read_kpath~~UsesGraph proc~w90_readwrite_read_kpath w90_readwrite_read_kpath module~w90_error w90_error proc~w90_readwrite_read_kpath->module~w90_error module~w90_comms w90_comms module~w90_error->module~w90_comms module~w90_error_base w90_error_base module~w90_error->module~w90_error_base module~w90_comms->module~w90_error_base module~w90_constants w90_constants module~w90_comms->module~w90_constants

Read band plotting path variables: "kpoint_path" and "bands_num_points"

Arguments

Type IntentOptional Attributes Name
type(settings_type), intent(inout) :: settings
type(kpoint_path_type), intent(inout) :: kpoint_path
logical, intent(out) :: path_found
logical, intent(in) :: bands_plot
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~w90_readwrite_read_kpath~~CallsGraph proc~w90_readwrite_read_kpath w90_readwrite_read_kpath proc~set_error_alloc set_error_alloc proc~w90_readwrite_read_kpath->proc~set_error_alloc proc~set_error_dealloc set_error_dealloc proc~w90_readwrite_read_kpath->proc~set_error_dealloc proc~set_error_input set_error_input proc~w90_readwrite_read_kpath->proc~set_error_input proc~w90_readwrite_get_block_length w90_readwrite_get_block_length proc~w90_readwrite_read_kpath->proc~w90_readwrite_get_block_length proc~w90_readwrite_get_keyword w90_readwrite_get_keyword proc~w90_readwrite_read_kpath->proc~w90_readwrite_get_keyword proc~w90_readwrite_get_keyword_kpath w90_readwrite_get_keyword_kpath proc~w90_readwrite_read_kpath->proc~w90_readwrite_get_keyword_kpath proc~comms_sync_error comms_sync_error proc~set_error_alloc->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_alloc->proc~set_base_error proc~set_error_dealloc->proc~comms_sync_error proc~set_error_dealloc->proc~set_base_error proc~set_error_input->proc~comms_sync_error proc~set_error_input->proc~set_base_error proc~w90_readwrite_get_block_length->proc~set_error_input proc~w90_readwrite_get_keyword->proc~set_error_input proc~set_error_fatal set_error_fatal proc~w90_readwrite_get_keyword->proc~set_error_fatal proc~w90_readwrite_get_keyword_kpath->proc~set_error_input proc~set_error_fatal->proc~comms_sync_error proc~set_error_fatal->proc~set_base_error

Called by

proc~~w90_readwrite_read_kpath~~CalledByGraph proc~w90_readwrite_read_kpath w90_readwrite_read_kpath proc~w90_postw90_readwrite_read w90_postw90_readwrite_read proc~w90_postw90_readwrite_read->proc~w90_readwrite_read_kpath proc~w90_wannier90_readwrite_read w90_wannier90_readwrite_read proc~w90_wannier90_readwrite_read->proc~w90_readwrite_read_kpath proc~w90_input_reader~2 w90_input_reader proc~w90_input_reader~2->proc~w90_wannier90_readwrite_read proc~w90_input_setopt w90_input_setopt proc~w90_input_setopt->proc~w90_wannier90_readwrite_read program~postw90 postw90 program~postw90->proc~w90_postw90_readwrite_read proc~w90_input_reader w90_input_reader proc~w90_input_reader->proc~w90_input_reader~2 proc~w90_input_setopt_f w90_input_setopt_f proc~w90_input_setopt_f->proc~w90_input_setopt program~wannier wannier program~wannier->proc~w90_input_reader~2

Source Code

  subroutine w90_readwrite_read_kpath(settings, kpoint_path, path_found, bands_plot, error, comm)
    !! Read band plotting path variables: "kpoint_path" and "bands_num_points"
    use w90_error, only: w90_error_type, set_error_input, set_error_alloc, set_error_dealloc
    implicit none

    logical, intent(in) :: bands_plot
    logical, intent(out) :: path_found
    type(kpoint_path_type), intent(inout) :: kpoint_path
    type(settings_type), intent(inout) :: settings
    type(w90_comm_type), intent(in) :: comm
    type(w90_error_type), allocatable, intent(out) :: error

    integer :: i_temp, ierr, bands_num_spec_points
    logical :: found

    path_found = .false.
    bands_num_spec_points = 0

    call w90_readwrite_get_block_length(settings, 'kpoint_path', path_found, i_temp, error, comm)
    if (allocated(error)) return
    if (path_found) then
      bands_num_spec_points = i_temp*2
      if (allocated(kpoint_path%labels)) then
        deallocate (kpoint_path%labels, stat=ierr)
        if (ierr /= 0) then
          call set_error_dealloc(error, 'Error deallocating kpoint_path%labels &
          & in w90_readwrite_read_kpath', comm)
          return
        end if
      end if
      allocate (kpoint_path%labels(bands_num_spec_points), stat=ierr)
      if (ierr /= 0) then
        call set_error_alloc(error, 'Error allocating kpoint_path%labels in &
        & w90_readwrite_read_kpath', comm)
        return
      end if
      if (allocated(kpoint_path%points)) then
        deallocate (kpoint_path%points, stat=ierr)
        if (ierr /= 0) then
          call set_error_dealloc(error, 'Error deallocating kpoint_path%points in &
          & w90_readwrite_read_kpath', comm)
          return
        end if
      end if
      allocate (kpoint_path%points(3, bands_num_spec_points), stat=ierr)
      if (ierr /= 0) then
        call set_error_alloc(error, 'Error allocating kpoint_path%points&
        & in w90_readwrite_read_kpath', comm)
        return
      end if
      call w90_readwrite_get_keyword_kpath(settings, kpoint_path, error, comm)
      if (allocated(error)) return
    end if

    call w90_readwrite_get_keyword(settings, 'bands_num_points', found, error, comm, &
                                   i_value=kpoint_path%num_points_first_segment)
    if (allocated(error)) return
    if (bands_plot) then
      if (kpoint_path%num_points_first_segment < 0) then
        call set_error_input(error, 'Error: bands_num_points must be positive', comm)
        return
      end if
    end if
  end subroutine w90_readwrite_read_kpath