9
9
! given in the SIESTA license, as signed by all legitimate users.
12
use precision, only: dp
14
use alloc, only: re_alloc
18
parameter (maxlin = 1000)
18
integer, public :: nbk, maxbk
20
integer, parameter :: maxlin = 1000
22
real(dp), pointer, save, public :: bk(:,:)
23
logical, public , save :: gamma_bands
20
25
character, save :: label(maxlin)*8
21
integer, save :: lastk(maxlin), nlines
23
public :: initbands, bands
26
integer, save :: lastk(maxlin), nlines
28
public :: setup_bands, bands
32
subroutine setup_bands( )
34
! Find number of band k-points
38
call re_alloc(bk,1,3,1,maxbk,name='bk',routine='siesta',
41
call initbands( maxbk, nbk, bk )
43
if (nbk .gt. maxbk) then
44
! If there wasn't enough space to store bands on first call correct
45
! the dimensions and repeat the initialisation
47
call re_alloc(bk,1,3,1,maxbk,name='bk',routine='siesta',
50
call initbands( maxbk, nbk, bk )
53
gamma_bands = (nbk == 0) ! Flag for use of auxiliary cell
55
end subroutine setup_bands
29
57
subroutine initbands( maxk, nk, kpoint )
30
58
C *********************************************************************
31
59
C Finds band k-points
404
432
use parallelsubs, only : GetNodeOrbs
435
use alloc, only : re_alloc, de_alloc
408
436
use files, only : slabel, label_length
438
466
. path, temp, wk, Entropy
441
real(dp), dimension(:), allocatable, save :: aux
442
integer, dimension(:), allocatable, save :: muo
469
real(dp), dimension(:), pointer :: aux
470
integer, dimension(:), pointer :: muo
444
472
parameter ( eV = 1.d0 / 13.60580d0 )
445
473
save getD, Dnew, Enew, e1, e2, qk, qtot, temp, wk
473
501
call re_alloc(Saux,1,nhs,name='Saux',routine='bands')
474
502
call re_alloc(psi,1,nhs,name='psi',routine='bands')
477
call memory('A','D',naux,'bands')
478
allocate(muo(nuotot))
479
call memory('A','I',nuotot,'bands')
505
call re_alloc( aux, 1, naux, name='aux', routine='bands' )
507
call re_alloc( muo, 1, nuotot, name='muo', routine='bands' )
482
510
do iuo = 1,nuotot
618
646
C Free local arrays
619
call memory('D','I',size(muo),'bands')
621
call memory('D','D',size(aux),'bands')
647
call de_alloc( muo, name='muo' )
648
call de_alloc( aux, name='aux' )
624
650
C This is the only exit point