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