subroutine tran_read_htX(nxx, h_00, 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) :: nxx
real(kind=dp), intent(out) :: h_00(nxx, nxx), h_01(nxx, nxx)
character(len=50), intent(in) :: h_file
!
integer :: i, j, nw, 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) nw
if (nw .ne. nxx) call io_error('wrong matrix size in transport: read_htX')
read (file_unit, *) ((h_00(i, j), i=1, nxx), j=1, nxx)
read (file_unit, *, err=102, end=102) nw
if (nw .ne. nxx) call io_error('wrong matrix size in transport: read_htX')
read (file_unit, *, err=102, end=102) ((h_01(i, j), i=1, nxx), j=1, nxx)
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_htX