39 use,
intrinsic :: iso_c_binding
45 kim_collection_item_type_type, &
64 type, bind(c) :: kim_collection_item_type_type
71 integer(c_int) collection_item_type_id
72 end type kim_collection_item_type_type
80 type(kim_collection_item_type_type),
protected,
save, &
81 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_modelDriver") &
90 type(kim_collection_item_type_type),
protected,
save, &
91 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_portableModel") &
100 type(kim_collection_item_type_type),
protected,
save, &
101 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_simulatorModel") &
110 module procedure kim_collection_item_type_known
111 end interface kim_known
118 interface operator(.eq.)
119 module procedure kim_collection_item_type_equal
120 end interface operator(.eq.)
127 interface operator(.ne.)
128 module procedure kim_collection_item_type_not_equal
129 end interface operator(.ne.)
138 interface kim_from_string
139 module procedure kim_collection_item_type_from_string
140 end interface kim_from_string
147 interface kim_to_string
148 module procedure kim_collection_item_type_to_string
149 end interface kim_to_string
157 logical recursive function kim_collection_item_type_known( &
158 collection_item_type)
161 integer(c_int) recursive function known(collection_item_type) &
162 bind(c, name=
"KIM_CollectionItemType_Known")
163 use,
intrinsic :: iso_c_binding
164 import kim_collection_item_type_type
166 type(kim_collection_item_type_type),
intent(in),
value :: &
170 type(kim_collection_item_type_type),
intent(in) :: collection_item_type
172 kim_collection_item_type_known = (known(collection_item_type) /= 0)
173 end function kim_collection_item_type_known
180 logical recursive function kim_collection_item_type_equal(lhs, rhs)
182 type(kim_collection_item_type_type),
intent(in) :: lhs
183 type(kim_collection_item_type_type),
intent(in) :: rhs
185 kim_collection_item_type_equal &
186 = (lhs%collection_item_type_id == rhs%collection_item_type_id)
187 end function kim_collection_item_type_equal
194 logical recursive function kim_collection_item_type_not_equal(lhs, rhs)
196 type(kim_collection_item_type_type),
intent(in) :: lhs
197 type(kim_collection_item_type_type),
intent(in) :: rhs
199 kim_collection_item_type_not_equal = .not. (lhs == rhs)
200 end function kim_collection_item_type_not_equal
209 recursive subroutine kim_collection_item_type_from_string( &
210 string, collection_item_type)
213 type(kim_collection_item_type_type)
recursive function &
214 from_string(string) bind(c, name=
"KIM_CollectionItemType_FromString")
215 use,
intrinsic :: iso_c_binding
216 import kim_collection_item_type_type
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_item_type_type),
intent(out) :: collection_item_type
224 collection_item_type = from_string(trim(string)//c_null_char)
225 end subroutine kim_collection_item_type_from_string
232 recursive subroutine kim_collection_item_type_to_string( &
233 collection_item_type, string)
234 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
237 type(c_ptr)
recursive function get_string(collection_item_type) &
238 bind(c, name=
"KIM_CollectionItemType_ToString")
239 use,
intrinsic :: iso_c_binding
240 import kim_collection_item_type_type
242 type(kim_collection_item_type_type),
intent(in),
value :: &
244 end function get_string
246 type(kim_collection_item_type_type),
intent(in) :: collection_item_type
247 character(len=*, kind=c_char),
intent(out) :: string
251 p = get_string(collection_item_type)
252 call kim_convert_c_char_ptr_to_string(p, string)
253 end subroutine kim_collection_item_type_to_string
262 number_of_collection_item_types)
265 recursive subroutine get_number_of_collection_item_types( &
266 number_of_collection_item_types) &
267 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_GetNumberOfCollectionItemTypes")
268 use,
intrinsic :: iso_c_binding
270 integer(c_int),
intent(out) :: number_of_collection_item_types
271 end subroutine get_number_of_collection_item_types
273 integer(c_int),
intent(out) :: number_of_collection_item_types
275 call get_number_of_collection_item_types(number_of_collection_item_types)
285 collection_item_type, ierr)
288 integer(c_int) recursive function get_collection_item_type( &
289 index, collection_item_type) &
290 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_GetCollectionItemType")
291 use,
intrinsic :: iso_c_binding
292 import kim_collection_item_type_type
294 integer(c_int),
intent(in),
value :: index
295 type(kim_collection_item_type_type),
intent(out) :: collection_item_type
296 end function get_collection_item_type
298 integer(c_int),
intent(in) :: index
299 type(kim_collection_item_type_type),
intent(out) :: collection_item_type
300 integer(c_int),
intent(out) :: ierr
302 ierr = get_collection_item_type(index - 1, collection_item_type)
type(kim_collection_item_type_type), save, public, protected kim_collection_item_type_model_driver
An Extensible Enumeration for the CollectionItemType's supported by the KIM API.
recursive subroutine, public kim_get_collection_item_type(index, collection_item_type, ierr)
Get the identity of each defined standard CollectionItemType.
recursive subroutine, public kim_get_number_of_collection_item_types(number_of_collection_item_types)
Get the number of standard CollectionItemType's defined by the KIM API.
type(kim_collection_item_type_type), save, public, protected kim_collection_item_type_portable_model
type(kim_collection_item_type_type), save, public, protected kim_collection_item_type_simulator_model