36 use,
intrinsic :: iso_c_binding
71 type,
bind(c) :: kim_model_extension_handle_type
72 type(c_ptr) :: p = c_null_ptr
84 interface operator(.eq.)
85 module procedure kim_model_extension_handle_equal
86 end interface operator(.eq.)
91 interface operator(.ne.)
92 module procedure kim_model_extension_handle_not_equal
93 end interface operator(.ne.)
101 module procedure kim_model_extension_get_extension_id
252 logical recursive function kim_model_extension_handle_equal(lhs, rhs)
254 type(kim_model_extension_handle_type),
intent(in) :: lhs
255 type(kim_model_extension_handle_type),
intent(in) :: rhs
257 if ((.not. c_associated(lhs%p)) .and. (.not. c_associated(rhs%p)))
then
258 kim_model_extension_handle_equal = .true.
260 kim_model_extension_handle_equal = c_associated(lhs%p, rhs%p)
262 end function kim_model_extension_handle_equal
267 logical recursive function kim_model_extension_handle_not_equal(lhs, rhs)
269 type(kim_model_extension_handle_type),
intent(in) :: lhs
270 type(kim_model_extension_handle_type),
intent(in) :: rhs
272 kim_model_extension_handle_not_equal = .not. (lhs == rhs)
273 end function kim_model_extension_handle_not_equal
280 recursive subroutine kim_model_extension_get_extension_id( &
281 model_extension_handle, extension_id)
282 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
283 use kim_interoperable_types_module,
only: kim_model_extension_type
287 bind(c, name="KIM_ModelExtension_GetExtensionID")
288 use,
intrinsic :: iso_c_binding
289 use kim_interoperable_types_module,
only: kim_model_extension_type
291 type(kim_model_extension_type),
intent(in) :: model_extension
292 type(c_ptr),
intent(out) :: extension_id
295 type(kim_model_extension_handle_type),
intent(in) :: model_extension_handle
296 character(len=*, kind=c_char),
intent(out) :: extension_id
297 type(kim_model_extension_type),
pointer :: model_extension
301 call c_f_pointer(model_extension_handle%p, model_extension)
303 call kim_convert_c_char_ptr_to_string(p, extension_id)
304 end subroutine kim_model_extension_get_extension_id
318 model_handle%p = model_extension_handle%p
327 model_extension_handle, model_compute_handle)
333 model_compute_handle%p = model_extension_handle%p
342 model_extension_handle, model_create_handle)
348 model_create_handle%p = model_extension_handle%p
357 model_extension_handle, model_destroy_handle)
363 model_destroy_handle%p = model_extension_handle%p
373 model_extension_handle, model_driver_create_handle)
378 :: model_driver_create_handle
380 model_driver_create_handle%p = model_extension_handle%p
389 model_extension_handle, model_refresh_handle)
395 model_refresh_handle%p = model_extension_handle%p
405 model_extension_handle, model_write_parameterized_model_handle)
410 :: model_write_parameterized_model_handle
412 model_write_parameterized_model_handle%p = model_extension_handle%p
422 model_extension_handle, compute_arguments_c_ptr, &
423 model_compute_arguments_handle)
427 type(c_ptr),
intent(in) :: compute_arguments_c_ptr
429 :: model_compute_arguments_handle
434 model_compute_arguments_handle%p = compute_arguments_c_ptr
444 model_extension_handle, compute_arguments_c_ptr, &
445 model_compute_arguments_create_handle)
449 type(c_ptr),
intent(in) :: compute_arguments_c_ptr
451 :: model_compute_arguments_create_handle
456 model_compute_arguments_create_handle%p = compute_arguments_c_ptr
466 model_extension_handle, compute_arguments_c_ptr, &
467 model_compute_arguments_destroy_handle)
471 type(c_ptr),
intent(in) :: compute_arguments_c_ptr
473 :: model_compute_arguments_destroy_handle
478 model_compute_arguments_destroy_handle%p = compute_arguments_c_ptr
485 c_char_array, string)
486 use kim_convert_string_module,
only: kim_convert_c_char_array_to_string
488 character(len=1, kind=c_char),
intent(in) :: c_char_array(:)
489 character(len=*, kind=c_char),
intent(out) :: string
491 call kim_convert_c_char_array_to_string(c_char_array, string)
499 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
501 type(c_ptr),
intent(in) :: c_char_ptr
502 character(len=*, kind=c_char),
intent(out) :: string
504 call kim_convert_c_char_ptr_to_string(c_char_ptr, string)
511 string, c_char_array)
512 use kim_convert_string_module,
only: kim_convert_string_to_c_char_array
514 character(len=*, kind=c_char),
intent(in) :: string
515 character(len=1, kind=c_char),
intent(out) :: c_char_array(:)
517 call kim_convert_string_to_c_char_array(string, c_char_array)
527 model_extension_handle, ptr)
528 use kim_interoperable_types_module,
only: kim_model_extension_type
532 bind(c, name="KIM_ModelExtension_GetModelBufferPointer")
533 use,
intrinsic :: iso_c_binding
534 use kim_interoperable_types_module,
only: kim_model_extension_type
537 type(c_ptr),
intent(out) :: ptr
541 type(c_ptr),
intent(out) :: ptr
554 log_verbosity, message)
556 use kim_interoperable_types_module,
only: kim_model_extension_type
560 model_extension, log_verbosity, message, line_number, file_name) &
561 bind(c, name="KIM_ModelExtension_LogEntry")
562 use,
intrinsic :: iso_c_binding
564 use kim_interoperable_types_module,
only: kim_model_extension_type
568 character(c_char),
intent(in) :: message(*)
569 integer(c_int),
intent(in),
value :: line_number
570 character(c_char),
intent(in) :: file_name(*)
574 type(kim_log_verbosity_type),
intent(in) :: log_verbosity
575 character(len=*, kind=c_char),
intent(in) :: message
590 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
591 use kim_interoperable_types_module,
only: kim_model_extension_type
594 type(c_ptr)
recursive function model_extension_string(model_extension) &
595 bind(c, name="KIM_ModelExtension_ToString")
596 use,
intrinsic :: iso_c_binding
597 use kim_interoperable_types_module,
only: kim_model_extension_type
599 type(kim_model_extension_type),
intent(in) :: model_extension
602 type(kim_model_extension_handle_type),
intent(in) :: model_extension_handle
603 character(len=*, kind=c_char),
intent(out) :: string
604 type(kim_model_extension_type),
pointer :: model_extension
610 call kim_convert_c_char_ptr_to_string(p, string)
static int model_extension(KIM_ModelExtension *const modelExtension, void *const extensionStructure)
Copy C character array to Fortran string.
Copy C character pointer to Fortran string.
Get the extension identification string.
Get the Model's buffer pointer within the Model object.
Write a log entry into the log file.
Convert Fortran string to C character array.
Convert the ModelExtension interface to the Model object to a ModelComputeArgumentsCreate interface.
Convert the ModelExtension interface to the Model object to a ModelComputeArgumentsDestroy interface.
Convert the ModelExtension interface to the Model object to a ModelComputeArguments interface.
Convert the ModelExtension interface to the Model object to a ModelCompute interface.
Convert the ModelExtension interface to the Model object to a ModelCompute interface.
Convert the ModelExtension interface to the Model object to a ModelDestroy interface.
Convert the ModelExtension interface to the Model object to a ModelDriverCreate interface.
Convert the ModelExtension interface to the Model object to a ModelRefresh interface.
Convert the ModelExtension interface to the Model object to a ModelWriteParameterizedModel interface.
Convert the ModelExtension interface to the Model object to a Model interface.
Get a string representing the internal state of the Model object.
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...
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUT...
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUT...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::D...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::E...
recursive subroutine kim_model_extension_to_model_write_parameterized_model(model_extension_handle, model_write_parameterized_model_handle)
Convert the ModelExtension interface to the Model object to a ModelWriteParameterizedModel interface.
recursive subroutine kim_model_extension_to_model_destroy(model_extension_handle, model_destroy_handle)
Convert the ModelExtension interface to the Model object to a ModelDestroy interface.
recursive subroutine kim_model_extension_convert_c_char_ptr_to_string(c_char_ptr, string)
Copy C character pointer to Fortran string.
recursive subroutine kim_model_extension_to_model_compute_arguments_create(model_extension_handle, compute_arguments_c_ptr, model_compute_arguments_create_handle)
Convert the ModelExtension interface to the Model object to a ModelComputeArgumentsCreate interface.
recursive subroutine kim_model_extension_to_model_compute(model_extension_handle, model_compute_handle)
Convert the ModelExtension interface to the Model object to a ModelCompute interface.
recursive subroutine kim_model_extension_to_model_compute_arguments(model_extension_handle, compute_arguments_c_ptr, model_compute_arguments_handle)
Convert the ModelExtension interface to the Model object to a ModelComputeArguments interface.
recursive subroutine kim_model_extension_to_model_refresh(model_extension_handle, model_refresh_handle)
Convert the ModelExtension interface to the Model object to a ModelRefresh interface.
recursive subroutine kim_model_extension_to_model(model_extension_handle, model_handle)
Convert the ModelExtension interface to the Model object to a Model interface.
recursive subroutine kim_model_extension_to_model_create(model_extension_handle, model_create_handle)
Convert the ModelExtension interface to the Model object to a ModelCompute interface.
recursive subroutine kim_model_extension_to_string(model_extension_handle, string)
Get a string representing the internal state of the Model object.
recursive subroutine kim_model_extension_convert_c_char_array_to_string(c_char_array, string)
Copy C character array to Fortran string.
recursive subroutine kim_model_extension_convert_string_to_c_char_array(string, c_char_array)
Convert Fortran string to C character array.
recursive subroutine kim_model_extension_to_model_driver_create(model_extension_handle, model_driver_create_handle)
Convert the ModelExtension interface to the Model object to a ModelDriverCreate interface.
type(kim_model_extension_handle_type), save, public, protected kim_model_extension_null_handle
NULL handle for use in comparisons.
recursive subroutine kim_model_extension_log_entry(model_extension_handle, log_verbosity, message)
Write a log entry into the log file.
recursive subroutine kim_model_extension_to_model_compute_arguments_destroy(model_extension_handle, compute_arguments_c_ptr, model_compute_arguments_destroy_handle)
Convert the ModelExtension interface to the Model object to a ModelComputeArgumentsDestroy interface.
recursive subroutine kim_model_extension_get_model_buffer_pointer(model_extension_handle, ptr)
Get the Model's buffer pointer within the Model object.
Provides the primary interface to a KIM API Model object and is meant to be used by simulators.
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::R...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::W...
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...
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUT...
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUT...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::D...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::E...
Provides the primary interface to a KIM API Model object and is meant to be used by simulators.
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::R...
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::W...