27#include "../base/base_uses.f90"
32 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
33 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'xc_hcth'
48 SUBROUTINE hcth_lda_info(iparset, reference, shortform, needs, max_deriv)
49 INTEGER,
INTENT(in) :: iparset
50 CHARACTER(LEN=*),
INTENT(OUT),
OPTIONAL :: reference, shortform
52 INTEGER,
INTENT(out),
OPTIONAL :: max_deriv
56 IF (
PRESENT(reference))
THEN
57 reference =
"F. A. Hamprecht, A. J. Cohen, D. J. Tozer, and N. C. Handy, J. Chem. Phys. 109, 6264 (1998);"// &
58 " HCTH/93 xc functional {LDA version}"
60 IF (
PRESENT(shortform))
THEN
61 shortform =
"HCTH/93 xc energy functional (LDA)"
64 IF (
PRESENT(reference))
THEN
65 reference =
"A. D. Boese, N. L. Doltsinis, N. C. Handy, and M. Sprik, J. Chem. Phys. 112, 1670 (2000);"// &
66 " HCTH/120 xc functional {LDA version}"
68 IF (
PRESENT(shortform))
THEN
69 shortform =
"HCTH/120 xc energy functional (LDA)"
72 IF (
PRESENT(reference))
THEN
73 reference =
"A. D. Boese, N. L. Doltsinis, N. C. Handy, and M. Sprik, J. Chem. Phys. 112, 1670 (2000);"// &
74 " HCTH/147 xc functional {LDA Version}"
76 IF (
PRESENT(shortform))
THEN
77 shortform =
"HCTH/147 xc energy functional (LDA)"
80 IF (
PRESENT(reference))
THEN
81 reference =
"A. D. Boese and N. C. Handy, J. Chem. Phys. 114, 5497 (2001); "// &
82 "HCTH/407 xc functional {LDA version}"
84 IF (
PRESENT(shortform))
THEN
85 shortform =
"HCTH/407 xc energy functional (LDA)"
88 IF (
PRESENT(reference))
THEN
89 reference =
"P. Verma and D. G. Truhlar, J. Phys. Chem. Lett. 8, 380 (2016); "// &
90 "HLE16 xc functional {LDA version}"
92 IF (
PRESENT(shortform))
THEN
93 shortform =
"HLE16 xc energy functional (LDA)"
96 cpabort(
"Invalid HCTH parameter set requested ("//
cp_to_string(iparset)//
")")
98 IF (
PRESENT(needs))
THEN
100 needs%norm_drho = .true.
102 IF (
PRESENT(max_deriv)) max_deriv = 1
116 INTEGER,
INTENT(in) :: iparset
119 INTEGER,
INTENT(in) :: grad_deriv
122 INTEGER,
DIMENSION(2, 3) :: bo
123 REAL(kind=
dp) :: epsilon_rho
124 REAL(kind=
dp),
CONTIGUOUS,
DIMENSION(:, :, :), &
125 POINTER :: e_0, e_ndrho, e_rho, norm_drho, rho
128 NULLIFY (e_0, e_ndrho, e_rho, norm_drho, rho)
131 norm_drho=norm_drho, local_bounds=bo, rho_cutoff=epsilon_rho)
132 npoints = (bo(2, 1) - bo(1, 1) + 1)*(bo(2, 2) - bo(1, 2) + 1)*(bo(2, 3) - bo(1, 3) + 1)
135 allocate_deriv=.true.)
138 allocate_deriv=.true.)
141 allocate_deriv=.true.)
143 IF (grad_deriv > 1)
THEN
144 cpabort(
"derivatives bigger than 1 not implemented")
147 CALL hcth_lda_calc(iparset=iparset, rho=rho, norm_drho=norm_drho, &
148 e_0=e_0, e_rho=e_rho, e_ndrho=e_ndrho, &
149 npoints=npoints, epsilon_rho=epsilon_rho)
175 SUBROUTINE hcth_lda_calc(iparset, rho, norm_drho, e_0, e_rho, e_ndrho, &
176 epsilon_rho, npoints)
177 INTEGER,
INTENT(IN) :: iparset
178 REAL(kind=
dp),
DIMENSION(*),
INTENT(IN) :: rho, norm_drho
179 REAL(kind=
dp),
DIMENSION(*),
INTENT(INOUT) :: e_0, e_rho, e_ndrho
180 REAL(kind=
dp),
INTENT(in) :: epsilon_rho
181 INTEGER,
INTENT(IN) :: npoints
183 REAL(kind=
dp),
DIMENSION(4),
PARAMETER :: &
184 beta0 = [7.59570_dp, 3.58760_dp, 1.63820_dp, 0.49294_dp], &
185 beta1 = [14.11890_dp, 6.19770_dp, 3.36620_dp, 0.62517_dp]
186 REAL(kind=
dp),
PARAMETER :: a0 = 0.031091_dp, a1 = 0.015545_dp, alpha0 = 0.21370_dp, &
187 alpha1 = 0.20548_dp, f13 = 1.0_dp/3.0_dp, f43 = 4.0_dp*f13, f83 = 8.0_dp*f13, &
188 gamma_cab = 0.006_dp, gamma_css = 0.200_dp, gamma_xss = 0.004_dp
191 REAL(kind=
dp) :: cx_vwn_e, cx_vwn_v, dgcabddrho, dgcabdrho, dgcabds, dgcssddrho, dgcssdrho, &
192 dgcssds, dgdrs, dgxssddrho, dgxssdrho, dgxssds, drho, drhos, drsdrho, ecab, ecss, exss, &
193 g, gcab, gcss, gs2, gxss, my_rho, p, q, rho13, rho43, rhos, rhos13, rhos43, rs, rs12, &
194 rsfac, s, s2, two13, u, vcab, vcss, vxss, x, y
195 REAL(kind=
dp),
DIMENSION(0:4) :: ccab, ccss, cxss
197 cx_vwn_e = -0.75_dp*(3.0_dp/
pi)**f13
198 cx_vwn_v = f43*cx_vwn_e
199 rsfac = (f43*
pi)**(-f13)
207 SELECT CASE (iparset)
209 cxss(0) = 0.109320e+01_dp
210 ccss(0) = 0.222601e+00_dp
211 ccab(0) = 0.729974e+00_dp
212 cxss(1) = -0.744056e+00_dp
213 ccss(1) = -0.338622e-01_dp
214 ccab(1) = 0.335287e+01_dp
215 cxss(2) = 0.559920e+01_dp
216 ccss(2) = -0.125170e-01_dp
217 ccab(2) = -0.115430e+02_dp
218 cxss(3) = -0.678549e+01_dp
219 ccss(3) = -0.802496e+00_dp
220 ccab(3) = 0.808564e+01_dp
221 cxss(4) = 0.449357e+01_dp
222 ccss(4) = 0.155396e+01_dp
223 ccab(4) = -0.447857e+01_dp
225 cxss(0) = 0.109163e+01_dp
226 ccss(0) = 0.489508e+00_dp
227 ccab(0) = 0.514730e+00_dp
228 cxss(1) = -0.747215e+00_dp
229 ccss(1) = -0.260699e+00_dp
230 ccab(1) = 0.692982e+01_dp
231 cxss(2) = 0.507833e+01_dp
232 ccss(2) = 0.432917e+00_dp
233 ccab(2) = -0.247073e+02_dp
234 cxss(3) = -0.410746e+01_dp
235 ccss(3) = -0.199247e+01_dp
236 ccab(3) = 0.231098e+02_dp
237 cxss(4) = 0.117173e+01_dp
238 ccss(4) = 0.248531e+01_dp
239 ccab(4) = -0.113234e+02_dp
241 cxss(0) = 0.109025e+01_dp
242 ccss(0) = 0.562576e+00_dp
243 ccab(0) = 0.542352e+00_dp
244 cxss(1) = -0.799194e+00_dp
245 ccss(1) = 0.171436e-01_dp
246 ccab(1) = 0.701464e+01_dp
247 cxss(2) = 0.557212e+01_dp
248 ccss(2) = -0.130636e+01_dp
249 ccab(2) = -0.283822e+02_dp
250 cxss(3) = -0.586760e+01_dp
251 ccss(3) = 0.105747e+01_dp
252 ccab(3) = 0.350329e+02_dp
253 cxss(4) = 0.304544e+01_dp
254 ccss(4) = 0.885429e+00_dp
255 ccab(4) = -0.204284e+02_dp
257 cxss(0) = 0.108184e+01_dp
258 ccss(0) = 0.118777e+01_dp
259 ccab(0) = 0.589076e+00_dp
260 cxss(1) = -0.518339e+00_dp
261 ccss(1) = -0.240292e+01_dp
262 ccab(1) = 0.442374e+01_dp
263 cxss(2) = 0.342562e+01_dp
264 ccss(2) = 0.561741e+01_dp
265 ccab(2) = -0.192218e+02_dp
266 cxss(3) = -0.262901e+01_dp
267 ccss(3) = -0.917923e+01_dp
268 ccab(3) = 0.425721e+02_dp
269 cxss(4) = 0.228855e+01_dp
270 ccss(4) = 0.624798e+01_dp
271 ccab(4) = -0.420052e+02_dp
275 cxss(0) = 0.108184e+01_dp*1.25_dp
276 ccss(0) = 0.118777e+01_dp*0.5_dp
277 ccab(0) = 0.589076e+00_dp*0.5_dp
278 cxss(1) = -0.518339e+00_dp*1.25_dp
279 ccss(1) = -0.240292e+01_dp*0.5_dp
280 ccab(1) = 0.442374e+01_dp*0.5_dp
281 cxss(2) = 0.342562e+01_dp*1.25_dp
282 ccss(2) = 0.561741e+01_dp*0.5_dp
283 ccab(2) = -0.192218e+02_dp*0.5_dp
284 cxss(3) = -0.262901e+01_dp*1.25_dp
285 ccss(3) = -0.917923e+01_dp*0.5_dp
286 ccab(3) = 0.425721e+02_dp*0.5_dp
287 cxss(4) = 0.228855e+01_dp*1.25_dp
288 ccss(4) = 0.624798e+01_dp*0.5_dp
289 ccab(4) = -0.420052e+02_dp*0.5_dp
291 cpabort(
"Invalid HCTH parameter set requested ("//
cp_to_string(iparset)//
")")
305 IF (rho(ii) > epsilon_rho)
THEN
306 my_rho = max(rho(ii), epsilon_rho)
319 exss = cx_vwn_e*rho43
320 vxss = cx_vwn_v*rho13
328 q = 2.0_dp*a1*(beta1(1) + (beta1(2) + (beta1(3) + &
329 beta1(4)*rs12)*rs12)*rs12)*rs12
330 p = 1.0_dp + 1.0_dp/q
331 x = -2.0_dp*a1*(1.0_dp + alpha1*rs)
334 dgdrs = -2.0_dp*a1*alpha1*y - &
335 x*a1*(beta1(1)/rs12 + 2.0_dp*beta1(2) + &
336 3.0_dp*beta1(3)*rs12 + 4.0_dp*beta1(4)*rs)/(p*q*q)
337 drsdrho = -f13*rs/my_rho
339 vcss = g + my_rho*dgdrs*drsdrho
345 q = 2.0_dp*a0*(beta0(1) + (beta0(2) + (beta0(3) + &
346 beta0(4)*rs12)*rs12)*rs12)*rs12
347 p = 1.0_dp + 1.0_dp/q
348 x = -2.0_dp*a0*(1.0_dp + alpha0*rs)
351 dgdrs = -2.0_dp*a0*alpha0*y - &
352 x*a0*(beta0(1)/rs12 + 2.0_dp*beta0(2) + &
353 3.0_dp*beta0(3)*rs12 + 4.0_dp*beta0(4)*rs)/(p*q*q)
354 drsdrho = -f13*rs/my_rho
355 ecab = my_rho*g - ecss
356 vcab = g + my_rho*dgdrs*drsdrho - vcss
363 y = 2.0_dp/(drho*drho)
368 q = 1.0_dp/(1.0_dp + gs2)
370 gxss = cxss(0) + (cxss(1) + (cxss(2) + (cxss(3) + cxss(4)*u)*u)*u)*u
371 dgxssds = q*(cxss(1) + (2.0_dp*cxss(2) + (3.0_dp*cxss(3) + &
372 4.0_dp*cxss(4)*u)*u)*u)*u
373 dgxssdrho = x*dgxssds
374 dgxssddrho = y*dgxssds
379 q = 1.0_dp/(1.0_dp + gs2)
381 gcss = ccss(0) + (ccss(1) + (ccss(2) + (ccss(3) + ccss(4)*u)*u)*u)*u
382 dgcssds = q*(ccss(1) + (2.0_dp*ccss(2) + (3.0_dp*ccss(3) + &
383 4.0_dp*ccss(4)*u)*u)*u)*u
384 dgcssdrho = x*dgcssds
385 dgcssddrho = y*dgcssds
390 q = 1.0_dp/(1.0_dp + gs2)
392 gcab = ccab(0) + (ccab(1) + (ccab(2) + (ccab(3) + ccab(4)*u)*u)*u)*u
393 dgcabds = q*(ccab(1) + (2.0_dp*ccab(2) + (3.0_dp*ccab(3) + &
394 4.0_dp*ccab(4)*u)*u)*u)*u
395 dgcabdrho = x*dgcabds
396 dgcabddrho = y*dgcabds
400 e_0(ii) = e_0(ii) + exss*gxss + ecss*gcss + ecab*gcab
401 e_rho(ii) = e_rho(ii) + vxss*gxss + exss*dgxssdrho + &
402 vcss*gcss + ecss*dgcssdrho + &
403 vcab*gcab + ecab*dgcabdrho
404 e_ndrho(ii) = e_ndrho(ii) + (exss*dgxssddrho + ecss*dgcssddrho + ecab*dgcabddrho)*drho
408 END SUBROUTINE hcth_lda_calc
various routines to log and control the output. The idea is that decisions about where to log should ...
Defines the basic variable types.
integer, parameter, public dp
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
Module with functions to handle derivative descriptors. derivative description are strings have the f...
integer, parameter, public deriv_norm_drho
integer, parameter, public deriv_rho
represent a group ofunctional derivatives
type(xc_derivative_type) function, pointer, public xc_dset_get_derivative(derivative_set, description, allocate_deriv)
returns the requested xc_derivative
Provides types for the management of the xc-functionals and their derivatives.
subroutine, public xc_derivative_get(deriv, split_desc, order, deriv_data, accept_null_data)
returns various information on the given derivative
calculate the Hamprecht, Cohen, Tozer, and Handy (HCTH) exchange functional
subroutine, public hcth_lda_info(iparset, reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public hcth_lda_eval(iparset, rho_set, deriv_set, grad_deriv)
evaluates the hcth functional for lda
subroutine, public xc_rho_set_get(rho_set, can_return_null, rho, drho, norm_drho, rhoa, rhob, norm_drhoa, norm_drhob, rho_1_3, rhoa_1_3, rhob_1_3, laplace_rho, laplace_rhoa, laplace_rhob, drhoa, drhob, rho_cutoff, drho_cutoff, tau_cutoff, tau, tau_a, tau_b, local_bounds)
returns the various attributes of rho_set
A derivative set contains the different derivatives of a xc-functional in form of a linked list.
represent a derivative of a functional
contains a flag for each component of xc_rho_set, so that you can use it to tell which components you...
represent a density, with all the representation and data needed to perform a functional evaluation