-
Notifications
You must be signed in to change notification settings - Fork 1
/
exclusion_types.F
67 lines (58 loc) · 3 KB
/
exclusion_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
!--------------------------------------------------------------------------------------------------!
! 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 !
!--------------------------------------------------------------------------------------------------!
! **************************************************************************************************
!> \brief an exclusion type
! **************************************************************************************************
MODULE exclusion_types
#include "./base/base_uses.f90"
IMPLICIT NONE
PRIVATE
! **************************************************************************************************
!> \brief A type used to store lists of exclusions and onfos
!> \par History
!> 12.2010 created [Joost VandeVondele]
! **************************************************************************************************
TYPE exclusion_type
INTEGER, POINTER, DIMENSION(:) :: list_exclude_vdw => NULL()
INTEGER, POINTER, DIMENSION(:) :: list_exclude_ei => NULL()
INTEGER, POINTER, DIMENSION(:) :: list_onfo => NULL()
END TYPE
PUBLIC :: exclusion_type, &
exclusion_release
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'exclusion_types'
CONTAINS
! **************************************************************************************************
!> \brief Release exclusion type
!> \param exclusions ...
!> \par History
!> 12.2010 created [Teodoro Laino] - [email protected]
!> \author teo
! **************************************************************************************************
SUBROUTINE exclusion_release(exclusions)
TYPE(exclusion_type), DIMENSION(:), POINTER :: exclusions
INTEGER :: iatom
IF (ASSOCIATED(exclusions)) THEN
DO iatom = 1, SIZE(exclusions)
IF (ASSOCIATED(exclusions(iatom)%list_exclude_vdw, &
exclusions(iatom)%list_exclude_ei)) THEN
DEALLOCATE (exclusions(iatom)%list_exclude_vdw)
ELSE
IF (ASSOCIATED(exclusions(iatom)%list_exclude_vdw)) THEN
DEALLOCATE (exclusions(iatom)%list_exclude_vdw)
END IF
IF (ASSOCIATED(exclusions(iatom)%list_exclude_ei)) THEN
DEALLOCATE (exclusions(iatom)%list_exclude_ei)
END IF
END IF
IF (ASSOCIATED(exclusions(iatom)%list_onfo)) THEN
DEALLOCATE (exclusions(iatom)%list_onfo)
END IF
END DO
DEALLOCATE (exclusions)
END IF
END SUBROUTINE exclusion_release
END MODULE exclusion_types