54#include "./base/base_uses.f90"
60 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_vxc_atom'
83 adiabatic_rescale_factor, kind_set_external, &
84 rho_atom_set_external, xc_section_external)
87 LOGICAL,
INTENT(IN) :: energy_only
88 REAL(
dp),
INTENT(INOUT) :: exc1
90 POINTER :: gradient_atom_set
91 REAL(
dp),
INTENT(IN),
OPTIONAL :: adiabatic_rescale_factor
93 POINTER :: kind_set_external
95 POINTER :: rho_atom_set_external
98 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calculate_vxc_atom'
100 INTEGER :: bo(2), handle, ia, iat, iatom, idir, &
101 ikind, ir, ispin, myfun, na, natom, &
103 INTEGER,
DIMENSION(2, 3) :: bounds
104 INTEGER,
DIMENSION(:),
POINTER :: atom_list
105 LOGICAL :: donlcc, epr_xc, gradient_f, lsd, nlcc, &
107 REAL(
dp) :: density_cut, exc_h, exc_s, gradient_cut, &
108 my_adiabatic_rescale_factor, tau_cut
109 REAL(
dp),
DIMENSION(1, 1, 1) :: tau_d
110 REAL(
dp),
DIMENSION(1, 1, 1, 1) :: rho_d
111 REAL(
dp),
DIMENSION(:, :),
POINTER :: rho_nlcc, weight
112 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: rho_h, rho_s, tau_h, tau_s, vtau_h, &
114 REAL(
dp),
DIMENSION(:, :, :, :),
POINTER :: drho_h, drho_s, vxg_h, vxg_s
121 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: my_kind_set
122 TYPE(
rho_atom_coeff),
DIMENSION(:),
POINTER :: dr_h, dr_s, int_hh, int_ss, r_h, r_s
124 TYPE(
rho_atom_type),
DIMENSION(:),
POINTER :: my_rho_atom_set
133 CALL timeset(routinen, handle)
136 NULLIFY (my_kind_set)
137 NULLIFY (atomic_kind_set)
143 NULLIFY (my_rho_atom_set)
147 IF (
PRESENT(gradient_atom_set))
THEN
151 IF (
PRESENT(adiabatic_rescale_factor))
THEN
152 my_adiabatic_rescale_factor = adiabatic_rescale_factor
154 my_adiabatic_rescale_factor = 1.0_dp
158 dft_control=dft_control, &
160 atomic_kind_set=atomic_kind_set, &
161 qs_kind_set=my_kind_set, &
163 rho_atom_set=my_rho_atom_set)
165 IF (
PRESENT(kind_set_external)) my_kind_set => kind_set_external
166 IF (
PRESENT(rho_atom_set_external)) my_rho_atom_set => rho_atom_set_external
172 "PROPERTIES%LINRES%EPR%PRINT%G_TENSOR%XC")
177 IF (
PRESENT(xc_section_external)) my_xc_section => xc_section_external
185 my_rho_atom_set(:)%exc_h = 0.0_dp
186 my_rho_atom_set(:)%exc_s = 0.0_dp
195 lsd = dft_control%lsd
196 nspins = dft_control%nspins
199 calc_potential=.true.)
202 IF (epr_xc) needs%drho_spin = .true.
204 gradient_f = (needs%drho .OR. needs%drho_spin)
205 tau_f = (needs%tau .OR. needs%tau_spin)
211 NULLIFY (rho_h, drho_h, rho_s, drho_s, weight)
212 NULLIFY (vxc_h, vxc_s, vxg_h, vxg_s)
213 NULLIFY (tau_h, tau_s)
214 NULLIFY (vtau_h, vtau_s)
218 DO ikind = 1,
SIZE(atomic_kind_set)
219 CALL get_atomic_kind(atomic_kind_set(ikind), atom_list=atom_list, natom=natom)
220 CALL get_qs_kind(my_kind_set(ikind), paw_atom=paw_atom, &
221 harmonics=harmonics, grid_atom=grid_atom)
222 CALL get_qs_kind(my_kind_set(ikind), basis_set=basis_1c, basis_type=
"GAPW_1C")
224 IF (.NOT. paw_atom) cycle
227 na = grid_atom%ng_sphere
242 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
244 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
250 CALL reallocate(rho_h, 1, na, 1, nr, 1, nspins)
251 CALL reallocate(rho_s, 1, na, 1, nr, 1, nspins)
252 weight => grid_atom%weight
253 CALL reallocate(vxc_h, 1, na, 1, nr, 1, nspins)
254 CALL reallocate(vxc_s, 1, na, 1, nr, 1, nspins)
257 CALL reallocate(drho_h, 1, 4, 1, na, 1, nr, 1, nspins)
258 CALL reallocate(drho_s, 1, 4, 1, na, 1, nr, 1, nspins)
259 CALL reallocate(vxg_h, 1, 3, 1, na, 1, nr, 1, nspins)
260 CALL reallocate(vxg_s, 1, 3, 1, na, 1, nr, 1, nspins)
264 CALL reallocate(tau_h, 1, na, 1, nr, 1, nspins)
265 CALL reallocate(tau_s, 1, na, 1, nr, 1, nspins)
266 CALL reallocate(vtau_h, 1, na, 1, nr, 1, nspins)
267 CALL reallocate(vtau_s, 1, na, 1, nr, 1, nspins)
274 rho_nlcc => my_kind_set(ikind)%nlcc_pot
275 IF (
ASSOCIATED(rho_nlcc)) donlcc = .true.
280 num_pe = para_env%num_pe
281 bo =
get_limit(natom, para_env%num_pe, para_env%mepos)
283 DO iat = bo(1), bo(2)
284 iatom = atom_list(iat)
286 my_rho_atom_set(iatom)%exc_h = 0.0_dp
287 my_rho_atom_set(iatom)%exc_s = 0.0_dp
289 rho_atom => my_rho_atom_set(iatom)
293 NULLIFY (r_h, r_s, dr_h, dr_s, r_h_d, r_s_d)
295 rho_rad_s=r_s, drho_rad_h=dr_h, &
296 drho_rad_s=dr_s, rho_rad_h_d=r_h_d, &
302 CALL get_rho_atom(rho_atom=rho_atom, rho_rad_h=r_h, rho_rad_s=r_s)
307 CALL calc_tau_atom(tau_h, tau_s, rho_atom, my_kind_set(ikind), nspins)
314 ir, r_h, r_s, rho_h, rho_s, dr_h, dr_s, &
315 r_h_d, r_s_d, drho_h, drho_s)
317 CALL calc_rho_nlcc(grid_atom, nspins, gradient_f, &
318 ir, rho_nlcc(:, 1), rho_h, rho_s, rho_nlcc(:, 2), drho_h, drho_s)
323 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, drho_h, tau_h, na, ir)
324 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, drho_s, tau_s, na, ir)
325 ELSE IF (gradient_f)
THEN
326 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, drho_h, tau_d, na, ir)
327 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, drho_s, tau_d, na, ir)
329 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, rho_d, tau_d, na, ir)
330 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, rho_d, tau_d, na, ir)
338 CALL vxc_of_r_new(xc_fun_section, rho_set_h, deriv_set, 1, needs, weight, &
339 lsd, na, nr, exc_h, vxc_h, vxg_h, vtau_h, energy_only=energy_only, &
340 epr_xc=epr_xc, adiabatic_rescale_factor=my_adiabatic_rescale_factor)
341 rho_atom%exc_h = rho_atom%exc_h + exc_h
347 CALL vxc_of_r_new(xc_fun_section, rho_set_s, deriv_set, 1, needs, weight, &
348 lsd, na, nr, exc_s, vxc_s, vxg_s, vtau_s, energy_only=energy_only, &
349 epr_xc=epr_xc, adiabatic_rescale_factor=my_adiabatic_rescale_factor)
350 rho_atom%exc_s = rho_atom%exc_s + exc_s
357 gradient_atom_set(iatom)%nablavks_vec_rad_h(idir, ispin)%r_coef(ir, ia) = &
358 gradient_atom_set(iatom)%nablavks_vec_rad_h(idir, ispin)%r_coef(ir, ia) &
359 + vxg_h(idir, ia, ir, ispin)
360 gradient_atom_set(iatom)%nablavks_vec_rad_s(idir, ispin)%r_coef(ir, ia) = &
361 gradient_atom_set(iatom)%nablavks_vec_rad_s(idir, ispin)%r_coef(ir, ia) &
362 + vxg_s(idir, ia, ir, ispin)
371 exc1 = exc1 + rho_atom%exc_h - rho_atom%exc_s
377 IF (.NOT. energy_only)
THEN
378 NULLIFY (int_hh, int_ss)
379 CALL get_rho_atom(rho_atom=rho_atom, ga_vlocal_gb_h=int_hh, ga_vlocal_gb_s=int_ss)
381 CALL gavxcgb_gc(vxc_h, vxc_s, vxg_h, vxg_s, int_hh, int_ss, &
382 grid_atom, basis_1c, harmonics, nspins)
385 grid_atom, basis_1c, harmonics, nspins)
388 CALL dgavtaudgb(vtau_h, vtau_s, int_hh, int_ss, &
389 grid_atom, basis_1c, harmonics, nspins)
392 NULLIFY (r_h, r_s, dr_h, dr_s)
402 CALL para_env%sum(exc1)
404 IF (
ASSOCIATED(rho_h))
DEALLOCATE (rho_h)
405 IF (
ASSOCIATED(rho_s))
DEALLOCATE (rho_s)
406 IF (
ASSOCIATED(vxc_h))
DEALLOCATE (vxc_h)
407 IF (
ASSOCIATED(vxc_s))
DEALLOCATE (vxc_s)
410 IF (
ASSOCIATED(drho_h))
DEALLOCATE (drho_h)
411 IF (
ASSOCIATED(drho_s))
DEALLOCATE (drho_s)
412 IF (
ASSOCIATED(vxg_h))
DEALLOCATE (vxg_h)
413 IF (
ASSOCIATED(vxg_s))
DEALLOCATE (vxg_s)
417 IF (
ASSOCIATED(tau_h))
DEALLOCATE (tau_h)
418 IF (
ASSOCIATED(tau_s))
DEALLOCATE (tau_s)
419 IF (
ASSOCIATED(vtau_h))
DEALLOCATE (vtau_h)
420 IF (
ASSOCIATED(vtau_s))
DEALLOCATE (vtau_s)
425 CALL timestop(handle)
441 do_tddfpt2, do_triplet, kind_set_external)
443 TYPE(
rho_atom_type),
DIMENSION(:),
POINTER :: rho_atom_set, rho1_atom_set
447 LOGICAL,
INTENT(IN),
OPTIONAL :: do_tddfpt2, do_triplet
449 POINTER :: kind_set_external
451 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calculate_xc_2nd_deriv_atom'
453 INTEGER ::
atom, handle, iatom, ikind, ir, na, &
455 INTEGER,
DIMENSION(2) :: local_loop_limit
456 INTEGER,
DIMENSION(2, 3) :: bounds
457 INTEGER,
DIMENSION(:),
POINTER :: atom_list
458 LOGICAL :: gradient_functional, lsd, paw_atom, &
460 REAL(kind=
dp) :: density_cut, gradient_cut, rtot, tau_cut
461 REAL(kind=
dp),
CONTIGUOUS,
DIMENSION(:, :, :), &
462 POINTER :: vxc_h, vxc_s
463 REAL(kind=
dp),
DIMENSION(1, 1, 1) :: rtau
464 REAL(kind=
dp),
DIMENSION(1, 1, 1, 1) :: rrho
465 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: weight
466 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: rho1_h, rho1_s, rho_h, rho_s, tau1_h, &
468 REAL(kind=
dp),
DIMENSION(:, :, :, :),
POINTER :: drho1_h, drho1_s, drho_h, drho_s, vxg_h, &
474 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: my_kind_set, qs_kind_set
475 TYPE(
rho_atom_coeff),
DIMENSION(:),
POINTER :: dr1_h, dr1_s, dr_h, dr_s, int_hh, &
476 int_ss, r1_h, r1_s, r_h, r_s
477 TYPE(
rho_atom_coeff),
DIMENSION(:, :),
POINTER :: r1_h_d, r1_s_d, r_h_d, r_s_d
487 CALL timeset(routinen, handle)
489 NULLIFY (qs_kind_set)
490 NULLIFY (rho_h, rho_s, drho_h, drho_s, weight)
491 NULLIFY (rho1_h, rho1_s, drho1_h, drho1_s)
492 NULLIFY (vxc_h, vxc_s, vxg_h, vxg_s)
493 NULLIFY (tau_h, tau_s, tau1_h, tau1_s)
497 qs_kind_set=qs_kind_set, &
498 atomic_kind_set=atomic_kind_set)
500 IF (
PRESENT(kind_set_external))
THEN
501 my_kind_set => kind_set_external
503 my_kind_set => qs_kind_set
523 IF (
PRESENT(do_tddfpt2) .AND.
PRESENT(do_triplet))
THEN
524 IF (nspins == 1 .AND. do_triplet)
THEN
528 ELSEIF (
PRESENT(do_triplet))
THEN
529 IF (nspins == 1 .AND. do_triplet) lsd = .true.
533 calc_potential=.true.)
534 gradient_functional = needs%drho .OR. needs%drho_spin
535 tau_f = (needs%tau .OR. needs%tau_spin)
537 cpabort(
"Tau functionals not implemented for GAPW 2nd derivatives")
543 DO ikind = 1,
SIZE(atomic_kind_set)
545 NULLIFY (atom_list, harmonics, grid_atom)
546 CALL get_atomic_kind(atomic_kind_set(ikind), atom_list=atom_list, natom=natom)
547 CALL get_qs_kind(my_kind_set(ikind), paw_atom=paw_atom, &
548 harmonics=harmonics, grid_atom=grid_atom)
549 CALL get_qs_kind(my_kind_set(ikind), basis_set=basis_1c, basis_type=
"GAPW_1C")
550 IF (.NOT. paw_atom) cycle
553 na = grid_atom%ng_sphere
564 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
566 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
568 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
570 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
573 IF (nspins == 1 .AND. .NOT. lsd)
THEN
585 ALLOCATE (rho_h(1:na, 1:nr, 1:nspins), rho1_h(1:na, 1:nr, 1:nspins), &
586 rho_s(1:na, 1:nr, 1:nspins), rho1_s(1:na, 1:nr, 1:nspins))
588 ALLOCATE (vxc_h(1:na, 1:nr, 1:nspins), vxc_s(1:na, 1:nr, 1:nspins))
592 weight => grid_atom%weight
594 IF (gradient_functional)
THEN
595 ALLOCATE (drho_h(1:4, 1:na, 1:nr, 1:nspins), drho1_h(1:4, 1:na, 1:nr, 1:nspins), &
596 drho_s(1:4, 1:na, 1:nr, 1:nspins), drho1_s(1:4, 1:na, 1:nr, 1:nspins))
597 ALLOCATE (vxg_h(1:3, 1:na, 1:nr, 1:nspins), vxg_s(1:3, 1:na, 1:nr, 1:nspins))
599 ALLOCATE (drho_h(1, 1, 1, 1), drho1_h(1, 1, 1, 1), &
600 drho_s(1, 1, 1, 1), drho1_s(1, 1, 1, 1))
601 ALLOCATE (vxg_h(1, 1, 1, 1), vxg_s(1, 1, 1, 1))
608 local_loop_limit =
get_limit(natom, para_env%num_pe, para_env%mepos)
610 DO iatom = local_loop_limit(1), local_loop_limit(2)
611 atom = atom_list(iatom)
613 rho_atom_set(
atom)%exc_h = 0.0_dp
614 rho_atom_set(
atom)%exc_s = 0.0_dp
615 rho1_atom_set(
atom)%exc_h = 0.0_dp
616 rho1_atom_set(
atom)%exc_s = 0.0_dp
618 rho_atom => rho_atom_set(
atom)
619 rho1_atom => rho1_atom_set(
atom)
620 NULLIFY (r_h, r_s, dr_h, dr_s, r_h_d, r_s_d)
621 NULLIFY (r1_h, r1_s, dr1_h, dr1_s, r1_h_d, r1_s_d)
626 IF (gradient_functional)
THEN
628 rho_rad_h=r_h, rho_rad_s=r_s, &
629 drho_rad_h=dr_h, drho_rad_s=dr_s, &
630 rho_rad_h_d=r_h_d, rho_rad_s_d=r_s_d)
632 rho_rad_h=r1_h, rho_rad_s=r1_s, &
633 drho_rad_h=dr1_h, drho_rad_s=dr1_s, &
634 rho_rad_h_d=r1_h_d, rho_rad_s_d=r1_s_d)
635 drho_h = 0.0_dp; drho_s = 0.0_dp
636 drho1_h = 0.0_dp; drho1_s = 0.0_dp
639 rho_rad_h=r_h, rho_rad_s=r_s)
641 rho_rad_h=r1_h, rho_rad_s=r1_s)
648 ir, r_h, r_s, rho_h, rho_s, dr_h, dr_s, r_h_d, r_s_d, &
651 ir, r1_h, r1_s, rho1_h, rho1_s, dr1_h, dr1_s, r1_h_d, r1_s_d, &
657 IF (gradient_functional)
THEN
658 drho_h = 2.0_dp*drho_h
659 drho_s = 2.0_dp*drho_s
665 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, drho_h, tau_h, na, ir)
666 CALL fill_rho_set(rho1_set_h, lsd, nspins, needs, rho1_h, drho1_h, tau1_h, na, ir)
667 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, drho_s, tau_s, na, ir)
668 CALL fill_rho_set(rho1_set_s, lsd, nspins, needs, rho1_s, drho1_s, tau1_s, na, ir)
669 ELSE IF (gradient_functional)
THEN
670 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, drho_h, rtau, na, ir)
671 CALL fill_rho_set(rho1_set_h, lsd, nspins, needs, rho1_h, drho1_h, rtau, na, ir)
672 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, drho_s, rtau, na, ir)
673 CALL fill_rho_set(rho1_set_s, lsd, nspins, needs, rho1_s, drho1_s, rtau, na, ir)
675 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, rrho, rtau, na, ir)
676 CALL fill_rho_set(rho1_set_h, lsd, nspins, needs, rho1_h, rrho, rtau, na, ir)
677 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, rrho, rtau, na, ir)
678 CALL fill_rho_set(rho1_set_s, lsd, nspins, needs, rho1_s, rrho, rtau, na, ir)
683 rho_set=rho_set_h, rho1_set=rho1_set_h, &
684 deriv_set=deriv_set, &
685 w=weight, vxc=vxc_h, vxg=vxg_h, do_triplet=do_triplet)
687 rho_set=rho_set_s, rho1_set=rho1_set_s, &
688 deriv_set=deriv_set, &
689 w=weight, vxc=vxc_s, vxg=vxg_s, do_triplet=do_triplet)
691 CALL get_rho_atom(rho_atom=rho1_atom, ga_vlocal_gb_h=int_hh, ga_vlocal_gb_s=int_ss)
692 IF (gradient_functional)
THEN
693 CALL gavxcgb_gc(vxc_h, vxc_s, vxg_h, vxg_s, int_hh, int_ss, &
694 grid_atom, basis_1c, harmonics, nspins)
697 grid_atom, basis_1c, harmonics, nspins)
700 NULLIFY (r_h, r_s, dr_h, dr_s)
706 DEALLOCATE (rho_h, rho_s, rho1_h, rho1_s, vxc_h, vxc_s)
707 DEALLOCATE (drho_h, drho_s, vxg_h, vxg_s)
708 DEALLOCATE (drho1_h, drho1_s)
718 CALL timestop(handle)
734 kind_set, xc_section, is_triplet, accuracy)
737 TYPE(
rho_atom_type),
DIMENSION(:),
POINTER :: rho0_atom_set, rho1_atom_set, &
741 LOGICAL,
INTENT(IN) :: is_triplet
742 INTEGER,
INTENT(IN) :: accuracy
744 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calculate_gfxc_atom'
745 REAL(kind=
dp),
PARAMETER :: epsrho = 5.e-4_dp
747 INTEGER :: bo(2), handle, iat, iatom, ikind, ir, &
748 istep, mspins, myfun, na, natom, nf, &
749 nr, ns, nspins, nstep, num_pe
750 INTEGER,
DIMENSION(2, 3) :: bounds
751 INTEGER,
DIMENSION(:),
POINTER :: atom_list
752 LOGICAL :: donlcc, gradient_f, lsd, nlcc, paw_atom, &
754 REAL(
dp) :: beta, density_cut, exc_h, exc_s, &
755 gradient_cut, oeps1, oeps2, tau_cut
756 REAL(
dp),
DIMENSION(1, 1, 1) :: tau_d
757 REAL(
dp),
DIMENSION(1, 1, 1, 1) :: rho_d
758 REAL(
dp),
DIMENSION(:, :),
POINTER :: rho_nlcc, weight
759 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: rho0_h, rho0_s, rho1_h, rho1_s, rho_h, &
760 rho_s, tau0_h, tau0_s, tau1_h, tau1_s, &
761 tau_h, tau_s, vtau_h, vtau_s, vxc_h, &
763 REAL(
dp),
DIMENSION(:, :, :, :),
POINTER :: drho0_h, drho0_s, drho1_h, drho1_s, &
764 drho_h, drho_s, vxg_h, vxg_s
765 REAL(kind=
dp),
DIMENSION(-4:4) :: ak, bl
772 TYPE(
rho_atom_coeff),
DIMENSION(:),
POINTER :: dr_h, dr_s, fint_hh, fint_ss, int_hh, &
775 TYPE(
rho_atom_type),
POINTER :: rho0_atom, rho1_atom, rho2_atom
781 CALL timeset(routinen, handle)
785 SELECT CASE (accuracy)
788 ak(-2:2) = (/1.0_dp, -8.0_dp, 0.0_dp, 8.0_dp, -1.0_dp/)/12.0_dp
789 bl(-2:2) = (/-1.0_dp, 16.0_dp, -30.0_dp, 16.0_dp, -1.0_dp/)/12.0_dp
792 ak(-3:3) = (/-1.0_dp, 9.0_dp, -45.0_dp, 0.0_dp, 45.0_dp, -9.0_dp, 1.0_dp/)/60.0_dp
793 bl(-3:3) = (/2.0_dp, -27.0_dp, 270.0_dp, -490.0_dp, 270.0_dp, -27.0_dp, 2.0_dp/)/180.0_dp
796 ak(-4:4) = (/1.0_dp, -32.0_dp/3.0_dp, 56.0_dp, -224.0_dp, 0.0_dp, &
797 224.0_dp, -56.0_dp, 32.0_dp/3.0_dp, -1.0_dp/)/280.0_dp
798 bl(-4:4) = (/-1.0_dp, 128.0_dp/9.0_dp, -112.0_dp, 896.0_dp, -14350.0_dp/9.0_dp, &
799 896.0_dp, -112.0_dp, 128.0_dp/9.0_dp, -1.0_dp/)/560.0_dp
801 oeps1 = 1.0_dp/epsrho
802 oeps2 = 1.0_dp/(epsrho**2)
805 dft_control=dft_control, &
807 atomic_kind_set=atomic_kind_set)
820 lsd = dft_control%lsd
821 nspins = dft_control%nspins
824 cpassert(nspins == 1)
829 gradient_f = (needs%drho .OR. needs%drho_spin)
830 tau_f = (needs%tau .OR. needs%tau_spin)
833 DO ikind = 1,
SIZE(atomic_kind_set)
834 CALL get_atomic_kind(atomic_kind_set(ikind), atom_list=atom_list, natom=natom)
835 CALL get_qs_kind(kind_set(ikind), paw_atom=paw_atom, &
836 harmonics=harmonics, grid_atom=grid_atom)
837 CALL get_qs_kind(kind_set(ikind), basis_set=basis_1c, basis_type=
"GAPW_1C")
839 IF (.NOT. paw_atom) cycle
842 na = grid_atom%ng_sphere
857 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
859 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
865 weight => grid_atom%weight
867 ALLOCATE (rho_h(na, nr, mspins), rho_s(na, nr, mspins), &
868 rho0_h(na, nr, nspins), rho0_s(na, nr, nspins), &
869 rho1_h(na, nr, nspins), rho1_s(na, nr, nspins))
870 ALLOCATE (vxc_h(na, nr, mspins), vxc_s(na, nr, mspins))
872 ALLOCATE (drho_h(4, na, nr, mspins), drho_s(4, na, nr, mspins), &
873 drho0_h(4, na, nr, nspins), drho0_s(4, na, nr, nspins), &
874 drho1_h(4, na, nr, nspins), drho1_s(4, na, nr, nspins))
875 ALLOCATE (vxg_h(3, na, nr, mspins), vxg_s(3, na, nr, mspins))
878 ALLOCATE (tau_h(na, nr, mspins), tau_s(na, nr, mspins), &
879 tau0_h(na, nr, nspins), tau0_s(na, nr, nspins), &
880 tau1_h(na, nr, nspins), tau1_s(na, nr, nspins))
881 ALLOCATE (vtau_h(na, nr, mspins), vtau_s(na, nr, mspins))
888 rho_nlcc => kind_set(ikind)%nlcc_pot
889 IF (
ASSOCIATED(rho_nlcc)) donlcc = .true.
893 num_pe = para_env%num_pe
894 bo =
get_limit(natom, num_pe, para_env%mepos)
896 DO iat = bo(1), bo(2)
897 iatom = atom_list(iat)
899 NULLIFY (int_hh, int_ss)
900 rho0_atom => rho0_atom_set(iatom)
901 CALL get_rho_atom(rho_atom=rho0_atom, ga_vlocal_gb_h=int_hh, ga_vlocal_gb_s=int_ss)
902 ALLOCATE (fint_ss(nspins), fint_hh(nspins))
904 nf =
SIZE(int_ss(ns)%r_coef, 1)
905 ALLOCATE (fint_ss(ns)%r_coef(nf, nf))
906 nf =
SIZE(int_hh(ns)%r_coef, 1)
907 ALLOCATE (fint_hh(ns)%r_coef(nf, nf))
913 rho0_atom => rho0_atom_set(iatom)
915 NULLIFY (r_h, r_s, dr_h, dr_s, r_h_d, r_s_d)
916 CALL get_rho_atom(rho_atom=rho0_atom, rho_rad_h=r_h, rho_rad_s=r_s, drho_rad_h=dr_h, &
917 drho_rad_s=dr_s, rho_rad_h_d=r_h_d, rho_rad_s_d=r_s_d)
922 CALL get_rho_atom(rho_atom=rho0_atom, rho_rad_h=r_h, rho_rad_s=r_s)
927 ir, r_h, r_s, rho0_h, rho0_s, dr_h, dr_s, &
928 r_h_d, r_s_d, drho0_h, drho0_s)
930 CALL calc_rho_nlcc(grid_atom, nspins, gradient_f, &
931 ir, rho_nlcc(:, 1), rho0_h, rho0_s, rho_nlcc(:, 2), drho0_h, drho0_s)
936 CALL calc_tau_atom(tau0_h, tau0_s, rho0_atom, kind_set(ikind), nspins)
943 rho1_atom => rho1_atom_set(iatom)
945 NULLIFY (r_h, r_s, dr_h, dr_s, r_h_d, r_s_d)
946 CALL get_rho_atom(rho_atom=rho1_atom, rho_rad_h=r_h, rho_rad_s=r_s, drho_rad_h=dr_h, &
947 drho_rad_s=dr_s, rho_rad_h_d=r_h_d, rho_rad_s_d=r_s_d)
952 CALL get_rho_atom(rho_atom=rho1_atom, rho_rad_h=r_h, rho_rad_s=r_s)
956 ir, r_h, r_s, rho1_h, rho1_s, dr_h, dr_s, &
957 r_h_d, r_s_d, drho1_h, drho1_s)
961 CALL calc_tau_atom(tau1_h, tau1_s, rho1_atom, kind_set(ikind), nspins)
964 rho2_atom => rho2_atom_set(iatom)
966 DO istep = -nstep, nstep
968 beta = real(istep, kind=
dp)*epsrho
971 rho_h(:, :, 1) = rho0_h(:, :, 1) + beta*rho1_h(:, :, 1)
972 rho_h(:, :, 2) = rho0_h(:, :, 1)
974 rho_s(:, :, 1) = rho0_s(:, :, 1) + beta*rho1_s(:, :, 1)
975 rho_s(:, :, 2) = rho0_s(:, :, 1)
978 drho_h(:, :, :, 1) = drho0_h(:, :, :, 1) + beta*drho1_h(:, :, :, 1)
979 drho_h(:, :, :, 2) = drho0_h(:, :, :, 1)
980 drho_h = 0.5_dp*drho_h
981 drho_s(:, :, :, 1) = drho0_s(:, :, :, 1) + beta*drho1_s(:, :, :, 1)
982 drho_s(:, :, :, 2) = drho0_s(:, :, :, 1)
983 drho_s = 0.5_dp*drho_s
986 tau_h(:, :, 1) = tau0_h(:, :, 1) + beta*tau1_h(:, :, 1)
987 tau_h(:, :, 2) = tau0_h(:, :, 1)
988 tau_h = 0.5_dp*tau0_h
989 tau_s(:, :, 1) = tau0_s(:, :, 1) + beta*tau1_s(:, :, 1)
990 tau_s(:, :, 2) = tau0_s(:, :, 1)
991 tau_s = 0.5_dp*tau0_s
994 rho_h = rho0_h + beta*rho1_h
995 rho_s = rho0_s + beta*rho1_s
997 drho_h = drho0_h + beta*drho1_h
998 drho_s = drho0_s + beta*drho1_s
1001 tau_h = tau0_h + beta*tau1_h
1002 tau_s = tau0_s + beta*tau1_s
1006 IF (gradient_f)
THEN
1007 drho_h(4, :, :, :) = sqrt( &
1008 drho_h(1, :, :, :)*drho_h(1, :, :, :) + &
1009 drho_h(2, :, :, :)*drho_h(2, :, :, :) + &
1010 drho_h(3, :, :, :)*drho_h(3, :, :, :))
1012 drho_s(4, :, :, :) = sqrt( &
1013 drho_s(1, :, :, :)*drho_s(1, :, :, :) + &
1014 drho_s(2, :, :, :)*drho_s(2, :, :, :) + &
1015 drho_s(3, :, :, :)*drho_s(3, :, :, :))
1020 CALL fill_rho_set(rho_set_h, lsd, mspins, needs, rho_h, drho_h, tau_h, na, ir)
1021 CALL fill_rho_set(rho_set_s, lsd, mspins, needs, rho_s, drho_s, tau_s, na, ir)
1022 ELSE IF (gradient_f)
THEN
1023 CALL fill_rho_set(rho_set_h, lsd, mspins, needs, rho_h, drho_h, tau_d, na, ir)
1024 CALL fill_rho_set(rho_set_s, lsd, mspins, needs, rho_s, drho_s, tau_d, na, ir)
1026 CALL fill_rho_set(rho_set_h, lsd, mspins, needs, rho_h, rho_d, tau_d, na, ir)
1027 CALL fill_rho_set(rho_set_s, lsd, mspins, needs, rho_s, rho_d, tau_d, na, ir)
1033 CALL vxc_of_r_new(xc_fun_section, rho_set_h, deriv_set, 1, needs, weight, &
1034 lsd, na, nr, exc_h, vxc_h, vxg_h, vtau_h)
1035 IF (is_triplet)
THEN
1036 vxc_h(:, :, 1) = vxc_h(:, :, 1) - vxc_h(:, :, 2)
1037 IF (gradient_f)
THEN
1038 vxg_h(:, :, :, 1) = vxg_h(:, :, :, 1) - vxg_h(:, :, :, 2)
1041 vtau_h(:, :, 1) = vtau_h(:, :, 1) - vtau_h(:, :, 2)
1046 CALL vxc_of_r_new(xc_fun_section, rho_set_s, deriv_set, 1, needs, weight, &
1047 lsd, na, nr, exc_s, vxc_s, vxg_s, vtau_s)
1048 IF (is_triplet)
THEN
1049 vxc_s(:, :, 1) = vxc_s(:, :, 1) - vxc_s(:, :, 2)
1050 IF (gradient_f)
THEN
1051 vxg_s(:, :, :, 1) = vxg_s(:, :, :, 1) - vxg_s(:, :, :, 2)
1054 vtau_s(:, :, 1) = vtau_s(:, :, 1) - vtau_s(:, :, 2)
1059 fint_hh(ns)%r_coef(:, :) = 0.0_dp
1060 fint_ss(ns)%r_coef(:, :) = 0.0_dp
1062 IF (gradient_f)
THEN
1063 CALL gavxcgb_gc(vxc_h, vxc_s, vxg_h, vxg_s, fint_hh, fint_ss, &
1064 grid_atom, basis_1c, harmonics, nspins)
1067 grid_atom, basis_1c, harmonics, nspins)
1070 CALL dgavtaudgb(vtau_h, vtau_s, fint_hh, fint_ss, &
1071 grid_atom, basis_1c, harmonics, nspins)
1074 NULLIFY (int_hh, int_ss)
1075 CALL get_rho_atom(rho_atom=rho1_atom, ga_vlocal_gb_h=int_hh, ga_vlocal_gb_s=int_ss)
1077 int_ss(ns)%r_coef(:, :) = int_ss(ns)%r_coef(:, :) + oeps1*ak(istep)*fint_ss(ns)%r_coef(:, :)
1078 int_hh(ns)%r_coef(:, :) = int_hh(ns)%r_coef(:, :) + oeps1*ak(istep)*fint_hh(ns)%r_coef(:, :)
1081 NULLIFY (int_hh, int_ss)
1082 CALL get_rho_atom(rho_atom=rho2_atom, ga_vlocal_gb_h=int_hh, ga_vlocal_gb_s=int_ss)
1084 int_ss(ns)%r_coef(:, :) = int_ss(ns)%r_coef(:, :) + oeps2*bl(istep)*fint_ss(ns)%r_coef(:, :)
1085 int_hh(ns)%r_coef(:, :) = int_hh(ns)%r_coef(:, :) + oeps2*bl(istep)*fint_hh(ns)%r_coef(:, :)
1090 DEALLOCATE (fint_ss(ns)%r_coef)
1091 DEALLOCATE (fint_hh(ns)%r_coef)
1093 DEALLOCATE (fint_ss, fint_hh)
1102 DEALLOCATE (rho_h, rho_s, rho0_h, rho0_s, rho1_h, rho1_s)
1103 DEALLOCATE (vxc_h, vxc_s)
1104 IF (gradient_f)
THEN
1105 DEALLOCATE (drho_h, drho_s, drho0_h, drho0_s, drho1_h, drho1_s)
1106 DEALLOCATE (vxg_h, vxg_s)
1109 DEALLOCATE (tau_h, tau_s, tau0_h, tau0_s, tau1_h, tau1_s)
1110 DEALLOCATE (vtau_h, vtau_s)
1117 CALL timestop(handle)
1134 kind_set, xc_section, is_triplet, accuracy, epsrho)
1137 TYPE(
rho_atom_type),
DIMENSION(:),
POINTER :: rho0_atom_set, rho1_atom_set, &
1141 LOGICAL,
INTENT(IN) :: is_triplet
1142 INTEGER,
INTENT(IN) :: accuracy
1143 REAL(kind=
dp),
INTENT(IN) :: epsrho
1145 CHARACTER(LEN=*),
PARAMETER :: routinen =
'gfxc_atom_diff'
1147 INTEGER :: bo(2), handle, iat, iatom, ikind, ir, &
1148 istep, mspins, myfun, na, natom, nf, &
1149 nr, ns, nspins, nstep, num_pe
1150 INTEGER,
DIMENSION(2, 3) :: bounds
1151 INTEGER,
DIMENSION(:),
POINTER :: atom_list
1152 LOGICAL :: donlcc, gradient_f, lsd, nlcc, paw_atom, &
1154 REAL(
dp) :: beta, density_cut, gradient_cut, oeps1, &
1156 REAL(
dp),
CONTIGUOUS,
DIMENSION(:, :, :),
POINTER :: vxc_h, vxc_s
1157 REAL(
dp),
DIMENSION(1, 1, 1) :: tau_d
1158 REAL(
dp),
DIMENSION(1, 1, 1, 1) :: rho_d
1159 REAL(
dp),
DIMENSION(:, :),
POINTER :: rho_nlcc, weight
1160 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: rho0_h, rho0_s, rho1_h, rho1_s, rho_h, &
1161 rho_s, tau0_h, tau0_s, tau1_h, tau1_s, &
1162 tau_h, tau_s, vtau_h, vtau_s
1163 REAL(
dp),
DIMENSION(:, :, :, :),
POINTER :: drho0_h, drho0_s, drho1_h, drho1_s, &
1164 drho_h, drho_s, vxg_h, vxg_s
1165 REAL(kind=
dp),
DIMENSION(-4:4) :: ak
1172 TYPE(
rho_atom_coeff),
DIMENSION(:),
POINTER :: dr_h, dr_s, fint_hh, fint_ss, int_hh, &
1175 TYPE(
rho_atom_type),
POINTER :: rho0_atom, rho1_atom, rho2_atom
1182 CALL timeset(routinen, handle)
1185 SELECT CASE (accuracy)
1188 ak(-2:2) = (/1.0_dp, -8.0_dp, 0.0_dp, 8.0_dp, -1.0_dp/)/12.0_dp
1191 ak(-3:3) = (/-1.0_dp, 9.0_dp, -45.0_dp, 0.0_dp, 45.0_dp, -9.0_dp, 1.0_dp/)/60.0_dp
1194 ak(-4:4) = (/1.0_dp, -32.0_dp/3.0_dp, 56.0_dp, -224.0_dp, 0.0_dp, &
1195 224.0_dp, -56.0_dp, 32.0_dp/3.0_dp, -1.0_dp/)/280.0_dp
1197 oeps1 = 1.0_dp/epsrho
1200 dft_control=dft_control, &
1201 para_env=para_env, &
1202 atomic_kind_set=atomic_kind_set)
1212 do_triplet=is_triplet, kind_set_external=kind_set)
1219 lsd = dft_control%lsd
1220 nspins = dft_control%nspins
1222 IF (is_triplet)
THEN
1223 cpassert(nspins == 1)
1228 gradient_f = (needs%drho .OR. needs%drho_spin)
1229 tau_f = (needs%tau .OR. needs%tau_spin)
1232 DO ikind = 1,
SIZE(atomic_kind_set)
1233 CALL get_atomic_kind(atomic_kind_set(ikind), atom_list=atom_list, natom=natom)
1234 CALL get_qs_kind(kind_set(ikind), paw_atom=paw_atom, &
1235 harmonics=harmonics, grid_atom=grid_atom)
1236 CALL get_qs_kind(kind_set(ikind), basis_set=basis_1c, basis_type=
"GAPW_1C")
1238 IF (.NOT. paw_atom) cycle
1241 na = grid_atom%ng_sphere
1248 bounds(1:2, 1:3) = 1
1256 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
1258 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
1260 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
1262 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
1270 weight => grid_atom%weight
1272 ALLOCATE (rho_h(na, nr, nspins), rho_s(na, nr, nspins), &
1273 rho0_h(na, nr, nspins), rho0_s(na, nr, nspins), &
1274 rho1_h(na, nr, nspins), rho1_s(na, nr, nspins))
1275 ALLOCATE (vxc_h(na, nr, nspins), vxc_s(na, nr, nspins))
1276 IF (gradient_f)
THEN
1277 ALLOCATE (drho_h(4, na, nr, nspins), drho_s(4, na, nr, nspins), &
1278 drho0_h(4, na, nr, nspins), drho0_s(4, na, nr, nspins), &
1279 drho1_h(4, na, nr, nspins), drho1_s(4, na, nr, nspins))
1280 ALLOCATE (vxg_h(3, na, nr, nspins), vxg_s(3, na, nr, nspins))
1283 ALLOCATE (tau_h(na, nr, nspins), tau_s(na, nr, nspins), &
1284 tau0_h(na, nr, nspins), tau0_s(na, nr, nspins), &
1285 tau1_h(na, nr, nspins), tau1_s(na, nr, nspins))
1286 ALLOCATE (vtau_h(na, nr, nspins), vtau_s(na, nr, nspins))
1293 rho_nlcc => kind_set(ikind)%nlcc_pot
1294 IF (
ASSOCIATED(rho_nlcc)) donlcc = .true.
1298 num_pe = para_env%num_pe
1299 bo =
get_limit(natom, num_pe, para_env%mepos)
1301 DO iat = bo(1), bo(2)
1302 iatom = atom_list(iat)
1304 NULLIFY (int_hh, int_ss)
1305 rho0_atom => rho0_atom_set(iatom)
1306 CALL get_rho_atom(rho_atom=rho0_atom, ga_vlocal_gb_h=int_hh, ga_vlocal_gb_s=int_ss)
1307 ALLOCATE (fint_ss(nspins), fint_hh(nspins))
1309 nf =
SIZE(int_ss(ns)%r_coef, 1)
1310 ALLOCATE (fint_ss(ns)%r_coef(nf, nf))
1311 nf =
SIZE(int_hh(ns)%r_coef, 1)
1312 ALLOCATE (fint_hh(ns)%r_coef(nf, nf))
1318 rho0_atom => rho0_atom_set(iatom)
1319 IF (gradient_f)
THEN
1320 NULLIFY (r_h, r_s, dr_h, dr_s, r_h_d, r_s_d)
1321 CALL get_rho_atom(rho_atom=rho0_atom, rho_rad_h=r_h, rho_rad_s=r_s, drho_rad_h=dr_h, &
1322 drho_rad_s=dr_s, rho_rad_h_d=r_h_d, rho_rad_s_d=r_s_d)
1327 CALL get_rho_atom(rho_atom=rho0_atom, rho_rad_h=r_h, rho_rad_s=r_s)
1332 ir, r_h, r_s, rho0_h, rho0_s, dr_h, dr_s, &
1333 r_h_d, r_s_d, drho0_h, drho0_s)
1335 CALL calc_rho_nlcc(grid_atom, nspins, gradient_f, &
1336 ir, rho_nlcc(:, 1), rho0_h, rho0_s, rho_nlcc(:, 2), drho0_h, drho0_s)
1341 CALL calc_tau_atom(tau0_h, tau0_s, rho0_atom, kind_set(ikind), nspins)
1348 rho1_atom => rho1_atom_set(iatom)
1349 IF (gradient_f)
THEN
1350 NULLIFY (r_h, r_s, dr_h, dr_s, r_h_d, r_s_d)
1351 CALL get_rho_atom(rho_atom=rho1_atom, rho_rad_h=r_h, rho_rad_s=r_s, drho_rad_h=dr_h, &
1352 drho_rad_s=dr_s, rho_rad_h_d=r_h_d, rho_rad_s_d=r_s_d)
1357 CALL get_rho_atom(rho_atom=rho1_atom, rho_rad_h=r_h, rho_rad_s=r_s)
1361 ir, r_h, r_s, rho1_h, rho1_s, dr_h, dr_s, &
1362 r_h_d, r_s_d, drho1_h, drho1_s)
1366 CALL calc_tau_atom(tau1_h, tau1_s, rho1_atom, kind_set(ikind), nspins)
1371 CALL fill_rho_set(rho1_set_h, lsd, nspins, needs, rho1_h, drho1_h, tau1_h, na, ir)
1372 CALL fill_rho_set(rho1_set_s, lsd, nspins, needs, rho1_s, drho1_s, tau1_s, na, ir)
1373 ELSE IF (gradient_f)
THEN
1374 CALL fill_rho_set(rho1_set_h, lsd, nspins, needs, rho1_h, drho1_h, tau_d, na, ir)
1375 CALL fill_rho_set(rho1_set_s, lsd, nspins, needs, rho1_s, drho1_s, tau_d, na, ir)
1377 CALL fill_rho_set(rho1_set_h, lsd, nspins, needs, rho1_h, rho_d, tau_d, na, ir)
1378 CALL fill_rho_set(rho1_set_s, lsd, nspins, needs, rho1_s, rho_d, tau_d, na, ir)
1383 rho2_atom => rho2_atom_set(iatom)
1385 DO istep = -nstep, nstep
1387 beta = real(istep, kind=
dp)*epsrho
1389 rho_h = rho0_h + beta*rho1_h
1390 rho_s = rho0_s + beta*rho1_s
1391 IF (gradient_f)
THEN
1392 drho_h = drho0_h + beta*drho1_h
1393 drho_s = drho0_s + beta*drho1_s
1396 tau_h = tau0_h + beta*tau1_h
1397 tau_s = tau0_s + beta*tau1_s
1400 IF (gradient_f)
THEN
1401 drho_h(4, :, :, :) = sqrt( &
1402 drho_h(1, :, :, :)*drho_h(1, :, :, :) + &
1403 drho_h(2, :, :, :)*drho_h(2, :, :, :) + &
1404 drho_h(3, :, :, :)*drho_h(3, :, :, :))
1406 drho_s(4, :, :, :) = sqrt( &
1407 drho_s(1, :, :, :)*drho_s(1, :, :, :) + &
1408 drho_s(2, :, :, :)*drho_s(2, :, :, :) + &
1409 drho_s(3, :, :, :)*drho_s(3, :, :, :))
1414 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, drho_h, tau_h, na, ir)
1415 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, drho_s, tau_s, na, ir)
1416 ELSE IF (gradient_f)
THEN
1417 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, drho_h, tau_d, na, ir)
1418 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, drho_s, tau_d, na, ir)
1420 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, rho_d, tau_d, na, ir)
1421 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, rho_d, tau_d, na, ir)
1428 rho_set=rho_set_h, rho1_set=rho1_set_h, &
1429 deriv_set=deriv_set, &
1430 w=weight, vxc=vxc_h, vxg=vxg_h, do_triplet=is_triplet)
1434 rho_set=rho_set_s, rho1_set=rho1_set_s, &
1435 deriv_set=deriv_set, &
1436 w=weight, vxc=vxc_s, vxg=vxg_s, do_triplet=is_triplet)
1439 fint_hh(ns)%r_coef(:, :) = 0.0_dp
1440 fint_ss(ns)%r_coef(:, :) = 0.0_dp
1442 IF (gradient_f)
THEN
1443 CALL gavxcgb_gc(vxc_h, vxc_s, vxg_h, vxg_s, fint_hh, fint_ss, &
1444 grid_atom, basis_1c, harmonics, nspins)
1447 grid_atom, basis_1c, harmonics, nspins)
1450 CALL dgavtaudgb(vtau_h, vtau_s, fint_hh, fint_ss, &
1451 grid_atom, basis_1c, harmonics, nspins)
1454 NULLIFY (int_hh, int_ss)
1455 CALL get_rho_atom(rho_atom=rho2_atom, ga_vlocal_gb_h=int_hh, ga_vlocal_gb_s=int_ss)
1457 int_ss(ns)%r_coef(:, :) = int_ss(ns)%r_coef(:, :) + oeps1*ak(istep)*fint_ss(ns)%r_coef(:, :)
1458 int_hh(ns)%r_coef(:, :) = int_hh(ns)%r_coef(:, :) + oeps1*ak(istep)*fint_hh(ns)%r_coef(:, :)
1463 DEALLOCATE (fint_ss(ns)%r_coef)
1464 DEALLOCATE (fint_hh(ns)%r_coef)
1466 DEALLOCATE (fint_ss, fint_hh)
1477 DEALLOCATE (rho_h, rho_s, rho0_h, rho0_s, rho1_h, rho1_s)
1478 DEALLOCATE (vxc_h, vxc_s)
1479 IF (gradient_f)
THEN
1480 DEALLOCATE (drho_h, drho_s, drho0_h, drho0_s, drho1_h, drho1_s)
1481 DEALLOCATE (vxg_h, vxg_s)
1484 DEALLOCATE (tau_h, tau_s, tau0_h, tau0_s, tau1_h, tau1_s)
1485 DEALLOCATE (vtau_h, vtau_s)
1492 CALL timestop(handle)
1515 ir, r_h, r_s, rho_h, rho_s, &
1516 dr_h, dr_s, r_h_d, r_s_d, drho_h, drho_s)
1520 INTEGER,
INTENT(IN) :: nspins
1521 LOGICAL,
INTENT(IN) :: grad_func
1522 INTEGER,
INTENT(IN) :: ir
1524 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: rho_h, rho_s
1527 REAL(kind=
dp),
DIMENSION(:, :, :, :),
POINTER :: drho_h, drho_s
1529 INTEGER :: ia, iso, ispin, na
1530 REAL(kind=
dp) :: rad, urad
1532 cpassert(
ASSOCIATED(r_h))
1533 cpassert(
ASSOCIATED(r_s))
1534 cpassert(
ASSOCIATED(rho_h))
1535 cpassert(
ASSOCIATED(rho_s))
1537 cpassert(
ASSOCIATED(dr_h))
1538 cpassert(
ASSOCIATED(dr_s))
1539 cpassert(
ASSOCIATED(r_h_d))
1540 cpassert(
ASSOCIATED(r_s_d))
1541 cpassert(
ASSOCIATED(drho_h))
1542 cpassert(
ASSOCIATED(drho_s))
1545 na = grid_atom%ng_sphere
1546 rad = grid_atom%rad(ir)
1547 urad = grid_atom%oorad2l(ir, 1)
1548 DO ispin = 1, nspins
1549 DO iso = 1, harmonics%max_iso_not0
1551 rho_h(ia, ir, ispin) = rho_h(ia, ir, ispin) + &
1552 r_h(ispin)%r_coef(ir, iso)*harmonics%slm(ia, iso)
1553 rho_s(ia, ir, ispin) = rho_s(ia, ir, ispin) + &
1554 r_s(ispin)%r_coef(ir, iso)*harmonics%slm(ia, iso)
1560 DO ispin = 1, nspins
1561 DO iso = 1, harmonics%max_iso_not0
1565 drho_h(1, ia, ir, ispin) = drho_h(1, ia, ir, ispin) + &
1566 dr_h(ispin)%r_coef(ir, iso)* &
1567 harmonics%a(1, ia)*harmonics%slm(ia, iso) + &
1568 r_h_d(1, ispin)%r_coef(ir, iso)* &
1569 harmonics%slm(ia, iso)
1571 drho_h(2, ia, ir, ispin) = drho_h(2, ia, ir, ispin) + &
1572 dr_h(ispin)%r_coef(ir, iso)* &
1573 harmonics%a(2, ia)*harmonics%slm(ia, iso) + &
1574 r_h_d(2, ispin)%r_coef(ir, iso)* &
1575 harmonics%slm(ia, iso)
1577 drho_h(3, ia, ir, ispin) = drho_h(3, ia, ir, ispin) + &
1578 dr_h(ispin)%r_coef(ir, iso)* &
1579 harmonics%a(3, ia)*harmonics%slm(ia, iso) + &
1580 r_h_d(3, ispin)%r_coef(ir, iso)* &
1581 harmonics%slm(ia, iso)
1584 drho_s(1, ia, ir, ispin) = drho_s(1, ia, ir, ispin) + &
1585 dr_s(ispin)%r_coef(ir, iso)* &
1586 harmonics%a(1, ia)*harmonics%slm(ia, iso) + &
1587 r_s_d(1, ispin)%r_coef(ir, iso)* &
1588 harmonics%slm(ia, iso)
1590 drho_s(2, ia, ir, ispin) = drho_s(2, ia, ir, ispin) + &
1591 dr_s(ispin)%r_coef(ir, iso)* &
1592 harmonics%a(2, ia)*harmonics%slm(ia, iso) + &
1593 r_s_d(2, ispin)%r_coef(ir, iso)* &
1594 harmonics%slm(ia, iso)
1596 drho_s(3, ia, ir, ispin) = drho_s(3, ia, ir, ispin) + &
1597 dr_s(ispin)%r_coef(ir, iso)* &
1598 harmonics%a(3, ia)*harmonics%slm(ia, iso) + &
1599 r_s_d(3, ispin)%r_coef(ir, iso)* &
1600 harmonics%slm(ia, iso)
1602 drho_h(4, ia, ir, ispin) = sqrt( &
1603 drho_h(1, ia, ir, ispin)*drho_h(1, ia, ir, ispin) + &
1604 drho_h(2, ia, ir, ispin)*drho_h(2, ia, ir, ispin) + &
1605 drho_h(3, ia, ir, ispin)*drho_h(3, ia, ir, ispin))
1607 drho_s(4, ia, ir, ispin) = sqrt( &
1608 drho_s(1, ia, ir, ispin)*drho_s(1, ia, ir, ispin) + &
1609 drho_s(2, ia, ir, ispin)*drho_s(2, ia, ir, ispin) + &
1610 drho_s(3, ia, ir, ispin)*drho_s(3, ia, ir, ispin))
1630 SUBROUTINE calc_tau_atom(tau_h, tau_s, rho_atom, qs_kind, nspins)
1632 REAL(
dp),
DIMENSION(:, :, :),
INTENT(INOUT) :: tau_h, tau_s
1635 INTEGER,
INTENT(IN) :: nspins
1637 CHARACTER(len=*),
PARAMETER :: routinen =
'calc_tau_atom'
1639 INTEGER :: dir, handle, ia, ip, ipgf, ir, iset, &
1640 iso, ispin, jp, jpgf, jset, jso, l, &
1641 maxso, na, nr, nset, starti, startj
1642 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf, o2nindex
1643 REAL(
dp) :: cpc_h, cpc_s
1644 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: fga, fgr, r1, r2
1645 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: a1, a2
1646 REAL(
dp),
DIMENSION(:, :),
POINTER :: slm, zet
1647 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: dslm_dxyz
1652 NULLIFY (harmonics, grid_atom, basis_1c, lmax, lmin, npgf, zet, slm, dslm_dxyz, o2nindex)
1654 CALL timeset(routinen, handle)
1658 CALL get_qs_kind(qs_kind, grid_atom=grid_atom, harmonics=harmonics)
1659 CALL get_qs_kind(qs_kind, basis_set=basis_1c, basis_type=
"GAPW_1C")
1662 na = grid_atom%ng_sphere
1664 slm => harmonics%slm
1665 dslm_dxyz => harmonics%dslm_dxyz
1673 CALL get_gto_basis_set(gto_basis_set=basis_1c, lmax=lmax, lmin=lmin, npgf=npgf, &
1674 nset=nset, zet=zet, maxso=maxso)
1677 ALLOCATE (a1(na, nset*maxso, 3), a2(na, nset*maxso, 3))
1678 ALLOCATE (r1(nr, nset*maxso), r2(nr, nset*maxso))
1679 a1 = 0.0_dp; a2 = 0.0_dp
1680 r1 = 0.0_dp; r2 = 0.0_dp
1683 DO ipgf = 1, npgf(iset)
1684 starti = (iset - 1)*maxso + (ipgf - 1)*
nsoset(lmax(iset))
1685 DO iso =
nsoset(lmin(iset) - 1) + 1,
nsoset(lmax(iset))
1692 r1(1:nr, starti + iso) = grid_atom%rad(1:nr)**(l - 1)*exp(-zet(ipgf, iset)*grid_atom%rad2(1:nr))
1695 r2(1:nr, starti + iso) = -2.0_dp*zet(ipgf, iset)*grid_atom%rad(1:nr)**(l + 1) &
1696 *exp(-zet(ipgf, iset)*grid_atom%rad2(1:nr))
1700 a1(1:na, starti + iso, dir) = dslm_dxyz(dir, 1:na, iso)
1703 a2(1:na, starti + iso, dir) = harmonics%a(dir, 1:na)*slm(1:na, iso)
1711 ALLOCATE (fga(na, 1))
1712 ALLOCATE (fgr(nr, 1))
1713 fga = 0.0_dp; fgr = 0.0_dp
1717 DO ipgf = 1, npgf(iset)
1718 starti = (iset - 1)*maxso + (ipgf - 1)*
nsoset(lmax(iset))
1719 DO jpgf = 1, npgf(jset)
1720 startj = (jset - 1)*maxso + (jpgf - 1)*
nsoset(lmax(jset))
1722 DO iso =
nsoset(lmin(iset) - 1) + 1,
nsoset(lmax(iset))
1723 DO jso =
nsoset(lmin(jset) - 1) + 1,
nsoset(lmax(jset))
1725 ip = o2nindex(starti + iso)
1726 jp = o2nindex(startj + jso)
1731 fgr(1:nr, 1) = r1(1:nr, starti + iso)*r1(1:nr, startj + jso)
1733 fga(1:na, 1) = a1(1:na, starti + iso, dir)*a1(1:na, startj + jso, dir)
1735 DO ispin = 1, nspins
1737 cpc_h = rho_atom%cpc_h(ispin)%r_coef(ip, jp)
1738 cpc_s = rho_atom%cpc_s(ispin)%r_coef(ip, jp)
1743 tau_h(ia, ir, ispin) = tau_h(ia, ir, ispin) + 0.5_dp*cpc_h* &
1744 fgr(ir, 1)*fga(ia, 1)
1746 tau_s(ia, ir, ispin) = tau_s(ia, ir, ispin) + 0.5_dp*cpc_s* &
1747 fgr(ir, 1)*fga(ia, 1)
1755 fgr(1:nr, 1) = r1(1:nr, starti + iso)*r2(1:nr, startj + jso)
1757 fga(1:na, 1) = a1(1:na, starti + iso, dir)*a2(1:na, startj + jso, dir)
1759 DO ispin = 1, nspins
1761 cpc_h = rho_atom%cpc_h(ispin)%r_coef(ip, jp)
1762 cpc_s = rho_atom%cpc_s(ispin)%r_coef(ip, jp)
1767 tau_h(ia, ir, ispin) = tau_h(ia, ir, ispin) + 0.5_dp*cpc_h* &
1768 fgr(ir, 1)*fga(ia, 1)
1770 tau_s(ia, ir, ispin) = tau_s(ia, ir, ispin) + 0.5_dp*cpc_s* &
1771 fgr(ir, 1)*fga(ia, 1)
1779 fgr(1:nr, 1) = r2(1:nr, starti + iso)*r1(1:nr, startj + jso)
1781 fga(1:na, 1) = a2(1:na, starti + iso, dir)*a1(1:na, startj + jso, dir)
1783 DO ispin = 1, nspins
1785 cpc_h = rho_atom%cpc_h(ispin)%r_coef(ip, jp)
1786 cpc_s = rho_atom%cpc_s(ispin)%r_coef(ip, jp)
1791 tau_h(ia, ir, ispin) = tau_h(ia, ir, ispin) + 0.5_dp*cpc_h* &
1792 fgr(ir, 1)*fga(ia, 1)
1794 tau_s(ia, ir, ispin) = tau_s(ia, ir, ispin) + 0.5_dp*cpc_s* &
1795 fgr(ir, 1)*fga(ia, 1)
1803 fgr(1:nr, 1) = r2(1:nr, starti + iso)*r2(1:nr, startj + jso)
1805 fga(1:na, 1) = a2(1:na, starti + iso, dir)*a2(1:na, startj + jso, dir)
1807 DO ispin = 1, nspins
1809 cpc_h = rho_atom%cpc_h(ispin)%r_coef(ip, jp)
1810 cpc_s = rho_atom%cpc_s(ispin)%r_coef(ip, jp)
1815 tau_h(ia, ir, ispin) = tau_h(ia, ir, ispin) + 0.5_dp*cpc_h* &
1816 fgr(ir, 1)*fga(ia, 1)
1818 tau_s(ia, ir, ispin) = tau_s(ia, ir, ispin) + 0.5_dp*cpc_s* &
1819 fgr(ir, 1)*fga(ia, 1)
1834 DEALLOCATE (o2nindex)
1836 CALL timestop(handle)
1838 END SUBROUTINE calc_tau_atom
1853 SUBROUTINE calc_rho_nlcc(grid_atom, nspins, grad_func, &
1854 ir, rho_nlcc, rho_h, rho_s, drho_nlcc, drho_h, drho_s)
1857 INTEGER,
INTENT(IN) :: nspins
1858 LOGICAL,
INTENT(IN) :: grad_func
1859 INTEGER,
INTENT(IN) :: ir
1860 REAL(kind=
dp),
DIMENSION(:) :: rho_nlcc
1861 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: rho_h, rho_s
1862 REAL(kind=
dp),
DIMENSION(:) :: drho_nlcc
1863 REAL(kind=
dp),
DIMENSION(:, :, :, :),
POINTER :: drho_h, drho_s
1865 INTEGER :: ia, ispin, na
1866 REAL(kind=
dp) :: drho, dx, dy, dz, rad, rho, urad, xsp
1868 cpassert(
ASSOCIATED(rho_h))
1869 cpassert(
ASSOCIATED(rho_s))
1871 cpassert(
ASSOCIATED(drho_h))
1872 cpassert(
ASSOCIATED(drho_s))
1875 na = grid_atom%ng_sphere
1876 rad = grid_atom%rad(ir)
1877 urad = grid_atom%oorad2l(ir, 1)
1879 xsp = real(nspins, kind=
dp)
1880 rho = rho_nlcc(ir)/xsp
1881 DO ispin = 1, nspins
1882 rho_h(1:na, ir, ispin) = rho_h(1:na, ir, ispin) + rho
1883 rho_s(1:na, ir, ispin) = rho_s(1:na, ir, ispin) + rho
1887 drho = drho_nlcc(ir)/xsp
1888 DO ispin = 1, nspins
1890 IF (grid_atom%azi(ia) == 0.0_dp)
THEN
1894 dx = grid_atom%sin_pol(ia)*grid_atom%sin_azi(ia)
1895 dy = grid_atom%sin_pol(ia)*grid_atom%cos_azi(ia)
1897 dz = grid_atom%cos_pol(ia)
1899 drho_h(1, ia, ir, ispin) = drho_h(1, ia, ir, ispin) + drho*dx
1900 drho_h(2, ia, ir, ispin) = drho_h(2, ia, ir, ispin) + drho*dy
1901 drho_h(3, ia, ir, ispin) = drho_h(3, ia, ir, ispin) + drho*dz
1903 drho_s(1, ia, ir, ispin) = drho_s(1, ia, ir, ispin) + drho*dx
1904 drho_s(2, ia, ir, ispin) = drho_s(2, ia, ir, ispin) + drho*dy
1905 drho_s(3, ia, ir, ispin) = drho_s(3, ia, ir, ispin) + drho*dz
1907 drho_h(4, ia, ir, ispin) = sqrt( &
1908 drho_h(1, ia, ir, ispin)*drho_h(1, ia, ir, ispin) + &
1909 drho_h(2, ia, ir, ispin)*drho_h(2, ia, ir, ispin) + &
1910 drho_h(3, ia, ir, ispin)*drho_h(3, ia, ir, ispin))
1912 drho_s(4, ia, ir, ispin) = sqrt( &
1913 drho_s(1, ia, ir, ispin)*drho_s(1, ia, ir, ispin) + &
1914 drho_s(2, ia, ir, ispin)*drho_s(2, ia, ir, ispin) + &
1915 drho_s(3, ia, ir, ispin)*drho_s(3, ia, ir, ispin))
1920 END SUBROUTINE calc_rho_nlcc
1933 SUBROUTINE gavxcgb_nogc(vxc_h, vxc_s, int_hh, int_ss, grid_atom, basis_1c, harmonics, nspins)
1935 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: vxc_h, vxc_s
1940 INTEGER,
INTENT(IN) :: nspins
1942 CHARACTER(len=*),
PARAMETER :: routinen =
'gaVxcgb_noGC'
1944 INTEGER :: handle, ia, ic, icg, ipgf1, ipgf2, ir, iset1, iset2, iso, iso1, iso2, ispin, l, &
1945 ld, lmax12, lmax_expansion, lmin12, m1, m2, max_iso_not0, max_iso_not0_local, max_s_harm, &
1946 maxl, maxso, n1, n2, na, ngau1, ngau2, nngau1, nr, nset, size1
1947 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: cg_n_list
1948 INTEGER,
ALLOCATABLE,
DIMENSION(:, :, :) :: cg_list
1949 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf
1950 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: g1, g2
1951 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: gg, gvg_h, gvg_s, matso_h, matso_s, vx
1952 REAL(
dp),
DIMENSION(:, :),
POINTER :: zet
1953 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: my_cg
1955 CALL timeset(routinen, handle)
1957 NULLIFY (lmin, lmax, npgf, zet, my_cg)
1960 maxso=maxso, maxl=maxl, npgf=npgf, &
1964 na = grid_atom%ng_sphere
1965 my_cg => harmonics%my_CG
1966 max_iso_not0 = harmonics%max_iso_not0
1967 lmax_expansion =
indso(1, max_iso_not0)
1968 max_s_harm = harmonics%max_s_harm
1970 ALLOCATE (g1(nr), g2(nr), gg(nr, 0:2*maxl))
1971 ALLOCATE (gvg_h(na, 0:2*maxl), gvg_s(na, 0:2*maxl))
1974 ALLOCATE (vx(na, nr))
1975 ALLOCATE (cg_list(2,
nsoset(maxl)**2, max_s_harm), cg_n_list(max_s_harm))
1984 CALL get_none0_cg_list(my_cg, lmin(iset1), lmax(iset1), lmin(iset2), lmax(iset2), &
1985 max_s_harm, lmax_expansion, cg_list, cg_n_list, max_iso_not0_local)
1986 cpassert(max_iso_not0_local .LE. max_iso_not0)
1989 DO ipgf1 = 1, npgf(iset1)
1990 ngau1 = n1*(ipgf1 - 1) + m1
1992 nngau1 =
nsoset(lmin(iset1) - 1) + ngau1
1994 g1(1:nr) = exp(-zet(ipgf1, iset1)*grid_atom%rad2(1:nr))
1995 DO ipgf2 = 1, npgf(iset2)
1996 ngau2 = n2*(ipgf2 - 1) + m2
1998 g2(1:nr) = exp(-zet(ipgf2, iset2)*grid_atom%rad2(1:nr))
1999 lmin12 = lmin(iset1) + lmin(iset2)
2000 lmax12 = lmax(iset1) + lmax(iset2)
2003 IF (lmin12 .LE. lmax_expansion)
THEN
2006 IF (lmin12 == 0)
THEN
2007 gg(1:nr, lmin12) = g1(1:nr)*g2(1:nr)
2009 gg(1:nr, lmin12) = grid_atom%rad2l(1:nr, lmin12)*g1(1:nr)*g2(1:nr)
2013 IF (lmax12 .GT. lmax_expansion) lmax12 = lmax_expansion
2015 DO l = lmin12 + 1, lmax12
2016 gg(1:nr, l) = grid_atom%rad(1:nr)*gg(:, l - 1)
2019 DO ispin = 1, nspins
2022 vx(1:na, ir) = vxc_h(1:na, ir, ispin)
2024 CALL dgemm(
'N',
'N', na, ld, nr, 1.0_dp, vx(1:na, 1:nr), na, &
2025 gg(1:nr, 0:lmax12), nr, 0.0_dp, gvg_h(1:na, 0:lmax12), na)
2027 vx(1:na, ir) = vxc_s(1:na, ir, ispin)
2029 CALL dgemm(
'N',
'N', na, ld, nr, 1.0_dp, vx(1:na, 1:nr), na, &
2030 gg(1:nr, 0:lmax12), nr, 0.0_dp, gvg_s(1:na, 0:lmax12), na)
2034 DO iso = 1, max_iso_not0_local
2035 DO icg = 1, cg_n_list(iso)
2036 iso1 = cg_list(1, icg, iso)
2037 iso2 = cg_list(2, icg, iso)
2040 cpassert(l <= lmax_expansion)
2042 matso_h(iso1, iso2) = matso_h(iso1, iso2) + &
2044 my_cg(iso1, iso2, iso)* &
2045 harmonics%slm(ia, iso)
2046 matso_s(iso1, iso2) = matso_s(iso1, iso2) + &
2048 my_cg(iso1, iso2, iso)* &
2049 harmonics%slm(ia, iso)
2055 DO ic =
nsoset(lmin(iset2) - 1) + 1,
nsoset(lmax(iset2))
2056 iso1 =
nsoset(lmin(iset1) - 1) + 1
2058 CALL daxpy(size1, 1.0_dp, matso_h(iso1, ic), 1, &
2059 int_hh(ispin)%r_coef(nngau1 + 1, iso2), 1)
2060 CALL daxpy(size1, 1.0_dp, matso_s(iso1, ic), 1, &
2061 int_ss(ispin)%r_coef(nngau1 + 1, iso2), 1)
2075 DEALLOCATE (g1, g2, gg, matso_h, matso_s, gvg_s, gvg_h, vx)
2077 DEALLOCATE (cg_list, cg_n_list)
2079 CALL timestop(handle)
2096 SUBROUTINE gavxcgb_gc(vxc_h, vxc_s, vxg_h, vxg_s, int_hh, int_ss, &
2097 grid_atom, basis_1c, harmonics, nspins)
2099 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: vxc_h, vxc_s
2100 REAL(
dp),
DIMENSION(:, :, :, :),
POINTER :: vxg_h, vxg_s
2105 INTEGER,
INTENT(IN) :: nspins
2107 CHARACTER(len=*),
PARAMETER :: routinen =
'gaVxcgb_GC'
2109 INTEGER :: dmax_iso_not0_local, handle, ia, ic, icg, ipgf1, ipgf2, ir, iset1, iset2, iso, &
2110 iso1, iso2, ispin, l, lmax12, lmax_expansion, lmin12, m1, m2, max_iso_not0, &
2111 max_iso_not0_local, max_s_harm, maxl, maxso, n1, n2, na, ngau1, ngau2, nngau1, nr, nset, &
2113 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: cg_n_list, dcg_n_list
2114 INTEGER,
ALLOCATABLE,
DIMENSION(:, :, :) :: cg_list, dcg_list
2115 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf
2117 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: g1, g2
2118 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: dgg, gg, gvxcg_h, gvxcg_s, matso_h, &
2120 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: gvxgg_h, gvxgg_s
2121 REAL(
dp),
DIMENSION(:, :),
POINTER :: zet
2122 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: my_cg
2123 REAL(
dp),
DIMENSION(:, :, :, :),
POINTER :: my_cg_dxyz
2125 CALL timeset(routinen, handle)
2127 NULLIFY (lmin, lmax, npgf, zet, my_cg, my_cg_dxyz)
2130 maxso=maxso, maxl=maxl, npgf=npgf, &
2134 na = grid_atom%ng_sphere
2135 my_cg => harmonics%my_CG
2136 my_cg_dxyz => harmonics%my_CG_dxyz
2137 max_iso_not0 = harmonics%max_iso_not0
2138 lmax_expansion =
indso(1, max_iso_not0)
2139 max_s_harm = harmonics%max_s_harm
2141 ALLOCATE (g1(nr), g2(nr), gg(nr, 0:2*maxl), dgg(nr, 0:2*maxl))
2142 ALLOCATE (gvxcg_h(na, 0:2*maxl), gvxcg_s(na, 0:2*maxl))
2143 ALLOCATE (gvxgg_h(3, na, 0:2*maxl), gvxgg_s(3, na, 0:2*maxl))
2144 ALLOCATE (cg_list(2,
nsoset(maxl)**2, max_s_harm), cg_n_list(max_s_harm), &
2145 dcg_list(2,
nsoset(maxl)**2, max_s_harm), dcg_n_list(max_s_harm))
2150 DO ispin = 1, nspins
2159 CALL get_none0_cg_list(my_cg, lmin(iset1), lmax(iset1), lmin(iset2), lmax(iset2), &
2160 max_s_harm, lmax_expansion, cg_list, cg_n_list, max_iso_not0_local)
2161 cpassert(max_iso_not0_local .LE. max_iso_not0)
2162 CALL get_none0_cg_list(my_cg_dxyz, lmin(iset1), lmax(iset1), lmin(iset2), lmax(iset2), &
2163 max_s_harm, lmax_expansion, dcg_list, dcg_n_list, dmax_iso_not0_local)
2166 DO ipgf1 = 1, npgf(iset1)
2167 ngau1 = n1*(ipgf1 - 1) + m1
2169 nngau1 =
nsoset(lmin(iset1) - 1) + ngau1
2171 g1(1:nr) = exp(-zet(ipgf1, iset1)*grid_atom%rad2(1:nr))
2172 DO ipgf2 = 1, npgf(iset2)
2173 ngau2 = n2*(ipgf2 - 1) + m2
2175 g2(1:nr) = exp(-zet(ipgf2, iset2)*grid_atom%rad2(1:nr))
2176 lmin12 = lmin(iset1) + lmin(iset2)
2177 lmax12 = lmax(iset1) + lmax(iset2)
2180 IF (lmin12 .LE. lmax_expansion)
THEN
2185 IF (lmin12 == 0)
THEN
2186 gg(1:nr, lmin12) = g1(1:nr)*g2(1:nr)
2188 gg(1:nr, lmin12) = grid_atom%rad2l(1:nr, lmin12)*g1(1:nr)*g2(1:nr)
2192 IF (lmax12 .GT. lmax_expansion) lmax12 = lmax_expansion
2194 DO l = lmin12 + 1, lmax12
2195 gg(1:nr, l) = grid_atom%rad(1:nr)*gg(:, l - 1)
2196 dgg(1:nr, l - 1) = dgg(1:nr, l - 1) - 2.0_dp*(zet(ipgf1, iset1) + &
2197 zet(ipgf2, iset2))*gg(1:nr, l)
2199 dgg(1:nr, lmax12) = dgg(1:nr, lmax12) - 2.0_dp*(zet(ipgf1, iset1) + &
2200 zet(ipgf2, iset2))*grid_atom%rad(1:nr)* &
2209 DO l = lmin12, lmax12
2212 gvxcg_h(ia, l) = gvxcg_h(ia, l) + &
2213 gg(ir, l)*vxc_h(ia, ir, ispin) + &
2215 (vxg_h(1, ia, ir, ispin)*harmonics%a(1, ia) + &
2216 vxg_h(2, ia, ir, ispin)*harmonics%a(2, ia) + &
2217 vxg_h(3, ia, ir, ispin)*harmonics%a(3, ia))
2219 gvxcg_s(ia, l) = gvxcg_s(ia, l) + &
2220 gg(ir, l)*vxc_s(ia, ir, ispin) + &
2222 (vxg_s(1, ia, ir, ispin)*harmonics%a(1, ia) + &
2223 vxg_s(2, ia, ir, ispin)*harmonics%a(2, ia) + &
2224 vxg_s(3, ia, ir, ispin)*harmonics%a(3, ia))
2226 urad = grid_atom%oorad2l(ir, 1)
2228 gvxgg_h(1, ia, l) = gvxgg_h(1, ia, l) + &
2229 vxg_h(1, ia, ir, ispin)* &
2232 gvxgg_h(2, ia, l) = gvxgg_h(2, ia, l) + &
2233 vxg_h(2, ia, ir, ispin)* &
2236 gvxgg_h(3, ia, l) = gvxgg_h(3, ia, l) + &
2237 vxg_h(3, ia, ir, ispin)* &
2240 gvxgg_s(1, ia, l) = gvxgg_s(1, ia, l) + &
2241 vxg_s(1, ia, ir, ispin)* &
2244 gvxgg_s(2, ia, l) = gvxgg_s(2, ia, l) + &
2245 vxg_s(2, ia, ir, ispin)* &
2248 gvxgg_s(3, ia, l) = gvxgg_s(3, ia, l) + &
2249 vxg_s(3, ia, ir, ispin)* &
2258 DO iso = 1, max_iso_not0_local
2259 DO icg = 1, cg_n_list(iso)
2260 iso1 = cg_list(1, icg, iso)
2261 iso2 = cg_list(2, icg, iso)
2266 cpassert(l <= lmax_expansion)
2268 matso_h(iso1, iso2) = matso_h(iso1, iso2) + &
2270 harmonics%slm(ia, iso)* &
2271 my_cg(iso1, iso2, iso)
2272 matso_s(iso1, iso2) = matso_s(iso1, iso2) + &
2274 harmonics%slm(ia, iso)* &
2275 my_cg(iso1, iso2, iso)
2284 DO iso = 1, dmax_iso_not0_local
2285 DO icg = 1, dcg_n_list(iso)
2286 iso1 = dcg_list(1, icg, iso)
2287 iso2 = dcg_list(2, icg, iso)
2291 cpassert(l <= lmax_expansion)
2293 matso_h(iso1, iso2) = matso_h(iso1, iso2) + &
2294 (gvxgg_h(1, ia, l)*my_cg_dxyz(1, iso1, iso2, iso) + &
2295 gvxgg_h(2, ia, l)*my_cg_dxyz(2, iso1, iso2, iso) + &
2296 gvxgg_h(3, ia, l)*my_cg_dxyz(3, iso1, iso2, iso))* &
2297 harmonics%slm(ia, iso)
2299 matso_s(iso1, iso2) = matso_s(iso1, iso2) + &
2300 (gvxgg_s(1, ia, l)*my_cg_dxyz(1, iso1, iso2, iso) + &
2301 gvxgg_s(2, ia, l)*my_cg_dxyz(2, iso1, iso2, iso) + &
2302 gvxgg_s(3, ia, l)*my_cg_dxyz(3, iso1, iso2, iso))* &
2303 harmonics%slm(ia, iso)
2315 DO ic =
nsoset(lmin(iset2) - 1) + 1,
nsoset(lmax(iset2))
2316 iso1 =
nsoset(lmin(iset1) - 1) + 1
2318 CALL daxpy(size1, 1.0_dp, matso_h(iso1, ic), 1, &
2319 int_hh(ispin)%r_coef(nngau1 + 1, iso2), 1)
2320 CALL daxpy(size1, 1.0_dp, matso_s(iso1, ic), 1, &
2321 int_ss(ispin)%r_coef(nngau1 + 1, iso2), 1)
2332 DEALLOCATE (g1, g2, gg, dgg, matso_h, matso_s, gvxcg_h, gvxcg_s, gvxgg_h, gvxgg_s)
2333 DEALLOCATE (cg_list, cg_n_list, dcg_list, dcg_n_list)
2335 CALL timestop(handle)
2337 END SUBROUTINE gavxcgb_gc
2352 SUBROUTINE dgavtaudgb(vtau_h, vtau_s, int_hh, int_ss, &
2353 grid_atom, basis_1c, harmonics, nspins)
2355 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: vtau_h, vtau_s
2360 INTEGER,
INTENT(IN) :: nspins
2362 CHARACTER(len=*),
PARAMETER :: routinen =
'dgaVtaudgb'
2364 INTEGER :: dir, handle, ipgf, iset, iso, ispin, &
2365 jpgf, jset, jso, l, maxso, na, nr, &
2366 nset, starti, startj
2367 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf
2368 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: fga, fgr, r1, r2, work
2369 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: a1, a2, intso_h, intso_s
2370 REAL(
dp),
DIMENSION(:, :),
POINTER :: slm, zet
2371 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: dslm_dxyz
2373 CALL timeset(routinen, handle)
2375 NULLIFY (zet, slm, dslm_dxyz, lmax, lmin, npgf)
2378 maxso=maxso, npgf=npgf, nset=nset, zet=zet)
2380 na = grid_atom%ng_sphere
2383 slm => harmonics%slm
2384 dslm_dxyz => harmonics%dslm_dxyz
2388 ALLOCATE (a1(na, nset*maxso, 3), a2(na, nset*maxso, 3))
2389 ALLOCATE (r1(nr, nset*maxso), r2(nr, nset*maxso))
2390 a1 = 0.0_dp; a2 = 0.0_dp
2391 r1 = 0.0_dp; r2 = 0.0_dp
2394 DO ipgf = 1, npgf(iset)
2395 starti = (iset - 1)*maxso + (ipgf - 1)*
nsoset(lmax(iset))
2396 DO iso =
nsoset(lmin(iset) - 1) + 1,
nsoset(lmax(iset))
2403 r1(1:nr, starti + iso) = grid_atom%rad(1:nr)**(l - 1)*exp(-zet(ipgf, iset)*grid_atom%rad2(1:nr))
2406 r2(1:nr, starti + iso) = -2.0_dp*zet(ipgf, iset)*grid_atom%rad(1:nr)**(l + 1) &
2407 *exp(-zet(ipgf, iset)*grid_atom%rad2(1:nr))
2411 a1(1:na, starti + iso, dir) = dslm_dxyz(dir, 1:na, iso)
2414 a2(1:na, starti + iso, dir) = harmonics%a(dir, 1:na)*slm(1:na, iso)
2422 ALLOCATE (intso_h(nset*maxso, nset*maxso, nspins))
2423 ALLOCATE (intso_s(nset*maxso, nset*maxso, nspins))
2424 intso_h = 0.0_dp; intso_s = 0.0_dp
2426 ALLOCATE (fga(na, 1))
2427 ALLOCATE (fgr(nr, 1))
2428 ALLOCATE (work(na, 1))
2429 fga = 0.0_dp; fgr = 0.0_dp; work = 0.0_dp
2433 DO ipgf = 1, npgf(iset)
2434 starti = (iset - 1)*maxso + (ipgf - 1)*
nsoset(lmax(iset))
2435 DO jpgf = 1, npgf(jset)
2436 startj = (jset - 1)*maxso + (jpgf - 1)*
nsoset(lmax(jset))
2438 DO iso =
nsoset(lmin(iset) - 1) + 1,
nsoset(lmax(iset))
2439 DO jso =
nsoset(lmin(jset) - 1) + 1,
nsoset(lmax(jset))
2444 fgr(1:nr, 1) = r1(1:nr, starti + iso)*r1(1:nr, startj + jso)
2446 fga(1:na, 1) = a1(1:na, starti + iso, dir)*a1(1:na, startj + jso, dir)
2448 DO ispin = 1, nspins
2449 CALL dgemm(
'N',
'N', na, 1, nr, 0.5_dp, vtau_h(:, :, ispin), na, fgr, &
2450 nr, 0.0_dp, work, na)
2451 CALL dgemm(
'T',
'N', 1, 1, na, 1.0_dp, work, na, fga, na, 1.0_dp, &
2452 intso_h(starti + iso:, startj + jso, ispin), 1)
2454 CALL dgemm(
'N',
'N', na, 1, nr, 0.5_dp, vtau_s(:, :, ispin), na, fgr, &
2455 nr, 0.0_dp, work, na)
2456 CALL dgemm(
'T',
'N', 1, 1, na, 1.0_dp, work, na, fga, na, 1.0_dp, &
2457 intso_s(starti + iso:, startj + jso, ispin), 1)
2462 fgr(1:nr, 1) = r1(1:nr, starti + iso)*r2(1:nr, startj + jso)
2464 fga(1:na, 1) = a1(1:na, starti + iso, dir)*a2(1:na, startj + jso, dir)
2466 DO ispin = 1, nspins
2467 CALL dgemm(
'N',
'N', na, 1, nr, 0.5_dp, vtau_h(:, :, ispin), na, fgr, &
2468 nr, 0.0_dp, work, na)
2469 CALL dgemm(
'T',
'N', 1, 1, na, 1.0_dp, work, na, fga, na, 1.0_dp, &
2470 intso_h(starti + iso:, startj + jso, ispin), 1)
2472 CALL dgemm(
'N',
'N', na, 1, nr, 0.5_dp, vtau_s(:, :, ispin), na, fgr, &
2473 nr, 0.0_dp, work, na)
2474 CALL dgemm(
'T',
'N', 1, 1, na, 1.0_dp, work, na, fga, na, 1.0_dp, &
2475 intso_s(starti + iso:, startj + jso, ispin), 1)
2480 fgr(1:nr, 1) = r2(1:nr, starti + iso)*r1(1:nr, startj + jso)
2482 fga(1:na, 1) = a2(1:na, starti + iso, dir)*a1(1:na, startj + jso, dir)
2484 DO ispin = 1, nspins
2485 CALL dgemm(
'N',
'N', na, 1, nr, 0.5_dp, vtau_h(:, :, ispin), na, fgr, &
2486 nr, 0.0_dp, work, na)
2487 CALL dgemm(
'T',
'N', 1, 1, na, 1.0_dp, work, na, fga, na, 1.0_dp, &
2488 intso_h(starti + iso:, startj + jso, ispin), 1)
2490 CALL dgemm(
'N',
'N', na, 1, nr, 0.5_dp, vtau_s(:, :, ispin), na, fgr, &
2491 nr, 0.0_dp, work, na)
2492 CALL dgemm(
'T',
'N', 1, 1, na, 1.0_dp, work, na, fga, na, 1.0_dp, &
2493 intso_s(starti + iso:, startj + jso, ispin), 1)
2498 fgr(1:nr, 1) = r2(1:nr, starti + iso)*r2(1:nr, startj + jso)
2500 fga(1:na, 1) = a2(1:na, starti + iso, dir)*a2(1:na, startj + jso, dir)
2502 DO ispin = 1, nspins
2503 CALL dgemm(
'N',
'N', na, 1, nr, 0.5_dp, vtau_h(:, :, ispin), na, fgr, &
2504 nr, 0.0_dp, work, na)
2505 CALL dgemm(
'T',
'N', 1, 1, na, 1.0_dp, work, na, fga, na, 1.0_dp, &
2506 intso_h(starti + iso:, startj + jso, ispin), 1)
2508 CALL dgemm(
'N',
'N', na, 1, nr, 0.5_dp, vtau_s(:, :, ispin), na, fgr, &
2509 nr, 0.0_dp, work, na)
2510 CALL dgemm(
'T',
'N', 1, 1, na, 1.0_dp, work, na, fga, na, 1.0_dp, &
2511 intso_s(starti + iso:, startj + jso, ispin), 1)
2524 DO ispin = 1, nspins
2525 int_hh(ispin)%r_coef(:, :) = int_hh(ispin)%r_coef(:, :) + intso_h(:, :, ispin)
2526 int_ss(ispin)%r_coef(:, :) = int_ss(ispin)%r_coef(:, :) + intso_s(:, :, ispin)
2529 CALL timestop(handle)
2531 END SUBROUTINE dgavtaudgb
static void dgemm(const char transa, const char transb, const int m, const int n, const int k, const double alpha, const double *a, const int lda, const double *b, const int ldb, const double beta, double *c, const int ldc)
Convenient wrapper to hide Fortran nature of dgemm_, swapping a and b.
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum)
...
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
Defines the basic variable types.
integer, parameter, public dp
Utility routines for the memory handling.
Interface to the message passing library MPI.
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public nsoset
integer, dimension(:, :), allocatable, public indso
subroutine, public get_paw_basis_info(basis_1c, o2nindex, n2oindex, nsatbas)
Return some info on the PAW basis derived from a GTO basis set.
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs)
Get the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
logical function, public has_nlcc(qs_kind_set)
finds if a given qs run needs to use nlcc
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
Type definitiona for linear response calculations.
subroutine, public get_rho_atom(rho_atom, cpc_h, cpc_s, rho_rad_h, rho_rad_s, drho_rad_h, drho_rad_s, vrho_rad_h, vrho_rad_s, rho_rad_h_d, rho_rad_s_d, ga_vlocal_gb_h, ga_vlocal_gb_s, int_scr_h, int_scr_s)
...
routines that build the integrals of the Vxc potential calculated for the atomic density in the basis...
subroutine, public calculate_gfxc_atom(qs_env, rho0_atom_set, rho1_atom_set, rho2_atom_set, kind_set, xc_section, is_triplet, accuracy)
...
subroutine, public calculate_xc_2nd_deriv_atom(rho_atom_set, rho1_atom_set, qs_env, xc_section, para_env, do_tddfpt2, do_triplet, kind_set_external)
...
subroutine, public calc_rho_angular(grid_atom, harmonics, nspins, grad_func, ir, r_h, r_s, rho_h, rho_s, dr_h, dr_s, r_h_d, r_s_d, drho_h, drho_s)
...
subroutine, public gavxcgb_nogc(vxc_h, vxc_s, int_hh, int_ss, grid_atom, basis_1c, harmonics, nspins)
...
subroutine, public calculate_vxc_atom(qs_env, energy_only, exc1, gradient_atom_set, adiabatic_rescale_factor, kind_set_external, rho_atom_set_external, xc_section_external)
...
subroutine, public gfxc_atom_diff(qs_env, rho0_atom_set, rho1_atom_set, rho2_atom_set, kind_set, xc_section, is_triplet, accuracy, epsrho)
...
All kind of helpful little routines.
pure integer function, dimension(2), public get_limit(m, n, me)
divide m entries into n parts, return size of part me
subroutine, public xc_rho_set_atom_update(rho_set, needs, nspins, bo)
...
subroutine, public fill_rho_set(rho_set, lsd, nspins, needs, rho, drho, tau, na, ir)
...
subroutine, public xc_2nd_deriv_of_r(rho_set, rho1_set, xc_section, deriv_set, w, vxc, vxg, do_triplet)
...
subroutine, public vxc_of_r_new(xc_fun_section, rho_set, deriv_set, deriv_order, needs, w, lsd, na, nr, exc, vxc, vxg, vtau, energy_only, epr_xc, adiabatic_rescale_factor)
...
represent a group ofunctional derivatives
subroutine, public xc_dset_zero_all(deriv_set)
...
subroutine, public xc_dset_release(derivative_set)
releases a derivative set
subroutine, public xc_dset_create(derivative_set, pw_pool, local_bounds)
creates a derivative set object
type(xc_rho_cflags_type) function, public xc_functionals_get_needs(functionals, lsd, calc_potential)
...
subroutine, public xc_rho_set_create(rho_set, local_bounds, rho_cutoff, drho_cutoff, tau_cutoff)
allocates and does (minimal) initialization of a rho_set
subroutine, public xc_rho_set_release(rho_set, pw_pool)
releases the given rho_set
Provides all information about an atomic kind.
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.
A derivative set contains the different derivatives of a xc-functional in form of a linked list.
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