w90_wannier90_readwrite_read_band_plot Subroutine

private subroutine w90_wannier90_readwrite_read_band_plot(settings, band_plot, num_wann, has_kpath, has_explicit_kpath, bands_plot, error, comm)

Uses

  • proc~~w90_wannier90_readwrite_read_band_plot~~UsesGraph proc~w90_wannier90_readwrite_read_band_plot w90_wannier90_readwrite_read_band_plot module~w90_error w90_error proc~w90_wannier90_readwrite_read_band_plot->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
type(band_plot_type), intent(inout) :: band_plot
integer, intent(in) :: num_wann
logical, intent(in) :: has_kpath
logical, intent(in) :: has_explicit_kpath
logical, intent(in) :: bands_plot
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~w90_wannier90_readwrite_read_band_plot~~CallsGraph proc~w90_wannier90_readwrite_read_band_plot w90_wannier90_readwrite_read_band_plot proc~set_error_alloc set_error_alloc proc~w90_wannier90_readwrite_read_band_plot->proc~set_error_alloc proc~set_error_dealloc set_error_dealloc proc~w90_wannier90_readwrite_read_band_plot->proc~set_error_dealloc proc~set_error_input set_error_input proc~w90_wannier90_readwrite_read_band_plot->proc~set_error_input proc~w90_readwrite_get_keyword w90_readwrite_get_keyword proc~w90_wannier90_readwrite_read_band_plot->proc~w90_readwrite_get_keyword proc~w90_readwrite_get_range_vector w90_readwrite_get_range_vector proc~w90_wannier90_readwrite_read_band_plot->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_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_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_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~set_error_fatal->proc~comms_sync_error proc~set_error_fatal->proc~set_base_error 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

Called by

proc~~w90_wannier90_readwrite_read_band_plot~~CalledByGraph proc~w90_wannier90_readwrite_read_band_plot w90_wannier90_readwrite_read_band_plot proc~w90_wannier90_readwrite_read w90_wannier90_readwrite_read proc~w90_wannier90_readwrite_read->proc~w90_wannier90_readwrite_read_band_plot 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_wannier90_readwrite_read_band_plot(settings, band_plot, num_wann, has_kpath, &
                                                    has_explicit_kpath, bands_plot, error, comm)
    !================================================!
    ! Plotting
    !================================================!
    use w90_error, only: w90_error_type
    implicit none

    integer, intent(in) :: num_wann
    logical, intent(in) :: bands_plot
    logical, intent(in) :: has_kpath
    logical, intent(in) :: has_explicit_kpath
    type(band_plot_type), intent(inout) :: band_plot
    type(settings_type), intent(inout) :: settings
    type(w90_comm_type), intent(in) :: comm
    type(w90_error_type), allocatable, intent(out) :: error

    integer :: ierr, num_project
    logical :: found

    call w90_readwrite_get_keyword(settings, 'bands_plot_format', found, error, comm, &
                                   c_value=band_plot%format)
    if (allocated(error)) return

    call w90_readwrite_get_keyword(settings, 'bands_plot_mode', found, error, comm, c_value=band_plot%mode)
    if (allocated(error)) return

    num_project = 0
    call w90_readwrite_get_range_vector(settings, 'bands_plot_project', found, num_project, .true., error, comm)
    if (allocated(error)) return
    if (found) then
      if (num_project < 1) then
        call set_error_input(error, 'Error: problem reading bands_plot_project', comm)
        return
      end if
      if (allocated(band_plot%project)) then
        deallocate (band_plot%project, stat=ierr)
        if (ierr /= 0) then
          call set_error_dealloc(error, 'Error deallocating bands_plot%project in &
          & w90_wannier90_readwrite_read_band_plot', comm)
          return
        end if
      end if
      allocate (band_plot%project(num_project), stat=ierr)
      if (ierr /= 0) then
        call set_error_alloc(error, 'Error allocating bands_plot%project in w90_wannier90_readwrite_read_band_plot', comm)
        return
      end if
      call w90_readwrite_get_range_vector(settings, 'bands_plot_project', found, &
                                          num_project, .false., error, comm, band_plot%project)
      if (allocated(error)) return
      if (any(band_plot%project < 1) .or. any(band_plot%project > num_wann)) then
        call set_error_input(error, 'Error: bands_plot_project asks for a non-valid wannier function to be projected', comm)
        return
      end if
    end if

    if ((.not. has_kpath) .and. (.not. has_explicit_kpath) .and. bands_plot) then
      call set_error_input(error, &
                           'A bandstructure plot has been requested but there is no kpoint_path or explicit_kpath block', comm)
      return
    end if

    ! checks
    if (bands_plot) then
      if ((index(band_plot%format, 'gnu') .eq. 0) .and. &
          (index(band_plot%format, 'xmgr') .eq. 0)) then
        call set_error_input(error, 'Error: bands_plot_format not recognised', comm)
        return
      end if
      if ((index(band_plot%mode, 's-k') .eq. 0) .and. (index(band_plot%mode, 'cut') .eq. 0)) then
        call set_error_input(error, 'Error: bands_plot_mode not recognised', comm)
        return
      end if
    end if

  end subroutine w90_wannier90_readwrite_read_band_plot