36 use,
intrinsic :: iso_c_binding
57 type,
bind(c) :: kim_model_compute_handle_type
58 type(c_ptr) :: p = c_null_ptr
70 interface operator(.eq.)
71 module procedure kim_model_compute_handle_equal
72 end interface operator(.eq.)
77 interface operator(.ne.)
78 module procedure kim_model_compute_handle_not_equal
79 end interface operator(.ne.)
88 module procedure kim_model_compute_get_model_buffer_pointer
113 logical recursive function kim_model_compute_handle_equal(lhs, rhs)
115 type(kim_model_compute_handle_type),
intent(in) :: lhs
116 type(kim_model_compute_handle_type),
intent(in) :: rhs
118 if ((.not. c_associated(lhs%p)) .and. (.not. c_associated(rhs%p)))
then
119 kim_model_compute_handle_equal = .true.
121 kim_model_compute_handle_equal = c_associated(lhs%p, rhs%p)
123 end function kim_model_compute_handle_equal
128 logical recursive function kim_model_compute_handle_not_equal(lhs, rhs)
130 type(kim_model_compute_handle_type),
intent(in) :: lhs
131 type(kim_model_compute_handle_type),
intent(in) :: rhs
133 kim_model_compute_handle_not_equal = .not. (lhs == rhs)
134 end function kim_model_compute_handle_not_equal
142 recursive subroutine kim_model_compute_get_model_buffer_pointer( &
143 model_compute_handle, ptr)
144 use kim_interoperable_types_module,
only: kim_model_compute_type
148 bind(c, name="KIM_ModelCompute_GetModelBufferPointer")
149 use,
intrinsic :: iso_c_binding
150 use kim_interoperable_types_module,
only: kim_model_compute_type
152 type(kim_model_compute_type),
intent(in) :: model_compute
153 type(c_ptr),
intent(out) :: ptr
156 type(kim_model_compute_handle_type),
intent(in) :: model_compute_handle
157 type(c_ptr),
intent(out) :: ptr
158 type(kim_model_compute_type),
pointer :: model_compute
160 call c_f_pointer(model_compute_handle%p, model_compute)
162 end subroutine kim_model_compute_get_model_buffer_pointer
170 log_verbosity, message)
172 use kim_interoperable_types_module,
only: kim_model_compute_type
176 model_compute, log_verbosity, message, line_number, file_name) &
177 bind(c, name="KIM_ModelCompute_LogEntry")
178 use,
intrinsic :: iso_c_binding
180 use kim_interoperable_types_module,
only: kim_model_compute_type
184 character(c_char),
intent(in) :: message(*)
185 integer(c_int),
intent(in),
value :: line_number
186 character(c_char),
intent(in) :: file_name(*)
190 type(kim_log_verbosity_type),
intent(in) :: log_verbosity
191 character(len=*, kind=c_char),
intent(in) :: message
205 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
206 use kim_interoperable_types_module,
only: kim_model_compute_type
210 bind(c, name="KIM_ModelCompute_ToString")
211 use,
intrinsic :: iso_c_binding
212 use kim_interoperable_types_module,
only: kim_model_compute_type
218 character(len=*, kind=c_char),
intent(out) :: string
225 call kim_convert_c_char_ptr_to_string(p, string)
static int model_compute(KIM_ModelCompute const *const modelCompute, KIM_ModelComputeArguments const *const modelComputeArguments)
Get the Model's buffer pointer within the Model object.
Write a log entry into the log file.
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 Model object for use by models within their MODEL_ROUTINE_NAME::C...
recursive subroutine kim_model_compute_log_entry(model_compute_handle, log_verbosity, message)
Write a log entry into the log file.
recursive subroutine kim_model_compute_to_string(model_compute_handle, string)
Get a string representing the internal state of the Model object.
type(kim_model_compute_handle_type), save, public, protected kim_model_compute_null_handle
NULL handle for use in comparisons.
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...