~albertog/siesta/trunk-nlso

« back to all changes in this revision

Viewing changes to Src/kpoint_scf.F90

  • Committer: Alberto Garcia
  • Date: 2018-06-04 16:10:46 UTC
  • mfrom: (697.2.2 trunk)
  • Revision ID: albertog@icmab.es-20180604161046-fsufw3pl21dnb5g5
Sync to trunk-699

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
! ---
 
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.
 
7
! ---
 
8
module kpoint_scf_m
 
9
  !
 
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.
 
13
  !
 
14
  use precision, only : dp
 
15
  
 
16
  ! The k-point-type
 
17
  use kpoint_t_m
 
18
 
 
19
  implicit none
 
20
 
 
21
  public :: setup_kpoint_scf
 
22
  public :: kpoints_scf
 
23
  public :: gamma_scf
 
24
  
 
25
  private
 
26
 
 
27
  logical, save :: gamma_scf
 
28
  type(kpoint_t), save :: kpoints_scf
 
29
 
 
30
contains
 
31
 
 
32
  subroutine setup_kpoint_scf( ucell )
 
33
    use parallel, only: Node
 
34
    use siesta_options, only: writek
 
35
    use m_spin, only: TrSym
 
36
 
 
37
    real(dp), intent(in) :: ucell(3,3)
 
38
 
 
39
    call kpoint_read(kpoints_scf, '', ucell, TrSym)
 
40
 
 
41
    gamma_scf = (kpoints_scf%N == 1 .and. &
 
42
        dot_product(kpoints_scf%k(:,1),kpoints_scf%k(:,1)) < 1.0e-20_dp)
 
43
 
 
44
    ! Quick-return if non-IO
 
45
    if ( Node /= 0 ) return
 
46
 
 
47
    call kpoint_write_stdout(kpoints_scf, all=writek)
 
48
    call kpoint_write_xml(kpoints_scf)
 
49
    call kpoint_write_file(kpoints_scf, 'KP')
 
50
 
 
51
  end subroutine setup_kpoint_scf
 
52
  
 
53
end module kpoint_scf_m