36 use,
intrinsic :: iso_c_binding
42 kim_compute_argument_name_type, &
68 type, bind(c) :: kim_compute_argument_name_type
75 integer(c_int) compute_argument_name_id
76 end type kim_compute_argument_name_type
84 type(kim_compute_argument_name_type),
protected,
save, &
85 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_numberOfParticles") &
94 type(kim_compute_argument_name_type),
protected,
save, &
95 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_particleSpeciesCodes") &
104 type(kim_compute_argument_name_type),
protected,
save, &
105 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_particleContributing") &
114 type(kim_compute_argument_name_type),
protected,
save, &
115 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_coordinates") &
124 type(kim_compute_argument_name_type),
protected,
save, &
125 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialEnergy") &
134 type(kim_compute_argument_name_type),
protected,
save, &
135 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialForces") &
144 type(kim_compute_argument_name_type),
protected,
save, &
145 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy") &
154 type(kim_compute_argument_name_type),
protected,
save, &
155 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialVirial") &
164 type(kim_compute_argument_name_type),
protected,
save, &
165 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialParticleVirial") &
174 module procedure kim_compute_argument_name_known
175 end interface kim_known
182 interface operator(.eq.)
183 module procedure kim_compute_argument_name_equal
184 end interface operator(.eq.)
192 interface operator(.ne.)
193 module procedure kim_compute_argument_name_not_equal
194 end interface operator(.ne.)
203 interface kim_from_string
204 module procedure kim_compute_argument_name_from_string
205 end interface kim_from_string
212 interface kim_to_string
213 module procedure kim_compute_argument_name_to_string
214 end interface kim_to_string
222 logical recursive function kim_compute_argument_name_known( &
223 compute_argument_name)
226 integer(c_int) recursive function known(compute_argument_name) &
227 bind(c, name=
"KIM_ComputeArgumentName_Known")
228 use,
intrinsic :: iso_c_binding
229 import kim_compute_argument_name_type
231 type(kim_compute_argument_name_type),
intent(in),
value :: &
232 compute_argument_name
235 type(kim_compute_argument_name_type),
intent(in) :: compute_argument_name
237 kim_compute_argument_name_known = (known(compute_argument_name) /= 0)
238 end function kim_compute_argument_name_known
245 logical recursive function kim_compute_argument_name_equal(lhs, rhs)
247 type(kim_compute_argument_name_type),
intent(in) :: lhs
248 type(kim_compute_argument_name_type),
intent(in) :: rhs
250 kim_compute_argument_name_equal &
251 = (lhs%compute_argument_name_id == rhs%compute_argument_name_id)
252 end function kim_compute_argument_name_equal
260 logical recursive function kim_compute_argument_name_not_equal(lhs, rhs)
262 type(kim_compute_argument_name_type),
intent(in) :: lhs
263 type(kim_compute_argument_name_type),
intent(in) :: rhs
265 kim_compute_argument_name_not_equal = .not. (lhs == rhs)
266 end function kim_compute_argument_name_not_equal
275 recursive subroutine kim_compute_argument_name_from_string( &
276 string, compute_argument_name)
279 type(kim_compute_argument_name_type)
recursive function from_string( &
280 string) bind(c, name=
"KIM_ComputeArgumentName_FromString")
281 use,
intrinsic :: iso_c_binding
282 import kim_compute_argument_name_type
284 character(c_char),
intent(in) :: string(*)
285 end function from_string
287 character(len=*, kind=c_char),
intent(in) :: string
288 type(kim_compute_argument_name_type),
intent(out) :: compute_argument_name
290 compute_argument_name = from_string(trim(string)//c_null_char)
291 end subroutine kim_compute_argument_name_from_string
298 recursive subroutine kim_compute_argument_name_to_string( &
299 compute_argument_name, string)
300 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
303 type(c_ptr)
recursive function get_string(compute_argument_name) &
304 bind(c, name=
"KIM_ComputeArgumentName_ToString")
305 use,
intrinsic :: iso_c_binding
306 import kim_compute_argument_name_type
308 type(kim_compute_argument_name_type),
intent(in),
value :: &
309 compute_argument_name
310 end function get_string
312 type(kim_compute_argument_name_type),
intent(in) :: &
313 compute_argument_name
314 character(len=*, kind=c_char),
intent(out) :: string
318 p = get_string(compute_argument_name)
319 call kim_convert_c_char_ptr_to_string(p, string)
320 end subroutine kim_compute_argument_name_to_string
330 number_of_compute_argument_names)
333 recursive subroutine get_number_of_compute_argument_names( &
334 number_of_compute_argument_names) &
336 name=
"KIM_COMPUTE_ARGUMENT_NAME_GetNumberOfComputeArgumentNames")
337 use,
intrinsic :: iso_c_binding
338 integer(c_int),
intent(out) :: number_of_compute_argument_names
339 end subroutine get_number_of_compute_argument_names
341 integer(c_int),
intent(out) :: number_of_compute_argument_names
343 call get_number_of_compute_argument_names(number_of_compute_argument_names)
354 index, compute_argument_name, ierr)
357 integer(c_int) recursive function get_compute_argument_name( &
358 index, compute_argument_name) &
359 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName")
360 use,
intrinsic :: iso_c_binding
361 import kim_compute_argument_name_type
363 integer(c_int),
intent(in),
value :: index
364 type(kim_compute_argument_name_type),
intent(out) :: &
365 compute_argument_name
366 end function get_compute_argument_name
368 integer(c_int),
intent(in) :: index
369 type(kim_compute_argument_name_type),
intent(out) :: compute_argument_name
370 integer(c_int),
intent(out) :: ierr
372 ierr = get_compute_argument_name(index - 1, compute_argument_name)
383 compute_argument_name, &
388 integer(c_int) recursive function get_compute_argument_data_type( &
389 compute_argument_name, data_type) &
390 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentDataType")
391 use,
intrinsic :: iso_c_binding
393 import kim_compute_argument_name_type
395 type(kim_compute_argument_name_type),
intent(in),
value :: &
396 compute_argument_name
397 type(kim_data_type_type),
intent(out) :: data_type
398 end function get_compute_argument_data_type
400 type(kim_compute_argument_name_type),
intent(in) :: &
401 compute_argument_name
402 type(kim_data_type_type),
intent(out) :: data_type
403 integer(c_int),
intent(out) :: ierr
405 ierr = get_compute_argument_data_type(compute_argument_name, data_type)
recursive subroutine, public kim_get_compute_argument_data_type(compute_argument_name, data_type, ierr)
Get the DataType of each defined standard ComputeArgumentName.
type(kim_compute_argument_name_type), save, public, protected kim_compute_argument_name_particle_contributing
type(kim_compute_argument_name_type), save, public, protected kim_compute_argument_name_partial_virial
recursive subroutine, public kim_get_compute_argument_name(index, compute_argument_name, ierr)
Get the identity of each defined standard ComputeArgumentName.
type(kim_compute_argument_name_type), save, public, protected kim_compute_argument_name_partial_energy
type(kim_compute_argument_name_type), save, public, protected kim_compute_argument_name_partial_particle_energy
type(kim_compute_argument_name_type), save, public, protected kim_compute_argument_name_coordinates
recursive subroutine, public kim_get_number_of_compute_argument_names(number_of_compute_argument_names)
Get the number of standard ComputeArgumentName's defined by the KIM API.
type(kim_compute_argument_name_type), save, public, protected kim_compute_argument_name_partial_particle_virial
type(kim_compute_argument_name_type), save, public, protected kim_compute_argument_name_particle_species_codes
An Extensible Enumeration for the DataType's supported by the KIM API.
type(kim_compute_argument_name_type), save, public, protected kim_compute_argument_name_partial_forces
An Extensible Enumeration for the ComputeArgumentName's supported by the KIM API. ...
type(kim_compute_argument_name_type), save, public, protected kim_compute_argument_name_number_of_particles