115 SUBROUTINE mixing_allocate(qs_env, mixing_method, p_mix_new, p_delta, nspins, mixing_store)
117 INTEGER :: mixing_method
119 POINTER :: p_mix_new, p_delta
120 INTEGER,
INTENT(IN) :: nspins
123 CHARACTER(LEN=*),
PARAMETER :: routinen =
'mixing_allocate'
125 INTEGER :: handle, i, ia, iat, ic, ikind, ispin, &
126 max_shell, na, natom, nbuffer, nel, &
128 LOGICAL :: charge_mixing
129 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s
137 CALL timeset(routinen, handle)
139 NULLIFY (matrix_s, dft_control, sab_orb, refmatrix, rho_atom)
142 matrix_s_kp=matrix_s, &
143 dft_control=dft_control)
145 charge_mixing = dft_control%qs_control%dftb .OR. dft_control%qs_control%xtb &
146 .OR. dft_control%qs_control%semi_empirical
147 refmatrix => matrix_s(1, 1)%matrix
148 nimg = dft_control%nimages
151 IF (
PRESENT(p_mix_new))
THEN
152 IF (.NOT.
ASSOCIATED(p_mix_new))
THEN
156 ALLOCATE (p_mix_new(i, ic)%matrix)
157 CALL dbcsr_create(matrix=p_mix_new(i, ic)%matrix, template=refmatrix, &
158 name=
"SCF DENSITY", matrix_type=dbcsr_type_symmetric)
160 CALL dbcsr_set(p_mix_new(i, ic)%matrix, 0.0_dp)
167 IF (
PRESENT(p_delta))
THEN
169 IF (.NOT.
ASSOCIATED(p_delta))
THEN
173 ALLOCATE (p_delta(i, ic)%matrix)
174 CALL dbcsr_create(matrix=p_delta(i, ic)%matrix, template=refmatrix, &
175 name=
"SCF DENSITY", matrix_type=dbcsr_type_symmetric)
177 CALL dbcsr_set(p_delta(i, ic)%matrix, 0.0_dp)
181 cpassert(
ASSOCIATED(mixing_store))
185 IF (charge_mixing)
THEN
188 cpassert(.NOT. mixing_store%gmix_p)
189 IF (dft_control%qs_control%dftb)
THEN
190 max_shell = max_dftb_scc_vars
191 ELSEIF (dft_control%qs_control%xtb)
THEN
192 max_shell = max_xtb_scc_vars
194 cpabort(
'UNKNOWN METHOD')
196 nbuffer = mixing_store%nbuffer
197 mixing_store%ncall = 0
198 CALL get_qs_env(qs_env, local_particles=distribution_1d)
199 nkind =
SIZE(distribution_1d%n_el)
200 na = sum(distribution_1d%n_el(:))
201 IF (
ASSOCIATED(mixing_store%atlist))
DEALLOCATE (mixing_store%atlist)
202 ALLOCATE (mixing_store%atlist(na))
203 mixing_store%nat_local = na
204 mixing_store%max_shell = max_shell
207 nel = distribution_1d%n_el(ikind)
210 mixing_store%atlist(ia) = distribution_1d%list(ikind)%array(iat)
213 IF (
ASSOCIATED(mixing_store%acharge))
DEALLOCATE (mixing_store%acharge)
214 ALLOCATE (mixing_store%acharge(na, max_shell, nbuffer))
215 IF (
ASSOCIATED(mixing_store%dacharge))
DEALLOCATE (mixing_store%dacharge)
216 ALLOCATE (mixing_store%dacharge(na, max_shell, nbuffer))
219 IF (
ASSOCIATED(mixing_store%pulay_matrix))
DEALLOCATE (mixing_store%pulay_matrix)
220 ALLOCATE (mixing_store%pulay_matrix(nbuffer, nbuffer, nspins))
221 mixing_store%pulay_matrix = 0.0_dp
223 IF (
ASSOCIATED(mixing_store%abroy))
DEALLOCATE (mixing_store%abroy)
224 ALLOCATE (mixing_store%abroy(nbuffer, nbuffer))
225 mixing_store%abroy = 0.0_dp
226 IF (
ASSOCIATED(mixing_store%wbroy))
DEALLOCATE (mixing_store%wbroy)
227 ALLOCATE (mixing_store%wbroy(nbuffer))
228 mixing_store%wbroy = 0.0_dp
229 IF (
ASSOCIATED(mixing_store%dfbroy))
DEALLOCATE (mixing_store%dfbroy)
230 ALLOCATE (mixing_store%dfbroy(na, max_shell, nbuffer))
231 mixing_store%dfbroy = 0.0_dp
232 IF (
ASSOCIATED(mixing_store%ubroy))
DEALLOCATE (mixing_store%ubroy)
233 ALLOCATE (mixing_store%ubroy(na, max_shell, nbuffer))
234 mixing_store%ubroy = 0.0_dp
236 cpabort(
"multisecant_mixing not available")
241 nbuffer = mixing_store%nbuffer
242 mixing_store%ncall = 0
243 IF (.NOT.
ASSOCIATED(mixing_store%rhoin))
THEN
244 ALLOCATE (mixing_store%rhoin(nspins))
246 NULLIFY (mixing_store%rhoin(ispin)%cc)
250 IF (mixing_store%gmix_p .AND. dft_control%qs_control%gapw)
THEN
251 CALL get_qs_env(qs_env=qs_env, rho_atom_set=rho_atom)
252 natom =
SIZE(rho_atom)
253 IF (.NOT.
ASSOCIATED(mixing_store%paw))
THEN
254 ALLOCATE (mixing_store%paw(natom))
255 mixing_store%paw = .false.
256 ALLOCATE (mixing_store%cpc_h_in(natom, nspins))
257 ALLOCATE (mixing_store%cpc_s_in(natom, nspins))
260 NULLIFY (mixing_store%cpc_h_in(iat, ispin)%r_coef)
261 NULLIFY (mixing_store%cpc_s_in(iat, ispin)%r_coef)
270 IF (.NOT.
ASSOCIATED(mixing_store%res_buffer))
THEN
271 ALLOCATE (mixing_store%res_buffer(nbuffer, nspins))
274 NULLIFY (mixing_store%res_buffer(i, ispin)%cc)
282 IF (.NOT.
ASSOCIATED(mixing_store%pulay_matrix))
THEN
283 ALLOCATE (mixing_store%pulay_matrix(nbuffer, nbuffer, nspins))
286 IF (.NOT.
ASSOCIATED(mixing_store%rhoin_buffer))
THEN
287 ALLOCATE (mixing_store%rhoin_buffer(nbuffer, nspins))
290 NULLIFY (mixing_store%rhoin_buffer(i, ispin)%cc)
294 IF (mixing_store%gmix_p)
THEN
295 IF (dft_control%qs_control%gapw)
THEN
296 IF (.NOT.
ASSOCIATED(mixing_store%cpc_h_in_buffer))
THEN
297 ALLOCATE (mixing_store%cpc_h_in_buffer(nbuffer, natom, nspins))
298 ALLOCATE (mixing_store%cpc_s_in_buffer(nbuffer, natom, nspins))
299 ALLOCATE (mixing_store%cpc_h_res_buffer(nbuffer, natom, nspins))
300 ALLOCATE (mixing_store%cpc_s_res_buffer(nbuffer, natom, nspins))
304 NULLIFY (mixing_store%cpc_h_in_buffer(i, iat, ispin)%r_coef)
305 NULLIFY (mixing_store%cpc_s_in_buffer(i, iat, ispin)%r_coef)
306 NULLIFY (mixing_store%cpc_h_res_buffer(i, iat, ispin)%r_coef)
307 NULLIFY (mixing_store%cpc_s_res_buffer(i, iat, ispin)%r_coef)
318 IF (.NOT.
ASSOCIATED(mixing_store%rhoin_old))
THEN
319 ALLOCATE (mixing_store%rhoin_old(nspins))
321 NULLIFY (mixing_store%rhoin_old(ispin)%cc)
324 IF (.NOT.
ASSOCIATED(mixing_store%drho_buffer))
THEN
325 ALLOCATE (mixing_store%drho_buffer(nbuffer, nspins))
326 ALLOCATE (mixing_store%last_res(nspins))
329 NULLIFY (mixing_store%drho_buffer(i, ispin)%cc)
331 NULLIFY (mixing_store%last_res(ispin)%cc)
335 IF (.NOT.
ASSOCIATED(mixing_store%weight))
THEN
336 ALLOCATE (mixing_store%weight(nbuffer, nspins))
338 mixing_store%weight = 0.0_dp
340 IF (mixing_store%gmix_p)
THEN
342 IF (dft_control%qs_control%gapw)
THEN
343 IF (.NOT.
ASSOCIATED(mixing_store%cpc_h_old))
THEN
344 ALLOCATE (mixing_store%cpc_h_old(natom, nspins))
345 ALLOCATE (mixing_store%cpc_s_old(natom, nspins))
348 NULLIFY (mixing_store%cpc_h_old(iat, ispin)%r_coef)
349 NULLIFY (mixing_store%cpc_s_old(iat, ispin)%r_coef)
353 IF (.NOT.
ASSOCIATED(mixing_store%dcpc_h_in))
THEN
354 ALLOCATE (mixing_store%dcpc_h_in(nbuffer, natom, nspins))
355 ALLOCATE (mixing_store%dcpc_s_in(nbuffer, natom, nspins))
356 ALLOCATE (mixing_store%cpc_h_lastres(natom, nspins))
357 ALLOCATE (mixing_store%cpc_s_lastres(natom, nspins))
361 NULLIFY (mixing_store%dcpc_h_in(i, iat, ispin)%r_coef)
362 NULLIFY (mixing_store%dcpc_s_in(i, iat, ispin)%r_coef)
364 NULLIFY (mixing_store%cpc_h_lastres(iat, ispin)%r_coef)
365 NULLIFY (mixing_store%cpc_s_lastres(iat, ispin)%r_coef)
375 IF (.NOT.
ASSOCIATED(mixing_store%norm_res_buffer))
THEN
376 ALLOCATE (mixing_store%norm_res_buffer(nbuffer, nspins))
381 IF (.NOT.
ASSOCIATED(mixing_store%rhoin_buffer))
THEN
382 ALLOCATE (mixing_store%rhoin_buffer(nbuffer, nspins))
385 NULLIFY (mixing_store%rhoin_buffer(i, ispin)%cc)
393 CALL timestop(handle)
408 SUBROUTINE mixing_init(mixing_method, rho, mixing_store, para_env, rho_atom)
409 INTEGER,
INTENT(IN) :: mixing_method
416 CHARACTER(len=*),
PARAMETER :: routinen =
'mixing_init'
418 INTEGER :: handle, iat, ib, icoef1, icoef2, ig, ig1, ig_count, iproc, ispin, n1, n2, natom, &
419 nbuffer, ncoef_h1, ncoef_h2, ncoef_s1, ncoef_s2, ng, nimg, nspin
420 REAL(
dp) :: bconst, beta, cpc_h_tmp, cpc_s_tmp, &
421 fdamp, g2max, g2min, kmin, qk, qkappa, &
423 REAL(
dp),
DIMENSION(:),
POINTER :: g2
424 REAL(
dp),
DIMENSION(:, :),
POINTER :: g_vec
425 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp
428 CALL timeset(routinen, handle)
430 NULLIFY (g2, g_vec, rho_ao_kp, rho_g)
431 CALL qs_rho_get(rho, rho_ao_kp=rho_ao_kp, rho_g=rho_g)
434 ng =
SIZE(rho_g(1)%pw_grid%gsq, 1)
435 nimg =
SIZE(rho_ao_kp, 2)
436 mixing_store%ig_max = ng
437 g2 => rho_g(1)%pw_grid%gsq
438 g_vec => rho_g(1)%pw_grid%g
440 IF (mixing_store%max_gvec_exp > 0._dp)
THEN
442 IF (g2(ig) > mixing_store%max_g2)
THEN
443 mixing_store%ig_max = ig
449 IF (.NOT.
ASSOCIATED(mixing_store%kerker_factor))
THEN
450 ALLOCATE (mixing_store%kerker_factor(ng))
452 IF (.NOT.
ASSOCIATED(mixing_store%kerker_factor_mag))
THEN
453 ALLOCATE (mixing_store%kerker_factor_mag(ng))
455 IF (.NOT.
ASSOCIATED(mixing_store%special_metric))
THEN
456 ALLOCATE (mixing_store%special_metric(ng))
458 beta = mixing_store%beta
460 mixing_store%kerker_factor = 1.0_dp
461 mixing_store%kerker_factor_mag = 1.0_dp
462 mixing_store%special_metric = 1.0_dp
466 IF (rho_g(1)%pw_grid%have_g0) ig1 = 2
467 DO ig = ig1, mixing_store%ig_max
468 mixing_store%kerker_factor(ig) = max(g2(ig)/(g2(ig) + beta*beta), kmin)
469 IF (mixing_store%beta_mag > 1.0e-10_dp)
THEN
470 mixing_store%kerker_factor_mag(ig) = max(g2(ig)/(g2(ig) + mixing_store%beta_mag*mixing_store%beta_mag), kmin)
473 mixing_store%kerker_factor_mag(ig) = 1.0_dp
475 mixing_store%special_metric(ig) = &
476 1.0_dp + 50.0_dp/8.0_dp*( &
477 1.0_dp + cos(g_vec(1, ig)) + cos(g_vec(2, ig)) + cos(g_vec(3, ig)) + &
478 cos(g_vec(1, ig))*cos(g_vec(2, ig)) + &
479 cos(g_vec(2, ig))*cos(g_vec(3, ig)) + &
480 cos(g_vec(1, ig))*cos(g_vec(3, ig)) + &
481 cos(g_vec(1, ig))*cos(g_vec(2, ig))*cos(g_vec(3, ig)))
485 qkappa = mixing_store%qkappa
488 IF (rho_g(1)%pw_grid%have_g0) ig1 = 1
489 DO ig = ig1, mixing_store%ig_max
490 mixing_store%kerker_factor(ig) = (g2(ig) + qkappa*qkappa)/(g2(ig) + qkappa*qkappa + qk*qk)
491 mixing_store%special_metric(ig) = (g2(ig) + qkappa*qkappa + qm*qm)/(g2(ig) + qkappa*qkappa)
494 nbuffer = mixing_store%nbuffer
496 IF (.NOT.
ASSOCIATED(mixing_store%rhoin(ispin)%cc))
THEN
497 ALLOCATE (mixing_store%rhoin(ispin)%cc(ng))
499 mixing_store%rhoin(ispin)%cc = rho_g(ispin)%array
501 IF (
ASSOCIATED(mixing_store%rhoin_buffer))
THEN
502 IF (.NOT.
ASSOCIATED(mixing_store%rhoin_buffer(1, ispin)%cc))
THEN
504 ALLOCATE (mixing_store%rhoin_buffer(ib, ispin)%cc(ng))
507 mixing_store%rhoin_buffer(1, ispin)%cc(1:ng) = &
508 rho_g(ispin)%array(1:ng)
510 IF (
ASSOCIATED(mixing_store%res_buffer))
THEN
511 IF (.NOT.
ASSOCIATED(mixing_store%res_buffer(1, ispin)%cc))
THEN
513 ALLOCATE (mixing_store%res_buffer(ib, ispin)%cc(ng))
520 mixing_store%rhoin(1)%cc = rho_g(1)%array + rho_g(2)%array
521 mixing_store%rhoin(2)%cc = rho_g(1)%array - rho_g(2)%array
522 IF (
ASSOCIATED(mixing_store%rhoin_buffer))
THEN
523 mixing_store%rhoin_buffer(1, 1)%cc = rho_g(1)%array + rho_g(2)%array
524 mixing_store%rhoin_buffer(1, 2)%cc = rho_g(1)%array - rho_g(2)%array
528 IF (mixing_store%gmix_p)
THEN
529 IF (
PRESENT(rho_atom))
THEN
530 natom =
SIZE(rho_atom)
533 IF (
ASSOCIATED(rho_atom(iat)%cpc_s(ispin)%r_coef))
THEN
534 mixing_store%paw(iat) = .true.
535 n1 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 1)
536 n2 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 2)
537 IF (
ASSOCIATED(mixing_store%cpc_s_in))
THEN
538 IF (.NOT.
ASSOCIATED(mixing_store%cpc_s_in(iat, ispin)%r_coef))
THEN
539 ALLOCATE (mixing_store%cpc_s_in(iat, ispin)%r_coef(n1, n2))
540 ALLOCATE (mixing_store%cpc_h_in(iat, ispin)%r_coef(n1, n2))
542 mixing_store%cpc_h_in(iat, ispin)%r_coef = rho_atom(iat)%cpc_h(ispin)%r_coef
543 mixing_store%cpc_s_in(iat, ispin)%r_coef = rho_atom(iat)%cpc_s(ispin)%r_coef
548 IF (nspin == 2 .AND.
ASSOCIATED(mixing_store%cpc_s_in))
THEN
550 IF (mixing_store%paw(iat))
THEN
551 cpassert(
ASSOCIATED(mixing_store%cpc_h_in(iat, 1)%r_coef))
552 cpassert(
ASSOCIATED(mixing_store%cpc_h_in(iat, 2)%r_coef))
553 cpassert(
ASSOCIATED(mixing_store%cpc_s_in(iat, 1)%r_coef))
554 cpassert(
ASSOCIATED(mixing_store%cpc_s_in(iat, 2)%r_coef))
556 ncoef_h1 =
SIZE(mixing_store%cpc_h_in(iat, 1)%r_coef, 1)
557 ncoef_h2 =
SIZE(mixing_store%cpc_h_in(iat, 1)%r_coef, 2)
558 ncoef_s1 =
SIZE(mixing_store%cpc_s_in(iat, 1)%r_coef, 1)
559 ncoef_s2 =
SIZE(mixing_store%cpc_s_in(iat, 1)%r_coef, 2)
560 cpassert(ncoef_h1 ==
SIZE(mixing_store%cpc_h_in(iat, 2)%r_coef, 1))
561 cpassert(ncoef_h2 ==
SIZE(mixing_store%cpc_h_in(iat, 2)%r_coef, 2))
562 cpassert(ncoef_s1 ==
SIZE(mixing_store%cpc_s_in(iat, 2)%r_coef, 1))
563 cpassert(ncoef_s2 ==
SIZE(mixing_store%cpc_s_in(iat, 2)%r_coef, 2))
565 DO icoef2 = 1, ncoef_h2
566 DO icoef1 = 1, ncoef_h1
567 cpc_h_tmp = mixing_store%cpc_h_in(iat, 1)%r_coef(icoef1, icoef2)
568 mixing_store%cpc_h_in(iat, 1)%r_coef(icoef1, icoef2) = &
569 cpc_h_tmp + mixing_store%cpc_h_in(iat, 2)%r_coef(icoef1, icoef2)
570 mixing_store%cpc_h_in(iat, 2)%r_coef(icoef1, icoef2) = &
571 cpc_h_tmp - mixing_store%cpc_h_in(iat, 2)%r_coef(icoef1, icoef2)
575 DO icoef2 = 1, ncoef_s2
576 DO icoef1 = 1, ncoef_s1
577 cpc_s_tmp = mixing_store%cpc_s_in(iat, 1)%r_coef(icoef1, icoef2)
578 mixing_store%cpc_s_in(iat, 1)%r_coef(icoef1, icoef2) = &
579 cpc_s_tmp + mixing_store%cpc_s_in(iat, 2)%r_coef(icoef1, icoef2)
580 mixing_store%cpc_s_in(iat, 2)%r_coef(icoef1, icoef2) = &
581 cpc_s_tmp - mixing_store%cpc_s_in(iat, 2)%r_coef(icoef1, icoef2)
592 IF (mixing_store%gmix_p .AND.
PRESENT(rho_atom))
THEN
595 IF (mixing_store%paw(iat))
THEN
596 n1 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 1)
597 n2 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 2)
598 IF (.NOT.
ASSOCIATED(mixing_store%cpc_h_in_buffer(1, iat, ispin)%r_coef))
THEN
600 ALLOCATE (mixing_store%cpc_s_in_buffer(ib, iat, ispin)%r_coef(n1, n2))
601 ALLOCATE (mixing_store%cpc_h_in_buffer(ib, iat, ispin)%r_coef(n1, n2))
602 ALLOCATE (mixing_store%cpc_s_res_buffer(ib, iat, ispin)%r_coef(n1, n2))
603 ALLOCATE (mixing_store%cpc_h_res_buffer(ib, iat, ispin)%r_coef(n1, n2))
607 mixing_store%cpc_h_in_buffer(ib, iat, ispin)%r_coef = 0.0_dp
608 mixing_store%cpc_s_in_buffer(ib, iat, ispin)%r_coef = 0.0_dp
609 mixing_store%cpc_h_res_buffer(ib, iat, ispin)%r_coef = 0.0_dp
610 mixing_store%cpc_s_res_buffer(ib, iat, ispin)%r_coef = 0.0_dp
618 IF (.NOT.
ASSOCIATED(mixing_store%rhoin_old(ispin)%cc))
THEN
619 ALLOCATE (mixing_store%rhoin_old(ispin)%cc(ng))
621 IF (.NOT.
ASSOCIATED(mixing_store%drho_buffer(1, ispin)%cc))
THEN
623 ALLOCATE (mixing_store%drho_buffer(ib, ispin)%cc(ng))
625 ALLOCATE (mixing_store%last_res(ispin)%cc(ng))
628 mixing_store%drho_buffer(ib, ispin)%cc =
z_zero
630 mixing_store%last_res(ispin)%cc =
z_zero
631 mixing_store%rhoin_old(ispin)%cc =
z_zero
633 IF (mixing_store%gmix_p)
THEN
634 IF (
PRESENT(rho_atom))
THEN
637 IF (mixing_store%paw(iat))
THEN
638 n1 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 1)
639 n2 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 2)
640 IF (.NOT.
ASSOCIATED(mixing_store%cpc_s_old(iat, ispin)%r_coef))
THEN
641 ALLOCATE (mixing_store%cpc_s_old(iat, ispin)%r_coef(n1, n2))
642 ALLOCATE (mixing_store%cpc_h_old(iat, ispin)%r_coef(n1, n2))
644 mixing_store%cpc_h_old(iat, ispin)%r_coef = 0.0_dp
645 mixing_store%cpc_s_old(iat, ispin)%r_coef = 0.0_dp
646 IF (.NOT.
ASSOCIATED(mixing_store%dcpc_s_in(1, iat, ispin)%r_coef))
THEN
648 ALLOCATE (mixing_store%dcpc_h_in(ib, iat, ispin)%r_coef(n1, n2))
649 ALLOCATE (mixing_store%dcpc_s_in(ib, iat, ispin)%r_coef(n1, n2))
651 ALLOCATE (mixing_store%cpc_h_lastres(iat, ispin)%r_coef(n1, n2))
652 ALLOCATE (mixing_store%cpc_s_lastres(iat, ispin)%r_coef(n1, n2))
655 mixing_store%dcpc_h_in(ib, iat, ispin)%r_coef = 0.0_dp
656 mixing_store%dcpc_s_in(ib, iat, ispin)%r_coef = 0.0_dp
658 mixing_store%cpc_h_lastres(iat, ispin)%r_coef = 0.0_dp
659 mixing_store%cpc_s_lastres(iat, ispin)%r_coef = 0.0_dp
666 IF (.NOT.
ASSOCIATED(mixing_store%p_metric))
THEN
667 ALLOCATE (mixing_store%p_metric(ng))
668 bconst = mixing_store%bconst
671 IF (g2(ig) > 1.e-10_dp) g2min = min(g2min, g2(ig))
675 g2max = max(g2max, g2(ig))
677 CALL para_env%min(g2min)
678 CALL para_env%max(g2max)
682 fdamp = (bconst - 1.0_dp)*g2min*g2max/(g2max - g2min*bconst)
684 mixing_store%p_metric(ig) = (g2(ig) + fdamp)/max(g2(ig), 1.e-10_dp)
686 IF (rho_g(1)%pw_grid%have_g0) mixing_store%p_metric(1) = bconst
689 IF (.NOT.
ASSOCIATED(mixing_store%ig_global_index))
THEN
690 ALLOCATE (mixing_store%ig_global_index(ng))
692 mixing_store%ig_global_index = 0
694 DO iproc = 0, para_env%num_pe - 1
695 IF (para_env%mepos == iproc)
THEN
697 ig_count = ig_count + 1
698 mixing_store%ig_global_index(ig) = ig_count
701 CALL para_env%bcast(ig_count, iproc)
705 CALL timestop(handle)
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, 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.