40 use,
intrinsic :: iso_c_binding
46 kim_compute_argument_name_type, &
75 type, bind(c) :: kim_compute_argument_name_type
82 integer(c_int) compute_argument_name_id
83 end type kim_compute_argument_name_type
91 type(kim_compute_argument_name_type),
protected,
save, &
92 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_numberOfParticles") &
101 type(kim_compute_argument_name_type),
protected,
save, &
102 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_particleSpeciesCodes") &
111 type(kim_compute_argument_name_type),
protected,
save, &
112 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_particleContributing") &
121 type(kim_compute_argument_name_type),
protected,
save, &
122 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_coordinates") &
131 type(kim_compute_argument_name_type),
protected,
save, &
132 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialEnergy") &
141 type(kim_compute_argument_name_type),
protected,
save, &
142 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialForces") &
151 type(kim_compute_argument_name_type),
protected,
save, &
152 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy") &
161 type(kim_compute_argument_name_type),
protected,
save, &
162 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialVirial") &
171 type(kim_compute_argument_name_type),
protected,
save, &
172 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialParticleVirial") &
181 module procedure kim_compute_argument_name_known
182 end interface kim_known
189 interface operator (.eq.)
190 module procedure kim_compute_argument_name_equal
191 end interface operator (.eq.)
199 interface operator (.ne.)
200 module procedure kim_compute_argument_name_not_equal
201 end interface operator (.ne.)
210 interface kim_from_string
211 module procedure kim_compute_argument_name_from_string
212 end interface kim_from_string
219 interface kim_to_string
220 module procedure kim_compute_argument_name_to_string
221 end interface kim_to_string
229 logical recursive function kim_compute_argument_name_known( &
230 compute_argument_name)
233 integer(c_int) recursive function known(compute_argument_name) &
234 bind(c, name=
"KIM_ComputeArgumentName_Known")
235 use,
intrinsic :: iso_c_binding
236 import kim_compute_argument_name_type
238 type(kim_compute_argument_name_type),
intent(in),
value :: &
239 compute_argument_name
242 type(kim_compute_argument_name_type),
intent(in) :: compute_argument_name
244 kim_compute_argument_name_known = (known(compute_argument_name) /= 0)
245 end function kim_compute_argument_name_known
252 logical recursive function kim_compute_argument_name_equal(lhs, rhs)
254 type(kim_compute_argument_name_type),
intent(in) :: lhs
255 type(kim_compute_argument_name_type),
intent(in) :: rhs
257 kim_compute_argument_name_equal &
258 = (lhs%compute_argument_name_id .eq. rhs%compute_argument_name_id)
259 end function kim_compute_argument_name_equal
267 logical recursive function kim_compute_argument_name_not_equal(lhs, rhs)
269 type(kim_compute_argument_name_type),
intent(in) :: lhs
270 type(kim_compute_argument_name_type),
intent(in) :: rhs
272 kim_compute_argument_name_not_equal = .not. (lhs .eq. rhs)
273 end function kim_compute_argument_name_not_equal
282 recursive subroutine kim_compute_argument_name_from_string(string, &
283 compute_argument_name)
286 type(kim_compute_argument_name_type)
recursive function from_string( &
287 string) bind(c, name=
"KIM_ComputeArgumentName_FromString")
288 use,
intrinsic :: iso_c_binding
289 import kim_compute_argument_name_type
291 character(c_char),
intent(in) :: string(*)
292 end function from_string
294 character(len=*, kind=c_char),
intent(in) :: string
295 type(kim_compute_argument_name_type),
intent(out) :: compute_argument_name
297 compute_argument_name = from_string(trim(string)//c_null_char)
298 end subroutine kim_compute_argument_name_from_string
305 recursive subroutine kim_compute_argument_name_to_string( &
306 compute_argument_name, string)
307 use kim_convert_string_module
, only : kim_convert_c_char_ptr_to_string
310 type(c_ptr)
recursive function get_string(compute_argument_name) &
311 bind(c, name=
"KIM_ComputeArgumentName_ToString")
312 use,
intrinsic :: iso_c_binding
313 import kim_compute_argument_name_type
315 type(kim_compute_argument_name_type),
intent(in),
value :: &
316 compute_argument_name
317 end function get_string
319 type(kim_compute_argument_name_type),
intent(in) :: &
320 compute_argument_name
321 character(len=*, kind=c_char),
intent(out) :: string
325 p = get_string(compute_argument_name)
326 call kim_convert_c_char_ptr_to_string(p, string)
327 end subroutine kim_compute_argument_name_to_string
337 number_of_compute_argument_names)
340 recursive subroutine get_number_of_compute_argument_names( &
341 number_of_compute_argument_names) &
343 name=
"KIM_COMPUTE_ARGUMENT_NAME_GetNumberOfComputeArgumentNames")
344 use,
intrinsic :: iso_c_binding
345 integer(c_int),
intent(out) :: number_of_compute_argument_names
346 end subroutine get_number_of_compute_argument_names
348 integer(c_int),
intent(out) :: number_of_compute_argument_names
350 call get_number_of_compute_argument_names(number_of_compute_argument_names)
362 compute_argument_name, ierr)
365 integer(c_int) recursive function get_compute_argument_name(index, &
366 compute_argument_name) &
367 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName")
368 use,
intrinsic :: iso_c_binding
369 import kim_compute_argument_name_type
371 integer(c_int),
intent(in),
value :: index
372 type(kim_compute_argument_name_type),
intent(out) :: &
373 compute_argument_name
374 end function get_compute_argument_name
376 integer(c_int),
intent(in) :: index
377 type(kim_compute_argument_name_type),
intent(out) :: compute_argument_name
378 integer(c_int),
intent(out) :: ierr
380 ierr = get_compute_argument_name(index-1, compute_argument_name)
391 compute_argument_name, &
396 integer(c_int) recursive function get_compute_argument_data_type( &
397 compute_argument_name, data_type) &
398 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentDataType")
399 use,
intrinsic :: iso_c_binding
401 import kim_compute_argument_name_type
403 type(kim_compute_argument_name_type),
intent(in),
value :: &
404 compute_argument_name
405 type(kim_data_type_type),
intent(out) :: data_type
406 end function get_compute_argument_data_type
408 type(kim_compute_argument_name_type),
intent(in) :: &
409 compute_argument_name
410 type(kim_data_type_type),
intent(out) :: data_type
411 integer(c_int),
intent(out) :: ierr
413 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