w90_wannier90_readwrite_read_spin_hall Subroutine

private subroutine w90_wannier90_readwrite_read_spin_hall(settings, pw90_calculation, scissors_shift, pw90_spin_hall, berry_task, error, comm)

Uses

  • proc~~w90_wannier90_readwrite_read_spin_hall~~UsesGraph proc~w90_wannier90_readwrite_read_spin_hall w90_wannier90_readwrite_read_spin_hall module~w90_comms w90_comms proc~w90_wannier90_readwrite_read_spin_hall->module~w90_comms module~w90_error w90_error proc~w90_wannier90_readwrite_read_spin_hall->module~w90_error module~w90_constants w90_constants module~w90_comms->module~w90_constants module~w90_error_base w90_error_base module~w90_comms->module~w90_error_base module~w90_error->module~w90_comms module~w90_error->module~w90_error_base

Arguments

Type IntentOptional Attributes Name
type(settings_type), intent(inout) :: settings
type(pw90_calculation_type), intent(in) :: pw90_calculation
real(kind=dp), intent(in) :: scissors_shift
type(pw90_spin_hall_type), intent(inout) :: pw90_spin_hall
character(len=*), intent(in) :: berry_task
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~w90_wannier90_readwrite_read_spin_hall~~CallsGraph proc~w90_wannier90_readwrite_read_spin_hall w90_wannier90_readwrite_read_spin_hall proc~set_error_input set_error_input proc~w90_wannier90_readwrite_read_spin_hall->proc~set_error_input proc~w90_readwrite_get_keyword w90_readwrite_get_keyword proc~w90_wannier90_readwrite_read_spin_hall->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_spin_hall~~CalledByGraph proc~w90_wannier90_readwrite_read_spin_hall w90_wannier90_readwrite_read_spin_hall proc~w90_postw90_readwrite_read w90_postw90_readwrite_read proc~w90_postw90_readwrite_read->proc~w90_wannier90_readwrite_read_spin_hall proc~w90_postw90_readwrite_readall w90_postw90_readwrite_readall proc~w90_postw90_readwrite_readall->proc~w90_wannier90_readwrite_read_spin_hall program~postw90 postw90 program~postw90->proc~w90_postw90_readwrite_read

Source Code

  subroutine w90_wannier90_readwrite_read_spin_hall(settings, pw90_calculation, scissors_shift, &
                                                    pw90_spin_hall, berry_task, error, comm)
    !================================================!

    use w90_error, only: w90_error_type
    use w90_comms, only: w90_comm_type

    implicit none

    type(pw90_calculation_type), intent(in) :: pw90_calculation
    type(pw90_spin_hall_type), intent(inout) :: pw90_spin_hall
    type(w90_error_type), allocatable, intent(out) :: error
    type(w90_comm_type), intent(in) :: comm
    type(settings_type), intent(inout) :: settings

    real(kind=dp), intent(in) :: scissors_shift

    character(len=*), intent(in) :: berry_task

    logical :: found, transl_inv_full

    transl_inv_full = .false.

    call w90_readwrite_get_keyword(settings, 'shc_freq_scan', found, error, comm, &
                                   l_value=pw90_spin_hall%freq_scan)
    if (allocated(error)) return

    call w90_readwrite_get_keyword(settings, 'shc_alpha', found, error, comm, &
                                   i_value=pw90_spin_hall%alpha)
    if (allocated(error)) return
    if (found .and. (pw90_spin_hall%alpha < 1 .or. pw90_spin_hall%alpha > 3)) then
      call set_error_input(error, 'Error:  shc_alpha must be 1, 2 or 3', comm)
      return
    end if

    call w90_readwrite_get_keyword(settings, 'shc_beta', found, error, comm, &
                                   i_value=pw90_spin_hall%beta)
    if (allocated(error)) return
    if (found .and. (pw90_spin_hall%beta < 1 .or. pw90_spin_hall%beta > 3)) then
      call set_error_input(error, 'Error:  shc_beta must be 1, 2 or 3', comm)
      return
    end if

    call w90_readwrite_get_keyword(settings, 'shc_gamma', found, error, comm, &
                                   i_value=pw90_spin_hall%gamma)
    if (allocated(error)) return
    if (found .and. (pw90_spin_hall%gamma < 1 .or. pw90_spin_hall%gamma > 3)) then
      call set_error_input(error, 'Error:  shc_gamma must be 1, 2 or 3', comm)
      return
    end if

    call w90_readwrite_get_keyword(settings, 'shc_bandshift', found, error, comm, &
                                   l_value=pw90_spin_hall%bandshift)
    if (allocated(error)) return
    pw90_spin_hall%bandshift = pw90_spin_hall%bandshift .and. pw90_calculation%berry .and. &
                               .not. (index(berry_task, 'shc') == 0)
    if ((abs(scissors_shift) > 1.0e-7_dp) .and. pw90_spin_hall%bandshift) then
      call set_error_input(error, 'Error: shc_bandshift and scissors_shift cannot be used simultaneously', comm)
      return
    end if

    call w90_readwrite_get_keyword(settings, 'shc_bandshift_firstband', found, error, comm, &
                                   i_value=pw90_spin_hall%bandshift_firstband)
    if (allocated(error)) return
    if (pw90_spin_hall%bandshift .and. (.not. found)) then
      call set_error_input(error, 'Error: shc_bandshift required but no shc_bandshift_firstband provided', comm)
      return
    end if
    if ((pw90_spin_hall%bandshift_firstband < 1) .and. found) then
      call set_error_input(error, 'Error: shc_bandshift_firstband must >= 1', comm)
      return
    end if

    call w90_readwrite_get_keyword(settings, 'shc_bandshift_energyshift', found, error, comm, &
                                   r_value=pw90_spin_hall%bandshift_energyshift)
    if (allocated(error)) return
    if (pw90_spin_hall%bandshift .and. (.not. found)) then
      call set_error_input(error, 'Error: shc_bandshift required but no shc_bandshift_energyshift provided', comm)
      return
    end if

    call w90_readwrite_get_keyword(settings, 'shc_method', found, error, comm, &
                                   c_value=pw90_spin_hall%method)
    if (allocated(error)) return
    if (index(berry_task, 'shc') > 0 .and. .not. found) then
      call set_error_input(error, 'Error: berry_task=shc and shc_method is not set', comm)
      return
    end if
    if (index(berry_task, 'shc') > 0 .and. index(pw90_spin_hall%method, 'qiao') == 0 &
        .and. index(pw90_spin_hall%method, 'ryoo') == 0) then
      call set_error_input(error, 'Error: value of shc_method not recognised in w90_wannier90_readwrite_read', comm)
      return
    end if
    if (index(pw90_spin_hall%method, 'qiao') > 0) then
      call w90_readwrite_get_keyword(settings, 'transl_inv_full', found, error, comm, &
                                     l_value=transl_inv_full)
      if (transl_inv_full) then
        call set_error_input(error, 'Error: transl_inv_full=T not implemented for shc_method=qiao', comm)
        return
      end if
    end if

  end subroutine w90_wannier90_readwrite_read_spin_hall