w90_wannier90_readwrite_read_pw90spin Subroutine

private subroutine w90_wannier90_readwrite_read_pw90spin(settings, spin_moment, spin_decomp, pw90_spin, num_elec_per_state, error, comm)

Uses

  • proc~~w90_wannier90_readwrite_read_pw90spin~~UsesGraph proc~w90_wannier90_readwrite_read_pw90spin w90_wannier90_readwrite_read_pw90spin module~w90_comms w90_comms proc~w90_wannier90_readwrite_read_pw90spin->module~w90_comms module~w90_error w90_error proc~w90_wannier90_readwrite_read_pw90spin->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
logical, intent(inout) :: spin_moment
logical, intent(inout) :: spin_decomp
type(pw90_spin_mod_type), intent(inout) :: pw90_spin
integer, intent(in) :: num_elec_per_state
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

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

Source Code

  subroutine w90_wannier90_readwrite_read_pw90spin(settings, spin_moment, spin_decomp, pw90_spin, &
                                                   num_elec_per_state, error, comm)
    !================================================!

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

    implicit none
    logical, intent(inout) :: spin_moment ! from pw90_calculation
    logical, intent(inout) :: spin_decomp ! from pw90_common
    type(pw90_spin_mod_type), intent(inout) :: pw90_spin
    integer, intent(in) :: num_elec_per_state
    type(w90_error_type), allocatable, intent(out) :: error
    type(w90_comm_type), intent(in) :: comm
    type(settings_type), intent(inout) :: settings

    logical :: found

    call w90_readwrite_get_keyword(settings, 'spin_moment', found, error, comm, l_value=spin_moment)
    if (allocated(error)) return

    call w90_readwrite_get_keyword(settings, 'spin_axis_polar', found, error, comm, &
                                   r_value=pw90_spin%axis_polar)
    if (allocated(error)) return

    call w90_readwrite_get_keyword(settings, 'spin_axis_azimuth', found, error, comm, &
                                   r_value=pw90_spin%axis_azimuth)
    if (allocated(error)) return

    call w90_readwrite_get_keyword(settings, 'spin_decomp', found, error, comm, l_value=spin_decomp)
    if (allocated(error)) return

    if (spin_decomp .and. (num_elec_per_state .ne. 1)) then
      call set_error_input(error, 'spin_decomp can be true only if num_elec_per_state is 1', comm)
      return
    end if

  end subroutine w90_wannier90_readwrite_read_pw90spin