(git:e7e05ae)
dg_types.F
Go to the documentation of this file.
1 !--------------------------------------------------------------------------------------------------!
2 ! CP2K: A general program to perform molecular dynamics simulations !
3 ! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4 ! !
5 ! SPDX-License-Identifier: GPL-2.0-or-later !
6 !--------------------------------------------------------------------------------------------------!
7 
8 ! **************************************************************************************************
9 !> \par History
10 !> none
11 ! **************************************************************************************************
12 MODULE dg_types
13 
14  USE dg_rho0_types, ONLY: dg_rho0_create,&
16  dg_rho0_type
17 #include "../base/base_uses.f90"
18 
19  IMPLICIT NONE
20 
21 ! Information on the assignment function for Ewald
22 ! **************************************************************************************************
23  TYPE dg_type
24  PRIVATE
25  TYPE(dg_rho0_type), POINTER :: dg_rho0 => null()
26  END TYPE dg_type
27 
28  CHARACTER(len=*), PARAMETER, PRIVATE :: modulen = 'dg_types'
29 
30  PRIVATE
31  PUBLIC :: dg_type, dg_get, &
32  dg_set, dg_release, &
33  dg_create
34 
35 CONTAINS
36 
37 ! **************************************************************************************************
38 !> \brief Get the dg_type
39 !> \param dg ...
40 !> \param dg_rho0 ...
41 !> \version 1.0
42 ! **************************************************************************************************
43  SUBROUTINE dg_get(dg, dg_rho0)
44  TYPE(dg_type), POINTER :: dg
45  TYPE(dg_rho0_type), OPTIONAL, POINTER :: dg_rho0
46 
47  IF (PRESENT(dg_rho0)) dg_rho0 => dg%dg_rho0
48 
49  END SUBROUTINE dg_get
50 
51 ! **************************************************************************************************
52 !> \brief create the dg structure
53 !> \param dg ...
54 !> \version 1.0
55 ! **************************************************************************************************
56  SUBROUTINE dg_create(dg)
57  TYPE(dg_type), INTENT(OUT) :: dg
58 
59  CALL dg_rho0_create(dg%dg_rho0)
60 
61  END SUBROUTINE dg_create
62 
63 ! **************************************************************************************************
64 !> \brief releases the given dg_type
65 !> \param dg the dg_type to release
66 !> \par History
67 !> 04.2003 created [fawzi]
68 !> \author fawzi
69 !> \note
70 !> see doc/ReferenceCounting.html
71 ! **************************************************************************************************
72  SUBROUTINE dg_release(dg)
73  TYPE(dg_type), INTENT(INOUT) :: dg
74 
75  CALL dg_rho0_release(dg%dg_rho0)
76  END SUBROUTINE dg_release
77 
78 ! **************************************************************************************************
79 !> \brief Set the double grid environment
80 !> \param dg ...
81 !> \param dg_rho0 ...
82 !> \version 1.0
83 ! **************************************************************************************************
84  SUBROUTINE dg_set(dg, dg_rho0)
85  TYPE(dg_type), POINTER :: dg
86  TYPE(dg_rho0_type), OPTIONAL, POINTER :: dg_rho0
87 
88  IF (PRESENT(dg_rho0)) THEN
89  CALL dg_rho0_release(dg%dg_rho0)
90  dg%dg_rho0 => dg_rho0
91  END IF
92  END SUBROUTINE dg_set
93 
94 END MODULE dg_types
subroutine, public dg_rho0_create(dg_rho0)
create the dg_rho0 structure
subroutine, public dg_rho0_release(dg_rho0)
releases the given dg_rho0_type
subroutine, public dg_get(dg, dg_rho0)
Get the dg_type.
Definition: dg_types.F:44
subroutine, public dg_create(dg)
create the dg structure
Definition: dg_types.F:57
subroutine, public dg_release(dg)
releases the given dg_type
Definition: dg_types.F:73
subroutine, public dg_set(dg, dg_rho0)
Set the double grid environment.
Definition: dg_types.F:85