39 use,
intrinsic :: iso_c_binding
45 kim_simulator_model_handle_type, &
53 kim_get_simulator_name_and_version, &
54 kim_get_number_of_supported_species, &
55 kim_get_supported_species, &
56 kim_open_and_initialize_template_map, &
57 kim_template_map_is_open, &
58 kim_add_template_map, &
59 kim_close_template_map, &
60 kim_get_number_of_simulator_fields, &
61 kim_get_simulator_field_metadata, &
62 kim_get_simulator_field_line, &
63 kim_get_parameter_file_directory_name, &
64 kim_get_specification_file_name, &
65 kim_get_number_of_parameter_files, &
66 kim_get_parameter_file_name, &
67 kim_get_parameter_file_basename, &
68 kim_set_simulator_buffer_pointer, &
69 kim_get_simulator_buffer_pointer, &
72 kim_push_log_verbosity, &
80 type, bind(c) :: kim_simulator_model_handle_type
81 type(c_ptr) :: p = c_null_ptr
82 end type kim_simulator_model_handle_type
87 type(kim_simulator_model_handle_type),
protected,
save &
93 interface operator(.eq.)
94 module procedure kim_simulator_model_handle_equal
95 end interface operator(.eq.)
100 interface operator(.ne.)
101 module procedure kim_simulator_model_handle_not_equal
102 end interface operator(.ne.)
110 interface kim_get_simulator_name_and_version
111 module procedure kim_simulator_model_get_simulator_name_and_version
112 end interface kim_get_simulator_name_and_version
120 interface kim_get_number_of_supported_species
122 end interface kim_get_number_of_supported_species
130 interface kim_get_supported_species
132 end interface kim_get_supported_species
140 interface kim_open_and_initialize_template_map
142 end interface kim_open_and_initialize_template_map
150 interface kim_template_map_is_open
152 end interface kim_template_map_is_open
159 interface kim_add_template_map
161 end interface kim_add_template_map
169 interface kim_close_template_map
171 end interface kim_close_template_map
179 interface kim_get_number_of_simulator_fields
181 end interface kim_get_number_of_simulator_fields
189 interface kim_get_simulator_field_metadata
191 end interface kim_get_simulator_field_metadata
199 interface kim_get_simulator_field_line
201 end interface kim_get_simulator_field_line
209 interface kim_get_parameter_file_directory_name
211 end interface kim_get_parameter_file_directory_name
219 interface kim_get_specification_file_name
221 end interface kim_get_specification_file_name
229 interface kim_get_number_of_parameter_files
231 end interface kim_get_number_of_parameter_files
242 interface kim_get_parameter_file_name
244 end interface kim_get_parameter_file_name
252 interface kim_get_parameter_file_basename
254 end interface kim_get_parameter_file_basename
262 interface kim_set_simulator_buffer_pointer
264 end interface kim_set_simulator_buffer_pointer
272 interface kim_get_simulator_buffer_pointer
274 end interface kim_get_simulator_buffer_pointer
281 interface kim_to_string
283 end interface kim_to_string
290 interface kim_set_log_id
292 end interface kim_set_log_id
300 interface kim_push_log_verbosity
302 end interface kim_push_log_verbosity
309 interface kim_pop_log_verbosity
311 end interface kim_pop_log_verbosity
317 logical recursive function kim_simulator_model_handle_equal(lhs, rhs)
319 type(kim_simulator_model_handle_type),
intent(in) :: lhs
320 type(kim_simulator_model_handle_type),
intent(in) :: rhs
322 if ((.not. c_associated(lhs%p)) .and. (.not. c_associated(rhs%p)))
then 323 kim_simulator_model_handle_equal = .true.
325 kim_simulator_model_handle_equal = c_associated(lhs%p, rhs%p)
327 end function kim_simulator_model_handle_equal
332 logical recursive function kim_simulator_model_handle_not_equal(lhs, rhs)
334 type(kim_simulator_model_handle_type),
intent(in) :: lhs
335 type(kim_simulator_model_handle_type),
intent(in) :: rhs
337 kim_simulator_model_handle_not_equal = .not. (lhs == rhs)
338 end function kim_simulator_model_handle_not_equal
346 simulator_model_handle, ierr)
349 integer(c_int) recursive function create( &
350 simulator_model_name, simulator_model) &
351 bind(c, name=
"KIM_SimulatorModel_Create")
352 use,
intrinsic :: iso_c_binding
354 character(c_char),
intent(in) :: simulator_model_name(*)
355 type(c_ptr),
intent(out) :: simulator_model
358 character(len=*, kind=c_char),
intent(in) :: simulator_model_name
359 type(kim_simulator_model_handle_type),
intent(out) :: simulator_model_handle
360 integer(c_int),
intent(out) :: ierr
362 type(c_ptr) :: psimulator_model
364 ierr = create(trim(simulator_model_name)//c_null_char, psimulator_model)
365 simulator_model_handle%p = psimulator_model
376 recursive subroutine destroy(simulator_model) &
377 bind(c, name=
"KIM_SimulatorModel_Destroy")
378 use,
intrinsic :: iso_c_binding
380 type(c_ptr),
intent(inout) :: simulator_model
381 end subroutine destroy
383 type(kim_simulator_model_handle_type),
intent(inout) :: &
384 simulator_model_handle
386 type(c_ptr) :: psimulator_model
387 psimulator_model = simulator_model_handle%p
388 call destroy(psimulator_model)
389 simulator_model_handle%p = c_null_ptr
398 recursive subroutine kim_simulator_model_get_simulator_name_and_version( &
399 simulator_model_handle, simulator_name, simulator_version)
400 use kim_interoperable_types_module
, only: kim_simulator_model_type
401 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
404 recursive subroutine get_simulator_name_and_version( &
405 simulator_model, simulator_name, simulator_version) &
406 bind(c, name=
"KIM_SimulatorModel_GetSimulatorNameAndVersion")
407 use,
intrinsic :: iso_c_binding
408 use kim_interoperable_types_module
, only: kim_simulator_model_type
410 type(kim_simulator_model_type),
intent(in) :: simulator_model
411 type(c_ptr),
intent(out) :: simulator_name
412 type(c_ptr),
intent(out) :: simulator_version
413 end subroutine get_simulator_name_and_version
415 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
416 character(len=*, kind=c_char),
intent(out) :: simulator_name
417 character(len=*, kind=c_char),
intent(out) :: simulator_version
418 type(kim_simulator_model_type),
pointer :: simulator_model
420 type(c_ptr) psimulator_name, psimulator_version
422 call c_f_pointer(simulator_model_handle%p, simulator_model)
423 call get_simulator_name_and_version(simulator_model, psimulator_name, &
425 call kim_convert_c_char_ptr_to_string(psimulator_name, simulator_name)
426 call kim_convert_c_char_ptr_to_string(psimulator_version, simulator_version)
427 end subroutine kim_simulator_model_get_simulator_name_and_version
436 simulator_model_handle, number_of_supported_species)
437 use kim_interoperable_types_module
, only: kim_simulator_model_type
440 recursive subroutine get_number_of_supported_species( &
441 simulator_model, number_of_supported_species) &
442 bind(c, name=
"KIM_SimulatorModel_GetNumberOfSupportedSpecies")
443 use,
intrinsic :: iso_c_binding
444 use kim_interoperable_types_module
, only: kim_simulator_model_type
446 type(kim_simulator_model_type),
intent(in) :: simulator_model
447 integer(c_int),
intent(out) :: number_of_supported_species
448 end subroutine get_number_of_supported_species
450 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
451 integer(c_int),
intent(out) :: number_of_supported_species
452 type(kim_simulator_model_type),
pointer :: simulator_model
454 call c_f_pointer(simulator_model_handle%p, simulator_model)
455 call get_number_of_supported_species(simulator_model, &
456 number_of_supported_species)
466 simulator_model_handle, index, species_name, ierr)
467 use kim_interoperable_types_module
, only: kim_simulator_model_type
468 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
471 integer(c_int) recursive function get_supported_species( &
472 simulator_model, index, species_name) &
473 bind(c, name=
"KIM_SimulatorModel_GetSupportedSpecies")
474 use,
intrinsic :: iso_c_binding
475 use kim_interoperable_types_module
, only: kim_simulator_model_type
477 type(kim_simulator_model_type),
intent(in) :: simulator_model
478 integer(c_int),
intent(in),
value :: index
479 type(c_ptr),
intent(out) :: species_name
480 end function get_supported_species
482 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
483 integer(c_int),
intent(in) :: index
484 character(len=*, kind=c_char),
intent(out) :: species_name
485 integer(c_int),
intent(out) :: ierr
486 type(kim_simulator_model_type),
pointer :: simulator_model
488 type(c_ptr) pspecies_name
490 call c_f_pointer(simulator_model_handle%p, simulator_model)
491 ierr = get_supported_species(simulator_model, index - 1, pspecies_name)
492 call kim_convert_c_char_ptr_to_string(pspecies_name, species_name)
502 simulator_model_handle)
503 use kim_interoperable_types_module
, only: kim_simulator_model_type
506 recursive subroutine open_and_initialize_template_map(simulator_model) &
507 bind(c, name=
"KIM_SimulatorModel_OpenAndInitializeTemplateMap")
508 use,
intrinsic :: iso_c_binding
509 use kim_interoperable_types_module
, only: kim_simulator_model_type
511 type(kim_simulator_model_type),
intent(in) :: simulator_model
512 end subroutine open_and_initialize_template_map
514 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
515 type(kim_simulator_model_type),
pointer :: simulator_model
517 call c_f_pointer(simulator_model_handle%p, simulator_model)
518 call open_and_initialize_template_map(simulator_model)
528 simulator_model_handle)
529 use kim_interoperable_types_module
, only: kim_simulator_model_type
532 integer(c_int) recursive function template_map_is_open(simulator_model) &
533 bind(c, name=
"KIM_SimulatorModel_TemplateMapIsOpen")
534 use,
intrinsic :: iso_c_binding
535 use kim_interoperable_types_module
, only: kim_simulator_model_type
537 type(kim_simulator_model_type),
intent(in) :: simulator_model
538 end function template_map_is_open
540 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
541 type(kim_simulator_model_type),
pointer :: simulator_model
543 call c_f_pointer(simulator_model_handle%p, simulator_model)
554 simulator_model_handle, key, value, ierr)
555 use kim_interoperable_types_module
, only: kim_simulator_model_type
556 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
559 integer(c_int) recursive function add_template_map( &
560 simulator_model, key, value) &
561 bind(c, name=
"KIM_SimulatorModel_AddTemplateMap")
562 use,
intrinsic :: iso_c_binding
563 use kim_interoperable_types_module
, only: kim_simulator_model_type
565 type(kim_simulator_model_type),
intent(in) :: simulator_model
566 character(c_char),
intent(in) :: key(*)
567 character(c_char),
intent(in) ::
value(*)
568 end function add_template_map
570 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
571 character(len=*, kind=c_char),
intent(in) :: key
572 character(len=*, kind=c_char),
intent(in) :: value
573 integer(c_int),
intent(out) :: ierr
574 type(kim_simulator_model_type),
pointer :: simulator_model
576 call c_f_pointer(simulator_model_handle%p, simulator_model)
577 ierr = add_template_map(simulator_model, trim(key)//c_null_char, &
578 trim(
value)//c_null_char)
588 simulator_model_handle)
589 use kim_interoperable_types_module
, only: kim_simulator_model_type
592 recursive subroutine close_template_map(simulator_model) &
593 bind(c, name=
"KIM_SimulatorModel_CloseTemplateMap")
594 use,
intrinsic :: iso_c_binding
595 use kim_interoperable_types_module
, only: kim_simulator_model_type
597 type(kim_simulator_model_type),
intent(in) :: simulator_model
598 end subroutine close_template_map
600 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
601 type(kim_simulator_model_type),
pointer :: simulator_model
603 call c_f_pointer(simulator_model_handle%p, simulator_model)
604 call close_template_map(simulator_model)
614 simulator_model_handle, number_of_simulator_fields)
615 use kim_interoperable_types_module
, only: kim_simulator_model_type
618 recursive subroutine get_number_of_simulator_fields( &
619 simulator_model, number_of_simulator_fields) &
620 bind(c, name=
"KIM_SimulatorModel_GetNumberOfSimulatorFields")
621 use,
intrinsic :: iso_c_binding
622 use kim_interoperable_types_module
, only: kim_simulator_model_type
624 type(kim_simulator_model_type),
intent(in) :: simulator_model
625 integer(c_int),
intent(out) :: number_of_simulator_fields
626 end subroutine get_number_of_simulator_fields
628 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
629 integer(c_int),
intent(out) :: number_of_simulator_fields
630 type(kim_simulator_model_type),
pointer :: simulator_model
632 call c_f_pointer(simulator_model_handle%p, simulator_model)
633 call get_number_of_simulator_fields(simulator_model, &
634 number_of_simulator_fields)
644 simulator_model_handle, field_index, extent, field_name, ierr)
645 use kim_interoperable_types_module
, only: kim_simulator_model_type
646 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
649 integer(c_int) recursive function get_simulator_field_metadata( &
650 simulator_model, field_index, extent, field_name) &
651 bind(c, name=
"KIM_SimulatorModel_GetSimulatorFieldMetadata")
652 use,
intrinsic :: iso_c_binding
653 use kim_interoperable_types_module
, only: kim_simulator_model_type
655 type(kim_simulator_model_type),
intent(in) :: simulator_model
656 integer(c_int),
intent(in),
value :: field_index
657 integer(c_int),
intent(out) :: extent
658 type(c_ptr),
intent(out) :: field_name
659 end function get_simulator_field_metadata
661 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
662 integer(c_int),
intent(in) :: field_index
663 integer(c_int),
intent(out) :: extent
664 character(len=*, kind=c_char),
intent(out) :: field_name
665 integer(c_int),
intent(out) :: ierr
666 type(kim_simulator_model_type),
pointer :: simulator_model
668 type(c_ptr) pfield_name
670 call c_f_pointer(simulator_model_handle%p, simulator_model)
671 ierr = get_simulator_field_metadata(simulator_model, field_index - 1, &
673 call kim_convert_c_char_ptr_to_string(pfield_name, field_name)
683 simulator_model_handle, field_index, line_index, line_value, ierr)
684 use kim_interoperable_types_module
, only: kim_simulator_model_type
685 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
688 integer(c_int) recursive function get_simulator_field_line( &
689 simulator_model, field_index, line_index, line_value) &
690 bind(c, name=
"KIM_SimulatorModel_GetSimulatorFieldLine")
691 use,
intrinsic :: iso_c_binding
692 use kim_interoperable_types_module
, only: kim_simulator_model_type
694 type(kim_simulator_model_type),
intent(in) :: simulator_model
695 integer(c_int),
intent(in),
value :: field_index
696 integer(c_int),
intent(in),
value :: line_index
697 type(c_ptr),
intent(out) :: line_value
698 end function get_simulator_field_line
700 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
701 integer(c_int),
intent(in),
value :: field_index
702 integer(c_int),
intent(in),
value :: line_index
703 character(len=*, kind=c_char),
intent(out) :: line_value
704 integer(c_int),
intent(out) :: ierr
705 type(kim_simulator_model_type),
pointer :: simulator_model
707 type(c_ptr) pline_value
709 call c_f_pointer(simulator_model_handle%p, simulator_model)
710 ierr = get_simulator_field_line(simulator_model, field_index - 1, &
711 line_index - 1, pline_value)
712 call kim_convert_c_char_ptr_to_string(pline_value, line_value)
722 simulator_model_handle, directory_name)
723 use kim_interoperable_types_module
, only: kim_simulator_model_type
724 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
727 recursive subroutine get_parameter_file_directory_name(simulator_model, &
729 bind(c, name=
"KIM_SimulatorModel_GetParameterFileDirectoryName")
730 use,
intrinsic :: iso_c_binding
731 use kim_interoperable_types_module
, only: kim_simulator_model_type
733 type(kim_simulator_model_type),
intent(in) :: simulator_model
734 type(c_ptr),
intent(out) :: directory_name
735 end subroutine get_parameter_file_directory_name
737 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
738 character(len=*, kind=c_char),
intent(out) :: directory_name
739 type(kim_simulator_model_type),
pointer :: simulator_model
741 type(c_ptr) pdirectory_name
743 call c_f_pointer(simulator_model_handle%p, simulator_model)
744 call get_parameter_file_directory_name(simulator_model, pdirectory_name)
745 call kim_convert_c_char_ptr_to_string(pdirectory_name, directory_name)
755 simulator_model_handle, specification_file_name)
756 use kim_interoperable_types_module
, only: kim_simulator_model_type
757 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
760 recursive subroutine get_specification_file_name( &
761 simulator_model, specification_file_name) &
762 bind(c, name=
"KIM_SimulatorModel_GetSpecificationFileName")
763 use,
intrinsic :: iso_c_binding
764 use kim_interoperable_types_module
, only: kim_simulator_model_type
766 type(kim_simulator_model_type),
intent(in) :: simulator_model
767 type(c_ptr),
intent(out) :: specification_file_name
768 end subroutine get_specification_file_name
770 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
771 character(len=*, kind=c_char),
intent(out) :: specification_file_name
772 type(kim_simulator_model_type),
pointer :: simulator_model
774 type(c_ptr) pspecification_file_name
776 call c_f_pointer(simulator_model_handle%p, simulator_model)
777 call get_specification_file_name(simulator_model, pspecification_file_name)
778 call kim_convert_c_char_ptr_to_string(pspecification_file_name, &
779 specification_file_name)
789 simulator_model_handle, number_of_parameter_files)
790 use kim_interoperable_types_module
, only: kim_simulator_model_type
793 recursive subroutine get_number_of_parameter_files( &
794 simulator_model, number_of_parameter_files) &
795 bind(c, name=
"KIM_SimulatorModel_GetNumberOfParameterFiles")
796 use,
intrinsic :: iso_c_binding
797 use kim_interoperable_types_module
, only: kim_simulator_model_type
799 type(kim_simulator_model_type),
intent(in) :: simulator_model
800 integer(c_int),
intent(out) :: number_of_parameter_files
801 end subroutine get_number_of_parameter_files
803 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
804 integer(c_int),
intent(out) :: number_of_parameter_files
805 type(kim_simulator_model_type),
pointer :: simulator_model
807 call c_f_pointer(simulator_model_handle%p, simulator_model)
808 call get_number_of_parameter_files(simulator_model, &
809 number_of_parameter_files)
822 simulator_model_handle, index, parameter_file_name, ierr)
823 use kim_interoperable_types_module
, only: kim_simulator_model_type
824 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
827 integer(c_int) recursive function get_parameter_file_name( &
828 simulator_model, index, parameter_file_name) &
829 bind(c, name=
"KIM_SimulatorModel_GetParameterFileName")
830 use,
intrinsic :: iso_c_binding
831 use kim_interoperable_types_module
, only: kim_simulator_model_type
833 type(kim_simulator_model_type),
intent(in) :: simulator_model
834 integer(c_int),
intent(in),
value :: index
835 type(c_ptr),
intent(out) :: parameter_file_name
836 end function get_parameter_file_name
838 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
839 integer(c_int),
intent(in) :: index
840 character(len=*, kind=c_char),
intent(out) :: parameter_file_name
841 integer(c_int),
intent(out) :: ierr
842 type(kim_simulator_model_type),
pointer :: simulator_model
844 type(c_ptr) pparameter_file_name
846 call c_f_pointer(simulator_model_handle%p, simulator_model)
847 ierr = get_parameter_file_name(simulator_model, index - 1, &
848 pparameter_file_name)
849 call kim_convert_c_char_ptr_to_string(pparameter_file_name, &
860 simulator_model_handle, index, parameter_file_basename, ierr)
861 use kim_interoperable_types_module
, only: kim_simulator_model_type
862 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
865 integer(c_int) recursive function get_parameter_file_basename( &
866 simulator_model, index, parameter_file_basename) &
867 bind(c, name=
"KIM_SimulatorModel_GetParameterFileBasename")
868 use,
intrinsic :: iso_c_binding
869 use kim_interoperable_types_module
, only: kim_simulator_model_type
871 type(kim_simulator_model_type),
intent(in) :: simulator_model
872 integer(c_int),
intent(in),
value :: index
873 type(c_ptr),
intent(out) :: parameter_file_basename
874 end function get_parameter_file_basename
876 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
877 integer(c_int),
intent(in) :: index
878 character(len=*, kind=c_char),
intent(out) :: parameter_file_basename
879 integer(c_int),
intent(out) :: ierr
880 type(kim_simulator_model_type),
pointer :: simulator_model
882 type(c_ptr) pparameter_file_basename
884 call c_f_pointer(simulator_model_handle%p, simulator_model)
885 ierr = get_parameter_file_basename(simulator_model, index - 1, &
886 pparameter_file_basename)
887 call kim_convert_c_char_ptr_to_string(pparameter_file_basename, &
888 parameter_file_basename)
898 simulator_model_handle, ptr)
899 use kim_interoperable_types_module
, only: kim_simulator_model_type
902 recursive subroutine set_simulator_buffer_pointer(simulator_model, ptr) &
903 bind(c, name=
"KIM_SimulatorModel_SetSimulatorBufferPointer")
904 use,
intrinsic :: iso_c_binding
905 use kim_interoperable_types_module
, only: kim_simulator_model_type
907 type(kim_simulator_model_type),
intent(in) :: simulator_model
908 type(c_ptr),
intent(in),
value :: ptr
909 end subroutine set_simulator_buffer_pointer
911 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
912 type(c_ptr),
intent(in) :: ptr
913 type(kim_simulator_model_type),
pointer :: simulator_model
915 call c_f_pointer(simulator_model_handle%p, simulator_model)
916 call set_simulator_buffer_pointer(simulator_model, ptr)
926 simulator_model_handle, ptr)
927 use kim_interoperable_types_module
, only: kim_simulator_model_type
930 recursive subroutine get_simulator_buffer_pointer(simulator_model, ptr) &
931 bind(c, name=
"KIM_SimulatorModel_GetSimulatorBufferPointer")
932 use,
intrinsic :: iso_c_binding
933 use kim_interoperable_types_module
, only: kim_simulator_model_type
935 type(kim_simulator_model_type),
intent(in) :: simulator_model
936 type(c_ptr),
intent(out) :: ptr
937 end subroutine get_simulator_buffer_pointer
939 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
940 type(c_ptr),
intent(out) :: ptr
941 type(kim_simulator_model_type),
pointer :: simulator_model
943 call c_f_pointer(simulator_model_handle%p, simulator_model)
944 call get_simulator_buffer_pointer(simulator_model, ptr)
954 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
955 use kim_interoperable_types_module
, only: kim_simulator_model_type
958 type(c_ptr)
recursive function model_string(simulator_model) &
959 bind(c, name=
"KIM_SimulatorModel_ToString")
960 use,
intrinsic :: iso_c_binding
961 use kim_interoperable_types_module
, only: kim_simulator_model_type
963 type(kim_simulator_model_type),
intent(in) :: simulator_model
964 end function model_string
966 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
967 character(len=*, kind=c_char),
intent(out) :: string
968 type(kim_simulator_model_type),
pointer :: simulator_model
972 call c_f_pointer(simulator_model_handle%p, simulator_model)
973 p = model_string(simulator_model)
974 call kim_convert_c_char_ptr_to_string(p, string)
984 use kim_interoperable_types_module
, only: kim_simulator_model_type
987 recursive subroutine set_log_id(simulator_model, log_id) &
988 bind(c, name=
"KIM_SimulatorModel_SetLogID")
989 use,
intrinsic :: iso_c_binding
990 use kim_interoperable_types_module
, only: kim_simulator_model_type
992 type(kim_simulator_model_type),
intent(in) :: simulator_model
993 character(c_char),
intent(in) :: log_id(*)
994 end subroutine set_log_id
996 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
997 character(len=*, kind=c_char),
intent(in) :: log_id
998 type(kim_simulator_model_type),
pointer :: simulator_model
1000 call c_f_pointer(simulator_model_handle%p, simulator_model)
1001 call set_log_id(simulator_model, trim(log_id)//c_null_char)
1011 simulator_model_handle, log_verbosity)
1013 use kim_interoperable_types_module
, only: kim_simulator_model_type
1016 recursive subroutine push_log_verbosity(simulator_model, log_verbosity) &
1017 bind(c, name=
"KIM_SimulatorModel_PushLogVerbosity")
1018 use,
intrinsic :: iso_c_binding
1020 use kim_interoperable_types_module
, only: kim_simulator_model_type
1022 type(kim_simulator_model_type),
intent(in) :: simulator_model
1023 type(kim_log_verbosity_type),
intent(in),
value :: log_verbosity
1024 end subroutine push_log_verbosity
1026 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
1027 type(kim_log_verbosity_type),
intent(in) :: log_verbosity
1028 type(kim_simulator_model_type),
pointer :: simulator_model
1030 call c_f_pointer(simulator_model_handle%p, simulator_model)
1031 call push_log_verbosity(simulator_model, log_verbosity)
1040 simulator_model_handle)
1042 use kim_interoperable_types_module
, only: kim_simulator_model_type
1045 recursive subroutine pop_log_verbosity(simulator_model) &
1046 bind(c, name=
"KIM_SimulatorModel_PopLogVerbosity")
1047 use,
intrinsic :: iso_c_binding
1049 use kim_interoperable_types_module
, only: kim_simulator_model_type
1051 type(kim_simulator_model_type),
intent(in) :: simulator_model
1052 end subroutine pop_log_verbosity
1054 type(kim_simulator_model_handle_type),
intent(in) :: simulator_model_handle
1055 type(kim_simulator_model_type),
pointer :: simulator_model
1057 call c_f_pointer(simulator_model_handle%p, simulator_model)
1058 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.