(git:ed6f26b)
Loading...
Searching...
No Matches
fist_energy_types.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \par History
10!> JGH (11.08.2002) exchange and correlation energy now in exc
11!> \author MK (13.06.2002)
12! **************************************************************************************************
14
15 USE kinds, ONLY: dp
16#include "./base/base_uses.f90"
17
18 IMPLICIT NONE
19 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'fist_energy_types'
20
21 PRIVATE
22
23! **************************************************************************************************
25 REAL(kind=dp) :: kin = 0.0_dp, pot = 0.0_dp, e_gspace = 0.0_dp, e_self = 0.0_dp, &
26 e_neut = 0.0_dp, e_bonded = 0.0_dp, e_induction = 0.0_dp
27 REAL(kind=dp) :: kin_shell = 0.0_dp, harm_shell = 0.0_dp
28 END TYPE fist_energy_type
29
30! *** Public data types ***
31
32 PUBLIC :: fist_energy_type
33
34! *** Public subroutines ***
35
36 PUBLIC :: allocate_fist_energy, &
38
39CONTAINS
40
41! **************************************************************************************************
42!> \brief Allocate and/or initialise a Fist energy data structure.
43!> \param fist_energy ...
44!> \date 13.06.2002
45!> \author MK
46!> \version 1.0
47! **************************************************************************************************
48 SUBROUTINE allocate_fist_energy(fist_energy)
49 TYPE(fist_energy_type), POINTER :: fist_energy
50
51 IF (.NOT. ASSOCIATED(fist_energy)) THEN
52 ALLOCATE (fist_energy)
53 END IF
54
55 CALL init_fist_energy(fist_energy)
56
57 END SUBROUTINE allocate_fist_energy
58
59! **************************************************************************************************
60!> \brief Deallocate a Fist energy data structure.
61!> \param fist_energy ...
62!> \date 13.06.2002
63!> \author MK
64!> \version 1.0
65! **************************************************************************************************
66 SUBROUTINE deallocate_fist_energy(fist_energy)
67 TYPE(fist_energy_type), POINTER :: fist_energy
68
69 IF (ASSOCIATED(fist_energy)) THEN
70 DEALLOCATE (fist_energy)
71 ELSE
72 CALL cp_abort(__location__, &
73 "The fist_energy pointer is not associated "// &
74 "and cannot be deallocated.")
75 END IF
76
77 END SUBROUTINE deallocate_fist_energy
78
79! **************************************************************************************************
80!> \brief Initialise a Fist energy data structure.
81!> \param fist_energy ...
82!> \date 13.06.2002
83!> \author MK
84!> \version 1.0
85! **************************************************************************************************
86 SUBROUTINE init_fist_energy(fist_energy)
87 TYPE(fist_energy_type), POINTER :: fist_energy
88
89 IF (ASSOCIATED(fist_energy)) THEN
90 fist_energy%kin = 0.0_dp
91 fist_energy%pot = 0.0_dp
92 fist_energy%e_gspace = 0.0_dp
93 fist_energy%e_self = 0.0_dp
94 fist_energy%e_neut = 0.0_dp
95 fist_energy%e_bonded = 0.0_dp
96 fist_energy%e_induction = 0.0_dp
97 fist_energy%kin_shell = 0.0_dp
98 fist_energy%harm_shell = 0.0_dp
99 ELSE
100 CALL cp_abort(__location__, &
101 "The fist_energy pointer is not associated "// &
102 "and cannot be initialised.")
103 END IF
104
105 END SUBROUTINE init_fist_energy
106
107END MODULE fist_energy_types
subroutine, public allocate_fist_energy(fist_energy)
Allocate and/or initialise a Fist energy data structure.
subroutine, public deallocate_fist_energy(fist_energy)
Deallocate a Fist energy data structure.
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34