w90_readwrite_read_num_bands Subroutine

public subroutine w90_readwrite_read_num_bands(settings, pw90_effective_model, num_bands, num_wann, error, comm)

Uses

  • proc~~w90_readwrite_read_num_bands~~UsesGraph proc~w90_readwrite_read_num_bands w90_readwrite_read_num_bands module~w90_error w90_error proc~w90_readwrite_read_num_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 the number of bands ("num_bands") If not specified (and exclude_bands and total_bands are not both provided), defaults to num_wann

Arguments

Type IntentOptional Attributes Name
type(settings_type), intent(inout) :: settings
logical, intent(in) :: pw90_effective_model
integer, intent(inout) :: num_bands
integer, intent(in) :: num_wann
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~w90_readwrite_read_num_bands~~CallsGraph proc~w90_readwrite_read_num_bands w90_readwrite_read_num_bands proc~set_error_input set_error_input proc~w90_readwrite_read_num_bands->proc~set_error_input proc~w90_readwrite_get_keyword w90_readwrite_get_keyword proc~w90_readwrite_read_num_bands->proc~w90_readwrite_get_keyword 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~set_error_fatal->proc~comms_sync_error proc~set_error_fatal->proc~set_base_error

Called by

proc~~w90_readwrite_read_num_bands~~CalledByGraph proc~w90_readwrite_read_num_bands w90_readwrite_read_num_bands proc~w90_postw90_readwrite_read w90_postw90_readwrite_read proc~w90_postw90_readwrite_read->proc~w90_readwrite_read_num_bands proc~w90_wannier90_readwrite_read_special w90_wannier90_readwrite_read_special proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_num_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_num_bands(settings, pw90_effective_model, num_bands, num_wann, &
                                          error, comm)
    !! Read the number of bands ("num_bands")
    !! If not specified (and exclude_bands and total_bands are not both provided), defaults to num_wann
    use w90_error, only: w90_error_type, set_error_input
    implicit none

    integer, intent(in) :: num_wann
    integer, intent(inout) :: num_bands
    logical, intent(in) :: pw90_effective_model
    type(settings_type), intent(inout) :: settings
    type(w90_comm_type), intent(in) :: comm
    type(w90_error_type), allocatable, intent(out) :: error

    integer :: i_temp
    logical :: found

    call w90_readwrite_get_keyword(settings, 'num_bands', found, error, comm, i_value=i_temp)
    if (allocated(error)) return

    ! in the pw90_effective_model case, this variable is ignored
    if (.not. pw90_effective_model) then
      if (found) then
        num_bands = i_temp
        if (num_bands < num_wann) then
          call set_error_input(error, &
                               'Error: num_bands must be greater than or equal to num_wann', comm)
          return
        end if
      else
        num_bands = num_wann
      end if
    end if
  end subroutine w90_readwrite_read_num_bands