16
16
use atmfuncs, only: nofis, nkbfis, izofis, massfis,
17
17
$ rcut, atmpopfio, zvalfis
18
18
use atm_types, only: species
19
use siesta_geom, only: na_u, na_s, xa, isa, xalast
22
23
public :: initatomlists, superc, superx
25
26
! Instead of "generic" na, no, and nokb, we use:
27
28
! For "supercell" (intended for k-point calcs)
28
integer, save, public :: na_s ! Number of atoms
29
29
integer, save, public :: no_s ! Number of orbitals
30
30
integer, save, public :: nokb_s ! Number of KB projs
32
32
! Same for "unit", or "real" cell:
33
integer, save, public :: na_u, no_u, nokb_u
33
integer, save, public :: no_u, nokb_u
34
integer, save, public :: no_l=1 ! Local to node
35
36
! Here 'na' is a generic number. It could be na_u or na_s, depending
36
37
! on whether we need a supercell or not.
38
C integer isa(na) : Species index of each atom
39
C character cisa(na) : Reference string for each atom
40
39
C character*2 elem(na) : Element name of each atom.
41
40
C integer lasto(0:na) : Position of last orbital of each atom
42
41
C integer lastkb(0:na) : Position of last KB proj. of each atom
44
43
C real*8 amass(na) : Atomic mass of each atom
45
44
C real*8 qa(na) : Neutral atom charge of each atom
47
integer, pointer, save, public :: isa(:) !
48
character(len=11), allocatable, save, public :: cisa(:) !
49
! NB cisa is this length in order to contain "siesta:e<isa>"
50
! where isa is the siesta element index, and we allow max 999
52
character(len=2), allocatable, save, public :: elem(:)
46
character(len=2), pointer, save, public :: elem(:)
53
47
! elem will contain element names, so is 2 chars in length
54
48
integer, pointer, save, public :: iza(:) !
55
49
integer, pointer, save, public :: lasto(:) !
56
50
integer, pointer, save, public :: lastkb(:)
57
51
real(dp), pointer, save, public :: amass(:), qa(:)
59
real(dp), pointer, save, public :: xa(:,:)
61
real(dp), pointer, save, public :: xalast(:,:)
62
! Atomic coordinates (it doesn't really belong here)
64
54
integer, pointer, save, public :: indxua(:)
65
55
! Index of equivalent atom in "u" cell
92
82
real(dp), pointer, save, public :: rckb(:)
93
83
! Cutoff radius of each KB projector
99
!----------------------------------------------------------------------
100
subroutine initatomlists
88
!=======================================================
89
subroutine initatomlists()
102
91
C Routine to initialize the atomic lists.
105
93
integer ia, io, is, nkba, noa, nol, nokbl, ioa, ikb
95
nullify(indxua,lastkb,lasto,qa,amass,xalast)
96
call re_alloc(indxua,1,na_u,name='indxua',routine='siesta')
97
call re_alloc(lastkb,0,na_u,name='lastkb',routine='siesta')
98
call re_alloc(lasto,0,na_u,name='lasto',routine='siesta')
99
call re_alloc(qa,1,na_u,name='qa',routine='siesta')
100
call re_alloc(xalast,1,3,1,na_u,name='xalast',routine='siesta')
101
call re_alloc(amass,1,na_u,name='amass',routine='siesta')
107
104
! Find number of orbitals and KB projectors in cell