33 #include "../base/base_uses.f90"
45 REAL(KIND=
dp),
PARAMETER :: a = 1.0161144_dp, &
47 c = -0.077215461_dp, &
51 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'xc_xlda_hole_t_c_lr'
67 CHARACTER(LEN=*),
INTENT(OUT),
OPTIONAL :: reference, shortform
68 TYPE(xc_rho_cflags_type),
INTENT(inout),
OPTIONAL :: needs
69 INTEGER,
INTENT(out),
OPTIONAL :: max_deriv
71 IF (
PRESENT(reference))
THEN
72 reference =
"{LDA version}"
74 IF (
PRESENT(shortform))
THEN
77 IF (
PRESENT(needs))
THEN
80 IF (
PRESENT(max_deriv)) max_deriv = 1
96 CHARACTER(LEN=*),
INTENT(OUT),
OPTIONAL :: reference, shortform
97 TYPE(xc_rho_cflags_type),
INTENT(inout),
OPTIONAL :: needs
98 INTEGER,
INTENT(out),
OPTIONAL :: max_deriv
100 IF (
PRESENT(reference))
THEN
101 reference =
"{LSD version}"
103 IF (
PRESENT(shortform))
THEN
106 IF (
PRESENT(needs))
THEN
107 needs%rho_spin = .true.
109 IF (
PRESENT(max_deriv)) max_deriv = 1
128 TYPE(xc_rho_set_type),
INTENT(IN) :: rho_set
129 TYPE(xc_derivative_set_type),
INTENT(IN) :: deriv_set
130 INTEGER,
INTENT(IN) :: order
131 TYPE(section_vals_type),
POINTER :: params
133 CHARACTER(len=*),
PARAMETER :: routinen =
'xlda_hole_t_c_lr_lda_eval'
135 INTEGER :: handle, npoints
136 INTEGER,
DIMENSION(2, 3) :: bo
137 REAL(kind=
dp) :: epsilon_rho, r, sx
138 REAL(kind=
dp),
CONTIGUOUS,
DIMENSION(:, :, :), &
139 POINTER :: dummy, e_0, e_rho, rho
140 TYPE(xc_derivative_type),
POINTER :: deriv
142 CALL timeset(routinen, handle)
148 local_bounds=bo, rho_cutoff=epsilon_rho)
149 npoints = (bo(2, 1) - bo(1, 1) + 1)*(bo(2, 2) - bo(1, 2) + 1)*(bo(2, 3) - bo(1, 3) + 1)
158 allocate_deriv=.true.)
161 IF (order >= 1 .OR. order == -1)
THEN
163 allocate_deriv=.true.)
166 IF (order > 1 .OR. order < -1)
THEN
167 cpabort(
"derivatives bigger than 1 not implemented")
170 IF (r == 0.0_dp)
THEN
171 cpabort(
"Cutoff_Radius 0.0 not implemented")
173 CALL xlda_hole_t_c_lr_lda_calc(npoints, order, rho=rho, &
174 e_0=e_0, e_rho=e_rho, &
175 epsilon_rho=epsilon_rho, &
178 CALL timestop(handle)
196 SUBROUTINE xlda_hole_t_c_lr_lda_calc(npoints, order, rho, e_0, e_rho, &
199 INTEGER,
INTENT(in) :: npoints, order
200 REAL(kind=
dp),
DIMENSION(1:npoints),
INTENT(inout) :: rho, e_0, e_rho
201 REAL(kind=
dp),
INTENT(in) :: epsilon_rho, sx, r
212 my_rho = max(rho(ip), 0.0_dp)
213 IF (my_rho > epsilon_rho)
THEN
221 END SUBROUTINE xlda_hole_t_c_lr_lda_calc
237 INTEGER,
INTENT(IN) :: order
238 REAL(kind=
dp),
INTENT(IN) :: rho
239 REAL(kind=
dp),
INTENT(INOUT) :: e_0, e_rho
240 REAL(kind=
dp),
INTENT(IN) :: sx, r
242 REAL(kind=
dp) :: t1, t12, t14, t15, t19, t2, t22, t23, &
243 t24, t25, t3, t32, t33, t36, t4, t41, &
244 t46, t5, t6, t62, t64, t67, t68, t7, &
245 t82, t86, t9, t91, t95
250 t3 = 3**(0.1e1_dp/0.3e1_dp)
253 t6 = t5**(0.1e1_dp/0.3e1_dp)
264 t32 = 9 + 4*a*t14*t23
271 t67 = a*t12 + 0.3e1_dp/0.2e1_dp*e*t15*t3*t6*t5*t19*t25 &
272 - a*t33/0.2e1_dp + e/t36/d*t25 + a*t41/0.2e1_dp + e*t14 &
273 *t22*t7*t46*t25 + b*t19*t25/0.2e1_dp + c*t46*t25/0.2e1_dp &
274 + c*t14*t22*t7*t19*t25/0.2e1_dp + a*t62 + a*t64 &
277 e_0 = e_0 + (0.2e1_dp/0.3e1_dp*t2*t68)*sx
279 IF (order >= 1 .OR. order == -1)
THEN
284 e_rho = e_rho + (0.4e1_dp/0.3e1_dp*rho*
pi*t68 - 0.4e1_dp/0.9e1_dp*t1*t4*
pi &
285 *t3/t7/t5*t67 + 0.2e1_dp/0.3e1_dp*t2*t9*(t82/0.3e1_dp - &
286 0.3e1_dp*e*t15*t14*t86*rho*t25 - 0.4e1_dp/0.3e1_dp*t91*t14 &
287 *t22*t95/t32 - t82*t25/0.3e1_dp - b*t14*t22*t95*t25 &
288 /0.3e1_dp - c*t15*t3*t6*t4*t25))*sx
309 TYPE(xc_rho_set_type),
INTENT(IN) :: rho_set
310 TYPE(xc_derivative_set_type),
INTENT(IN) :: deriv_set
311 INTEGER,
INTENT(IN) :: order
312 TYPE(section_vals_type),
POINTER :: params
314 CHARACTER(len=*),
PARAMETER :: routinen =
'xlda_hole_t_c_lr_lsd_eval'
316 INTEGER :: handle, npoints
317 INTEGER,
DIMENSION(2, 3) :: bo
318 REAL(kind=
dp) :: epsilon_rho, r, sx
319 REAL(kind=
dp),
CONTIGUOUS,
DIMENSION(:, :, :), &
320 POINTER :: dummy, e_0, e_rhoa, e_rhob, rhoa, rhob
321 TYPE(xc_derivative_type),
POINTER :: deriv
323 CALL timeset(routinen, handle)
329 local_bounds=bo, rho_cutoff=epsilon_rho)
330 npoints = (bo(2, 1) - bo(1, 1) + 1)*(bo(2, 2) - bo(1, 2) + 1)*(bo(2, 3) - bo(1, 3) + 1)
340 allocate_deriv=.true.)
343 IF (order >= 1 .OR. order == -1)
THEN
345 allocate_deriv=.true.)
348 allocate_deriv=.true.)
351 IF (order > 1 .OR. order < -1)
THEN
352 cpabort(
"derivatives bigger than 2 not implemented")
354 IF (r == 0.0_dp)
THEN
355 cpabort(
"Cutoff_Radius 0.0 not implemented")
362 CALL xlda_hole_t_c_lr_lsd_calc(npoints, order, rho=rhoa, &
363 e_0=e_0, e_rho=e_rhoa, &
364 epsilon_rho=epsilon_rho, &
367 CALL xlda_hole_t_c_lr_lsd_calc(npoints, order, rho=rhob, &
368 e_0=e_0, e_rho=e_rhob, &
369 epsilon_rho=epsilon_rho, &
373 CALL timestop(handle)
391 SUBROUTINE xlda_hole_t_c_lr_lsd_calc(npoints, order, rho, e_0, e_rho, &
394 INTEGER,
INTENT(in) :: npoints, order
395 REAL(kind=
dp),
DIMENSION(1:npoints),
INTENT(inout) :: rho, e_0, e_rho
396 REAL(kind=
dp),
INTENT(in) :: epsilon_rho, sx, r
399 REAL(
dp) :: e_tmp, my_rho
404 my_rho = 2.0_dp*max(rho(ip), 0.0_dp)
405 IF (my_rho > epsilon_rho)
THEN
409 e_0(ip) = e_0(ip) + 0.5_dp*e_tmp
415 END SUBROUTINE xlda_hole_t_c_lr_lsd_calc
Defines the basic variable types.
integer, parameter, public dp
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
Collection of simple mathematical functions and subroutines.
elemental impure real(dp) function, public expint(n, x)
computes the exponential integral En(x) = Int(exp(-x*t)/t^n,t=1..infinity) x>0, n=0,...
Module with functions to handle derivative descriptors. derivative description are strings have the f...
integer, parameter, public deriv_rhob
integer, parameter, public deriv_rhoa
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
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
Calculates the lda exchange hole in a truncated coulomb potential. Can be used as longrange correctio...
subroutine, public xlda_hole_t_c_lr_lda_eval(rho_set, deriv_set, order, params)
evaluates the truncated lda exchange hole
subroutine, public xlda_hole_t_c_lr_lda_info(reference, shortform, needs, max_deriv)
returns various information on the functional
subroutine, public xlda_hole_t_c_lr_lsd_eval(rho_set, deriv_set, order, params)
evaluates the truncated lsd exchange hole. Calls the lda routine and applies spin scaling relation
subroutine, public xlda_hole_t_c_lr_lda_calc_0(order, rho, e_0, e_rho, sx, R)
low level routine
subroutine, public xlda_hole_t_c_lr_lsd_info(reference, shortform, needs, max_deriv)
returns various information on the functional