36 use,
intrinsic :: iso_c_binding
78 type,
bind(c) :: kim_collections_handle_type
79 type(c_ptr) :: p = c_null_ptr
91 interface operator(.eq.)
92 module procedure kim_collections_handle_equal
93 end interface operator(.eq.)
98 interface operator(.ne.)
99 module procedure kim_collections_handle_not_equal
100 end interface operator(.ne.)
108 module procedure kim_collections_get_item_type
118 module procedure kim_collections_get_item_library_file_name_and_collection
128 module procedure kim_collections_cache_list_of_item_metadata_files
139 module procedure kim_collections_get_item_metadata_file_length
149 module procedure kim_collections_get_item_metadata_file_values
159 module procedure kim_collections_cache_list_of_item_names_by_type
168 module procedure kim_collections_get_item_name_by_type
179 kim_collections_cache_list_of_item_names_by_collection_and_type
189 module procedure kim_collections_get_item_name_by_collection_and_type
201 kim_collections_get_item_library_file_name_by_coll_and_type
213 kim_colls_cache_list_of_item_metadata_files_by_coll_and_type
225 kim_collections_get_item_metadata_file_length_by_coll_and_type
236 kim_collections_get_item_metadata_file_values_by_coll_and_type
246 module procedure kim_collections_get_project_name_and_sem_ver
256 module procedure kim_collections_get_environment_variable_name
266 module procedure kim_collections_get_configuration_file_environment_variable
276 module procedure kim_collections_get_configuration_file_name
286 module procedure kim_collections_cache_list_of_directory_names
295 module procedure kim_collections_get_directory_name
304 module procedure kim_collections_set_log_id
313 module procedure kim_collections_push_log_verbosity
322 module procedure kim_collections_pop_log_verbosity
329 logical recursive function kim_collections_handle_equal(lhs, rhs)
334 if ((.not. c_associated(lhs%p)) .and. (.not. c_associated(rhs%p)))
then
335 kim_collections_handle_equal = .true.
337 kim_collections_handle_equal = c_associated(lhs%p, rhs%p)
339 end function kim_collections_handle_equal
344 logical recursive function kim_collections_handle_not_equal(lhs, rhs)
349 kim_collections_handle_not_equal = .not. (lhs == rhs)
350 end function kim_collections_handle_not_equal
360 integer(c_int) recursive function create(collections) &
361 bind(c, name="KIM_Collections_Create")
362 use,
intrinsic :: iso_c_binding
364 type(c_ptr),
intent(out) :: collections
368 integer(c_int),
intent(out) :: ierr
370 type(c_ptr) :: pcollections
372 ierr = create(pcollections)
373 collections_handle%p = pcollections
384 recursive subroutine destroy(collections) &
385 bind(c, name="KIM_Collections_Destroy")
386 use,
intrinsic :: iso_c_binding
388 type(c_ptr),
intent(inout) :: collections
389 end subroutine destroy
393 type(c_ptr) :: pcollections
394 pcollections = collections_handle%p
395 call destroy(pcollections)
396 collections_handle%p = c_null_ptr
404 recursive subroutine kim_collections_get_item_type(collections_handle, &
405 item_name, item_type, ierr)
406 use kim_interoperable_types_module,
only: kim_collections_type
410 integer(c_int) recursive function get_item_type( &
411 collections, item_name, item_type) &
412 bind(c, name="KIM_Collections_GetItemType")
413 use,
intrinsic :: iso_c_binding
414 use kim_interoperable_types_module,
only: kim_collections_type
418 type(kim_collections_type),
intent(in) :: collections
419 character(c_char),
intent(in) :: item_name(*)
421 end function get_item_type
424 character(len=*, kind=c_char),
intent(in) :: item_name
425 type(kim_collection_item_type_type),
intent(out) :: item_type
426 integer(c_int),
intent(out) :: ierr
427 type(kim_collections_type),
pointer :: collections
429 call c_f_pointer(collections_handle%p, collections)
430 ierr = get_item_type(collections, trim(item_name)//c_null_char, item_type)
431 end subroutine kim_collections_get_item_type
439 recursive subroutine &
440 kim_collections_get_item_library_file_name_and_collection( &
441 collections_handle, item_type, item_name, file_name, collection, ierr)
442 use kim_interoperable_types_module,
only: kim_collections_type
443 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
448 integer(c_int) recursive function &
449 get_item_library_file_name_and_collection( &
450 collections, item_type, item_name, file_name, collection) &
451 bind(c, name="KIM_Collections_GetItemLibraryFileNameAndCollection")
452 use,
intrinsic :: iso_c_binding
453 use kim_interoperable_types_module,
only: kim_collections_type
458 type(kim_collections_type),
intent(in) :: collections
460 character(c_char),
intent(in) :: item_name(*)
461 type(c_ptr),
intent(out) :: file_name
463 end function get_item_library_file_name_and_collection
466 type(kim_collection_item_type_type),
intent(in) :: item_type
467 character(len=*, kind=c_char),
intent(in) :: item_name
468 character(len=*, kind=c_char),
intent(out) :: file_name
469 type(kim_collection_type),
intent(out) :: collection
470 integer(c_int),
intent(out) :: ierr
471 type(kim_collections_type),
pointer :: collections
473 type(c_ptr) :: pfile_name
475 call c_f_pointer(collections_handle%p, collections)
476 ierr = get_item_library_file_name_and_collection( &
479 trim(item_name)//c_null_char, &
482 call kim_convert_c_char_ptr_to_string(pfile_name, file_name)
483 end subroutine kim_collections_get_item_library_file_name_and_collection
491 recursive subroutine kim_collections_cache_list_of_item_metadata_files( &
492 collections_handle, item_type, item_name, extent, ierr)
493 use kim_interoperable_types_module,
only: kim_collections_type
497 integer(c_int) recursive function cache_list_of_item_metadata_files( &
498 collections, item_type, item_name, extent) &
499 bind(c, name="KIM_Collections_CacheListOfItemMetadataFiles")
500 use,
intrinsic :: iso_c_binding
501 use kim_interoperable_types_module,
only: kim_collections_type
505 type(kim_collections_type),
intent(in) :: collections
507 character(c_char),
intent(in) :: item_name(*)
508 integer(c_int),
intent(out) :: extent
509 end function cache_list_of_item_metadata_files
512 type(kim_collection_item_type_type),
intent(in) :: item_type
513 character(len=*, kind=c_char),
intent(in) :: item_name
514 integer(c_int),
intent(out) :: extent
515 integer(c_int),
intent(out) :: ierr
516 type(kim_collections_type),
pointer :: collections
518 call c_f_pointer(collections_handle%p, collections)
519 ierr = cache_list_of_item_metadata_files(collections, item_type, &
520 trim(item_name)//c_null_char, &
522 end subroutine kim_collections_cache_list_of_item_metadata_files
531 recursive subroutine kim_collections_get_item_metadata_file_length( &
532 collections_handle, index, file_length, available_as_string, ierr)
533 use kim_interoperable_types_module,
only: kim_collections_type
536 integer(c_int) recursive function get_item_metadata_file( &
537 collections, index, file_name, file_length, file_raw_data, &
538 available_as_string, file_string) &
539 bind(c, name="KIM_Collections_GetItemMetadataFile_fortran")
540 use,
intrinsic :: iso_c_binding
541 use kim_interoperable_types_module,
only: kim_collections_type
543 type(kim_collections_type),
intent(in) :: collections
544 integer(c_int),
intent(in),
value :: index
545 type(c_ptr),
intent(out) :: file_name
546 integer(c_long),
intent(out) :: file_length
547 type(c_ptr),
intent(out) :: file_raw_data
548 integer(c_int),
intent(out) :: available_as_string
549 type(c_ptr),
intent(out) :: file_string
550 end function get_item_metadata_file
553 integer(c_int),
intent(in) :: index
554 integer(c_long),
intent(out) :: file_length
555 integer(c_int),
intent(out) :: available_as_string
556 integer(c_int),
intent(out) :: ierr
557 type(kim_collections_type),
pointer :: collections
559 type(c_ptr) pfile_name, pfile_raw_data, pfile_string
561 call c_f_pointer(collections_handle%p, collections)
562 ierr = get_item_metadata_file(collections, &
567 available_as_string, &
569 end subroutine kim_collections_get_item_metadata_file_length
577 recursive subroutine kim_collections_get_item_metadata_file_values( &
578 collections_handle, index, file_name, file_raw_data, file_string, ierr)
579 use kim_interoperable_types_module,
only: kim_collections_type
580 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
583 integer(c_int) recursive function get_item_metadata_file( &
584 collections, index, file_name, file_length, file_raw_data, &
585 available_as_string, file_string) &
586 bind(c, name="KIM_Collections_GetItemMetadataFile_fortran")
587 use,
intrinsic :: iso_c_binding
588 use kim_interoperable_types_module,
only: kim_collections_type
590 type(kim_collections_type),
intent(in) :: collections
591 integer(c_int),
intent(in),
value :: index
592 type(c_ptr),
intent(out) :: file_name
593 integer(c_long),
intent(out) :: file_length
594 type(c_ptr),
intent(out) :: file_raw_data
595 integer(c_int),
intent(out) :: available_as_string
596 type(c_ptr),
intent(out) :: file_string
597 end function get_item_metadata_file
600 integer(c_int),
intent(in) :: index
601 character(len=*, kind=c_char),
intent(out) :: file_name
602 integer(c_signed_char),
intent(out) :: file_raw_data(:)
603 character(len=*, kind=c_char),
intent(out) :: file_string
604 integer(c_int),
intent(out) :: ierr
605 type(kim_collections_type),
pointer :: collections
607 integer(c_long) file_length
608 integer(c_int) available_as_string
609 type(c_ptr) pfile_name, pfile_raw_data, pfile_string
610 integer(c_signed_char),
pointer :: file_raw_data_fpointer(:)
612 call c_f_pointer(collections_handle%p, collections)
613 ierr = get_item_metadata_file(collections, &
618 available_as_string, &
621 if (
size(file_raw_data) < file_length)
then
625 if (available_as_string == 1)
then
626 if (len(file_string) < file_length)
then
632 call kim_convert_c_char_ptr_to_string(pfile_name, file_name)
633 if (c_associated(pfile_raw_data))
then
634 call c_f_pointer(pfile_raw_data, file_raw_data_fpointer, [file_length])
636 nullify (file_raw_data_fpointer)
638 file_raw_data = file_raw_data_fpointer(1:file_length)
640 if (available_as_string == 1)
then
641 call kim_convert_c_char_ptr_to_string(pfile_string, file_string)
644 end subroutine kim_collections_get_item_metadata_file_values
652 recursive subroutine kim_collections_cache_list_of_item_names_by_type( &
653 collections_handle, item_type, extent, ierr)
654 use kim_interoperable_types_module,
only: kim_collections_type
658 integer(c_int) recursive function cache_list_of_item_names_by_type( &
659 collections, item_type, extent) &
660 bind(c, name="KIM_Collections_CacheListOfItemNamesByType")
661 use,
intrinsic :: iso_c_binding
662 use kim_interoperable_types_module,
only: kim_collections_type
666 type(kim_collections_type),
intent(in) :: collections
668 integer(c_int),
intent(out) :: extent
669 end function cache_list_of_item_names_by_type
672 type(kim_collection_item_type_type),
intent(in) :: item_type
673 integer(c_int),
intent(out) :: extent
674 integer(c_int),
intent(out) :: ierr
675 type(kim_collections_type),
pointer :: collections
677 call c_f_pointer(collections_handle%p, collections)
678 ierr = cache_list_of_item_names_by_type(collections, item_type, extent)
679 end subroutine kim_collections_cache_list_of_item_names_by_type
686 recursive subroutine kim_collections_get_item_name_by_type( &
687 collections_handle, index, item_name, ierr)
688 use kim_interoperable_types_module,
only: kim_collections_type
689 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
692 integer(c_int) recursive function get_item_name_by_type( &
693 collections, index, item_name) &
694 bind(c, name="KIM_Collections_GetItemNameByType")
695 use,
intrinsic :: iso_c_binding
696 use kim_interoperable_types_module,
only: kim_collections_type
698 type(kim_collections_type),
intent(in) :: collections
699 integer(c_int),
intent(in),
value :: index
700 type(c_ptr),
intent(out) :: item_name
701 end function get_item_name_by_type
704 integer(c_int),
intent(in) :: index
705 character(len=*, kind=c_char),
intent(out) :: item_name
706 integer(c_int),
intent(out) :: ierr
707 type(kim_collections_type),
pointer :: collections
709 type(c_ptr) pitem_name
711 call c_f_pointer(collections_handle%p, collections)
712 ierr = get_item_name_by_type(collections, index - 1, pitem_name)
713 call kim_convert_c_char_ptr_to_string(pitem_name, item_name)
714 end subroutine kim_collections_get_item_name_by_type
722 recursive subroutine &
723 kim_collections_cache_list_of_item_names_by_collection_and_type( &
724 collections_handle, collection, item_type, extent, ierr)
725 use kim_interoperable_types_module,
only: kim_collections_type
730 integer(c_int) recursive function &
731 cache_list_of_item_names_by_collection_and_type( &
732 collections, collection, item_type, extent) &
733 bind(c, name="KIM_Collections_CacheListOfItemNamesByCollectionAndType")
734 use,
intrinsic :: iso_c_binding
735 use kim_interoperable_types_module,
only: kim_collections_type
740 type(kim_collections_type),
intent(in) :: collections
743 integer(c_int),
intent(out) :: extent
744 end function cache_list_of_item_names_by_collection_and_type
747 type(kim_collection_type),
intent(in) :: collection
748 type(kim_collection_item_type_type),
intent(in) :: item_type
749 integer(c_int),
intent(out) :: extent
750 integer(c_int),
intent(out) :: ierr
751 type(kim_collections_type),
pointer :: collections
753 call c_f_pointer(collections_handle%p, collections)
754 ierr = cache_list_of_item_names_by_collection_and_type(collections, &
758 end subroutine kim_collections_cache_list_of_item_names_by_collection_and_type
766 recursive subroutine kim_collections_get_item_name_by_collection_and_type( &
767 collections_handle, index, item_name, ierr)
768 use kim_interoperable_types_module,
only: kim_collections_type
769 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
772 integer(c_int) recursive function get_item_name_by_collection_and_type( &
773 collections, index, item_name) &
774 bind(c, name="KIM_Collections_GetItemNameByCollectionAndType")
775 use,
intrinsic :: iso_c_binding
776 use kim_interoperable_types_module,
only: kim_collections_type
778 type(kim_collections_type),
intent(in) :: collections
779 integer(c_int),
intent(in),
value :: index
780 type(c_ptr),
intent(out) :: item_name
781 end function get_item_name_by_collection_and_type
784 integer(c_int),
intent(in) :: index
785 character(len=*, kind=c_char),
intent(out) :: item_name
786 integer(c_int),
intent(out) :: ierr
787 type(kim_collections_type),
pointer :: collections
789 type(c_ptr) pitem_name
791 call c_f_pointer(collections_handle%p, collections)
792 ierr = get_item_name_by_collection_and_type(collections, index - 1, &
794 call kim_convert_c_char_ptr_to_string(pitem_name, item_name)
795 end subroutine kim_collections_get_item_name_by_collection_and_type
804 recursive subroutine &
805 kim_collections_get_item_library_file_name_by_coll_and_type( &
806 collections_handle, collection, item_type, item_name, file_name, ierr)
807 use kim_interoperable_types_module,
only: kim_collections_type
808 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
813 integer(c_int) recursive function &
814 get_item_library_file_name_by_coll_and_type( &
815 collections, collection, item_type, item_name, file_name) &
817 name=
"KIM_Collections_GetItemLibraryFileNameByCollectionAndType")
818 use,
intrinsic :: iso_c_binding
819 use kim_interoperable_types_module,
only: kim_collections_type
824 type(kim_collections_type),
intent(in) :: collections
827 character(c_char),
intent(in) :: item_name(*)
828 type(c_ptr),
intent(out) :: file_name
829 end function get_item_library_file_name_by_coll_and_type
832 type(kim_collection_type),
intent(in) :: collection
833 type(kim_collection_item_type_type),
intent(in) :: item_type
834 character(len=*, kind=c_char),
intent(in) :: item_name
835 character(len=*, kind=c_char),
intent(out) :: file_name
836 integer(c_int),
intent(out) :: ierr
837 type(kim_collections_type),
pointer :: collections
839 type(c_ptr) pfile_name
841 call c_f_pointer(collections_handle%p, collections)
842 ierr = get_item_library_file_name_by_coll_and_type( &
846 trim(item_name)//c_null_char, &
848 call kim_convert_c_char_ptr_to_string(pfile_name, file_name)
849 end subroutine kim_collections_get_item_library_file_name_by_coll_and_type
858 recursive subroutine &
859 kim_colls_cache_list_of_item_metadata_files_by_coll_and_type( &
860 collections_handle, collection, item_type, item_name, extent, ierr)
861 use kim_interoperable_types_module,
only: kim_collections_type
866 integer(c_int) recursive function &
867 cache_list_of_item_metadata_files_by_coll_and_type( &
868 collections, collection, item_type, item_name, extent) &
871 "KIM_Collections_CacheListOfItemMetadataFilesByCollectionAndType")
872 use,
intrinsic :: iso_c_binding
873 use kim_interoperable_types_module,
only: kim_collections_type
878 type(kim_collections_type),
intent(in) :: collections
881 character(c_char),
intent(in) :: item_name(*)
882 integer(c_int),
intent(out) :: extent
883 end function cache_list_of_item_metadata_files_by_coll_and_type
886 type(kim_collection_type),
intent(in) :: collection
887 type(kim_collection_item_type_type),
intent(in) :: item_type
888 character(len=*, kind=c_char),
intent(in) :: item_name
889 integer(c_int),
intent(out) :: extent
890 integer(c_int),
intent(out) :: ierr
891 type(kim_collections_type),
pointer :: collections
893 call c_f_pointer(collections_handle%p, collections)
894 ierr = cache_list_of_item_metadata_files_by_coll_and_type( &
898 trim(item_name)//c_null_char, &
900 end subroutine kim_colls_cache_list_of_item_metadata_files_by_coll_and_type
908 recursive subroutine &
909 kim_collections_get_item_metadata_file_length_by_coll_and_type( &
910 collections_handle, index, file_length, available_as_string, ierr)
911 use kim_interoperable_types_module,
only: kim_collections_type
914 integer(c_int) recursive function &
915 get_item_metadata_file_by_coll_and_type( &
916 collections, index, &
920 available_as_string, &
924 "KIM_Collections_GetItemMetadataFileByCollectionAndType_fortran")
925 use,
intrinsic :: iso_c_binding
926 use kim_interoperable_types_module,
only: kim_collections_type
928 type(kim_collections_type),
intent(in) :: collections
929 integer(c_int),
intent(in),
value :: index
930 type(c_ptr),
intent(out) :: file_name
931 integer(c_long),
intent(out) :: file_length
932 type(c_ptr),
intent(out) :: file_raw_data
933 integer(c_int),
intent(out) :: available_as_string
934 type(c_ptr),
intent(out) :: file_string
935 end function get_item_metadata_file_by_coll_and_type
938 integer(c_int),
intent(in),
value :: index
939 integer(c_long),
intent(out) :: file_length
940 integer(c_int),
intent(out) :: available_as_string
941 integer(c_int),
intent(out) :: ierr
942 type(kim_collections_type),
pointer :: collections
944 type(c_ptr) pfile_name, pfile_raw_data, pfile_string
946 call c_f_pointer(collections_handle%p, collections)
947 ierr = get_item_metadata_file_by_coll_and_type(collections, &
952 available_as_string, &
954 end subroutine kim_collections_get_item_metadata_file_length_by_coll_and_type
962 recursive subroutine &
963 kim_collections_get_item_metadata_file_values_by_coll_and_type( &
964 collections_handle, index, file_name, file_raw_data, file_string, ierr)
965 use kim_interoperable_types_module,
only: kim_collections_type
966 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
969 integer(c_int) recursive function &
970 get_item_metadata_file_by_coll_and_type(collections, &
975 available_as_string, &
979 "KIM_Collections_GetItemMetadataFileByCollectionAndType_fortran")
980 use,
intrinsic :: iso_c_binding
981 use kim_interoperable_types_module,
only: kim_collections_type
983 type(kim_collections_type),
intent(in) :: collections
984 integer(c_int),
intent(in),
value :: index
985 type(c_ptr),
intent(out) :: file_name
986 integer(c_long),
intent(out) :: file_length
987 type(c_ptr),
intent(out) :: file_raw_data
988 integer(c_int),
intent(out) :: available_as_string
989 type(c_ptr),
intent(out) :: file_string
990 end function get_item_metadata_file_by_coll_and_type
993 integer(c_int),
intent(in) :: index
994 character(len=*, kind=c_char),
intent(out) :: file_name
995 integer(c_signed_char),
intent(out) :: file_raw_data(:)
996 character(len=*, kind=c_char),
intent(out) :: file_string
997 integer(c_int),
intent(out) :: ierr
998 type(kim_collections_type),
pointer :: collections
1000 integer(c_long) file_length
1001 integer(c_int) available_as_string
1002 type(c_ptr) pfile_name, pfile_raw_data, pfile_string
1003 integer(c_signed_char),
pointer :: file_raw_data_fpointer(:)
1005 call c_f_pointer(collections_handle%p, collections)
1006 ierr = get_item_metadata_file_by_coll_and_type(collections, &
1011 available_as_string, &
1014 if (
size(file_raw_data) < file_length)
then
1018 if (available_as_string == 1)
then
1019 if (len(file_string) < file_length)
then
1025 call kim_convert_c_char_ptr_to_string(pfile_name, file_name)
1026 if (c_associated(pfile_raw_data))
then
1027 call c_f_pointer(pfile_raw_data, file_raw_data_fpointer, [file_length])
1029 nullify (file_raw_data_fpointer)
1031 file_raw_data = file_raw_data_fpointer(1:file_length)
1033 if (available_as_string == 1)
then
1034 call kim_convert_c_char_ptr_to_string(pfile_string, file_string)
1037 end subroutine kim_collections_get_item_metadata_file_values_by_coll_and_type
1045 recursive subroutine kim_collections_get_project_name_and_sem_ver( &
1046 collections_handle, project_name, sem_ver)
1047 use kim_interoperable_types_module,
only: kim_collections_type
1048 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
1051 recursive subroutine get_project_name_and_sem_ver(collections, &
1052 project_name, sem_ver) &
1053 bind(c, name="KIM_Collections_GetProjectNameAndSemVer")
1054 use,
intrinsic :: iso_c_binding
1055 use kim_interoperable_types_module,
only: kim_collections_type
1057 type(kim_collections_type),
intent(in) :: collections
1058 type(c_ptr),
intent(out) :: project_name
1059 type(c_ptr),
intent(out) :: sem_ver
1060 end subroutine get_project_name_and_sem_ver
1063 character(len=*, kind=c_char),
intent(out) :: project_name
1064 character(len=*, kind=c_char),
intent(out) :: sem_ver
1065 type(kim_collections_type),
pointer :: collections
1067 type(c_ptr) pproject_name, psem_ver
1069 call c_f_pointer(collections_handle%p, collections)
1070 call get_project_name_and_sem_ver(collections, pproject_name, psem_ver)
1071 call kim_convert_c_char_ptr_to_string(pproject_name, project_name)
1072 call kim_convert_c_char_ptr_to_string(psem_ver, sem_ver)
1073 end subroutine kim_collections_get_project_name_and_sem_ver
1081 recursive subroutine kim_collections_get_environment_variable_name( &
1082 collections_handle, item_type, name, ierr)
1083 use kim_interoperable_types_module,
only: kim_collections_type
1084 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
1088 integer(c_int) recursive function get_environment_variable_name( &
1089 collections, item_type, name) &
1090 bind(c, name="KIM_Collections_GetEnvironmentVariableName")
1091 use,
intrinsic :: iso_c_binding
1092 use kim_interoperable_types_module,
only: kim_collections_type
1096 type(kim_collections_type),
intent(in) :: collections
1098 type(c_ptr),
intent(out) :: name
1099 end function get_environment_variable_name
1102 type(kim_collection_item_type_type),
intent(in) :: item_type
1103 character(len=*, kind=c_char),
intent(out) :: name
1104 integer(c_int),
intent(out) :: ierr
1105 type(kim_collections_type),
pointer :: collections
1109 call c_f_pointer(collections_handle%p, collections)
1110 ierr = get_environment_variable_name(collections, item_type, pname)
1111 call kim_convert_c_char_ptr_to_string(pname, name)
1112 end subroutine kim_collections_get_environment_variable_name
1120 recursive subroutine &
1121 kim_collections_get_configuration_file_environment_variable( &
1122 collections_handle, name,
value)
1123 use kim_interoperable_types_module,
only: kim_collections_type
1124 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
1127 recursive subroutine get_configuration_file_environment_variable( &
1128 collections, name, value) &
1129 bind(c, name="KIM_Collections_GetConfigurationFileEnvironmentVariable")
1130 use,
intrinsic :: iso_c_binding
1131 use kim_interoperable_types_module,
only: kim_collections_type
1133 type(kim_collections_type),
intent(in) :: collections
1134 type(c_ptr),
intent(out) :: name
1135 type(c_ptr),
intent(out) :: value
1136 end subroutine get_configuration_file_environment_variable
1139 character(len=*, kind=c_char),
intent(out) :: name
1140 character(len=*, kind=c_char),
intent(out) :: value
1141 type(kim_collections_type),
pointer :: collections
1143 type(c_ptr) pname, pvalue
1145 call c_f_pointer(collections_handle%p, collections)
1146 call get_configuration_file_environment_variable(collections, pname, pvalue)
1147 call kim_convert_c_char_ptr_to_string(pname, name)
1148 call kim_convert_c_char_ptr_to_string(pvalue,
value)
1149 end subroutine kim_collections_get_configuration_file_environment_variable
1157 recursive subroutine kim_collections_get_configuration_file_name( &
1158 collections_handle, file_name)
1159 use kim_interoperable_types_module,
only: kim_collections_type
1160 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
1163 recursive subroutine get_configuration_file_name(collections, file_name) &
1164 bind(c, name="KIM_Collections_GetConfigurationFileName")
1165 use,
intrinsic :: iso_c_binding
1166 use kim_interoperable_types_module,
only: kim_collections_type
1168 type(kim_collections_type),
intent(in) :: collections
1169 type(c_ptr),
intent(out) :: file_name
1170 end subroutine get_configuration_file_name
1173 character(len=*, kind=c_char),
intent(out) :: file_name
1174 type(kim_collections_type),
pointer :: collections
1176 type(c_ptr) pfile_name
1178 call c_f_pointer(collections_handle%p, collections)
1179 call get_configuration_file_name(collections, pfile_name)
1180 call kim_convert_c_char_ptr_to_string(pfile_name, file_name)
1181 end subroutine kim_collections_get_configuration_file_name
1189 recursive subroutine kim_collections_cache_list_of_directory_names( &
1190 collections_handle, collection, item_type, extent, ierr)
1191 use kim_interoperable_types_module,
only: kim_collections_type
1196 integer(c_int) recursive function cache_list_of_directory_names( &
1197 collections, collection, item_type, extent) &
1198 bind(c, name="KIM_Collections_CacheListOfDirectoryNames")
1199 use,
intrinsic :: iso_c_binding
1200 use kim_interoperable_types_module,
only: kim_collections_type
1205 type(kim_collections_type),
intent(in) :: collections
1208 integer(c_int),
intent(out) :: extent
1209 end function cache_list_of_directory_names
1212 type(kim_collection_type),
intent(in) :: collection
1213 type(kim_collection_item_type_type),
intent(in) :: item_type
1214 integer(c_int),
intent(out) :: extent
1215 integer(c_int),
intent(out) :: ierr
1216 type(kim_collections_type),
pointer :: collections
1218 call c_f_pointer(collections_handle%p, collections)
1219 ierr = cache_list_of_directory_names(collections, collection, item_type, &
1221 end subroutine kim_collections_cache_list_of_directory_names
1228 recursive subroutine kim_collections_get_directory_name(collections_handle, &
1232 use kim_interoperable_types_module,
only: kim_collections_type
1233 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
1236 integer(c_int) recursive function get_directory_name(collections, index, &
1238 bind(c, name="KIM_Collections_GetDirectoryName")
1239 use,
intrinsic :: iso_c_binding
1240 use kim_interoperable_types_module,
only: kim_collections_type
1242 type(kim_collections_type),
intent(in) :: collections
1243 integer(c_int),
intent(in),
value :: index
1244 type(c_ptr),
intent(out) :: directory_name
1245 end function get_directory_name
1248 integer(c_int),
intent(in) :: index
1249 character(len=*, kind=c_char),
intent(out) :: directory_name
1250 integer(c_int),
intent(out) :: ierr
1251 type(kim_collections_type),
pointer :: collections
1253 type(c_ptr) pdirectory_name
1255 call c_f_pointer(collections_handle%p, collections)
1256 ierr = get_directory_name(collections, index - 1, pdirectory_name)
1257 call kim_convert_c_char_ptr_to_string(pdirectory_name, directory_name)
1258 end subroutine kim_collections_get_directory_name
1265 recursive subroutine kim_collections_set_log_id(collections_handle, log_id)
1266 use kim_interoperable_types_module,
only: kim_collections_type
1269 recursive subroutine set_log_id(collections, log_id) &
1270 bind(c, name="KIM_Collections_SetLogID")
1271 use,
intrinsic :: iso_c_binding
1272 use kim_interoperable_types_module,
only: kim_collections_type
1274 type(kim_collections_type),
intent(in) :: collections
1275 character(c_char),
intent(in) :: log_id(*)
1276 end subroutine set_log_id
1279 character(len=*, kind=c_char),
intent(in) :: log_id
1280 type(kim_collections_type),
pointer :: collections
1282 call c_f_pointer(collections_handle%p, collections)
1283 call set_log_id(collections, trim(log_id)//c_null_char)
1284 end subroutine kim_collections_set_log_id
1291 recursive subroutine kim_collections_push_log_verbosity(collections_handle, &
1294 use kim_interoperable_types_module,
only: kim_collections_type
1297 recursive subroutine push_log_verbosity(collections, log_verbosity) &
1298 bind(c, name="KIM_Collections_PushLogVerbosity")
1299 use,
intrinsic :: iso_c_binding
1301 use kim_interoperable_types_module,
only: kim_collections_type
1303 type(kim_collections_type),
intent(in) :: collections
1305 end subroutine push_log_verbosity
1308 type(kim_log_verbosity_type),
intent(in) :: log_verbosity
1309 type(kim_collections_type),
pointer :: collections
1311 call c_f_pointer(collections_handle%p, collections)
1312 call push_log_verbosity(collections, log_verbosity)
1313 end subroutine kim_collections_push_log_verbosity
1320 recursive subroutine kim_collections_pop_log_verbosity(collections_handle)
1322 use kim_interoperable_types_module,
only: kim_collections_type
1325 recursive subroutine pop_log_verbosity(collections) &
1326 bind(c, name="KIM_Collections_PopLogVerbosity")
1327 use,
intrinsic :: iso_c_binding
1329 use kim_interoperable_types_module,
only: kim_collections_type
1331 type(kim_collections_type),
intent(in) :: collections
1332 end subroutine pop_log_verbosity
1335 type(kim_collections_type),
pointer :: collections
1337 call c_f_pointer(collections_handle%p, collections)
1338 call pop_log_verbosity(collections)
1339 end subroutine kim_collections_pop_log_verbosity
Cache a list of directory names where a specific KIM API collection stores library files for a specif...
Cache a list of all item names of a specific type in a specific collection.
Cache a list of all item names of a specific type in the KIM API collections.
Get the name and value of the environment variable that stores the name of the KIM API user configura...
Get the absolute file and path name of the KIM API user configuration file.
Get the name of a directory from the cached list.
Get the names of environment variables that store configuration settings for the KIM::COLLECTION::env...
Get the item's library file name and its KIM::Collection.
KIM::Collections::GetItemLibraryFileNameByCollectionAndType
Get the name of an item from the cached list.
Get the name of an item from the cached list.
Get the KIM::CollectionItemType of the item in the KIM API collections with a specific name.
Get the KIM API project name and full Semantic Version string.
Pop a LogVerbosity from the Collections object's Log object verbosity stack.
Push a new LogVerbosity onto the Collections object's Log object verbosity stack.
Set the identity of the Log object associated with the Collections object.
An Extensible Enumeration for the CollectionItemType's supported by the KIM API.
An Extensible Enumeration for the Collection's supported by the KIM API.
Provides the interface to the KIM API Collections and is meant to be used by simulators.
recursive subroutine, public kim_collections_destroy(collections_handle)
Destroy a previously Collections::Create'd object.
recursive subroutine, public kim_collections_create(collections_handle, ierr)
Create a new KIM API Collections object.
type(kim_collections_handle_type), save, public, protected kim_collections_null_handle
NULL handle for use in comparisons.
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.
An Extensible Enumeration for the CollectionItemType's supported by the KIM API.
An Extensible Enumeration for the Collection's supported by the KIM API.
Provides the interface to the KIM API Collections and is meant to be used by simulators.
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.