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

Intent

Optional

Attributes

Name

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

Nodes of different colours represent the following:

Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.

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 nonereal(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-meshreal(kind=dp),dimension(3)::bleninteger::ido i=1,3blen(i)=sqrt(sum(reclat(i,:)**2))end do do i=1,3mesh(i)=int(floor(blen(i)/spacing))+1end do end subroutine internal_set_kmesh