27 integer,
parameter :: maxwf=40000
29 integer,
parameter :: maxit=1000
30 integer nwf,nwfcl,nin,nout
31 integer itemp,it,i,m,n,nthd
33 real(8),
parameter :: eps=1.d-12
35 real(8),
parameter :: beta=0.5d0
36 real(8) lambda,wlog,wrms,tc
37 real(8) wfmax,tmin,tmax,dtemp,temp
38 real(8) dw,dmu,sm,a,b,t0,t1
40 real(8),
allocatable :: w(:),a2f(:),wf(:),l(:)
41 real(8),
allocatable :: d0(:),d(:),z0(:),z(:),r(:)
42 complex(8),
allocatable :: zin(:),uin(:),zout(:),uout(:)
51 call mcmillan(w,a2f,lambda,wlog,wrms,tc)
56 if (tmin < 1.d-2) tmin=0.1d0
59 if (tmax < 1.d0) tmax=1.d0
61 dtemp=(tmax-tmin)/dble(
ntemp)
65 if (nwf > maxwf) nwf=maxwf
66 allocate(wf(-nwf:nwf))
67 allocate(l(-2*nwf:2*nwf))
68 allocate(d0(0:nwf),d(0:nwf))
69 allocate(z0(0:nwf),z(0:nwf))
71 allocate(zin(0:nwf),uin(0:nwf))
74 allocate(zout(nout),uout(nout))
76 zout(i)=2.d0*dble(i-1)*dw
79 open(62,file=
'ELIASHBERG.OUT',form=
'FORMATTED')
80 open(63,file=
'ELIASHBERG_IA.OUT',form=
'FORMATTED')
81 open(64,file=
'ELIASHBERG_GAP_T.OUT',form=
'FORMATTED')
82 open(65,file=
'ELIASHBERG_GAP_RA.OUT',form=
'FORMATTED')
83 open(66,file=
'ELIASHBERG_Z_RA.OUT',form=
'FORMATTED')
84 call writebox(62,
"Eliashberg equations")
86 write(62,
'("Temperature range : ",2G18.10)') tmin,tmax
87 write(62,
'("Number of temperature steps : ",I6)')
ntemp 88 write(62,
'("Number of output frequencies : ",I8)') nout
89 write(62,
'("Fermionic Matsubara frequency cut-off")')
90 write(62,
'(" phonons : ",G18.10)') wfmax
91 write(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
218 close(62);
close(63);
close(64);
close(65);
close(66)
220 write(*,
'("Info(eliashberg):")')
221 write(*,
'(" calculation information written to ELIASHBERG.OUT")')
222 write(*,
'(" gap and Z functions on the imaginary axis written to & 223 &ELIASHBERG_IA.OUT")')
224 write(*,
'(" gap vs. temperature written to ELIASHBERG_GAP_T.OUT")')
225 write(*,
'(" gap function on the real axis written to ELIASHBERG_GAP_RA.OUT")')
226 write(*,
'(" Z function on the real axis written to ELIASHBERG_Z_RA.OUT")')
227 deallocate(w,a2f,wf,l)
228 deallocate(d0,d,z0,z,r)
229 deallocate(zin,uin,zout,uout)
subroutine mcmillan(w, a2f, lambda, wlog, wrms, tc)
real(8), parameter kboltz
subroutine readalpha2f(w, a2f)
subroutine writebox(fnum, str)
pure subroutine pade(ni, zi, ui, no, zo, uo)
subroutine holdthd(nloop, nthd)