kim-api-v2  2.0.0+912e79a.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-v2-2.0.0 package.
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 
228  recursive subroutine kim_model_compute_arguments_get_neighbor_list( &
229  model_compute_arguments_handle, neighbor_list_index, particle_number, &
230  number_of_neighbors, neighbors_of_particle, ierr)
231  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
232  implicit none
233  interface
234  integer(c_int) recursive function get_neighbor_list( &
235  model_compute_arguments, neighbor_list_index, particle_number, &
236  number_of_neighbors, neighbors_of_particle) &
237  bind(c, name="KIM_ModelComputeArguments_GetNeighborList")
238  use, intrinsic :: iso_c_binding
239  use kim_interoperable_types_module, only : &
240  kim_model_compute_arguments_type
241  implicit none
242  type(kim_model_compute_arguments_type), intent(in) :: &
243  model_compute_arguments
244  integer(c_int), intent(in), value :: neighbor_list_index
245  integer(c_int), intent(in), value :: particle_number
246  integer(c_int), intent(out) :: number_of_neighbors
247  type(c_ptr), intent(out) :: neighbors_of_particle
248  end function get_neighbor_list
249  end interface
250  type(kim_model_compute_arguments_handle_type), intent(in) :: &
251  model_compute_arguments_handle
252  integer(c_int), intent(in) :: neighbor_list_index
253  integer(c_int), intent(in) :: particle_number
254  integer(c_int), intent(out) :: number_of_neighbors
255  integer(c_int), intent(out), pointer :: neighbors_of_particle(:)
256  integer(c_int), intent(out) :: ierr
257  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
258 
259  type(c_ptr) p
260 
261  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
262  ierr = get_neighbor_list(model_compute_arguments, neighbor_list_index-1, &
263  particle_number, number_of_neighbors, p)
264  if (c_associated(p)) then
265  call c_f_pointer(p, neighbors_of_particle, [number_of_neighbors])
266  else
267  nullify(neighbors_of_particle)
268  end if
269  end subroutine kim_model_compute_arguments_get_neighbor_list
270 
277  recursive subroutine kim_model_compute_arguments_process_dedr_term( &
278  model_compute_arguments_handle, de, r, dx, i, j, ierr)
279  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
280  implicit none
281  interface
282  integer(c_int) recursive function process_dedr_term( &
283  model_compute_arguments, de, r, dx, i, j) &
284  bind(c, name="KIM_ModelComputeArguments_ProcessDEDrTerm")
285  use, intrinsic :: iso_c_binding
286  use kim_interoperable_types_module, only : &
287  kim_model_compute_arguments_type
288  implicit none
289  type(kim_model_compute_arguments_type), intent(in) :: &
290  model_compute_arguments
291  real(c_double), intent(in), value :: de
292  real(c_double), intent(in), value :: r
293  real(c_double), intent(in) :: dx
294  integer(c_int), intent(in), value :: i
295  integer(c_int), intent(in), value :: j
296  end function process_dedr_term
297  end interface
298  type(kim_model_compute_arguments_handle_type), intent(in) :: &
299  model_compute_arguments_handle
300  real(c_double), intent(in) :: de
301  real(c_double), intent(in) :: r
302  real(c_double), intent(in) :: dx(:)
303  integer(c_int), intent(in) :: i
304  integer(c_int), intent(in) :: j
305  integer(c_int), intent(out) :: ierr
306  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
307 
308  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
309  ierr = process_dedr_term(model_compute_arguments, de, r, dx(1), i, j)
311 
319  model_compute_arguments_handle, de, r, dx, i, j, ierr)
320  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
321  implicit none
322  interface
323  integer(c_int) recursive function process_d2edr2_term( &
324  model_compute_arguments, de, r, dx, i, j) &
325  bind(c, name="KIM_ModelComputeArguments_ProcessD2EDr2Term")
326  use, intrinsic :: iso_c_binding
327  use kim_interoperable_types_module, only : &
328  kim_model_compute_arguments_type
329  implicit none
330  type(kim_model_compute_arguments_type), intent(in) :: &
331  model_compute_arguments
332  real(c_double), intent(in), value :: de
333  real(c_double), intent(in) :: r
334  real(c_double), intent(in) :: dx
335  integer(c_int), intent(in) :: i
336  integer(c_int), intent(in) :: j
337  end function process_d2edr2_term
338  end interface
339  type(kim_model_compute_arguments_handle_type), intent(in) :: &
340  model_compute_arguments_handle
341  real(c_double), intent(in) :: de
342  real(c_double), intent(in) :: r(:)
343  real(c_double), intent(in) :: dx(:,:)
344  integer(c_int), intent(in) :: i(:)
345  integer(c_int), intent(in) :: j(:)
346  integer(c_int), intent(out) :: ierr
347  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
348 
349  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
350  ierr = process_d2edr2_term(model_compute_arguments, &
351  de, r(1), dx(1,1), i(1), j(1))
353 
361  model_compute_arguments_handle, compute_argument_name, int0, ierr)
362  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
363  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
364  implicit none
365  interface
366  integer(c_int) recursive function get_argument_pointer_integer( &
367  model_compute_arguments, compute_argument_name, ptr) &
368  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerInteger")
369  use, intrinsic :: iso_c_binding
371  kim_compute_argument_name_type
372  use kim_interoperable_types_module, only : &
373  kim_model_compute_arguments_type
374  implicit none
375  type(kim_model_compute_arguments_type), intent(in) :: &
376  model_compute_arguments
377  type(kim_compute_argument_name_type), intent(in), value :: &
378  compute_argument_name
379  type(c_ptr), intent(out) :: ptr
380  end function get_argument_pointer_integer
381  end interface
382  type(kim_model_compute_arguments_handle_type), intent(in) :: &
383  model_compute_arguments_handle
384  type(kim_compute_argument_name_type), intent(in) :: &
385  compute_argument_name
386  integer(c_int), intent(out), pointer :: int0
387  integer(c_int), intent(out) :: ierr
388  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
389 
390  type(c_ptr) p
391 
392  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
393  ierr = get_argument_pointer_integer(model_compute_arguments, &
394  compute_argument_name, p)
395  if (c_associated(p)) then
396  call c_f_pointer(p, int0)
397  else
398  nullify(int0)
399  end if
401 
409  model_compute_arguments_handle, compute_argument_name, extent1, int1, ierr)
410  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
411  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
412  implicit none
413  interface
414  integer(c_int) recursive function get_argument_pointer_integer( &
415  model_compute_arguments, compute_argument_name, ptr) &
416  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerInteger")
417  use, intrinsic :: iso_c_binding
419  kim_compute_argument_name_type
420  use kim_interoperable_types_module, only : &
421  kim_model_compute_arguments_type
422  implicit none
423  type(kim_model_compute_arguments_type), intent(in) :: &
424  model_compute_arguments
425  type(kim_compute_argument_name_type), intent(in), value :: &
426  compute_argument_name
427  type(c_ptr), intent(out) :: ptr
428  end function get_argument_pointer_integer
429  end interface
430  type(kim_model_compute_arguments_handle_type), intent(in) :: &
431  model_compute_arguments_handle
432  type(kim_compute_argument_name_type), intent(in) :: &
433  compute_argument_name
434  integer(c_int), intent(in) :: extent1
435  integer(c_int), intent(out), pointer :: int1(:)
436  integer(c_int), intent(out) :: ierr
437  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
438 
439  type(c_ptr) p
440 
441  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
442  ierr = get_argument_pointer_integer(model_compute_arguments, &
443  compute_argument_name, p)
444  if (c_associated(p)) then
445  call c_f_pointer(p, int1, [extent1])
446  else
447  nullify(int1)
448  end if
449 
451 
459  model_compute_arguments_handle, compute_argument_name, extent1, extent2, &
460  int2, ierr)
461  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
462  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
463  implicit none
464  interface
465  integer(c_int) recursive function get_argument_pointer_integer( &
466  model_compute_arguments, compute_argument_name, ptr) &
467  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerInteger")
468  use, intrinsic :: iso_c_binding
470  kim_compute_argument_name_type
471  use kim_interoperable_types_module, only : &
472  kim_model_compute_arguments_type
473  implicit none
474  type(kim_model_compute_arguments_type), intent(in) :: &
475  model_compute_arguments
476  type(kim_compute_argument_name_type), intent(in), value :: &
477  compute_argument_name
478  type(c_ptr), intent(out) :: ptr
479  end function get_argument_pointer_integer
480  end interface
481  type(kim_model_compute_arguments_handle_type), intent(in) :: &
482  model_compute_arguments_handle
483  type(kim_compute_argument_name_type), intent(in) :: &
484  compute_argument_name
485  integer(c_int), intent(in) :: extent1
486  integer(c_int), intent(in) :: extent2
487  integer(c_int), intent(out), pointer :: int2(:,:)
488  integer(c_int), intent(out) :: ierr
489  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
490 
491  type(c_ptr) p
492 
493  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
494  ierr = get_argument_pointer_integer(model_compute_arguments, &
495  compute_argument_name, p)
496  if (c_associated(p)) then
497  call c_f_pointer(p, int2, [extent1, extent2])
498  else
499  nullify(int2)
500  end if
502 
509  recursive subroutine &
511  model_compute_arguments_handle, compute_argument_name, double0, ierr)
512  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
513  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
514  implicit none
515  interface
516  integer(c_int) recursive function get_argument_pointer_double( &
517  model_compute_arguments, compute_argument_name, ptr) &
518  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerDouble")
519  use, intrinsic :: iso_c_binding
521  kim_compute_argument_name_type
522  use kim_interoperable_types_module, only : &
523  kim_model_compute_arguments_type
524  implicit none
525  type(kim_model_compute_arguments_type), intent(in) :: &
526  model_compute_arguments
527  type(kim_compute_argument_name_type), intent(in), value :: &
528  compute_argument_name
529  type(c_ptr), intent(out) :: ptr
530  end function get_argument_pointer_double
531  end interface
532  type(kim_model_compute_arguments_handle_type), intent(in) :: &
533  model_compute_arguments_handle
534  type(kim_compute_argument_name_type), intent(in) :: &
535  compute_argument_name
536  real(c_double), intent(out), pointer :: double0
537  integer(c_int), intent(out) :: ierr
538  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
539 
540  type(c_ptr) p
541 
542  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
543  ierr = get_argument_pointer_double(model_compute_arguments, &
544  compute_argument_name, p)
545  if (c_associated(p)) then
546  call c_f_pointer(p, double0)
547  else
548  nullify(double0)
549  end if
551 
558  recursive subroutine &
560  model_compute_arguments_handle, compute_argument_name, extent1, double1, &
561  ierr)
562  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
563  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
564  implicit none
565  interface
566  integer(c_int) recursive function get_argument_pointer_double( &
567  model_compute_arguments, compute_argument_name, ptr) &
568  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerDouble")
569  use, intrinsic :: iso_c_binding
571  kim_compute_argument_name_type
572  use kim_interoperable_types_module, only : &
573  kim_model_compute_arguments_type
574  implicit none
575  type(kim_model_compute_arguments_type), intent(in) :: &
576  model_compute_arguments
577  type(kim_compute_argument_name_type), intent(in), value :: &
578  compute_argument_name
579  type(c_ptr), intent(out) :: ptr
580  end function get_argument_pointer_double
581  end interface
582  type(kim_model_compute_arguments_handle_type), intent(in) :: &
583  model_compute_arguments_handle
584  type(kim_compute_argument_name_type), intent(in) :: &
585  compute_argument_name
586  integer(c_int), intent(in) :: extent1
587  real(c_double), intent(out), pointer :: double1(:)
588  integer(c_int), intent(out) :: ierr
589  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
590 
591  type(c_ptr) p
592 
593  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
594  ierr = get_argument_pointer_double(model_compute_arguments, &
595  compute_argument_name, p)
596  if (c_associated(p)) then
597  call c_f_pointer(p, double1, [extent1])
598  else
599  nullify(double1)
600  end if
602 
609  recursive subroutine &
611  model_compute_arguments_handle, compute_argument_name, extent1, extent2, &
612  double2, ierr)
613  use kim_compute_argument_name_module, only : kim_compute_argument_name_type
614  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
615  implicit none
616  interface
617  integer(c_int) recursive function get_argument_pointer_double( &
618  model_compute_arguments, compute_argument_name, ptr) &
619  bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerDouble")
620  use, intrinsic :: iso_c_binding
622  kim_compute_argument_name_type
623  use kim_interoperable_types_module, only : &
624  kim_model_compute_arguments_type
625  implicit none
626  type(kim_model_compute_arguments_type), intent(in) :: &
627  model_compute_arguments
628  type(kim_compute_argument_name_type), intent(in), value :: &
629  compute_argument_name
630  type(c_ptr), intent(out) :: ptr
631  end function get_argument_pointer_double
632  end interface
633  type(kim_model_compute_arguments_handle_type), intent(in) :: &
634  model_compute_arguments_handle
635  type(kim_compute_argument_name_type), intent(in) :: &
636  compute_argument_name
637  integer(c_int), intent(in) :: extent1
638  integer(c_int), intent(in) :: extent2
639  real(c_double), intent(out), pointer :: double2(:,:)
640  integer(c_int), intent(out) :: ierr
641  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
642 
643  type(c_ptr) p
644 
645  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
646  ierr = get_argument_pointer_double(model_compute_arguments, &
647  compute_argument_name, p)
648  if (c_associated(p)) then
649  call c_f_pointer(p, double2, [extent1, extent2])
650  else
651  nullify(double2)
652  end if
654 
662  model_compute_arguments_handle, compute_callback_name, present, ierr)
663  use kim_compute_callback_name_module, only : kim_compute_callback_name_type
664  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
665  implicit none
666  interface
667  integer(c_int) recursive function is_callback_present( &
668  model_compute_arguments, compute_callback_name, present) &
669  bind(c, name="KIM_ModelComputeArguments_IsCallbackPresent")
670  use, intrinsic :: iso_c_binding
672  kim_compute_callback_name_type
673  use kim_interoperable_types_module, only : &
674  kim_model_compute_arguments_type
675  implicit none
676  type(kim_model_compute_arguments_type), intent(in) :: &
677  model_compute_arguments
678  type(kim_compute_callback_name_type), intent(in), value :: &
679  compute_callback_name
680  integer(c_int), intent(out) :: present
681  end function is_callback_present
682  end interface
683  type(kim_model_compute_arguments_handle_type), intent(in) :: &
684  model_compute_arguments_handle
685  type(kim_compute_callback_name_type), intent(in) :: &
686  compute_callback_name
687  integer(c_int), intent(out) :: present
688  integer(c_int), intent(out) :: ierr
689  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
690 
691  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
692  ierr = is_callback_present(model_compute_arguments, compute_callback_name, &
693  present)
695 
703  model_compute_arguments_handle, ptr)
704  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
705  implicit none
706  interface
707  recursive subroutine set_model_buffer_pointer(model_compute_arguments, &
708  ptr) bind(c, name="KIM_ModelComputeArguments_SetModelBufferPointer")
709  use, intrinsic :: iso_c_binding
710  use kim_interoperable_types_module, only : &
711  kim_model_compute_arguments_type
712  implicit none
713  type(kim_model_compute_arguments_type), intent(in) :: &
714  model_compute_arguments
715  type(c_ptr), intent(in), value :: ptr
716  end subroutine set_model_buffer_pointer
717  end interface
718  type(kim_model_compute_arguments_handle_type), intent(in) :: &
719  model_compute_arguments_handle
720  type(c_ptr), intent(in) :: ptr
721  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
722 
723  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
724  call set_model_buffer_pointer(model_compute_arguments, ptr)
726 
734  model_compute_arguments_handle, ptr)
735  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
736  implicit none
737  interface
738  recursive subroutine get_model_buffer_pointer(model_compute_arguments, &
739  ptr) bind(c, name="KIM_ModelComputeArguments_GetModelBufferPointer")
740  use, intrinsic :: iso_c_binding
741  use kim_interoperable_types_module, only : &
742  kim_model_compute_arguments_type
743  implicit none
744  type(kim_model_compute_arguments_type), intent(in) :: &
745  model_compute_arguments
746  type(c_ptr), intent(out) :: ptr
747  end subroutine get_model_buffer_pointer
748  end interface
749  type(kim_model_compute_arguments_handle_type), intent(in) :: &
750  model_compute_arguments_handle
751  type(c_ptr), intent(out) :: ptr
752  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
753 
754  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
755  call get_model_buffer_pointer(model_compute_arguments, ptr)
757 
764  recursive subroutine kim_model_compute_arguments_log_entry( &
765  model_compute_arguments_handle, log_verbosity, message)
766  use kim_log_verbosity_module, only : kim_log_verbosity_type
767  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
768  implicit none
769  interface
770  recursive subroutine log_entry(model_compute_arguments, log_verbosity, &
771  message, line_number, file_name) bind(c, &
772  name="KIM_ModelComputeArguments_LogEntry")
773  use, intrinsic :: iso_c_binding
774  use kim_log_verbosity_module, only : kim_log_verbosity_type
775  use kim_interoperable_types_module, only : &
776  kim_model_compute_arguments_type
777  implicit none
778  type(kim_model_compute_arguments_type), intent(in) :: &
779  model_compute_arguments
780  type(kim_log_verbosity_type), intent(in), value :: log_verbosity
781  character(c_char), intent(in) :: message(*)
782  integer(c_int), intent(in), value :: line_number
783  character(c_char), intent(in) :: file_name(*)
784  end subroutine log_entry
785  end interface
786  type(kim_model_compute_arguments_handle_type), intent(in) :: &
787  model_compute_arguments_handle
788  type(kim_log_verbosity_type), intent(in) :: log_verbosity
789  character(len=*, kind=c_char), intent(in) :: message
790  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
791 
792  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
793  call log_entry(model_compute_arguments, log_verbosity, &
794  trim(message)//c_null_char, 0, ""//c_null_char)
796 
803  recursive subroutine kim_model_compute_arguments_to_string( &
804  model_compute_arguments_handle, string)
805  use kim_convert_string_module, only : kim_convert_c_char_ptr_to_string
806  use kim_interoperable_types_module, only : kim_model_compute_arguments_type
807  implicit none
808  interface
809  type(c_ptr) recursive function model_compute_string( &
810  model_compute_arguments) &
811  bind(c, name="KIM_ModelComputeArguments_ToString")
812  use, intrinsic :: iso_c_binding
813  use kim_interoperable_types_module, only : &
814  kim_model_compute_arguments_type
815  implicit none
816  type(kim_model_compute_arguments_type), intent(in) :: &
817  model_compute_arguments
818  end function model_compute_string
819  end interface
820  type(kim_model_compute_arguments_handle_type), intent(in) :: &
821  model_compute_arguments_handle
822  character(len=*, kind=c_char), intent(out) :: string
823  type(kim_model_compute_arguments_type), pointer :: model_compute_arguments
824 
825  type(c_ptr) :: p
826 
827  call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
828  p = model_compute_string(model_compute_arguments)
829  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.