27integer,
parameter :: maxwf=40000
29integer,
parameter :: maxit=1000
30integer nwf,nwfcl,nin,nout
31integer itemp,it,i,m,n,nthd
33real(8),
parameter :: eps=1.d-12
35real(8),
parameter :: beta=0.5d0
36real(8) lambda,wlog,wrms,tc
37real(8) wfmax,tmin,tmax,dtemp,temp
38real(8) dw,dmu,sm,a,b,t0,t1
40real(8),
allocatable :: w(:),a2f(:),wf(:),l(:)
41real(8),
allocatable :: d0(:),d(:),z0(:),z(:),r(:)
42complex(8),
allocatable :: zin(:),uin(:),zout(:),uout(:)
51call mcmillan(w,a2f,lambda,wlog,wrms,tc)
56if (tmin < 1.d-2) tmin=0.1d0
59if (tmax < 1.d0) tmax=1.d0
61dtemp=(tmax-tmin)/dble(
ntemp)
65if (nwf > maxwf) nwf=maxwf
67allocate(l(-2*nwf:2*nwf))
68allocate(d0(0:nwf),d(0:nwf))
69allocate(z0(0:nwf),z(0:nwf))
71allocate(zin(0:nwf),uin(0:nwf))
74allocate(zout(nout),uout(nout))
76 zout(i)=2.d0*dble(i-1)*dw
79open(62,file=
'ELIASHBERG.OUT',form=
'FORMATTED')
80open(63,file=
'ELIASHBERG_IA.OUT',form=
'FORMATTED')
81open(64,file=
'ELIASHBERG_GAP_T.OUT',form=
'FORMATTED')
82open(65,file=
'ELIASHBERG_GAP_RA.OUT',form=
'FORMATTED')
83open(66,file=
'ELIASHBERG_Z_RA.OUT',form=
'FORMATTED')
84call writebox(62,
"Eliashberg equations")
86write(62,
'("Temperature range : ",2G18.10)') tmin,tmax
87write(62,
'("Number of temperature steps : ",I6)')
ntemp
88write(62,
'("Number of output frequencies : ",I8)') nout
89write(62,
'("Fermionic Matsubara frequency cut-off")')
90write(62,
'(" phonons : ",G18.10)') wfmax
91write(62,
'(" Coulomb : ",G18.10)') 2.d0*wrms
97 write(*,
'("Info(eliashberg): temperature step ",I6," of ",I6)') itemp,
ntemp
98 temp=dble(itemp)*dtemp+tmin
100 write(62,
'("Temperature (kelvin) : ",G18.10)') temp
103 nwf=nint(wfmax/(2.d0*t0))
104 if (nwf > maxwf) nwf=maxwf
105 nwfcl=nint(2.d0*wrms/(2.d0*t0))
106 if (nwfcl < 1) nwfcl=1
107 if (nwfcl > nwf) nwfcl=nwf
108 write(62,
'("Number of Matsubara frequencies")')
109 write(62,
'(" phonons : ",I8)') nwf
110 write(62,
'(" Coulomb : ",I8)') nwfcl
127 sm=sm+w(i)*a2f(i)/(w(i)**2+t1)
136 r(m)=sqrt((wf(m)**2+d0(m)**2)*z0(m)**2)
141 sm=sm+(l(n-m)-l(n+m+1))*z0(m)*wf(m)/r(m)
145 z(0:nwf)=z(0:nwf)+1.d0
150 dmu=dmu+
mustar*d0(n)*z(n)/r(n)
157 sm=sm+(l(n-m)+l(n+m+1))*d0(m)*z(m)/r(m)
159 d(n)=t0*(sm-dmu)/z(n)
162 d(0:nwf)=beta*d(0:nwf)+(1.d0-beta)*d0(0:nwf)
165 sm=sm+abs(d0(m)-d(m))
170 write(62,
'("Eliashberg equations converged in ",I6," iterations")') it
176 write(*,
'("Warning(eliashberg): failed to converge: possibly close to T_c")')
177 write(62,
'("Failed to converge: possibly close to T_c")')
186 write(63,
'(3G18.10)') wf(n),d(m),z(m)
190 write(64,
'(3G18.10)') temp,d(0),z(0)
194 zin(m)=cmplx(0.d0,wf(m),8)
197 call pade(nin,zin,uin,nout,zout,uout)
201 write(65,
'(3G18.10)') dble(zout(i)),a,b
208 call pade(nin,zin,uin,nout,zout,uout)
212 write(66,
'(3G18.10)') dble(zout(i)),a,b
218close(62);
close(63);
close(64);
close(65);
close(66)
220write(*,
'("Info(eliashberg):")')
221write(*,
'(" calculation information written to ELIASHBERG.OUT")')
222write(*,
'(" gap and Z functions on the imaginary axis written to &
223 &ELIASHBERG_IA.OUT")')
224write(*,
'(" gap vs. temperature written to ELIASHBERG_GAP_T.OUT")')
225write(*,
'(" gap function on the real axis written to ELIASHBERG_GAP_RA.OUT")')
226write(*,
'(" Z function on the real axis written to ELIASHBERG_Z_RA.OUT")')
227deallocate(w,a2f,wf,l)
228deallocate(d0,d,z0,z,r)
229deallocate(zin,uin,zout,uout)
real(8), parameter kboltz