64#include "./base/base_uses.f90"
72 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_rho_atom_methods'
73 INTEGER,
PARAMETER,
PRIVATE :: l2_chunk_dp = 16000
101 natom, nspins, tot_rho1_h, tot_rho1_s, &
102 rho1_h_spin, rho1_s_spin, rho1_h_aspin, rho1_s_aspin)
107 INTEGER,
DIMENSION(:),
INTENT(IN) :: atom_list
108 INTEGER,
INTENT(IN) :: natom, nspins
109 REAL(
dp),
DIMENSION(:),
INTENT(INOUT) :: tot_rho1_h, tot_rho1_s
110 REAL(
dp),
INTENT(INOUT) :: rho1_h_spin, rho1_s_spin, rho1_h_aspin, &
113 CHARACTER(len=*),
PARAMETER :: routinen =
'calculate_rho_atom'
115 INTEGER :: damax_iso_not0_local, handle, i, i1, i2, iat, iatom, icg, ipgf1, ipgf2, ir, &
116 iset1, iset2, iso, iso1, iso1_coeff, iso1_first, iso1_last, iso2, iso2_coeff, iso2_first, &
117 iso2_last, j, l, l_iso, l_sub, l_sum, lmax12, lmax_expansion, lmin12, m1s, m2s, &
118 max_iso_not0, max_iso_not0_local, max_npgf, max_s_harm, maxl, maxso, mepos, n1s, n2s, na, &
119 nr, nset, num_pe, size1, size2
120 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: cg_n_list, dacg_n_list
121 INTEGER,
ALLOCATABLE,
DIMENSION(:, :, :) :: cg_list, dacg_list
122 INTEGER,
DIMENSION(2) :: bo
123 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf, o2nindex
124 LOGICAL,
ALLOCATABLE,
DIMENSION(:, :) :: done_vgg
125 REAL(
dp) :: c1, c2, cpc_h, cpc_s, rfun, rho_h, &
126 rho_s, root_zet12, zet12
127 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: erf_zet12, g1, g2, gg0, int1, int2
128 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: dgg, gg, gg_lm1, sfun_h, sfun_s
129 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: g_rad, vgg
130 REAL(
dp),
DIMENSION(:, :),
POINTER :: coeff_h, coeff_s, zet
131 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: my_cg
132 REAL(
dp),
DIMENSION(:, :, :, :),
POINTER :: my_cg_dxyz
137 CALL timeset(routinen, handle)
142 NULLIFY (harmonics, grid_atom)
143 NULLIFY (lmin, lmax, npgf, zet, my_cg, my_cg_dxyz, coeff_h, coeff_s)
145 CALL get_qs_kind(qs_kind, grid_atom=grid_atom, harmonics=harmonics)
146 CALL get_qs_kind(qs_kind, basis_set=basis_1c, basis_type=
"GAPW_1C")
149 maxl=maxl, npgf=npgf, nset=nset, zet=zet, &
154 max_iso_not0 = harmonics%max_iso_not0
155 max_s_harm = harmonics%max_s_harm
158 max_npgf = maxval(npgf(1:nset))
159 lmax_expansion =
indso(1, max_iso_not0)
161 num_pe = para_env%num_pe
162 mepos = para_env%mepos
165 my_cg => harmonics%my_CG
166 my_cg_dxyz => harmonics%my_CG_dxyz
168 ALLOCATE (g1(nr), g2(nr), gg0(nr), gg(nr, 0:2*maxl), dgg(nr, 0:2*maxl), gg_lm1(nr, 0:2*maxl))
169 ALLOCATE (erf_zet12(nr), vgg(nr, 0:2*maxl, 0:
indso(1, max_iso_not0)))
170 ALLOCATE (done_vgg(0:2*maxl, 0:
indso(1, max_iso_not0)))
171 ALLOCATE (int1(nr), int2(nr))
172 ALLOCATE (cg_list(2,
nsoset(maxl)**2, max_s_harm), cg_n_list(max_s_harm), &
173 dacg_list(2,
nsoset(maxl)**2, max_s_harm), dacg_n_list(max_s_harm))
174 ALLOCATE (g_rad(nr, max_npgf, nset))
177 DO ipgf1 = 1, npgf(iset1)
178 g_rad(1:nr, ipgf1, iset1) = exp(-zet(ipgf1, iset1)*grid_atom%rad2(1:nr))
182 DO iat = bo(1), bo(2)
183 iatom = atom_list(iat)
185 IF (.NOT.
ASSOCIATED(rho_atom_set(iatom)%rho_rad_h(i)%r_coef))
THEN
186 CALL allocate_rho_atom_rad(rho_atom_set, iatom, i, nr, max_iso_not0)
188 CALL set2zero_rho_atom_rad(rho_atom_set, iatom, i)
198 CALL get_none0_cg_list(my_cg, lmin(iset1), lmax(iset1), lmin(iset2), lmax(iset2), &
199 max_s_harm, lmax_expansion, cg_list, cg_n_list, max_iso_not0_local)
200 cpassert(max_iso_not0_local <= max_iso_not0)
201 CALL get_none0_cg_list(my_cg_dxyz, lmin(iset1), lmax(iset1), lmin(iset2), lmax(iset2), &
202 max_s_harm, lmax_expansion, dacg_list, dacg_n_list, damax_iso_not0_local)
205 DO ipgf1 = 1, npgf(iset1)
206 iso1_first =
nsoset(lmin(iset1) - 1) + 1 + n1s*(ipgf1 - 1) + m1s
207 iso1_last =
nsoset(lmax(iset1)) + n1s*(ipgf1 - 1) + m1s
208 size1 = iso1_last - iso1_first + 1
209 iso1_first = o2nindex(iso1_first)
210 iso1_last = o2nindex(iso1_last)
211 i1 = iso1_last - iso1_first + 1
212 cpassert(size1 == i1)
213 i1 =
nsoset(lmin(iset1) - 1) + 1
215 g1(1:nr) = g_rad(1:nr, ipgf1, iset1)
218 DO ipgf2 = 1, npgf(iset2)
219 iso2_first =
nsoset(lmin(iset2) - 1) + 1 + n2s*(ipgf2 - 1) + m2s
220 iso2_last =
nsoset(lmax(iset2)) + n2s*(ipgf2 - 1) + m2s
221 size2 = iso2_last - iso2_first + 1
222 iso2_first = o2nindex(iso2_first)
223 iso2_last = o2nindex(iso2_last)
224 i2 = iso2_last - iso2_first + 1
225 cpassert(size2 == i2)
226 i2 =
nsoset(lmin(iset2) - 1) + 1
228 g2(1:nr) = g_rad(1:nr, ipgf2, iset2)
229 lmin12 = lmin(iset1) + lmin(iset2)
230 lmax12 = lmax(iset1) + lmax(iset2)
232 zet12 = zet(ipgf1, iset1) + zet(ipgf2, iset2)
233 root_zet12 = sqrt(zet(ipgf1, iset1) + zet(ipgf2, iset2))
235 erf_zet12(ir) = erf(root_zet12*grid_atom%rad(ir))
244 IF (lmin12 <= lmax_expansion)
THEN
245 IF (lmin12 == 0)
THEN
246 gg(1:nr, lmin12) = g1(1:nr)*g2(1:nr)
247 gg_lm1(1:nr, lmin12) = 0.0_dp
248 gg0(1:nr) = gg(1:nr, lmin12)
250 gg0(1:nr) = g1(1:nr)*g2(1:nr)
251 gg(1:nr, lmin12) = grid_atom%rad2l(1:nr, lmin12)*g1(1:nr)*g2(1:nr)
252 gg_lm1(1:nr, lmin12) = grid_atom%rad2l(1:nr, lmin12 - 1)*g1(1:nr)*g2(1:nr)
256 IF (lmax12 > lmax_expansion) lmax12 = lmax_expansion
258 DO l = lmin12 + 1, lmax12
259 gg(1:nr, l) = grid_atom%rad(1:nr)*gg(1:nr, l - 1)
260 gg_lm1(1:nr, l) = gg(1:nr, l - 1)
261 dgg(1:nr, l - 1) = -2.0_dp*(zet(ipgf1, iset1) + zet(ipgf2, iset2))*gg(1:nr, l)
264 dgg(1:nr, lmax12) = -2.0_dp*(zet(ipgf1, iset1) + &
265 zet(ipgf2, iset2))*grid_atom%rad(1:nr)*gg(1:nr, lmax12)
267 c2 = sqrt(
pi*
pi*
pi/(zet12*zet12*zet12))
269 DO iso = 1, max_iso_not0_local
270 l_iso =
indso(1, iso)
271 c1 =
fourpi/(2._dp*real(l_iso,
dp) + 1._dp)
272 DO icg = 1, cg_n_list(iso)
273 iso1 = cg_list(1, icg, iso)
274 iso2 = cg_list(2, icg, iso)
277 cpassert(l <= lmax_expansion)
278 IF (done_vgg(l, l_iso)) cycle
283 vgg(1:nr, l, l_iso) = erf_zet12(1:nr)*grid_atom%oorad2l(1:nr, 1)*c2
285 CALL whittaker_c0a(int1, grid_atom%rad, gg0, erf_zet12, zet12, l, l_iso, nr)
286 CALL whittaker_ci(int2, grid_atom%rad, gg0, zet12, l_sub, nr)
289 int2(ir) = grid_atom%rad2l(ir, l_iso)*int2(ir)
290 vgg(ir, l, l_iso) = c1*(int1(ir) + int2(ir))
293 done_vgg(l, l_iso) = .true.
298 DO iat = bo(1), bo(2)
299 iatom = atom_list(iat)
302 coeff_h => rho_atom_set(iatom)%cpc_h(i)%r_coef
303 coeff_s => rho_atom_set(iatom)%cpc_s(i)%r_coef
305 DO iso = 1, max_iso_not0_local
306 l_iso =
indso(1, iso)
307 DO icg = 1, cg_n_list(iso)
308 iso1 = cg_list(1, icg, iso)
309 iso2 = cg_list(2, icg, iso)
312 cpassert(l <= lmax_expansion)
313 iso1_coeff = iso1_first + iso1 - i1
314 iso2_coeff = iso2_first + iso2 - i2
315 cpc_h = coeff_h(iso1_coeff, iso2_coeff)*my_cg(iso1, iso2, iso)
316 cpc_s = coeff_s(iso1_coeff, iso2_coeff)*my_cg(iso1, iso2, iso)
318 rho_atom_set(iatom)%rho_rad_h(i)%r_coef(1:nr, iso) = &
319 rho_atom_set(iatom)%rho_rad_h(i)%r_coef(1:nr, iso) + &
322 rho_atom_set(iatom)%rho_rad_s(i)%r_coef(1:nr, iso) = &
323 rho_atom_set(iatom)%rho_rad_s(i)%r_coef(1:nr, iso) + &
326 rho_atom_set(iatom)%drho_rad_h(i)%r_coef(1:nr, iso) = &
327 rho_atom_set(iatom)%drho_rad_h(i)%r_coef(1:nr, iso) + &
330 rho_atom_set(iatom)%drho_rad_s(i)%r_coef(1:nr, iso) = &
331 rho_atom_set(iatom)%drho_rad_s(i)%r_coef(1:nr, iso) + &
334 rho_atom_set(iatom)%vrho_rad_h(i)%r_coef(1:nr, iso) = &
335 rho_atom_set(iatom)%vrho_rad_h(i)%r_coef(1:nr, iso) + &
336 vgg(1:nr, l, l_iso)*cpc_h
338 rho_atom_set(iatom)%vrho_rad_s(i)%r_coef(1:nr, iso) = &
339 rho_atom_set(iatom)%vrho_rad_s(i)%r_coef(1:nr, iso) + &
340 vgg(1:nr, l, l_iso)*cpc_s
346 DO iso = 1, max_iso_not0
347 l_iso =
indso(1, iso)
348 DO icg = 1, dacg_n_list(iso)
349 iso1 = dacg_list(1, icg, iso)
350 iso2 = dacg_list(2, icg, iso)
352 cpassert(l <= lmax_expansion)
353 iso1_coeff = iso1_first + iso1 - i1
354 iso2_coeff = iso2_first + iso2 - i2
355 cpc_h = coeff_h(iso1_coeff, iso2_coeff)
356 cpc_s = coeff_s(iso1_coeff, iso2_coeff)
358 rho_atom_set(iatom)%rho_rad_h_d(j, i)%r_coef(1:nr, iso) = &
359 rho_atom_set(iatom)%rho_rad_h_d(j, i)%r_coef(1:nr, iso) + &
360 gg_lm1(1:nr, l)*cpc_h*my_cg_dxyz(j, iso1, iso2, iso)
362 rho_atom_set(iatom)%rho_rad_s_d(j, i)%r_coef(1:nr, iso) = &
363 rho_atom_set(iatom)%rho_rad_s_d(j, i)%r_coef(1:nr, iso) + &
364 gg_lm1(1:nr, l)*cpc_s*my_cg_dxyz(j, iso1, iso2, iso)
380 DO iat = bo(1), bo(2)
381 iatom = atom_list(iat)
385 DO iso = 1, max_iso_not0
389 rho_h = rho_h + rho_atom_set(iatom)%rho_rad_h(i)%r_coef(ir, iso)*grid_atom%wr(ir)
390 rho_s = rho_s + rho_atom_set(iatom)%rho_rad_s(i)%r_coef(ir, iso)*grid_atom%wr(ir)
392 tot_rho1_h(i) = tot_rho1_h(i) + rho_h*harmonics%slm_int(iso)
393 tot_rho1_s(i) = tot_rho1_s(i) + rho_s*harmonics%slm_int(iso)
398 IF (nspins == 2)
THEN
399 na =
SIZE(harmonics%slm, 1)
400 ALLOCATE (sfun_h(nr, na), sfun_s(nr, na))
403 DO iso = 1, max_iso_not0
405 rfun = grid_atom%wr(ir)*(rho_atom_set(iatom)%rho_rad_h(1)%r_coef(ir, iso) - &
406 rho_atom_set(iatom)%rho_rad_h(2)%r_coef(ir, iso))
407 sfun_h(ir, 1:na) = sfun_h(ir, 1:na) + rfun*harmonics%slm(1:na, iso)*grid_atom%wa(1:na)
408 rfun = grid_atom%wr(ir)*(rho_atom_set(iatom)%rho_rad_s(1)%r_coef(ir, iso) - &
409 rho_atom_set(iatom)%rho_rad_s(2)%r_coef(ir, iso))
410 sfun_s(ir, 1:na) = sfun_s(ir, 1:na) + rfun*harmonics%slm(1:na, iso)*grid_atom%wa(1:na)
413 rho1_h_spin = rho1_h_spin + sum(sfun_h(1:nr, 1:na))
414 rho1_s_spin = rho1_s_spin + sum(sfun_s(1:nr, 1:na))
415 rho1_h_aspin = rho1_h_aspin + sum(abs(sfun_h(1:nr, 1:na)))
416 rho1_s_aspin = rho1_s_aspin + sum(abs(sfun_s(1:nr, 1:na)))
417 DEALLOCATE (sfun_h, sfun_s)
422 DEALLOCATE (g1, g2, gg0, gg, gg_lm1, dgg, vgg, done_vgg, erf_zet12, int1, int2, g_rad)
423 DEALLOCATE (cg_list, cg_n_list, dacg_list, dacg_n_list)
424 DEALLOCATE (o2nindex)
426 CALL timestop(handle)
445 INTEGER,
DIMENSION(:),
INTENT(IN) :: atom_list
446 INTEGER,
INTENT(IN) :: natom, nspins
448 CHARACTER(len=*),
PARAMETER :: routinen =
'replicate_rho_atom_radial'
450 INTEGER :: block_size, bo(2), cursor, handle, iat, &
451 iatom, ispin, j, max_iso_not0, ncoeff, &
453 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: buffer
457 CALL timeset(routinen, handle)
459 NULLIFY (grid_atom, harmonics)
460 CALL get_qs_kind(qs_kind, grid_atom=grid_atom, harmonics=harmonics)
461 cpassert(
ASSOCIATED(grid_atom))
462 cpassert(
ASSOCIATED(harmonics))
464 max_iso_not0 = harmonics%max_iso_not0
465 ncoeff = nr*max_iso_not0
466 block_size = 10*nspins*ncoeff
467 ALLOCATE (buffer(block_size*natom))
470 bo =
get_limit(natom, para_env%num_pe, para_env%mepos)
471 DO iat = bo(1), bo(2)
472 iatom = atom_list(iat)
473 cursor = (iat - 1)*block_size
475 buffer(cursor + 1:cursor + ncoeff) = &
476 reshape(rho_atom_set(iatom)%rho_rad_h(ispin)%r_coef, [ncoeff])
477 cursor = cursor + ncoeff
478 buffer(cursor + 1:cursor + ncoeff) = &
479 reshape(rho_atom_set(iatom)%rho_rad_s(ispin)%r_coef, [ncoeff])
480 cursor = cursor + ncoeff
481 buffer(cursor + 1:cursor + ncoeff) = &
482 reshape(rho_atom_set(iatom)%drho_rad_h(ispin)%r_coef, [ncoeff])
483 cursor = cursor + ncoeff
484 buffer(cursor + 1:cursor + ncoeff) = &
485 reshape(rho_atom_set(iatom)%drho_rad_s(ispin)%r_coef, [ncoeff])
486 cursor = cursor + ncoeff
488 buffer(cursor + 1:cursor + ncoeff) = &
489 reshape(rho_atom_set(iatom)%rho_rad_h_d(j, ispin)%r_coef, [ncoeff])
490 cursor = cursor + ncoeff
491 buffer(cursor + 1:cursor + ncoeff) = &
492 reshape(rho_atom_set(iatom)%rho_rad_s_d(j, ispin)%r_coef, [ncoeff])
493 cursor = cursor + ncoeff
496 cpassert(cursor == iat*block_size)
498 CALL para_env%sum(buffer)
501 iatom = atom_list(iat)
502 cursor = (iat - 1)*block_size
504 IF (.NOT.
ASSOCIATED(rho_atom_set(iatom)%rho_rad_h(ispin)%r_coef))
THEN
505 CALL allocate_rho_atom_rad(rho_atom_set, iatom, ispin, nr, max_iso_not0)
507 rho_atom_set(iatom)%rho_rad_h(ispin)%r_coef = &
508 reshape(buffer(cursor + 1:cursor + ncoeff), [nr, max_iso_not0])
509 cursor = cursor + ncoeff
510 rho_atom_set(iatom)%rho_rad_s(ispin)%r_coef = &
511 reshape(buffer(cursor + 1:cursor + ncoeff), [nr, max_iso_not0])
512 cursor = cursor + ncoeff
513 rho_atom_set(iatom)%drho_rad_h(ispin)%r_coef = &
514 reshape(buffer(cursor + 1:cursor + ncoeff), [nr, max_iso_not0])
515 cursor = cursor + ncoeff
516 rho_atom_set(iatom)%drho_rad_s(ispin)%r_coef = &
517 reshape(buffer(cursor + 1:cursor + ncoeff), [nr, max_iso_not0])
518 cursor = cursor + ncoeff
520 rho_atom_set(iatom)%rho_rad_h_d(j, ispin)%r_coef = &
521 reshape(buffer(cursor + 1:cursor + ncoeff), [nr, max_iso_not0])
522 cursor = cursor + ncoeff
523 rho_atom_set(iatom)%rho_rad_s_d(j, ispin)%r_coef = &
524 reshape(buffer(cursor + 1:cursor + ncoeff), [nr, max_iso_not0])
525 cursor = cursor + ncoeff
528 cpassert(cursor == iat*block_size)
532 CALL timestop(handle)
559 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
565 CHARACTER(len=*),
PARAMETER :: routinen =
'calculate_rho_atom_coeff'
567 INTEGER :: bo(2), handle, i, iac, iatom, ibc, ikind, img, inb, ispin, jatom, jkind, kac, &
568 kac_hi, kac_lo, katom, kbc, kkind, len_pc1, max_gau, max_nb, max_nclist, max_nsgf, mepos, &
569 n_cont_a, n_cont_b, n_nb, nat_kind, natom, nimages, nkind, nl_size, nsoctot, nspins, &
570 num_pe, slot, w_alloc, w_total
571 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: ia_ptr, ia_work, nsatbas_kind, &
573 INTEGER,
DIMENSION(3) :: cell_b
574 INTEGER,
DIMENSION(:),
POINTER :: a_list, list_a, list_b
575 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
576 LOGICAL :: dista, distb, found, paw_atom
577 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: has_intac, paw_kind
578 LOGICAL,
ALLOCATABLE,
DIMENSION(:, :) :: w_touched
579 REAL(kind=
dp) :: beta, eps_cpc, factor, pmax
580 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: nb_pmax, proj_work1
581 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: p_matrix, proj_work2, w_buf
582 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: c_coeff_hh_a, c_coeff_hh_b, &
583 c_coeff_ss_a, c_coeff_ss_b, r_coef_h, &
585 TYPE(
alist_type),
POINTER :: alist_ac, alist_bc
598 CALL timeset(routinen, handle)
601 dft_control=dft_control, &
602 atomic_kind_set=atomic_kind_set)
604 eps_cpc = dft_control%qs_control%gapw_control%eps_cpc
606 cpassert(
ASSOCIATED(qs_kind_set))
607 cpassert(
ASSOCIATED(rho_atom_set))
608 cpassert(
ASSOCIATED(oce))
609 cpassert(
ASSOCIATED(sab))
611 nspins = dft_control%nspins
612 nimages = dft_control%nimages
614 NULLIFY (cell_to_index)
615 IF (nimages > 1)
THEN
616 CALL get_qs_env(qs_env=qs_env, kpoints=kpoints)
621 CALL get_qs_kind_set(qs_kind_set, maxsgf=max_nsgf, maxgtops=max_gau, basis_type=
'GAPW_1C')
623 nkind =
SIZE(atomic_kind_set)
626 CALL get_atomic_kind(atomic_kind_set(ikind), atom_list=a_list, natom=nat_kind)
627 CALL get_qs_kind(qs_kind_set(ikind), paw_atom=paw_atom)
629 IF (.NOT. paw_atom) cycle
633 rho_atom_set(iatom)%cpc_h(ispin)%r_coef = 0.0_dp
634 rho_atom_set(iatom)%cpc_s(ispin)%r_coef = 0.0_dp
638 num_pe = para_env%num_pe
639 mepos = para_env%mepos
644 rho_atom_set(iatom)%ga_Vlocal_gb_h(ispin)%r_coef = 0.0_dp
645 rho_atom_set(iatom)%ga_Vlocal_gb_s(ispin)%r_coef = 0.0_dp
650 ALLOCATE (basis_set_list(nkind))
651 ALLOCATE (paw_kind(nkind), nsatbas_kind(nkind), has_intac(nkind*nkind))
652 paw_kind(:) = .false.
654 has_intac(:) = .false.
656 CALL get_qs_kind(qs_kind_set(ikind), basis_set=basis_set_a)
657 IF (
ASSOCIATED(basis_set_a))
THEN
658 basis_set_list(ikind)%gto_basis_set => basis_set_a
660 NULLIFY (basis_set_list(ikind)%gto_basis_set)
662 CALL get_qs_kind(qs_kind_set(ikind), basis_set=basis_1c, basis_type=
"GAPW_1C", &
663 paw_atom=paw_kind(ikind))
666 DO ikind = 1, nkind*nkind
667 has_intac(ikind) =
ASSOCIATED(oce%intac(ikind)%alist)
670 len_pc1 = max(1, max_nsgf*max_gau)
671 w_alloc = max(1, l2_chunk_dp/nspins, len_pc1)
673 DO iac = 1, nkind*nkind
674 IF (.NOT. has_intac(iac)) cycle
675 DO i = 1,
SIZE(oce%intac(iac)%alist)
676 max_nclist = max(max_nclist, oce%intac(iac)%alist(i)%nclist)
680 cpassert(
ASSOCIATED(sab(1)%nlist_task))
681 nl_size = sab(1)%nl_size
682 ALLOCATE (ia_ptr(natom + 1), ia_work(natom), slot_order(max(1, nl_size)))
686 task => sab(1)%nlist_task(slot)
687 IF (.NOT.
ASSOCIATED(basis_set_list(task%ikind)%gto_basis_set)) cycle
688 IF (.NOT.
ASSOCIATED(basis_set_list(task%jkind)%gto_basis_set)) cycle
689 iatom = min(task%iatom, task%jatom)
690 IF (i == 2) slot_order(ia_work(iatom)) = slot
691 ia_work(iatom) = ia_work(iatom) + 1
695 max_nb = max(1, maxval(ia_work))
697 ia_ptr(iatom + 1) = ia_ptr(iatom) + ia_work(iatom)
698 ia_work(iatom) = ia_ptr(iatom)
713 ALLOCATE (nb_pblk(nspins, max_nb), nb_pmax(max_nb), w_buf(w_alloc, nspins), w_offset(max_nclist))
714 ALLOCATE (p_matrix(max(1, max_nsgf), max(1, max_nsgf)), proj_work1(len_pc1), &
715 proj_work2(max(1, max_gau), max(1, max_gau)), w_touched(max_nclist, nspins))
731 n_nb = ia_ptr(iatom + 1) - ia_ptr(iatom)
733 task => sab(1)%nlist_task(slot_order(ia_ptr(iatom)))
734 ikind = merge(task%jkind, task%ikind, task%iatom > task%jatom)
737 task => sab(1)%nlist_task(slot_order(ia_ptr(iatom) + inb - 1))
738 jatom = max(task%iatom, task%jatom)
740 IF (nimages > 1) img = cell_to_index(task%cell(1), task%cell(2), task%cell(3))
745 nb_pblk(ispin, inb)%r_coef, found)
747 pmax = pmax + maxval(abs(nb_pblk(ispin, inb)%r_coef))
753 IF (.NOT. paw_kind(kkind)) cycle
754 nsoctot = nsatbas_kind(kkind)
755 iac = ikind + nkind*(kkind - 1)
756 IF (.NOT. has_intac(iac)) cycle
757 CALL get_alist(oce%intac(iac), alist_ac, iatom)
758 IF (.NOT.
ASSOCIATED(alist_ac)) cycle
761 DO WHILE (kac_lo <= alist_ac%nclist)
763 DO kac = kac_lo, alist_ac%nclist
764 n_cont_a = alist_ac%clist(kac)%nsgf_cnt
765 IF (n_cont_a == 0) cycle
766 IF (w_total > 0 .AND. w_total + n_cont_a*nsoctot > w_alloc)
EXIT
767 w_offset(kac) = w_total + 1
768 w_total = w_total + n_cont_a*nsoctot
772 IF (w_total > 0)
THEN
773 w_touched(kac_lo:kac_hi, 1:nspins) = .false.
776 IF (pmax <= 0.0_dp) cycle
777 task => sab(1)%nlist_task(slot_order(ia_ptr(iatom) + inb - 1))
778 jkind = merge(task%ikind, task%jkind, task%iatom > task%jatom)
779 jatom = max(task%iatom, task%jatom)
780 cell_b = merge(-task%cell, task%cell, task%iatom > task%jatom)
781 ibc = jkind + nkind*(kkind - 1)
782 IF (.NOT. has_intac(ibc)) cycle
783 CALL get_alist(oce%intac(ibc), alist_bc, jatom)
784 IF (.NOT.
ASSOCIATED(alist_bc)) cycle
785 factor = merge(0.5_dp, 1.0_dp, iatom == jatom)
787 DO kbc = 1, alist_bc%nclist
788 clist_b => alist_bc%clist(kbc)
789 n_cont_b = clist_b%nsgf_cnt
790 IF (n_cont_b == 0) cycle
791 katom = clist_b%catom
792 DO kac = kac_lo, kac_hi
793 IF (alist_ac%clist(kac)%catom /= katom) cycle
794 IF (all(cell_b + clist_b%cell == alist_ac%clist(kac)%cell))
EXIT
796 IF (kac > kac_hi) cycle
797 clist_a => alist_ac%clist(kac)
798 n_cont_a = clist_a%nsgf_cnt
799 IF (n_cont_a == 0 .OR. pmax*clist_b%maxac*clist_a%maxac < eps_cpc) cycle
801 list_a => clist_a%sgf_list
802 list_b => clist_b%sgf_list
803 dista = (iatom /= katom .OR. any(clist_a%cell /= 0))
804 distb = (jatom /= katom .OR. any(clist_b%cell /= 0))
805 c_coeff_ss_b => clist_b%acint(:, :, 1)
806 IF (.NOT. distb)
THEN
807 c_coeff_ss_a => clist_a%acint(:, :, 1)
808 c_coeff_hh_a => c_coeff_ss_a
809 IF (.NOT. dista) c_coeff_hh_a => clist_a%achint(:, :, 1)
810 c_coeff_hh_b => clist_b%achint(:, :, 1)
815 SIZE(nb_pblk(ispin, inb)%r_coef, 1), p_matrix,
SIZE(p_matrix, 1), &
816 list_a, n_cont_a, list_b, n_cont_b)
818 beta = merge(1.0_dp, 0.0_dp, w_touched(kac, ispin))
819 w_touched(kac, ispin) = .true.
820 CALL dgemm(
'N',
'N', n_cont_a, nsoctot, n_cont_b, factor, p_matrix,
SIZE(p_matrix, 1), &
821 c_coeff_ss_b, n_cont_b, beta, w_buf(w_offset(kac):, ispin), n_cont_a)
824 r_coef_h => rho_atom_set(katom)%cpc_h(ispin)%r_coef
825 r_coef_s => rho_atom_set(katom)%cpc_s(ispin)%r_coef
827 CALL proj_blk(c_coeff_hh_a, c_coeff_ss_a, n_cont_a, c_coeff_hh_b, c_coeff_ss_b, n_cont_b, &
828 p_matrix,
SIZE(p_matrix, 1), r_coef_h, r_coef_s, nsoctot, len_pc1, &
829 SIZE(proj_work2), factor, .false., proj_work1, proj_work2)
835 DO kac = kac_lo, kac_hi
836 clist_a => alist_ac%clist(kac)
837 n_cont_a = clist_a%nsgf_cnt
838 IF (n_cont_a == 0) cycle
839 katom = clist_a%catom
840 dista = (iatom /= katom .OR. any(clist_a%cell /= 0))
841 c_coeff_ss_a => clist_a%acint(:, :, 1)
843 IF (.NOT. w_touched(kac, ispin)) cycle
844 r_coef_h => rho_atom_set(katom)%cpc_h(ispin)%r_coef
845 r_coef_s => rho_atom_set(katom)%cpc_s(ispin)%r_coef
846 CALL dgemm(
'T',
'N', nsoctot, nsoctot, n_cont_a, 1.0_dp, c_coeff_ss_a, n_cont_a, &
847 w_buf(w_offset(kac):, ispin), n_cont_a, 0.0_dp, proj_work2,
SIZE(proj_work2, 1))
849 r_coef_s = r_coef_s + proj_work2(1:nsoctot, 1:nsoctot)
850 IF (dista) r_coef_h = r_coef_h + proj_work2(1:nsoctot, 1:nsoctot)
851 IF (.NOT. dista)
CALL dgemm(
'T',
'N', nsoctot, nsoctot, n_cont_a, 1.0_dp, &
852 clist_a%achint(:, :, 1), n_cont_a, w_buf(w_offset(kac):, ispin), &
853 n_cont_a, 1.0_dp, r_coef_h,
SIZE(r_coef_h, 1))
875 DEALLOCATE (nb_pblk, nb_pmax, p_matrix, proj_work1, proj_work2, w_buf, w_offset, w_touched)
878 DEALLOCATE (ia_ptr, slot_order)
879 CALL reduce_symmetrize_cpc(rho_atom_set, natom, nspins, max_gau, para_env)
881 DEALLOCATE (basis_set_list, paw_kind, nsatbas_kind, has_intac)
883 CALL timestop(handle)
897 SUBROUTINE init_rho_atom(rho_atom_set, atomic_kind_set, qs_kind_set, dft_control, para_env)
901 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
905 CHARACTER(len=*),
PARAMETER :: routinen =
'init_rho_atom'
907 CHARACTER(LEN=4) :: my_ikind, my_la, my_llmax
908 INTEGER :: handle, ikind, la, ll, llmax, &
909 lmax_sphere, max_s_harm, max_s_set, &
910 maxl, maxlgto, maxs, na, nat, natom, &
911 nr, nspins, quadrature
912 INTEGER,
DIMENSION(:),
POINTER :: atom_list
914 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: my_cg
920 CALL timeset(routinen, handle)
922 NULLIFY (basis_1c_set)
923 NULLIFY (my_cg, grid_atom, harmonics, atom_list)
925 cpassert(
ASSOCIATED(atomic_kind_set))
926 cpassert(
ASSOCIATED(dft_control))
927 cpassert(
ASSOCIATED(para_env))
928 cpassert(
ASSOCIATED(qs_kind_set))
932 CALL get_qs_kind_set(qs_kind_set, maxlgto=maxlgto, basis_type=
"GAPW_1C")
934 nspins = dft_control%nspins
935 gapw_control => dft_control%qs_control%gapw_control
937 lmax_sphere = gapw_control%lmax_sphere
939 llmax = min(lmax_sphere, 2*maxlgto)
940 max_s_harm =
nsoset(llmax)
941 max_s_set =
nsoset(maxlgto)
948 quadrature = gapw_control%quadrature
950 DO ikind = 1,
SIZE(atomic_kind_set)
951 CALL get_atomic_kind(atomic_kind_set(ikind), atom_list=atom_list, natom=nat)
954 grid_atom=grid_atom, &
955 harmonics=harmonics, &
956 ngrid_rad=nr, ngrid_ang=na)
963 grid_atom%ng_sphere = na
967 IF (para_env%is_source())
THEN
968 WRITE (my_la,
"(I4)") la
969 WRITE (my_ikind,
"(I4)") ikind
970 WRITE (my_llmax,
"(I4)") llmax
971 CALL cp_warn(__location__, &
972 "The Lebedev grid has been built for angular momentum l up "// &
973 "to "//trim(my_la)//
" for atom kind "//trim(my_ikind)//
", "// &
974 "but the max l of spherical harmonics "//trim(my_llmax)//
" is "// &
975 "larger and good integration cannot be guaranteed")
984 CALL get_qs_kind(qs_kind_set(ikind), basis_set=basis_1c_set, basis_type=
"GAPW_1C")
988 my_cg, na, llmax, maxs, max_s_harm, ll, grid_atom%wa, &
989 grid_atom%azi, grid_atom%pol)
990 CALL get_maxl_cg(harmonics, basis_1c_set, llmax, max_s_harm)
999 CALL timestop(handle)
1015 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1019 CHARACTER(len=*),
PARAMETER :: routinen =
'allocate_rho_atom_internals'
1021 INTEGER :: bo(2), handle, iat, iatom, ikind, ispin, &
1022 max_iso_not0, maxso, mepos, nat, &
1023 natom, nsatbas, nset, nsotot, nspins, &
1025 INTEGER,
DIMENSION(:),
POINTER :: atom_list
1030 CALL timeset(routinen, handle)
1032 cpassert(
ASSOCIATED(atomic_kind_set))
1033 cpassert(
ASSOCIATED(dft_control))
1034 cpassert(
ASSOCIATED(para_env))
1035 cpassert(
ASSOCIATED(qs_kind_set))
1039 nspins = dft_control%nspins
1041 IF (
ASSOCIATED(rho_atom_set))
THEN
1044 ALLOCATE (rho_atom_set(natom))
1046 DO ikind = 1,
SIZE(atomic_kind_set)
1048 NULLIFY (atom_list, harmonics)
1049 CALL get_atomic_kind(atomic_kind_set(ikind), atom_list=atom_list, natom=nat)
1051 paw_atom=paw_atom, &
1052 harmonics=harmonics)
1055 CALL get_qs_kind(qs_kind_set(ikind), basis_set=basis_1c, basis_type=
"GAPW_1C")
1061 max_iso_not0 = harmonics%max_iso_not0
1063 iatom = atom_list(iat)
1066 ALLOCATE (rho_atom_set(iatom)%rho_rad_h(nspins))
1067 ALLOCATE (rho_atom_set(iatom)%rho_rad_s(nspins))
1068 ALLOCATE (rho_atom_set(iatom)%vrho_rad_h(nspins))
1069 ALLOCATE (rho_atom_set(iatom)%vrho_rad_s(nspins))
1071 ALLOCATE (rho_atom_set(iatom)%cpc_h(nspins), &
1072 rho_atom_set(iatom)%cpc_s(nspins), &
1073 rho_atom_set(iatom)%drho_rad_h(nspins), &
1074 rho_atom_set(iatom)%drho_rad_s(nspins), &
1075 rho_atom_set(iatom)%rho_rad_h_d(3, nspins), &
1076 rho_atom_set(iatom)%rho_rad_s_d(3, nspins))
1077 ALLOCATE (rho_atom_set(iatom)%int_scr_h(nspins), &
1078 rho_atom_set(iatom)%int_scr_s(nspins))
1081 DO ispin = 1, nspins
1082 ALLOCATE (rho_atom_set(iatom)%cpc_h(ispin)%r_coef(1:nsatbas, 1:nsatbas), &
1083 rho_atom_set(iatom)%cpc_s(ispin)%r_coef(1:nsatbas, 1:nsatbas))
1084 ALLOCATE (rho_atom_set(iatom)%int_scr_h(ispin)%r_coef(1:nsatbas, 1:nsatbas), &
1085 rho_atom_set(iatom)%int_scr_s(ispin)%r_coef(1:nsatbas, 1:nsatbas))
1087 rho_atom_set(iatom)%cpc_h(ispin)%r_coef = 0.0_dp
1088 rho_atom_set(iatom)%cpc_s(ispin)%r_coef = 0.0_dp
1094 num_pe = para_env%num_pe
1095 mepos = para_env%mepos
1097 DO iat = bo(1), bo(2)
1098 iatom = atom_list(iat)
1099 ALLOCATE (rho_atom_set(iatom)%ga_Vlocal_gb_h(nspins), &
1100 rho_atom_set(iatom)%ga_Vlocal_gb_s(nspins))
1102 DO ispin = 1, nspins
1103 CALL reallocate(rho_atom_set(iatom)%ga_Vlocal_gb_h(ispin)%r_coef, &
1104 1, nsotot, 1, nsotot)
1105 CALL reallocate(rho_atom_set(iatom)%ga_Vlocal_gb_s(ispin)%r_coef, &
1106 1, nsotot, 1, nsotot)
1108 rho_atom_set(iatom)%ga_Vlocal_gb_h(ispin)%r_coef = 0.0_dp
1109 rho_atom_set(iatom)%ga_Vlocal_gb_s(ispin)%r_coef = 0.0_dp
1117 CALL timestop(handle)
1129 SUBROUTINE allocate_rho_atom_rad(rho_atom_set, iatom, ispin, nr, max_iso_not0)
1132 INTEGER,
INTENT(IN) :: iatom, ispin, nr, max_iso_not0
1134 CHARACTER(len=*),
PARAMETER :: routinen =
'allocate_rho_atom_rad'
1136 INTEGER :: handle, j
1138 CALL timeset(routinen, handle)
1140 ALLOCATE (rho_atom_set(iatom)%rho_rad_h(ispin)%r_coef(1:nr, 1:max_iso_not0), &
1141 rho_atom_set(iatom)%rho_rad_s(ispin)%r_coef(1:nr, 1:max_iso_not0), &
1142 rho_atom_set(iatom)%vrho_rad_h(ispin)%r_coef(1:nr, 1:max_iso_not0), &
1143 rho_atom_set(iatom)%vrho_rad_s(ispin)%r_coef(1:nr, 1:max_iso_not0))
1145 rho_atom_set(iatom)%rho_rad_h(ispin)%r_coef = 0.0_dp
1146 rho_atom_set(iatom)%rho_rad_s(ispin)%r_coef = 0.0_dp
1147 rho_atom_set(iatom)%vrho_rad_h(ispin)%r_coef = 0.0_dp
1148 rho_atom_set(iatom)%vrho_rad_s(ispin)%r_coef = 0.0_dp
1150 ALLOCATE (rho_atom_set(iatom)%drho_rad_h(ispin)%r_coef(nr, max_iso_not0), &
1151 rho_atom_set(iatom)%drho_rad_s(ispin)%r_coef(nr, max_iso_not0))
1152 rho_atom_set(iatom)%drho_rad_h(ispin)%r_coef = 0.0_dp
1153 rho_atom_set(iatom)%drho_rad_s(ispin)%r_coef = 0.0_dp
1156 ALLOCATE (rho_atom_set(iatom)%rho_rad_h_d(j, ispin)%r_coef(nr, max_iso_not0), &
1157 rho_atom_set(iatom)%rho_rad_s_d(j, ispin)%r_coef(nr, max_iso_not0))
1158 rho_atom_set(iatom)%rho_rad_h_d(j, ispin)%r_coef = 0.0_dp
1159 rho_atom_set(iatom)%rho_rad_s_d(j, ispin)%r_coef = 0.0_dp
1162 CALL timestop(handle)
1164 END SUBROUTINE allocate_rho_atom_rad
1172 SUBROUTINE set2zero_rho_atom_rad(rho_atom_set, iatom, ispin)
1175 INTEGER,
INTENT(IN) :: iatom, ispin
1179 rho_atom_set(iatom)%rho_rad_h(ispin)%r_coef = 0.0_dp
1180 rho_atom_set(iatom)%rho_rad_s(ispin)%r_coef = 0.0_dp
1182 rho_atom_set(iatom)%vrho_rad_h(ispin)%r_coef = 0.0_dp
1183 rho_atom_set(iatom)%vrho_rad_s(ispin)%r_coef = 0.0_dp
1185 rho_atom_set(iatom)%drho_rad_h(ispin)%r_coef = 0.0_dp
1186 rho_atom_set(iatom)%drho_rad_s(ispin)%r_coef = 0.0_dp
1189 rho_atom_set(iatom)%rho_rad_h_d(j, ispin)%r_coef = 0.0_dp
1190 rho_atom_set(iatom)%rho_rad_s_d(j, ispin)%r_coef = 0.0_dp
1193 END SUBROUTINE set2zero_rho_atom_rad
1203 SUBROUTINE reduce_symmetrize_cpc(rho_atom_set, natom, nspins, max_gau, para_env)
1205 INTEGER,
INTENT(IN) :: natom, nspins, max_gau
1208 INTEGER :: b_end, b_lo, iat, ispin, jj, m1, n, off, &
1210 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: buf
1211 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: r_h, r_s
1213 ALLOCATE (buf(max(l2_chunk_dp, nspins*max_gau*(max_gau + 1))))
1215 DO WHILE (b_lo <= natom)
1219 DO iat = b_lo, b_end
1220 IF (.NOT.
ASSOCIATED(rho_atom_set(iat)%cpc_h(1)%r_coef)) cycle
1221 m1 =
SIZE(rho_atom_set(iat)%cpc_h(1)%r_coef, 1)
1222 IF (p == 1 .AND. off > 0 .AND. off + nspins*m1*(m1 + 1) >
SIZE(buf))
EXIT
1223 DO ispin = 1, nspins
1224 r_h => rho_atom_set(iat)%cpc_h(ispin)%r_coef
1225 r_s => rho_atom_set(iat)%cpc_s(ispin)%r_coef
1228 IF (p == 1) buf(off + 1:off + n) = r_h(jj:m1, jj) + r_h(jj, jj:m1)
1229 IF (p == 1) buf(off + n + 1:off + 2*n) = r_s(jj:m1, jj) + r_s(jj, jj:m1)
1230 IF (p == 2) r_h(jj:m1, jj) = buf(off + 1:off + n)
1231 IF (p == 2) r_h(jj, jj:m1) = buf(off + 1:off + n)
1232 IF (p == 2) r_s(jj:m1, jj) = buf(off + n + 1:off + 2*n)
1233 IF (p == 2) r_s(jj, jj:m1) = buf(off + n + 1:off + 2*n)
1239 IF (p == 1 .AND. off > 0)
CALL para_env%sum(buf(1:off))
1244 END SUBROUTINE reduce_symmetrize_cpc
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_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
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, ccon)
...
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_get_block_p(matrix, row, col, block, found, row_size, col_size)
...
Expansion of the product of two real spherical harmonics in real spherical harmonics.
subroutine, public real_gaunt_coefficients(my_cg, maxl1, maxl2, llmax, cg_none0_list, ncg_none0)
Calculate the expansion of the product of two real spherical harmonics in real spherical harmonics,...
Defines the basic variable types.
integer, parameter, public dp
Types and basic routines needed for a kpoint calculation.
subroutine, public get_kpoint_info(kpoint, kp_scheme, nkp_grid, kp_shift, symmetry, verbose, full_grid, use_real_wfn, eps_geo, parallel_group_size, kp_range, nkp, xkp, wkp, para_env, blacs_env_all, para_env_kp, para_env_inter_kp, blacs_env, kp_env, kp_aux_env, mpools, iogrp, nkp_groups, kp_dist, cell_to_index, index_to_cell, sab_nl, sab_nl_nosym, inversion_symmetry_only, symmetry_backend, symmetry_reduction_method, gamma_centered, lattice_fft)
Retrieve information from a kpoint environment.
Generation of the spherical Lebedev grids. All Lebedev grids were generated with a precision of at le...
subroutine, public deallocate_lebedev_grids()
...
type(oh_grid), dimension(nlg), target, public lebedev_grid
integer function, public get_number_of_lebedev_grid(l, n)
Get the number of the Lebedev grid, which has the requested angular momentum quantnum number l or siz...
subroutine, public init_lebedev_grids()
Load the coordinates and weights of the nonredundant Lebedev grid points.
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
real(kind=dp), parameter, public fourpi
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, 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.
subroutine, public create_grid_atom(grid_atom, nr, na, llmax, ll, quadrature)
...
subroutine, public get_maxl_cg(harmonics, orb_basis, llmax, max_s_harm)
...
subroutine, public create_harmonics_atom(harmonics, my_cg, na, llmax, maxs, max_s_harm, ll, wa, azi, pol)
...
Define the quickstep kind type and their sub types.
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_qs_kind_set(qs_kind_set, all_potential_present, tnadd_potential_present, gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, basis_rcut, do_mtlr_present, basis_type, total_zeff_corr, npgf_seg, cneo_potential_present, nkind_q, natom_q)
Get attributes of an atomic kind set.
Define the neighbor list data types and the corresponding functionality.
Routines for the construction of the coefficients for the expansion of the atomic densities rho1_hard...
subroutine, public proj_blk(h_a, s_a, na, h_b, s_b, nb, blk, ldb, proj_h, proj_s, nso, len1, len2, fac, distab, work1, work2)
Project a matrix block onto the local atomic functions.
subroutine, public calculate_rho_atom(para_env, rho_atom_set, qs_kind, atom_list, natom, nspins, tot_rho1_h, tot_rho1_s, rho1_h_spin, rho1_s_spin, rho1_h_aspin, rho1_s_aspin)
...
subroutine, public allocate_rho_atom_internals(rho_atom_set, atomic_kind_set, qs_kind_set, dft_control, para_env)
...
subroutine, public replicate_rho_atom_radial(para_env, rho_atom_set, qs_kind, atom_list, natom, nspins)
Replicate the radial hard/soft density data needed to evaluate one-center tails on rank-local target ...
subroutine, public init_rho_atom(rho_atom_set, atomic_kind_set, qs_kind_set, dft_control, para_env)
...
subroutine, public calculate_rho_atom_coeff(qs_env, rho_ao, rho_atom_set, qs_kind_set, oce, sab, para_env)
...
subroutine, public deallocate_rho_atom_set(rho_atom_set)
...
General overlap type integrals containers.
subroutine, public alist_pre_align_blk(blk_in, ldin, blk_out, ldout, ilist, in, jlist, jn)
...
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
Calculates special integrals.
subroutine, public whittaker_c0a(wc, r, expa, erfa, alpha, l1, l2, n)
int(y^(2+l1+l2) * exp(-alpha*y*y),y=0..x) / x^(l2+1); wc(:) :: output r(:) :: coordinate expa(:) :: e...
subroutine, public whittaker_ci(wc, r, expa, alpha, l, n)
int(y^(l+1) * exp(-alpha*y*y),y=x..infinity);
Provides all information about an atomic kind.
Contains information about kpoints.
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.