w90_readwrite_read_ws_data Subroutine

public subroutine w90_readwrite_read_ws_data(settings, ws_region, error, comm)

Uses

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

Reads "use_ws_distance", "ws_distance_tol", "ws_search_size"

Arguments

Type IntentOptional Attributes Name
type(settings_type), intent(inout) :: settings
type(ws_region_type), intent(inout) :: ws_region
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~w90_readwrite_read_ws_data~~CallsGraph proc~w90_readwrite_read_ws_data w90_readwrite_read_ws_data proc~set_error_input set_error_input proc~w90_readwrite_read_ws_data->proc~set_error_input proc~w90_readwrite_get_keyword w90_readwrite_get_keyword proc~w90_readwrite_read_ws_data->proc~w90_readwrite_get_keyword proc~w90_readwrite_get_keyword_vector w90_readwrite_get_keyword_vector proc~w90_readwrite_read_ws_data->proc~w90_readwrite_get_keyword_vector proc~w90_readwrite_get_vector_length w90_readwrite_get_vector_length proc~w90_readwrite_read_ws_data->proc~w90_readwrite_get_vector_length proc~comms_sync_error comms_sync_error proc~set_error_input->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_input->proc~set_base_error 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_vector->proc~set_error_input proc~w90_readwrite_get_keyword_vector->proc~set_error_fatal proc~w90_readwrite_get_vector_length->proc~set_error_input proc~w90_readwrite_get_vector_length->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_ws_data~~CalledByGraph proc~w90_readwrite_read_ws_data w90_readwrite_read_ws_data proc~w90_postw90_readwrite_read w90_postw90_readwrite_read proc~w90_postw90_readwrite_read->proc~w90_readwrite_read_ws_data proc~w90_wannier90_readwrite_read w90_wannier90_readwrite_read proc~w90_wannier90_readwrite_read->proc~w90_readwrite_read_ws_data 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_ws_data(settings, ws_region, error, comm)
    !! Reads "use_ws_distance", "ws_distance_tol", "ws_search_size"
    use w90_error, only: w90_error_type, set_error_input
    implicit none
    type(ws_region_type), intent(inout) :: ws_region
    type(w90_error_type), allocatable, intent(out) :: error
    type(w90_comm_type), intent(in) :: comm
    type(settings_type), intent(inout) :: settings

    integer :: i
    logical :: found

    call w90_readwrite_get_keyword(settings, 'use_ws_distance', found, error, comm, &
                                   l_value=ws_region%use_ws_distance)
    if (allocated(error)) return

    call w90_readwrite_get_keyword(settings, 'ws_distance_tol', found, error, comm, &
                                   r_value=ws_region%ws_distance_tol)
    if (allocated(error)) return

    call w90_readwrite_get_vector_length(settings, 'ws_search_size', found, i, error, comm)
    if (allocated(error)) return
    if (found) then
      if (i .eq. 1) then
        call w90_readwrite_get_keyword_vector(settings, 'ws_search_size', found, 1, error, comm, &
                                              i_value=ws_region%ws_search_size)
        if (allocated(error)) return
        ws_region%ws_search_size(2) = ws_region%ws_search_size(1)
        ws_region%ws_search_size(3) = ws_region%ws_search_size(1)
      elseif (i .eq. 3) then
        call w90_readwrite_get_keyword_vector(settings, 'ws_search_size', found, 3, error, comm, &
                                              i_value=ws_region%ws_search_size)
        if (allocated(error)) return
      else
        call set_error_input(error, &
                             'Error: ws_search_size must be provided as either one integer or a vector of three integers', comm)
        return
      end if
      if (any(ws_region%ws_search_size <= 0)) then
        call set_error_input(error, 'Error: ws_search_size elements must be greater than zero', comm)
        return
      end if
    end if
  end subroutine w90_readwrite_read_ws_data