Check if the obtained bweight satisfy the conditions for finite-difference, including (B1).
| Type | Intent | Optional | 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(:) |
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