65#include "./base/base_uses.f90"
70 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
71 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_ks_types'
139 LOGICAL :: s_mstruct_changed = .true., &
140 rho_changed = .true., &
141 potential_changed = .true., &
142 forces_up_to_date = .false., &
144 INTEGER :: n_evals = 0
161 matrix_p_mp2_admm => null()
173 INTEGER :: neighbor_list_id = -1
178 sap_ppnl => null(), &
184 sab_xtbe => null(), &
185 sab_core => null(), &
187 sab_xtb_pp => null(), &
188 sab_xtb_nonbond => null(), &
191 sab_almo => null(), &
193 sab_kp_nosym => null(), &
219 ALLOCATE (ks_env%rho)
221 ALLOCATE (ks_env%rho_xc)
316 s_mstruct_changed, rho_changed, &
317 potential_changed, forces_up_to_date, complex_ks, &
318 matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, &
320 matrix_s_RI_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, &
321 matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, &
322 matrix_s_RI_aux_kp, matrix_ks_im_kp, &
324 vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, &
326 sab_orb, sab_all, sac_ae, sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, &
327 sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, &
328 sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, &
329 task_list, task_list_soft, &
330 kpoints, do_kpoints, &
331 atomic_kind_set, qs_kind_set, cell, cell_ref, use_ref_cell, &
332 particle_set, energy, force, local_particles, local_molecules, &
333 molecule_kind_set, molecule_set, subsys, cp_subsys, virial, results, atprop, &
334 nkind, natom, dft_control, dbcsr_dist, distribution_2d, pw_env, &
335 para_env, blacs_env, nelectron_total, nelectron_spin)
339 LOGICAL,
OPTIONAL :: s_mstruct_changed, rho_changed, &
340 potential_changed, forces_up_to_date, &
342 TYPE(
dbcsr_p_type),
DIMENSION(:),
OPTIONAL,
POINTER :: matrix_h, matrix_h_im, matrix_ks, &
343 matrix_ks_im, matrix_vxc, kinetic, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, &
345 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
OPTIONAL,
POINTER :: matrix_h_kp, matrix_h_im_kp, &
346 matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, &
348 TYPE(
qs_rho_type),
OPTIONAL,
POINTER :: rho, rho_xc
354 INTEGER,
OPTIONAL :: neighbor_list_id
356 sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, &
357 sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, &
359 TYPE(
task_list_type),
OPTIONAL,
POINTER :: task_list, task_list_soft
361 LOGICAL,
OPTIONAL :: do_kpoints
363 POINTER :: atomic_kind_set
365 POINTER :: qs_kind_set
366 TYPE(
cell_type),
OPTIONAL,
POINTER :: cell, cell_ref
367 LOGICAL,
OPTIONAL :: use_ref_cell
369 POINTER :: particle_set
375 POINTER :: molecule_kind_set
377 POINTER :: molecule_set
383 INTEGER,
OPTIONAL :: nkind, natom
390 INTEGER,
OPTIONAL :: nelectron_total
391 INTEGER,
DIMENSION(2),
OPTIONAL :: nelectron_spin
393 IF (.NOT.
ASSOCIATED(ks_env%subsys)) cpabort(
"get_ks_env: subsys not associated")
395 IF (
PRESENT(s_mstruct_changed)) s_mstruct_changed = ks_env%s_mstruct_changed
396 IF (
PRESENT(rho_changed)) rho_changed = ks_env%rho_changed
397 IF (
PRESENT(potential_changed)) potential_changed = ks_env%potential_changed
398 IF (
PRESENT(forces_up_to_date)) forces_up_to_date = ks_env%forces_up_to_date
399 IF (
PRESENT(complex_ks)) complex_ks = ks_env%complex_ks
400 IF (
PRESENT(v_hartree_rspace)) v_hartree_rspace => ks_env%v_hartree_rspace
402 IF (
PRESENT(matrix_ks)) matrix_ks =>
get_1d_pointer(ks_env%matrix_ks)
403 IF (
PRESENT(matrix_s)) matrix_s =>
get_1d_pointer(ks_env%matrix_s)
404 IF (
PRESENT(matrix_s_ri_aux)) matrix_s_ri_aux =>
get_1d_pointer(ks_env%matrix_s_RI_aux)
406 IF (
PRESENT(matrix_h)) matrix_h =>
get_1d_pointer(ks_env%matrix_h)
407 IF (
PRESENT(matrix_h_im)) matrix_h_im =>
get_1d_pointer(ks_env%matrix_h_im)
408 IF (
PRESENT(matrix_w)) matrix_w =>
get_1d_pointer(ks_env%matrix_w)
409 IF (
PRESENT(matrix_vxc)) matrix_vxc =>
get_1d_pointer(ks_env%matrix_vxc)
411 IF (
PRESENT(matrix_ks_kp)) matrix_ks_kp =>
get_2d_pointer(ks_env%matrix_ks)
412 IF (
PRESENT(matrix_ks_im_kp)) matrix_ks_im_kp =>
get_2d_pointer(ks_env%matrix_ks_im)
413 IF (
PRESENT(matrix_s_kp)) matrix_s_kp =>
get_2d_pointer(ks_env%matrix_s)
414 IF (
PRESENT(matrix_s_ri_aux_kp)) matrix_s_ri_aux_kp =>
get_2d_pointer(ks_env%matrix_s_RI_aux)
415 IF (
PRESENT(matrix_w_kp)) matrix_w_kp =>
get_2d_pointer(ks_env%matrix_w)
416 IF (
PRESENT(kinetic_kp)) kinetic_kp =>
get_2d_pointer(ks_env%kinetic)
417 IF (
PRESENT(matrix_h_kp)) matrix_h_kp =>
get_2d_pointer(ks_env%matrix_h)
418 IF (
PRESENT(matrix_h_im_kp)) matrix_h_im_kp =>
get_2d_pointer(ks_env%matrix_h_im)
419 IF (
PRESENT(matrix_vxc_kp)) matrix_vxc_kp =>
get_2d_pointer(ks_env%matrix_vxc)
420 IF (
PRESENT(matrix_ks_im)) matrix_ks_im =>
get_1d_pointer(ks_env%matrix_ks_im)
422 IF (
PRESENT(matrix_p_mp2)) matrix_p_mp2 => ks_env%matrix_p_mp2
423 IF (
PRESENT(matrix_p_mp2_admm)) matrix_p_mp2_admm => ks_env%matrix_p_mp2_admm
424 IF (
PRESENT(rho)) rho => ks_env%rho
425 IF (
PRESENT(rho_xc)) rho_xc => ks_env%rho_xc
426 IF (
PRESENT(rho_core)) rho_core => ks_env%rho_core
427 IF (
PRESENT(rho_nlcc)) rho_nlcc => ks_env%rho_nlcc
428 IF (
PRESENT(rho_nlcc_g)) rho_nlcc_g => ks_env%rho_nlcc_g
429 IF (
PRESENT(vppl)) vppl => ks_env%vppl
430 IF (
PRESENT(vee)) vee => ks_env%vee
432 IF (
PRESENT(neighbor_list_id)) neighbor_list_id = ks_env%neighbor_list_id
433 IF (
PRESENT(sab_orb)) sab_orb => ks_env%sab_orb
434 IF (
PRESENT(sab_all)) sab_all => ks_env%sab_all
435 IF (
PRESENT(sab_vdw)) sab_vdw => ks_env%sab_vdw
436 IF (
PRESENT(sab_scp)) sab_scp => ks_env%sab_scp
437 IF (
PRESENT(sac_ae)) sac_ae => ks_env%sac_ae
438 IF (
PRESENT(sac_ppl)) sac_ppl => ks_env%sac_ppl
439 IF (
PRESENT(sac_lri)) sac_lri => ks_env%sac_lri
440 IF (
PRESENT(sap_ppnl)) sap_ppnl => ks_env%sap_ppnl
441 IF (
PRESENT(sap_oce)) sap_oce => ks_env%sap_oce
442 IF (
PRESENT(sab_se)) sab_se => ks_env%sab_se
443 IF (
PRESENT(sab_lrc)) sab_lrc => ks_env%sab_lrc
444 IF (
PRESENT(sab_tbe)) sab_tbe => ks_env%sab_tbe
445 IF (
PRESENT(sab_xtbe)) sab_xtbe => ks_env%sab_xtbe
446 IF (
PRESENT(sab_core)) sab_core => ks_env%sab_core
447 IF (
PRESENT(sab_xb)) sab_xb => ks_env%sab_xb
448 IF (
PRESENT(sab_xtb_pp)) sab_xtb_pp => ks_env%sab_xtb_pp
449 IF (
PRESENT(sab_xtb_nonbond)) sab_xtb_nonbond => ks_env%sab_xtb_nonbond
450 IF (
PRESENT(sab_almo)) sab_almo => ks_env%sab_almo
451 IF (
PRESENT(sab_kp)) sab_kp => ks_env%sab_kp
452 IF (
PRESENT(sab_kp_nosym)) sab_kp_nosym => ks_env%sab_kp_nosym
453 IF (
PRESENT(sab_cneo)) sab_cneo => ks_env%sab_cneo
454 IF (
PRESENT(dft_control)) dft_control => ks_env%dft_control
455 IF (
PRESENT(dbcsr_dist)) dbcsr_dist => ks_env%dbcsr_dist
456 IF (
PRESENT(distribution_2d)) distribution_2d => ks_env%distribution_2d
457 IF (
PRESENT(pw_env)) pw_env => ks_env%pw_env
458 IF (
PRESENT(para_env)) para_env => ks_env%para_env
459 IF (
PRESENT(blacs_env)) blacs_env => ks_env%blacs_env
461 IF (
PRESENT(task_list)) task_list => ks_env%task_list
462 IF (
PRESENT(task_list_soft)) task_list_soft => ks_env%task_list_soft
464 IF (
PRESENT(kpoints)) kpoints => ks_env%kpoints
465 IF (
PRESENT(do_kpoints))
THEN
466 do_kpoints = (ks_env%kpoints%nkp > 0)
469 IF (
PRESENT(subsys)) subsys => ks_env%subsys
471 local_molecules=local_molecules, &
472 local_particles=local_particles, &
478 use_ref_cell=use_ref_cell, &
481 qs_kind_set=qs_kind_set, &
482 cp_subsys=cp_subsys, &
483 atomic_kind_set=atomic_kind_set, &
484 particle_set=particle_set, &
485 molecule_kind_set=molecule_kind_set, &
486 molecule_set=molecule_set, &
489 nelectron_total=nelectron_total, &
490 nelectron_spin=nelectron_spin)
562 s_mstruct_changed, rho_changed, &
563 potential_changed, forces_up_to_date, complex_ks, &
564 matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, &
566 matrix_s_RI_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, &
567 matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, &
568 matrix_s_RI_aux_kp, matrix_ks_im_kp, &
569 vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, &
572 sab_orb, sab_all, sac_ae, sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, &
573 sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, &
574 sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, &
575 task_list, task_list_soft, &
576 subsys, dft_control, dbcsr_dist, distribution_2d, pw_env, &
581 LOGICAL,
OPTIONAL :: s_mstruct_changed, rho_changed, &
582 potential_changed, forces_up_to_date, &
584 TYPE(
dbcsr_p_type),
DIMENSION(:),
OPTIONAL,
POINTER :: matrix_h, matrix_h_im, matrix_ks, &
585 matrix_ks_im, matrix_vxc, kinetic, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, &
587 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
OPTIONAL,
POINTER :: matrix_h_kp, matrix_h_im_kp, &
588 matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, &
595 INTEGER,
OPTIONAL :: neighbor_list_id
598 sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, &
599 sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, &
601 TYPE(
task_list_type),
OPTIONAL,
POINTER :: task_list, task_list_soft
610 IF (
PRESENT(s_mstruct_changed)) ks_env%s_mstruct_changed = s_mstruct_changed
611 IF (
PRESENT(rho_changed)) ks_env%rho_changed = rho_changed
612 IF (
PRESENT(potential_changed)) ks_env%potential_changed = potential_changed
613 IF (
PRESENT(forces_up_to_date)) ks_env%forces_up_to_date = forces_up_to_date
614 IF (
PRESENT(complex_ks)) ks_env%complex_ks = complex_ks
615 IF (ks_env%s_mstruct_changed .OR. ks_env%potential_changed .OR. ks_env%rho_changed) &
616 ks_env%forces_up_to_date = .false.
617 IF (
PRESENT(v_hartree_rspace)) ks_env%v_hartree_rspace => v_hartree_rspace
619 IF (
PRESENT(matrix_h))
CALL set_1d_pointer(ks_env%matrix_h, matrix_h)
620 IF (
PRESENT(matrix_h_kp))
CALL set_2d_pointer(ks_env%matrix_h, matrix_h_kp)
622 IF (
PRESENT(matrix_h_im))
CALL set_1d_pointer(ks_env%matrix_h_im, matrix_h_im)
623 IF (
PRESENT(matrix_h_im_kp))
CALL set_2d_pointer(ks_env%matrix_h_im, matrix_h_im_kp)
625 IF (
PRESENT(matrix_ks))
CALL set_1d_pointer(ks_env%matrix_ks, matrix_ks)
626 IF (
PRESENT(matrix_ks_kp))
CALL set_2d_pointer(ks_env%matrix_ks, matrix_ks_kp)
628 IF (
PRESENT(matrix_vxc))
CALL set_1d_pointer(ks_env%matrix_vxc, matrix_vxc)
629 IF (
PRESENT(matrix_vxc_kp))
CALL set_2d_pointer(ks_env%matrix_vxc, matrix_vxc_kp)
631 IF (
PRESENT(matrix_s))
CALL set_1d_pointer(ks_env%matrix_s, matrix_s)
632 IF (
PRESENT(matrix_s_kp))
CALL set_2d_pointer(ks_env%matrix_s, matrix_s_kp)
634 IF (
PRESENT(kinetic))
CALL set_1d_pointer(ks_env%kinetic, kinetic)
635 IF (
PRESENT(kinetic_kp))
CALL set_2d_pointer(ks_env%kinetic, kinetic_kp)
637 IF (
PRESENT(matrix_w))
CALL set_1d_pointer(ks_env%matrix_w, matrix_w)
638 IF (
PRESENT(matrix_w_kp))
CALL set_2d_pointer(ks_env%matrix_w, matrix_w_kp)
640 IF (
PRESENT(matrix_s_ri_aux))
CALL set_1d_pointer(ks_env%matrix_s_RI_aux, matrix_s_ri_aux)
641 IF (
PRESENT(matrix_s_ri_aux_kp))
CALL set_2d_pointer(ks_env%matrix_s_RI_aux, matrix_s_ri_aux_kp)
643 IF (
PRESENT(matrix_ks_im))
CALL set_1d_pointer(ks_env%matrix_ks_im, matrix_ks_im)
644 IF (
PRESENT(matrix_ks_im_kp))
CALL set_2d_pointer(ks_env%matrix_ks_im, matrix_ks_im_kp)
646 IF (
PRESENT(matrix_p_mp2)) ks_env%matrix_p_mp2 => matrix_p_mp2
647 IF (
PRESENT(matrix_p_mp2_admm)) ks_env%matrix_p_mp2_admm => matrix_p_mp2_admm
648 IF (
PRESENT(rho_core)) ks_env%rho_core => rho_core
649 IF (
PRESENT(rho_nlcc)) ks_env%rho_nlcc => rho_nlcc
650 IF (
PRESENT(rho_nlcc_g)) ks_env%rho_nlcc_g => rho_nlcc_g
651 IF (
PRESENT(vppl)) ks_env%vppl => vppl
652 IF (
PRESENT(vee)) ks_env%vee => vee
654 IF (
PRESENT(neighbor_list_id)) ks_env%neighbor_list_id = neighbor_list_id
655 IF (
PRESENT(kpoints)) ks_env%kpoints => kpoints
656 IF (
PRESENT(sab_orb)) ks_env%sab_orb => sab_orb
657 IF (
PRESENT(sab_vdw)) ks_env%sab_vdw => sab_vdw
658 IF (
PRESENT(sab_scp)) ks_env%sab_scp => sab_scp
659 IF (
PRESENT(sab_all)) ks_env%sab_all => sab_all
660 IF (
PRESENT(sac_ae)) ks_env%sac_ae => sac_ae
661 IF (
PRESENT(sac_ppl)) ks_env%sac_ppl => sac_ppl
662 IF (
PRESENT(sac_lri)) ks_env%sac_lri => sac_lri
663 IF (
PRESENT(sap_ppnl)) ks_env%sap_ppnl => sap_ppnl
664 IF (
PRESENT(sap_oce)) ks_env%sap_oce => sap_oce
665 IF (
PRESENT(sab_se)) ks_env%sab_se => sab_se
666 IF (
PRESENT(sab_lrc)) ks_env%sab_lrc => sab_lrc
667 IF (
PRESENT(sab_tbe)) ks_env%sab_tbe => sab_tbe
668 IF (
PRESENT(sab_xtbe)) ks_env%sab_xtbe => sab_xtbe
669 IF (
PRESENT(sab_core)) ks_env%sab_core => sab_core
670 IF (
PRESENT(sab_xb)) ks_env%sab_xb => sab_xb
671 IF (
PRESENT(sab_xtb_pp)) ks_env%sab_xtb_pp => sab_xtb_pp
672 IF (
PRESENT(sab_xtb_nonbond)) ks_env%sab_xtb_nonbond => sab_xtb_nonbond
673 IF (
PRESENT(sab_almo)) ks_env%sab_almo => sab_almo
674 IF (
PRESENT(sab_kp)) ks_env%sab_kp => sab_kp
675 IF (
PRESENT(sab_kp_nosym)) ks_env%sab_kp_nosym => sab_kp_nosym
676 IF (
PRESENT(sab_cneo)) ks_env%sab_cneo => sab_cneo
678 IF (
PRESENT(task_list)) ks_env%task_list => task_list
679 IF (
PRESENT(task_list_soft)) ks_env%task_list_soft => task_list_soft
681 IF (
PRESENT(subsys))
THEN
682 IF (
ASSOCIATED(ks_env%subsys))
THEN
683 IF (
ASSOCIATED(ks_env%subsys, subsys))
THEN
685 DEALLOCATE (ks_env%subsys)
688 ks_env%subsys => subsys
690 IF (
PRESENT(dft_control))
THEN
691 IF (
ASSOCIATED(ks_env%dft_control))
THEN
692 IF (.NOT.
ASSOCIATED(ks_env%dft_control, dft_control))
THEN
694 DEALLOCATE (ks_env%dft_control)
697 ks_env%dft_control => dft_control
699 IF (
PRESENT(dbcsr_dist))
THEN
700 IF (
ASSOCIATED(ks_env%dbcsr_dist))
THEN
701 IF (.NOT.
ASSOCIATED(ks_env%dbcsr_dist, dbcsr_dist))
THEN
703 DEALLOCATE (ks_env%dbcsr_dist)
706 ks_env%dbcsr_dist => dbcsr_dist
708 IF (
PRESENT(distribution_2d))
THEN
711 ks_env%distribution_2d => distribution_2d
713 IF (
PRESENT(pw_env))
THEN
716 ks_env%pw_env => pw_env
718 IF (
PRESENT(para_env))
THEN
719 CALL para_env%retain()
721 ks_env%para_env => para_env
723 IF (
PRESENT(blacs_env))
THEN
724 CALL blacs_env%retain()
726 ks_env%blacs_env => blacs_env
740 IF (
ASSOCIATED(ks_env%v_hartree_rspace))
THEN
741 CALL ks_env%v_hartree_rspace%release()
742 DEALLOCATE (ks_env%v_hartree_rspace)
755 IF (
ASSOCIATED(ks_env%matrix_p_mp2)) &
757 IF (
ASSOCIATED(ks_env%matrix_p_mp2_admm)) &
759 IF (
ASSOCIATED(ks_env%rho))
THEN
761 DEALLOCATE (ks_env%rho)
763 IF (
ASSOCIATED(ks_env%rho_xc))
THEN
765 DEALLOCATE (ks_env%rho_xc)
767 IF (
ASSOCIATED(ks_env%distribution_2d)) &
769 IF (
ASSOCIATED(ks_env%task_list)) &
771 IF (
ASSOCIATED(ks_env%task_list_soft)) &
774 IF (
ASSOCIATED(ks_env%rho_nlcc_g))
THEN
775 CALL ks_env%rho_nlcc_g%release()
776 DEALLOCATE (ks_env%rho_nlcc_g)
778 IF (
ASSOCIATED(ks_env%rho_nlcc))
THEN
779 CALL ks_env%rho_nlcc%release()
780 DEALLOCATE (ks_env%rho_nlcc)
782 IF (
ASSOCIATED(ks_env%rho_core))
THEN
783 CALL ks_env%rho_core%release()
784 DEALLOCATE (ks_env%rho_core)
786 IF (
ASSOCIATED(ks_env%vppl))
THEN
787 CALL ks_env%vppl%release()
788 DEALLOCATE (ks_env%vppl)
790 IF (
ASSOCIATED(ks_env%vee))
THEN
791 CALL ks_env%vee%release()
792 DEALLOCATE (ks_env%vee)
794 IF (
ASSOCIATED(ks_env%dbcsr_dist))
THEN
796 DEALLOCATE (ks_env%dbcsr_dist)
820 IF (
ASSOCIATED(ks_env%dft_control))
THEN
822 DEALLOCATE (ks_env%dft_control)
825 IF (
ASSOCIATED(ks_env%subsys))
THEN
827 DEALLOCATE (ks_env%subsys)
844 IF (
ASSOCIATED(ks_env%v_hartree_rspace))
THEN
845 CALL ks_env%v_hartree_rspace%release()
846 DEALLOCATE (ks_env%v_hartree_rspace)
857 IF (
ASSOCIATED(ks_env%matrix_p_mp2)) &
859 IF (
ASSOCIATED(ks_env%matrix_p_mp2_admm)) &
861 IF (
ASSOCIATED(ks_env%rho))
THEN
863 DEALLOCATE (ks_env%rho)
865 IF (
ASSOCIATED(ks_env%rho_xc))
THEN
867 DEALLOCATE (ks_env%rho_xc)
869 IF (
ASSOCIATED(ks_env%task_list)) &
871 IF (
ASSOCIATED(ks_env%task_list_soft)) &
874 IF (
ASSOCIATED(ks_env%rho_nlcc_g))
THEN
875 CALL ks_env%rho_nlcc_g%release()
876 DEALLOCATE (ks_env%rho_nlcc_g)
878 IF (
ASSOCIATED(ks_env%rho_nlcc))
THEN
879 CALL ks_env%rho_nlcc%release()
880 DEALLOCATE (ks_env%rho_nlcc)
882 IF (
ASSOCIATED(ks_env%rho_core))
THEN
883 CALL ks_env%rho_core%release()
884 DEALLOCATE (ks_env%rho_core)
886 IF (
ASSOCIATED(ks_env%vppl))
THEN
887 CALL ks_env%vppl%release()
888 DEALLOCATE (ks_env%vppl)
890 IF (
ASSOCIATED(ks_env%vee))
THEN
891 CALL ks_env%vee%release()
892 DEALLOCATE (ks_env%vee)
936 potential_changed, full_reset)
938 LOGICAL,
INTENT(in),
OPTIONAL :: s_mstruct_changed, rho_changed, &
939 potential_changed, full_reset
941 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_ks_did_change'
944 LOGICAL :: my_mstruct_chg
946 CALL timeset(routinen, handle)
947 my_mstruct_chg = .false.
949 IF (
PRESENT(rho_changed))
THEN
950 IF (rho_changed) ks_env%rho_changed = .true.
953 IF (
PRESENT(potential_changed))
THEN
954 IF (potential_changed) ks_env%potential_changed = .true.
957 IF (
PRESENT(s_mstruct_changed))
THEN
958 IF (s_mstruct_changed) my_mstruct_chg = .true.
961 IF (
PRESENT(full_reset))
THEN
963 ks_env%potential_changed = .true.
964 my_mstruct_chg = .true.
968 IF (my_mstruct_chg)
THEN
969 ks_env%s_mstruct_changed = .true.
973 IF (ks_env%complex_ks)
THEN
980 CALL timestop(handle)
Define the atomic kind types and their sub types.
Holds information on atomic properties.
Handles all functions related to the CELL.
methods related to the blacs parallel environment
subroutine, public cp_blacs_env_release(blacs_env)
releases the given blacs_env
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dft_control_release(dft_control)
...
subroutine, public dbcsr_distribution_release(dist)
...
DBCSR operations in CP2K.
set of type/routines to handle the storage of results in force_envs
types that represent a subsys, i.e. a part of the system
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
stores a mapping of 2D info (e.g. matrix) on a 2D processor distribution (i.e. blacs grid) where cpus...
subroutine, public distribution_2d_release(distribution_2d)
...
subroutine, public distribution_2d_retain(distribution_2d)
...
Datatype to translate between k-points (2d) and gamma-point (1d) code.
type(dbcsr_p_type) function, dimension(:), pointer, public get_1d_pointer(this)
Smart getter, raises an error when called during a k-point calculation.
type(dbcsr_p_type) function, dimension(:, :), pointer, public get_2d_pointer(this)
Simple getter, needed because of PRIVATE.
subroutine, public kpoint_transitional_release(this)
Release the matrix set, using the right pointer.
subroutine, public set_1d_pointer(this, ptr_1d)
Assigns a 1D pointer.
subroutine, public set_2d_pointer(this, ptr_2d)
Assigns a 2D pointer.
Types and basic routines needed for a kpoint calculation.
subroutine, public kpoint_release(kpoint)
Release a kpoint environment, deallocate all data.
Interface to the message passing library MPI.
subroutine, public mp_para_env_release(para_env)
releases the para object (to be called when you don't want anymore the shared copy of this object)
Define the molecule kind structure types and the corresponding functionality.
Define the data structure for the molecule information.
Define the data structure for the particle information.
container for various plainwaves related things
subroutine, public pw_env_retain(pw_env)
retains the pw_env (see doc/ReferenceCounting.html)
subroutine, public pw_env_release(pw_env, para_env)
releases the given pw_env (see doc/ReferenceCounting.html)
Define the quickstep kind type and their sub types.
subroutine, public qs_ks_release(ks_env)
releases the ks_env (see doc/ReferenceCounting.html)
subroutine, public set_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, complex_ks, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, kinetic, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_ks_im_kp, vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, kpoints, sab_orb, sab_all, sac_ae, sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, task_list, task_list_soft, subsys, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env)
...
subroutine, public get_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, complex_ks, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, kinetic, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_ks_im_kp, rho, rho_xc, vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, sab_orb, sab_all, sac_ae, sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, task_list, task_list_soft, kpoints, do_kpoints, atomic_kind_set, qs_kind_set, cell, cell_ref, use_ref_cell, particle_set, energy, force, local_particles, local_molecules, molecule_kind_set, molecule_set, subsys, cp_subsys, virial, results, atprop, nkind, natom, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env, nelectron_total, nelectron_spin)
...
subroutine, public qs_ks_did_change(ks_env, s_mstruct_changed, rho_changed, potential_changed, full_reset)
tells that some of the things relevant to the ks calculation did change. has to be called when change...
subroutine, public qs_ks_part_release(ks_env)
releases part of the ks_env
subroutine, public qs_ks_env_create(ks_env)
Allocates a new instance of ks_env.
Define the neighbor list data types and the corresponding functionality.
subroutine, public release_neighbor_list_sets(nlists)
releases an array of neighbor_list_sets
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_create(rho)
Allocates a new instance of rho.
subroutine, public qs_rho_release(rho_struct)
releases a rho_struct by decreasing the reference count by one and deallocating if it reaches 0 (to b...
types that represent a quickstep subsys
subroutine, public qs_subsys_release(subsys)
releases a subsys (see doc/ReferenceCounting.html)
subroutine, public qs_subsys_get(subsys, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell, energy, force, qs_kind_set, cp_subsys, nelectron_total, nelectron_spin)
...
subroutine, public deallocate_task_list(task_list)
deallocates the components and the object itself
Provides all information about an atomic kind.
type for the atomic properties
Type defining parameters related to the simulation cell.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
contains arbitrary information which need to be stored
represents a system: atoms, molecules, their pos,vel,...
structure to store local (to a processor) ordered lists of integers.
distributes pairs on a 2d grid of processors
Contains information about kpoints.
stores all the informations relevant to an mpi environment
contained for different pw related things
Provides all information about a quickstep kind.
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...
keeps the density in various representations, keeping track of which ones are valid.