36 use,
intrinsic :: iso_c_binding
62 type,
bind(c) :: kim_collection_type
68 integer(c_int) collection_id
77 bind(c, name="KIM_COLLECTION_system") &
86 bind(c, name="KIM_COLLECTION_user") &
96 bind(c, name="KIM_COLLECTION_environmentVariable") &
106 bind(c, name="KIM_COLLECTION_currentWorkingDirectory") &
115 module procedure kim_collection_known
123 interface operator(.eq.)
124 module procedure kim_collection_equal
125 end interface operator(.eq.)
132 interface operator(.ne.)
133 module procedure kim_collection_not_equal
134 end interface operator(.ne.)
143 module procedure kim_collection_from_string
152 module procedure kim_collection_to_string
161 logical recursive function kim_collection_known(collection)
164 integer(c_int) recursive function known(collection) &
165 bind(c, name="KIM_Collection_Known")
166 use,
intrinsic :: iso_c_binding
169 type(kim_collection_type),
intent(in),
value :: collection
172 type(kim_collection_type),
intent(in) :: collection
174 kim_collection_known = (known(collection) /= 0)
175 end function kim_collection_known
182 logical recursive function kim_collection_equal(lhs, rhs)
184 type(kim_collection_type),
intent(in) :: lhs
185 type(kim_collection_type),
intent(in) :: rhs
187 kim_collection_equal &
188 = (lhs%collection_id == rhs%collection_id)
189 end function kim_collection_equal
196 logical recursive function kim_collection_not_equal(lhs, rhs)
198 type(kim_collection_type),
intent(in) :: lhs
199 type(kim_collection_type),
intent(in) :: rhs
201 kim_collection_not_equal = .not. (lhs == rhs)
202 end function kim_collection_not_equal
210 recursive subroutine kim_collection_from_string(string, collection)
213 type(kim_collection_type)
recursive function from_string(string) &
214 bind(c, name="KIM_Collection_FromString")
215 use,
intrinsic :: iso_c_binding
218 character(c_char),
intent(in) :: string(*)
219 end function from_string
221 character(len=*, kind=c_char),
intent(in) :: string
222 type(kim_collection_type),
intent(out) :: collection
224 collection = from_string(trim(string)//c_null_char)
225 end subroutine kim_collection_from_string
232 recursive subroutine kim_collection_to_string(collection, string)
233 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
236 type(c_ptr)
recursive function get_string(collection) &
237 bind(c, name="KIM_Collection_ToString")
238 use,
intrinsic :: iso_c_binding
241 type(kim_collection_type),
intent(in),
value :: collection
244 type(kim_collection_type),
intent(in) :: collection
245 character(len=*, kind=c_char),
intent(out) :: string
250 call kim_convert_c_char_ptr_to_string(p, string)
251 end subroutine kim_collection_to_string
262 recursive subroutine get_number_of_collections(number_of_collections) &
263 bind(c, name="KIM_COLLECTION_GetNumberOfCollections")
264 use,
intrinsic :: iso_c_binding
266 integer(c_int),
intent(out) :: number_of_collections
267 end subroutine get_number_of_collections
269 integer(c_int),
intent(out) :: number_of_collections
271 call get_number_of_collections(number_of_collections)
282 integer(c_int) recursive function get_collection(index, collection) &
283 bind(c, name="KIM_COLLECTION_GetCollection")
284 use,
intrinsic :: iso_c_binding
287 integer(c_int),
intent(in),
value :: index
289 end function get_collection
291 integer(c_int),
intent(in) :: index
293 integer(c_int),
intent(out) :: ierr
295 ierr = get_collection(index - 1, collection)
Create a Collection object corresponding to the provided string. If the string does not match one of ...
Determines if the object is a quantity known to the KIM API.
Converts the object to a string.
An Extensible Enumeration for the Collection's supported by the KIM API.
type(kim_collection_type), save, bind(C, name="KIM_COLLECTION_system"), public, protected kim_collection_system
The standard system Collection.
type(kim_collection_type), save, bind(C, name="KIM_COLLECTION_user"), public, protected kim_collection_user
The standard user Collection.
type(kim_collection_type), save, bind(C, name="KIM_COLLECTION_environmentVariable"), public, protected kim_collection_environment_variable
The standard environmentVariable Collection.
type(kim_collection_type), save, bind(C, name="KIM_COLLECTION_currentWorkingDirectory"), public, protected kim_collection_current_working_directory
The standard currentWorkingDirectory Collection.
recursive subroutine, public kim_get_collection(index, collection, ierr)
Get the identity of each defined standard Collection.
recursive subroutine, public kim_get_number_of_collections(number_of_collections)
Get the number of standard Collection's defined by the KIM API.
An Extensible Enumeration for the Collection's supported by the KIM API.