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