(git:374b731)
Loading...
Searching...
No Matches
qs_kpp1_env_types.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief basis types for the calculation of the perturbation of density theory.
10!> \par History
11!> 4.2002 created [fawzi]
12!> \author Fawzi Mohamed
13! **************************************************************************************************
15 USE dbcsr_api, ONLY: dbcsr_deallocate_matrix,&
16 dbcsr_p_type
21#include "./base/base_uses.f90"
22
23 IMPLICIT NONE
24 PRIVATE
25 PUBLIC :: qs_kpp1_env_type
26 PUBLIC :: kpp1_release
27
28 LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .true.
29 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_kpp1_env_types'
30
31! **************************************************************************************************
32!> \brief environment that keeps the informations and temporary
33!> val to build the kpp1 kernel matrix
34!> \param v_ao the potential in the ao basis (used togheter with v_rspace
35!> to update only what changed
36!> \param deriv_xc (ii,ipot): the second derivative of the xc potential at psi0
37!> (qs_env%c), if grad pot is true it should already be divised
38!> by the gradient
39! **************************************************************************************************
41 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: v_ao => null()
42 TYPE(xc_derivative_set_type), POINTER :: deriv_set => null()
43 TYPE(xc_rho_set_type), POINTER :: rho_set => null()
44 TYPE(xc_derivative_set_type), POINTER :: deriv_set_admm => null()
45 TYPE(xc_rho_set_type), POINTER :: rho_set_admm => null()
46 END TYPE qs_kpp1_env_type
47
48CONTAINS
49
50! **************************************************************************************************
51!> \brief releases a kpp1_env (see doc/ReferenceCounting.html)
52!> \param kpp1_env the environment to release
53!> \par History
54!> 07.2002 created [fawzi]
55!> \author Fawzi Mohamed
56! **************************************************************************************************
57 SUBROUTINE kpp1_release(kpp1_env)
58 TYPE(qs_kpp1_env_type) :: kpp1_env
59
60 INTEGER :: ispin
61
62 IF (ASSOCIATED(kpp1_env%v_ao)) THEN
63 DO ispin = 1, SIZE(kpp1_env%v_ao)
64 IF (ASSOCIATED(kpp1_env%v_ao(ispin)%matrix)) THEN
65 CALL dbcsr_deallocate_matrix(kpp1_env%v_ao(ispin)%matrix)
66 END IF
67 END DO
68 DEALLOCATE (kpp1_env%v_ao)
69 END IF
70 IF (ASSOCIATED(kpp1_env%deriv_set)) THEN
71 CALL xc_dset_release(kpp1_env%deriv_set)
72 DEALLOCATE (kpp1_env%deriv_set)
73 NULLIFY (kpp1_env%deriv_set)
74 END IF
75 IF (ASSOCIATED(kpp1_env%rho_set)) THEN
76 CALL xc_rho_set_release(kpp1_env%rho_set)
77 DEALLOCATE (kpp1_env%rho_set)
78 NULLIFY (kpp1_env%rho_set)
79 END IF
80 IF (ASSOCIATED(kpp1_env%deriv_set_admm)) THEN
81 CALL xc_dset_release(kpp1_env%deriv_set_admm)
82 DEALLOCATE (kpp1_env%deriv_set_admm)
83 NULLIFY (kpp1_env%deriv_set_admm)
84 END IF
85 IF (ASSOCIATED(kpp1_env%rho_set_admm)) THEN
86 CALL xc_rho_set_release(kpp1_env%rho_set_admm)
87 DEALLOCATE (kpp1_env%rho_set_admm)
88 NULLIFY (kpp1_env%rho_set_admm)
89 END IF
90 END SUBROUTINE kpp1_release
91
92END MODULE qs_kpp1_env_types
basis types for the calculation of the perturbation of density theory.
subroutine, public kpp1_release(kpp1_env)
releases a kpp1_env (see doc/ReferenceCounting.html)
represent a group ofunctional derivatives
subroutine, public xc_dset_release(derivative_set)
releases a derivative set
contains the structure
subroutine, public xc_rho_set_release(rho_set, pw_pool)
releases the given rho_set
environment that keeps the informations and temporary val to build the kpp1 kernel matrix
A derivative set contains the different derivatives of a xc-functional in form of a linked list.
represent a density, with all the representation and data needed to perform a functional evaluation