KIM API V2
kim_compute_arguments_module.f90
Go to the documentation of this file.
1 !
2 ! CDDL HEADER START
3 !
4 ! The contents of this file are subject to the terms of the Common Development
5 ! and Distribution License Version 1.0 (the "License").
6 !
7 ! You can obtain a copy of the license at
8 ! http://www.opensource.org/licenses/CDDL-1.0. See the License for the
9 ! specific language governing permissions and limitations under the License.
10 !
11 ! When distributing Covered Code, include this CDDL HEADER in each file and
12 ! include the License file in a prominent location with the name LICENSE.CDDL.
13 ! If applicable, add the following below this CDDL HEADER, with the fields
14 ! enclosed by brackets "[]" replaced with your own identifying information:
15 !
16 ! Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
17 !
18 ! CDDL HEADER END
19 !
20 
21 !
22 ! Copyright (c) 2016--2018, Regents of the University of Minnesota.
23 ! All rights reserved.
24 !
25 ! Contributors:
26 ! Ryan S. Elliott
27 !
28 
29 !
30 ! Release: This file is part of the kim-api-v2.0.0-beta.0 package.
31 !
32 
33 
35  use, intrinsic :: iso_c_binding
36  implicit none
37  private
38 
39  public &
40  kim_compute_arguments_handle_type, &
42  operator (.eq.), &
43  operator (.ne.), &
46  kim_compute_arguments_set_argument_pointer, &
49  kim_compute_arguments_set_simulator_buffer_pointer, &
50  kim_compute_arguments_get_simulator_buffer_pointer, &
51  kim_compute_arguments_string, &
52  kim_compute_arguments_set_log_id, &
53  kim_compute_arguments_push_log_verbosity, &
55 
56  type, bind(c) :: kim_compute_arguments_handle_type
57  type(c_ptr) :: p = c_null_ptr
58  end type kim_compute_arguments_handle_type
59 
60  type(kim_compute_arguments_handle_type), protected &
62 
63  interface operator (.eq.)
64  logical function kim_compute_arguments_handle_equal(left, right)
65  use, intrinsic :: iso_c_binding
66  import kim_compute_arguments_handle_type
67  implicit none
68  type(kim_compute_arguments_handle_type), intent(in) :: left
69  type(kim_compute_arguments_handle_type), intent(in) :: right
70  end function kim_compute_arguments_handle_equal
71  end interface operator (.eq.)
72 
73  interface operator (.ne.)
74  logical function kim_compute_arguments_handle_not_equal(left, right)
75  use, intrinsic :: iso_c_binding
76  import kim_compute_arguments_handle_type
77  implicit none
78  type(kim_compute_arguments_handle_type), intent(in) :: left
79  type(kim_compute_arguments_handle_type), intent(in) :: right
80  end function kim_compute_arguments_handle_not_equal
81  end interface operator (.ne.)
82 
83  interface kim_compute_arguments_set_argument_pointer
84  subroutine kim_compute_arguments_set_argument_pointer_int0( &
85  compute_arguments_handle, compute_argument_name, int0, ierr)
86  use, intrinsic :: iso_c_binding
88  kim_compute_argument_name_type
89  import kim_compute_arguments_handle_type
90  implicit none
91  type(kim_compute_arguments_handle_type), intent(in) :: &
92  compute_arguments_handle
93  type(kim_compute_argument_name_type), intent(in), value :: &
94  compute_argument_name
95  integer(c_int), intent(in), target :: int0
96  integer(c_int), intent(out) :: ierr
97  end subroutine kim_compute_arguments_set_argument_pointer_int0
98 
99  subroutine kim_compute_arguments_set_argument_pointer_int1( &
100  compute_arguments_handle, &
101  compute_argument_name, int1, ierr)
102  use, intrinsic :: iso_c_binding
104  kim_compute_argument_name_type
105  import kim_compute_arguments_handle_type
106  implicit none
107  type(kim_compute_arguments_handle_type), intent(in) :: &
108  compute_arguments_handle
109  type(kim_compute_argument_name_type), intent(in), value :: &
110  compute_argument_name
111  integer(c_int), intent(in), target :: int1(:)
112  integer(c_int), intent(out) :: ierr
113  end subroutine kim_compute_arguments_set_argument_pointer_int1
114 
115  subroutine kim_compute_arguments_set_argument_pointer_int2( &
116  compute_arguments_handle, compute_argument_name, int2, ierr)
117  use, intrinsic :: iso_c_binding
119  kim_compute_argument_name_type
120  import kim_compute_arguments_handle_type
121  implicit none
122  type(kim_compute_arguments_handle_type), intent(in) :: &
123  compute_arguments_handle
124  type(kim_compute_argument_name_type), intent(in), value :: &
125  compute_argument_name
126  integer(c_int), intent(in), target :: int2(:,:)
127  integer(c_int), intent(out) :: ierr
128  end subroutine kim_compute_arguments_set_argument_pointer_int2
129 
130  subroutine kim_compute_arguments_set_argument_pointer_double0( &
131  compute_arguments_handle, compute_argument_name, double0, ierr)
132  use, intrinsic :: iso_c_binding
134  kim_compute_argument_name_type
135  import kim_compute_arguments_handle_type
136  implicit none
137  type(kim_compute_arguments_handle_type), intent(in) :: &
138  compute_arguments_handle
139  type(kim_compute_argument_name_type), intent(in), value :: &
140  compute_argument_name
141  real(c_double), intent(in), target :: double0
142  integer(c_int), intent(out) :: ierr
143  end subroutine kim_compute_arguments_set_argument_pointer_double0
144 
145  subroutine kim_compute_arguments_set_argument_pointer_double1( &
146  compute_arguments_handle, compute_argument_name, double1, ierr)
147  use, intrinsic :: iso_c_binding
149  kim_compute_argument_name_type
150  import kim_compute_arguments_handle_type
151  implicit none
152  type(kim_compute_arguments_handle_type), intent(in) :: &
153  compute_arguments_handle
154  type(kim_compute_argument_name_type), intent(in), value :: &
155  compute_argument_name
156  real(c_double), intent(in), target :: double1(:)
157  integer(c_int), intent(out) :: ierr
158  end subroutine kim_compute_arguments_set_argument_pointer_double1
159 
160  subroutine kim_compute_arguments_set_argument_pointer_double2( &
161  compute_arguments_handle, compute_argument_name, double2, ierr)
162  use, intrinsic :: iso_c_binding
164  kim_compute_argument_name_type
165  import kim_compute_arguments_handle_type
166  implicit none
167  type(kim_compute_arguments_handle_type), intent(in) :: &
168  compute_arguments_handle
169  type(kim_compute_argument_name_type), intent(in), value :: &
170  compute_argument_name
171  real(c_double), intent(in), target :: double2(:,:)
172  integer(c_int), intent(out) :: ierr
173  end subroutine kim_compute_arguments_set_argument_pointer_double2
174  end interface kim_compute_arguments_set_argument_pointer
175 
176  interface
178  compute_arguments_handle, compute_argument_name, support_status, ierr)
179  use, intrinsic :: iso_c_binding
181  kim_compute_argument_name_type
182  use kim_support_status_module, only : kim_support_status_type
183  import kim_compute_arguments_handle_type
184  implicit none
185  type(kim_compute_arguments_handle_type), intent(in) :: &
186  compute_arguments_handle
187  type(kim_compute_argument_name_type), intent(in), value :: &
188  compute_argument_name
189  type(kim_support_status_type), intent(out) :: support_status
190  integer(c_int), intent(out) :: ierr
192 
194  compute_arguments_handle, compute_callback_name, support_status, ierr)
195  use, intrinsic :: iso_c_binding
197  kim_compute_callback_name_type
198  use kim_support_status_module, only : kim_support_status_type
199  import kim_compute_arguments_handle_type
200  implicit none
201  type(kim_compute_arguments_handle_type), intent(in) :: &
202  compute_arguments_handle
203  type(kim_compute_callback_name_type), intent(in), value :: &
204  compute_callback_name
205  type(kim_support_status_type), intent(out) :: support_status
206  integer(c_int), intent(out) :: ierr
208 
210  compute_arguments_handle, compute_callback_name, language_name, fptr, &
211  data_object, ierr)
212  use, intrinsic :: iso_c_binding
214  kim_compute_callback_name_type
215  use kim_language_name_module, only : kim_language_name_type
216  import kim_compute_arguments_handle_type
217  implicit none
218  type(kim_compute_arguments_handle_type), intent(in) :: &
219  compute_arguments_handle
220  type(kim_compute_callback_name_type), intent(in), value :: &
221  compute_callback_name
222  type(kim_language_name_type), intent(in), value :: language_name
223  type(c_funptr), intent(in), value :: fptr
224  type(c_ptr), intent(in), value :: data_object
225  integer(c_int), intent(out) :: ierr
227 
229  compute_arguments_handle, result_value, ierr)
230  ! name is not consistent with c/c++ due to Fortran 2003
231  ! identifier length limits
232  use, intrinsic :: iso_c_binding
233  import kim_compute_arguments_handle_type
234  implicit none
235  type(kim_compute_arguments_handle_type), intent(in) :: &
236  compute_arguments_handle
237  integer(c_int), intent(out) :: result_value
238  integer(c_int), intent(out) :: ierr
240 
241  subroutine kim_compute_arguments_set_simulator_buffer_pointer( &
242  compute_arguments_handle, ptr)
243  use, intrinsic :: iso_c_binding
244  import kim_compute_arguments_handle_type
245  implicit none
246  type(kim_compute_arguments_handle_type), intent(in) :: &
247  compute_arguments_handle
248  type(c_ptr), intent(in), value :: ptr
249  end subroutine kim_compute_arguments_set_simulator_buffer_pointer
250 
251  subroutine kim_compute_arguments_get_simulator_buffer_pointer( &
252  compute_arguments_handle, ptr)
253  use, intrinsic :: iso_c_binding
254  import kim_compute_arguments_handle_type
255  implicit none
256  type(kim_compute_arguments_handle_type), intent(in) :: &
257  compute_arguments_handle
258  type(c_ptr), intent(out) :: ptr
259  end subroutine kim_compute_arguments_get_simulator_buffer_pointer
260 
261  subroutine kim_compute_arguments_string(compute_arguments_handle, string)
262  use, intrinsic :: iso_c_binding
263  import kim_compute_arguments_handle_type
264  implicit none
265  type(kim_compute_arguments_handle_type), intent(in) :: &
266  compute_arguments_handle
267  character(len=*, kind=c_char), intent(out) :: string
268  end subroutine kim_compute_arguments_string
269 
270  subroutine kim_compute_arguments_set_log_id(compute_arguments_handle, &
271  log_id)
272  use, intrinsic :: iso_c_binding
273  import kim_compute_arguments_handle_type
274  implicit none
275  type(kim_compute_arguments_handle_type), intent(in) :: &
276  compute_arguments_handle
277  character(len=*, kind=c_char), intent(in) :: log_id
278  end subroutine kim_compute_arguments_set_log_id
279 
280  subroutine kim_compute_arguments_push_log_verbosity( &
281  compute_arguments_handle, log_verbosity)
282  use, intrinsic :: iso_c_binding
283  use kim_log_verbosity_module, only : kim_log_verbosity_type
284  import kim_compute_arguments_handle_type
285  implicit none
286  type(kim_compute_arguments_handle_type), intent(in) :: &
287  compute_arguments_handle
288  type(kim_log_verbosity_type), intent(in) :: log_verbosity
289  end subroutine kim_compute_arguments_push_log_verbosity
290 
291  subroutine kim_compute_arguments_pop_log_verbosity(compute_arguments_handle)
292  use, intrinsic :: iso_c_binding
293  use kim_log_verbosity_module, only : kim_log_verbosity_type
294  import kim_compute_arguments_handle_type
295  implicit none
296  type(kim_compute_arguments_handle_type), intent(in) :: &
297  compute_arguments_handle
299  end interface
type(kim_compute_arguments_handle_type), public, protected kim_compute_arguments_null_handle