The Elk Code
readdyn.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 subroutine readdyn
7 use modmain
8 use modphonon
9 implicit none
10 ! local variables
11 logical exist
12 integer iq,is,js,ia,ja
13 integer ip,jp,i,j
14 real(8) a,b
15 character(256) fext
16 do iq=1,nqpt
17  i=0
18  do is=1,nspecies
19  do ia=1,natoms(is)
20  do ip=1,3
21  i=i+1
22  call dynfext(iq,is,ia,ip,fext)
23  inquire(file='DYN'//trim(fext),exist=exist)
24  if (.not.exist) then
25  write(*,*)
26  write(*,'("Error(readdyn): file not found :")')
27  write(*,'(A)') ' DYN'//trim(fext)
28  write(*,*)
29  stop
30  end if
31  open(50,file='DYN'//trim(fext),status='OLD',form='FORMATTED')
32  j=0
33  do js=1,nspecies
34  do ja=1,natoms(js)
35  do jp=1,3
36  j=j+1
37  read(50,*) a,b
38  dynq(i,j,iq)=cmplx(a,b,8)
39  end do
40  end do
41  end do
42  close(50)
43  end do
44 ! end loops over atoms and species
45  end do
46  end do
47 ! symmetrise the dynamical matrix
48  call dynsym(vql(:,iq),dynq(:,:,iq))
49 ! end loop over q-vectors
50 end do
51 end subroutine
52 
subroutine readdyn
Definition: readdyn.f90:7
integer nqpt
Definition: modmain.f90:525
subroutine dynfext(iq, is, ia, ip, fext)
Definition: dynfext.f90:7
complex(8), dimension(:,:,:), allocatable dynq
Definition: modphonon.f90:27
real(8), dimension(:,:), allocatable vql
Definition: modmain.f90:545
integer, dimension(maxspecies) natoms
Definition: modmain.f90:36
integer nspecies
Definition: modmain.f90:34
subroutine dynsym(vpl, dq)
Definition: dynsym.f90:7