plot_calc_projection Subroutine

private subroutine plot_calc_projection(num_bands, num_wann, num_kpts, u_matrix_opt, eigval, lwindow, timing_level, iprint, stdout, timer)

Uses

  • proc~~plot_calc_projection~~UsesGraph proc~plot_calc_projection plot_calc_projection module~w90_comms w90_comms proc~plot_calc_projection->module~w90_comms module~w90_constants w90_constants proc~plot_calc_projection->module~w90_constants module~w90_error w90_error proc~plot_calc_projection->module~w90_error module~w90_io w90_io proc~plot_calc_projection->module~w90_io module~w90_types w90_types proc~plot_calc_projection->module~w90_types module~w90_comms->module~w90_constants module~w90_error_base w90_error_base module~w90_comms->module~w90_error_base module~w90_error->module~w90_comms module~w90_error->module~w90_error_base module~w90_io->module~w90_constants module~w90_types->module~w90_constants

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: num_bands
integer, intent(in) :: num_wann
integer, intent(in) :: num_kpts
complex(kind=dp), intent(in) :: u_matrix_opt(:,:,:)
real(kind=dp), intent(in) :: eigval(:,:)
logical, intent(in) :: lwindow(:,:)
integer, intent(in) :: timing_level
integer, intent(in) :: iprint
integer, intent(in) :: stdout
type(timer_list_type), intent(inout) :: timer

Calls

proc~~plot_calc_projection~~CallsGraph proc~plot_calc_projection plot_calc_projection proc~io_stopwatch_start io_stopwatch_start proc~plot_calc_projection->proc~io_stopwatch_start proc~io_stopwatch_stop io_stopwatch_stop proc~plot_calc_projection->proc~io_stopwatch_stop

Called by

proc~~plot_calc_projection~~CalledByGraph proc~plot_calc_projection plot_calc_projection proc~plot_main plot_main proc~plot_main->proc~plot_calc_projection proc~w90_plot w90_plot proc~w90_plot->proc~plot_main program~wannier wannier program~wannier->proc~w90_plot

Source Code

  subroutine plot_calc_projection(num_bands, num_wann, num_kpts, u_matrix_opt, eigval, lwindow, &
                                  timing_level, iprint, stdout, timer)
    !================================================!
    !
    ! Calculates and writes the projection of each Wannier function
    ! on the original bands within the outer window.
    !
    !================================================!

    use w90_comms, only: w90_comm_type
    use w90_constants, only: dp
    use w90_error, only: w90_error_type
    use w90_io, only: io_stopwatch_start, io_stopwatch_stop
    use w90_types, only: timer_list_type

    implicit none

    ! arguments
    type(timer_list_type), intent(inout) :: timer
    integer, intent(in) :: num_bands
    integer, intent(in) :: num_kpts
    integer, intent(in) :: num_wann
    integer, intent(in) :: stdout
    integer, intent(in) :: timing_level, iprint
    logical, intent(in) :: lwindow(:, :)
    complex(kind=dp), intent(in) :: u_matrix_opt(:, :, :)
    real(kind=dp), intent(in) :: eigval(:, :)

    ! local variables
    integer :: nw, nb, nkp, counter
    real(kind=dp) :: summ

    if (timing_level > 1 .and. iprint > 0) call io_stopwatch_start('wann: calc_projection', timer)

    if (iprint > 0) then
      write (stdout, '(/1x,a78)') repeat('-', 78)
      write (stdout, '(1x,9x,a)') &
        'Projection of Bands in Outer Window on all Wannier Functions'
      write (stdout, '(1x,8x,62a)') repeat('-', 62)
      write (stdout, '(1x,16x,a)') '   Kpt  Band      Eigval      |Projection|^2'
      write (stdout, '(1x,16x,a47)') repeat('-', 47)
    end if

    do nkp = 1, num_kpts
      counter = 0
      do nb = 1, num_bands
        if (lwindow(nb, nkp)) then
          counter = counter + 1
          summ = 0.0_dp
          do nw = 1, num_wann
            summ = summ + abs(u_matrix_opt(counter, nw, nkp))**2
          end do
          if (iprint > 0) write (stdout, '(1x,16x,i5,1x,i5,1x,f14.6,2x,f14.8)') &
            nkp, nb, eigval(nb, nkp), summ
        end if
      end do
    end do
    if (iprint > 0) write (stdout, '(1x,a78/)') repeat('-', 78)

    if (timing_level > 1 .and. iprint > 0) call io_stopwatch_stop('wann: calc_projection', timer)

    return

  end subroutine plot_calc_projection