tran_read_htXY Subroutine

private subroutine tran_read_htXY(nxx1, nxx2, h_01, h_file, stdout, error, comm)

Uses

  • proc~~tran_read_htxy~~UsesGraph proc~tran_read_htxy tran_read_htXY module~w90_constants w90_constants proc~tran_read_htxy->module~w90_constants module~w90_error w90_error proc~tran_read_htxy->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_constants module~w90_comms->module~w90_error_base

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nxx1
integer, intent(in) :: nxx2
real(kind=dp), intent(out) :: h_01(nxx1,nxx2)
character(len=50), intent(in) :: h_file
integer, intent(in) :: stdout
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~tran_read_htxy~~CallsGraph proc~tran_read_htxy tran_read_htXY proc~set_error_file set_error_file proc~tran_read_htxy->proc~set_error_file proc~comms_sync_error comms_sync_error proc~set_error_file->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_file->proc~set_base_error

Called by

proc~~tran_read_htxy~~CalledByGraph proc~tran_read_htxy tran_read_htXY proc~tran_lcr tran_lcr proc~tran_lcr->proc~tran_read_htxy proc~tran_main tran_main proc~tran_main->proc~tran_lcr proc~w90_transport w90_transport proc~w90_transport->proc~tran_main program~wannier wannier program~wannier->proc~w90_transport

Source Code

  subroutine tran_read_htXY(nxx1, nxx2, h_01, h_file, stdout, error, comm)
    !================================================!

    use w90_constants, only: dp, maxlen
    use w90_error, only: w90_error_type, set_error_file, set_error_file

    implicit none

    type(w90_error_type), allocatable, intent(out) :: error
    type(w90_comm_type), intent(in) :: comm
    integer, intent(in) ::  nxx1, nxx2
    integer, intent(in) ::  stdout
    real(kind=dp), intent(out) :: h_01(nxx1, nxx2)
    character(len=50), intent(in) :: h_file

    integer :: i, j, nw1, nw2, file_unit
    character(len=maxlen) :: dummy

    open (newunit=file_unit, file=h_file, form='formatted', &
          status='old', action='read', err=101)

    write (stdout, '(/a)', advance='no') ' Reading H matrix from '//h_file//'  : '

    read (file_unit, '(a)', err=102, end=102) dummy
    write (stdout, '(a)') trim(dummy)

    read (file_unit, *, err=102, end=102) nw1, nw2

    if (nw1 .ne. nxx1 .or. nw2 .ne. nxx2) then
      call set_error_file(error, 'wrong matrix size in transport: read_htXY', comm)
      return
    end if

    read (file_unit, *, err=102, end=102) ((h_01(i, j), i=1, nxx1), j=1, nxx2)

    close (unit=file_unit)

    return

101 call set_error_file(error, 'Error: Problem opening input file '//h_file, comm)
    return
102 call set_error_file(error, 'Error: Problem reading input file '//h_file, comm)
    return

  end subroutine tran_read_htXY