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_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 character(len=2048, kind=c_char) item_type_str
182 call my_error(
"Unable to create collections object.")
185 call kim_get_project_name_and_sem_ver(col, project_name, sem_ver)
186 print *,
"Project : ", trim(project_name)
187 print *,
"semVer : ", trim(sem_ver)
193 call kim_get_environment_variable_name(col, it, name, ierr)
194 call kim_to_string(it, item_type_str)
195 print
'(A," env name : ",A)', trim(item_type_str), trim(name)
199 call kim_get_environment_variable_name(col, it, name, ierr)
200 call kim_to_string(it, item_type_str)
201 print
'(A," env name : ",A)', trim(item_type_str), trim(name)
205 call kim_get_environment_variable_name(col, it, name, ierr)
206 call kim_to_string(it, item_type_str)
207 print
'(A," env name : ",A)', trim(item_type_str), trim(name)
210 call kim_get_configuration_file_environment_variable(col, name,
value)
211 print
'("config file env name : ",A)', trim(name)
212 print
'("config file env value : ",A)', trim(
value)
215 call kim_get_configuration_file_name(col, file_name)
216 print
'("config file name : ",A)', trim(file_name)
232 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
233 call kim_to_string(it, item_type_str)
234 print
'(A," :")', trim(item_type_str)
236 call kim_get_item_name_by_type(col, i, name, ierr)
237 print
'(A,A)', achar(9), trim(name)
241 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
242 call kim_to_string(it, item_type_str)
243 print
'(A," :")', trim(item_type_str)
245 call kim_get_item_name_by_type(col, i, name, ierr)
246 print
'(A,A)', achar(9), trim(name)
250 call kim_cache_list_of_item_names_by_type(col, it, extent, ierr)
251 call kim_to_string(it, item_type_str)
252 print
'(A," :")', trim(item_type_str)
254 call kim_get_item_name_by_type(col, i, name, ierr)
255 print
'(A,A)', achar(9), trim(name)
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.