kmesh_check_condition Subroutine

private subroutine kmesh_check_condition(kmesh_input, bsat, bvector, bweight, multi, loop_order, num_x, num_y, num_z)

Uses

  • proc~~kmesh_check_condition~~UsesGraph proc~kmesh_check_condition kmesh_check_condition module~w90_types w90_types proc~kmesh_check_condition->module~w90_types module~w90_constants w90_constants module~w90_types->module~w90_constants

Check if the obtained bweight satisfy the conditions for finite-difference, including (B1).

Arguments

Type IntentOptional Attributes Name
type(kmesh_input_type), intent(inout) :: kmesh_input
logical, intent(inout) :: bsat
real(kind=dp), intent(in) :: bvector(3,maxval(multi),kmesh_input%max_shells_h)
real(kind=dp), intent(in) :: bweight(kmesh_input%max_shells_h)
integer, intent(in) :: multi(kmesh_input%search_shells)
integer, intent(in) :: loop_order
integer, intent(inout) :: num_x(:)
integer, intent(inout) :: num_y(:)
integer, intent(inout) :: num_z(:)

Called by

proc~~kmesh_check_condition~~CalledByGraph proc~kmesh_check_condition kmesh_check_condition proc~kmesh_shell_automatic kmesh_shell_automatic proc~kmesh_shell_automatic->proc~kmesh_check_condition proc~kmesh_get kmesh_get proc~kmesh_get->proc~kmesh_shell_automatic proc~w90_create_kmesh w90_create_kmesh proc~w90_create_kmesh->proc~kmesh_get program~postw90 postw90 program~postw90->proc~kmesh_get proc~w90_get_gkpb~2 w90_get_gkpb proc~w90_get_gkpb~2->proc~w90_create_kmesh proc~w90_get_nnkp~2 w90_get_nnkp proc~w90_get_nnkp~2->proc~w90_create_kmesh proc~w90_get_nn~2 w90_get_nn proc~w90_get_nn~2->proc~w90_create_kmesh proc~write_kmesh write_kmesh proc~write_kmesh->proc~w90_create_kmesh proc~w90_get_gkpb w90_get_gkpb proc~w90_get_gkpb->proc~w90_get_gkpb~2 proc~w90_get_nn w90_get_nn proc~w90_get_nn->proc~w90_get_nn~2 proc~w90_get_nnkp w90_get_nnkp proc~w90_get_nnkp->proc~w90_get_nnkp~2 program~wannier wannier program~wannier->proc~w90_get_nn~2 program~wannier->proc~write_kmesh

Source Code

  subroutine kmesh_check_condition(kmesh_input, bsat, bvector, bweight, multi, loop_order, num_x, num_y, num_z)
    !================================================
    !
    !!  Check if the obtained bweight satisfy the conditions for finite-difference, including (B1).
    !
    !================================================

    use w90_types, only: kmesh_input_type

    implicit none

    ! arguments
    type(kmesh_input_type), intent(inout) :: kmesh_input
    logical, intent(inout) :: bsat
    integer, intent(inout) :: num_x(:)
    integer, intent(inout) :: num_y(:)
    integer, intent(inout) :: num_z(:)
    integer, intent(in) :: multi(kmesh_input%search_shells)   ! the number of kpoints in the shell
    integer, intent(in) :: loop_order
    real(kind=dp), intent(in) :: bvector(3, maxval(multi), kmesh_input%max_shells_h)
    real(kind=dp), intent(in) :: bweight(kmesh_input%max_shells_h)

    ! local variables
    integer :: num_of_eqs
    integer :: loop_i, loop_s, loop_b
    real(kind=dp) :: delta

    num_of_eqs = (1 + loop_order)*(1 + 2*loop_order)
    do loop_i = 1, num_of_eqs
      delta = 0.0_dp
      do loop_s = 1, kmesh_input%num_shells
        do loop_b = 1, multi(kmesh_input%shell_list(loop_s))
          delta = delta + bweight(loop_s)*(bvector(1, loop_b, loop_s)**num_x(loop_i)) &
                  *(bvector(2, loop_b, loop_s)**num_y(loop_i)) &
                  *(bvector(3, loop_b, loop_s)**num_z(loop_i))
        end do
      end do
      if (loop_order .eq. 1 .and. (loop_i .eq. 1 .or. loop_i .eq. 3 .or. loop_i .eq. 6)) then
        if (abs(delta - 1.0_dp) > kmesh_input%tol) bsat = .false.
      else
        if (abs(delta) > kmesh_input%tol) bsat = .false.
      end if
    end do

  end subroutine kmesh_check_condition