The Elk Code
 
Loading...
Searching...
No Matches
genidxlo.f90
Go to the documentation of this file.
1
2! Copyright (C) 2002-2005 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6!BOP
7! !ROUTINE: genidxlo
8! !INTERFACE:
9subroutine genidxlo
10! !USES:
11use modmain
12! !DESCRIPTION:
13! Generates an index array which maps the local-orbitals in each atom to their
14! locations in the overlap or Hamiltonian matrices. Also finds the total
15! number of local-orbitals.
16!
17! !REVISION HISTORY:
18! Created June 2003 (JKD)
19!EOP
20!BOC
21implicit none
22! local variables
23integer is,ias,i,ilo,l,m,lm
24! allocate global local-orbital index
25if (allocated(idxlo)) deallocate(idxlo)
26allocate(idxlo(lolmmax,nlomax,natmtot))
27i=0
28do ias=1,natmtot
29 is=idxis(ias)
30 do ilo=1,nlorb(is)
31 l=lorbl(ilo,is)
32 do m=-l,l
33 i=i+1
34 lm=l*(l+1)+m+1
35 idxlo(lm,ilo,ias)=i
36 end do
37 end do
38end do
39nlotot=i
40end subroutine
41!EOC
42
subroutine genidxlo
Definition genidxlo.f90:10
integer, dimension(:,:,:), allocatable idxlo
Definition modmain.f90:850
integer, dimension(maxatoms *maxspecies) idxis
Definition modmain.f90:44
integer nlotot
Definition modmain.f90:790
integer nlomax
Definition modmain.f90:788
integer natmtot
Definition modmain.f90:40
integer lolmmax
Definition modmain.f90:800
integer, dimension(maxspecies) nlorb
Definition modmain.f90:786
integer, dimension(maxlorb, maxspecies) lorbl
Definition modmain.f90:796