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
97 module procedure kim_model_compute_log_entry
106 module procedure kim_model_compute_to_string
113 logical recursive function kim_model_compute_handle_equal(lhs, 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)
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
147 recursive subroutine get_model_buffer_pointer(model_compute, ptr) &
148 bind(c, name="KIM_ModelCompute_GetModelBufferPointer")
149 use,
intrinsic :: iso_c_binding
150 use kim_interoperable_types_module,
only: kim_model_compute_type
153 type(c_ptr),
intent(out) :: ptr
154 end subroutine get_model_buffer_pointer
157 type(c_ptr),
intent(out) :: ptr
162 end subroutine kim_model_compute_get_model_buffer_pointer
169 recursive subroutine kim_model_compute_log_entry(model_compute_handle, &
170 log_verbosity, message)
172 use kim_interoperable_types_module,
only: kim_model_compute_type
175 recursive subroutine log_entry( &
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(*)
187 end subroutine log_entry
190 type(kim_log_verbosity_type),
intent(in) :: log_verbosity
191 character(len=*, kind=c_char),
intent(in) :: message
195 call log_entry(
model_compute, log_verbosity, trim(message)//c_null_char, &
197 end subroutine kim_model_compute_log_entry
204 recursive subroutine kim_model_compute_to_string(model_compute_handle, string)
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
209 type(c_ptr)
recursive function model_compute_string(
model_compute) &
210 bind(c, name="KIM_ModelCompute_ToString")
211 use,
intrinsic :: iso_c_binding
212 use kim_interoperable_types_module,
only: kim_model_compute_type
215 end function model_compute_string
218 character(len=*, kind=c_char),
intent(out) :: string
225 call kim_convert_c_char_ptr_to_string(p, string)
226 end subroutine kim_model_compute_to_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...
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...