5
C> Another implementation of the PW91 LDA correlation functional
12
C> \brief An alternative implementation of the functional
15
C> This stems from the original authors of the functional and hence
16
C> it follows different calling conventions from the other routines
17
C> in the library. For this reason it is also only meant to be used
18
C> as an internal component of PW91 related functionals.
21
c Perdew 91 local correlation functional at one grid point
24
Subroutine nwxc_c_lsda(tol_rho,
25
R rs,zeta,PotLC,dLdS,dLdZ,d2LdSS,d2LdSZ,d2LdZZ)
27
C Evaluate the Perdew 91 local correlation functional and its
28
C derivatives at one point.
30
double precision tol_rho
32
double precision PotLC,dLdS, dLdZ, d2dSS, d2dSZ, d2dZZ
33
double precision eps0c(6), eps1c(6), epsc(6)
34
double precision F1, F2, F3, F4, F6, F8, F9, F12, F24, F36
35
double precision GammaI,Zeta,FZeta,dfZdz,d2fZdz
36
double precision EU,dEUdRS,d2UdRS
37
double precision EP,dEPdRS,d2PdRS
38
double precision AlphaM,dAMdRS,d2AdRS
39
double precision GZ, HZ, dGZ, dHZ, d2GZ, d2HZ
40
double precision d2LdSS,d2LdSZ,d2LdZZ,fzzi,
43
data eps0c/0.03109070D0,0.21370D0, 7.5957D0,3.5876D0,1.6382D0,
45
data eps1c/0.01554535D0,0.20548D0,14.1189D0,6.1977D0,3.3662D0,
47
data epsc/0.01688690D0,0.11125D0,10.3570D0,3.6231D0,0.88026D0,
49
data F1/1.0d0/, F2/2.0d0/, F3/3.0d0/, F4/4.0d0/, F6/6.0d0/,
50
& F8/8.0d0/, F9/9.0d0/, F12/12.0d0/, F24/24.0d0/, F36/36.0d0/
56
epsc(1) = F1 / (F6*Pi*Pi)
57
FZZI = F9*(F2**Third-F1) / F4
58
GammaI = F1 / (F2*F2**Third-F2)
60
Call nwxc_EvFZet(tol_rho,GammaI,Zeta,FZeta,dfZdz,d2fZdz)
61
Call nwxc_EvPWLC(eps0c(1),eps0c(2),eps0c(3),eps0c(4),eps0c(5),
62
& eps0c(6), RS,EU,dEUdRS,d2UdRS)
63
Call nwxc_EvPWLC(eps1c(1),eps1c(2),eps1c(3),eps1c(4),eps1c(5),
64
& eps1c(6),RS,EP,dEPdRS,d2PdRS)
65
Call nwxc_EvPWLC(epsc(1),epsc(2),epsc(3),epsc(4),epsc(5),
66
& epsc(6),RS,AlphaM,dAMdRS,d2AdRS)
72
PotLC = EU*(F1-GZ) + EP*GZ - AlphaM*HZ
73
dLdS = dEUdRS*(F1-GZ) + dEPdRS*GZ - dAMdRS*HZ
74
dGZ = dfZdz*Z4 + F4*FZeta*Z3
75
dHZ = FZZI*(dFZdz-dGZ)
76
dLdz = (EP-EU)*dGZ - AlphaM*dHZ
77
d2GZ = d2fZdz*Z4 + F8*Z3*dfZdz + F12*FZeta*Z2
78
d2HZ = FZZI*(d2FZdz-d2GZ)
79
d2LdSS = d2UdRS*(F1-GZ) + d2PdRS*GZ - d2AdRS*HZ
80
d2LdSZ = (dEPdRS-dEUdRS)*dGZ - dAMdRS*dHZ
81
d2LdZZ = (EP-EU)*d2GZ - AlphaM*d2HZ
88
Subroutine nwxc_EvFZet(tol_rho,S,Zeta,FZeta,dfZdz,d2fZdz)
91
c evaluate f(Zeta) and its derivatives for lsdac.
93
double precision tol_rho
94
double precision Small
95
double precision S, Zeta, FZeta,dfZdz,d2fZdz
96
double precision Zero, One, Two, Three, Four, Nine, F8, F27
97
double precision OMZ, OPZ, OMZ2, OPZ2, OMZ3, OPZ3
98
double precision F13, F43, F49, F827
99
data Zero/0.0d0/, One/1.0d0/, Two/2.0d0/, Three/3.0d0/,
100
$ Four/4.0d0/, Nine/9.0d0/, F8/8.0D0/, F27/27.0D0/
115
If(OMZ.gt.Small) then
117
fZeta = fZeta + OMZ*OMZ3
119
d2fZdz = d2fZdz + OMZ3/OMZ
121
If(OPZ.gt.Small) then
123
fZeta = fZeta + OPZ*OPZ3
125
d2fZdz = d2fZdz + OPZ3/OPZ
128
dfZdz = dfZdz * F43 * S
129
d2fZdz = d2fZdz * F49 * S
134
c pw91 local correlation
136
Subroutine nwxc_EvPWLC(A,A1,B1,B2,B3,B4,RS,V,dVdRS,d2VdRS)
139
C Evaluate the interpolation function for PW91 local correlation.
141
double precision A,A1,B1,B2,B3,B4,RS,V,dVdRS,d2VdRS
142
double precision F1,F2, F3, F4
143
double precision Q0, RS12, RS32,Q1,Q2
144
double precision dQ0dRS,dQ1dRS,dQ2dRS
145
double precision d2Q1dS, d2Q2dS
146
data F1/1.0d0/, F2/2.0d0/, F3/3.0d0/, F4/4.0d0/
148
Q0 = -F2*A*(F1+A1*RS)
151
Q1 = F2*A*(B1*RS12+B2*RS+B3*RS32+B4*RS*RS)
156
dQ1dRS = A*(B1/RS12+F2*B2+F3*B3*RS12+F4*B4*RS)
157
dQ2dRS = -dQ1dRS/(Q1+Q1**2)
158
dVdRS = dQ0dRS*Q2 + Q0*dQ2dRS
160
d2Q1dS = A*(F3*B3/(RS12*F2)-B1/(RS32*F2)+F4*B4)
161
d2Q2dS = (F2*Q1+F1)*(dQ1dRS/(Q1+Q1**2))**2 - d2Q1dS/(Q1+Q1**2)
162
d2VdRS = F2*dQ0dRS*dQ2dRS + Q0*d2Q2dS