Octopus
pseudo_set.F90
Go to the documentation of this file.
1!! Copyright (C) 2018 X. Andrade
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the Lesser GNU General Public License as published by
5!! the Free Software Foundation; either version 3, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
23 use global_oct_m
24
25 implicit none
26
27 private
28
29 public :: &
38
39 !! Dummy data type for pseudopotential sets. The actual data type is a C++ class, defined in set.hpp.
41 type pseudo_set_t
42 private
43 integer(int64) :: dummy
44 end type pseudo_set_t
45
46 interface
47
49 subroutine pseudo_set_nullify(pseudo_set)
50 import :: pseudo_set_t
51 implicit none
52
53 type(pseudo_set_t), intent(inout) :: pseudo_set
54 end subroutine pseudo_set_nullify
55
56 ! -------------------------------------------------
57
59 subroutine pseudo_set_end(pseudo_set)
60 import :: pseudo_set_t
61 implicit none
62
63 type(pseudo_set_t), intent(inout) :: pseudo_set
64 end subroutine pseudo_set_end
65
66 ! -------------------------------------------------
67
68 integer function pseudo_set_lmax(pseudo_set, element)
70 import :: pseudo_set_t
71 implicit none
72
73 type(pseudo_set_t), intent(in) :: pseudo_set
74 type(element_t), intent(in) :: element
75 end function pseudo_set_lmax
76
77 ! -------------------------------------------------
78
79 integer function pseudo_set_llocal(pseudo_set, element)
81 import :: pseudo_set_t
82 implicit none
83
84 type(pseudo_set_t), intent(in) :: pseudo_set
85 type(element_t), intent(in) :: element
86 end function pseudo_set_llocal
87
88 end interface
89
90
91contains
92
93 subroutine pseudo_set_init(pseudo_set, dirname, ierr)
94 type(pseudo_set_t), intent(out) :: pseudo_set
95 character(len=*), intent(in) :: dirname
96 integer, intent(out) :: ierr
97
98 interface
99 subroutine pseudo_set_init_low(pseudo_set, dirname, ierr)
100 import :: pseudo_set_t
101 implicit none
102
103 type(pseudo_set_t), intent(out) :: pseudo_set
104 character(len=*), intent(in) :: dirname
105 integer, intent(out) :: ierr
106 end subroutine pseudo_set_init_low
107 end interface
108
109 call pseudo_set_init_low(pseudo_set, dirname, ierr)
110
111 end subroutine pseudo_set_init
112
113 ! -----------------------------------------------------------------------
115 logical function pseudo_set_has(pseudo_set, element)
116 type(pseudo_set_t), intent(in) :: pseudo_set
117 type(element_t), intent(in) :: element
118
119 interface
120 integer function pseudo_set_has_low(pseudo_set, element)
121 use element_oct_m
122 import :: pseudo_set_t
123 implicit none
124
125 type(pseudo_set_t), intent(in) :: pseudo_set
126 type(element_t), intent(in) :: element
127 end function pseudo_set_has_low
128 end interface
129
130 pseudo_set_has = pseudo_set_has_low(pseudo_set, element) /= 0
131
132 end function pseudo_set_has
133
134 ! -----------------------------------------------------------------
135
136 character(len=MAX_PATH_LEN) function pseudo_set_file_path(pseudo_set, element)
137 type(pseudo_set_t), intent(in) :: pseudo_set
138 type(element_t), intent(in) :: element
139
140 interface
141 subroutine pseudo_set_file_path_low(pseudo_set, element, path)
143 import :: pseudo_set_t
144 implicit none
145
146 type(pseudo_set_t), intent(in) :: pseudo_set
147 type(element_t), intent(in) :: element
148 character(len=*), intent(out) :: path
149 end subroutine pseudo_set_file_path_low
150 end interface
151
152 call pseudo_set_file_path_low(pseudo_set, element, pseudo_set_file_path)
153
154 end function pseudo_set_file_path
155
156end module pseudo_set_oct_m
157
158!! Local Variables:
159!! mode: f90
160!! coding: utf-8
161!! End:
Delete the C++ object.
Definition: pseudo_set.F90:152
Nullify the C++ pointer.
Definition: pseudo_set.F90:142
subroutine, public pseudo_set_init(pseudo_set, dirname, ierr)
Definition: pseudo_set.F90:187
character(len=max_path_len) function, public pseudo_set_file_path(pseudo_set, element)
Definition: pseudo_set.F90:230
logical function, public pseudo_set_has(pseudo_set, element)
Definition: pseudo_set.F90:209
The integer(int64) dummy reserves the memory for the pointer to the actual data structure.
Definition: pseudo_set.F90:134