27 use,
intrinsic :: iso_c_binding
33 recursive subroutine my_error(message)
35 character(len=*, kind=c_char),
intent(in) :: message
37 print *,
"* Error : ", trim(message)
49 use,
intrinsic :: iso_c_binding
54 type(kim_collection_type),
intent(in) :: collection
55 type(kim_collections_handle_type),
intent(inout) :: col
60 character(len=2048, kind=c_char) coll_str
61 character(len=2048, kind=c_char) item_type_str
62 character(len=2048, kind=c_char) dir_str
64 call kim_cache_list_of_directory_names( &
66 call kim_to_string(collection, coll_str)
68 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
71 call kim_get_directory_name(col, i, dir_str, ierr)
72 print
'(A,A)', achar(9), trim(dir_str)
75 call kim_cache_list_of_directory_names( &
77 call kim_to_string(collection, coll_str)
79 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
82 call kim_get_directory_name(col, i, dir_str, ierr)
83 print
'(A,A)', achar(9), trim(dir_str)
86 call kim_cache_list_of_directory_names( &
88 call kim_to_string(collection, coll_str)
90 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
93 call kim_get_directory_name(col, i, dir_str, ierr)
94 print
'(A,A)', achar(9), trim(dir_str)
99 use,
intrinsic :: iso_c_binding
104 type(kim_collection_type),
intent(in) :: kc
105 type(kim_collections_handle_type),
intent(inout) :: col
109 integer(c_int) extent
110 character(len=2048, kind=c_char) coll_str
111 character(len=2048, kind=c_char) item_type_str
112 character(len=2048, kind=c_char) name_str
114 call kim_cache_list_of_item_names_by_collection_and_type( &
116 call kim_to_string(kc, coll_str)
118 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
121 call kim_get_item_name_by_collection_and_type(col, i, name_str, ierr)
122 print
'(A,A)', achar(9), trim(name_str)
125 call kim_cache_list_of_item_names_by_collection_and_type( &
127 call kim_to_string(kc, coll_str)
129 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
132 call kim_get_item_name_by_collection_and_type(col, i, name_str, ierr)
133 print
'(A,A)', achar(9), trim(name_str)
136 call kim_cache_list_of_item_names_by_collection_and_type( &
138 call kim_to_string(kc, coll_str)
140 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
143 call kim_get_item_name_by_collection_and_type(col, i, name_str, ierr)
144 print
'(A,A)', achar(9), trim(name_str)
155 use,
intrinsic :: iso_c_binding
163 integer(c_int) :: ierr
164 integer(c_int) :: extent
166 type(kim_collections_handle_type) :: col
167 type(kim_collection_type) col_t
168 type(kim_collection_item_type_type) it
169 character(len=2048, kind=c_char) project_name
170 character(len=2048, kind=c_char) sem_ver
171 character(len=2048, kind=c_char) name
172 character(len=2048, kind=c_char) value
173 character(len=2048, kind=c_char) file_name
174 integer(c_long) file_length
175 integer(c_int) available_as_string
176 integer(c_signed_char) file_raw_data(10000)
177 character(len=10000, kind=c_char) file_string
178 character(len=2048, kind=c_char) item_type_str
183 call my_error(
"Unable to create collections object.")
186 call kim_get_project_name_and_sem_ver(col, project_name, sem_ver)
187 print *,
"Project : ", trim(project_name)
188 print *,
"semVer : ", trim(sem_ver)
192 call kim_get_environment_variable_name(col, it, name, ierr)
193 call kim_to_string(it, item_type_str)
194 print
'(A," env name : ",A)', trim(item_type_str), trim(name)
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)
209 call kim_get_configuration_file_environment_variable(col, name,
value)
210 print
'("config file env name : ",A)', trim(name)
211 print
'("config file env value : ",A)', trim(
value)
214 call kim_get_configuration_file_name(col, file_name)
215 print
'("config file name : ",A)', trim(file_name)
231 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
232 call kim_to_string(it, item_type_str)
233 print
'(A," :")', trim(item_type_str)
235 call kim_get_item_name_by_type(col, i, name, ierr)
236 print
'(A,A)', achar(9), trim(name)
240 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
241 call kim_to_string(it, item_type_str)
242 print
'(A," :")', trim(item_type_str)
244 call kim_get_item_name_by_type(col, i, name, ierr)
245 print
'(A,A)', achar(9), trim(name)
249 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
250 call kim_to_string(it, item_type_str)
251 print
'(A," :")', trim(item_type_str)
253 call kim_get_item_name_by_type(col, i, name, ierr)
254 print
'(A,A)', achar(9), trim(name)
257 call kim_get_item_library_file_name_and_collection( &
258 col, it, trim(
"Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu"), name, &
261 print
'(A)',
"Error from GetItemLibraryFileNameAndCollection" 263 call kim_to_string(col_t,
value)
264 print
'(A,A,A,A,A,A)', &
265 "Simulator Model Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu ", &
266 "has library name '", trim(name),
"' and is part of the '", &
267 trim(
value),
"' collection." 270 call kim_cache_list_of_item_metadata_files( &
271 col, it, trim(
"Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu"), extent, ierr)
273 print
'(A)',
"Error from CacheListOfItemMetadataFiles" 276 call kim_get_item_metadata_file_length(col, i, file_length, &
277 available_as_string, ierr)
278 call kim_get_item_metadata_file_values(col, i, file_name, &
279 file_raw_data, file_string, ierr)
280 print
'(A,I2,A,A,A,I6)',
"Metadata File ", i,
", ", trim(file_name), &
281 ", is of length", file_length
282 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.