File: Bands_to_gnuplot.f90

package info (click to toggle)
espresso 6.7-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 311,068 kB
  • sloc: f90: 447,429; ansic: 52,566; sh: 40,631; xml: 37,561; tcl: 20,077; lisp: 5,923; makefile: 4,503; python: 4,379; perl: 1,219; cpp: 761; fortran: 618; java: 568; awk: 128
file content (60 lines) | stat: -rw-r--r-- 1,823 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
!  For Quantum Espresso 3.0 and higher
!
!  Copyright Eyvaz Isaev (2006-2007)
!  Condensed Matter Theory Group, Uppsala University, Sweden, 
!
!  Theoretical Physics Department, 
!  Moscow State Institute of Steel and Alloys, Russia
!
!  Copyright Eyvaz Isaev (2007-2010): 
!  Department of Physics, Chemistry and Biology (IFM), 
!  Linkoping University, Linkoping, Sweden  
!
!  isaev@ifm.liu.se, eyvaz_isaev@yahoo.com
!  
!  Program makes it possible plotting phonon dispersion curves along high symmetry directions
!  using Gnuplot (www.gnuplot.info).
!  Phonon frequences  are calculated by means of matdyn.x for a given number of k-vectors.
!  Then the program yields a Frequency file to be used in a gnuplot script.  

	implicit none
	integer nbnd, nks, i, j
	real*8, allocatable :: e(:,:), qx(:), qy(:), qz(:), ql(:)
!        dimension e(1000,500),qx(1000),qy(1000),qz(1000)
!        dimension ql(1000)

        open(10,file='Frequency')
        read(5,'(12X, I4, 6X,I4,2x)') nbnd, nks
        print*, 'nbands ===', nbnd

	allocate (e(nks,nbnd))
	allocate  (qx(nks),qy(nks),qz(nks),ql(nks))

	if(nbnd.gt.500) print*, 'nbnd > 500, You have too many bands!'
	if(nks.gt.1000)  stop   'nks > 1000, Too many k-points, usually 300-500 is enough.'

        do i=1,nks
        read(5,'(10X, 3f10.6)') qx(i),qy(i),qz(i)
        if(i.eq.1) then
        ql(i)=0.
        else
        ql(i)=ql(i-1)+ sqrt((qx(i)-qx(i-1))**2+(qy(i)-qy(i-1))**2+(qz(i-1)-qz(i))**2)
        endif
        read(5,'(6f10.4)') (e(i,j),j=1,nbnd)
!        write(6,'(f8.4,6f14.6)') ql(i),(e(i,j),j=1,6)
        enddo

        do i=1, nbnd
        do j=1,nks
        write(10, '(2f10.4)') ql(j), e(j,i)
        enddo
        write(10,*)
        enddo

!	deallocate (e(nks,nbnd))
!	deallocate  (qx(nks),qy(nks),qz(nks),ql(nks))

        stop
        end