39 use,
intrinsic :: iso_c_binding
45 kim_compute_argument_name_type, &
71 type, bind(c) :: kim_compute_argument_name_type
78 integer(c_int) compute_argument_name_id
79 end type kim_compute_argument_name_type
87 type(kim_compute_argument_name_type),
protected,
save, &
88 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_numberOfParticles") &
97 type(kim_compute_argument_name_type),
protected,
save, &
98 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_particleSpeciesCodes") &
107 type(kim_compute_argument_name_type),
protected,
save, &
108 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_particleContributing") &
117 type(kim_compute_argument_name_type),
protected,
save, &
118 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_coordinates") &
127 type(kim_compute_argument_name_type),
protected,
save, &
128 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialEnergy") &
137 type(kim_compute_argument_name_type),
protected,
save, &
138 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialForces") &
147 type(kim_compute_argument_name_type),
protected,
save, &
148 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy") &
157 type(kim_compute_argument_name_type),
protected,
save, &
158 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialVirial") &
167 type(kim_compute_argument_name_type),
protected,
save, &
168 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_partialParticleVirial") &
177 module procedure kim_compute_argument_name_known
178 end interface kim_known
185 interface operator(.eq.)
186 module procedure kim_compute_argument_name_equal
187 end interface operator(.eq.)
195 interface operator(.ne.)
196 module procedure kim_compute_argument_name_not_equal
197 end interface operator(.ne.)
206 interface kim_from_string
207 module procedure kim_compute_argument_name_from_string
208 end interface kim_from_string
215 interface kim_to_string
216 module procedure kim_compute_argument_name_to_string
217 end interface kim_to_string
225 logical recursive function kim_compute_argument_name_known( &
226 compute_argument_name)
229 integer(c_int) recursive function known(compute_argument_name) &
230 bind(c, name=
"KIM_ComputeArgumentName_Known")
231 use,
intrinsic :: iso_c_binding
232 import kim_compute_argument_name_type
234 type(kim_compute_argument_name_type),
intent(in),
value :: &
235 compute_argument_name
238 type(kim_compute_argument_name_type),
intent(in) :: compute_argument_name
240 kim_compute_argument_name_known = (known(compute_argument_name) /= 0)
241 end function kim_compute_argument_name_known
248 logical recursive function kim_compute_argument_name_equal(lhs, rhs)
250 type(kim_compute_argument_name_type),
intent(in) :: lhs
251 type(kim_compute_argument_name_type),
intent(in) :: rhs
253 kim_compute_argument_name_equal &
254 = (lhs%compute_argument_name_id == rhs%compute_argument_name_id)
255 end function kim_compute_argument_name_equal
263 logical recursive function kim_compute_argument_name_not_equal(lhs, rhs)
265 type(kim_compute_argument_name_type),
intent(in) :: lhs
266 type(kim_compute_argument_name_type),
intent(in) :: rhs
268 kim_compute_argument_name_not_equal = .not. (lhs == rhs)
269 end function kim_compute_argument_name_not_equal
278 recursive subroutine kim_compute_argument_name_from_string( &
279 string, compute_argument_name)
282 type(kim_compute_argument_name_type)
recursive function from_string( &
283 string) bind(c, name=
"KIM_ComputeArgumentName_FromString")
284 use,
intrinsic :: iso_c_binding
285 import kim_compute_argument_name_type
287 character(c_char),
intent(in) :: string(*)
288 end function from_string
290 character(len=*, kind=c_char),
intent(in) :: string
291 type(kim_compute_argument_name_type),
intent(out) :: compute_argument_name
293 compute_argument_name = from_string(trim(string)//c_null_char)
294 end subroutine kim_compute_argument_name_from_string
301 recursive subroutine kim_compute_argument_name_to_string( &
302 compute_argument_name, string)
303 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
306 type(c_ptr)
recursive function get_string(compute_argument_name) &
307 bind(c, name=
"KIM_ComputeArgumentName_ToString")
308 use,
intrinsic :: iso_c_binding
309 import kim_compute_argument_name_type
311 type(kim_compute_argument_name_type),
intent(in),
value :: &
312 compute_argument_name
313 end function get_string
315 type(kim_compute_argument_name_type),
intent(in) :: &
316 compute_argument_name
317 character(len=*, kind=c_char),
intent(out) :: string
321 p = get_string(compute_argument_name)
322 call kim_convert_c_char_ptr_to_string(p, string)
323 end subroutine kim_compute_argument_name_to_string
333 number_of_compute_argument_names)
336 recursive subroutine get_number_of_compute_argument_names( &
337 number_of_compute_argument_names) &
339 name=
"KIM_COMPUTE_ARGUMENT_NAME_GetNumberOfComputeArgumentNames")
340 use,
intrinsic :: iso_c_binding
341 integer(c_int),
intent(out) :: number_of_compute_argument_names
342 end subroutine get_number_of_compute_argument_names
344 integer(c_int),
intent(out) :: number_of_compute_argument_names
346 call get_number_of_compute_argument_names(number_of_compute_argument_names)
357 index, compute_argument_name, ierr)
360 integer(c_int) recursive function get_compute_argument_name( &
361 index, compute_argument_name) &
362 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName")
363 use,
intrinsic :: iso_c_binding
364 import kim_compute_argument_name_type
366 integer(c_int),
intent(in),
value :: index
367 type(kim_compute_argument_name_type),
intent(out) :: &
368 compute_argument_name
369 end function get_compute_argument_name
371 integer(c_int),
intent(in) :: index
372 type(kim_compute_argument_name_type),
intent(out) :: compute_argument_name
373 integer(c_int),
intent(out) :: ierr
375 ierr = get_compute_argument_name(index - 1, compute_argument_name)
386 compute_argument_name, &
391 integer(c_int) recursive function get_compute_argument_data_type( &
392 compute_argument_name, data_type) &
393 bind(c, name=
"KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentDataType")
394 use,
intrinsic :: iso_c_binding
396 import kim_compute_argument_name_type
398 type(kim_compute_argument_name_type),
intent(in),
value :: &
399 compute_argument_name
400 type(kim_data_type_type),
intent(out) :: data_type
401 end function get_compute_argument_data_type
403 type(kim_compute_argument_name_type),
intent(in) :: &
404 compute_argument_name
405 type(kim_data_type_type),
intent(out) :: data_type
406 integer(c_int),
intent(out) :: ierr
408 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