w90_readwrite_read_explicit_kpath_points Subroutine

private subroutine w90_readwrite_read_explicit_kpath_points(settings, kpt_latt, bohr, error, comm)

Uses

  • proc~~w90_readwrite_read_explicit_kpath_points~~UsesGraph proc~w90_readwrite_read_explicit_kpath_points w90_readwrite_read_explicit_kpath_points module~w90_error w90_error proc~w90_readwrite_read_explicit_kpath_points->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

Arguments

Type IntentOptional Attributes Name
type(settings_type), intent(inout) :: settings
real(kind=dp), intent(out), allocatable :: kpt_latt(:,:)
real(kind=dp), intent(in) :: bohr
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~w90_readwrite_read_explicit_kpath_points~~CallsGraph proc~w90_readwrite_read_explicit_kpath_points w90_readwrite_read_explicit_kpath_points proc~set_error_alloc set_error_alloc proc~w90_readwrite_read_explicit_kpath_points->proc~set_error_alloc proc~set_error_dealloc set_error_dealloc proc~w90_readwrite_read_explicit_kpath_points->proc~set_error_dealloc proc~set_error_input set_error_input proc~w90_readwrite_read_explicit_kpath_points->proc~set_error_input proc~w90_readwrite_get_block_length w90_readwrite_get_block_length proc~w90_readwrite_read_explicit_kpath_points->proc~w90_readwrite_get_block_length proc~w90_readwrite_get_keyword_block w90_readwrite_get_keyword_block proc~w90_readwrite_read_explicit_kpath_points->proc~w90_readwrite_get_keyword_block 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_block->proc~set_error_input proc~set_error_fatal set_error_fatal proc~w90_readwrite_get_keyword_block->proc~set_error_fatal proc~set_error_fatal->proc~comms_sync_error proc~set_error_fatal->proc~set_base_error

Called by

proc~~w90_readwrite_read_explicit_kpath_points~~CalledByGraph proc~w90_readwrite_read_explicit_kpath_points w90_readwrite_read_explicit_kpath_points proc~w90_readwrite_read_explicit_kpath w90_readwrite_read_explicit_kpath proc~w90_readwrite_read_explicit_kpath->proc~w90_readwrite_read_explicit_kpath_points proc~w90_wannier90_readwrite_read w90_wannier90_readwrite_read proc~w90_wannier90_readwrite_read->proc~w90_readwrite_read_explicit_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 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_explicit_kpath_points(settings, kpt_latt, bohr, &
                                                      error, comm)
    use w90_error, only: w90_error_type, set_error_input, set_error_alloc, set_error_dealloc
    implicit none

    ! arguments
    real(kind=dp), allocatable, intent(out) :: kpt_latt(:, :)
    real(kind=dp), intent(in) :: bohr
    type(settings_type), intent(inout) :: settings
    type(w90_comm_type), intent(in) :: comm
    type(w90_error_type), allocatable, intent(out) :: error

    ! local variables
    real(kind=dp), allocatable :: kpt_cart(:, :)
    integer :: ierr, num_kpts
    logical :: found

    ! pw90_effective_model ignores kpt_cart
    ! this routine allocates the intent(out) kpt_latt

    call w90_readwrite_get_block_length(settings, 'explicit_kpath', found, num_kpts, error, comm)

    ierr = 0

    allocate (kpt_latt(3, num_kpts), stat=ierr)
    if (ierr /= 0) then
      call set_error_alloc(error, 'Error allocating kpt_latt in w90_readwrite_read_explicit_kpath_points', comm)
      return
    end if

    allocate (kpt_cart(3, num_kpts), stat=ierr)
    if (ierr /= 0) then
      call set_error_alloc(error, 'Error allocating kpt_cart in w90_readwrite_read_explicit_kpath_points', comm)
      return
    end if

    call w90_readwrite_get_keyword_block(settings, 'explicit_kpath', found, num_kpts, 3, bohr, error, &
                                         comm, r_value=kpt_cart)
    if (allocated(error)) return
    if (.not. found) then
      call set_error_input(error, 'Error: Found explicit_kpath_labels but there is no explicit_kpath block', comm)
      return
    end if
    kpt_latt = kpt_cart

    deallocate (kpt_cart, stat=ierr)
    if (ierr /= 0) then
      call set_error_dealloc(error, 'Error deallocating kpt_cart in w90_readwrite_read_explicit_kpath_points', comm)
      return
    end if
  end subroutine w90_readwrite_read_explicit_kpath_points