w90_readwrite_read_exclude_bands Subroutine

public subroutine w90_readwrite_read_exclude_bands(settings, exclude_bands, num_exclude_bands, error, comm)

Uses

  • proc~~w90_readwrite_read_exclude_bands~~UsesGraph proc~w90_readwrite_read_exclude_bands w90_readwrite_read_exclude_bands module~w90_error w90_error proc~w90_readwrite_read_exclude_bands->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 (and allocate) excluded_bands list "exclude_bands"

Arguments

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

Calls

proc~~w90_readwrite_read_exclude_bands~~CallsGraph proc~w90_readwrite_read_exclude_bands w90_readwrite_read_exclude_bands proc~set_error_alloc set_error_alloc proc~w90_readwrite_read_exclude_bands->proc~set_error_alloc proc~set_error_input set_error_input proc~w90_readwrite_read_exclude_bands->proc~set_error_input proc~w90_readwrite_get_range_vector w90_readwrite_get_range_vector proc~w90_readwrite_read_exclude_bands->proc~w90_readwrite_get_range_vector 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_input->proc~comms_sync_error proc~set_error_input->proc~set_base_error proc~w90_readwrite_get_range_vector->proc~set_error_input proc~w90_readwrite_get_keyword_vector w90_readwrite_get_keyword_vector proc~w90_readwrite_get_range_vector->proc~w90_readwrite_get_keyword_vector proc~w90_readwrite_get_vector_length w90_readwrite_get_vector_length proc~w90_readwrite_get_range_vector->proc~w90_readwrite_get_vector_length proc~w90_readwrite_get_keyword_vector->proc~set_error_input proc~set_error_fatal set_error_fatal 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_exclude_bands~~CalledByGraph proc~w90_readwrite_read_exclude_bands w90_readwrite_read_exclude_bands proc~w90_postw90_readwrite_read w90_postw90_readwrite_read proc~w90_postw90_readwrite_read->proc~w90_readwrite_read_exclude_bands proc~w90_wannier90_readwrite_read_special w90_wannier90_readwrite_read_special proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_exclude_bands proc~input_reader_special input_reader_special proc~input_reader_special->proc~w90_wannier90_readwrite_read_special proc~w90_input_setopt w90_input_setopt proc~w90_input_setopt->proc~w90_wannier90_readwrite_read_special program~postw90 postw90 program~postw90->proc~w90_postw90_readwrite_read proc~w90_input_setopt_f w90_input_setopt_f proc~w90_input_setopt_f->proc~w90_input_setopt program~wannier wannier program~wannier->proc~input_reader_special

Source Code

  subroutine w90_readwrite_read_exclude_bands(settings, exclude_bands, num_exclude_bands, error, &
                                              comm)
    !! Read (and allocate) excluded_bands list "exclude_bands"
    use w90_error, only: w90_error_type, set_error_input, set_error_alloc
    implicit none

    integer, allocatable, intent(inout) :: exclude_bands(:)
    integer, intent(out) :: num_exclude_bands
    type(settings_type), intent(inout) :: settings
    type(w90_comm_type), intent(in) :: comm
    type(w90_error_type), allocatable, intent(out) :: error

    integer :: ierr
    logical :: found = .false.

    num_exclude_bands = 0
    call w90_readwrite_get_range_vector(settings, 'exclude_bands', found, num_exclude_bands, &
                                        .true., error, comm)
    if (allocated(error)) return

    if (found) then
      if (num_exclude_bands < 1) then
        call set_error_input(error, 'Error: problem reading exclude_bands', comm)
        return
      end if
      allocate (exclude_bands(num_exclude_bands), stat=ierr)
      if (ierr /= 0) then
        call set_error_alloc(error, &
                             'Error allocating exclude_bands in w90_readwrite_read_exclude_bands', comm)
        return
      end if
      call w90_readwrite_get_range_vector(settings, 'exclude_bands', found, num_exclude_bands, &
                                          .false., error, comm, exclude_bands)
      if (allocated(error)) return
      if (any(exclude_bands < 1)) then
        call set_error_input(error, 'Error: exclude_bands must contain positive numbers', comm)
        return
      end if
    end if
  end subroutine w90_readwrite_read_exclude_bands