The Elk Code
writephn.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 writephn
7 use modmain
8 use modphonon
9 implicit none
10 ! local variables
11 integer iq,i,j,is,ia,ip
12 ! allocatable arrays
13 real(8), allocatable :: wq(:)
14 complex(8), allocatable :: dq(:,:),ev(:,:)
15 ! initialise universal variables
16 call init0
17 call init2
18 call initph
19 allocate(wq(nbph),dq(nbph,nbph),ev(nbph,nbph))
20 open(50,file='PHONON.OUT',form='FORMATTED')
21 do iq=1,nphwrt
22  call dynrtoq(vqlwrt(:,iq),dynr,dq)
23  call dynev(dq,wq,ev)
24  write(50,*)
25  write(50,'(I6,3G18.10," : q-point, vqlwrt")') iq,vqlwrt(:,iq)
26  do j=1,nbph
27  write(50,*)
28  write(50,'(I6,G18.10," : mode, frequency")') j,wq(j)
29  i=0
30  do is=1,nspecies
31  do ia=1,natoms(is)
32  do ip=1,3
33  i=i+1
34  if (i == 1) then
35  write(50,'(3I4,2G18.10," : species, atom, polarisation, &
36  &eigenvector")') is,ia,ip,ev(i,j)
37  else
38  write(50,'(3I4,2G18.10)') is,ia,ip,ev(i,j)
39  end if
40  end do
41  end do
42  end do
43  end do
44  write(50,*)
45 end do
46 close(50)
47 write(*,*)
48 write(*,'("Info(writephn): phonon frequencies and eigenvectors written to &
49  &PHONON.OUT")')
50 write(*,'(" for all q-vectors in the phwrite list")')
51 deallocate(wq,dq,ev)
52 end subroutine
53 
real(8), dimension(:,:,:), allocatable dynr
Definition: modphonon.f90:29
integer nphwrt
Definition: modphonon.f90:19
subroutine writephn
Definition: writephn.f90:7
subroutine dynrtoq(vpl, dr, dq)
Definition: dynrtoq.f90:7
real(8), dimension(:,:), allocatable vqlwrt
Definition: modphonon.f90:21
subroutine dynev(dq, wq, ev)
Definition: dynev.f90:7
integer nbph
Definition: modphonon.f90:13
subroutine init2
Definition: init2.f90:7
subroutine initph
Definition: initph.f90:7
integer, dimension(maxspecies) natoms
Definition: modmain.f90:36
integer nspecies
Definition: modmain.f90:34
subroutine init0
Definition: init0.f90:10