30 use,
intrinsic :: iso_c_binding
36 recursive subroutine my_error(message)
38 character(len=*, kind=c_char),
intent(in) :: message
40 print *,
"* Error : ", trim(message)
52 use,
intrinsic :: iso_c_binding
57 type(kim_collection_type),
intent(in) :: collection
58 type(kim_collections_handle_type),
intent(inout) :: col
63 character(len=2048, kind=c_char) coll_str
64 character(len=2048, kind=c_char) item_type_str
65 character(len=2048, kind=c_char) dir_str
68 call kim_cache_list_of_directory_names(col, collection, &
70 call kim_to_string(collection, coll_str)
72 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
75 call kim_get_directory_name(col, i, dir_str, ierr)
76 print
'(A,A)', achar(9), trim(dir_str)
79 call kim_cache_list_of_directory_names(col, collection, &
81 call kim_to_string(collection, coll_str)
83 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
86 call kim_get_directory_name(col, i, dir_str, ierr)
87 print
'(A,A)', achar(9), trim(dir_str)
90 call kim_cache_list_of_directory_names(col, collection, &
92 call kim_to_string(collection, coll_str)
94 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
97 call kim_get_directory_name(col, i, dir_str, ierr)
98 print
'(A,A)', achar(9), trim(dir_str)
103 use,
intrinsic :: iso_c_binding
108 type(kim_collection_type),
intent(in) :: kc
109 type(kim_collections_handle_type),
intent(inout) :: col
113 integer(c_int) extent
114 character(len=2048, kind=c_char) coll_str
115 character(len=2048, kind=c_char) item_type_str
116 character(len=2048, kind=c_char) name_str
118 call kim_cache_list_of_item_names_by_collection_and_type(col, kc, &
120 call kim_to_string(kc, coll_str)
122 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
125 call kim_get_item_name_by_collection_and_type(col, i, name_str, ierr)
126 print
'(A,A)', achar(9), trim(name_str)
129 call kim_cache_list_of_item_names_by_collection_and_type(col, kc, &
131 call kim_to_string(kc, coll_str)
133 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
136 call kim_get_item_name_by_collection_and_type(col, i, name_str, ierr)
137 print
'(A,A)', achar(9), trim(name_str)
140 call kim_cache_list_of_item_names_by_collection_and_type(col, kc, &
142 call kim_to_string(kc, coll_str)
144 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
147 call kim_get_item_name_by_collection_and_type(col, i, name_str, ierr)
148 print
'(A,A)', achar(9), trim(name_str)
159 use,
intrinsic :: iso_c_binding
167 integer(c_int) :: ierr
168 integer(c_int) :: extent
170 type(kim_collections_handle_type) :: col
171 type(kim_collection_type) col_t
172 type(kim_collection_item_type_type) it
173 character(len=2048, kind=c_char) project_name
174 character(len=2048, kind=c_char) sem_ver
175 character(len=2048, kind=c_char) name
176 character(len=2048, kind=c_char) value
177 character(len=2048, kind=c_char) file_name
178 integer(c_long) file_length
179 integer(c_int) available_as_string
180 integer(c_signed_char) file_raw_data(10000)
181 character(len=10000, kind=c_char) file_string
182 character(len=2048, kind=c_char) item_type_str
187 call my_error(
"Unable to create collections object.")
190 call kim_get_project_name_and_sem_ver(col, project_name, sem_ver)
191 print *,
"Project : ", trim(project_name)
192 print *,
"semVer : ", trim(sem_ver)
198 call kim_get_environment_variable_name(col, it, name, ierr)
199 call kim_to_string(it, item_type_str)
200 print
'(A," env name : ",A)', trim(item_type_str), trim(name)
204 call kim_get_environment_variable_name(col, it, name, ierr)
205 call kim_to_string(it, item_type_str)
206 print
'(A," env name : ",A)', trim(item_type_str), trim(name)
210 call kim_get_environment_variable_name(col, it, name, ierr)
211 call kim_to_string(it, item_type_str)
212 print
'(A," env name : ",A)', trim(item_type_str), trim(name)
215 call kim_get_configuration_file_environment_variable(col, name,
value)
216 print
'("config file env name : ",A)', trim(name)
217 print
'("config file env value : ",A)', trim(
value)
220 call kim_get_configuration_file_name(col, file_name)
221 print
'("config file name : ",A)', trim(file_name)
237 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
238 call kim_to_string(it, item_type_str)
239 print
'(A," :")', trim(item_type_str)
241 call kim_get_item_name_by_type(col, i, name, ierr)
242 print
'(A,A)', achar(9), trim(name)
246 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
247 call kim_to_string(it, item_type_str)
248 print
'(A," :")', trim(item_type_str)
250 call kim_get_item_name_by_type(col, i, name, ierr)
251 print
'(A,A)', achar(9), trim(name)
255 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
256 call kim_to_string(it, item_type_str)
257 print
'(A," :")', trim(item_type_str)
259 call kim_get_item_name_by_type(col, i, name, ierr)
260 print
'(A,A)', achar(9), trim(name)
263 call kim_get_item_library_file_name_and_collection(col, it, &
264 trim(
"Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu"), name, col_t, ierr)
266 print
'(A)',
"Error from GetItemLibraryFileNameAndCollection" 268 call kim_to_string(col_t,
value)
269 print
'(A,A,A,A,A)', &
270 "Simulator Model Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu has library name '", &
271 trim(name),
"' and is part of the '", trim(
value),
"' collection." 274 call kim_cache_list_of_item_metadata_files(col, it, &
275 trim(
"Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu"), extent, ierr)
277 print
'(A)',
"Error from CacheListOfItemMetadataFiles" 280 call kim_get_item_metadata_file_length(col, i, file_length, &
281 available_as_string, ierr)
282 call kim_get_item_metadata_file_values(col, i, file_name, &
283 file_raw_data, file_string, ierr)
284 print
'(A,I2,A,A,A,I6)',
"Metadata File ", i,
", ", trim(file_name), &
285 ", is of length", file_length
286 print
'(A)', trim(file_string)
type(kim_collection_item_type_type), save, public, protected kim_collection_item_type_model_driver
type(kim_collection_type), save, public, protected kim_collection_user
subroutine dirs_for_collection(collection, col)
An Extensible Enumeration for the CollectionItemType's supported by the KIM API.
recursive subroutine, public kim_collections_create(collections_handle, ierr)
Create a new KIM API Collections object.
Provides the interface to the KIM API Collections and is meant to be used by simulators.
type(kim_collection_item_type_type), save, public, protected kim_collection_item_type_portable_model
recursive subroutine my_error(message)
type(kim_collection_type), save, public, protected kim_collection_environment_variable
subroutine names_for_collection(kc, col)
type(kim_collection_item_type_type), save, public, protected kim_collection_item_type_simulator_model
type(kim_collection_type), save, public, protected kim_collection_system
program collections_example_fortran
type(kim_collection_type), save, public, protected kim_collection_current_working_directory
An Extensible Enumeration for the Collection's supported by the KIM API.
recursive subroutine, public kim_collections_destroy(collections_handle)
Destroy a previously Collections::Create'd object.