The Elk Code
 
Loading...
Searching...
No Matches
c_pbe.f90
Go to the documentation of this file.
1
2! This routine is based on code written by K. Burke.
3
4subroutine c_pbe(beta,rs,z,t,uu,vv,ww,ec,vcup,vcdn)
5implicit none
6! arguments
7real(8), intent(in) :: beta,rs,z,t,uu,vv,ww
8real(8), intent(out) :: ec,vcup,vcdn
9! local variables
10real(8), parameter :: thrd=1.d0/3.d0
11real(8), parameter :: thrdm=-thrd
12real(8), parameter :: thrd2=2.d0*thrd
13real(8), parameter :: thrd4=4.d0*thrd
14real(8), parameter :: sixthm=thrdm/2.d0
15real(8), parameter :: gam=0.5198420997897463295d0
16real(8), parameter :: fzz=8.d0/(9.d0*gam)
17real(8), parameter :: gamma=0.0310906908696548950d0
18real(8), parameter :: eta=1.d-12
19real(8) rtrs,eu,eurs,ep,eprs,alfm,alfrsm,z4,f
20real(8) ecrs,fz,ecz,comm,g,g3,pon,b,b2,t2,t4
21real(8) q4,q5,g4,t6,rsthrd,gz,fac,bg,bec,q8,q9
22real(8) hb,hrs,fact0,fact1,hbt,hrst,hz,ht,hzt
23real(8) fact2,fact3,htt,pref,fact5,h,dvcup,dvcdn
24real(8) delt
25delt=beta/gamma
26rtrs=sqrt(rs)
27call c_pbe_gcor(0.0310907d0,0.21370d0,7.5957d0,3.5876d0,1.6382d0,0.49294d0, &
28 rtrs,eu,eurs)
29call c_pbe_gcor(0.01554535d0,0.20548d0,14.1189d0,6.1977d0,3.3662d0,0.62517d0, &
30 rtrs,ep,eprs)
31call c_pbe_gcor(0.0168869d0,0.11125d0,10.357d0,3.6231d0,0.88026d0,0.49671d0, &
32 rtrs,alfm,alfrsm)
33z4=z**4
34f=((1.d0+z)**thrd4+(1.d0-z)**thrd4-2.d0)/gam
35! local contribution to correlation energy density
36ec=eu*(1.d0-f*z4)+ep*f*z4-alfm*f*(1.d0-z4)/fzz
37ecrs=eurs*(1.d0-f*z4)+eprs*f*z4-alfrsm*f*(1.d0-z4)/fzz
38fz=thrd4*((1.d0+z)**thrd-(1.d0-z)**thrd)/gam
39ecz=4.d0*(z**3)*f*(ep-eu+alfm/fzz)+fz*(z4*ep-z4*eu-(1.d0-z4)*alfm/fzz)
40comm=ec-rs*ecrs/3.d0-z*ecz
41! local contribution to correlation potential
42vcup=comm+ecz
43vcdn=comm-ecz
44g=((1.d0+z)**thrd2+(1.d0-z)**thrd2)/2.d0
45g3=g**3
46pon=-ec/(g3*gamma)
47b=delt/(exp(pon)-1.d0)
48b2=b*b
49t2=t*t
50t4=t2*t2
51q4=1.d0+b*t2
52q5=1.d0+b*t2+b2*t4
53! gradient correction to energy density
54h=g3*(beta/delt)*log(1.d0+delt*q4*t2/q5)
55g4=g3*g
56t6=t4*t2
57rsthrd=rs/3.d0
58gz=(((1.d0+z)**2+eta)**sixthm-((1.d0-z)**2+eta)**sixthm)/3.d0
59fac=delt/b+1.d0
60bg=-3.d0*b2*ec*fac/(beta*g4)
61bec=b2*fac/(beta*g3)
62q8=q5*q5+delt*q4*q5*t2
63q9=1.d0+2.d0*b*t2
64hb=-beta*g3*b*t6*(2.d0+b*t2)/q8
65hrs=-rsthrd*hb*bec*ecrs
66fact0=2.d0*delt-6.d0*b
67fact1=q5*q9+q4*q9*q9
68hbt=2.d0*beta*g3*t4*((q4*q5*fact0-delt*fact1)/q8)/q8
69hrst=rsthrd*t2*hbt*bec*ecrs
70hz=3.d0*gz*h/g+hb*(bg*gz+bec*ecz)
71ht=2.d0*beta*g3*q9/q8
72hzt=3.d0*gz*ht/g+hbt*(bg*gz+bec*ecz)
73fact2=q4*q5+b*t2*(q4*q9+q5)
74fact3=2.d0*b*q5*q9+delt*fact2
75htt=4.d0*beta*g3*t*(2.d0*b/q8-(q9*fact3/q8)/q8)
76comm=h+hrs+hrst+t2*ht/6.d0+7.d0*t2*t*htt/6.d0
77pref=hz-gz*t2*ht/g
78fact5=gz*(2.d0*ht+t*htt)/g
79comm=comm-pref*z-uu*htt-vv*ht-ww*(hzt-fact5)
80! gradient correction to potential
81dvcup=comm+pref
82dvcdn=comm-pref
83! add gradient corrections
84ec=ec+h
85vcup=vcup+dvcup
86vcdn=vcdn+dvcdn
87end subroutine
88
subroutine c_pbe(beta, rs, z, t, uu, vv, ww, ec, vcup, vcdn)
Definition c_pbe.f90:5
elemental subroutine c_pbe_gcor(a, a1, b1, b2, b3, b4, rtrs, gg, ggrs)
Definition c_pbe_gcor.f90:5