w90_wannier90_readwrite_read_transport Subroutine

private subroutine w90_wannier90_readwrite_read_transport(settings, transport, tran, restart, error, comm)

Uses

  • proc~~w90_wannier90_readwrite_read_transport~~UsesGraph proc~w90_wannier90_readwrite_read_transport w90_wannier90_readwrite_read_transport module~w90_error w90_error proc~w90_wannier90_readwrite_read_transport->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_error_base module~w90_constants w90_constants module~w90_comms->module~w90_constants

Arguments

Type IntentOptional Attributes Name
type(settings_type), intent(inout) :: settings
logical, intent(in) :: transport
type(transport_type), intent(inout) :: tran
character(len=*), intent(inout) :: restart
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~w90_wannier90_readwrite_read_transport~~CallsGraph proc~w90_wannier90_readwrite_read_transport w90_wannier90_readwrite_read_transport proc~set_error_input set_error_input proc~w90_wannier90_readwrite_read_transport->proc~set_error_input proc~w90_readwrite_get_keyword w90_readwrite_get_keyword proc~w90_wannier90_readwrite_read_transport->proc~w90_readwrite_get_keyword proc~comms_sync_error comms_sync_error proc~set_error_input->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_input->proc~set_base_error proc~w90_readwrite_get_keyword->proc~set_error_input proc~set_error_fatal set_error_fatal proc~w90_readwrite_get_keyword->proc~set_error_fatal proc~set_error_fatal->proc~comms_sync_error proc~set_error_fatal->proc~set_base_error

Called by

proc~~w90_wannier90_readwrite_read_transport~~CalledByGraph proc~w90_wannier90_readwrite_read_transport w90_wannier90_readwrite_read_transport proc~w90_wannier90_readwrite_read w90_wannier90_readwrite_read proc~w90_wannier90_readwrite_read->proc~w90_wannier90_readwrite_read_transport proc~w90_input_reader~2 w90_input_reader proc~w90_input_reader~2->proc~w90_wannier90_readwrite_read proc~w90_input_setopt w90_input_setopt proc~w90_input_setopt->proc~w90_wannier90_readwrite_read proc~w90_input_reader w90_input_reader proc~w90_input_reader->proc~w90_input_reader~2 proc~w90_input_setopt_f w90_input_setopt_f proc~w90_input_setopt_f->proc~w90_input_setopt program~wannier wannier program~wannier->proc~w90_input_reader~2

Source Code

  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