36 use,
intrinsic :: iso_c_binding
42 kim_collection_item_type_type, &
61 type, bind(c) :: kim_collection_item_type_type
68 integer(c_int) collection_item_type_id
69 end type kim_collection_item_type_type
77 type(kim_collection_item_type_type),
protected,
save, &
78 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_modelDriver") &
87 type(kim_collection_item_type_type),
protected,
save, &
88 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_portableModel") &
97 type(kim_collection_item_type_type),
protected,
save, &
98 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_simulatorModel") &
107 module procedure kim_collection_item_type_known
108 end interface kim_known
115 interface operator(.eq.)
116 module procedure kim_collection_item_type_equal
117 end interface operator(.eq.)
124 interface operator(.ne.)
125 module procedure kim_collection_item_type_not_equal
126 end interface operator(.ne.)
135 interface kim_from_string
136 module procedure kim_collection_item_type_from_string
137 end interface kim_from_string
144 interface kim_to_string
145 module procedure kim_collection_item_type_to_string
146 end interface kim_to_string
154 logical recursive function kim_collection_item_type_known( &
155 collection_item_type)
158 integer(c_int) recursive function known(collection_item_type) &
159 bind(c, name=
"KIM_CollectionItemType_Known")
160 use,
intrinsic :: iso_c_binding
161 import kim_collection_item_type_type
163 type(kim_collection_item_type_type),
intent(in),
value :: &
167 type(kim_collection_item_type_type),
intent(in) :: collection_item_type
169 kim_collection_item_type_known = (known(collection_item_type) /= 0)
170 end function kim_collection_item_type_known
177 logical recursive function kim_collection_item_type_equal(lhs, rhs)
179 type(kim_collection_item_type_type),
intent(in) :: lhs
180 type(kim_collection_item_type_type),
intent(in) :: rhs
182 kim_collection_item_type_equal &
183 = (lhs%collection_item_type_id == rhs%collection_item_type_id)
184 end function kim_collection_item_type_equal
191 logical recursive function kim_collection_item_type_not_equal(lhs, rhs)
193 type(kim_collection_item_type_type),
intent(in) :: lhs
194 type(kim_collection_item_type_type),
intent(in) :: rhs
196 kim_collection_item_type_not_equal = .not. (lhs == rhs)
197 end function kim_collection_item_type_not_equal
206 recursive subroutine kim_collection_item_type_from_string( &
207 string, collection_item_type)
210 type(kim_collection_item_type_type)
recursive function &
211 from_string(string) bind(c, name=
"KIM_CollectionItemType_FromString")
212 use,
intrinsic :: iso_c_binding
213 import kim_collection_item_type_type
215 character(c_char),
intent(in) :: string(*)
216 end function from_string
218 character(len=*, kind=c_char),
intent(in) :: string
219 type(kim_collection_item_type_type),
intent(out) :: collection_item_type
221 collection_item_type = from_string(trim(string)//c_null_char)
222 end subroutine kim_collection_item_type_from_string
229 recursive subroutine kim_collection_item_type_to_string( &
230 collection_item_type, string)
231 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
234 type(c_ptr)
recursive function get_string(collection_item_type) &
235 bind(c, name=
"KIM_CollectionItemType_ToString")
236 use,
intrinsic :: iso_c_binding
237 import kim_collection_item_type_type
239 type(kim_collection_item_type_type),
intent(in),
value :: &
241 end function get_string
243 type(kim_collection_item_type_type),
intent(in) :: collection_item_type
244 character(len=*, kind=c_char),
intent(out) :: string
248 p = get_string(collection_item_type)
249 call kim_convert_c_char_ptr_to_string(p, string)
250 end subroutine kim_collection_item_type_to_string
259 number_of_collection_item_types)
262 recursive subroutine get_number_of_collection_item_types( &
263 number_of_collection_item_types) &
264 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_GetNumberOfCollectionItemTypes")
265 use,
intrinsic :: iso_c_binding
267 integer(c_int),
intent(out) :: number_of_collection_item_types
268 end subroutine get_number_of_collection_item_types
270 integer(c_int),
intent(out) :: number_of_collection_item_types
272 call get_number_of_collection_item_types(number_of_collection_item_types)
282 collection_item_type, ierr)
285 integer(c_int) recursive function get_collection_item_type( &
286 index, collection_item_type) &
287 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_GetCollectionItemType")
288 use,
intrinsic :: iso_c_binding
289 import kim_collection_item_type_type
291 integer(c_int),
intent(in),
value :: index
292 type(kim_collection_item_type_type),
intent(out) :: collection_item_type
293 end function get_collection_item_type
295 integer(c_int),
intent(in) :: index
296 type(kim_collection_item_type_type),
intent(out) :: collection_item_type
297 integer(c_int),
intent(out) :: ierr
299 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