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
67 call kim_cache_list_of_directory_names( &
69 call kim_to_string(collection, coll_str)
71 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
74 call kim_get_directory_name(col, i, dir_str, ierr)
75 print
'(A,A)', achar(9), trim(dir_str)
78 call kim_cache_list_of_directory_names( &
80 call kim_to_string(collection, coll_str)
82 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
85 call kim_get_directory_name(col, i, dir_str, ierr)
86 print
'(A,A)', achar(9), trim(dir_str)
89 call kim_cache_list_of_directory_names( &
91 call kim_to_string(collection, coll_str)
93 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
96 call kim_get_directory_name(col, i, dir_str, ierr)
97 print
'(A,A)', achar(9), trim(dir_str)
102 use,
intrinsic :: iso_c_binding
107 type(kim_collection_type),
intent(in) :: kc
108 type(kim_collections_handle_type),
intent(inout) :: col
112 integer(c_int) extent
113 character(len=2048, kind=c_char) coll_str
114 character(len=2048, kind=c_char) item_type_str
115 character(len=2048, kind=c_char) name_str
117 call kim_cache_list_of_item_names_by_collection_and_type( &
119 call kim_to_string(kc, coll_str)
121 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
124 call kim_get_item_name_by_collection_and_type(col, i, name_str, ierr)
125 print
'(A,A)', achar(9), trim(name_str)
128 call kim_cache_list_of_item_names_by_collection_and_type( &
130 call kim_to_string(kc, coll_str)
132 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
135 call kim_get_item_name_by_collection_and_type(col, i, name_str, ierr)
136 print
'(A,A)', achar(9), trim(name_str)
139 call kim_cache_list_of_item_names_by_collection_and_type( &
141 call kim_to_string(kc, coll_str)
143 print
'(A,":",A," :")', trim(coll_str), trim(item_type_str)
146 call kim_get_item_name_by_collection_and_type(col, i, name_str, ierr)
147 print
'(A,A)', achar(9), trim(name_str)
158 use,
intrinsic :: iso_c_binding
166 integer(c_int) :: ierr
167 integer(c_int) :: extent
169 type(kim_collections_handle_type) :: col
170 type(kim_collection_type) col_t
171 type(kim_collection_item_type_type) it
172 character(len=2048, kind=c_char) project_name
173 character(len=2048, kind=c_char) sem_ver
174 character(len=2048, kind=c_char) name
175 character(len=2048, kind=c_char) value
176 character(len=2048, kind=c_char) file_name
177 integer(c_long) file_length
178 integer(c_int) available_as_string
179 integer(c_signed_char) file_raw_data(10000)
180 character(len=10000, kind=c_char) file_string
181 character(len=2048, kind=c_char) item_type_str
186 call my_error(
"Unable to create collections object.")
189 call kim_get_project_name_and_sem_ver(col, project_name, sem_ver)
190 print *,
"Project : ", trim(project_name)
191 print *,
"semVer : ", trim(sem_ver)
195 call kim_get_environment_variable_name(col, it, name, ierr)
196 call kim_to_string(it, item_type_str)
197 print
'(A," env name : ",A)', trim(item_type_str), trim(name)
201 call kim_get_environment_variable_name(col, it, name, ierr)
202 call kim_to_string(it, item_type_str)
203 print
'(A," env name : ",A)', trim(item_type_str), trim(name)
207 call kim_get_environment_variable_name(col, it, name, ierr)
208 call kim_to_string(it, item_type_str)
209 print
'(A," env name : ",A)', trim(item_type_str), trim(name)
212 call kim_get_configuration_file_environment_variable(col, name,
value)
213 print
'("config file env name : ",A)', trim(name)
214 print
'("config file env value : ",A)', trim(
value)
217 call kim_get_configuration_file_name(col, file_name)
218 print
'("config file name : ",A)', trim(file_name)
234 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
235 call kim_to_string(it, item_type_str)
236 print
'(A," :")', trim(item_type_str)
238 call kim_get_item_name_by_type(col, i, name, ierr)
239 print
'(A,A)', achar(9), trim(name)
243 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
244 call kim_to_string(it, item_type_str)
245 print
'(A," :")', trim(item_type_str)
247 call kim_get_item_name_by_type(col, i, name, ierr)
248 print
'(A,A)', achar(9), trim(name)
252 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
253 call kim_to_string(it, item_type_str)
254 print
'(A," :")', trim(item_type_str)
256 call kim_get_item_name_by_type(col, i, name, ierr)
257 print
'(A,A)', achar(9), trim(name)
260 call kim_get_item_library_file_name_and_collection( &
261 col, it, trim(
"Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu"), name, &
264 print
'(A)',
"Error from GetItemLibraryFileNameAndCollection" 266 call kim_to_string(col_t,
value)
267 print
'(A,A,A,A,A,A)', &
268 "Simulator Model Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu ", &
269 "has library name '", trim(name),
"' and is part of the '", &
270 trim(
value),
"' collection." 273 call kim_cache_list_of_item_metadata_files( &
274 col, it, trim(
"Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu"), extent, ierr)
276 print
'(A)',
"Error from CacheListOfItemMetadataFiles" 279 call kim_get_item_metadata_file_length(col, i, file_length, &
280 available_as_string, ierr)
281 call kim_get_item_metadata_file_values(col, i, file_name, &
282 file_raw_data, file_string, ierr)
283 print
'(A,I2,A,A,A,I6)',
"Metadata File ", i,
", ", trim(file_name), &
284 ", is of length", file_length
285 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.