w90_wannier90_readwrite_read_smearing Subroutine

private subroutine w90_wannier90_readwrite_read_smearing(settings, pw90_smearing, error, comm)

Uses

  • proc~~w90_wannier90_readwrite_read_smearing~~UsesGraph proc~w90_wannier90_readwrite_read_smearing w90_wannier90_readwrite_read_smearing module~w90_comms w90_comms proc~w90_wannier90_readwrite_read_smearing->module~w90_comms module~w90_error w90_error proc~w90_wannier90_readwrite_read_smearing->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_smearing_type), intent(inout) :: pw90_smearing
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~w90_wannier90_readwrite_read_smearing~~CallsGraph proc~w90_wannier90_readwrite_read_smearing w90_wannier90_readwrite_read_smearing proc~set_error_input set_error_input proc~w90_wannier90_readwrite_read_smearing->proc~set_error_input proc~w90_readwrite_get_keyword w90_readwrite_get_keyword proc~w90_wannier90_readwrite_read_smearing->proc~w90_readwrite_get_keyword proc~w90_readwrite_get_smearing_index w90_readwrite_get_smearing_index proc~w90_wannier90_readwrite_read_smearing->proc~w90_readwrite_get_smearing_index 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~w90_readwrite_get_smearing_index->proc~set_error_input proc~set_error_fatal->proc~comms_sync_error proc~set_error_fatal->proc~set_base_error

Called by

proc~~w90_wannier90_readwrite_read_smearing~~CalledByGraph proc~w90_wannier90_readwrite_read_smearing w90_wannier90_readwrite_read_smearing proc~w90_postw90_readwrite_read w90_postw90_readwrite_read proc~w90_postw90_readwrite_read->proc~w90_wannier90_readwrite_read_smearing proc~w90_postw90_readwrite_readall w90_postw90_readwrite_readall proc~w90_postw90_readwrite_readall->proc~w90_wannier90_readwrite_read_smearing program~postw90 postw90 program~postw90->proc~w90_postw90_readwrite_read

Source Code

  subroutine w90_wannier90_readwrite_read_smearing(settings, pw90_smearing, error, comm)
    !================================================!

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

    implicit none
    type(pw90_smearing_type), intent(inout) :: pw90_smearing
    type(w90_error_type), allocatable, intent(out) :: error
    type(w90_comm_type), intent(in) :: comm
    type(settings_type), intent(inout) :: settings

    logical :: found
    character(len=maxlen)              :: ctmp
    ! [gp-begin, Apr 20, 2012]

    ! By default: Gaussian
    call w90_readwrite_get_keyword(settings, 'smr_type', found, error, comm, c_value=ctmp)
    if (allocated(error)) return
    if (found) then
      pw90_smearing%type_index = w90_readwrite_get_smearing_index(ctmp, 'smr_type', error, comm)
      if (allocated(error)) return
    end if

    ! By default: adaptive smearing
    call w90_readwrite_get_keyword(settings, 'adpt_smr', found, error, comm, &
                                   l_value=pw90_smearing%use_adaptive)
    if (allocated(error)) return

    ! By default: a=sqrt(2)
    call w90_readwrite_get_keyword(settings, 'adpt_smr_fac', found, error, comm, &
                                   r_value=pw90_smearing%adaptive_prefactor)
    if (allocated(error)) return
    if (found .and. (pw90_smearing%adaptive_prefactor <= 0._dp)) then
      call set_error_input(error, 'Error: adpt_smr_fac must be greater than zero', comm)
      return
    end if

    ! By default: 1 eV
    call w90_readwrite_get_keyword(settings, 'adpt_smr_max', found, error, comm, &
                                   r_value=pw90_smearing%adaptive_max_width)
    if (allocated(error)) return
    if (pw90_smearing%adaptive_max_width <= 0._dp) then
      call set_error_input(error, 'Error: adpt_smr_max must be greater than zero', comm)
      return
    end if

    ! By default: if adpt_smr is manually set to false by the user, but he/she doesn't
    ! define smr_fixed_en_width: NO smearing, i.e. just the histogram
    call w90_readwrite_get_keyword(settings, 'smr_fixed_en_width', found, error, comm, &
                                   r_value=pw90_smearing%fixed_width)
    if (allocated(error)) return
    if (found .and. (pw90_smearing%fixed_width < 0._dp)) then
      call set_error_input(error, 'Error: smr_fixed_en_width must be greater than or equal to zero', comm)
      return
    end if
  end subroutine w90_wannier90_readwrite_read_smearing