(git:db0abe2)
Loading...
Searching...
No Matches
qs_oce_types.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7! **************************************************************************************************
9
12#include "./base/base_uses.f90"
13
14 IMPLICIT NONE
15
16 PRIVATE
17
18! *** Global parameters (only in this module)
19
20 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_oce_types'
21
22! *** Define a oce matrix type ***
23
24! **************************************************************************************************
26 TYPE(sap_int_type), DIMENSION(:), POINTER :: intac => null()
27 END TYPE oce_matrix_type
28
29! *** Public data types ***
30
31 PUBLIC :: oce_matrix_type
32
33! *** Public subroutines ***
34
35 PUBLIC :: allocate_oce_set, &
38
39CONTAINS
40
41! **************************************************************************************************
42!> \brief Allocate and initialize the matrix set of oce coefficients.
43!> \param oce_set ...
44!> \param nkind ...
45!> \version 1.0
46! **************************************************************************************************
47 SUBROUTINE allocate_oce_set(oce_set, nkind)
48 TYPE(oce_matrix_type), POINTER :: oce_set
49 INTEGER, INTENT(IN) :: nkind
50
51 INTEGER :: i
52
53 ALLOCATE (oce_set%intac(nkind*nkind))
54 DO i = 1, nkind*nkind
55 NULLIFY (oce_set%intac(i)%alist)
56 NULLIFY (oce_set%intac(i)%asort)
57 NULLIFY (oce_set%intac(i)%aindex)
58 END DO
59
60 END SUBROUTINE allocate_oce_set
61
62! **************************************************************************************************
63!> \brief ...
64!> \param oce_set ...
65! **************************************************************************************************
66 SUBROUTINE create_oce_set(oce_set)
67
68 TYPE(oce_matrix_type), POINTER :: oce_set
69
70 IF (ASSOCIATED(oce_set)) CALL deallocate_oce_set(oce_set)
71
72 ALLOCATE (oce_set)
73
74 NULLIFY (oce_set%intac)
75
76 END SUBROUTINE create_oce_set
77
78! **************************************************************************************************
79!> \brief Deallocate the matrix set of oce coefficients
80!> \param oce_set ...
81!> \date
82!> \author
83!> \version 1.0
84! **************************************************************************************************
85 SUBROUTINE deallocate_oce_set(oce_set)
86 TYPE(oce_matrix_type), POINTER :: oce_set
87
88 IF (.NOT. ASSOCIATED(oce_set)) RETURN
89
90 IF (ASSOCIATED(oce_set%intac)) CALL release_sap_int(oce_set%intac)
91
92 DEALLOCATE (oce_set)
93
94 END SUBROUTINE deallocate_oce_set
95
96! **************************************************************************************************
97
98END MODULE qs_oce_types
subroutine, public allocate_oce_set(oce_set, nkind)
Allocate and initialize the matrix set of oce coefficients.
subroutine, public create_oce_set(oce_set)
...
subroutine, public deallocate_oce_set(oce_set)
Deallocate the matrix set of oce coefficients.
General overlap type integrals containers.