11 #include "./base/base_uses.f90"
17 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_rho_atom_types'
20 REAL(dp),
DIMENSION(:, :),
POINTER :: r_coef => null()
21 END TYPE rho_atom_coeff
24 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: cpc_h => null()
25 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: cpc_s => null()
26 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: rho_rad_h => null()
27 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: rho_rad_s => null()
28 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: vrho_rad_h => null()
29 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: vrho_rad_s => null()
30 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: drho_rad_h => null()
31 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: drho_rad_s => null()
32 TYPE(rho_atom_coeff),
DIMENSION(:, :),
POINTER :: rho_rad_h_d => null()
33 TYPE(rho_atom_coeff),
DIMENSION(:, :),
POINTER :: rho_rad_s_d => null()
34 INTEGER :: rhoa_of_atom = -1
35 REAL(dp) :: exc_h = 0.0_dp
36 REAL(dp) :: exc_s = 0.0_dp
37 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: ga_Vlocal_gb_h => null()
38 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: ga_Vlocal_gb_s => null()
39 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: int_scr_h => null()
40 TYPE(rho_atom_coeff),
DIMENSION(:),
POINTER :: int_scr_s => null()
41 END TYPE rho_atom_type
44 TYPE(rho_atom_type),
POINTER :: rho_atom => null()
45 END TYPE rho_atom_p_type
58 TYPE(rho_atom_type),
DIMENSION(:),
POINTER :: rho_atom_set
60 INTEGER :: i, iat, j, n, natom
62 IF (
ASSOCIATED(rho_atom_set))
THEN
64 natom =
SIZE(rho_atom_set)
67 IF (
ASSOCIATED(rho_atom_set(iat)%cpc_h))
THEN
68 IF (
ASSOCIATED(rho_atom_set(iat)%cpc_h(1)%r_coef))
THEN
69 n =
SIZE(rho_atom_set(iat)%cpc_h, 1)
71 DEALLOCATE (rho_atom_set(iat)%cpc_h(i)%r_coef)
72 DEALLOCATE (rho_atom_set(iat)%cpc_s(i)%r_coef)
75 DEALLOCATE (rho_atom_set(iat)%cpc_h)
76 DEALLOCATE (rho_atom_set(iat)%cpc_s)
78 IF (
ASSOCIATED(rho_atom_set(iat)%ga_Vlocal_gb_h))
THEN
79 IF (
ASSOCIATED(rho_atom_set(iat)%ga_Vlocal_gb_h(1)%r_coef))
THEN
80 n =
SIZE(rho_atom_set(iat)%ga_Vlocal_gb_h, 1)
82 DEALLOCATE (rho_atom_set(iat)%ga_Vlocal_gb_h(i)%r_coef)
83 DEALLOCATE (rho_atom_set(iat)%ga_Vlocal_gb_s(i)%r_coef)
86 DEALLOCATE (rho_atom_set(iat)%ga_Vlocal_gb_h)
87 DEALLOCATE (rho_atom_set(iat)%ga_Vlocal_gb_s)
89 IF (
ASSOCIATED(rho_atom_set(iat)%int_scr_h))
THEN
90 IF (
ASSOCIATED(rho_atom_set(iat)%int_scr_h(1)%r_coef))
THEN
91 n =
SIZE(rho_atom_set(iat)%int_scr_h, 1)
93 DEALLOCATE (rho_atom_set(iat)%int_scr_h(i)%r_coef)
94 DEALLOCATE (rho_atom_set(iat)%int_scr_s(i)%r_coef)
97 DEALLOCATE (rho_atom_set(iat)%int_scr_h)
98 DEALLOCATE (rho_atom_set(iat)%int_scr_s)
101 IF (
ASSOCIATED(rho_atom_set(iat)%drho_rad_h))
THEN
102 IF (
ASSOCIATED(rho_atom_set(iat)%drho_rad_h(1)%r_coef))
THEN
103 n =
SIZE(rho_atom_set(iat)%drho_rad_h, 1)
105 DEALLOCATE (rho_atom_set(iat)%drho_rad_h(i)%r_coef)
106 DEALLOCATE (rho_atom_set(iat)%drho_rad_s(i)%r_coef)
108 DEALLOCATE (rho_atom_set(iat)%rho_rad_h_d(j, i)%r_coef)
109 DEALLOCATE (rho_atom_set(iat)%rho_rad_s_d(j, i)%r_coef)
113 DEALLOCATE (rho_atom_set(iat)%drho_rad_h)
114 DEALLOCATE (rho_atom_set(iat)%drho_rad_s)
115 DEALLOCATE (rho_atom_set(iat)%rho_rad_h_d)
116 DEALLOCATE (rho_atom_set(iat)%rho_rad_s_d)
119 IF (
ASSOCIATED(rho_atom_set(iat)%rho_rad_h))
THEN
120 IF (
ASSOCIATED(rho_atom_set(iat)%rho_rad_h(1)%r_coef))
THEN
121 n =
SIZE(rho_atom_set(iat)%rho_rad_h)
123 DEALLOCATE (rho_atom_set(iat)%rho_rad_h(i)%r_coef)
126 DEALLOCATE (rho_atom_set(iat)%rho_rad_h)
129 IF (
ASSOCIATED(rho_atom_set(iat)%rho_rad_s))
THEN
130 IF (
ASSOCIATED(rho_atom_set(iat)%rho_rad_s(1)%r_coef))
THEN
131 n =
SIZE(rho_atom_set(iat)%rho_rad_s)
133 DEALLOCATE (rho_atom_set(iat)%rho_rad_s(i)%r_coef)
136 DEALLOCATE (rho_atom_set(iat)%rho_rad_s)
139 IF (
ASSOCIATED(rho_atom_set(iat)%vrho_rad_h))
THEN
140 IF (
ASSOCIATED(rho_atom_set(iat)%vrho_rad_h(1)%r_coef))
THEN
141 n =
SIZE(rho_atom_set(iat)%vrho_rad_h)
143 DEALLOCATE (rho_atom_set(iat)%vrho_rad_h(i)%r_coef)
146 DEALLOCATE (rho_atom_set(iat)%vrho_rad_h)
149 IF (
ASSOCIATED(rho_atom_set(iat)%vrho_rad_s))
THEN
150 IF (
ASSOCIATED(rho_atom_set(iat)%vrho_rad_s(1)%r_coef))
THEN
151 n =
SIZE(rho_atom_set(iat)%vrho_rad_s)
153 DEALLOCATE (rho_atom_set(iat)%vrho_rad_s(i)%r_coef)
156 DEALLOCATE (rho_atom_set(iat)%vrho_rad_s)
161 DEALLOCATE (rho_atom_set)
165 CALL cp_abort(__location__, &
166 "The pointer rho_atom_set is not associated and "// &
167 "cannot be deallocated")
191 SUBROUTINE get_rho_atom(rho_atom, cpc_h, cpc_s, rho_rad_h, rho_rad_s, &
192 drho_rad_h, drho_rad_s, vrho_rad_h, vrho_rad_s, &
193 rho_rad_h_d, rho_rad_s_d, ga_Vlocal_gb_h, ga_Vlocal_gb_s, &
194 int_scr_h, int_scr_s)
196 TYPE(rho_atom_type),
INTENT(IN),
POINTER :: rho_atom
197 TYPE(rho_atom_coeff),
DIMENSION(:),
OPTIONAL, &
198 POINTER :: cpc_h, cpc_s, rho_rad_h, rho_rad_s, &
199 drho_rad_h, drho_rad_s, vrho_rad_h, &
201 TYPE(rho_atom_coeff),
DIMENSION(:, :),
OPTIONAL, &
202 POINTER :: rho_rad_h_d, rho_rad_s_d
203 TYPE(rho_atom_coeff),
DIMENSION(:),
OPTIONAL, &
204 POINTER :: ga_vlocal_gb_h, ga_vlocal_gb_s, &
207 IF (
ASSOCIATED(rho_atom))
THEN
208 IF (
PRESENT(cpc_h)) cpc_h => rho_atom%cpc_h
209 IF (
PRESENT(cpc_s)) cpc_s => rho_atom%cpc_s
210 IF (
PRESENT(rho_rad_h)) rho_rad_h => rho_atom%rho_rad_h
211 IF (
PRESENT(rho_rad_s)) rho_rad_s => rho_atom%rho_rad_s
212 IF (
PRESENT(drho_rad_h)) drho_rad_h => rho_atom%drho_rad_h
213 IF (
PRESENT(drho_rad_s)) drho_rad_s => rho_atom%drho_rad_s
214 IF (
PRESENT(rho_rad_h_d)) rho_rad_h_d => rho_atom%rho_rad_h_d
215 IF (
PRESENT(rho_rad_s_d)) rho_rad_s_d => rho_atom%rho_rad_s_d
216 IF (
PRESENT(vrho_rad_h)) vrho_rad_h => rho_atom%vrho_rad_h
217 IF (
PRESENT(vrho_rad_s)) vrho_rad_s => rho_atom%vrho_rad_s
218 IF (
PRESENT(ga_vlocal_gb_h)) ga_vlocal_gb_h => rho_atom%ga_Vlocal_gb_h
219 IF (
PRESENT(ga_vlocal_gb_s)) ga_vlocal_gb_s => rho_atom%ga_Vlocal_gb_s
220 IF (
PRESENT(int_scr_h)) int_scr_h => rho_atom%int_scr_h
221 IF (
PRESENT(int_scr_s)) int_scr_s => rho_atom%int_scr_s
223 cpabort(
"The pointer rho_atom is not associated")
233 TYPE(rho_atom_type),
DIMENSION(:),
POINTER :: rho_atom_set
235 INTEGER :: i, iat, n, natom
237 IF (
ASSOCIATED(rho_atom_set))
THEN
238 natom =
SIZE(rho_atom_set)
240 IF (
ASSOCIATED(rho_atom_set(iat)%ga_Vlocal_gb_h))
THEN
241 IF (
ASSOCIATED(rho_atom_set(iat)%ga_Vlocal_gb_h(1)%r_coef))
THEN
242 n =
SIZE(rho_atom_set(iat)%ga_Vlocal_gb_h, 1)
244 rho_atom_set(iat)%ga_Vlocal_gb_h(i)%r_coef = 0.0_dp
248 IF (
ASSOCIATED(rho_atom_set(iat)%ga_Vlocal_gb_s))
THEN
249 IF (
ASSOCIATED(rho_atom_set(iat)%ga_Vlocal_gb_s(1)%r_coef))
THEN
250 n =
SIZE(rho_atom_set(iat)%ga_Vlocal_gb_s, 1)
252 rho_atom_set(iat)%ga_Vlocal_gb_s(i)%r_coef = 0.0_dp
Defines the basic variable types.
integer, parameter, public dp
subroutine, public get_rho_atom(rho_atom, cpc_h, cpc_s, rho_rad_h, rho_rad_s, drho_rad_h, drho_rad_s, vrho_rad_h, vrho_rad_s, rho_rad_h_d, rho_rad_s_d, ga_Vlocal_gb_h, ga_Vlocal_gb_s, int_scr_h, int_scr_s)
...
subroutine, public deallocate_rho_atom_set(rho_atom_set)
...
subroutine, public zero_rho_atom_integrals(rho_atom_set)
...