36 use,
intrinsic :: iso_c_binding
63 type,
bind(c) :: kim_model_compute_arguments_handle_type
64 type(c_ptr) :: p = c_null_ptr
77 interface operator(.eq.)
78 module procedure kim_model_compute_arguments_handle_equal
79 end interface operator(.eq.)
85 interface operator(.ne.)
86 module procedure kim_model_compute_arguments_handle_not_equal
87 end interface operator(.ne.)
96 module procedure kim_model_compute_arguments_get_neighbor_list
190 logical recursive function kim_model_compute_arguments_handle_equal(lhs, rhs)
192 type(kim_model_compute_arguments_handle_type),
intent(in) :: lhs
193 type(kim_model_compute_arguments_handle_type),
intent(in) :: rhs
195 if ((.not. c_associated(lhs%p)) .and. (.not. c_associated(rhs%p)))
then
196 kim_model_compute_arguments_handle_equal = .true.
198 kim_model_compute_arguments_handle_equal = c_associated(lhs%p, rhs%p)
200 end function kim_model_compute_arguments_handle_equal
206 logical recursive function kim_model_compute_arguments_handle_not_equal(lhs, &
209 type(kim_model_compute_arguments_handle_type),
intent(in) :: lhs
210 type(kim_model_compute_arguments_handle_type),
intent(in) :: rhs
212 kim_model_compute_arguments_handle_not_equal = .not. (lhs == rhs)
213 end function kim_model_compute_arguments_handle_not_equal
249 recursive subroutine kim_model_compute_arguments_get_neighbor_list( &
250 model_compute_arguments_handle, neighbor_list_index, particle_number, &
251 number_of_neighbors, neighbors_of_particle, ierr)
252 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
255 integer(c_int) recursive function get_neighbor_list( &
256 model_compute_arguments, neighbor_list_index, particle_number, &
257 number_of_neighbors, neighbors_of_particle) &
258 bind(c, name="KIM_ModelComputeArguments_GetNeighborList")
259 use,
intrinsic :: iso_c_binding
260 use kim_interoperable_types_module,
only: &
261 kim_model_compute_arguments_type
263 type(kim_model_compute_arguments_type),
intent(in) :: &
264 model_compute_arguments
265 integer(c_int),
intent(in),
value :: neighbor_list_index
266 integer(c_int),
intent(in),
value :: particle_number
267 integer(c_int),
intent(out) :: number_of_neighbors
268 type(c_ptr),
intent(out) :: neighbors_of_particle
271 type(kim_model_compute_arguments_handle_type),
intent(in) :: &
272 model_compute_arguments_handle
273 integer(c_int),
intent(in) :: neighbor_list_index
274 integer(c_int),
intent(in) :: particle_number
275 integer(c_int),
intent(out) :: number_of_neighbors
276 integer(c_int),
intent(out),
pointer :: neighbors_of_particle(:)
277 integer(c_int),
intent(out) :: ierr
278 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
282 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
284 particle_number, number_of_neighbors, p)
285 if (c_associated(p))
then
286 call c_f_pointer(p, neighbors_of_particle, [number_of_neighbors])
288 nullify (neighbors_of_particle)
290 end subroutine kim_model_compute_arguments_get_neighbor_list
320 model_compute_arguments_handle, de, r, dx, i, j, ierr)
321 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
324 integer(c_int) recursive function process_dedr_term( &
325 model_compute_arguments, de, r, dx, i, j) &
326 bind(c, name="KIM_ModelComputeArguments_ProcessDEDrTerm")
327 use,
intrinsic :: iso_c_binding
328 use kim_interoperable_types_module,
only: &
329 kim_model_compute_arguments_type
331 type(kim_model_compute_arguments_type),
intent(in) :: &
332 model_compute_arguments
333 real(c_double),
intent(in),
value :: de
334 real(c_double),
intent(in),
value :: r
335 real(c_double),
intent(in) :: dx
336 integer(c_int),
intent(in),
value :: i
337 integer(c_int),
intent(in),
value :: j
340 type(kim_model_compute_arguments_handle_type),
intent(in) :: &
341 model_compute_arguments_handle
342 real(c_double),
intent(in) :: de
343 real(c_double),
intent(in) :: r
344 real(c_double),
intent(in) :: dx(:)
345 integer(c_int),
intent(in) :: i
346 integer(c_int),
intent(in) :: j
347 integer(c_int),
intent(out) :: ierr
348 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
350 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
382 model_compute_arguments_handle, de, r, dx, i, j, ierr)
383 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
386 integer(c_int) recursive function process_d2edr2_term( &
387 model_compute_arguments, de, r, dx, i, j) &
388 bind(c, name="KIM_ModelComputeArguments_ProcessD2EDr2Term")
389 use,
intrinsic :: iso_c_binding
390 use kim_interoperable_types_module,
only: &
391 kim_model_compute_arguments_type
393 type(kim_model_compute_arguments_type),
intent(in) :: &
394 model_compute_arguments
395 real(c_double),
intent(in),
value :: de
396 real(c_double),
intent(in) :: r
397 real(c_double),
intent(in) :: dx
398 integer(c_int),
intent(in) :: i
399 integer(c_int),
intent(in) :: j
402 type(kim_model_compute_arguments_handle_type),
intent(in) :: &
403 model_compute_arguments_handle
404 real(c_double),
intent(in) :: de
405 real(c_double),
intent(in) :: r(:)
406 real(c_double),
intent(in) :: dx(:, :)
407 integer(c_int),
intent(in) :: i(:)
408 integer(c_int),
intent(in) :: j(:)
409 integer(c_int),
intent(out) :: ierr
410 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
412 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
414 de, r(1), dx(1, 1), i(1), j(1))
424 model_compute_arguments_handle, compute_argument_name, int0, ierr)
426 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
429 integer(c_int) recursive function get_argument_pointer_integer( &
430 model_compute_arguments, compute_argument_name, ptr) &
431 bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerInteger")
432 use,
intrinsic :: iso_c_binding
435 use kim_interoperable_types_module,
only: &
436 kim_model_compute_arguments_type
438 type(kim_model_compute_arguments_type),
intent(in) :: &
439 model_compute_arguments
440 type(kim_compute_argument_name_type),
intent(in),
value :: &
441 compute_argument_name
442 type(c_ptr),
intent(out) :: ptr
445 type(kim_model_compute_arguments_handle_type),
intent(in) :: &
446 model_compute_arguments_handle
447 type(kim_compute_argument_name_type),
intent(in) :: &
448 compute_argument_name
449 integer(c_int),
intent(out),
pointer :: int0
450 integer(c_int),
intent(out) :: ierr
451 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
455 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
457 compute_argument_name, p)
458 if (c_associated(p))
then
459 call c_f_pointer(p, int0)
472 model_compute_arguments_handle, compute_argument_name, extent1, int1, ierr)
474 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
478 model_compute_arguments, compute_argument_name, ptr) &
479 bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerInteger")
480 use,
intrinsic :: iso_c_binding
483 use kim_interoperable_types_module,
only: &
484 kim_model_compute_arguments_type
486 type(kim_model_compute_arguments_type),
intent(in) :: &
487 model_compute_arguments
489 compute_argument_name
490 type(c_ptr),
intent(out) :: ptr
494 model_compute_arguments_handle
495 type(kim_compute_argument_name_type),
intent(in) :: &
496 compute_argument_name
497 integer(c_int),
intent(in) :: extent1
498 integer(c_int),
intent(out),
pointer :: int1(:)
499 integer(c_int),
intent(out) :: ierr
500 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
504 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
506 compute_argument_name, p)
507 if (c_associated(p))
then
508 call c_f_pointer(p, int1, [extent1])
522 model_compute_arguments_handle, compute_argument_name, extent1, extent2, &
525 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
529 model_compute_arguments, compute_argument_name, ptr) &
530 bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerInteger")
531 use,
intrinsic :: iso_c_binding
534 use kim_interoperable_types_module,
only: &
535 kim_model_compute_arguments_type
537 type(kim_model_compute_arguments_type),
intent(in) :: &
538 model_compute_arguments
540 compute_argument_name
541 type(c_ptr),
intent(out) :: ptr
545 model_compute_arguments_handle
546 type(kim_compute_argument_name_type),
intent(in) :: &
547 compute_argument_name
548 integer(c_int),
intent(in) :: extent1
549 integer(c_int),
intent(in) :: extent2
550 integer(c_int),
intent(out),
pointer :: int2(:, :)
551 integer(c_int),
intent(out) :: ierr
552 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
556 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
558 compute_argument_name, p)
559 if (c_associated(p))
then
560 call c_f_pointer(p, int2, [extent1, extent2])
572 recursive subroutine &
574 model_compute_arguments_handle, compute_argument_name, double0, ierr)
576 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
579 integer(c_int) recursive function get_argument_pointer_double( &
580 model_compute_arguments, compute_argument_name, ptr) &
581 bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerDouble")
582 use,
intrinsic :: iso_c_binding
585 use kim_interoperable_types_module,
only: &
586 kim_model_compute_arguments_type
588 type(kim_model_compute_arguments_type),
intent(in) :: &
589 model_compute_arguments
590 type(kim_compute_argument_name_type),
intent(in),
value :: &
591 compute_argument_name
592 type(c_ptr),
intent(out) :: ptr
595 type(kim_model_compute_arguments_handle_type),
intent(in) :: &
596 model_compute_arguments_handle
597 type(kim_compute_argument_name_type),
intent(in) :: &
598 compute_argument_name
599 real(c_double),
intent(out),
pointer :: double0
600 integer(c_int),
intent(out) :: ierr
601 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
605 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
607 compute_argument_name, p)
608 if (c_associated(p))
then
609 call c_f_pointer(p, double0)
621 recursive subroutine &
623 model_compute_arguments_handle, compute_argument_name, extent1, double1, &
626 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
630 model_compute_arguments, compute_argument_name, ptr) &
631 bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerDouble")
632 use,
intrinsic :: iso_c_binding
635 use kim_interoperable_types_module,
only: &
636 kim_model_compute_arguments_type
638 type(kim_model_compute_arguments_type),
intent(in) :: &
639 model_compute_arguments
641 compute_argument_name
642 type(c_ptr),
intent(out) :: ptr
646 model_compute_arguments_handle
647 type(kim_compute_argument_name_type),
intent(in) :: &
648 compute_argument_name
649 integer(c_int),
intent(in) :: extent1
650 real(c_double),
intent(out),
pointer :: double1(:)
651 integer(c_int),
intent(out) :: ierr
652 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
656 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
658 compute_argument_name, p)
659 if (c_associated(p))
then
660 call c_f_pointer(p, double1, [extent1])
672 recursive subroutine &
674 model_compute_arguments_handle, compute_argument_name, extent1, extent2, &
677 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
681 model_compute_arguments, compute_argument_name, ptr) &
682 bind(c, name="KIM_ModelComputeArguments_GetArgumentPointerDouble")
683 use,
intrinsic :: iso_c_binding
686 use kim_interoperable_types_module,
only: &
687 kim_model_compute_arguments_type
689 type(kim_model_compute_arguments_type),
intent(in) :: &
690 model_compute_arguments
692 compute_argument_name
693 type(c_ptr),
intent(out) :: ptr
697 model_compute_arguments_handle
698 type(kim_compute_argument_name_type),
intent(in) :: &
699 compute_argument_name
700 integer(c_int),
intent(in) :: extent1
701 integer(c_int),
intent(in) :: extent2
702 real(c_double),
intent(out),
pointer :: double2(:, :)
703 integer(c_int),
intent(out) :: ierr
704 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
708 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
710 compute_argument_name, p)
711 if (c_associated(p))
then
712 call c_f_pointer(p, double2, [extent1, extent2])
725 model_compute_arguments_handle, compute_callback_name, present, ierr)
727 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
730 integer(c_int) recursive function is_callback_present( &
731 model_compute_arguments, compute_callback_name, present) &
732 bind(c, name="KIM_ModelComputeArguments_IsCallbackPresent")
733 use,
intrinsic :: iso_c_binding
736 use kim_interoperable_types_module,
only: &
737 kim_model_compute_arguments_type
739 type(kim_model_compute_arguments_type),
intent(in) :: &
740 model_compute_arguments
741 type(kim_compute_callback_name_type),
intent(in),
value :: &
742 compute_callback_name
743 integer(c_int),
intent(out) :: present
746 type(kim_model_compute_arguments_handle_type),
intent(in) :: &
747 model_compute_arguments_handle
748 type(kim_compute_callback_name_type),
intent(in) :: &
749 compute_callback_name
750 integer(c_int),
intent(out) :: present
751 integer(c_int),
intent(out) :: ierr
752 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
754 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
766 model_compute_arguments_handle, ptr)
767 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
771 model_compute_arguments, ptr) &
772 bind(c, name="KIM_ModelComputeArguments_SetModelBufferPointer")
773 use,
intrinsic :: iso_c_binding
774 use kim_interoperable_types_module,
only: &
775 kim_model_compute_arguments_type
777 type(kim_model_compute_arguments_type),
intent(in) :: &
778 model_compute_arguments
779 type(c_ptr),
intent(in),
value :: ptr
783 model_compute_arguments_handle
784 type(c_ptr),
intent(in) :: ptr
785 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
787 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
798 model_compute_arguments_handle, ptr)
799 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
803 model_compute_arguments, ptr) &
804 bind(c, name="KIM_ModelComputeArguments_GetModelBufferPointer")
805 use,
intrinsic :: iso_c_binding
806 use kim_interoperable_types_module,
only: &
807 kim_model_compute_arguments_type
809 type(kim_model_compute_arguments_type),
intent(in) :: &
810 model_compute_arguments
811 type(c_ptr),
intent(out) :: ptr
815 model_compute_arguments_handle
816 type(c_ptr),
intent(out) :: ptr
817 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
819 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
830 model_compute_arguments_handle, log_verbosity, message)
832 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
835 recursive subroutine log_entry(model_compute_arguments, log_verbosity, &
836 message, line_number, file_name) &
837 bind(c, name="KIM_ModelComputeArguments_LogEntry")
838 use,
intrinsic :: iso_c_binding
840 use kim_interoperable_types_module,
only: &
841 kim_model_compute_arguments_type
843 type(kim_model_compute_arguments_type),
intent(in) :: &
844 model_compute_arguments
846 character(c_char),
intent(in) :: message(*)
847 integer(c_int),
intent(in),
value :: line_number
848 character(c_char),
intent(in) :: file_name(*)
852 model_compute_arguments_handle
853 type(kim_log_verbosity_type),
intent(in) :: log_verbosity
854 character(len=*, kind=c_char),
intent(in) :: message
855 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
857 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
858 call log_entry(model_compute_arguments, log_verbosity, &
859 trim(message)//c_null_char, 0,
""//c_null_char)
869 model_compute_arguments_handle, string)
870 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
871 use kim_interoperable_types_module,
only: kim_model_compute_arguments_type
874 type(c_ptr)
recursive function model_compute_string( &
875 model_compute_arguments) &
876 bind(c, name="KIM_ModelComputeArguments_ToString")
877 use,
intrinsic :: iso_c_binding
878 use kim_interoperable_types_module,
only: &
879 kim_model_compute_arguments_type
881 type(kim_model_compute_arguments_type),
intent(in) :: &
882 model_compute_arguments
885 type(kim_model_compute_arguments_handle_type),
intent(in) :: &
886 model_compute_arguments_handle
887 character(len=*, kind=c_char),
intent(out) :: string
888 type(kim_model_compute_arguments_type),
pointer :: model_compute_arguments
892 call c_f_pointer(model_compute_arguments_handle%p, model_compute_arguments)
894 call kim_convert_c_char_ptr_to_string(p, string)
Get the data pointer for a ComputeArgumentName.
Get the Model's buffer pointer within the ComputeArguments object.
Get the neighbor list for a particle of interest corresponding to a particular neighbor list cutoff d...
Determine if the Simulator has provided a non-NULL function pointer for a ComputeCallbackName of inte...
Write a log entry into the log file.
Call the Simulator's COMPUTE_CALLBACK_NAME::ProcessD2EDr2Term routine.
Call the Simulator's COMPUTE_CALLBACK_NAME::ProcessDEDrTerm routine.
Set the Model's buffer pointer within the ComputeArguments object.
Get a string representing the internal state of the ComputeArguments object.
An Extensible Enumeration for the ComputeArgumentName's supported by the KIM API.
An Extensible Enumeration for the ComputeCallbackName's supported by the KIM API.
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUT...
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_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.
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_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_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_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_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_double1(model_compute_arguments_handle, compute_argument_name, extent1, double1, 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_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.
An Extensible Enumeration for the ComputeArgumentName's supported by the KIM API.
An Extensible Enumeration for the ComputeCallbackName's supported by the KIM API.
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUT...