internal_set_kmesh Subroutine

private subroutine internal_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.

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(in) :: spacing

Minimum spacing between neighboring points, in angstrom^(-1)

real(kind=dp), intent(in), dimension(3, 3):: reclat

Matrix of the reciprocal lattice vectors in cartesian coordinates, in angstrom^(-1)

integer, intent(out), dimension(3):: mesh

Will contain the three integers defining the interpolation k-mesh


Called by

proc~~internal_set_kmesh~~CalledByGraph proc~internal_set_kmesh internal_set_kmesh proc~get_module_kmesh get_module_kmesh proc~get_module_kmesh->proc~internal_set_kmesh proc~param_read param_read proc~param_read->proc~internal_set_kmesh proc~param_read->proc~get_module_kmesh program~wannier wannier program~wannier->proc~param_read program~postw90 postw90 program~postw90->proc~param_read proc~wannier_run wannier_run proc~wannier_run->proc~param_read proc~wannier_setup wannier_setup proc~wannier_setup->proc~param_read

Contents

Source Code


Source Code

  subroutine internal_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), dimension(3, 3), intent(in) :: reclat
    !! Matrix of the reciprocal lattice vectors in cartesian coordinates, in angstrom^(-1)
    integer, dimension(3), intent(out) :: mesh
    !! Will contain the three integers defining the interpolation k-mesh

    real(kind=dp), dimension(3) :: blen
    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 internal_set_kmesh