36 use,
intrinsic :: iso_c_binding
42 kim_simulator_model_handle_type, &
50 kim_get_simulator_name_and_version, &
51 kim_get_number_of_supported_species, &
52 kim_get_supported_species, &
53 kim_open_and_initialize_template_map, &
54 kim_template_map_is_open, &
55 kim_add_template_map, &
56 kim_close_template_map, &
57 kim_get_number_of_simulator_fields, &
58 kim_get_simulator_field_metadata, &
59 kim_get_simulator_field_line, &
60 kim_get_parameter_file_directory_name, &
61 kim_get_specification_file_name, &
62 kim_get_number_of_parameter_files, &
63 kim_get_parameter_file_name, &
64 kim_get_parameter_file_basename, &
65 kim_set_simulator_buffer_pointer, &
66 kim_get_simulator_buffer_pointer, &
69 kim_push_log_verbosity, &
77 type, bind(c) :: kim_simulator_model_handle_type
78 type(c_ptr) :: p = c_null_ptr
79 end type kim_simulator_model_handle_type
84 type(kim_simulator_model_handle_type),
protected,
save &
90 interface operator(.eq.)
91 module procedure kim_simulator_model_handle_equal
92 end interface operator(.eq.)
97 interface operator(.ne.)
98 module procedure kim_simulator_model_handle_not_equal
99 end interface operator(.ne.)
107 interface kim_get_simulator_name_and_version
108 module procedure kim_simulator_model_get_simulator_name_and_version
109 end interface kim_get_simulator_name_and_version
117 interface kim_get_number_of_supported_species
119 end interface kim_get_number_of_supported_species
127 interface kim_get_supported_species
129 end interface kim_get_supported_species
137 interface kim_open_and_initialize_template_map
139 end interface kim_open_and_initialize_template_map
147 interface kim_template_map_is_open
149 end interface kim_template_map_is_open
156 interface kim_add_template_map
158 end interface kim_add_template_map
166 interface kim_close_template_map
168 end interface kim_close_template_map
176 interface kim_get_number_of_simulator_fields
178 end interface kim_get_number_of_simulator_fields
186 interface kim_get_simulator_field_metadata
188 end interface kim_get_simulator_field_metadata
196 interface kim_get_simulator_field_line
198 end interface kim_get_simulator_field_line
206 interface kim_get_parameter_file_directory_name
208 end interface kim_get_parameter_file_directory_name
216 interface kim_get_specification_file_name
218 end interface kim_get_specification_file_name
226 interface kim_get_number_of_parameter_files
228 end interface kim_get_number_of_parameter_files
239 interface kim_get_parameter_file_name
241 end interface kim_get_parameter_file_name
249 interface kim_get_parameter_file_basename
251 end interface kim_get_parameter_file_basename
259 interface kim_set_simulator_buffer_pointer
261 end interface kim_set_simulator_buffer_pointer
269 interface kim_get_simulator_buffer_pointer
271 end interface kim_get_simulator_buffer_pointer
278 interface kim_to_string
280 end interface kim_to_string
287 interface kim_set_log_id
289 end interface kim_set_log_id
297 interface kim_push_log_verbosity
299 end interface kim_push_log_verbosity
306 interface kim_pop_log_verbosity
308 end interface kim_pop_log_verbosity
314 logical recursive function kim_simulator_model_handle_equal(lhs, rhs)
316 type(kim_simulator_model_handle_type),
intent(in) :: lhs
317 type(kim_simulator_model_handle_type),
intent(in) :: rhs
319 if ((.not. c_associated(lhs%p)) .and. (.not. c_associated(rhs%p)))
then 320 kim_simulator_model_handle_equal = .true.
322 kim_simulator_model_handle_equal = c_associated(lhs%p, rhs%p)
324 end function kim_simulator_model_handle_equal
329 logical recursive function kim_simulator_model_handle_not_equal(lhs, rhs)
331 type(kim_simulator_model_handle_type),
intent(in) :: lhs
332 type(kim_simulator_model_handle_type),
intent(in) :: rhs
334 kim_simulator_model_handle_not_equal = .not. (lhs == rhs)
335 end function kim_simulator_model_handle_not_equal
343 simulator_model_handle, ierr)
346 integer(c_int) recursive function create( &
347 simulator_model_name, simulator_model) &
348 bind(c, name=
"KIM_SimulatorModel_Create")
349 use,
intrinsic :: iso_c_binding
351 character(c_char),
intent(in) :: simulator_model_name(*)
352 type(c_ptr),
intent(out) :: simulator_model
355 character(len=*, kind=c_char),
intent(in) :: simulator_model_name
356 type(kim_simulator_model_handle_type),
intent(out) :: simulator_model_handle
357 integer(c_int),
intent(out) :: ierr
359 type(c_ptr) :: psimulator_model
361 ierr = create(trim(simulator_model_name)//c_null_char, psimulator_model)
362 simulator_model_handle%p = psimulator_model
373 recursive subroutine destroy(simulator_model) &
374 bind(c, name=
"KIM_SimulatorModel_Destroy")
375 use,
intrinsic :: iso_c_binding
377 type(c_ptr),
intent(inout) :: simulator_model
378 end subroutine destroy
380 type(kim_simulator_model_handle_type),
intent(inout) :: &
381 simulator_model_handle
383 type(c_ptr) :: psimulator_model
384 psimulator_model = simulator_model_handle%p
385 call destroy(psimulator_model)
386 simulator_model_handle%p = c_null_ptr
395 recursive subroutine kim_simulator_model_get_simulator_name_and_version( &
396 simulator_model_handle, simulator_name, simulator_version)
397 use kim_interoperable_types_module
, only: kim_simulator_model_type
398 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
401 recursive subroutine get_simulator_name_and_version( &
402 simulator_model, simulator_name, simulator_version) &
403 bind(c, name=
"KIM_SimulatorModel_GetSimulatorNameAndVersion")
404 use,
intrinsic :: iso_c_binding
405 use kim_interoperable_types_module
, only: kim_simulator_model_type
407 type(kim_simulator_model_type),
intent(in) :: simulator_model
408 type(c_ptr),
intent(out) :: simulator_name
409 type(c_ptr),
intent(out) :: simulator_version
410 end subroutine get_simulator_name_and_version
412 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
413 character(len=*, kind=c_char),
intent(out) :: simulator_name
414 character(len=*, kind=c_char),
intent(out) :: simulator_version
415 type(kim_simulator_model_type),
pointer :: simulator_model
417 type(c_ptr) psimulator_name, psimulator_version
419 call c_f_pointer(simulator_model_handle%p, simulator_model)
420 call get_simulator_name_and_version(simulator_model, psimulator_name, &
422 call kim_convert_c_char_ptr_to_string(psimulator_name, simulator_name)
423 call kim_convert_c_char_ptr_to_string(psimulator_version, simulator_version)
424 end subroutine kim_simulator_model_get_simulator_name_and_version
433 simulator_model_handle, number_of_supported_species)
434 use kim_interoperable_types_module
, only: kim_simulator_model_type
437 recursive subroutine get_number_of_supported_species( &
438 simulator_model, number_of_supported_species) &
439 bind(c, name=
"KIM_SimulatorModel_GetNumberOfSupportedSpecies")
440 use,
intrinsic :: iso_c_binding
441 use kim_interoperable_types_module
, only: kim_simulator_model_type
443 type(kim_simulator_model_type),
intent(in) :: simulator_model
444 integer(c_int),
intent(out) :: number_of_supported_species
445 end subroutine get_number_of_supported_species
447 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
448 integer(c_int),
intent(out) :: number_of_supported_species
449 type(kim_simulator_model_type),
pointer :: simulator_model
451 call c_f_pointer(simulator_model_handle%p, simulator_model)
452 call get_number_of_supported_species(simulator_model, &
453 number_of_supported_species)
463 simulator_model_handle, index, species_name, ierr)
464 use kim_interoperable_types_module
, only: kim_simulator_model_type
465 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
468 integer(c_int) recursive function get_supported_species( &
469 simulator_model, index, species_name) &
470 bind(c, name=
"KIM_SimulatorModel_GetSupportedSpecies")
471 use,
intrinsic :: iso_c_binding
472 use kim_interoperable_types_module
, only: kim_simulator_model_type
474 type(kim_simulator_model_type),
intent(in) :: simulator_model
475 integer(c_int),
intent(in),
value :: index
476 type(c_ptr),
intent(out) :: species_name
477 end function get_supported_species
479 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
480 integer(c_int),
intent(in) :: index
481 character(len=*, kind=c_char),
intent(out) :: species_name
482 integer(c_int),
intent(out) :: ierr
483 type(kim_simulator_model_type),
pointer :: simulator_model
485 type(c_ptr) pspecies_name
487 call c_f_pointer(simulator_model_handle%p, simulator_model)
488 ierr = get_supported_species(simulator_model, index - 1, pspecies_name)
489 call kim_convert_c_char_ptr_to_string(pspecies_name, species_name)
499 simulator_model_handle)
500 use kim_interoperable_types_module
, only: kim_simulator_model_type
503 recursive subroutine open_and_initialize_template_map(simulator_model) &
504 bind(c, name=
"KIM_SimulatorModel_OpenAndInitializeTemplateMap")
505 use,
intrinsic :: iso_c_binding
506 use kim_interoperable_types_module
, only: kim_simulator_model_type
508 type(kim_simulator_model_type),
intent(in) :: simulator_model
509 end subroutine open_and_initialize_template_map
511 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
512 type(kim_simulator_model_type),
pointer :: simulator_model
514 call c_f_pointer(simulator_model_handle%p, simulator_model)
515 call open_and_initialize_template_map(simulator_model)
525 simulator_model_handle)
526 use kim_interoperable_types_module
, only: kim_simulator_model_type
529 integer(c_int) recursive function template_map_is_open(simulator_model) &
530 bind(c, name=
"KIM_SimulatorModel_TemplateMapIsOpen")
531 use,
intrinsic :: iso_c_binding
532 use kim_interoperable_types_module
, only: kim_simulator_model_type
534 type(kim_simulator_model_type),
intent(in) :: simulator_model
535 end function template_map_is_open
537 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
538 type(kim_simulator_model_type),
pointer :: simulator_model
540 call c_f_pointer(simulator_model_handle%p, simulator_model)
551 simulator_model_handle, key, value, ierr)
552 use kim_interoperable_types_module
, only: kim_simulator_model_type
553 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
556 integer(c_int) recursive function add_template_map( &
557 simulator_model, key, value) &
558 bind(c, name=
"KIM_SimulatorModel_AddTemplateMap")
559 use,
intrinsic :: iso_c_binding
560 use kim_interoperable_types_module
, only: kim_simulator_model_type
562 type(kim_simulator_model_type),
intent(in) :: simulator_model
563 character(c_char),
intent(in) :: key(*)
564 character(c_char),
intent(in) ::
value(*)
565 end function add_template_map
567 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
568 character(len=*, kind=c_char),
intent(in) :: key
569 character(len=*, kind=c_char),
intent(in) :: value
570 integer(c_int),
intent(out) :: ierr
571 type(kim_simulator_model_type),
pointer :: simulator_model
573 call c_f_pointer(simulator_model_handle%p, simulator_model)
574 ierr = add_template_map(simulator_model, trim(key)//c_null_char, &
575 trim(
value)//c_null_char)
585 simulator_model_handle)
586 use kim_interoperable_types_module
, only: kim_simulator_model_type
589 recursive subroutine close_template_map(simulator_model) &
590 bind(c, name=
"KIM_SimulatorModel_CloseTemplateMap")
591 use,
intrinsic :: iso_c_binding
592 use kim_interoperable_types_module
, only: kim_simulator_model_type
594 type(kim_simulator_model_type),
intent(in) :: simulator_model
595 end subroutine close_template_map
597 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
598 type(kim_simulator_model_type),
pointer :: simulator_model
600 call c_f_pointer(simulator_model_handle%p, simulator_model)
601 call close_template_map(simulator_model)
611 simulator_model_handle, number_of_simulator_fields)
612 use kim_interoperable_types_module
, only: kim_simulator_model_type
615 recursive subroutine get_number_of_simulator_fields( &
616 simulator_model, number_of_simulator_fields) &
617 bind(c, name=
"KIM_SimulatorModel_GetNumberOfSimulatorFields")
618 use,
intrinsic :: iso_c_binding
619 use kim_interoperable_types_module
, only: kim_simulator_model_type
621 type(kim_simulator_model_type),
intent(in) :: simulator_model
622 integer(c_int),
intent(out) :: number_of_simulator_fields
623 end subroutine get_number_of_simulator_fields
625 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
626 integer(c_int),
intent(out) :: number_of_simulator_fields
627 type(kim_simulator_model_type),
pointer :: simulator_model
629 call c_f_pointer(simulator_model_handle%p, simulator_model)
630 call get_number_of_simulator_fields(simulator_model, &
631 number_of_simulator_fields)
641 simulator_model_handle, field_index, extent, field_name, ierr)
642 use kim_interoperable_types_module
, only: kim_simulator_model_type
643 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
646 integer(c_int) recursive function get_simulator_field_metadata( &
647 simulator_model, field_index, extent, field_name) &
648 bind(c, name=
"KIM_SimulatorModel_GetSimulatorFieldMetadata")
649 use,
intrinsic :: iso_c_binding
650 use kim_interoperable_types_module
, only: kim_simulator_model_type
652 type(kim_simulator_model_type),
intent(in) :: simulator_model
653 integer(c_int),
intent(in),
value :: field_index
654 integer(c_int),
intent(out) :: extent
655 type(c_ptr),
intent(out) :: field_name
656 end function get_simulator_field_metadata
658 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
659 integer(c_int),
intent(in) :: field_index
660 integer(c_int),
intent(out) :: extent
661 character(len=*, kind=c_char),
intent(out) :: field_name
662 integer(c_int),
intent(out) :: ierr
663 type(kim_simulator_model_type),
pointer :: simulator_model
665 type(c_ptr) pfield_name
667 call c_f_pointer(simulator_model_handle%p, simulator_model)
668 ierr = get_simulator_field_metadata(simulator_model, field_index - 1, &
670 call kim_convert_c_char_ptr_to_string(pfield_name, field_name)
680 simulator_model_handle, field_index, line_index, line_value, ierr)
681 use kim_interoperable_types_module
, only: kim_simulator_model_type
682 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
685 integer(c_int) recursive function get_simulator_field_line( &
686 simulator_model, field_index, line_index, line_value) &
687 bind(c, name=
"KIM_SimulatorModel_GetSimulatorFieldLine")
688 use,
intrinsic :: iso_c_binding
689 use kim_interoperable_types_module
, only: kim_simulator_model_type
691 type(kim_simulator_model_type),
intent(in) :: simulator_model
692 integer(c_int),
intent(in),
value :: field_index
693 integer(c_int),
intent(in),
value :: line_index
694 type(c_ptr),
intent(out) :: line_value
695 end function get_simulator_field_line
697 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
698 integer(c_int),
intent(in),
value :: field_index
699 integer(c_int),
intent(in),
value :: line_index
700 character(len=*, kind=c_char),
intent(out) :: line_value
701 integer(c_int),
intent(out) :: ierr
702 type(kim_simulator_model_type),
pointer :: simulator_model
704 type(c_ptr) pline_value
706 call c_f_pointer(simulator_model_handle%p, simulator_model)
707 ierr = get_simulator_field_line(simulator_model, field_index - 1, &
708 line_index - 1, pline_value)
709 call kim_convert_c_char_ptr_to_string(pline_value, line_value)
719 simulator_model_handle, directory_name)
720 use kim_interoperable_types_module
, only: kim_simulator_model_type
721 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
724 recursive subroutine get_parameter_file_directory_name(simulator_model, &
726 bind(c, name=
"KIM_SimulatorModel_GetParameterFileDirectoryName")
727 use,
intrinsic :: iso_c_binding
728 use kim_interoperable_types_module
, only: kim_simulator_model_type
730 type(kim_simulator_model_type),
intent(in) :: simulator_model
731 type(c_ptr),
intent(out) :: directory_name
732 end subroutine get_parameter_file_directory_name
734 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
735 character(len=*, kind=c_char),
intent(out) :: directory_name
736 type(kim_simulator_model_type),
pointer :: simulator_model
738 type(c_ptr) pdirectory_name
740 call c_f_pointer(simulator_model_handle%p, simulator_model)
741 call get_parameter_file_directory_name(simulator_model, pdirectory_name)
742 call kim_convert_c_char_ptr_to_string(pdirectory_name, directory_name)
752 simulator_model_handle, specification_file_name)
753 use kim_interoperable_types_module
, only: kim_simulator_model_type
754 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
757 recursive subroutine get_specification_file_name( &
758 simulator_model, specification_file_name) &
759 bind(c, name=
"KIM_SimulatorModel_GetSpecificationFileName")
760 use,
intrinsic :: iso_c_binding
761 use kim_interoperable_types_module
, only: kim_simulator_model_type
763 type(kim_simulator_model_type),
intent(in) :: simulator_model
764 type(c_ptr),
intent(out) :: specification_file_name
765 end subroutine get_specification_file_name
767 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
768 character(len=*, kind=c_char),
intent(out) :: specification_file_name
769 type(kim_simulator_model_type),
pointer :: simulator_model
771 type(c_ptr) pspecification_file_name
773 call c_f_pointer(simulator_model_handle%p, simulator_model)
774 call get_specification_file_name(simulator_model, pspecification_file_name)
775 call kim_convert_c_char_ptr_to_string(pspecification_file_name, &
776 specification_file_name)
786 simulator_model_handle, number_of_parameter_files)
787 use kim_interoperable_types_module
, only: kim_simulator_model_type
790 recursive subroutine get_number_of_parameter_files( &
791 simulator_model, number_of_parameter_files) &
792 bind(c, name=
"KIM_SimulatorModel_GetNumberOfParameterFiles")
793 use,
intrinsic :: iso_c_binding
794 use kim_interoperable_types_module
, only: kim_simulator_model_type
796 type(kim_simulator_model_type),
intent(in) :: simulator_model
797 integer(c_int),
intent(out) :: number_of_parameter_files
798 end subroutine get_number_of_parameter_files
800 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
801 integer(c_int),
intent(out) :: number_of_parameter_files
802 type(kim_simulator_model_type),
pointer :: simulator_model
804 call c_f_pointer(simulator_model_handle%p, simulator_model)
805 call get_number_of_parameter_files(simulator_model, &
806 number_of_parameter_files)
819 simulator_model_handle, index, parameter_file_name, ierr)
820 use kim_interoperable_types_module
, only: kim_simulator_model_type
821 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
824 integer(c_int) recursive function get_parameter_file_name( &
825 simulator_model, index, parameter_file_name) &
826 bind(c, name=
"KIM_SimulatorModel_GetParameterFileName")
827 use,
intrinsic :: iso_c_binding
828 use kim_interoperable_types_module
, only: kim_simulator_model_type
830 type(kim_simulator_model_type),
intent(in) :: simulator_model
831 integer(c_int),
intent(in),
value :: index
832 type(c_ptr),
intent(out) :: parameter_file_name
833 end function get_parameter_file_name
835 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
836 integer(c_int),
intent(in) :: index
837 character(len=*, kind=c_char),
intent(out) :: parameter_file_name
838 integer(c_int),
intent(out) :: ierr
839 type(kim_simulator_model_type),
pointer :: simulator_model
841 type(c_ptr) pparameter_file_name
843 call c_f_pointer(simulator_model_handle%p, simulator_model)
844 ierr = get_parameter_file_name(simulator_model, index - 1, &
845 pparameter_file_name)
846 call kim_convert_c_char_ptr_to_string(pparameter_file_name, &
857 simulator_model_handle, index, parameter_file_basename, ierr)
858 use kim_interoperable_types_module
, only: kim_simulator_model_type
859 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
862 integer(c_int) recursive function get_parameter_file_basename( &
863 simulator_model, index, parameter_file_basename) &
864 bind(c, name=
"KIM_SimulatorModel_GetParameterFileBasename")
865 use,
intrinsic :: iso_c_binding
866 use kim_interoperable_types_module
, only: kim_simulator_model_type
868 type(kim_simulator_model_type),
intent(in) :: simulator_model
869 integer(c_int),
intent(in),
value :: index
870 type(c_ptr),
intent(out) :: parameter_file_basename
871 end function get_parameter_file_basename
873 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
874 integer(c_int),
intent(in) :: index
875 character(len=*, kind=c_char),
intent(out) :: parameter_file_basename
876 integer(c_int),
intent(out) :: ierr
877 type(kim_simulator_model_type),
pointer :: simulator_model
879 type(c_ptr) pparameter_file_basename
881 call c_f_pointer(simulator_model_handle%p, simulator_model)
882 ierr = get_parameter_file_basename(simulator_model, index - 1, &
883 pparameter_file_basename)
884 call kim_convert_c_char_ptr_to_string(pparameter_file_basename, &
885 parameter_file_basename)
895 simulator_model_handle, ptr)
896 use kim_interoperable_types_module
, only: kim_simulator_model_type
899 recursive subroutine set_simulator_buffer_pointer(simulator_model, ptr) &
900 bind(c, name=
"KIM_SimulatorModel_SetSimulatorBufferPointer")
901 use,
intrinsic :: iso_c_binding
902 use kim_interoperable_types_module
, only: kim_simulator_model_type
904 type(kim_simulator_model_type),
intent(in) :: simulator_model
905 type(c_ptr),
intent(in),
value :: ptr
906 end subroutine set_simulator_buffer_pointer
908 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
909 type(c_ptr),
intent(in) :: ptr
910 type(kim_simulator_model_type),
pointer :: simulator_model
912 call c_f_pointer(simulator_model_handle%p, simulator_model)
913 call set_simulator_buffer_pointer(simulator_model, ptr)
923 simulator_model_handle, ptr)
924 use kim_interoperable_types_module
, only: kim_simulator_model_type
927 recursive subroutine get_simulator_buffer_pointer(simulator_model, ptr) &
928 bind(c, name=
"KIM_SimulatorModel_GetSimulatorBufferPointer")
929 use,
intrinsic :: iso_c_binding
930 use kim_interoperable_types_module
, only: kim_simulator_model_type
932 type(kim_simulator_model_type),
intent(in) :: simulator_model
933 type(c_ptr),
intent(out) :: ptr
934 end subroutine get_simulator_buffer_pointer
936 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
937 type(c_ptr),
intent(out) :: ptr
938 type(kim_simulator_model_type),
pointer :: simulator_model
940 call c_f_pointer(simulator_model_handle%p, simulator_model)
941 call get_simulator_buffer_pointer(simulator_model, ptr)
951 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
952 use kim_interoperable_types_module
, only: kim_simulator_model_type
955 type(c_ptr)
recursive function model_string(simulator_model) &
956 bind(c, name=
"KIM_SimulatorModel_ToString")
957 use,
intrinsic :: iso_c_binding
958 use kim_interoperable_types_module
, only: kim_simulator_model_type
960 type(kim_simulator_model_type),
intent(in) :: simulator_model
961 end function model_string
963 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
964 character(len=*, kind=c_char),
intent(out) :: string
965 type(kim_simulator_model_type),
pointer :: simulator_model
969 call c_f_pointer(simulator_model_handle%p, simulator_model)
970 p = model_string(simulator_model)
971 call kim_convert_c_char_ptr_to_string(p, string)
981 use kim_interoperable_types_module
, only: kim_simulator_model_type
984 recursive subroutine set_log_id(simulator_model, log_id) &
985 bind(c, name=
"KIM_SimulatorModel_SetLogID")
986 use,
intrinsic :: iso_c_binding
987 use kim_interoperable_types_module
, only: kim_simulator_model_type
989 type(kim_simulator_model_type),
intent(in) :: simulator_model
990 character(c_char),
intent(in) :: log_id(*)
991 end subroutine set_log_id
993 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
994 character(len=*, kind=c_char),
intent(in) :: log_id
995 type(kim_simulator_model_type),
pointer :: simulator_model
997 call c_f_pointer(simulator_model_handle%p, simulator_model)
998 call set_log_id(simulator_model, trim(log_id)//c_null_char)
1008 simulator_model_handle, log_verbosity)
1010 use kim_interoperable_types_module
, only: kim_simulator_model_type
1013 recursive subroutine push_log_verbosity(simulator_model, log_verbosity) &
1014 bind(c, name=
"KIM_SimulatorModel_PushLogVerbosity")
1015 use,
intrinsic :: iso_c_binding
1017 use kim_interoperable_types_module
, only: kim_simulator_model_type
1019 type(kim_simulator_model_type),
intent(in) :: simulator_model
1020 type(kim_log_verbosity_type),
intent(in),
value :: log_verbosity
1021 end subroutine push_log_verbosity
1023 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
1024 type(kim_log_verbosity_type),
intent(in) :: log_verbosity
1025 type(kim_simulator_model_type),
pointer :: simulator_model
1027 call c_f_pointer(simulator_model_handle%p, simulator_model)
1028 call push_log_verbosity(simulator_model, log_verbosity)
1037 simulator_model_handle)
1039 use kim_interoperable_types_module
, only: kim_simulator_model_type
1042 recursive subroutine pop_log_verbosity(simulator_model) &
1043 bind(c, name=
"KIM_SimulatorModel_PopLogVerbosity")
1044 use,
intrinsic :: iso_c_binding
1046 use kim_interoperable_types_module
, only: kim_simulator_model_type
1048 type(kim_simulator_model_type),
intent(in) :: simulator_model
1049 end subroutine pop_log_verbosity
1051 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
1052 type(kim_simulator_model_type),
pointer :: simulator_model
1054 call c_f_pointer(simulator_model_handle%p, simulator_model)
1055 call pop_log_verbosity(simulator_model)
recursive subroutine, public kim_simulator_model_create(simulator_model_name, simulator_model_handle, ierr)
Create a new KIM API SimulatorModel object.
recursive subroutine kim_simulator_model_close_template_map(simulator_model_handle)
Close the template map and perform template substitutions.
recursive subroutine kim_simulator_model_get_number_of_parameter_files(simulator_model_handle, number_of_parameter_files)
Get the number of parameter files provided by the SimulatorModel.
recursive subroutine kim_simulator_model_set_simulator_buffer_pointer(simulator_model_handle, ptr)
Set the Simulator's buffer pointer within the SimulatorModel object.
recursive subroutine kim_simulator_model_push_log_verbosity(simulator_model_handle, log_verbosity)
Push a new LogVerbosity onto the SimulatorModel object's Log object verbosity stack.
integer(c_int) recursive function kim_simulator_model_template_map_is_open(simulator_model_handle)
Determine if the template map is open.
recursive subroutine kim_simulator_model_get_parameter_file_name(simulator_model_handle, index, parameter_file_name, ierr)
Get the basename (file name without path) of a particular parameter file. The file is located in the ...
recursive subroutine kim_simulator_model_get_number_of_simulator_fields(simulator_model_handle, number_of_simulator_fields)
Get the number of simulator fields provided by the SimulatorModel.
type(kim_simulator_model_handle_type), save, public, protected kim_simulator_model_null_handle
NULL handle for use in comparisons.
recursive subroutine kim_simulator_model_get_specification_file_name(simulator_model_handle, specification_file_name)
Get the SimulatorModel's specification file basename (file name without path). The file is located in...
Provides the primary interface to a KIM API SimulatorModel object and is meant to be used by simulato...
recursive subroutine kim_simulator_model_add_template_map(simulator_model_handle, key, value, ierr)
Add a new key-value entry to the template map.
recursive subroutine kim_simulator_model_get_simulator_buffer_pointer(simulator_model_handle, ptr)
Get the Simulator's buffer pointer from the SimulatorModel object.
recursive subroutine kim_simulator_model_set_log_id(simulator_model_handle, log_id)
Set the identity of the Log object associated with the SimulatorModel object.
recursive subroutine kim_simulator_model_pop_log_verbosity(simulator_model_handle)
Pop a LogVerbosity from the SimulatorModel object's Log object verbosity stack.
recursive subroutine kim_simulator_model_get_simulator_field_metadata(simulator_model_handle, field_index, extent, field_name, ierr)
Get the metadata for the simulator field of interest.
recursive subroutine, public kim_simulator_model_destroy(simulator_model_handle)
Destroy a previously SimulatorModel::Create'd object.
recursive subroutine kim_simulator_model_get_simulator_field_line(simulator_model_handle, field_index, line_index, line_value, ierr)
Get a line for the simulator field of interest with all template substitutions performed (Requires th...
recursive subroutine kim_simulator_model_get_number_of_supported_species(simulator_model_handle, number_of_supported_species)
Get the number of species supported by the SimulatorModel.
recursive subroutine kim_simulator_model_get_parameter_file_basename(simulator_model_handle, index, parameter_file_basename, ierr)
Get the basename (file name without path) of a particular parameter file. The file is located in the ...
recursive subroutine kim_simulator_model_get_parameter_file_directory_name(simulator_model_handle, directory_name)
Get absolute path name of the temporary directory where parameter files provided by the simulator mod...
recursive subroutine kim_simulator_model_get_supported_species(simulator_model_handle, index, species_name, ierr)
Get a species name supported by the SimulatorModel.
recursive subroutine kim_simulator_model_to_string(simulator_model_handle, string)
Get a string representing the internal state of the SimulatorModel object.
recursive subroutine kim_simulator_model_open_and_initialize_template_map(simulator_model_handle)
Open and initialize the template map for simulator field line substitutions.
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.