(git:6344619)
Loading...
Searching...
No Matches
qs_fxc_atom.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief routines that build the integrals of the Fxc kernel calculated
10!> for the atomic density in the basis set of spherical primitives
11! **************************************************************************************************
20 USE kinds, ONLY: dp
26 USE qs_kind_types, ONLY: get_qs_kind,&
27 has_nlcc,&
32 USE qs_vxc_atom_utils, ONLY: &
36 USE util, ONLY: get_limit
37 USE xc_atom, ONLY: fill_rho_set,&
48#include "./base/base_uses.f90"
49
50 IMPLICIT NONE
51
52 PRIVATE
53
54 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_fxc_atom'
55
56 PUBLIC :: fxc_atom_calc
57
58! **************************************************************************************************
59
60CONTAINS
61
62! **************************************************************************************************
63!> \brief ...
64!> \param qs_env ...
65!> \param rho_atom_set ...
66!> \param rho1_atom_set ...
67!> \param xc_section ...
68!> \param para_env_ext ...
69!> \param do_scale ...
70!> \param do_triplet ...
71!> \param do_sf ...
72!> \param kind_set_external ...
73! **************************************************************************************************
74 SUBROUTINE fxc_atom_calc(qs_env, rho_atom_set, rho1_atom_set, xc_section, para_env_ext, &
75 do_scale, do_triplet, do_sf, kind_set_external)
76
77 TYPE(qs_environment_type), POINTER :: qs_env
78 TYPE(rho_atom_type), DIMENSION(:), POINTER :: rho_atom_set, rho1_atom_set
79 TYPE(section_vals_type), POINTER :: xc_section
80 TYPE(mp_para_env_type), INTENT(IN), OPTIONAL :: para_env_ext
81 LOGICAL, INTENT(IN), OPTIONAL :: do_scale, do_triplet, do_sf
82 TYPE(qs_kind_type), DIMENSION(:), OPTIONAL, &
83 POINTER :: kind_set_external
84
85 CHARACTER(LEN=*), PARAMETER :: routinen = 'fxc_atom_calc'
86
87 INTEGER :: atom, handle, iatom, ikind, ir, na, &
88 natom, nr, nspins, on
89 INTEGER, DIMENSION(2) :: local_loop_limit
90 INTEGER, DIMENSION(2, 3) :: bounds
91 INTEGER, DIMENSION(:), POINTER :: atom_list
92 LOGICAL :: accint, donlcc, gradient_functional, &
93 lsd, my_do_sf, nlcc, paw_atom, &
94 scale_rho, tau_f
95 REAL(kind=dp) :: agr, alpha, density_cut, gradient_cut, &
96 rtot, tau_cut
97 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: fw
98 REAL(kind=dp), CONTIGUOUS, DIMENSION(:, :, :), &
99 POINTER :: vtau_h, vtau_s, vxc_h, vxc_s
100 REAL(kind=dp), DIMENSION(1, 1, 1) :: rtau
101 REAL(kind=dp), DIMENSION(1, 1, 1, 1) :: rrho
102 REAL(kind=dp), DIMENSION(:, :), POINTER :: rho_nlcc, weight_h, weight_s
103 REAL(kind=dp), DIMENSION(:, :, :), POINTER :: rho1_h, rho1_s, rho_h, rho_s, tau1_h, &
104 tau1_s, tau_h, tau_s
105 REAL(kind=dp), DIMENSION(:, :, :, :), POINTER :: drho1_h, drho1_s, drho_h, drho_s, vxg_h, &
106 vxg_s
107 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
108 TYPE(dft_control_type), POINTER :: dft_control
109 TYPE(grid_atom_type), POINTER :: grid_atom
110 TYPE(gto_basis_set_type), POINTER :: basis_1c
111 TYPE(harmonics_atom_type), POINTER :: harmonics
112 TYPE(mp_para_env_type), POINTER :: para_env
113 TYPE(qs_kind_type), DIMENSION(:), POINTER :: my_kind_set, qs_kind_set
114 TYPE(rho_atom_coeff), DIMENSION(:), POINTER :: dr1_h, dr1_s, dr_h, dr_s, int_hh, &
115 int_ss, r1_h, r1_s, r_h, r_s
116 TYPE(rho_atom_coeff), DIMENSION(:, :), POINTER :: r1_h_d, r1_s_d, r_h_d, r_s_d
117 TYPE(rho_atom_type), POINTER :: rho1_atom, rho_atom
118 TYPE(section_vals_type), POINTER :: input, xc_fun_section
119 TYPE(tau_basis_cache_type) :: tau_basis_cache
120 TYPE(xc_derivative_set_type) :: deriv_set
121 TYPE(xc_rho_cflags_type) :: needs
122 TYPE(xc_rho_set_type) :: rho1_set_h, rho1_set_s, rho_set_h, &
123 rho_set_s
124
125! -------------------------------------------------------------------------
126
127 CALL timeset(routinen, handle)
128
129 NULLIFY (qs_kind_set)
130 NULLIFY (rho_h, rho_s, drho_h, drho_s, weight_h, weight_s)
131 NULLIFY (rho1_h, rho1_s, drho1_h, drho1_s)
132 NULLIFY (vxc_h, vxc_s, vxg_h, vxg_s)
133 NULLIFY (tau_h, tau_s, tau1_h, tau1_s, vtau_h, vtau_s)
134 NULLIFY (rho_nlcc)
135
136 CALL get_qs_env(qs_env=qs_env, &
137 input=input, &
138 dft_control=dft_control, &
139 para_env=para_env, &
140 qs_kind_set=qs_kind_set, &
141 atomic_kind_set=atomic_kind_set)
142
143 IF (PRESENT(kind_set_external)) THEN
144 my_kind_set => kind_set_external
145 ELSE
146 my_kind_set => qs_kind_set
147 END IF
148 nlcc = has_nlcc(my_kind_set)
149
150 accint = dft_control%qs_control%gapw_control%accurate_xcint
151
152 CALL section_vals_val_get(input, "DFT%LSD", l_val=lsd)
153 CALL section_vals_val_get(xc_section, "DENSITY_CUTOFF", &
154 r_val=density_cut)
155 CALL section_vals_val_get(xc_section, "GRADIENT_CUTOFF", &
156 r_val=gradient_cut)
157 CALL section_vals_val_get(xc_section, "TAU_CUTOFF", &
158 r_val=tau_cut)
159
160 my_do_sf = .false.
161 IF (PRESENT(do_sf)) my_do_sf = do_sf
162
163 xc_fun_section => section_vals_get_subs_vals(xc_section, &
164 "XC_FUNCTIONAL")
165 IF (lsd) THEN
166 nspins = 2
167 ELSE
168 nspins = 1
169 END IF
170
171 scale_rho = .false.
172 IF (PRESENT(do_scale)) THEN
173 IF (do_scale) THEN
174 ! obscure scaling needed for (some) triplet densities
175 scale_rho = .true.
176 cpassert(PRESENT(do_triplet))
177 cpassert(do_triplet)
178 cpassert(nspins == 1)
179 END IF
180 END IF
181 IF (PRESENT(do_triplet)) THEN
182 IF (nspins == 1 .AND. do_triplet) lsd = .true.
183 END IF
184
185 needs = xc_functionals_get_needs(xc_fun_section, lsd=lsd, &
186 calc_potential=.true.)
187 gradient_functional = needs%drho .OR. needs%drho_spin
188 tau_f = (needs%tau .OR. needs%tau_spin)
189 IF (.NOT. tau_f) rtau = 0.0_dp
190
191 ! Here starts the loop over all the atoms
192 DO ikind = 1, SIZE(atomic_kind_set)
193
194 NULLIFY (atom_list, harmonics, grid_atom)
195 CALL get_atomic_kind(atomic_kind_set(ikind), atom_list=atom_list, natom=natom)
196 CALL get_qs_kind(my_kind_set(ikind), paw_atom=paw_atom, &
197 harmonics=harmonics, grid_atom=grid_atom)
198 CALL get_qs_kind(my_kind_set(ikind), basis_set=basis_1c, basis_type="GAPW_1C")
199 IF (.NOT. paw_atom) cycle
200
201 nr = grid_atom%nr
202 na = grid_atom%ng_sphere
203
204 ! set integration weights
205 weight_h => grid_atom%weight
206 weight_s => grid_atom%weight
207 IF (accint) THEN
208 on = dft_control%qs_control%gapw_control%oweights
209 alpha = dft_control%qs_control%gapw_control%aw(ikind)
210 IF (ASSOCIATED(grid_atom%gapw_weight_s)) THEN
211 IF (grid_atom%gapw_weight_alpha /= alpha) DEALLOCATE (grid_atom%gapw_weight_s)
212 END IF
213 IF (.NOT. ASSOCIATED(grid_atom%gapw_weight_s)) THEN
214 ALLOCATE (grid_atom%gapw_weight_s(na, nr))
215 ALLOCATE (fw(nr))
216 CALL calc_weight_function(fw, grid_atom%rad2, on, alpha)
217 DO ir = 1, nr
218 agr = 1.0_dp - fw(ir)
219 grid_atom%gapw_weight_s(:, ir) = agr*grid_atom%weight(:, ir)
220 END DO
221 DEALLOCATE (fw)
222 grid_atom%gapw_weight_alpha = alpha
223 END IF
224 weight_s => grid_atom%gapw_weight_s
225 END IF
226
227 ! Array dimension: here only one dimensional arrays are used,
228 ! i.e. only the first column of deriv_data is read.
229 ! The other two dimensions are set to size equal 1.
230 bounds(1:2, 1:3) = 1
231 bounds(2, 1) = na
232 bounds(2, 2) = nr
233
234 CALL xc_dset_create(deriv_set, local_bounds=bounds)
235 CALL xc_rho_set_create(rho_set_h, bounds, rho_cutoff=density_cut, &
236 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
237 CALL xc_rho_set_create(rho_set_s, bounds, rho_cutoff=density_cut, &
238 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
239 CALL xc_rho_set_create(rho1_set_h, bounds, rho_cutoff=density_cut, &
240 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
241 CALL xc_rho_set_create(rho1_set_s, bounds, rho_cutoff=density_cut, &
242 drho_cutoff=gradient_cut, tau_cutoff=tau_cut)
243
244 ! allocate the required 3d arrays where to store rho and drho
245 IF (nspins == 1 .AND. .NOT. lsd) THEN
246 CALL xc_rho_set_atom_update(rho_set_h, needs, 1, bounds)
247 CALL xc_rho_set_atom_update(rho1_set_h, needs, 1, bounds)
248 CALL xc_rho_set_atom_update(rho_set_s, needs, 1, bounds)
249 CALL xc_rho_set_atom_update(rho1_set_s, needs, 1, bounds)
250 ELSE
251 CALL xc_rho_set_atom_update(rho_set_h, needs, 2, bounds)
252 CALL xc_rho_set_atom_update(rho1_set_h, needs, 2, bounds)
253 CALL xc_rho_set_atom_update(rho_set_s, needs, 2, bounds)
254 CALL xc_rho_set_atom_update(rho1_set_s, needs, 2, bounds)
255 END IF
256
257 ALLOCATE (rho_h(1:na, 1:nr, 1:nspins), rho1_h(1:na, 1:nr, 1:nspins), &
258 rho_s(1:na, 1:nr, 1:nspins), rho1_s(1:na, 1:nr, 1:nspins))
259
260 ALLOCATE (vxc_h(1:na, 1:nr, 1:nspins), vxc_s(1:na, 1:nr, 1:nspins))
261 vxc_h = 0.0_dp
262 vxc_s = 0.0_dp
263
264 IF (tau_f) THEN
265 CALL create_tau_basis_cache(tau_basis_cache, grid_atom, basis_1c, harmonics)
266 ALLOCATE (tau_h(1:na, 1:nr, 1:nspins), tau1_h(1:na, 1:nr, 1:nspins), &
267 tau_s(1:na, 1:nr, 1:nspins), tau1_s(1:na, 1:nr, 1:nspins))
268 ALLOCATE (vtau_h(1:na, 1:nr, 1:nspins), vtau_s(1:na, 1:nr, 1:nspins))
269 END IF
270
271 IF (gradient_functional) THEN
272 ALLOCATE (drho_h(1:4, 1:na, 1:nr, 1:nspins), drho1_h(1:4, 1:na, 1:nr, 1:nspins), &
273 drho_s(1:4, 1:na, 1:nr, 1:nspins), drho1_s(1:4, 1:na, 1:nr, 1:nspins))
274 ALLOCATE (vxg_h(1:3, 1:na, 1:nr, 1:nspins), vxg_s(1:3, 1:na, 1:nr, 1:nspins))
275 ELSE
276 ALLOCATE (drho_h(1, 1, 1, 1), drho1_h(1, 1, 1, 1), &
277 drho_s(1, 1, 1, 1), drho1_s(1, 1, 1, 1))
278 ALLOCATE (vxg_h(1, 1, 1, 1), vxg_s(1, 1, 1, 1))
279 rrho = 0.0_dp
280 END IF
281 vxg_h = 0.0_dp
282 vxg_s = 0.0_dp
283
284 ! NLCC: prepare rho and drho of the core charge for this KIND
285 donlcc = .false.
286 IF (nlcc) THEN
287 NULLIFY (rho_nlcc)
288 rho_nlcc => my_kind_set(ikind)%nlcc_pot
289 IF (ASSOCIATED(rho_nlcc)) donlcc = .true.
290 END IF
291
292 ! parallelization
293 IF (PRESENT(para_env_ext)) THEN
294 local_loop_limit = get_limit(natom, para_env_ext%num_pe, para_env_ext%mepos)
295 ELSE
296 local_loop_limit = get_limit(natom, para_env%num_pe, para_env%mepos)
297 END IF
298
299 DO iatom = local_loop_limit(1), local_loop_limit(2) !1,natom
300 atom = atom_list(iatom)
301
302 rho_atom_set(atom)%exc_h = 0.0_dp
303 rho_atom_set(atom)%exc_s = 0.0_dp
304 rho1_atom_set(atom)%exc_h = 0.0_dp
305 rho1_atom_set(atom)%exc_s = 0.0_dp
306
307 rho_atom => rho_atom_set(atom)
308 rho1_atom => rho1_atom_set(atom)
309 NULLIFY (r_h, r_s, dr_h, dr_s, r_h_d, r_s_d)
310 NULLIFY (r1_h, r1_s, dr1_h, dr1_s, r1_h_d, r1_s_d)
311 rho_h = 0.0_dp
312 rho_s = 0.0_dp
313 rho1_h = 0.0_dp
314 rho1_s = 0.0_dp
315 IF (gradient_functional) THEN
316 CALL get_rho_atom(rho_atom=rho_atom, &
317 rho_rad_h=r_h, rho_rad_s=r_s, &
318 drho_rad_h=dr_h, drho_rad_s=dr_s, &
319 rho_rad_h_d=r_h_d, rho_rad_s_d=r_s_d)
320 CALL get_rho_atom(rho_atom=rho1_atom, &
321 rho_rad_h=r1_h, rho_rad_s=r1_s, &
322 drho_rad_h=dr1_h, drho_rad_s=dr1_s, &
323 rho_rad_h_d=r1_h_d, rho_rad_s_d=r1_s_d)
324 drho_h = 0.0_dp; drho_s = 0.0_dp
325 drho1_h = 0.0_dp; drho1_s = 0.0_dp
326 ELSE
327 CALL get_rho_atom(rho_atom=rho_atom, &
328 rho_rad_h=r_h, rho_rad_s=r_s)
329 CALL get_rho_atom(rho_atom=rho1_atom, &
330 rho_rad_h=r1_h, rho_rad_s=r1_s)
331 END IF
332
333 rtot = 0.0_dp
334
335 DO ir = 1, nr
336 CALL calc_rho_angular(grid_atom, harmonics, nspins, gradient_functional, &
337 ir, r_h, r_s, rho_h, rho_s, dr_h, dr_s, r_h_d, r_s_d, &
338 drho_h, drho_s)
339 IF (donlcc .AND. ASSOCIATED(rho_nlcc)) THEN
340 CALL calc_rho_nlcc(grid_atom, nspins, gradient_functional, &
341 ir, rho_nlcc(:, 1), rho_h, rho_s, rho_nlcc(:, 2), drho_h, drho_s)
342 END IF
343 CALL calc_rho_angular(grid_atom, harmonics, nspins, gradient_functional, &
344 ir, r1_h, r1_s, rho1_h, rho1_s, dr1_h, dr1_s, r1_h_d, r1_s_d, &
345 drho1_h, drho1_s)
346 END DO
347 IF (tau_f) THEN
348 CALL calc_tau_atom(tau_h, tau_s, rho_atom, tau_basis_cache, nspins)
349 CALL calc_tau_atom(tau1_h, tau1_s, rho1_atom, tau_basis_cache, nspins)
350 END IF
351 IF (scale_rho) THEN
352 rho_h = 2.0_dp*rho_h
353 rho_s = 2.0_dp*rho_s
354 IF (gradient_functional) THEN
355 drho_h = 2.0_dp*drho_h
356 drho_s = 2.0_dp*drho_s
357 END IF
358 IF (tau_f) THEN
359 tau_h = 2.0_dp*tau_h
360 tau_s = 2.0_dp*tau_s
361 END IF
362 END IF
363
364 DO ir = 1, nr
365 IF (tau_f) THEN
366 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, drho_h, tau_h, na, ir)
367 CALL fill_rho_set(rho1_set_h, lsd, nspins, needs, rho1_h, drho1_h, tau1_h, na, ir)
368 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, drho_s, tau_s, na, ir)
369 CALL fill_rho_set(rho1_set_s, lsd, nspins, needs, rho1_s, drho1_s, tau1_s, na, ir)
370 ELSE IF (gradient_functional) THEN
371 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, drho_h, rtau, na, ir)
372 CALL fill_rho_set(rho1_set_h, lsd, nspins, needs, rho1_h, drho1_h, rtau, na, ir)
373 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, drho_s, rtau, na, ir)
374 CALL fill_rho_set(rho1_set_s, lsd, nspins, needs, rho1_s, drho1_s, rtau, na, ir)
375 ELSE
376 CALL fill_rho_set(rho_set_h, lsd, nspins, needs, rho_h, rrho, rtau, na, ir)
377 CALL fill_rho_set(rho1_set_h, lsd, nspins, needs, rho1_h, rrho, rtau, na, ir)
378 CALL fill_rho_set(rho_set_s, lsd, nspins, needs, rho_s, rrho, rtau, na, ir)
379 CALL fill_rho_set(rho1_set_s, lsd, nspins, needs, rho1_s, rrho, rtau, na, ir)
380 END IF
381 END DO
382
383 CALL xc_2nd_deriv_of_r(xc_section=xc_section, &
384 rho_set=rho_set_h, rho1_set=rho1_set_h, &
385 deriv_set=deriv_set, &
386 w=weight_h, vxc=vxc_h, vxg=vxg_h, vtau=vtau_h, do_triplet=do_triplet, &
387 do_sf=my_do_sf)
388 CALL xc_2nd_deriv_of_r(xc_section=xc_section, &
389 rho_set=rho_set_s, rho1_set=rho1_set_s, &
390 deriv_set=deriv_set, &
391 w=weight_s, vxc=vxc_s, vxg=vxg_s, vtau=vtau_s, do_triplet=do_triplet, &
392 do_sf=my_do_sf)
393
394 CALL get_rho_atom(rho_atom=rho1_atom, ga_vlocal_gb_h=int_hh, ga_vlocal_gb_s=int_ss)
395 IF (gradient_functional) THEN
396 CALL gavxcgb_gc(vxc_h, vxc_s, vxg_h, vxg_s, int_hh, int_ss, &
397 grid_atom, basis_1c, harmonics, nspins)
398 ELSE
399 CALL gavxcgb_nogc(vxc_h, vxc_s, int_hh, int_ss, &
400 grid_atom, basis_1c, harmonics, nspins)
401 END IF
402 IF (tau_f) THEN
403 CALL dgavtaudgb(vtau_h, vtau_s, int_hh, int_ss, &
404 tau_basis_cache, nspins)
405 END IF
406
407 NULLIFY (r_h, r_s, dr_h, dr_s)
408
409 END DO
410
411 ! some cleanup
412 DEALLOCATE (rho_h, rho_s, rho1_h, rho1_s, vxc_h, vxc_s)
413 DEALLOCATE (drho_h, drho_s, vxg_h, vxg_s)
414 DEALLOCATE (drho1_h, drho1_s)
415 IF (tau_f) THEN
416 DEALLOCATE (tau_h, tau_s, tau1_h, tau1_s)
417 DEALLOCATE (vtau_h, vtau_s)
418 CALL release_tau_basis_cache(tau_basis_cache)
419 END IF
420
421 CALL xc_dset_release(deriv_set)
422 CALL xc_rho_set_release(rho_set_h)
423 CALL xc_rho_set_release(rho1_set_h)
424 CALL xc_rho_set_release(rho_set_s)
425 CALL xc_rho_set_release(rho1_set_s)
426 END DO
427
428 CALL timestop(handle)
429
430 END SUBROUTINE fxc_atom_calc
431
432END MODULE qs_fxc_atom
Definition atom.F:9
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.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
objects that represent the structure of input sections and the data contained in an input section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Interface to the message passing library MPI.
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, mimic, 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, sab_cneo, 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, matrix_vhxc, 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, xcint_weights, 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, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_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, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
routines that build the integrals of the Fxc kernel calculated for the atomic density in the basis se...
Definition qs_fxc_atom.F:12
subroutine, public fxc_atom_calc(qs_env, rho_atom_set, rho1_atom_set, xc_section, para_env_ext, do_scale, do_triplet, do_sf, kind_set_external)
...
Definition qs_fxc_atom.F:76
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, cneo_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, hund_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, proj_shell_charge, lr_atom, do_mtlr, u_j_loop, ao_coef, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
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)
...
Support routines for integrals of the Vxc/Fxc/Gxc potentials calculated for the atomic density in the...
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 release_tau_basis_cache(tau_cache)
Release precomputed GAPW meta-GGA tau factors.
subroutine, public create_tau_basis_cache(tau_cache, grid_atom, basis_1c, harmonics)
Precompute radial and angular factors for GAPW meta-GGA tau contractions.
subroutine, public gavxcgb_nogc(vxc_h, vxc_s, int_hh, int_ss, grid_atom, basis_1c, harmonics, nspins)
...
subroutine, public gavxcgb_gc(vxc_h, vxc_s, vxg_h, vxg_s, int_hh, int_ss, grid_atom, basis_1c, harmonics, nspins)
...
subroutine, public calc_weight_function(fun, r2, order, alpha)
Calculates the radial weight function for accurate XC integration.
subroutine, public calc_rho_nlcc(grid_atom, nspins, grad_func, ir, rho_nlcc, rho_h, rho_s, drho_nlcc, drho_h, drho_s)
...
subroutine, public dgavtaudgb(vtau_h, vtau_s, int_hh, int_ss, tau_cache, nspins)
Integrates 0.5 * grad_ga .dot. (V_tau * grad_gb) on the atomic grid for meta-GGA.
subroutine, public calc_tau_atom(tau_h, tau_s, rho_atom, tau_cache, nspins)
Computes tau hard and soft on the atomic grids for meta-GGA calculations.
All kind of helpful little routines.
Definition util.F:14
pure integer function, dimension(2), public get_limit(m, n, me)
divide m entries into n parts, return size of part me
Definition util.F:333
subroutine, public xc_rho_set_atom_update(rho_set, needs, nspins, bo)
...
Definition xc_atom.F:523
subroutine, public xc_2nd_deriv_of_r(rho_set, rho1_set, xc_section, deriv_set, w, vxc, vxg, vtau, do_triplet, do_sf)
...
Definition xc_atom.F:419
subroutine, public fill_rho_set(rho_set, lsd, nspins, needs, rho, drho, tau, na, ir)
...
Definition xc_atom.F:683
represent a group ofunctional derivatives
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)
...
contains the structure
contains the structure
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