The Elk Code
 
Loading...
Searching...
No Matches
symveca.f90
Go to the documentation of this file.
1
2! Copyright (C) 2002-2008 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: symveca
8! !INTERFACE:
9subroutine symveca(vca)
10! !USES:
11use modmain
12! !INPUT/OUTPUT PARAMETERS:
13! vca : vectors in Cartesian coordinates for all atoms (in,real(3,natmtot))
14! !DESCRIPTION:
15! Symmetrises a 3-vector at each atomic site by rotating and averaging over
16! equivalent atoms. Only the spatial part of each crystal symmetry is used.
17!
18! !REVISION HISTORY:
19! Created June 2004 (JKD)
20!EOP
21!BOC
22implicit none
23! arguments
24real(8), intent(inout) :: vca(3,natmtot)
25! local variables
26integer is,ia,ja,ias,jas
27integer isym,lspl
28real(8) v(3),t1
29! automatic arrays
30real(8) vs(3,natmtot)
31! make symmetric average
32vs(1:3,1:natmtot)=0.d0
33do isym=1,nsymcrys
34 lspl=lsplsymc(isym)
35 do is=1,nspecies
36 do ia=1,natoms(is)
37 ias=idxas(ia,is)
38 ja=ieqatom(ia,is,isym)
39 jas=idxas(ja,is)
40 call r3mv(symlatc(:,:,lspl),vca(:,jas),v)
41 vs(1:3,ias)=vs(1:3,ias)+v(1:3)
42 end do
43 end do
44end do
45! normalise
46t1=1.d0/dble(nsymcrys)
47vca(1:3,1:natmtot)=t1*vs(1:3,1:natmtot)
48end subroutine
49!EOC
50
real(8), dimension(3, 3, 48) symlatc
Definition modmain.f90:350
integer, dimension(maxspecies) natoms
Definition modmain.f90:36
integer, dimension(:,:,:), allocatable ieqatom
Definition modmain.f90:368
integer, dimension(maxatoms, maxspecies) idxas
Definition modmain.f90:42
integer nsymcrys
Definition modmain.f90:358
integer nspecies
Definition modmain.f90:34
integer, dimension(maxsymcrys) lsplsymc
Definition modmain.f90:364
pure subroutine r3mv(a, x, y)
Definition r3mv.f90:10
subroutine symveca(vca)
Definition symveca.f90:10