kim-api  2.1.4-git+v2.1.3-git-3-g4c859c7f.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
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--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_model_compute_arguments_handle_type, &
47 
48  ! Constants
50 
51  ! Routines
52  operator (.eq.), &
53  operator (.ne.), &
54  kim_get_neighbor_list, &
55  kim_process_dedr_term, &
56  kim_process_d2edr2_term, &
57  kim_get_argument_pointer, &
58  kim_is_callback_present, &
59  kim_set_model_buffer_pointer, &
60  kim_get_model_buffer_pointer, &
61  kim_log_entry, &
62  kim_to_string
63 
64 
70  type, bind(c) :: kim_model_compute_arguments_handle_type
71  type(c_ptr) :: p = c_null_ptr
72  end type kim_model_compute_arguments_handle_type
73 
77  type(kim_model_compute_arguments_handle_type), protected, save &
79 
84  interface operator (.eq.)
85  module procedure kim_model_compute_arguments_handle_equal
86  end interface operator (.eq.)
87 
92  interface operator (.ne.)
93  module procedure kim_model_compute_arguments_handle_not_equal
94  end interface operator (.ne.)
95 
102  interface kim_get_neighbor_list
103  module procedure kim_model_compute_arguments_get_neighbor_list
104  end interface kim_get_neighbor_list
105 
112  interface kim_process_dedr_term
114  end interface kim_process_dedr_term
115 
122  interface kim_process_d2edr2_term
124  end interface kim_process_d2edr2_term
125 
133  interface kim_get_argument_pointer
140  end interface kim_get_argument_pointer
141 
148  interface kim_is_callback_present
150  end interface kim_is_callback_present
151 
158  interface kim_set_model_buffer_pointer
160  end interface kim_set_model_buffer_pointer
161 
168  interface kim_get_model_buffer_pointer
170  end interface kim_get_model_buffer_pointer
171 
178  interface kim_log_entry
180  end interface kim_log_entry
181 
188  interface kim_to_string
190  end interface kim_to_string
191 
192 contains
197  logical recursive function kim_model_compute_arguments_handle_equal(lhs, rhs)
198  implicit none
199  type(kim_model_compute_arguments_handle_type), intent(in) :: lhs
200  type(kim_model_compute_arguments_handle_type), intent(in) :: rhs
201 
202  if ((.not. c_associated(lhs%p)) .and. (.not. c_associated(rhs%p))) then
203  kim_model_compute_arguments_handle_equal = .true.
204  else
205  kim_model_compute_arguments_handle_equal = c_associated(lhs%p, rhs%p)
206  end if
207  end function kim_model_compute_arguments_handle_equal
208 
213  logical recursive function kim_model_compute_arguments_handle_not_equal(lhs, &
214  rhs)
215  implicit none
216  type(kim_model_compute_arguments_handle_type), intent(in) :: lhs
217  type(kim_model_compute_arguments_handle_type), intent(in) :: rhs
218 
219  kim_model_compute_arguments_handle_not_equal = .not. (lhs .eq. rhs)
220  end function kim_model_compute_arguments_handle_not_equal
221 
256  recursive subroutine kim_model_compute_arguments_get_neighbor_list( &
257  model_compute_arguments_handle, neighbor_list_index, particle_number, &
258  number_of_neighbors, neighbors_of_particle, ierr)
259  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
260  implicit none
261  interface
262  integer(c_int) recursive function get_neighbor_list( &
263  model_compute_arguments, neighbor_list_index, particle_number, &
264  number_of_neighbors, neighbors_of_particle) &
265  bind(c, name="KIM_ModelComputeArguments_GetNeighborList")
266  use, intrinsic :: iso_c_binding
267  use kim_interoperable_types_module, only : &
268  kim_model_compute_arguments_type
269  implicit none
270  type(kim_model_compute_arguments_type), intent(in) :: &
271  model_compute_arguments
272  integer(c_int), intent(in), value :: neighbor_list_index
273  integer(c_int), intent(in), value :: particle_number
274  integer(c_int), intent(out) :: number_of_neighbors
275  type(c_ptr), intent(out) :: neighbors_of_particle
276  end function get_neighbor_list
277  end interface
278  type(kim_model_compute_arguments_handle_type), intent(in) :: &
279  model_compute_arguments_handle
280  integer(c_int), intent(in) :: neighbor_list_index
281  integer(c_int), intent(in) :: particle_number
282  integer(c_int), intent(out) :: number_of_neighbors
283  integer(c_int), intent(out), pointer :: neighbors_of_particle(:)
284  integer(c_int), intent(out) :: ierr
285  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
286 
287  type(c_ptr) p
288 
289  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
290  ierr = get_neighbor_list(model_compute_arguments, neighbor_list_index-1, &
291  particle_number, number_of_neighbors, p)
292  if (c_associated(p)) then
293  call c_f_pointer(p, neighbors_of_particle, [number_of_neighbors])
294  else
295  nullify(neighbors_of_particle)
296  end if
297  end subroutine kim_model_compute_arguments_get_neighbor_list
298 
326  recursive subroutine kim_model_compute_arguments_process_dedr_term( &
327  model_compute_arguments_handle, de, r, dx, i, j, ierr)
328  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
329  implicit none
330  interface
331  integer(c_int) recursive function process_dedr_term( &
332  model_compute_arguments, de, r, dx, i, j) &
333  bind(c, name="KIM_ModelComputeArguments_ProcessDEDrTerm")
334  use, intrinsic :: iso_c_binding
335  use kim_interoperable_types_module, only : &
336  kim_model_compute_arguments_type
337  implicit none
338  type(kim_model_compute_arguments_type), intent(in) :: &
339  model_compute_arguments
340  real(c_double), intent(in), value :: de
341  real(c_double), intent(in), value :: r
342  real(c_double), intent(in) :: dx
343  integer(c_int), intent(in), value :: i
344  integer(c_int), intent(in), value :: j
345  end function process_dedr_term
346  end interface
347  type(kim_model_compute_arguments_handle_type), intent(in) :: &
348  model_compute_arguments_handle
349  real(c_double), intent(in) :: de
350  real(c_double), intent(in) :: r
351  real(c_double), intent(in) :: dx(:)
352  integer(c_int), intent(in) :: i
353  integer(c_int), intent(in) :: j
354  integer(c_int), intent(out) :: ierr
355  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
356 
357  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
358  ierr = process_dedr_term(model_compute_arguments, de, r, dx(1), i, j)
360 
389  model_compute_arguments_handle, de, r, dx, i, j, ierr)
390  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
391  implicit none
392  interface
393  integer(c_int) recursive function process_d2edr2_term( &
394  model_compute_arguments, de, r, dx, i, j) &
395  bind(c, name="KIM_ModelComputeArguments_ProcessD2EDr2Term")
396  use, intrinsic :: iso_c_binding
397  use kim_interoperable_types_module, only : &
398  kim_model_compute_arguments_type
399  implicit none
400  type(kim_model_compute_arguments_type), intent(in) :: &
401  model_compute_arguments
402  real(c_double), intent(in), value :: de
403  real(c_double), intent(in) :: r
404  real(c_double), intent(in) :: dx
405  integer(c_int), intent(in) :: i
406  integer(c_int), intent(in) :: j
407  end function process_d2edr2_term
408  end interface
409  type(kim_model_compute_arguments_handle_type), intent(in) :: &
410  model_compute_arguments_handle
411  real(c_double), intent(in) :: de
412  real(c_double), intent(in) :: r(:)
413  real(c_double), intent(in) :: dx(:,:)
414  integer(c_int), intent(in) :: i(:)
415  integer(c_int), intent(in) :: j(:)
416  integer(c_int), intent(out) :: ierr
417  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
418 
419  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
420  ierr = process_d2edr2_term(model_compute_arguments, &
421  de, r(1), dx(1,1), i(1), j(1))
423 
431  model_compute_arguments_handle, compute_argument_name, int0, ierr)
432  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
433  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
434  implicit none
435  interface
436  integer(c_int) recursive function get_argument_pointer_integer( &
437  model_compute_arguments, compute_argument_name, ptr) &
438  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerInteger")
439  use, intrinsic :: iso_c_binding
441  kim_compute_argument_name_type
442  use kim_interoperable_types_module, only : &
443  kim_model_compute_arguments_type
444  implicit none
445  type(kim_model_compute_arguments_type), intent(in) :: &
446  model_compute_arguments
447  type(kim_compute_argument_name_type), intent(in), value :: &
448  compute_argument_name
449  type(c_ptr), intent(out) :: ptr
450  end function get_argument_pointer_integer
451  end interface
452  type(kim_model_compute_arguments_handle_type), intent(in) :: &
453  model_compute_arguments_handle
454  type(kim_compute_argument_name_type), intent(in) :: &
455  compute_argument_name
456  integer(c_int), intent(out), pointer :: int0
457  integer(c_int), intent(out) :: ierr
458  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
459 
460  type(c_ptr) p
461 
462  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
463  ierr = get_argument_pointer_integer(model_compute_arguments, &
464  compute_argument_name, p)
465  if (c_associated(p)) then
466  call c_f_pointer(p, int0)
467  else
468  nullify(int0)
469  end if
471 
479  model_compute_arguments_handle, compute_argument_name, extent1, int1, ierr)
480  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
481  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
482  implicit none
483  interface
484  integer(c_int) recursive function get_argument_pointer_integer( &
485  model_compute_arguments, compute_argument_name, ptr) &
486  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerInteger")
487  use, intrinsic :: iso_c_binding
489  kim_compute_argument_name_type
490  use kim_interoperable_types_module, only : &
491  kim_model_compute_arguments_type
492  implicit none
493  type(kim_model_compute_arguments_type), intent(in) :: &
494  model_compute_arguments
495  type(kim_compute_argument_name_type), intent(in), value :: &
496  compute_argument_name
497  type(c_ptr), intent(out) :: ptr
498  end function get_argument_pointer_integer
499  end interface
500  type(kim_model_compute_arguments_handle_type), intent(in) :: &
501  model_compute_arguments_handle
502  type(kim_compute_argument_name_type), intent(in) :: &
503  compute_argument_name
504  integer(c_int), intent(in) :: extent1
505  integer(c_int), intent(out), pointer :: int1(:)
506  integer(c_int), intent(out) :: ierr
507  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
508 
509  type(c_ptr) p
510 
511  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
512  ierr = get_argument_pointer_integer(model_compute_arguments, &
513  compute_argument_name, p)
514  if (c_associated(p)) then
515  call c_f_pointer(p, int1, [extent1])
516  else
517  nullify(int1)
518  end if
519 
521 
529  model_compute_arguments_handle, compute_argument_name, extent1, extent2, &
530  int2, ierr)
531  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
532  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
533  implicit none
534  interface
535  integer(c_int) recursive function get_argument_pointer_integer( &
536  model_compute_arguments, compute_argument_name, ptr) &
537  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerInteger")
538  use, intrinsic :: iso_c_binding
540  kim_compute_argument_name_type
541  use kim_interoperable_types_module, only : &
542  kim_model_compute_arguments_type
543  implicit none
544  type(kim_model_compute_arguments_type), intent(in) :: &
545  model_compute_arguments
546  type(kim_compute_argument_name_type), intent(in), value :: &
547  compute_argument_name
548  type(c_ptr), intent(out) :: ptr
549  end function get_argument_pointer_integer
550  end interface
551  type(kim_model_compute_arguments_handle_type), intent(in) :: &
552  model_compute_arguments_handle
553  type(kim_compute_argument_name_type), intent(in) :: &
554  compute_argument_name
555  integer(c_int), intent(in) :: extent1
556  integer(c_int), intent(in) :: extent2
557  integer(c_int), intent(out), pointer :: int2(:,:)
558  integer(c_int), intent(out) :: ierr
559  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
560 
561  type(c_ptr) p
562 
563  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
564  ierr = get_argument_pointer_integer(model_compute_arguments, &
565  compute_argument_name, p)
566  if (c_associated(p)) then
567  call c_f_pointer(p, int2, [extent1, extent2])
568  else
569  nullify(int2)
570  end if
572 
579  recursive subroutine &
581  model_compute_arguments_handle, compute_argument_name, double0, ierr)
582  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
583  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
584  implicit none
585  interface
586  integer(c_int) recursive function get_argument_pointer_double( &
587  model_compute_arguments, compute_argument_name, ptr) &
588  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerDouble")
589  use, intrinsic :: iso_c_binding
591  kim_compute_argument_name_type
592  use kim_interoperable_types_module, only : &
593  kim_model_compute_arguments_type
594  implicit none
595  type(kim_model_compute_arguments_type), intent(in) :: &
596  model_compute_arguments
597  type(kim_compute_argument_name_type), intent(in), value :: &
598  compute_argument_name
599  type(c_ptr), intent(out) :: ptr
600  end function get_argument_pointer_double
601  end interface
602  type(kim_model_compute_arguments_handle_type), intent(in) :: &
603  model_compute_arguments_handle
604  type(kim_compute_argument_name_type), intent(in) :: &
605  compute_argument_name
606  real(c_double), intent(out), pointer :: double0
607  integer(c_int), intent(out) :: ierr
608  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
609 
610  type(c_ptr) p
611 
612  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
613  ierr = get_argument_pointer_double(model_compute_arguments, &
614  compute_argument_name, p)
615  if (c_associated(p)) then
616  call c_f_pointer(p, double0)
617  else
618  nullify(double0)
619  end if
621 
628  recursive subroutine &
630  model_compute_arguments_handle, compute_argument_name, extent1, double1, &
631  ierr)
632  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
633  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
634  implicit none
635  interface
636  integer(c_int) recursive function get_argument_pointer_double( &
637  model_compute_arguments, compute_argument_name, ptr) &
638  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerDouble")
639  use, intrinsic :: iso_c_binding
641  kim_compute_argument_name_type
642  use kim_interoperable_types_module, only : &
643  kim_model_compute_arguments_type
644  implicit none
645  type(kim_model_compute_arguments_type), intent(in) :: &
646  model_compute_arguments
647  type(kim_compute_argument_name_type), intent(in), value :: &
648  compute_argument_name
649  type(c_ptr), intent(out) :: ptr
650  end function get_argument_pointer_double
651  end interface
652  type(kim_model_compute_arguments_handle_type), intent(in) :: &
653  model_compute_arguments_handle
654  type(kim_compute_argument_name_type), intent(in) :: &
655  compute_argument_name
656  integer(c_int), intent(in) :: extent1
657  real(c_double), intent(out), pointer :: double1(:)
658  integer(c_int), intent(out) :: ierr
659  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
660 
661  type(c_ptr) p
662 
663  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
664  ierr = get_argument_pointer_double(model_compute_arguments, &
665  compute_argument_name, p)
666  if (c_associated(p)) then
667  call c_f_pointer(p, double1, [extent1])
668  else
669  nullify(double1)
670  end if
672 
679  recursive subroutine &
681  model_compute_arguments_handle, compute_argument_name, extent1, extent2, &
682  double2, ierr)
683  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
684  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
685  implicit none
686  interface
687  integer(c_int) recursive function get_argument_pointer_double( &
688  model_compute_arguments, compute_argument_name, ptr) &
689  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerDouble")
690  use, intrinsic :: iso_c_binding
692  kim_compute_argument_name_type
693  use kim_interoperable_types_module, only : &
694  kim_model_compute_arguments_type
695  implicit none
696  type(kim_model_compute_arguments_type), intent(in) :: &
697  model_compute_arguments
698  type(kim_compute_argument_name_type), intent(in), value :: &
699  compute_argument_name
700  type(c_ptr), intent(out) :: ptr
701  end function get_argument_pointer_double
702  end interface
703  type(kim_model_compute_arguments_handle_type), intent(in) :: &
704  model_compute_arguments_handle
705  type(kim_compute_argument_name_type), intent(in) :: &
706  compute_argument_name
707  integer(c_int), intent(in) :: extent1
708  integer(c_int), intent(in) :: extent2
709  real(c_double), intent(out), pointer :: double2(:,:)
710  integer(c_int), intent(out) :: ierr
711  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
712 
713  type(c_ptr) p
714 
715  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
716  ierr = get_argument_pointer_double(model_compute_arguments, &
717  compute_argument_name, p)
718  if (c_associated(p)) then
719  call c_f_pointer(p, double2, [extent1, extent2])
720  else
721  nullify(double2)
722  end if
724 
732  model_compute_arguments_handle, compute_callback_name, present, ierr)
733  use kim_compute_callback_name_module, only : kim_compute_callback_name_type
734  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
735  implicit none
736  interface
737  integer(c_int) recursive function is_callback_present( &
738  model_compute_arguments, compute_callback_name, present) &
739  bind(c, name="KIM_ModelComputeArguments_IsCallbackPresent")
740  use, intrinsic :: iso_c_binding
742  kim_compute_callback_name_type
743  use kim_interoperable_types_module, only : &
744  kim_model_compute_arguments_type
745  implicit none
746  type(kim_model_compute_arguments_type), intent(in) :: &
747  model_compute_arguments
748  type(kim_compute_callback_name_type), intent(in), value :: &
749  compute_callback_name
750  integer(c_int), intent(out) :: present
751  end function is_callback_present
752  end interface
753  type(kim_model_compute_arguments_handle_type), intent(in) :: &
754  model_compute_arguments_handle
755  type(kim_compute_callback_name_type), intent(in) :: &
756  compute_callback_name
757  integer(c_int), intent(out) :: present
758  integer(c_int), intent(out) :: ierr
759  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
760 
761  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
762  ierr = is_callback_present(model_compute_arguments, compute_callback_name, &
763  present)
765 
773  model_compute_arguments_handle, ptr)
774  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
775  implicit none
776  interface
777  recursive subroutine set_model_buffer_pointer(model_compute_arguments, &
778  ptr) bind(c, name="KIM_ModelComputeArguments_SetModelBufferPointer")
779  use, intrinsic :: iso_c_binding
780  use kim_interoperable_types_module, only : &
781  kim_model_compute_arguments_type
782  implicit none
783  type(kim_model_compute_arguments_type), intent(in) :: &
784  model_compute_arguments
785  type(c_ptr), intent(in), value :: ptr
786  end subroutine set_model_buffer_pointer
787  end interface
788  type(kim_model_compute_arguments_handle_type), intent(in) :: &
789  model_compute_arguments_handle
790  type(c_ptr), intent(in) :: ptr
791  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
792 
793  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
794  call set_model_buffer_pointer(model_compute_arguments, ptr)
796 
804  model_compute_arguments_handle, ptr)
805  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
806  implicit none
807  interface
808  recursive subroutine get_model_buffer_pointer(model_compute_arguments, &
809  ptr) bind(c, name="KIM_ModelComputeArguments_GetModelBufferPointer")
810  use, intrinsic :: iso_c_binding
811  use kim_interoperable_types_module, only : &
812  kim_model_compute_arguments_type
813  implicit none
814  type(kim_model_compute_arguments_type), intent(in) :: &
815  model_compute_arguments
816  type(c_ptr), intent(out) :: ptr
817  end subroutine get_model_buffer_pointer
818  end interface
819  type(kim_model_compute_arguments_handle_type), intent(in) :: &
820  model_compute_arguments_handle
821  type(c_ptr), intent(out) :: ptr
822  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
823 
824  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
825  call get_model_buffer_pointer(model_compute_arguments, ptr)
827 
834  recursive subroutine kim_model_compute_arguments_log_entry( &
835  model_compute_arguments_handle, log_verbosity, message)
836  use kim_log_verbosity_module, only : kim_log_verbosity_type
837  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
838  implicit none
839  interface
840  recursive subroutine log_entry(model_compute_arguments, log_verbosity, &
841  message, line_number, file_name) bind(c, &
842  name="KIM_ModelComputeArguments_LogEntry")
843  use, intrinsic :: iso_c_binding
844  use kim_log_verbosity_module, only : kim_log_verbosity_type
845  use kim_interoperable_types_module, only : &
846  kim_model_compute_arguments_type
847  implicit none
848  type(kim_model_compute_arguments_type), intent(in) :: &
849  model_compute_arguments
850  type(kim_log_verbosity_type), intent(in), value :: log_verbosity
851  character(c_char), intent(in) :: message(*)
852  integer(c_int), intent(in), value :: line_number
853  character(c_char), intent(in) :: file_name(*)
854  end subroutine log_entry
855  end interface
856  type(kim_model_compute_arguments_handle_type), intent(in) :: &
857  model_compute_arguments_handle
858  type(kim_log_verbosity_type), intent(in) :: log_verbosity
859  character(len=*, kind=c_char), intent(in) :: message
860  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
861 
862  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
863  call log_entry(model_compute_arguments, log_verbosity, &
864  trim(message)//c_null_char, 0, ""//c_null_char)
866 
873  recursive subroutine kim_model_compute_arguments_to_string( &
874  model_compute_arguments_handle, string)
875  use kim_convert_string_module, only : kim_convert_c_char_ptr_to_string
876  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
877  implicit none
878  interface
879  type(c_ptr) recursive function model_compute_string( &
880  model_compute_arguments) &
881  bind(c, name="KIM_ModelComputeArguments_ToString")
882  use, intrinsic :: iso_c_binding
883  use kim_interoperable_types_module, only : &
884  kim_model_compute_arguments_type
885  implicit none
886  type(kim_model_compute_arguments_type), intent(in) :: &
887  model_compute_arguments
888  end function model_compute_string
889  end interface
890  type(kim_model_compute_arguments_handle_type), intent(in) :: &
891  model_compute_arguments_handle
892  character(len=*, kind=c_char), intent(out) :: string
893  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
894 
895  type(c_ptr) :: p
896 
897  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
898  p = model_compute_string(model_compute_arguments)
899  call kim_convert_c_char_ptr_to_string(p, string)
type(kim_model_compute_arguments_handle_type), save, public, protected kim_model_compute_arguments_null_handle
NULL handle for use in comparisons.
recursive subroutine kim_model_compute_arguments_get_argument_pointer_int1(model_compute_arguments_handle, compute_argument_name, extent1, int1, ierr)
Get the data pointer for a ComputeArgumentName.
recursive subroutine kim_model_compute_arguments_log_entry(model_compute_arguments_handle, log_verbosity, message)
Write a log entry into the log file.
recursive subroutine kim_model_compute_arguments_get_argument_pointer_double0(model_compute_arguments_handle, compute_argument_name, double0, ierr)
Get the data pointer for a ComputeArgumentName.
recursive subroutine kim_model_compute_arguments_process_d2edr2_term(model_compute_arguments_handle, de, r, dx, i, j, ierr)
Call the Simulator's COMPUTE_CALLBACK_NAME::ProcessD2EDr2Term routine.
recursive subroutine kim_model_compute_arguments_set_model_buffer_pointer(model_compute_arguments_handle, ptr)
Set the Model's buffer pointer within the ComputeArguments object.
recursive subroutine kim_model_compute_arguments_process_dedr_term(model_compute_arguments_handle, de, r, dx, i, j, ierr)
Call the Simulator's COMPUTE_CALLBACK_NAME::ProcessDEDrTerm routine.
recursive subroutine kim_model_compute_arguments_get_argument_pointer_int0(model_compute_arguments_handle, compute_argument_name, int0, ierr)
Get the data pointer for a ComputeArgumentName.
recursive subroutine kim_model_compute_arguments_is_callback_present(model_compute_arguments_handle, compute_callback_name, present, ierr)
Determine if the Simulator has provided a non-NULL function pointer for a ComputeCallbackName of inte...
recursive subroutine kim_model_compute_arguments_get_argument_pointer_int2(model_compute_arguments_handle, compute_argument_name, extent1, extent2, int2, ierr)
Get the data pointer for a ComputeArgumentName.
recursive subroutine kim_model_compute_arguments_get_model_buffer_pointer(model_compute_arguments_handle, ptr)
Get the Model's buffer pointer within the ComputeArguments object.
recursive subroutine kim_model_compute_arguments_to_string(model_compute_arguments_handle, string)
Get a string representing the internal state of the ComputeArguments object.
recursive subroutine kim_model_compute_arguments_get_argument_pointer_double2(model_compute_arguments_handle, compute_argument_name, extent1, extent2, double2, ierr)
Get the data pointer for a ComputeArgumentName.
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUT...
recursive subroutine kim_model_compute_arguments_get_argument_pointer_double1(model_compute_arguments_handle, compute_argument_name, extent1, double1, ierr)
Get the data pointer for a ComputeArgumentName.
An Extensible Enumeration for the ComputeCallbackName's supported by the KIM API. ...
An Extensible Enumeration for the ComputeArgumentName's supported by the KIM API. ...
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.