kim-api  2.1.4-git+v2.1.3-git-1-g7847914a.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
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--2019, 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.git repository.
31 !
32 
33 
40  use, intrinsic :: iso_c_binding
41  implicit none
42  private
43 
44  public &
45  ! Derived types
46  kim_compute_arguments_handle_type, &
47 
48  ! Constants
50 
51  ! Routines
52  operator (.eq.), &
53  operator (.ne.), &
54  kim_get_argument_support_status, &
55  kim_get_callback_support_status, &
56  kim_set_argument_pointer, &
57  kim_set_callback_pointer, &
58  kim_are_all_required_present, &
59  kim_set_simulator_buffer_pointer, &
60  kim_get_simulator_buffer_pointer, &
61  kim_to_string, &
62  kim_set_log_id, &
63  kim_push_log_verbosity, &
64  kim_pop_log_verbosity
65 
66 
72  type, bind(c) :: kim_compute_arguments_handle_type
73  type(c_ptr) :: p = c_null_ptr
74  end type kim_compute_arguments_handle_type
75 
79  type(kim_compute_arguments_handle_type), protected, save &
81 
85  interface operator (.eq.)
86  module procedure kim_compute_arguments_handle_equal
87  end interface operator (.eq.)
88 
92  interface operator (.ne.)
93  module procedure kim_compute_arguments_handle_not_equal
94  end interface operator (.ne.)
95 
102  interface kim_get_argument_support_status
103  module procedure kim_compute_arguments_get_argument_support_status
104  end interface kim_get_argument_support_status
105 
112  interface kim_get_callback_support_status
114  end interface kim_get_callback_support_status
115 
123  interface kim_set_argument_pointer
130  end interface kim_set_argument_pointer
131 
138  interface kim_set_callback_pointer
140  end interface kim_set_callback_pointer
141 
149  interface kim_are_all_required_present
151  end interface kim_are_all_required_present
152 
159  interface kim_set_simulator_buffer_pointer
161  end interface kim_set_simulator_buffer_pointer
162 
169  interface kim_get_simulator_buffer_pointer
171  end interface kim_get_simulator_buffer_pointer
172 
178  interface kim_to_string
179  module procedure kim_compute_arguments_to_string
180  end interface kim_to_string
181 
187  interface kim_set_log_id
188  module procedure kim_compute_arguments_set_log_id
189  end interface kim_set_log_id
190 
197  interface kim_push_log_verbosity
199  end interface kim_push_log_verbosity
200 
207  interface kim_pop_log_verbosity
209  end interface kim_pop_log_verbosity
210 
211 contains
215  logical recursive function kim_compute_arguments_handle_equal(lhs, rhs)
216  implicit none
217  type(kim_compute_arguments_handle_type), intent(in) :: lhs
218  type(kim_compute_arguments_handle_type), intent(in) :: rhs
219 
220  if ((.not. c_associated(lhs%p)) .and. (.not. c_associated(rhs%p))) then
221  kim_compute_arguments_handle_equal = .true.
222  else
223  kim_compute_arguments_handle_equal = c_associated(lhs%p, rhs%p)
224  end if
225  end function kim_compute_arguments_handle_equal
226 
230  logical recursive function kim_compute_arguments_handle_not_equal(lhs, rhs)
231  implicit none
232  type(kim_compute_arguments_handle_type), intent(in) :: lhs
233  type(kim_compute_arguments_handle_type), intent(in) :: rhs
234 
235  kim_compute_arguments_handle_not_equal = .not. (lhs .eq. rhs)
236  end function kim_compute_arguments_handle_not_equal
237 
244  recursive subroutine kim_compute_arguments_get_argument_support_status( &
245  compute_arguments_handle, compute_argument_name, &
246  support_status, ierr)
247  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
248  use kim_support_status_module, only : kim_support_status_type
249  use kim_interoperable_types_module, only : kim_compute_arguments_type
250  implicit none
251  interface
252  integer(c_int) recursive function get_argument_support_status( &
253  compute_arguments, compute_argument_name, support_status) &
254  bind(c, name="KIM_ComputeArguments_GetArgumentSupportStatus")
255  use, intrinsic :: iso_c_binding
257  kim_compute_argument_name_type
258  use kim_support_status_module, only : kim_support_status_type
259  use kim_interoperable_types_module, only : kim_compute_arguments_type
260  implicit none
261  type(kim_compute_arguments_type), intent(in) :: compute_arguments
262  type(kim_compute_argument_name_type), intent(in), value :: &
263  compute_argument_name
264  type(kim_support_status_type), intent(out) :: support_status
265  end function get_argument_support_status
266  end interface
267  type(kim_compute_arguments_handle_type), intent(in) :: &
268  compute_arguments_handle
269  type(kim_compute_argument_name_type), intent(in) :: &
270  compute_argument_name
271  type(kim_support_status_type), intent(out) :: support_status
272  integer(c_int), intent(out) :: ierr
273  type(kim_compute_arguments_type), pointer :: compute_arguments
274 
275  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
276  ierr = get_argument_support_status(compute_arguments, &
277  compute_argument_name, support_status)
278  end subroutine kim_compute_arguments_get_argument_support_status
279 
287  compute_arguments_handle, compute_callback_name, support_status, ierr)
288  use kim_compute_callback_name_module, only : kim_compute_callback_name_type
289  use kim_support_status_module, only : kim_support_status_type
290  use kim_interoperable_types_module, only : kim_compute_arguments_type
291  implicit none
292  interface
293  integer(c_int) recursive function get_callback_support_status( &
294  compute_arguments, compute_callback_name, support_status) &
295  bind(c, name="KIM_ComputeArguments_GetCallbackSupportStatus")
296  use, intrinsic :: iso_c_binding
298  kim_compute_callback_name_type
299  use kim_support_status_module, only : kim_support_status_type
300  use kim_interoperable_types_module, only : kim_compute_arguments_type
301  implicit none
302  type(kim_compute_arguments_type), intent(in) :: compute_arguments
303  type(kim_compute_callback_name_type), intent(in), value :: &
304  compute_callback_name
305  type(kim_support_status_type), intent(out) :: support_status
306  end function get_callback_support_status
307  end interface
308  type(kim_compute_arguments_handle_type), intent(in) :: &
309  compute_arguments_handle
310  type(kim_compute_callback_name_type), intent(in) :: &
311  compute_callback_name
312  type(kim_support_status_type), intent(out) :: support_status
313  integer(c_int), intent(out) :: ierr
314  type(kim_compute_arguments_type), pointer :: compute_arguments
315 
316  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
317  ierr = get_callback_support_status(compute_arguments, &
318  compute_callback_name, support_status)
320 
328  compute_arguments_handle, compute_argument_name, int0, ierr)
329  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
330  use kim_interoperable_types_module, only : kim_compute_arguments_type
331  implicit none
332  interface
333  integer(c_int) recursive function set_argument_pointer_integer( &
334  compute_arguments, compute_argument_name, ptr) &
335  bind(c, name="KIM_ComputeArguments_SetArgumentPointerInteger")
336  use, intrinsic :: iso_c_binding
338  kim_compute_argument_name_type
339  use kim_interoperable_types_module, only : kim_compute_arguments_type
340  implicit none
341  type(kim_compute_arguments_type), intent(in) :: compute_arguments
342  type(kim_compute_argument_name_type), intent(in), value :: &
343  compute_argument_name
344  type(c_ptr), intent(in), value :: ptr
345  end function set_argument_pointer_integer
346  end interface
347  type(kim_compute_arguments_handle_type), intent(in) :: &
348  compute_arguments_handle
349  type(kim_compute_argument_name_type), intent(in) :: &
350  compute_argument_name
351  integer(c_int), intent(in), target :: int0
352  integer(c_int), intent(out) :: ierr
353  type(kim_compute_arguments_type), pointer :: compute_arguments
354 
355  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
356  ierr = set_argument_pointer_integer(compute_arguments, &
357  compute_argument_name, c_loc(int0))
359 
367  compute_arguments_handle, compute_argument_name, int1, ierr)
368  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
369  use kim_interoperable_types_module, only : kim_compute_arguments_type
370  implicit none
371  type(kim_compute_arguments_handle_type), intent(in) :: &
372  compute_arguments_handle
373  type(kim_compute_argument_name_type), intent(in) :: &
374  compute_argument_name
375  integer(c_int), intent(in), target :: int1(:)
376  integer(c_int), intent(out) :: ierr
377  type(kim_compute_arguments_type), pointer :: compute_arguments
378 
379  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
380  call set(compute_arguments, compute_argument_name, size(int1,1,c_int), &
381  int1, ierr)
382  return
383 
384  contains
385  recursive subroutine set(compute_arguments, compute_argument_name, &
386  extent1, int1, ierr)
388  kim_compute_argument_name_type
389  use kim_interoperable_types_module, only : kim_compute_arguments_type
390  implicit none
391  interface
392  integer(c_int) recursive function set_argument_pointer_integer( &
393  compute_arguments, compute_argument_name, ptr) &
394  bind(c, name="KIM_ComputeArguments_SetArgumentPointerInteger")
395  use, intrinsic :: iso_c_binding
397  kim_compute_argument_name_type
398  use kim_interoperable_types_module, only : kim_compute_arguments_type
399  implicit none
400  type(kim_compute_arguments_type), intent(in) :: compute_arguments
401  type(kim_compute_argument_name_type), intent(in), value :: &
402  compute_argument_name
403  type(c_ptr), intent(in), value :: ptr
404  end function set_argument_pointer_integer
405  end interface
406  type(kim_compute_arguments_type), intent(in) :: compute_arguments
407  type(kim_compute_argument_name_type), intent(in) :: &
408  compute_argument_name
409  integer(c_int), intent(in) :: extent1
410  integer(c_int), intent(in), target :: int1(extent1)
411  integer(c_int), intent(out) :: ierr
412 
413  ierr = set_argument_pointer_integer(compute_arguments, &
414  compute_argument_name, c_loc(int1))
415  end subroutine set
417 
425  compute_arguments_handle, compute_argument_name, int2, ierr)
426  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
427  use kim_interoperable_types_module, only : kim_compute_arguments_type
428  implicit none
429  type(kim_compute_arguments_handle_type), intent(in) :: &
430  compute_arguments_handle
431  type(kim_compute_argument_name_type), intent(in) :: &
432  compute_argument_name
433  integer(c_int), intent(in), target :: int2(:,:)
434  integer(c_int), intent(out) :: ierr
435  type(kim_compute_arguments_type), pointer :: compute_arguments
436 
437  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
438  call set(compute_arguments, compute_argument_name, size(int2, 1, c_int), &
439  size(int2, 2, c_int), int2, ierr)
440  return
441 
442  contains
443  recursive subroutine set(compute_arguments, compute_argument_name, &
444  extent1, extent2, int2, ierr)
446  kim_compute_argument_name_type
447  use kim_interoperable_types_module, only : kim_compute_arguments_type
448  implicit none
449  interface
450  integer(c_int) recursive function set_argument_pointer_integer( &
451  compute_arguments, compute_argument_name, ptr) &
452  bind(c, name="KIM_ComputeArguments_SetArgumentPointerInteger")
453  use, intrinsic :: iso_c_binding
455  kim_compute_argument_name_type
456  use kim_interoperable_types_module, only : kim_compute_arguments_type
457  implicit none
458  type(kim_compute_arguments_type), intent(in) :: compute_arguments
459  type(kim_compute_argument_name_type), intent(in), value :: &
460  compute_argument_name
461  type(c_ptr), intent(in), value :: ptr
462  end function set_argument_pointer_integer
463  end interface
464  type(kim_compute_arguments_type), intent(in) :: compute_arguments
465  type(kim_compute_argument_name_type), intent(in) :: &
466  compute_argument_name
467  integer(c_int), intent(in) :: extent1
468  integer(c_int), intent(in) :: extent2
469  integer(c_int), intent(in), target :: int2(extent1,extent2)
470  integer(c_int), intent(out) :: ierr
471 
472  ierr = set_argument_pointer_integer(compute_arguments, &
473  compute_argument_name, c_loc(int2))
474  end subroutine set
476 
484  compute_arguments_handle, compute_argument_name, double0, ierr)
485  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
486  use kim_interoperable_types_module, only : kim_compute_arguments_type
487  implicit none
488  interface
489  integer(c_int) recursive function set_argument_pointer_double( &
490  compute_arguments, compute_argument_name, ptr) &
491  bind(c, name="KIM_ComputeArguments_SetArgumentPointerDouble")
492  use, intrinsic :: iso_c_binding
494  kim_compute_argument_name_type
495  use kim_interoperable_types_module, only : kim_compute_arguments_type
496  implicit none
497  type(kim_compute_arguments_type), intent(in) :: compute_arguments
498  type(kim_compute_argument_name_type), intent(in), value :: &
499  compute_argument_name
500  type(c_ptr), intent(in), value :: ptr
501  end function set_argument_pointer_double
502  end interface
503  type(kim_compute_arguments_handle_type), intent(in) :: &
504  compute_arguments_handle
505  type(kim_compute_argument_name_type), intent(in) :: &
506  compute_argument_name
507  real(c_double), intent(in), target :: double0
508  integer(c_int), intent(out) :: ierr
509  type(kim_compute_arguments_type), pointer :: compute_arguments
510 
511  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
512  ierr = set_argument_pointer_double(compute_arguments, &
513  compute_argument_name, c_loc(double0))
515 
523  compute_arguments_handle, compute_argument_name, double1, ierr)
524  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
525  use kim_interoperable_types_module, only : kim_compute_arguments_type
526  implicit none
527  type(kim_compute_arguments_handle_type), intent(in) :: &
528  compute_arguments_handle
529  type(kim_compute_argument_name_type), intent(in) :: &
530  compute_argument_name
531  real(c_double), intent(in), target :: double1(:)
532  integer(c_int), intent(out) :: ierr
533  type(kim_compute_arguments_type), pointer :: compute_arguments
534 
535  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
536  call set(compute_arguments, compute_argument_name, &
537  size(double1, 1, c_int), double1, ierr)
538  return
539 
540  contains
541  recursive subroutine set(compute_arguments, compute_argument_name, &
542  extent1, double1, ierr)
544  kim_compute_argument_name_type
545  use kim_interoperable_types_module, only : kim_compute_arguments_type
546  implicit none
547  interface
548  integer(c_int) recursive function set_argument_pointer_double( &
549  compute_arguments, compute_argument_name, ptr) &
550  bind(c, name="KIM_ComputeArguments_SetArgumentPointerDouble")
551  use, intrinsic :: iso_c_binding
553  kim_compute_argument_name_type
554  use kim_interoperable_types_module, only : kim_compute_arguments_type
555  implicit none
556  type(kim_compute_arguments_type), intent(in) :: compute_arguments
557  type(kim_compute_argument_name_type), intent(in), value :: &
558  compute_argument_name
559  type(c_ptr), intent(in), value :: ptr
560  end function set_argument_pointer_double
561  end interface
562  type(kim_compute_arguments_type), intent(in) :: compute_arguments
563  type(kim_compute_argument_name_type), intent(in) :: &
564  compute_argument_name
565  integer(c_int), intent(in) :: extent1
566  real(c_double), intent(in), target :: double1(extent1)
567  integer(c_int), intent(out) :: ierr
568 
569  ierr = set_argument_pointer_double(compute_arguments, &
570  compute_argument_name, c_loc(double1))
571  end subroutine set
573 
581  compute_arguments_handle, compute_argument_name, double2, ierr)
582  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
583  use kim_interoperable_types_module, only : kim_compute_arguments_type
584  implicit none
585  type(kim_compute_arguments_handle_type), intent(in) :: &
586  compute_arguments_handle
587  type(kim_compute_argument_name_type), intent(in) :: &
588  compute_argument_name
589  real(c_double), intent(in), target :: double2(:,:)
590  integer(c_int), intent(out) :: ierr
591  type(kim_compute_arguments_type), pointer :: compute_arguments
592 
593  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
594  call set(compute_arguments, compute_argument_name, &
595  size(double2, 1, c_int), size(double2, 2, c_int), double2, ierr)
596  return
597 
598  contains
599  recursive subroutine set(compute_arguments, compute_argument_name, &
600  extent1, extent2, double2, ierr)
602  kim_compute_argument_name_type
603  implicit none
604  interface
605  integer(c_int) recursive function set_argument_pointer_double( &
606  compute_arguments, compute_argument_name, ptr) &
607  bind(c, name="KIM_ComputeArguments_SetArgumentPointerDouble")
608  use, intrinsic :: iso_c_binding
610  kim_compute_argument_name_type
611  use kim_interoperable_types_module, only : kim_compute_arguments_type
612  implicit none
613  type(kim_compute_arguments_type), intent(in) :: compute_arguments
614  type(kim_compute_argument_name_type), intent(in), value :: &
615  compute_argument_name
616  type(c_ptr), intent(in), value :: ptr
617  end function set_argument_pointer_double
618  end interface
619  type(kim_compute_arguments_type), intent(in) :: compute_arguments
620  type(kim_compute_argument_name_type), intent(in) :: &
621  compute_argument_name
622  integer(c_int), intent(in) :: extent1
623  integer(c_int), intent(in) :: extent2
624  real(c_double), intent(in), target :: double2(extent1,extent2)
625  integer(c_int), intent(out) :: ierr
626 
627  ierr = set_argument_pointer_double(compute_arguments, &
628  compute_argument_name, c_loc(double2))
629  end subroutine set
631 
638  recursive subroutine kim_compute_arguments_set_callback_pointer( &
639  compute_arguments_handle, compute_callback_name, language_name, fptr, &
640  data_object, ierr)
641  use kim_compute_callback_name_module, only : kim_compute_callback_name_type
642  use kim_language_name_module, only : kim_language_name_type
643  use kim_interoperable_types_module, only : kim_compute_arguments_type
644  implicit none
645  interface
646  integer(c_int) recursive function set_callback_pointer( &
647  compute_arguments, compute_callback_name, language_name, fptr, &
648  data_object) bind(c, name="KIM_ComputeArguments_SetCallbackPointer")
649  use, intrinsic :: iso_c_binding
650  use kim_language_name_module, only : kim_language_name_type
652  kim_compute_callback_name_type
653  use kim_interoperable_types_module, only : kim_compute_arguments_type
654  implicit none
655  type(kim_compute_arguments_type), intent(in) :: compute_arguments
656  type(kim_language_name_type), intent(in), value :: language_name
657  type(kim_compute_callback_name_type), intent(in), value :: &
658  compute_callback_name
659  type(c_funptr), intent(in), value :: fptr
660  type(c_ptr), intent(in), value :: data_object
661  end function set_callback_pointer
662  end interface
663  type(kim_compute_arguments_handle_type), intent(in) :: &
664  compute_arguments_handle
665  type(kim_compute_callback_name_type), intent(in) :: &
666  compute_callback_name
667  type(kim_language_name_type), intent(in) :: language_name
668  type(c_funptr), intent(in), value :: fptr ! must be left as "value"!?!
669  type(c_ptr), intent(in) :: data_object
670  integer(c_int), intent(out) :: ierr
671  type(kim_compute_arguments_type), pointer :: compute_arguments
672 
673  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
674  ierr = set_callback_pointer(compute_arguments, compute_callback_name, &
675  language_name, fptr, data_object)
677 
685  recursive subroutine kim_compute_arguments_are_all_required_present( &
686  compute_arguments_handle, result_value, ierr)
687  use kim_interoperable_types_module, only : kim_compute_arguments_type
688  implicit none
689  interface
690  integer(c_int) recursive function &
691  are_all_required_arguments_and_callbacks_present( &
692  compute_arguments, result_value) bind(c, &
693  name="KIM_ComputeArguments_AreAllRequiredArgumentsAndCallbacksPresent")
694  use, intrinsic :: iso_c_binding
695  use kim_interoperable_types_module, only : kim_compute_arguments_type
696  implicit none
697  type(kim_compute_arguments_type), intent(in) :: compute_arguments
698  integer(c_int), intent(out) :: result_value
699  end function are_all_required_arguments_and_callbacks_present
700  end interface
701  type(kim_compute_arguments_handle_type), intent(in) :: &
702  compute_arguments_handle
703  integer(c_int), intent(out) :: result_value
704  integer(c_int), intent(out) :: ierr
705  type(kim_compute_arguments_type), pointer :: compute_arguments
706 
707  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
708  ierr = are_all_required_arguments_and_callbacks_present( &
709  compute_arguments, result_value)
711 
719  compute_arguments_handle, ptr)
720  use kim_interoperable_types_module, only : kim_compute_arguments_type
721  implicit none
722  interface
723  recursive subroutine set_simulator_buffer_pointer(compute_arguments, &
724  ptr) bind(c, name="KIM_ComputeArguments_SetSimulatorBufferPointer")
725  use, intrinsic :: iso_c_binding
726  use kim_interoperable_types_module, only : kim_compute_arguments_type
727  implicit none
728  type(kim_compute_arguments_type), intent(in) :: compute_arguments
729  type(c_ptr), intent(in), value :: ptr
730  end subroutine set_simulator_buffer_pointer
731  end interface
732  type(kim_compute_arguments_handle_type), intent(in) :: &
733  compute_arguments_handle
734  type(c_ptr), intent(in) :: ptr
735  type(kim_compute_arguments_type), pointer :: compute_arguments
736 
737  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
738  call set_simulator_buffer_pointer(compute_arguments, ptr)
740 
748  compute_arguments_handle, ptr)
749  use kim_interoperable_types_module, only : kim_compute_arguments_type
750  implicit none
751  interface
752  recursive subroutine get_simulator_buffer_pointer(compute_arguments, &
753  ptr) bind(c, name="KIM_ComputeArguments_GetSimulatorBufferPointer")
754  use, intrinsic :: iso_c_binding
755  use kim_interoperable_types_module, only : kim_compute_arguments_type
756  implicit none
757  type(kim_compute_arguments_type), intent(in) :: compute_arguments
758  type(c_ptr), intent(out) :: ptr
759  end subroutine get_simulator_buffer_pointer
760  end interface
761  type(kim_compute_arguments_handle_type), intent(in) :: &
762  compute_arguments_handle
763  type(c_ptr), intent(out) :: ptr
764  type(kim_compute_arguments_type), pointer :: compute_arguments
765 
766  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
767  call get_simulator_buffer_pointer(compute_arguments, ptr)
769 
775  recursive subroutine kim_compute_arguments_to_string( &
776  compute_arguments_handle, string)
777  use kim_convert_string_module, only : kim_convert_c_char_ptr_to_string
778  use kim_interoperable_types_module, only : kim_compute_arguments_type
779  implicit none
780  interface
781  type(c_ptr) recursive function compute_arguments_string( &
782  compute_arguments) bind(c, name="KIM_ComputeArguments_ToString")
783  use, intrinsic :: iso_c_binding
784  use kim_interoperable_types_module, only : kim_compute_arguments_type
785  implicit none
786  type(kim_compute_arguments_type), intent(in) :: compute_arguments
787  end function compute_arguments_string
788  end interface
789  type(kim_compute_arguments_handle_type), intent(in) :: &
790  compute_arguments_handle
791  character(len=*, kind=c_char), intent(out) :: string
792  type(kim_compute_arguments_type), pointer :: compute_arguments
793 
794  type(c_ptr) :: p
795 
796  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
797  p = compute_arguments_string(compute_arguments)
798  call kim_convert_c_char_ptr_to_string(p, string)
799  end subroutine kim_compute_arguments_to_string
800 
806  recursive subroutine kim_compute_arguments_set_log_id( &
807  compute_arguments_handle, log_id)
808  use kim_interoperable_types_module, only : kim_compute_arguments_type
809  implicit none
810  interface
811  recursive subroutine set_log_id(compute_arguments, log_id) &
812  bind(c, name="KIM_ComputeArguments_SetLogID")
813  use, intrinsic :: iso_c_binding
814  use kim_interoperable_types_module, only : kim_compute_arguments_type
815  implicit none
816  type(kim_compute_arguments_type), intent(in) :: compute_arguments
817  character(c_char), intent(in) :: log_id(*)
818  end subroutine set_log_id
819  end interface
820  type(kim_compute_arguments_handle_type), intent(in) :: &
821  compute_arguments_handle
822  character(len=*, kind=c_char), intent(in) :: log_id
823  type(kim_compute_arguments_type), pointer :: compute_arguments
824 
825  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
826  call set_log_id(compute_arguments, trim(log_id)//c_null_char)
827  end subroutine kim_compute_arguments_set_log_id
828 
835  recursive subroutine kim_compute_arguments_push_log_verbosity( &
836  compute_arguments_handle, log_verbosity)
837  use kim_log_verbosity_module, only : kim_log_verbosity_type
838  use kim_interoperable_types_module, only : kim_compute_arguments_type
839  implicit none
840  interface
841  recursive subroutine push_log_verbosity(compute_arguments, &
842  log_verbosity) bind(c, name="KIM_ComputeArguments_PushLogVerbosity")
843  use, intrinsic :: iso_c_binding
844  use kim_log_verbosity_module, only : kim_log_verbosity_type
845  use kim_interoperable_types_module, only : kim_compute_arguments_type
846  implicit none
847  type(kim_compute_arguments_type), intent(in) :: compute_arguments
848  type(kim_log_verbosity_type), intent(in), value :: log_verbosity
849  end subroutine push_log_verbosity
850  end interface
851  type(kim_compute_arguments_handle_type), intent(in) :: &
852  compute_arguments_handle
853  type(kim_log_verbosity_type), intent(in) :: log_verbosity
854  type(kim_compute_arguments_type), pointer :: compute_arguments
855 
856  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
857  call push_log_verbosity(compute_arguments, log_verbosity)
859 
866  recursive subroutine kim_compute_arguments_pop_log_verbosity( &
867  compute_arguments_handle)
868  use kim_log_verbosity_module, only : kim_log_verbosity_type
869  use kim_interoperable_types_module, only : kim_compute_arguments_type
870  implicit none
871  interface
872  recursive subroutine pop_log_verbosity(compute_arguments) &
873  bind(c, name="KIM_ComputeArguments_PopLogVerbosity")
874  use, intrinsic :: iso_c_binding
875  use kim_log_verbosity_module, only : kim_log_verbosity_type
876  use kim_interoperable_types_module, only : kim_compute_arguments_type
877  implicit none
878  type(kim_compute_arguments_type), intent(in) :: compute_arguments
879  end subroutine pop_log_verbosity
880  end interface
881  type(kim_compute_arguments_handle_type), intent(in) :: &
882  compute_arguments_handle
883  type(kim_compute_arguments_type), pointer :: compute_arguments
884 
885  call c_f_pointer(compute_arguments_handle%p, compute_arguments)
886  call pop_log_verbosity(compute_arguments)
recursive subroutine kim_compute_arguments_set_argument_pointer_double1(compute_arguments_handle, compute_argument_name, double1, ierr)
Set the data pointer for a ComputeArgumentName.
recursive subroutine kim_compute_arguments_get_callback_support_status(compute_arguments_handle, compute_callback_name, support_status, ierr)
Get the SupportStatus of a ComputeCallbackName.
recursive subroutine kim_compute_arguments_set_log_id(compute_arguments_handle, log_id)
Set the identity of the Log object associated with the ComputeArguments object.
recursive subroutine kim_compute_arguments_set_simulator_buffer_pointer(compute_arguments_handle, ptr)
Set the Simulator's buffer pointer within the ComputeArguments object.
recursive subroutine kim_compute_arguments_get_simulator_buffer_pointer(compute_arguments_handle, ptr)
Get the Simulator's buffer pointer from the ComputeArguments object.
recursive subroutine kim_compute_arguments_set_argument_pointer_double0(compute_arguments_handle, compute_argument_name, double0, ierr)
Set the data pointer for a ComputeArgumentName.
An Extensible Enumeration for the LanguageName's supported by the KIM API.
type(kim_compute_arguments_handle_type), save, public, protected kim_compute_arguments_null_handle
NULL handle for use in comparisons.
recursive subroutine kim_compute_arguments_set_argument_pointer_double2(compute_arguments_handle, compute_argument_name, double2, ierr)
Set the data pointer for a ComputeArgumentName.
recursive subroutine kim_compute_arguments_are_all_required_present(compute_arguments_handle, result_value, ierr)
Determine if non-NULL pointers have been set for all ComputeArgumentName's and ComputeCallbackName's ...
recursive subroutine kim_compute_arguments_set_argument_pointer_int1(compute_arguments_handle, compute_argument_name, int1, ierr)
Set the data pointer for a ComputeArgumentName.
recursive subroutine kim_compute_arguments_push_log_verbosity(compute_arguments_handle, log_verbosity)
Push a new LogVerbosity onto the ComputeArguments object's Log object verbosity stack.
Provides the primary interface to a KIM API ComputeArguments object and is meant to be used by simula...
recursive subroutine kim_compute_arguments_pop_log_verbosity(compute_arguments_handle)
Pop a LogVerbosity from the ComputeArguments object's Log object verbosity stack. ...
An Extensible Enumeration for the SupportStatus's supported by the KIM API.
recursive subroutine kim_compute_arguments_set_callback_pointer(compute_arguments_handle, compute_callback_name, language_name, fptr, data_object, ierr)
Set the function pointer for a ComputeCallbackName.
recursive subroutine kim_compute_arguments_set_argument_pointer_int0(compute_arguments_handle, compute_argument_name, int0, ierr)
Set the data pointer for a ComputeArgumentName.
recursive subroutine set(compute_arguments, compute_argument_name, extent1, int1, ierr)
An Extensible Enumeration for the ComputeCallbackName's supported by the KIM API. ...
recursive subroutine kim_compute_arguments_set_argument_pointer_int2(compute_arguments_handle, compute_argument_name, int2, ierr)
Set the data pointer for a ComputeArgumentName.
An Extensible Enumeration for the ComputeArgumentName's supported by the KIM API. ...
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.
recursive subroutine kim_compute_arguments_to_string(compute_arguments_handle, string)
Get a string representing the internal state of the ComputeArguments object.