2
! Copyright (C) 1996-2016 The SIESTA group
3
! This file is distributed under the terms of the
4
! GNU General Public License: see COPYING in the top directory
5
! or http://www.gnu.org/copyleft/gpl.txt .
6
! See Docs/Contributors.txt for a list of contributors.
10
! Contains data structures and routines to deal with the kpoint-grid
11
! for the self-consistent calculation
12
! Other uses (bands, optical, polarization) have their own structures.
14
use precision, only : dp
21
public :: setup_kpoint_scf
27
logical, save :: gamma_scf
28
type(kpoint_t), save :: kpoints_scf
32
subroutine setup_kpoint_scf( ucell )
33
use parallel, only: Node
34
use siesta_options, only: writek
35
use m_spin, only: TrSym
37
real(dp), intent(in) :: ucell(3,3)
39
call kpoint_read(kpoints_scf, '', ucell, TrSym)
41
gamma_scf = (kpoints_scf%N == 1 .and. &
42
dot_product(kpoints_scf%k(:,1),kpoints_scf%k(:,1)) < 1.0e-20_dp)
44
! Quick-return if non-IO
45
if ( Node /= 0 ) return
47
call kpoint_write_stdout(kpoints_scf, all=writek)
48
call kpoint_write_xml(kpoints_scf)
49
call kpoint_write_file(kpoints_scf, 'KP')
51
end subroutine setup_kpoint_scf
53
end module kpoint_scf_m