subroutine w90_wannier90_readwrite_read_transport(settings, transport, tran, restart, error, comm)
!================================================!
! Transport
!================================================!
use w90_error, only: w90_error_type
implicit none
character(len=*), intent(inout) :: restart
logical, intent(in) :: transport
type(settings_type), intent(inout) :: settings
type(transport_type), intent(inout) :: tran
type(w90_comm_type), intent(in) :: comm
type(w90_error_type), allocatable, intent(out) :: error
logical :: found
call w90_readwrite_get_keyword(settings, 'tran_read_ht', found, error, comm, &
l_value=tran%read_ht)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_easy_fix', found, error, comm, &
l_value=tran%easy_fix)
if (allocated(error)) return
if (transport .and. tran%read_ht) restart = ' '
call w90_readwrite_get_keyword(settings, 'transport_mode', found, error, comm, &
c_value=tran%mode)
if (allocated(error)) return
! if ( .not.tran_read_ht .and. (index(transport_mode,'lcr').ne.0) ) then
! call set_error_input(error, 'Error: transport_mode.eq.lcr not compatible with tran_read_ht.eq.false', comm)
! return
! endif
call w90_readwrite_get_keyword(settings, 'tran_win_min', found, error, comm, &
r_value=tran%win_min)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_win_max', found, error, comm, &
r_value=tran%win_max)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_energy_step', found, error, comm, &
r_value=tran%energy_step)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_num_bb', found, error, comm, i_value=tran%num_bb)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_num_ll', found, error, comm, i_value=tran%num_ll)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_num_rr', found, error, comm, i_value=tran%num_rr)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_num_cc', found, error, comm, i_value=tran%num_cc)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_num_lc', found, error, comm, i_value=tran%num_lc)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_num_cr', found, error, comm, i_value=tran%num_cr)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_num_bandc', found, error, comm, &
i_value=tran%num_bandc)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_write_ht', found, error, comm, &
l_value=tran%write_ht)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_use_same_lead', found, error, comm, &
l_value=tran%use_same_lead)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_num_cell_ll', found, error, comm, &
i_value=tran%num_cell_ll)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_num_cell_rr', found, error, comm, &
i_value=tran%num_cell_rr)
if (allocated(error)) return
call w90_readwrite_get_keyword(settings, 'tran_group_threshold', found, error, comm, &
r_value=tran%group_threshold)
if (allocated(error)) return
! checks
if (transport) then
if ((index(tran%mode, 'bulk') .eq. 0) .and. (index(tran%mode, 'lcr') .eq. 0)) then
call set_error_input(error, 'Error: transport_mode not recognised', comm)
return
end if
if (tran%num_bb < 0) then
call set_error_input(error, 'Error: tran_num_bb < 0', comm)
return
end if
if (tran%num_ll < 0) then
call set_error_input(error, 'Error: tran_num_ll < 0', comm)
return
end if
if (tran%num_rr < 0) then
call set_error_input(error, 'Error: tran_num_rr < 0', comm)
return
end if
if (tran%num_cc < 0) then
call set_error_input(error, 'Error: tran_num_cc < 0', comm)
return
end if
if (tran%num_lc < 0) then
call set_error_input(error, 'Error: tran_num_lc < 0', comm)
return
end if
if (tran%num_cr < 0) then
call set_error_input(error, 'Error: tran_num_cr < 0', comm)
return
end if
if (tran%num_bandc < 0) then
call set_error_input(error, 'Error: tran_num_bandc < 0', comm)
return
end if
if (tran%num_cell_ll < 0) then
call set_error_input(error, 'Error: tran_num_cell_ll < 0', comm)
return
end if
if (tran%num_cell_rr < 0) then
call set_error_input(error, 'Error: tran_num_cell_rr < 0', comm)
return
end if
if (tran%group_threshold < 0.0_dp) then
call set_error_input(error, 'Error: tran_group_threshold < 0', comm)
return
end if
end if
end subroutine w90_wannier90_readwrite_read_transport