40 use,
intrinsic :: iso_c_binding
46 kim_collection_item_type_type, &
68 type, bind(c) :: kim_collection_item_type_type
75 integer(c_int) collection_item_type_id
76 end type kim_collection_item_type_type
84 type(kim_collection_item_type_type),
protected,
save, &
85 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_modelDriver") &
94 type(kim_collection_item_type_type),
protected,
save, &
95 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_portableModel") &
104 type(kim_collection_item_type_type),
protected,
save, &
105 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_simulatorModel") &
114 module procedure kim_collection_item_type_known
115 end interface kim_known
122 interface operator (.eq.)
123 module procedure kim_collection_item_type_equal
124 end interface operator (.eq.)
131 interface operator (.ne.)
132 module procedure kim_collection_item_type_not_equal
133 end interface operator (.ne.)
142 interface kim_from_string
143 module procedure kim_collection_item_type_from_string
144 end interface kim_from_string
151 interface kim_to_string
152 module procedure kim_collection_item_type_to_string
153 end interface kim_to_string
161 logical recursive function kim_collection_item_type_known( &
162 collection_item_type)
165 integer(c_int) recursive function known(collection_item_type) &
166 bind(c, name=
"KIM_CollectionItemType_Known")
167 use,
intrinsic :: iso_c_binding
168 import kim_collection_item_type_type
170 type(kim_collection_item_type_type),
intent(in),
value :: &
174 type(kim_collection_item_type_type),
intent(in) :: collection_item_type
176 kim_collection_item_type_known = (known(collection_item_type) /= 0)
177 end function kim_collection_item_type_known
184 logical recursive function kim_collection_item_type_equal(lhs, rhs)
186 type(kim_collection_item_type_type),
intent(in) :: lhs
187 type(kim_collection_item_type_type),
intent(in) :: rhs
189 kim_collection_item_type_equal &
190 = (lhs%collection_item_type_id .eq. rhs%collection_item_type_id)
191 end function kim_collection_item_type_equal
198 logical recursive function kim_collection_item_type_not_equal(lhs, rhs)
200 type(kim_collection_item_type_type),
intent(in) :: lhs
201 type(kim_collection_item_type_type),
intent(in) :: rhs
203 kim_collection_item_type_not_equal = .not. (lhs .eq. rhs)
204 end function kim_collection_item_type_not_equal
213 recursive subroutine kim_collection_item_type_from_string(string, &
214 collection_item_type)
217 type(kim_collection_item_type_type)
recursive function &
218 from_string(string) bind(c, name=
"KIM_CollectionItemType_FromString")
219 use,
intrinsic :: iso_c_binding
220 import kim_collection_item_type_type
222 character(c_char),
intent(in) :: string(*)
223 end function from_string
225 character(len=*, kind=c_char),
intent(in) :: string
226 type(kim_collection_item_type_type),
intent(out) :: collection_item_type
228 collection_item_type = from_string(trim(string)//c_null_char)
229 end subroutine kim_collection_item_type_from_string
236 recursive subroutine kim_collection_item_type_to_string( &
237 collection_item_type, string)
238 use kim_convert_string_module
, only : kim_convert_c_char_ptr_to_string
241 type(c_ptr)
recursive function get_string(collection_item_type) &
242 bind(c, name=
"KIM_CollectionItemType_ToString")
243 use,
intrinsic :: iso_c_binding
244 import kim_collection_item_type_type
246 type(kim_collection_item_type_type),
intent(in),
value :: &
248 end function get_string
250 type(kim_collection_item_type_type),
intent(in) :: collection_item_type
251 character(len=*, kind=c_char),
intent(out) :: string
255 p = get_string(collection_item_type)
256 call kim_convert_c_char_ptr_to_string(p, string)
257 end subroutine kim_collection_item_type_to_string
266 number_of_collection_item_types)
269 recursive subroutine get_number_of_collection_item_types( &
270 number_of_collection_item_types) &
271 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_GetNumberOfCollectionItemTypes")
272 use,
intrinsic :: iso_c_binding
274 integer(c_int),
intent(out) :: number_of_collection_item_types
275 end subroutine get_number_of_collection_item_types
277 integer(c_int),
intent(out) :: number_of_collection_item_types
279 call get_number_of_collection_item_types(number_of_collection_item_types)
289 collection_item_type, ierr)
292 integer(c_int) recursive function get_collection_item_type(index, &
293 collection_item_type) &
294 bind(c, name=
"KIM_COLLECTION_ITEM_TYPE_GetCollectionItemType")
295 use,
intrinsic :: iso_c_binding
296 import kim_collection_item_type_type
298 integer(c_int),
intent(in),
value :: index
299 type(kim_collection_item_type_type),
intent(out) :: collection_item_type
300 end function get_collection_item_type
302 integer(c_int),
intent(in) :: index
303 type(kim_collection_item_type_type),
intent(out) :: collection_item_type
304 integer(c_int),
intent(out) :: ierr
306 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