33#include "../base/base_uses.f90"
41 CHARACTER(LEN=*),
PARAMETER,
PRIVATE :: moduleN =
'atomic_kind_types'
47 CHARACTER(LEN=default_string_length) :: name =
""
48 CHARACTER(LEN=2) :: element_symbol =
""
49 REAL(kind=
dp) :: mass = 0.0_dp
50 INTEGER :: kind_number = -1
52 INTEGER,
DIMENSION(:),
POINTER :: atom_list => null()
53 LOGICAL :: shell_active = .false.
82 INTEGER :: ikind, nkind
84 IF (.NOT.
ASSOCIATED(atomic_kind_set))
THEN
85 CALL cp_abort(__location__, &
86 "The pointer atomic_kind_set is not associated and "// &
87 "cannot be deallocated")
90 nkind =
SIZE(atomic_kind_set)
93 IF (
ASSOCIATED(atomic_kind_set(ikind)%fist_potential))
THEN
96 IF (
ASSOCIATED(atomic_kind_set(ikind)%atom_list))
THEN
97 DEALLOCATE (atomic_kind_set(ikind)%atom_list)
99 IF (
ASSOCIATED(atomic_kind_set(ikind)%shell))
DEALLOCATE (atomic_kind_set(ikind)%shell)
103 DEALLOCATE (atomic_kind_set)
128 element_symbol, name, mass, kind_number, natom, atom_list, &
129 rcov, rvdw, z, qeff, apol, cpol, mm_radius, &
130 shell, shell_active, damping)
134 CHARACTER(LEN=2),
INTENT(OUT),
OPTIONAL :: element_symbol
135 CHARACTER(LEN=default_string_length), &
136 INTENT(OUT),
OPTIONAL :: name
137 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: mass
138 INTEGER,
INTENT(OUT),
OPTIONAL :: kind_number, natom
139 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: atom_list
140 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: rcov, rvdw
141 INTEGER,
INTENT(OUT),
OPTIONAL :: z
142 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: qeff, apol, cpol, mm_radius
144 LOGICAL,
INTENT(OUT),
OPTIONAL :: shell_active
147 IF (
PRESENT(fist_potential)) fist_potential => atomic_kind%fist_potential
148 IF (
PRESENT(element_symbol)) element_symbol = atomic_kind%element_symbol
149 IF (
PRESENT(name)) name = atomic_kind%name
150 IF (
PRESENT(mass)) mass = atomic_kind%mass
151 IF (
PRESENT(kind_number)) kind_number = atomic_kind%kind_number
152 IF (
PRESENT(natom)) natom = atomic_kind%natom
153 IF (
PRESENT(atom_list)) atom_list => atomic_kind%atom_list
158 IF (
PRESENT(rcov))
THEN
161 IF (
PRESENT(rvdw))
THEN
164 IF (
PRESENT(qeff))
THEN
165 IF (
ASSOCIATED(atomic_kind%fist_potential))
THEN
166 CALL get_potential(potential=atomic_kind%fist_potential, qeff=qeff)
171 IF (
PRESENT(apol))
THEN
172 IF (
ASSOCIATED(atomic_kind%fist_potential))
THEN
173 CALL get_potential(potential=atomic_kind%fist_potential, apol=apol)
178 IF (
PRESENT(cpol))
THEN
179 IF (
ASSOCIATED(atomic_kind%fist_potential))
THEN
180 CALL get_potential(potential=atomic_kind%fist_potential, cpol=cpol)
185 IF (
PRESENT(mm_radius))
THEN
186 IF (
ASSOCIATED(atomic_kind%fist_potential))
THEN
187 CALL get_potential(potential=atomic_kind%fist_potential, mm_radius=mm_radius)
189 mm_radius = -huge(0.0_dp)
192 IF (
PRESENT(shell)) shell => atomic_kind%shell
193 IF (
PRESENT(shell_active)) shell_active = atomic_kind%shell_active
194 IF (
PRESENT(damping)) damping => atomic_kind%damping
214 natom, nshell, fist_potential_present, shell_present, &
215 shell_adiabatic, shell_check_distance, damping_present)
218 INTEGER,
ALLOCATABLE,
DIMENSION(:),
OPTIONAL :: atom_of_kind, kind_of, natom_of_kind
219 INTEGER,
INTENT(OUT),
OPTIONAL :: maxatom, natom, nshell
220 LOGICAL,
INTENT(OUT),
OPTIONAL :: fist_potential_present, shell_present, &
221 shell_adiabatic, shell_check_distance, &
224 INTEGER :: atom_a, iatom, ikind, my_natom
228 DO ikind = 1,
SIZE(atomic_kind_set)
229 my_natom = my_natom + atomic_kind_set(ikind)%natom
232 IF (
PRESENT(maxatom)) maxatom = 0
233 IF (
PRESENT(natom)) natom = my_natom
234 IF (
PRESENT(nshell)) nshell = 0
235 IF (
PRESENT(shell_present)) shell_present = .false.
236 IF (
PRESENT(shell_adiabatic)) shell_adiabatic = .false.
237 IF (
PRESENT(shell_check_distance)) shell_check_distance = .false.
238 IF (
PRESENT(damping_present)) damping_present = .false.
239 IF (
PRESENT(atom_of_kind))
THEN
240 ALLOCATE (atom_of_kind(my_natom))
243 IF (
PRESENT(kind_of))
THEN
244 ALLOCATE (kind_of(my_natom))
247 IF (
PRESENT(natom_of_kind))
THEN
248 ALLOCATE (natom_of_kind(
SIZE(atomic_kind_set)))
252 DO ikind = 1,
SIZE(atomic_kind_set)
253 associate(atomic_kind => atomic_kind_set(ikind))
254 IF (
PRESENT(maxatom))
THEN
255 maxatom = max(maxatom, atomic_kind%natom)
257 IF (
PRESENT(fist_potential_present))
THEN
258 IF (
ASSOCIATED(atomic_kind%fist_potential))
THEN
259 fist_potential_present = .true.
262 IF (
PRESENT(shell_present))
THEN
263 IF (
ASSOCIATED(atomic_kind%shell))
THEN
264 shell_present = .true.
267 IF (
PRESENT(shell_adiabatic) .AND.
ASSOCIATED(atomic_kind%shell))
THEN
268 IF (.NOT. shell_adiabatic)
THEN
269 shell_adiabatic = (atomic_kind%shell%massfrac /= 0.0_dp)
272 IF (
PRESENT(shell_check_distance) .AND.
ASSOCIATED(atomic_kind%shell))
THEN
273 IF (.NOT. shell_check_distance)
THEN
274 shell_check_distance = (atomic_kind%shell%max_dist > 0.0_dp)
277 IF (
PRESENT(damping_present))
THEN
278 IF (
ASSOCIATED(atomic_kind%damping))
THEN
279 damping_present = .true.
282 IF (
PRESENT(atom_of_kind))
THEN
283 DO iatom = 1, atomic_kind%natom
284 atom_a = atomic_kind%atom_list(iatom)
285 atom_of_kind(atom_a) = iatom
288 IF (
PRESENT(kind_of))
THEN
289 DO iatom = 1, atomic_kind%natom
290 atom_a = atomic_kind%atom_list(iatom)
291 kind_of(atom_a) = ikind
294 IF (
PRESENT(natom_of_kind))
THEN
295 natom_of_kind(ikind) = atomic_kind%natom
318 fist_potential, shell, &
319 shell_active, damping)
322 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: element_symbol, name
323 REAL(kind=dp),
INTENT(IN),
OPTIONAL :: mass
324 INTEGER,
INTENT(IN),
OPTIONAL :: kind_number, natom
325 INTEGER,
DIMENSION(:),
INTENT(IN),
OPTIONAL :: atom_list
326 TYPE(fist_potential_type),
OPTIONAL,
POINTER :: fist_potential
327 TYPE(shell_kind_type),
OPTIONAL,
POINTER :: shell
328 LOGICAL,
INTENT(IN),
OPTIONAL :: shell_active
329 TYPE(damping_p_type),
OPTIONAL,
POINTER :: damping
333 IF (
PRESENT(element_symbol)) atomic_kind%element_symbol = element_symbol
334 IF (
PRESENT(name)) atomic_kind%name = name
335 IF (
PRESENT(mass)) atomic_kind%mass = mass
336 IF (
PRESENT(kind_number)) atomic_kind%kind_number = kind_number
337 IF (
PRESENT(natom)) atomic_kind%natom = natom
338 IF (
PRESENT(atom_list))
THEN
341 IF (
ASSOCIATED(atomic_kind%atom_list))
THEN
342 DEALLOCATE (atomic_kind%atom_list)
344 ALLOCATE (atomic_kind%atom_list(n))
345 atomic_kind%atom_list(:) = atom_list(:)
346 atomic_kind%natom = n
348 cpabort(
"An invalid atom_list was supplied")
351 IF (
PRESENT(fist_potential)) atomic_kind%fist_potential => fist_potential
352 IF (
PRESENT(shell))
THEN
353 IF (
ASSOCIATED(atomic_kind%shell))
THEN
354 IF (.NOT.
ASSOCIATED(atomic_kind%shell, shell))
THEN
355 DEALLOCATE (atomic_kind%shell)
358 atomic_kind%shell => shell
360 IF (
PRESENT(shell_active)) atomic_kind%shell_active = shell_active
362 IF (
PRESENT(damping)) atomic_kind%damping => damping
376 res = trim(atomic_kind%element_symbol) ==
"H"
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
subroutine, public set_atomic_kind(atomic_kind, element_symbol, name, mass, kind_number, natom, atom_list, fist_potential, shell, shell_active, damping)
Set the components of an atomic kind data set.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
subroutine, public deallocate_atomic_kind_set(atomic_kind_set)
Destructor routine for a set of atomic kinds.
elemental logical function, public is_hydrogen(atomic_kind)
Determines if the atomic_kind is HYDROGEN.
subroutine, public damping_p_release(damping)
Release Data-structure that contains damping information.
Definition of the atomic potential types.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Periodic Table related data definitions.
subroutine, public get_ptable_info(symbol, number, amass, ielement, covalent_radius, metallic_radius, vdw_radius, found)
Pass information about the kind given the element symbol.
Provides all information about an atomic kind.