File: dynamic_pol.f

package info (click to toggle)
abinit 9.10.4-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 518,712 kB
  • sloc: xml: 877,568; f90: 577,240; python: 80,760; perl: 7,019; ansic: 4,585; sh: 1,925; javascript: 601; fortran: 557; cpp: 454; objc: 323; makefile: 77; csh: 42; pascal: 31
file content (79 lines) | stat: -rw-r--r-- 1,677 bytes parent folder | download | duplicates (7)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
      program dynamic_pol
c
c     this small utility computes the dynamic polarisability
c     from a TDDFT calculation output

      implicit real*8(a-h,p-z)
      character*12 nomin,nomout
	character*5 string,check
      integer nomega,nexcit,omegamax


      real*8 eha(40),eev(40),ostr(40)

	omegamax=5.0d0
	nomega=100

      check = '  Osc'
	write(*,*)'Abinit output filename :'
	read(*,*) nomin
      write(*,*)'Polarisability output filename :'
	read(*,*) nomout

	open(5,file=nomin,status='OLD',err=201)
      string='rrrrr'
      do while (string.ne.check)
      read(5,10) string
	write(*,*) string
	enddo
      read(5,*)
      index=1
      
400	read(5,*,err=300)i,eha(index),eev(index),ostr(index)
      write(*,*)i,eha(index),eev(index),ostr(index)
      index=index+1
	goto 400

300   index=index-1
      write(*,*)'singlet excitations :',index

      string='rrrrr'
      do while (string.ne.check)
      read(5,10) string
	enddo
10    format(A5)
      read(5,*)
      
401	read(5,*,err=301)i,eha(index),eev(index),ostr(index)
      write(*,*)i,eha(index),eev(index),ostr(index)
      index=index+1
	goto 401

301   nexcit=index-1
      write(*,*)'singlet+triplet excitations :',nexcit

      open(6,file=nomout,status='UNKNOWN')
	write(6,*)'Omega,  Alpha'
	do iomega=1,nomega
	  om=omegamax*(iomega*1.0d0/(nomega*1.0d0))
        pola=0.0d0
	  do iexcit=1,nexcit
         pola=pola+ostr(iexcit)/(eev(iexcit)*eev(iexcit)-om*om)
	  enddo
      write(6,50)om,pola
	enddo
50    format(D13.5,' ,  ',D13.5)








      goto 500
201   write(*,*)'file ',nomin,' does not exist'
      goto 500
202   write(*,*)'cannot find string   Oscillator '
      goto 500
500   end