KIM API V2
kim_model_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.1 package.
31 !
32 
33 
35  use, intrinsic :: iso_c_binding
36  implicit none
37  private
38 
39  public &
40  kim_model_compute_arguments_handle_type, &
42  operator (.eq.), &
43  operator (.ne.), &
45  kim_model_compute_arguments_process_dedr_term, &
46  kim_model_compute_arguments_process_d2edr2_term, &
47  kim_model_compute_arguments_get_argument_pointer, &
48  kim_model_compute_arguments_is_callback_present, &
50  kim_model_compute_arguments_get_model_buffer_pointer, &
51  kim_model_compute_arguments_log_entry, &
53 
54  type, bind(c) :: kim_model_compute_arguments_handle_type
55  type(c_ptr) :: p = c_null_ptr
56  end type kim_model_compute_arguments_handle_type
57 
58  type(kim_model_compute_arguments_handle_type), protected &
60 
61  interface operator (.eq.)
62  logical function kim_model_compute_arguments_handle_equal(left, right)
63  use, intrinsic :: iso_c_binding
64  import kim_model_compute_arguments_handle_type
65  implicit none
66  type(kim_model_compute_arguments_handle_type), intent(in) :: left
67  type(kim_model_compute_arguments_handle_type), intent(in) :: right
68  end function kim_model_compute_arguments_handle_equal
69  end interface operator (.eq.)
70 
71  interface operator (.ne.)
72  logical function kim_model_compute_arguments_handle_not_equal(left, right)
73  use, intrinsic :: iso_c_binding
74  import kim_model_compute_arguments_handle_type
75  implicit none
76  type(kim_model_compute_arguments_handle_type), intent(in) :: left
77  type(kim_model_compute_arguments_handle_type), intent(in) :: right
78  end function kim_model_compute_arguments_handle_not_equal
79  end interface operator (.ne.)
80 
81  interface kim_model_compute_arguments_get_argument_pointer
82  subroutine kim_model_compute_arguments_get_argument_pointer_int0( &
83  model_compute_arguments_handle, compute_argument_name, int0, ierr)
84  use, intrinsic :: iso_c_binding
86  kim_compute_argument_name_type
87  import kim_model_compute_arguments_handle_type
88  implicit none
89  type(kim_model_compute_arguments_handle_type), intent(in) :: &
90  model_compute_arguments_handle
91  type(kim_compute_argument_name_type), intent(in), value :: &
92  compute_argument_name
93  integer(c_int), intent(out), pointer :: int0
94  integer(c_int), intent(out) :: ierr
95  end subroutine kim_model_compute_arguments_get_argument_pointer_int0
96 
97  subroutine kim_model_compute_arguments_get_argument_pointer_int1( &
98  model_compute_arguments_handle, compute_argument_name, extent1, int1, &
99  ierr)
100  use, intrinsic :: iso_c_binding
102  kim_compute_argument_name_type
103  import kim_model_compute_arguments_handle_type
104  implicit none
105  type(kim_model_compute_arguments_handle_type), intent(in) :: &
106  model_compute_arguments_handle
107  type(kim_compute_argument_name_type), intent(in), value :: &
108  compute_argument_name
109  integer(c_int), intent(in), value :: extent1
110  integer(c_int), intent(out), pointer :: int1(:)
111  integer(c_int), intent(out) :: ierr
112  end subroutine kim_model_compute_arguments_get_argument_pointer_int1
113 
114  subroutine kim_model_compute_arguments_get_argument_pointer_int2( &
115  model_compute_arguments_handle, compute_argument_name, extent1, extent2, &
116  int2, ierr)
117  use, intrinsic :: iso_c_binding
119  kim_compute_argument_name_type
120  import kim_model_compute_arguments_handle_type
121  implicit none
122  type(kim_model_compute_arguments_handle_type), intent(in) :: &
123  model_compute_arguments_handle
124  type(kim_compute_argument_name_type), intent(in), value :: &
125  compute_argument_name
126  integer(c_int), intent(in), value :: extent1
127  integer(c_int), intent(in), value :: extent2
128  integer(c_int), intent(out), pointer :: int2(:,:)
129  integer(c_int), intent(out) :: ierr
130  end subroutine kim_model_compute_arguments_get_argument_pointer_int2
131 
132  subroutine kim_model_compute_arguments_get_argument_pointer_double0( &
133  model_compute_arguments_handle, compute_argument_name, double0, ierr)
134  use, intrinsic :: iso_c_binding
136  kim_compute_argument_name_type
137  import kim_model_compute_arguments_handle_type
138  implicit none
139  type(kim_model_compute_arguments_handle_type), intent(in) :: &
140  model_compute_arguments_handle
141  type(kim_compute_argument_name_type), intent(in), value :: &
142  compute_argument_name
143  real(c_double), intent(out), pointer :: double0
144  integer(c_int), intent(out) :: ierr
145  end subroutine kim_model_compute_arguments_get_argument_pointer_double0
146 
147  subroutine kim_model_compute_arguments_get_argument_pointer_double1( &
148  model_compute_arguments_handle, compute_argument_name, extent1, double1, &
149  ierr)
150  use, intrinsic :: iso_c_binding
152  kim_compute_argument_name_type
153  import kim_model_compute_arguments_handle_type
154  implicit none
155  type(kim_model_compute_arguments_handle_type), intent(in) :: &
156  model_compute_arguments_handle
157  type(kim_compute_argument_name_type), intent(in), value :: &
158  compute_argument_name
159  integer(c_int), intent(in), value :: extent1
160  real(c_double), intent(out), pointer :: double1(:)
161  integer(c_int), intent(out) :: ierr
162  end subroutine kim_model_compute_arguments_get_argument_pointer_double1
163 
164  subroutine kim_model_compute_arguments_get_argument_pointer_double2( &
165  model_compute_arguments_handle, compute_argument_name, extent1, extent2, &
166  double2, ierr)
167  use, intrinsic :: iso_c_binding
169  kim_compute_argument_name_type
170  import kim_model_compute_arguments_handle_type
171  implicit none
172  type(kim_model_compute_arguments_handle_type), intent(in) :: &
173  model_compute_arguments_handle
174  type(kim_compute_argument_name_type), intent(in), value :: &
175  compute_argument_name
176  integer(c_int), intent(in), value :: extent1
177  integer(c_int), intent(in), value :: extent2
178  real(c_double), intent(out), pointer :: double2(:,:)
179  integer(c_int), intent(out) :: ierr
180  end subroutine kim_model_compute_arguments_get_argument_pointer_double2
181  end interface kim_model_compute_arguments_get_argument_pointer
182 
183  interface
185  model_compute_arguments_handle, neighbor_list_index, particle_number, &
186  number_of_neighbors, neighbors_of_particle, ierr)
187  use, intrinsic :: iso_c_binding
188  import kim_model_compute_arguments_handle_type
189  implicit none
190  type(kim_model_compute_arguments_handle_type), intent(in) :: &
191  model_compute_arguments_handle
192  integer(c_int), intent(in), value :: neighbor_list_index
193  integer(c_int), intent(in), value :: particle_number
194  integer(c_int), intent(out) :: number_of_neighbors
195  integer(c_int), intent(out), pointer :: neighbors_of_particle(:)
196  integer(c_int), intent(out) :: ierr
198 
199  subroutine kim_model_compute_arguments_process_dedr_term( &
200  model_compute_arguments_handle, de, r, dx, i, j, ierr)
201  use, intrinsic :: iso_c_binding
202  import kim_model_compute_arguments_handle_type
203  implicit none
204  type(kim_model_compute_arguments_handle_type), intent(in) :: &
205  model_compute_arguments_handle
206  real(c_double), intent(in), value :: de
207  real(c_double), intent(in), value :: r
208  type(c_ptr), intent(in) :: dx
209  integer(c_int), intent(in), value :: i
210  integer(c_int), intent(in), value :: j
211  integer(c_int), intent(out) :: ierr
212  end subroutine kim_model_compute_arguments_process_dedr_term
213 
214  subroutine kim_model_compute_arguments_process_d2edr2_term( &
215  model_compute_arguments_handle, de, r, dx, i, j, ierr)
216  use, intrinsic :: iso_c_binding
217  import kim_model_compute_arguments_handle_type
218  implicit none
219  type(kim_model_compute_arguments_handle_type), intent(in) :: &
220  model_compute_arguments_handle
221  real(c_double), intent(in), value :: de
222  type(c_ptr), intent(in), value :: r
223  type(c_ptr), intent(in), value :: dx
224  type(c_ptr), intent(in), value :: i
225  type(c_ptr), intent(in), value :: j
226  integer(c_int), intent(out) :: ierr
227  end subroutine kim_model_compute_arguments_process_d2edr2_term
228 
229  subroutine kim_model_compute_arguments_is_callback_present( &
230  model_compute_arguments_handle, compute_callback_name, present, ierr)
231  use, intrinsic :: iso_c_binding
233  kim_compute_callback_name_type
234  import kim_model_compute_arguments_handle_type
235  implicit none
236  type(kim_model_compute_arguments_handle_type), intent(in) :: &
237  model_compute_arguments_handle
238  type(kim_compute_callback_name_type), intent(in), value :: &
239  compute_callback_name
240  integer(c_int), intent(out) :: present
241  integer(c_int), intent(out) :: ierr
242  end subroutine kim_model_compute_arguments_is_callback_present
243 
245  model_compute_arguments_handle, ptr)
246  use, intrinsic :: iso_c_binding
247  import kim_model_compute_arguments_handle_type
248  implicit none
249  type(kim_model_compute_arguments_handle_type), intent(inout) :: &
250  model_compute_arguments_handle
251  type(c_ptr), intent(in), value :: ptr
253 
254  subroutine kim_model_compute_arguments_get_model_buffer_pointer( &
255  model_compute_arguments_handle, ptr)
256  use, intrinsic :: iso_c_binding
257  import kim_model_compute_arguments_handle_type
258  implicit none
259  type(kim_model_compute_arguments_handle_type), intent(in) :: &
260  model_compute_arguments_handle
261  type(c_ptr), intent(out) :: ptr
262  end subroutine kim_model_compute_arguments_get_model_buffer_pointer
263 
264  subroutine kim_model_compute_arguments_log_entry( &
265  model_compute_arguments_handle, log_verbosity, message, line_number, &
266  file_name)
267  use, intrinsic :: iso_c_binding
268  use kim_log_verbosity_module, only : kim_log_verbosity_type
269  import kim_model_compute_arguments_handle_type
270  implicit none
271  type(kim_model_compute_arguments_handle_type), intent(in) :: &
272  model_compute_arguments_handle
273  type(kim_log_verbosity_type), intent(in), value :: log_verbosity
274  character(len=*, kind=c_char), intent(in) :: message
275  integer(c_int), intent(in), value :: line_number
276  character(len=*, kind=c_char), intent(in) :: file_name
277  end subroutine kim_model_compute_arguments_log_entry
278 
280  model_compute_arguments_handle, string)
281  use, intrinsic :: iso_c_binding
282  import kim_model_compute_arguments_handle_type
283  implicit none
284  type(kim_model_compute_arguments_handle_type), intent(in) :: &
285  model_compute_arguments_handle
286  character(len=*, kind=c_char), intent(out) :: string
288 end interface
type(kim_model_compute_arguments_handle_type), public, protected kim_model_compute_arguments_null_handle