The Elk Code
writesym.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: writesym
8 ! !INTERFACE:
9 subroutine writesym
10 ! !USES:
11 use modmain
12 ! !DESCRIPTION:
13 ! Outputs the Bravais, crystal and site symmetry matrices to files
14 ! {\tt SYMLAT.OUT}, {\tt SYMCRYS.OUT} and {\tt SYMSITE.OUT}, respectively.
15 ! Also writes out equivalent atoms and related crystal symmetries to
16 ! {\tt EQATOMS.OUT}.
17 !
18 ! !REVISION HISTORY:
19 ! Created October 2002 (JKD)
20 !EOP
21 !BOC
22 implicit none
23 ! local variables
24 integer is,ia,ja,ias,i
25 integer isym,lspl,lspn
26 ! output the Bravais lattice symmetries
27 open(50,file='SYMLAT'//trim(filext),form='FORMATTED',action='WRITE')
28 write(50,'(I4," : nsymlat")') nsymlat
29 do isym=1,nsymlat
30  write(50,*)
31  write(50,'(I4)') isym
32  do i=1,3
33  write(50,'(3I4)') symlat(i,:,isym)
34  end do
35 end do
36 close(50)
37 ! output the crystal symmetries
38 open(50,file='SYMCRYS'//trim(filext),form='FORMATTED',action='WRITE')
39 write(50,*)
40 write(50,'("(translation vectors and rotation matrices are in lattice &
41  &coordinates)")')
42 write(50,*)
43 write(50,'(I4," : nsymcrys")') nsymcrys
44 do isym=1,nsymcrys
45  write(50,*)
46  write(50,'("Crystal symmetry : ",I4)') isym
47  write(50,'(" spatial translation :")')
48  write(50,'(3G18.10)') vtlsymc(:,isym)
49  write(50,'(" spatial rotation :")')
50  lspl=lsplsymc(isym)
51  do i=1,3
52  write(50,'(3I4)') symlat(i,:,lspl)
53  end do
54  write(50,'(" global spin rotation :")')
55  lspn=lspnsymc(isym)
56  do i=1,3
57  write(50,'(3I4)') symlat(i,:,lspn)
58  end do
59 end do
60 close(50)
61 ! output the site symmetries
62 open(50,file='SYMSITE'//trim(filext),form='FORMATTED',action='WRITE')
63 write(50,*)
64 write(50,'("(rotation matrices are in lattice coordinates)")')
65 do is=1,nspecies
66  do ia=1,natoms(is)
67  ias=idxas(ia,is)
68  write(50,*)
69  write(50,*)
70  write(50,'("Species : ",I4," (",A,"), atom : ",I4)') is,trim(spsymb(is)),ia
71  write(50,'(I4," : nsymsite")') nsymsite(ias)
72  do isym=1,nsymsite(ias)
73  write(50,*)
74  write(50,'(" Site symmetry : ",I4)') isym
75  write(50,'(" spatial rotation :")')
76  lspl=lsplsyms(isym,ias)
77  do i=1,3
78  write(50,'(3I4)') symlat(i,:,lspl)
79  end do
80  write(50,'(" global spin rotation :")')
81  lspn=lspnsyms(isym,ias)
82  do i=1,3
83  write(50,'(3I4)') symlat(i,:,lspn)
84  end do
85  end do
86  end do
87 end do
88 close(50)
89 ! output the equivalent atoms and related symmetries
90 open(50,file='EQATOMS'//trim(filext),form='FORMATTED',action='WRITE')
91 do is=1,nspecies
92  write(50,*)
93  write(50,'("Species : ",I4," (",A,")")') is,trim(spsymb(is))
94  do ia=1,natoms(is)
95  write(50,'(" atom ",I4," is equivalent to atom(s)")') ia
96  i=0
97  do ja=1,natoms(is)
98  if (eqatoms(ia,ja,is)) then
99  if ((i > 0).and.(mod(i,20) == 0)) write(50,*)
100  write(50,'(I4)',advance='NO') ja
101  i=i+1
102  end if
103  end do
104  write(50,*)
105  end do
106 end do
107 close(50)
108 end subroutine
109 !EOC
110 
integer, dimension(maxsymcrys) lspnsymc
Definition: modmain.f90:366
character(256) filext
Definition: modmain.f90:1301
integer, dimension(maxatoms, maxspecies) idxas
Definition: modmain.f90:42
integer nsymcrys
Definition: modmain.f90:358
integer, dimension(3, 3, 48) symlat
Definition: modmain.f90:344
real(8), dimension(3, maxsymcrys) vtlsymc
Definition: modmain.f90:360
integer, dimension(:,:), allocatable lspnsyms
Definition: modmain.f90:378
logical, dimension(:,:,:), allocatable eqatoms
Definition: modmain.f90:370
integer, dimension(maxsymcrys) lsplsymc
Definition: modmain.f90:364
integer nsymlat
Definition: modmain.f90:342
subroutine writesym
Definition: writesym.f90:10
integer, dimension(maxspecies) natoms
Definition: modmain.f90:36
integer nspecies
Definition: modmain.f90:34
integer, dimension(:), allocatable nsymsite
Definition: modmain.f90:374
integer, dimension(:,:), allocatable lsplsyms
Definition: modmain.f90:376
character(64), dimension(maxspecies) spsymb
Definition: modmain.f90:78