Use file_close from C

This commit is contained in:
Paul Romano 2018-04-17 15:29:35 -05:00
parent c74f4738c1
commit b3bd34e51b
2 changed files with 8 additions and 13 deletions

View file

@ -99,6 +99,13 @@ module hdf5_interface
public :: get_datasets
public :: get_name
interface
subroutine file_close(file_id) bind(C)
import HID_T
integer(HID_T), value :: file_id
end subroutine file_close
end interface
contains
!===============================================================================
@ -133,18 +140,6 @@ contains
file_id = file_open_c(to_c_string(filename), mode, parallel_)
end function file_open
!===============================================================================
! FILE_CLOSE closes HDF5 file
!===============================================================================
subroutine file_close(file_id)
integer(HID_T), intent(in) :: file_id
integer :: hdf5_err
call h5fclose_f(file_id, hdf5_err)
end subroutine file_close
!===============================================================================
! GET_GROUPS Gets a list of all the groups in a given location.
!===============================================================================

View file

@ -18,7 +18,7 @@ void close_dataset(hid_t dataset_id);
void close_group(hid_t group_id);
extern "C" hid_t file_open(const char* filename, char mode, bool parallel);
hid_t file_open(const std::string& filename, char mode, bool parallel);
void file_close(hid_t file_id);
extern "C" void file_close(hid_t file_id);
bool object_exists(hid_t object_id, const char* name);
hid_t open_dataset(hid_t group_id, const char* name);
hid_t open_group(hid_t group_id, const char* name);