File: kim_compute_arguments_module.f90

package info (click to toggle)
kim-api 2.0~beta2.gita734d1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,944 kB
  • sloc: cpp: 22,447; f90: 13,218; ansic: 3,865; sh: 1,960; makefile: 298
file content (300 lines) | stat: -rw-r--r-- 12,737 bytes parent folder | download
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
!
! CDDL HEADER START
!
! The contents of this file are subject to the terms of the Common Development
! and Distribution License Version 1.0 (the "License").
!
! You can obtain a copy of the license at
! http://www.opensource.org/licenses/CDDL-1.0.  See the License for the
! specific language governing permissions and limitations under the License.
!
! When distributing Covered Code, include this CDDL HEADER in each file and
! include the License file in a prominent location with the name LICENSE.CDDL.
! If applicable, add the following below this CDDL HEADER, with the fields
! enclosed by brackets "[]" replaced with your own identifying information:
!
! Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
!
! CDDL HEADER END
!

!
! Copyright (c) 2016--2018, Regents of the University of Minnesota.
! All rights reserved.
!
! Contributors:
!    Ryan S. Elliott
!

!
! Release: This file is part of the kim-api.git repository.
!


module kim_compute_arguments_module
  use, intrinsic :: iso_c_binding
  implicit none
  private

  public &
    kim_compute_arguments_handle_type, &
    kim_compute_arguments_null_handle, &
    operator (.eq.), &
    operator (.ne.), &
    kim_compute_arguments_get_argument_support_status, &
    kim_compute_arguments_get_callback_support_status, &
    kim_compute_arguments_set_argument_pointer, &
    kim_compute_arguments_set_callback_pointer, &
    kim_compute_arguments_are_all_required_present, &
    kim_compute_arguments_set_simulator_buffer_pointer, &
    kim_compute_arguments_get_simulator_buffer_pointer, &
    kim_compute_arguments_string, &
    kim_compute_arguments_set_log_id, &
    kim_compute_arguments_push_log_verbosity, &
    kim_compute_arguments_pop_log_verbosity

  type, bind(c) :: kim_compute_arguments_handle_type
    type(c_ptr) :: p = c_null_ptr
  end type kim_compute_arguments_handle_type

  type(kim_compute_arguments_handle_type), protected, save &
    :: kim_compute_arguments_null_handle

  interface operator (.eq.)
    logical function kim_compute_arguments_handle_equal(left, right)
      use, intrinsic :: iso_c_binding
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: left
      type(kim_compute_arguments_handle_type), intent(in) :: right
    end function kim_compute_arguments_handle_equal
  end interface operator (.eq.)

  interface operator (.ne.)
    logical function kim_compute_arguments_handle_not_equal(left, right)
      use, intrinsic :: iso_c_binding
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: left
      type(kim_compute_arguments_handle_type), intent(in) :: right
    end function kim_compute_arguments_handle_not_equal
  end interface operator (.ne.)

  interface kim_compute_arguments_set_argument_pointer
    subroutine kim_compute_arguments_set_argument_pointer_int0( &
      compute_arguments_handle, compute_argument_name, int0, ierr)
      use, intrinsic :: iso_c_binding
      use kim_compute_argument_name_module, only : &
        kim_compute_argument_name_type
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(kim_compute_argument_name_type), intent(in), value :: &
        compute_argument_name
      integer(c_int), intent(in), target :: int0
      integer(c_int), intent(out) :: ierr
    end subroutine kim_compute_arguments_set_argument_pointer_int0

    subroutine kim_compute_arguments_set_argument_pointer_int1( &
      compute_arguments_handle, &
      compute_argument_name, int1, ierr)
      use, intrinsic :: iso_c_binding
      use kim_compute_argument_name_module, only : &
        kim_compute_argument_name_type
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(kim_compute_argument_name_type), intent(in), value :: &
        compute_argument_name
      integer(c_int), intent(in), target :: int1(:)
      integer(c_int), intent(out) :: ierr
    end subroutine kim_compute_arguments_set_argument_pointer_int1

    subroutine kim_compute_arguments_set_argument_pointer_int2( &
      compute_arguments_handle, compute_argument_name, int2, ierr)
      use, intrinsic :: iso_c_binding
      use kim_compute_argument_name_module, only : &
        kim_compute_argument_name_type
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(kim_compute_argument_name_type), intent(in), value :: &
        compute_argument_name
      integer(c_int), intent(in), target :: int2(:,:)
      integer(c_int), intent(out) :: ierr
    end subroutine kim_compute_arguments_set_argument_pointer_int2

    subroutine kim_compute_arguments_set_argument_pointer_double0( &
      compute_arguments_handle, compute_argument_name, double0, ierr)
      use, intrinsic :: iso_c_binding
      use kim_compute_argument_name_module, only : &
        kim_compute_argument_name_type
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(kim_compute_argument_name_type), intent(in), value :: &
        compute_argument_name
      real(c_double), intent(in), target :: double0
      integer(c_int), intent(out) :: ierr
    end subroutine kim_compute_arguments_set_argument_pointer_double0

    subroutine kim_compute_arguments_set_argument_pointer_double1( &
      compute_arguments_handle, compute_argument_name, double1, ierr)
      use, intrinsic :: iso_c_binding
      use kim_compute_argument_name_module, only : &
        kim_compute_argument_name_type
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(kim_compute_argument_name_type), intent(in), value :: &
        compute_argument_name
      real(c_double), intent(in), target :: double1(:)
      integer(c_int), intent(out) :: ierr
    end subroutine kim_compute_arguments_set_argument_pointer_double1

    subroutine kim_compute_arguments_set_argument_pointer_double2( &
      compute_arguments_handle, compute_argument_name, double2, ierr)
      use, intrinsic :: iso_c_binding
      use kim_compute_argument_name_module, only : &
        kim_compute_argument_name_type
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(kim_compute_argument_name_type), intent(in), value :: &
        compute_argument_name
      real(c_double), intent(in), target :: double2(:,:)
      integer(c_int), intent(out) :: ierr
    end subroutine kim_compute_arguments_set_argument_pointer_double2
  end interface kim_compute_arguments_set_argument_pointer

  interface
    subroutine kim_compute_arguments_get_argument_support_status( &
      compute_arguments_handle, compute_argument_name, support_status, ierr)
      use, intrinsic :: iso_c_binding
      use kim_compute_argument_name_module, only : &
        kim_compute_argument_name_type
      use kim_support_status_module, only : kim_support_status_type
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(kim_compute_argument_name_type), intent(in), value :: &
        compute_argument_name
      type(kim_support_status_type), intent(out) :: support_status
      integer(c_int), intent(out) :: ierr
    end subroutine kim_compute_arguments_get_argument_support_status

    subroutine kim_compute_arguments_get_callback_support_status( &
      compute_arguments_handle, compute_callback_name, support_status, ierr)
      use, intrinsic :: iso_c_binding
      use kim_compute_callback_name_module, only : &
        kim_compute_callback_name_type
      use kim_support_status_module, only : kim_support_status_type
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(kim_compute_callback_name_type), intent(in), value :: &
        compute_callback_name
      type(kim_support_status_type), intent(out) :: support_status
      integer(c_int), intent(out) :: ierr
    end subroutine kim_compute_arguments_get_callback_support_status

    subroutine kim_compute_arguments_set_callback_pointer( &
      compute_arguments_handle, compute_callback_name, language_name, fptr, &
      data_object, ierr)
      use, intrinsic :: iso_c_binding
      use kim_compute_callback_name_module, only : &
        kim_compute_callback_name_type
      use kim_language_name_module, only : kim_language_name_type
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(kim_compute_callback_name_type), intent(in), value :: &
        compute_callback_name
      type(kim_language_name_type), intent(in), value :: language_name
      type(c_funptr), intent(in), value :: fptr
      type(c_ptr), intent(in), value :: data_object
      integer(c_int), intent(out) :: ierr
    end subroutine kim_compute_arguments_set_callback_pointer

    subroutine kim_compute_arguments_are_all_required_present( &
      compute_arguments_handle, result_value, ierr)
      ! name is not consistent with c/c++ due to Fortran 2003
      ! identifier length limits
      use, intrinsic :: iso_c_binding
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      integer(c_int), intent(out) :: result_value
      integer(c_int), intent(out) :: ierr
    end subroutine kim_compute_arguments_are_all_required_present

    subroutine kim_compute_arguments_set_simulator_buffer_pointer( &
      compute_arguments_handle, ptr)
      use, intrinsic :: iso_c_binding
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(c_ptr), intent(in), value :: ptr
    end subroutine kim_compute_arguments_set_simulator_buffer_pointer

    subroutine kim_compute_arguments_get_simulator_buffer_pointer( &
      compute_arguments_handle, ptr)
      use, intrinsic :: iso_c_binding
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(c_ptr), intent(out) :: ptr
    end subroutine kim_compute_arguments_get_simulator_buffer_pointer

    subroutine kim_compute_arguments_string(compute_arguments_handle, string)
      use, intrinsic :: iso_c_binding
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      character(len=*, kind=c_char), intent(out) :: string
    end subroutine kim_compute_arguments_string

    subroutine kim_compute_arguments_set_log_id(compute_arguments_handle, &
      log_id)
      use, intrinsic :: iso_c_binding
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      character(len=*, kind=c_char), intent(in) :: log_id
    end subroutine kim_compute_arguments_set_log_id

    subroutine kim_compute_arguments_push_log_verbosity( &
      compute_arguments_handle, log_verbosity)
      use, intrinsic :: iso_c_binding
      use kim_log_verbosity_module, only : kim_log_verbosity_type
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
      type(kim_log_verbosity_type), intent(in) :: log_verbosity
    end subroutine kim_compute_arguments_push_log_verbosity

    subroutine kim_compute_arguments_pop_log_verbosity(compute_arguments_handle)
      use, intrinsic :: iso_c_binding
      use kim_log_verbosity_module, only : kim_log_verbosity_type
      import kim_compute_arguments_handle_type
      implicit none
      type(kim_compute_arguments_handle_type), intent(in) :: &
        compute_arguments_handle
    end subroutine kim_compute_arguments_pop_log_verbosity
  end interface
end module kim_compute_arguments_module