34#include "../base/base_uses.f90"
39 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
40 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'xc_lyp'
41 REAL(kind=
dp),
PARAMETER,
PRIVATE :: a = 0.04918_dp, b = 0.132_dp, &
42 c = 0.2533_dp, d = 0.349_dp
59 CHARACTER(LEN=*),
INTENT(OUT),
OPTIONAL :: reference, shortform
61 INTEGER,
INTENT(out),
OPTIONAL :: max_deriv
63 IF (
PRESENT(reference))
THEN
64 reference =
"C. Lee, W. Yang, R.G. Parr, Phys. Rev. B, 37, 785 (1988) {LDA version}"
66 IF (
PRESENT(shortform))
THEN
67 shortform =
"Lee-Yang-Parr correlation energy functional (LDA)"
69 IF (
PRESENT(needs))
THEN
71 needs%rho_1_3 = .true.
72 needs%norm_drho = .true.
74 IF (
PRESENT(max_deriv)) max_deriv = 3
90 CHARACTER(LEN=*),
INTENT(OUT),
OPTIONAL :: reference, shortform
92 INTEGER,
INTENT(out),
OPTIONAL :: max_deriv
94 IF (
PRESENT(reference))
THEN
95 reference =
"C. Lee, W. Yang, R.G. Parr, Phys. Rev. B, 37, 785 (1988) {LSD version}"
97 IF (
PRESENT(shortform))
THEN
98 shortform =
"Lee-Yang-Parr correlation energy functional (LSD)"
100 IF (
PRESENT(needs))
THEN
101 needs%rho_spin = .true.
102 needs%norm_drho_spin = .true.
103 needs%norm_drho = .true.
105 IF (
PRESENT(max_deriv)) max_deriv = 2
124 INTEGER,
INTENT(in) :: grad_deriv
127 CHARACTER(len=*),
PARAMETER :: routinen =
'lyp_lda_eval'
129 INTEGER :: handle, npoints
130 INTEGER,
DIMENSION(2, 3) :: bo
131 REAL(kind=
dp) :: epsilon_norm_drho, epsilon_rho, sc
132 REAL(kind=
dp),
CONTIGUOUS,
DIMENSION(:, :, :),
POINTER :: dummy, e_0, e_ndrho, &
133 e_ndrho_ndrho, e_ndrho_ndrho_rho, e_ndrho_rho, e_ndrho_rho_rho, e_rho, e_rho_rho, &
134 e_rho_rho_rho, norm_drho, rho, rho_1_3
137 CALL timeset(routinen, handle)
143 norm_drho=norm_drho, local_bounds=bo, rho_cutoff=epsilon_rho, &
144 drho_cutoff=epsilon_norm_drho)
145 npoints = (bo(2, 1) - bo(1, 1) + 1)*(bo(2, 2) - bo(1, 2) + 1)*(bo(2, 3) - bo(1, 3) + 1)
154 e_ndrho_ndrho => dummy
155 e_rho_rho_rho => dummy
156 e_ndrho_rho_rho => dummy
157 e_ndrho_ndrho_rho => dummy
160 allocate_deriv=.true.)
162 IF (grad_deriv >= 1)
THEN
164 allocate_deriv=.true.)
167 allocate_deriv=.true.)
170 IF (grad_deriv >= 2)
THEN
172 allocate_deriv=.true.)
175 allocate_deriv=.true.)
181 IF (grad_deriv >= 3)
THEN
183 allocate_deriv=.true.)
196 IF (grad_deriv > 3)
THEN
197 cpabort(
"derivatives bigger than 3 not implemented")
207 CALL lyp_lda_calc(rho=rho, rho_1_3=rho_1_3, norm_drho=norm_drho, &
208 e_0=e_0, e_rho=e_rho, e_ndrho=e_ndrho, e_rho_rho=e_rho_rho, &
209 e_ndrho_rho=e_ndrho_rho, e_ndrho_ndrho=e_ndrho_ndrho, &
210 e_rho_rho_rho=e_rho_rho_rho, e_ndrho_rho_rho=e_ndrho_rho_rho, &
211 e_ndrho_ndrho_rho=e_ndrho_ndrho_rho, &
212 grad_deriv=grad_deriv, &
213 npoints=npoints, epsilon_rho=epsilon_rho, sc=sc)
217 CALL timestop(handle)
243 SUBROUTINE lyp_lda_calc(rho, rho_1_3, norm_drho, &
244 e_0, e_rho, e_ndrho, e_rho_rho, e_ndrho_rho, &
245 e_ndrho_ndrho, e_rho_rho_rho, e_ndrho_rho_rho, e_ndrho_ndrho_rho, &
246 grad_deriv, npoints, epsilon_rho, sc)
247 INTEGER,
INTENT(in) :: npoints, grad_deriv
248 REAL(kind=
dp),
DIMENSION(1:npoints),
INTENT(inout) :: e_ndrho_ndrho_rho, e_ndrho_rho_rho, &
249 e_rho_rho_rho, e_ndrho_ndrho, &
250 e_ndrho_rho, e_rho_rho, e_ndrho, &
252 REAL(kind=
dp),
DIMENSION(1:npoints),
INTENT(in) :: norm_drho, rho_1_3, rho
253 REAL(kind=
dp),
INTENT(in) :: epsilon_rho, sc
256 REAL(kind=
dp) :: cf, epsilon_rho13, my_ndrho, my_rho, my_rho_1_3, t1, t102, t103, t105, &
257 t106, t11, t112, t123, t124, t127, t128, t13, t133, t134, t14, t161, t165, t166, t173, &
258 t176, t184, t185, t189, t192, t193, t196, t199, t2, t200, t201, t202, t203, t215, t22, &
259 t227, t228, t231, t245, t246, t248, t26, t265, t278, t279, t3, t332, t37, t38, t39, t4, &
260 t40, t41, t44, t45, t48, t5, t52, t6, t61, t62, t69, t7, t70, t77, t78, t80, t87, t88, &
261 t89, t93, t94, t95, t98, t99
263 epsilon_rho13 = epsilon_rho**(1.0_dp/3.0_dp)
264 cf = 0.3_dp*(3._dp*
pi*
pi)**(2._dp/3._dp)
265 SELECT CASE (grad_deriv)
270 IF (my_rho > epsilon_rho)
THEN
271 my_rho_1_3 = rho_1_3(ii)
272 my_ndrho = norm_drho(ii)
280 t11 = 0.1e1_dp/my_rho_1_3
285 t37 = -0.72e2_dp*t7 - 0.72e2_dp*t6*d - 0.72e2_dp*t14* &
286 t7*cf - 0.72e2_dp*t14*t6*cf*d + 0.3e1_dp*t14&
287 & *t1*t22 + 0.10e2_dp*t14*t26*d + 0.7e1_dp*t14 &
288 &*t26*c + 0.7e1_dp*t14*t22*c*d
295 + (t4*t41/0.72e2_dp)*sc
304 t77 = 0.1e1_dp/my_rho
310 t93 = my_rho_1_3*my_rho
313 t98 = -0.240e3_dp*t48 - 0.216e3_dp*t5*d - 0.24e2_dp*t52&
314 & *t5*t13*cf - 0.240e3_dp*t14*t48*cf - &
315 0.24e2_dp*t52*t2*t62 - 0.216e3_dp*t14*t5*cf &
316 &*d + 0.10e2_dp/0.3e1_dp*t52*t70*t22 + 0.2e1_dp* &
317 t14*t11*t22 + 0.10e2_dp/0.3e1_dp*t78*t80 + &
318 0.10e2_dp/0.3e1_dp*t14*t69*t22*d + 0.7e1_dp/ &
319 0.3e1_dp*t88*t89*t22 + 0.7e1_dp/0.3e1_dp*t95* &
324 t105 = 0.1e1_dp/t39/t38
327 e_rho(ii) = e_rho(ii) &
328 - (0.5e1_dp/0.216e3_dp*t45*t41 - t4*t99/0.72e2_dp&
329 & + t103*t106/0.108e3_dp)*sc
331 t112 = my_rho_1_3*my_ndrho
332 t123 = 0.6e1_dp*t14*t1*my_ndrho + 0.20e2_dp*t14*t112 &
333 &*d + 0.14e2_dp*t14*t112*c + 0.14e2_dp*t14* &
337 e_ndrho(ii) = e_ndrho(ii) &
338 + (t4*t124/0.72e2_dp)*sc
346 IF (my_rho > epsilon_rho)
THEN
347 my_rho_1_3 = rho_1_3(ii)
348 my_ndrho = norm_drho(ii)
356 t11 = 0.1e1_dp/my_rho_1_3
361 t37 = -0.72e2_dp*t7 - 0.72e2_dp*t6*d - 0.72e2_dp*t14* &
362 t7*cf - 0.72e2_dp*t14*t6*cf*d + 0.3e1_dp*t14&
363 & *t1*t22 + 0.10e2_dp*t14*t26*d + 0.7e1_dp*t14 &
364 &*t26*c + 0.7e1_dp*t14*t22*c*d
371 + (t4*t41/0.72e2_dp)*sc
373 IF (grad_deriv > 0)
THEN
382 t77 = 0.1e1_dp/my_rho
388 t93 = my_rho_1_3*my_rho
391 t98 = -0.240e3_dp*t48 - 0.216e3_dp*t5*d - 0.24e2_dp*t52&
392 & *t5*t13*cf - 0.240e3_dp*t14*t48*cf - &
393 0.24e2_dp*t52*t2*t62 - 0.216e3_dp*t14*t5*cf &
394 &*d + 0.10e2_dp/0.3e1_dp*t52*t70*t22 + 0.2e1_dp* &
395 t14*t11*t22 + 0.10e2_dp/0.3e1_dp*t78*t80 + &
396 0.10e2_dp/0.3e1_dp*t14*t69*t22*d + 0.7e1_dp/ &
397 0.3e1_dp*t88*t89*t22 + 0.7e1_dp/0.3e1_dp*t95* &
402 t105 = 0.1e1_dp/t39/t38
404 t112 = my_rho_1_3*my_ndrho
405 t123 = 0.6e1_dp*t14*t1*my_ndrho + 0.20e2_dp*t14*t112 &
406 &*d + 0.14e2_dp*t14*t112*c + 0.14e2_dp*t14* &
410 e_rho(ii) = e_rho(ii) &
411 - (0.5e1_dp/0.216e3_dp*t45*t41 - t4*t99/0.72e2_dp&
412 & + t103*t106/0.108e3_dp)*sc
413 e_ndrho(ii) = e_ndrho(ii) &
414 + (t4*t124/0.72e2_dp)*sc
416 IF (grad_deriv > 1)
THEN
417 t127 = 0.1e1_dp/t1/t6
429 t192 = -0.560e3_dp*t93 - 0.432e3_dp*my_rho*d - 0.128e3_dp&
430 & *t52*my_rho*t13*cf - 0.8e1_dp*t88*t1*t13* &
431 cf - 0.560e3_dp*t14*t93*cf - 0.112e3_dp*t52*t1&
432 & *t62 - 0.8e1_dp*t88*my_rho_1_3*t62 - 0.432e3_dp* &
433 t14*my_rho*cf*d - 0.14e2_dp/0.9e1_dp*t52* &
434 t161*t22 - 0.11e2_dp/0.9e1_dp*t88*t166*t22 - &
435 0.2e1_dp/0.3e1_dp*t14*t94*t22 - 0.20e2_dp/ &
436 0.9e1_dp*t173*t80 - 0.2e1_dp*t176*t80 - &
437 0.20e2_dp/0.9e1_dp*t14*t3*t22*d + 0.7e1_dp/ &
438 0.9e1_dp*t184*t185*t22 + 0.7e1_dp/0.9e1_dp* &
447 t215 = t13*my_ndrho*d
448 t227 = 0.20e2_dp/0.3e1_dp*t52*t70*my_ndrho + 0.4e1_dp* &
449 t14*t11*my_ndrho + 0.20e2_dp/0.3e1_dp*t78*t215&
450 & + 0.20e2_dp/0.3e1_dp*t14*t69*my_ndrho*d + &
451 0.14e2_dp/0.3e1_dp*t88*t89*my_ndrho + 0.14e2_dp &
455 t245 = 0.6e1_dp*t14*t1 + 0.20e2_dp*t14*my_rho_1_3*d + &
456 0.14e2_dp*t14*my_rho_1_3*c + 0.14e2_dp*t14*c* &
460 e_rho_rho(ii) = e_rho_rho(ii) &
461 + (0.5e1_dp/0.81e2_dp*t128*t41 - 0.5e1_dp/0.108e3_dp&
462 & *t45*t99 + t134*t106/0.27e2_dp + t4*t193/ &
463 0.72e2_dp - t103*t196/0.54e2_dp + t200*t203/ &
465 e_ndrho_rho(ii) = e_ndrho_rho(ii) &
466 - (0.5e1_dp/0.216e3_dp*t45*t124 - t4*t228/ &
467 0.72e2_dp + t103*t231/0.108e3_dp)*sc
468 e_ndrho_ndrho(ii) = e_ndrho_ndrho(ii) &
469 + (t4*t246/0.72e2_dp)*sc
471 IF (grad_deriv > 2)
THEN
476 t332 = -0.432e3_dp*d - 0.2240e4_dp/0.3e1_dp*my_rho_1_3 - &
477 0.74e2_dp/0.27e2_dp*t184*t127*t80 + 0.100e3_dp/ &
478 0.27e2_dp*t14*t44*t22*d + 0.7e1_dp/0.27e2_dp* &
479 t279*t127*t13*t22 - 0.8e1_dp/0.3e1_dp*t184* &
480 t70*cf - 0.2240e4_dp/0.3e1_dp*t14*my_rho_1_3* &
481 cf - 0.48e2_dp*t88*t11*t13*cf - 0.944e3_dp/ &
482 0.3e1_dp*t52*t61 - 0.40e2_dp*t88*t69*t62 - &
483 0.656e3_dp/0.3e1_dp*t52*t11*t62 + 0.7e1_dp/ &
484 0.27e2_dp*t279*t265*t80 + 0.64e2_dp/0.27e2_dp* &
485 t52*t44*t13*t22 - 0.8e1_dp/0.3e1_dp*t184*t77&
486 & *t62 - 0.432e3_dp*t14*cf*d + 0.52e2_dp/ &
487 0.27e2_dp*t88*t199*t13*t22 - 0.20e2_dp/ &
488 0.9e1_dp*t184*t133*t13*t22 + 0.8e1_dp/0.9e1_dp&
489 & *t14*t102*t22 + 0.100e3_dp/0.27e2_dp*t52*t199&
490 & *t80 + 0.106e3_dp/0.27e2_dp*t88*t133*t80
492 e_rho_rho_rho(ii) = e_rho_rho_rho(ii) &
493 - (0.55e2_dp/0.243e3_dp*a/t1/t248*t41 - 0.5e1_dp &
494 &/0.27e2_dp*t128*t99 + 0.40e2_dp/0.243e3_dp*a/ &
495 my_rho_1_3/t248*t106 + 0.5e1_dp/0.72e2_dp*t45* &
496 t193 - t134*t196/0.9e1_dp + 0.7e1_dp/0.108e3_dp* &
497 a*t265*t203 - t4*t332*t40/0.72e2_dp + t103* &
498 t192*t105/0.36e2_dp - t200*t98*t202/0.36e2_dp &
499 &+ t128*t37/t201/t38/0.81e2_dp)*sc
500 e_ndrho_rho_rho(ii) = e_ndrho_rho_rho(ii) &
501 + (0.5e1_dp/0.81e2_dp*t128*t124 - 0.5e1_dp/ &
502 0.108e3_dp*t45*t228 + t134*t231/0.27e2_dp + t4*&
503 & (-0.28e2_dp/0.9e1_dp*t52*t161*my_ndrho - &
504 0.22e2_dp/0.9e1_dp*t88*t166*my_ndrho - 0.4e1_dp &
505 &/0.3e1_dp*t14*t94*my_ndrho - 0.40e2_dp/0.9e1_dp &
506 &*t173*t215 - 0.4e1_dp*t176*t215 - 0.40e2_dp/ &
507 0.9e1_dp*t14*t3*my_ndrho*d + 0.14e2_dp/ &
508 0.9e1_dp*t184*t185*my_ndrho + 0.14e2_dp/0.9e1_dp&
509 & *t189*t215)*t40/0.72e2_dp - t103*t227*t105/ &
510 0.54e2_dp + t200*t123*t202/0.108e3_dp)*sc
511 e_ndrho_ndrho_rho(ii) = e_ndrho_ndrho_rho(ii) &
512 - (0.5e1_dp/0.216e3_dp*t45*t246 - t4*(0.20e2_dp/ &
513 0.3e1_dp*t52*t70 + 0.4e1_dp*t14*t11 + 0.20e2_dp &
514 &/0.3e1_dp*t52*t89*d + 0.20e2_dp/0.3e1_dp*t14* &
515 t69*d + 0.14e2_dp/0.3e1_dp*t88*t89 + 0.14e2_dp/ &
516 0.3e1_dp*t88*t94*t13*d)*t40/0.72e2_dp + t103&
517 & *t245*t105/0.108e3_dp)*sc
527 END SUBROUTINE lyp_lda_calc
543 INTEGER,
INTENT(in) :: grad_deriv
546 CHARACTER(len=*),
PARAMETER :: routinen =
'lyp_lsd_eval'
548 INTEGER :: handle, npoints
549 INTEGER,
DIMENSION(2, 3) :: bo
550 REAL(kind=
dp) :: epsilon_drho, epsilon_rho, sc
551 REAL(kind=
dp),
CONTIGUOUS,
DIMENSION(:, :, :),
POINTER :: dummy, e_0, e_ndr, e_ndr_ndr, &
552 e_ndr_ra, e_ndr_rb, e_ndra, e_ndra_ndra, e_ndra_ra, e_ndra_rb, e_ndrb, e_ndrb_ndrb, &
553 e_ndrb_ra, e_ndrb_rb, e_ra, e_ra_ra, e_ra_rb, e_rb, e_rb_rb, norm_drho, norm_drhoa, &
554 norm_drhob, rhoa, rhob
557 CALL timeset(routinen, handle)
564 rhoa=rhoa, rhob=rhob, norm_drhoa=norm_drhoa, &
565 norm_drhob=norm_drhob, norm_drho=norm_drho, &
566 rho_cutoff=epsilon_rho, &
567 drho_cutoff=epsilon_drho, local_bounds=bo)
568 npoints = (bo(2, 1) - bo(1, 1) + 1)*(bo(2, 2) - bo(1, 2) + 1)*(bo(2, 3) - bo(1, 3) + 1)
591 allocate_deriv=.true.)
593 IF (grad_deriv >= 1)
THEN
595 allocate_deriv=.true.)
598 allocate_deriv=.true.)
601 allocate_deriv=.true.)
604 allocate_deriv=.true.)
607 allocate_deriv=.true.)
610 IF (grad_deriv >= 2)
THEN
612 allocate_deriv=.true.)
615 allocate_deriv=.true.)
618 allocate_deriv=.true.)
621 allocate_deriv=.true.)
624 allocate_deriv=.true.)
627 allocate_deriv=.true.)
630 allocate_deriv=.true.)
633 allocate_deriv=.true.)
655 rhoa=rhoa, rhob=rhob, norm_drho=norm_drho, norm_drhoa=norm_drhoa, &
656 norm_drhob=norm_drhob, e_0=e_0, e_ra=e_ra, e_rb=e_rb, &
657 e_ndra_ra=e_ndra_ra, e_ndra_rb=e_ndra_rb, e_ndrb_ra&
658 &=e_ndrb_ra, e_ndrb_rb=e_ndrb_rb, e_ndr_ndr=e_ndr_ndr, &
659 e_ndra_ndra=e_ndra_ndra, e_ndrb_ndrb=e_ndrb_ndrb, e_ndr=e_ndr, &
660 e_ndra=e_ndra, e_ndrb=e_ndrb, e_ra_ra=e_ra_ra, &
661 e_ra_rb=e_ra_rb, e_rb_rb=e_rb_rb, e_ndr_ra=e_ndr_ra, &
663 grad_deriv=grad_deriv, npoints=npoints, &
664 epsilon_rho=epsilon_rho, sc=sc)
668 CALL timestop(handle)
705 SUBROUTINE lyp_lsd_calc(rhoa, rhob, norm_drho, norm_drhoa, norm_drhob, &
706 e_0, e_ra, e_rb, e_ndra_ra, e_ndra_rb, e_ndrb_ra, e_ndrb_rb, e_ndr_ndr, &
707 e_ndra_ndra, e_ndrb_ndrb, e_ndr, &
708 e_ndra, e_ndrb, e_ra_ra, e_ra_rb, e_rb_rb, e_ndr_ra, e_ndr_rb, &
709 grad_deriv, npoints, epsilon_rho, sc)
710 REAL(kind=
dp),
DIMENSION(*),
INTENT(in) :: rhoa, rhob, norm_drho, norm_drhoa, &
712 REAL(kind=
dp),
DIMENSION(*),
INTENT(inout) :: e_0, e_ra, e_rb, e_ndra_ra, e_ndra_rb, &
713 e_ndrb_ra, e_ndrb_rb, e_ndr_ndr, e_ndra_ndra, e_ndrb_ndrb, e_ndr, e_ndra, e_ndrb, &
714 e_ra_ra, e_ra_rb, e_rb_rb, e_ndr_ra, e_ndr_rb
715 INTEGER,
INTENT(in) :: grad_deriv, npoints
716 REAL(kind=
dp),
INTENT(in) :: epsilon_rho, sc
719 REAL(kind=
dp) :: cf, my_ndrho, my_ndrhoa, my_ndrhob, my_rho, my_rhoa, my_rhob, t1, t100, &
720 t101, t102, t103, t104, t107, t108, t109, t112, t115, t118, t12, t120, t124, t129, t13, &
721 t130, t132, t135, t138, t14, t140, t142, t145, t15, t153, t155, t159, t16, t164, t168, &
722 t17, t171, t176, t18, t181, t182, t185, t189, t194, t195, t198, t2, t20, t202, t205, &
723 t206, t21, t210, t214, t215, t218, t22, t222, t228, t23, t232, t236, t238, t24, t243, &
724 t249, t25, t252, t253, t255, t257, t26, t260, t265, t268, t27, t270, t29, t3, t30, t304, &
725 t31, t310, t313, t316, t319, t322, t326, t329, t332, t334, t341, t35
726 REAL(kind=
dp) :: t354, t356, t360, t363, t37, t373, t376, t381, t39, t391, t4, t40, t408, &
727 t41, t415, t419, t422, t430, t44, t445, t449, t45, t452, t46, t467, t47, t48, t483, t487, &
728 t49, t490, t5, t50, t505, t515, t519, t52, t520, t54, t56, t57, t6, t61, t62, t64, t66, &
729 t7, t72, t75, t78, t8, t82, t85, t86, t87, t88, t90, t92, t94, t95, t98, t99
731 cf = 0.3_dp*(3._dp*
pi*
pi)**(2._dp/3._dp)
736 my_rhoa = max(rhoa(ii), 0.0_dp)
737 my_rhob = max(rhob(ii), 0.0_dp)
738 my_rho = my_rhoa + my_rhob
739 IF (my_rho > epsilon_rho)
THEN
740 my_ndrho = norm_drho(ii)
741 my_ndrhoa = norm_drhoa(ii)
742 my_ndrhob = norm_drhob(ii)
744 t1 = my_rho**(0.1e1_dp/0.3e1_dp)
759 t20 = 0.1e1_dp/t18/t17
761 t22 = 2**(0.1e1_dp/0.3e1_dp)
765 t26 = my_rhoa**(0.1e1_dp/0.3e1_dp)
768 t30 = my_rhob**(0.1e1_dp/0.3e1_dp)
770 t35 = 0.8e1_dp*t24*(t27*t25 + t31*t29)
772 t39 = 0.47e2_dp/0.18e2_dp - 0.7e1_dp/0.18e2_dp*t13 - &
773 0.7e1_dp/0.18e2_dp*t37
776 t44 = 0.5e1_dp/0.2e1_dp - t13/0.18e2_dp - t37/0.18e2_dp
781 t49 = t13 + t37 - 0.11e2_dp
784 t54 = t50*t45 + t52*t46
785 t56 = t49*t54/0.9e1_dp
786 t57 = t35 + t41 - t48 - t56
787 t61 = 0.2e1_dp/0.3e1_dp*t16
790 t66 = t7*t57 - 0.2e1_dp/0.3e1_dp*t16*t40 + t62*t46 + &
793 IF (my_rho > epsilon_rho)
THEN
795 - (0.4e1_dp*t6*t7*t8 + t15*t21*t66)*sc
799 IF (grad_deriv /= 0)
THEN
802 t78 = 0.64e2_dp/0.3e1_dp*t24*t72 - t75*t45/0.9e1_dp
803 t82 = my_rhob*t57 + t7*t78 - 0.2e1_dp*my_rhoa*t46
808 t90 = 0.1e1_dp/t1/t16
810 t94 = 0.4e1_dp/0.3e1_dp*t88*t92
812 t98 = 0.4e1_dp*t6*t7*t95
819 t107 = t99*t103*t104/0.3e1_dp
822 t112 = t15*t108*t109/0.3e1_dp
824 t118 = 0.11e2_dp/0.3e1_dp*t15*t115*t66
825 t120 = 0.1e1_dp/t1/my_rho
827 t129 = c*t120 + d*t120*t5 - t124/t18/my_rho*t86
828 t130 = 0.7e1_dp/0.54e2_dp*t129
829 t132 = t129/0.54e2_dp
830 t135 = -t129/0.3e1_dp
833 t142 = -t138*t45 - t140*t46
834 t145 = t130*t40 - t132*t47 - t135*t54/0.9e1_dp - t49* &
836 t153 = t7*t145 - 0.4e1_dp/0.3e1_dp*my_rho*t40 + &
837 0.4e1_dp/0.3e1_dp*my_rho*t46 + 0.4e1_dp/0.3e1_dp&
841 e_ra(ii) = e_ra(ii) &
842 - (0.4e1_dp*t6*t52 + t15*t21*t82 + t94 - t98 + &
843 t107 + t112 - t118 + t155)*sc
846 t164 = 0.64e2_dp/0.3e1_dp*t24*t159 - t75*t46/0.9e1_dp
847 t168 = my_rhoa*t57 + t7*t164 - 0.2e1_dp*my_rhob*t45
849 e_rb(ii) = e_rb(ii) &
850 - (0.4e1_dp*t6*t50 + t15*t21*t168 + t94 - t98 + &
851 t107 + t112 - t118 + t155)*sc
854 t176 = 0.2e1_dp*t7*t171 - 0.4e1_dp/0.3e1_dp*t16*my_ndrho
856 e_ndr(ii) = e_ndr(ii) &
861 t185 = -0.2e1_dp*t44*my_ndrhoa - 0.2e1_dp/0.9e1_dp*t181*t182
862 t189 = t7*t185 + 0.2e1_dp*t64*my_ndrhoa
864 e_ndra(ii) = e_ndra(ii) &
869 t198 = -0.2e1_dp*t44*my_ndrhob - 0.2e1_dp/0.9e1_dp*t194*t195
870 t202 = t7*t198 + 0.2e1_dp*t62*my_ndrhob
872 e_ndrb(ii) = e_ndrb(ii) &
875 IF (grad_deriv > 1)
THEN
878 t210 = 0.26e2_dp/0.9e1_dp*t99*t206*t14*t104
879 t214 = 0.2e1_dp/0.3e1_dp*t99*t103*t5*t153
881 t218 = 0.1e1_dp/t1/t205
882 t222 = t12*t215*t218*t14*t104/0.9e1_dp
883 t228 = 0.2e1_dp/0.9e1_dp*t12*c*t218*t14*t86*t109
884 t232 = 0.26e2_dp/0.9e1_dp*t15*t86*t206*t109
885 t236 = 0.2e1_dp/0.3e1_dp*t15*t108*t153*d
886 t238 = 0.1e1_dp/t85/t4
887 t243 = 0.2e1_dp/0.9e1_dp*t15*t238*t218*t66*t124
888 t249 = 0.154e3_dp/0.9e1_dp*t15*t5/t18/t101*t66
889 t252 = 0.22e2_dp/0.3e1_dp*t15*t115*t153
894 t265 = t124/t18/t16*t86
896 t270 = t124*d*t268*t238
897 t304 = t15*t21*(t7*((-0.14e2_dp/0.81e2_dp*t257 - &
898 0.14e2_dp/0.81e2_dp*t260 + 0.7e1_dp/0.27e2_dp* &
899 t265 - 0.7e1_dp/0.81e2_dp*t270)*t40 - (-0.2e1_dp/ &
900 0.81e2_dp*t257 - 0.2e1_dp/0.81e2_dp*t260 + t265/ &
901 0.27e2_dp - t270/0.81e2_dp)*t47 - (0.4e1_dp/ &
902 0.9e1_dp*t257 + 0.4e1_dp/0.9e1_dp*t260 - 0.2e1_dp &
903 &/0.3e1_dp*t265 + 0.2e1_dp/0.9e1_dp*t270)*t54/ &
904 0.9e1_dp - 0.2e1_dp/0.9e1_dp*t135*t142 - t49*&
905 & (0.2e1_dp*my_rhoa*t268*t45 + 0.2e1_dp*my_rhob* &
906 t268*t46)/0.9e1_dp) - 0.4e1_dp/0.3e1_dp*t40 + &
907 0.4e1_dp/0.3e1_dp*t46 + 0.4e1_dp/0.3e1_dp*t45)
908 t310 = 0.40e2_dp/0.9e1_dp*t88*my_rhob/t1/t17*d
910 t316 = 0.8e1_dp/0.9e1_dp*a*t238*my_rhoa*t313*t124
911 t319 = 0.8e1_dp*t6*t7*t268
912 t322 = t99*t103*t5*t82
913 t326 = t15*t108*t82*d
917 t341 = t15*t21*(my_rhob*t145 + t7*(-t332*t45/ &
918 0.9e1_dp + t334*t45/0.9e1_dp))
920 e_ra_ra(ii) = e_ra_ra(ii) &
921 + (t210 - t214 - t222 - t228 + t232 - t236 - t243 - t249 + &
922 t252 + 0.8e1_dp*t253 - 0.8e1_dp/0.3e1_dp*t255 - &
923 t304 + t310 - t316 - t319 - 0.2e1_dp/0.3e1_dp*t322 - &
924 0.2e1_dp/0.3e1_dp*t326 + 0.22e2_dp/0.3e1_dp*t329&
925 & - 0.2e1_dp*t341 - t15*t21*(0.2e1_dp*my_rhob* &
926 t78 + 0.320e3_dp/0.9e1_dp*t72*my_rhob*t24 - &
929 t354 = t99*t103*t5*t168
931 t360 = t87*my_rhoa*t90*d
933 t373 = t15*t21*(my_rhoa*t145 + t7*(-t332*t46/ &
934 0.9e1_dp + t334*t46/0.9e1_dp))
935 t376 = t15*t108*t168*d
937 e_rb_rb(ii) = e_rb_rb(ii) &
938 + (t210 - t214 - t222 - t228 + t232 - t236 - t243 - t249 + &
939 t252 - t304 + t310 - t316 - t319 + 0.8e1_dp*t356 - &
940 0.8e1_dp/0.3e1_dp*t360 + 0.22e2_dp/0.3e1_dp* &
941 t363 - 0.2e1_dp*t373 - 0.2e1_dp/0.3e1_dp*t354 - &
942 0.2e1_dp/0.3e1_dp*t376 - t15*t21*(0.2e1_dp* &
943 my_rhoa*t164 + 0.320e3_dp/0.9e1_dp*my_rhoa* &
944 t159*t24 - 0.2e1_dp*t45))*sc
946 t381 = -t354/0.3e1_dp + 0.4e1_dp*t356 - 0.4e1_dp/0.3e1_dp&
947 & *t360 + 0.11e2_dp/0.3e1_dp*t363 - t373 - t341 - &
948 t376/0.3e1_dp + t310 - 0.4e1_dp*t6*t8 + 0.4e1_dp* &
949 t253 + t210 - t214 - t222
950 t391 = -t228 + t232 - t236 - t243 - t249 + t252 - 0.4e1_dp/ &
951 0.3e1_dp*t255 - t304 - t316 - t319 - t322/0.3e1_dp - &
952 t326/0.3e1_dp + 0.11e2_dp/0.3e1_dp*t329 - t15* &
953 t21*(t35 + t41 - t48 - t56 + my_rhob*t164 + my_rhoa &
956 e_ra_rb(ii) = e_ra_rb(ii) &
960 t415 = t99*t103*t5*t176/0.3e1_dp
961 t419 = t15*t108*t176*d/0.3e1_dp
962 t422 = 0.11e2_dp/0.3e1_dp*t15*t115*t176
963 t430 = t15*t21*(0.2e1_dp*t7*t130*my_ndrho - 0.8e1_dp &
964 &/0.3e1_dp*my_rho*my_ndrho)
966 e_ndr_ra(ii) = e_ndr_ra(ii) &
967 - (0.2e1_dp*t408*t313*t171 + t415 + t419 - t422 + &
969 e_ndr_rb(ii) = e_ndr_rb(ii) &
970 - (0.2e1_dp*t408*t20*my_rhoa*t171 + t415 + t419 - &
973 t445 = t99*t103*t5*t189/0.3e1_dp
974 t449 = t15*t108*t189*d/0.3e1_dp
975 t452 = 0.11e2_dp/0.3e1_dp*t15*t115*t189
976 t467 = t15*t21*(t7*(-0.2e1_dp*t132*my_ndrhoa - &
977 0.2e1_dp/0.9e1_dp*t135*my_rhoa*t182 + 0.2e1_dp/ &
978 0.9e1_dp*t181*t95*my_ndrhoa) + 0.8e1_dp/0.3e1_dp&
981 e_ndra_ra(ii) = e_ndra_ra(ii) &
982 - (t15*t21*(my_rhob*t185 - 0.2e1_dp/0.9e1_dp*t7&
983 & *t75*my_ndrhoa) + t445 + t449 - t452 + t467)*sc
984 e_ndra_rb(ii) = e_ndra_rb(ii) &
985 - (t15*t21*(my_rhoa*t185 - 0.4e1_dp*my_rhob* &
986 my_ndrhoa) + t445 + t449 - t452 + t467)*sc
988 t483 = t99*t103*t5*t202/0.3e1_dp
989 t487 = t15*t108*t202*d/0.3e1_dp
990 t490 = 0.11e2_dp/0.3e1_dp*t15*t115*t202
991 t505 = t15*t21*(t7*(-0.2e1_dp*t132*my_ndrhob - &
992 0.2e1_dp/0.9e1_dp*t135*my_rhob*t195 + 0.2e1_dp/ &
993 0.9e1_dp*t194*t95*my_ndrhob) + 0.8e1_dp/0.3e1_dp&
996 e_ndrb_ra(ii) = e_ndrb_ra(ii) &
997 - (t15*t21*(my_rhob*t198 - 0.4e1_dp*my_rhoa* &
998 my_ndrhob) + t483 + t487 - t490 + t505)*sc
999 e_ndrb_rb(ii) = e_ndrb_rb(ii) &
1000 - (t15*t21*(my_rhoa*t198 - 0.2e1_dp/0.9e1_dp*t7&
1001 & *t75*my_ndrhob) + t483 + t487 - t490 + t505)*sc
1003 t515 = 0.4e1_dp/0.3e1_dp*t16
1005 e_ndr_ndr(ii) = e_ndr_ndr(ii) &
1006 - (t15*t21*(0.2e1_dp*t7*t39 - t515))*sc
1011 e_ndra_ndra(ii) = e_ndra_ndra(ii) &
1012 - (t15*t21*(t7*(-0.5e1_dp + t519 + t520 - 0.2e1_dp &
1013 &/0.9e1_dp*t181*t8) + t515 - 0.2e1_dp*t29))*sc
1015 e_ndrb_ndrb(ii) = e_ndrb_ndrb(ii) &
1016 - (t15*t21*(t7*(-0.5e1_dp + t519 + t520 - 0.2e1_dp &
1017 &/0.9e1_dp*t194*t8) + t515 - 0.2e1_dp*t25))*sc
1024 END SUBROUTINE lyp_lsd_calc
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public lee1988
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_norm_drhoa
integer, parameter, public deriv_rhob
integer, parameter, public deriv_rhoa
integer, parameter, public deriv_rho
integer, parameter, public deriv_norm_drhob
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
calculates the lyp correlation functional
subroutine, public lyp_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public lyp_lsd_eval(rho_set, deriv_set, grad_deriv, lyp_params)
evaluates the becke 88 exchange functional for lsd
subroutine, public lyp_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public lyp_lda_eval(rho_set, deriv_set, grad_deriv, lyp_params)
evaluates the lyp correlation 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