The Elk Code
 
Loading...
Searching...
No Matches
alpha2f.f90
Go to the documentation of this file.
1
2! Copyright (C) 2008 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
6subroutine alpha2f
7use modmain
8use modphonon
9use modtest
10implicit none
11! local variables
12integer iq,i,j,i1,i2,i3,iw
13real(8) wmin,wmax,wd,dw
14real(8) wlog,wrms,lambda,tc
15real(8) v(3),t1
16! allocatable arrays
17real(8), allocatable :: gq(:,:),wq(:),w(:)
18real(8), allocatable :: a2fmr(:,:,:),a2fp(:),a2f(:)
19complex(8), allocatable :: dq(:,:),ev(:,:),b(:,:)
20complex(8), allocatable :: a2fmq(:,:,:),a2fmp(:,:)
21! initialise universal variables
22call init0
23call init1
24call init2
25call initph
26! allocate local arrays
27allocate(gq(nbph,nqpt),wq(nbph),w(nwplot))
28allocate(a2fmr(nbph,nbph,nqptnr),a2fp(nbph),a2f(nwplot))
29allocate(dq(nbph,nbph),ev(nbph,nbph),b(nbph,nbph))
30allocate(a2fmq(nbph,nbph,nqpt),a2fmp(nbph,nbph))
31! get the eigenvalues from file
32call readevalsv
33! compute the density of states at the Fermi energy
34call occupy
35! read in the phonon linewidths for each q-point
36call readgamma(gq)
37! loop over phonon q-points
38do iq=1,nqpt
39! find the eigenvalues and eigenvectors of the dynamical matrix
40 call dynev(dynq(:,:,iq),wphq(:,iq),ev)
41! construct a complex matrix from the phonon eigenvectors such that its
42! eigenvalues squared are the phonon linewidths divided by the frequency
43 do i=1,nbph
44 if (wphq(i,iq) > 1.d-8) then
45 t1=sqrt(abs(gq(i,iq)/wphq(i,iq)))
46 else
47 t1=0.d0
48 end if
49 do j=1,nbph
50 b(i,j)=t1*conjg(ev(j,i))
51 end do
52 end do
53 call zgemm('N','N',nbph,nbph,nbph,zone,ev,nbph,b,nbph,zzero,a2fmq(:,:,iq), &
54 nbph)
55end do
56! Fourier transform the matrices to real-space
57call dynqtor(a2fmq,a2fmr)
58! find the minimum and maximum phonon frequencies
59wmin=minval(wphq(1,:))
60wmax=maxval(wphq(nbph,:))
61t1=(wmax-wmin)*0.1d0
62wmin=wmin-t1
63wmax=wmax+t1
64wd=wmax-wmin
65if (wd < 1.d-8) wd=1.d0
66dw=wd/dble(nwplot)
67! generate energy grid
68do iw=1,nwplot
69 w(iw)=dw*dble(iw-1)+wmin
70end do
71a2f(:)=0.d0
72do i1=0,ngrkf-1
73 v(1)=dble(i1)/dble(ngrkf)
74 do i2=0,ngrkf-1
75 v(2)=dble(i2)/dble(ngrkf)
76 do i3=0,ngrkf-1
77 v(3)=dble(i3)/dble(ngrkf)
78! compute the dynamical matrix at this particular q-point
79 call dynrtoq(v,dynr,dq)
80! find the phonon eigenvalues and eigenvectors
81 call dynev(dq,wq,ev)
82! compute the α²F matrix at this particular q-point
83 call dynrtoq(v,a2fmr,a2fmp)
84! diagonalise the α²F matrix simultaneously with the dynamical matrix
85! (thanks to Matthieu Verstraete and Ryotaro Arita for correcting this)
86 call dynevs(ev,a2fmp,a2fp)
87! square the eigenvalues to recover the linewidths divided by the frequency
88 a2fp(:)=a2fp(:)**2
89 do i=1,nbph
90 t1=(wq(i)-wmin)/dw+1.d0
91 iw=nint(t1)
92 if ((iw >= 1).and.(iw <= nwplot)) then
93 a2f(iw)=a2f(iw)+a2fp(i)
94 end if
95 end do
96 end do
97 end do
98end do
99t1=twopi*(fermidos/2.d0)*dw*dble(ngrkf)**3
100if (t1 > 1.d-8) then
101 t1=1.d0/t1
102else
103 t1=0.d0
104end if
105a2f(:)=t1*a2f(:)
106! smooth Eliashberg function if required
107if (nswplot > 0) call fsmooth(nswplot,nwplot,a2f)
108! write Eliashberg function to file
109open(50,file='ALPHA2F.OUT',form='FORMATTED')
110do iw=1,nwplot
111 write(50,'(2G18.10)') w(iw),a2f(iw)
112end do
113close(50)
114write(*,*)
115write(*,'("Info(alpha2f):")')
116write(*,α²'(" Eliashberg function F written to ALPHA2F.OUT")')
117! compute lambda, logarithmic average frequency, RMS average frequency and
118! McMillan-Allen-Dynes superconducting critical temperature
119call mcmillan(w,a2f,lambda,wlog,wrms,tc)
120open(50,file='MCMILLAN.OUT',form='FORMATTED')
121write(50,*)
122write(50,λ'("Electron-phonon coupling constant, : ",G18.10)') lambda
123write(50,*)
124write(50,'("Logarithmic average frequency : ",G18.10)') wlog
125write(50,*)
126write(50,'("RMS average frequency : ",G18.10)') wrms
127write(50,*)
128write(50,μ'("Coulomb pseudopotential, * : ",G18.10)') mustar
129write(50,*)
130write(50,'("McMillan-Allen-Dynes superconducting critical temperature")')
131write(50,'(" [Eq. 34, Phys. Rev. B 12, 905 (1975)] (kelvin) : ",G18.10)') tc
132write(50,*)
133close(50)
134write(*,*)
135write(*,'("Info(alpha2f):")')
136write(*,λ'(" Electron-phonon coupling constant, ,")')
137write(*,'(" logarithmic and RMS average frequencies,")')
138write(*,'(" and McMillan-Allen-Dynes superconducting critical temperature")')
139write(*,'(" written to MCMILLAN.OUT")')
140! write lambda to test file
141call writetest(251,'electron-phonon coupling constant, lambda',tol=5.d-2, &
142 rv=lambda)
143deallocate(gq,wq,w,dq,ev,b)
144deallocate(a2fmr,a2fp,a2f)
145deallocate(a2fmq,a2fmp)
146end subroutine
147
subroutine alpha2f
Definition alpha2f.f90:7
subroutine dynev(dq, wq, ev)
Definition dynev.f90:7
subroutine dynevs(ev, dq, wq)
Definition dynevs.f90:7
subroutine dynqtor(dq, dr)
Definition dynqtor.f90:7
subroutine dynrtoq(vpl, dr, dq)
Definition dynrtoq.f90:7
pure subroutine fsmooth(m, n, f)
Definition fsmooth.f90:10
subroutine init0
Definition init0.f90:10
subroutine init1
Definition init1.f90:10
subroutine init2
Definition init2.f90:7
subroutine initph
Definition initph.f90:7
subroutine mcmillan(w, a2f, lambda, wlog, wrms, tc)
Definition mcmillan.f90:7
complex(8), parameter zzero
Definition modmain.f90:1238
integer ngrkf
Definition modmain.f90:1072
integer nwplot
Definition modmain.f90:1070
real(8), parameter twopi
Definition modmain.f90:1230
integer nqptnr
Definition modmain.f90:527
complex(8), parameter zone
Definition modmain.f90:1238
integer nswplot
Definition modmain.f90:1074
integer nqpt
Definition modmain.f90:525
real(8) fermidos
Definition modmain.f90:910
integer nbph
Definition modphonon.f90:13
real(8), dimension(:,:,:), allocatable dynr
Definition modphonon.f90:29
complex(8), dimension(:,:,:), allocatable dynq
Definition modphonon.f90:27
real(8) mustar
Definition modphonon.f90:23
real(8), dimension(:,:), allocatable wphq
Definition modphonon.f90:31
subroutine writetest(id, descr, nv, iv, iva, tol, rv, rva, zv, zva)
Definition modtest.f90:16
subroutine occupy
Definition occupy.f90:10
subroutine readevalsv
Definition readevalsv.f90:7
subroutine readgamma(gq)
Definition readgamma.f90:7