This routines returns the three integers that define the interpolation k-mesh, satisfying the condition that the spacing between two neighboring points along each of the three k_x, k_y and k_z directions is at smaller than a given spacing.
The reclat is defined as: * 'b_1' = (recip_lattice(1,I), i=1,3) * 'b_2' = (recip_lattice(2,I), i=1,3) * 'b_3' = (recip_lattice(3,I), i=1,3)
spacing must be > 0 (and in particular different from zero). We don't check this here.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | spacing |
Minimum spacing between neighboring points, in angstrom^(-1) |
||
| real(kind=dp), | intent(in) | :: | reclat(3,3) |
Matrix of the reciprocal lattice vectors in cartesian coordinates, in angstrom^(-1) |
||
| integer, | intent(out) | :: | mesh(3) |
Will contain the three integers defining the interpolation k-mesh |
subroutine w90_readwrite_set_kmesh(spacing, reclat, mesh) !! This routines returns the three integers that define the interpolation k-mesh, satisfying !! the condition that the spacing between two neighboring points along each of the three !! k_x, k_y and k_z directions is at smaller than a given spacing. !! !! The reclat is defined as: !! * 'b_1' = (recip_lattice(1,I), i=1,3) !! * 'b_2' = (recip_lattice(2,I), i=1,3) !! * 'b_3' = (recip_lattice(3,I), i=1,3) !! !! spacing must be > 0 (and in particular different from zero). We don't check this here. !! implicit none real(kind=dp), intent(in) :: spacing !! Minimum spacing between neighboring points, in angstrom^(-1) real(kind=dp), intent(in) :: reclat(3, 3) !! Matrix of the reciprocal lattice vectors in cartesian coordinates, in angstrom^(-1) integer, intent(out) :: mesh(3) !! Will contain the three integers defining the interpolation k-mesh real(kind=dp) :: blen(3) integer :: i do i = 1, 3 blen(i) = sqrt(sum(reclat(i, :)**2)) end do do i = 1, 3 mesh(i) = int(floor(blen(i)/spacing)) + 1 end do end subroutine w90_readwrite_set_kmesh