229 do_hfxlr, do_exck, do_sf, qs_env, sub_env)
233 INTEGER,
INTENT(in) :: nstates
234 LOGICAL,
INTENT(in) :: do_hfx, do_admm, do_hfxlr, do_exck, do_sf
238 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_create_work_matrices'
240 INTEGER :: evecs_dim, handle, igroup, ispin, &
241 istate, nao, nao_aux, natom, ngroups, &
243 INTEGER,
DIMENSION(maxspins) :: nactive, nmo_occ, nmo_virt
250 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_s, matrix_s_aux_fit, rho_ia_ao, &
252 TYPE(
dbcsr_type),
POINTER :: dbcsr_template_hfx
258 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
260 CALL timeset(routinen, handle)
263 NULLIFY (work_matrices%shalf)
264 NULLIFY (work_matrices%ewald_env)
265 NULLIFY (work_matrices%ewald_pw)
266 NULLIFY (work_matrices%gamma_exchange)
267 NULLIFY (work_matrices%ctransformed)
268 NULLIFY (work_matrices%S_eigenvalues)
269 NULLIFY (work_matrices%S_eigenvectors)
270 NULLIFY (work_matrices%slambda)
273 NULLIFY (work_matrices%hartree_local)
274 NULLIFY (work_matrices%local_rho_set)
275 NULLIFY (work_matrices%local_rho_set_admm)
278 NULLIFY (work_matrices%rho_xc_struct_sub)
280 nspins =
SIZE(gs_mos)
286 CALL get_qs_env(qs_env, blacs_env=blacs_env, matrix_s=matrix_s)
290 nactive(ispin) = gs_mos(ispin)%nmo_active
291 nmo_occ(ispin) = gs_mos(ispin)%nmo_occ
292 nmo_virt(ispin) =
SIZE(gs_mos(ispin)%evals_virt)
297 cpassert(
ASSOCIATED(sub_env%admm_A))
298 CALL get_admm_env(qs_env%admm_env, matrix_s_aux_fit=matrix_s_aux_fit)
299 CALL dbcsr_get_info(matrix_s_aux_fit(1)%matrix, nfullrows_total=nao_aux)
303 ALLOCATE (work_matrices%fm_pool_ao_mo_active(nspins))
305 NULLIFY (work_matrices%fm_pool_ao_mo_active(ispin)%pool)
306 CALL cp_fm_struct_create(fm_struct, template_fmstruct=gs_mos(ispin)%mos_active%matrix_struct, context=blacs_env)
307 CALL fm_pool_create(work_matrices%fm_pool_ao_mo_active(ispin)%pool, fm_struct)
311 ALLOCATE (work_matrices%S_C0_C0T(nspins))
314 CALL cp_fm_create(work_matrices%S_C0_C0T(ispin), fm_struct)
318 ALLOCATE (work_matrices%S_C0(nspins))
320 CALL cp_fm_struct_create(fm_struct, template_fmstruct=gs_mos(ispin)%mos_occ%matrix_struct, context=blacs_env)
323 ncol=nmo_occ(ispin), alpha=1.0_dp, beta=0.0_dp)
324 CALL parallel_gemm(
'N',
'T', nao, nao, nmo_occ(ispin), 1.0_dp, work_matrices%S_C0(ispin), &
325 gs_mos(ispin)%mos_occ, 0.0_dp, work_matrices%S_C0_C0T(ispin))
329 IF (sub_env%is_split)
THEN
330 DO ispin = 1, evecs_dim
331 CALL cp_fm_struct_create(fm_struct_evects(ispin)%struct, template_fmstruct=gs_mos(ispin)%mos_active%matrix_struct, &
332 context=sub_env%blacs_env)
335 ALLOCATE (work_matrices%evects_sub(evecs_dim, nstates), work_matrices%Aop_evects_sub(evecs_dim, nstates))
337 CALL blacs_env%get(para_env=para_env)
338 igroup = sub_env%group_distribution(para_env%mepos)
339 ngroups = sub_env%ngroups
341 DO istate = ngroups - igroup, nstates, ngroups
342 DO ispin = 1, evecs_dim
343 CALL cp_fm_create(work_matrices%evects_sub(ispin, istate), fm_struct_evects(ispin)%struct)
344 CALL cp_fm_create(work_matrices%Aop_evects_sub(ispin, istate), fm_struct_evects(ispin)%struct)
348 DO ispin = evecs_dim, 1, -1
353 CALL cp_fm_struct_create(fm_struct, nrow_global=nao, ncol_global=nao, context=sub_env%blacs_env)
354 ALLOCATE (work_matrices%rho_ao_orb_fm_sub)
355 CALL cp_fm_create(work_matrices%rho_ao_orb_fm_sub, fm_struct)
358 NULLIFY (work_matrices%rho_ao_aux_fit_fm_sub, work_matrices%wfm_aux_orb_sub)
360 CALL cp_fm_struct_create(fm_struct, nrow_global=nao_aux, ncol_global=nao_aux, context=sub_env%blacs_env)
361 ALLOCATE (work_matrices%rho_ao_aux_fit_fm_sub)
362 CALL cp_fm_create(work_matrices%rho_ao_aux_fit_fm_sub, fm_struct)
365 CALL cp_fm_struct_create(fm_struct, nrow_global=nao_aux, ncol_global=nao, context=sub_env%blacs_env)
366 ALLOCATE (work_matrices%wfm_aux_orb_sub)
367 CALL cp_fm_create(work_matrices%wfm_aux_orb_sub, fm_struct)
372 NULLIFY (work_matrices%A_ia_munu_sub)
374 DO ispin = 1, evecs_dim
375 CALL dbcsr_init_p(work_matrices%A_ia_munu_sub(ispin)%matrix)
377 dbcsr_dist=sub_env%dbcsr_dist, sab=sub_env%sab_orb)
386 dbcsr_dist=sub_env%dbcsr_dist, sab=sub_env%sab_orb)
389 NULLIFY (work_matrices%rho_orb_struct_sub)
390 ALLOCATE (work_matrices%rho_orb_struct_sub)
392 CALL qs_rho_set(work_matrices%rho_orb_struct_sub, rho_ao=rho_ia_ao)
393 CALL qs_rho_rebuild(work_matrices%rho_orb_struct_sub, qs_env, rebuild_ao=.false., &
394 rebuild_grids=.true., pw_env_external=sub_env%pw_env)
395 CALL get_qs_env(qs_env, dft_control=dft_control)
396 IF (dft_control%qs_control%gapw_xc)
THEN
402 dbcsr_dist=sub_env%dbcsr_dist, sab=sub_env%sab_orb)
404 NULLIFY (work_matrices%rho_xc_struct_sub)
405 ALLOCATE (work_matrices%rho_xc_struct_sub)
407 CALL qs_rho_set(work_matrices%rho_xc_struct_sub, rho_ao=rho_xc_ao)
408 CALL qs_rho_rebuild(work_matrices%rho_xc_struct_sub, qs_env, rebuild_ao=.false., &
409 rebuild_grids=.true., pw_env_external=sub_env%pw_env)
412 NULLIFY (work_matrices%rho_aux_fit_struct_sub)
419 dbcsr_dist=sub_env%dbcsr_dist, sab=sub_env%sab_aux_fit)
422 ALLOCATE (work_matrices%rho_aux_fit_struct_sub)
424 CALL qs_rho_set(work_matrices%rho_aux_fit_struct_sub, rho_ao=rho_ia_ao)
425 CALL qs_rho_rebuild(work_matrices%rho_aux_fit_struct_sub, qs_env, rebuild_ao=.false., &
426 rebuild_grids=.true., pw_env_external=sub_env%pw_env)
430 CALL pw_env_get(sub_env%pw_env, auxbas_pw_pool=auxbas_pw_pool)
431 ALLOCATE (work_matrices%A_ia_rspace_sub(nspins))
432 ALLOCATE (work_matrices%wpw_gspace_sub(nspins), work_matrices%wpw_rspace_sub(nspins))
434 CALL auxbas_pw_pool%create_pw(work_matrices%A_ia_rspace_sub(ispin))
435 CALL auxbas_pw_pool%create_pw(work_matrices%wpw_gspace_sub(ispin))
436 CALL auxbas_pw_pool%create_pw(work_matrices%wpw_rspace_sub(ispin))
442 ALLOCATE (work_matrices%fxc_rspace_sub(3))
444 CALL auxbas_pw_pool%create_pw(work_matrices%fxc_rspace_sub(ispin))
447 NULLIFY (work_matrices%fxc_rspace_sub)
451 IF (dft_control%qs_control%gapw)
THEN
453 atomic_kind_set=atomic_kind_set, &
455 qs_kind_set=qs_kind_set)
458 qs_kind_set, dft_control, sub_env%para_env)
459 CALL init_rho0(work_matrices%local_rho_set, qs_env, dft_control%qs_control%gapw_control, &
464 ELSE IF (dft_control%qs_control%gapw_xc)
THEN
466 atomic_kind_set=atomic_kind_set, &
467 qs_kind_set=qs_kind_set)
470 qs_kind_set, dft_control, sub_env%para_env)
474 NULLIFY (work_matrices%hfx_fm_ao_ao, work_matrices%hfx_rho_ao_symm, work_matrices%hfx_hmat_symm, &
475 work_matrices%hfx_rho_ao_asymm, work_matrices%hfx_hmat_asymm)
478 CALL get_qs_env(qs_env, dbcsr_dist=dbcsr_dist)
480 dbcsr_template_hfx => matrix_s_aux_fit(1)%matrix
481 IF (dft_control%qs_control%gapw .OR. dft_control%qs_control%gapw_xc)
THEN
482 CALL get_qs_env(qs_env, admm_env=admm_env, atomic_kind_set=atomic_kind_set)
485 atomic_kind_set, admm_env%admm_gapw_env%admm_kind_set, &
486 dft_control, sub_env%para_env)
489 CALL get_qs_env(qs_env, dbcsr_dist=dbcsr_dist, sab_orb=sab_hfx)
490 dbcsr_template_hfx => matrix_s(1)%matrix
494 ALLOCATE (work_matrices%hfx_fm_ao_ao)
495 CALL cp_fm_create(work_matrices%hfx_fm_ao_ao, fm_struct)
501 CALL dbcsr_init_p(work_matrices%hfx_rho_ao_symm(ispin)%matrix)
503 template=dbcsr_template_hfx, dbcsr_dist=dbcsr_dist, sab=sab_hfx)
505 CALL dbcsr_init_p(work_matrices%hfx_rho_ao_asymm(ispin)%matrix)
506 CALL dbcsr_create(work_matrices%hfx_rho_ao_asymm(ispin)%matrix, matrix_type=dbcsr_type_antisymmetric, &
507 template=work_matrices%hfx_rho_ao_symm(ispin)%matrix)
509 work_matrices%hfx_rho_ao_asymm(ispin)%matrix)
515 CALL dbcsr_init_p(work_matrices%hfx_hmat_symm(ispin)%matrix)
517 template=dbcsr_template_hfx, dbcsr_dist=dbcsr_dist, sab=sab_hfx)
519 CALL dbcsr_init_p(work_matrices%hfx_hmat_asymm(ispin)%matrix)
520 CALL dbcsr_create(work_matrices%hfx_hmat_asymm(ispin)%matrix, matrix_type=dbcsr_type_antisymmetric, &
521 template=work_matrices%hfx_hmat_symm(ispin)%matrix)
523 work_matrices%hfx_hmat_asymm(ispin)%matrix)
528 NULLIFY (work_matrices%hfxsr_fm_ao_ao, work_matrices%hfxsr_rho_ao_symm, work_matrices%hfxsr_hmat_symm, &
529 work_matrices%hfxsr_rho_ao_asymm, work_matrices%hfxsr_hmat_asymm)
533 CALL cp_fm_struct_create(fm_struct_evects(ispin)%struct, template_fmstruct=gs_mos(ispin)%mos_active%matrix_struct, &
534 context=sub_env%blacs_env)
537 CALL dbcsr_create(work_matrices%shalf, template=matrix_s(1)%matrix)
538 ALLOCATE (work_matrices%ctransformed(nspins))
540 CALL cp_fm_create(work_matrices%ctransformed(ispin), fm_struct_evects(ispin)%struct)
543 ALLOCATE (work_matrices%S_eigenvalues(nao))
546 ALLOCATE (work_matrices%S_eigenvectors, work_matrices%slambda)
547 CALL cp_fm_create(work_matrices%S_eigenvectors, fm_struct)
556 CALL timestop(handle)
571 CHARACTER(LEN=*),
PARAMETER :: routinen =
'hfxsr_create_work_matrices'
573 INTEGER :: handle, ispin, nao, nao_aux, nspins
577 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_s, matrix_s_aux_fit
578 TYPE(
dbcsr_type),
POINTER :: dbcsr_template_hfx
583 CALL timeset(routinen, handle)
586 NULLIFY (work_matrices%hfxsr_fm_ao_ao, work_matrices%hfxsr_rho_ao_symm, work_matrices%hfxsr_hmat_symm, &
587 work_matrices%hfxsr_rho_ao_asymm, work_matrices%hfxsr_hmat_asymm)
589 CALL get_qs_env(qs_env, dft_control=dft_control, matrix_s=matrix_s, &
590 blacs_env=blacs_env, dbcsr_dist=dbcsr_dist)
591 nspins = dft_control%nspins
593 CALL get_admm_env(admm_env, matrix_s_aux_fit=matrix_s_aux_fit)
594 dbcsr_template_hfx => matrix_s_aux_fit(1)%matrix
598 ALLOCATE (work_matrices%hfxsr_fm_ao_ao)
599 CALL cp_fm_create(work_matrices%hfxsr_fm_ao_ao, fm_struct)
606 CALL dbcsr_init_p(work_matrices%hfxsr_rho_ao_symm(ispin)%matrix)
608 template=dbcsr_template_hfx, dbcsr_dist=dbcsr_dist, sab=sab_hfx)
610 CALL dbcsr_init_p(work_matrices%hfxsr_rho_ao_asymm(ispin)%matrix)
611 CALL dbcsr_create(work_matrices%hfxsr_rho_ao_asymm(ispin)%matrix, matrix_type=dbcsr_type_antisymmetric, &
612 template=work_matrices%hfxsr_rho_ao_symm(ispin)%matrix)
614 work_matrices%hfxsr_rho_ao_asymm(ispin)%matrix)
620 CALL dbcsr_init_p(work_matrices%hfxsr_hmat_symm(ispin)%matrix)
622 template=dbcsr_template_hfx, dbcsr_dist=dbcsr_dist, sab=sab_hfx)
624 CALL dbcsr_init_p(work_matrices%hfxsr_hmat_asymm(ispin)%matrix)
625 CALL dbcsr_create(work_matrices%hfxsr_hmat_asymm(ispin)%matrix, matrix_type=dbcsr_type_antisymmetric, &
626 template=work_matrices%hfxsr_hmat_symm(ispin)%matrix)
628 work_matrices%hfxsr_hmat_asymm(ispin)%matrix)
631 CALL timestop(handle)
649 INTEGER,
INTENT(in) :: nstates
653 CHARACTER(LEN=*),
PARAMETER :: routinen =
'stda_create_work_matrices'
655 INTEGER :: handle, igroup, ispin, istate, nao, &
657 INTEGER,
DIMENSION(maxspins) :: nactive, nmo_occ, nmo_virt
664 CALL timeset(routinen, handle)
666 NULLIFY (work_matrices%gamma_exchange, work_matrices%ctransformed)
668 nspins =
SIZE(gs_mos)
669 CALL get_qs_env(qs_env, blacs_env=blacs_env, matrix_s=matrix_s)
673 nactive(ispin) = gs_mos(ispin)%nmo_active
674 nmo_occ(ispin) = gs_mos(ispin)%nmo_occ
675 nmo_virt(ispin) =
SIZE(gs_mos(ispin)%evals_virt)
679 ALLOCATE (work_matrices%fm_pool_ao_mo_active(nspins))
681 NULLIFY (work_matrices%fm_pool_ao_mo_active(ispin)%pool)
682 CALL cp_fm_struct_create(fm_struct, nrow_global=nao, ncol_global=nactive(ispin), context=blacs_env)
683 CALL fm_pool_create(work_matrices%fm_pool_ao_mo_active(ispin)%pool, fm_struct)
687 ALLOCATE (work_matrices%S_C0_C0T(nspins))
690 CALL cp_fm_create(work_matrices%S_C0_C0T(ispin), fm_struct)
694 ALLOCATE (work_matrices%S_C0(nspins))
696 CALL cp_fm_struct_create(fm_struct, nrow_global=nao, ncol_global=nmo_occ(ispin), context=blacs_env)
699 ncol=nmo_occ(ispin), alpha=1.0_dp, beta=0.0_dp)
700 CALL parallel_gemm(
'N',
'T', nao, nao, nmo_occ(ispin), 1.0_dp, work_matrices%S_C0(ispin), &
701 gs_mos(ispin)%mos_occ, 0.0_dp, work_matrices%S_C0_C0T(ispin))
707 ncol_global=nactive(ispin), context=sub_env%blacs_env)
710 IF (sub_env%is_split)
THEN
711 ALLOCATE (work_matrices%evects_sub(nspins, nstates), work_matrices%Aop_evects_sub(nspins, nstates))
713 CALL blacs_env%get(para_env=para_env)
714 igroup = sub_env%group_distribution(para_env%mepos)
715 ngroups = sub_env%ngroups
717 DO istate = ngroups - igroup, nstates, ngroups
719 CALL cp_fm_create(work_matrices%evects_sub(ispin, istate), fm_struct_evects(ispin)%struct)
720 CALL cp_fm_create(work_matrices%Aop_evects_sub(ispin, istate), fm_struct_evects(ispin)%struct)
726 ALLOCATE (work_matrices%ctransformed(nspins))
728 CALL cp_fm_create(work_matrices%ctransformed(ispin), fm_struct_evects(ispin)%struct)
730 NULLIFY (work_matrices%shalf)
732 CALL dbcsr_create(work_matrices%shalf, template=matrix_s(1)%matrix)
734 ALLOCATE (work_matrices%S_eigenvalues(nao))
737 ALLOCATE (work_matrices%S_eigenvectors, work_matrices%slambda)
738 CALL cp_fm_create(work_matrices%S_eigenvectors, fm_struct)
742 DO ispin = nspins, 1, -1
746 NULLIFY (work_matrices%rho_ao_orb_fm_sub)
747 NULLIFY (work_matrices%rho_ao_aux_fit_fm_sub, work_matrices%wfm_aux_orb_sub)
748 NULLIFY (work_matrices%rho_aux_fit_struct_sub)
749 NULLIFY (work_matrices%rho_orb_struct_sub)
750 NULLIFY (work_matrices%hfx_fm_ao_ao, work_matrices%hfx_rho_ao_symm, work_matrices%hfx_hmat_symm, &
751 work_matrices%hfx_rho_ao_asymm, work_matrices%hfx_hmat_asymm)
752 NULLIFY (work_matrices%hfxsr_fm_ao_ao, work_matrices%hfxsr_rho_ao_symm, work_matrices%hfxsr_hmat_symm, &
753 work_matrices%hfxsr_rho_ao_asymm, work_matrices%hfxsr_hmat_asymm)
754 NULLIFY (work_matrices%A_ia_rspace_sub, work_matrices%wpw_gspace_sub, &
755 work_matrices%wpw_rspace_sub)
756 NULLIFY (work_matrices%fxc_rspace_sub)
757 NULLIFY (work_matrices%A_ia_munu_sub)
759 NULLIFY (work_matrices%ewald_env)
760 NULLIFY (work_matrices%ewald_pw)
762 NULLIFY (work_matrices%hartree_local)
763 NULLIFY (work_matrices%local_rho_set)
764 NULLIFY (work_matrices%local_rho_set_admm)
765 NULLIFY (work_matrices%rho_xc_struct_sub)
767 CALL timestop(handle)
782 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_release_work_matrices'
784 INTEGER :: handle, ispin
787 CALL timeset(routinen, handle)
790 IF (
ASSOCIATED(work_matrices%hfx_hmat_symm))
THEN
791 DO ispin =
SIZE(work_matrices%hfx_hmat_symm), 1, -1
794 DEALLOCATE (work_matrices%hfx_hmat_symm)
797 IF (
ASSOCIATED(work_matrices%hfx_hmat_asymm))
THEN
798 DO ispin =
SIZE(work_matrices%hfx_hmat_asymm), 1, -1
801 DEALLOCATE (work_matrices%hfx_hmat_asymm)
804 IF (
ASSOCIATED(work_matrices%hfx_rho_ao_symm))
THEN
805 DO ispin =
SIZE(work_matrices%hfx_rho_ao_symm), 1, -1
808 DEALLOCATE (work_matrices%hfx_rho_ao_symm)
811 IF (
ASSOCIATED(work_matrices%hfx_rho_ao_asymm))
THEN
812 DO ispin =
SIZE(work_matrices%hfx_rho_ao_asymm), 1, -1
815 DEALLOCATE (work_matrices%hfx_rho_ao_asymm)
818 IF (
ASSOCIATED(work_matrices%hfx_fm_ao_ao))
THEN
820 DEALLOCATE (work_matrices%hfx_fm_ao_ao)
824 IF (
ASSOCIATED(work_matrices%hfxsr_hmat_symm))
THEN
825 DO ispin =
SIZE(work_matrices%hfxsr_hmat_symm), 1, -1
828 DEALLOCATE (work_matrices%hfxsr_hmat_symm)
831 IF (
ASSOCIATED(work_matrices%hfxsr_hmat_asymm))
THEN
832 DO ispin =
SIZE(work_matrices%hfxsr_hmat_asymm), 1, -1
835 DEALLOCATE (work_matrices%hfxsr_hmat_asymm)
838 IF (
ASSOCIATED(work_matrices%hfxsr_rho_ao_symm))
THEN
839 DO ispin =
SIZE(work_matrices%hfxsr_rho_ao_symm), 1, -1
842 DEALLOCATE (work_matrices%hfxsr_rho_ao_symm)
845 IF (
ASSOCIATED(work_matrices%hfxsr_rho_ao_asymm))
THEN
846 DO ispin =
SIZE(work_matrices%hfxsr_rho_ao_asymm), 1, -1
849 DEALLOCATE (work_matrices%hfxsr_rho_ao_asymm)
852 IF (
ASSOCIATED(work_matrices%hfxsr_fm_ao_ao))
THEN
854 DEALLOCATE (work_matrices%hfxsr_fm_ao_ao)
858 IF (
ASSOCIATED(sub_env%pw_env))
THEN
859 CALL pw_env_get(sub_env%pw_env, auxbas_pw_pool=auxbas_pw_pool)
860 DO ispin =
SIZE(work_matrices%wpw_rspace_sub), 1, -1
861 CALL auxbas_pw_pool%give_back_pw(work_matrices%wpw_rspace_sub(ispin))
862 CALL auxbas_pw_pool%give_back_pw(work_matrices%wpw_gspace_sub(ispin))
863 CALL auxbas_pw_pool%give_back_pw(work_matrices%A_ia_rspace_sub(ispin))
865 DEALLOCATE (work_matrices%A_ia_rspace_sub, work_matrices%wpw_gspace_sub, work_matrices%wpw_rspace_sub)
866 IF (
ASSOCIATED(work_matrices%fxc_rspace_sub))
THEN
867 DO ispin =
SIZE(work_matrices%fxc_rspace_sub), 1, -1
868 CALL auxbas_pw_pool%give_back_pw(work_matrices%fxc_rspace_sub(ispin))
870 DEALLOCATE (work_matrices%fxc_rspace_sub)
874 IF (
ASSOCIATED(work_matrices%rho_aux_fit_struct_sub))
THEN
876 DEALLOCATE (work_matrices%rho_aux_fit_struct_sub)
878 IF (
ASSOCIATED(work_matrices%rho_orb_struct_sub))
THEN
880 DEALLOCATE (work_matrices%rho_orb_struct_sub)
883 IF (
ASSOCIATED(work_matrices%A_ia_munu_sub))
THEN
884 DO ispin =
SIZE(work_matrices%A_ia_munu_sub), 1, -1
887 DEALLOCATE (work_matrices%A_ia_munu_sub)
890 IF (
ASSOCIATED(work_matrices%wfm_aux_orb_sub))
THEN
892 DEALLOCATE (work_matrices%wfm_aux_orb_sub)
893 NULLIFY (work_matrices%wfm_aux_orb_sub)
895 IF (
ASSOCIATED(work_matrices%rho_ao_aux_fit_fm_sub))
THEN
897 DEALLOCATE (work_matrices%rho_ao_aux_fit_fm_sub)
898 NULLIFY (work_matrices%rho_ao_aux_fit_fm_sub)
900 IF (
ASSOCIATED(work_matrices%rho_ao_orb_fm_sub))
THEN
902 DEALLOCATE (work_matrices%rho_ao_orb_fm_sub)
903 NULLIFY (work_matrices%rho_ao_orb_fm_sub)
912 DO ispin =
SIZE(work_matrices%fm_pool_ao_mo_active), 1, -1
915 DEALLOCATE (work_matrices%fm_pool_ao_mo_active)
918 IF (
ASSOCIATED(work_matrices%gamma_exchange))
THEN
920 NULLIFY (work_matrices%gamma_exchange)
922 IF (
ASSOCIATED(work_matrices%ctransformed))
THEN
924 NULLIFY (work_matrices%ctransformed)
928 IF (
ASSOCIATED(work_matrices%S_eigenvectors))
THEN
930 DEALLOCATE (work_matrices%S_eigenvectors)
932 IF (
ASSOCIATED(work_matrices%slambda))
THEN
934 DEALLOCATE (work_matrices%slambda)
936 IF (
ASSOCIATED(work_matrices%S_eigenvalues))
THEN
937 DEALLOCATE (work_matrices%S_eigenvalues)
940 IF (
ASSOCIATED(work_matrices%ewald_env))
THEN
942 DEALLOCATE (work_matrices%ewald_env)
944 IF (
ASSOCIATED(work_matrices%ewald_pw))
THEN
946 DEALLOCATE (work_matrices%ewald_pw)
949 IF (
ASSOCIATED(work_matrices%local_rho_set))
THEN
952 IF (
ASSOCIATED(work_matrices%local_rho_set_admm))
THEN
955 IF (
ASSOCIATED(work_matrices%hartree_local))
THEN
959 IF (
ASSOCIATED(work_matrices%rho_xc_struct_sub))
THEN
961 DEALLOCATE (work_matrices%rho_xc_struct_sub)
964 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, 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.