tran_read_htXY Subroutine

private subroutine tran_read_htXY(nxx1, nxx2, h_01, h_file)

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_io w90_io proc~tran_read_htxy->module~w90_io module~w90_io->module~w90_constants

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: nxx1
integer, intent(in) :: nxx2
real(kind=dp), intent(out) :: h_01(nxx1,nxx2)
character(len=50), intent(in) :: h_file

Calls

proc~~tran_read_htxy~~CallsGraph proc~tran_read_htxy tran_read_htXY proc~io_file_unit io_file_unit proc~tran_read_htxy->proc~io_file_unit

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 program~wannier wannier program~wannier->proc~tran_main proc~wannier_run wannier_run proc~wannier_run->proc~tran_main

Contents

Source Code


Source Code

  subroutine tran_read_htXY(nxx1, nxx2, h_01, h_file)
    !============================================!

    use w90_constants, only: dp
    use w90_io, only: stdout, io_file_unit, io_error, maxlen

    implicit none

    integer, intent(in) ::  nxx1, nxx2
    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

    file_unit = io_file_unit()

    open (unit=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) call io_error('wrong matrix size in transport: read_htXY')

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

    close (unit=file_unit)

    return

101 call io_error('Error: Problem opening input file '//h_file)
102 call io_error('Error: Problem reading input file '//h_file)

  end subroutine tran_read_htXY