Checks whether dataset compression is available
subroutine check_compression_availability
!+ Checks whether dataset compression is available
IMPLICIT NONE
logical :: shuffle_avail, gzip_avail
integer :: gzip_info, shuf_info, filter_info_both
integer :: error
call h5open_f(error)
filter_info_both = ior(H5Z_FILTER_ENCODE_ENABLED_F,H5Z_FILTER_DECODE_ENABLED_F)
!! Check for GZIP filter
call h5zfilter_avail_f(H5Z_FILTER_DEFLATE_F, gzip_avail, error)
call h5zget_filter_info_f(H5Z_FILTER_DEFLATE_F, gzip_info, error)
if(.not.gzip_avail) then
print*,'HDF5: gzip filter is not available'
compress_data = .False.
endif
if (filter_info_both .ne. gzip_info) then
print*,'HDF5: gzip filter is not available for encoding and decoding'
compress_data = .False.
endif
!! Check for SHUFFLE filter
call h5zfilter_avail_f(H5Z_FILTER_SHUFFLE_F, shuffle_avail, error)
call h5zget_filter_info_f(H5Z_FILTER_SHUFFLE_F, shuf_info, error)
if(.not.shuffle_avail) then
print*,'HDF5: shuffle filter is not available'
compress_data = .False.
endif
if (filter_info_both .ne. shuf_info) then
print*,'HDF5: shuffle filter is not available for encoding and decoding'
compress_data = .False.
endif
if(.not.compress_data) then
print*,'HDF5: Compression is not available. Proceeding without compression.'
endif
call h5close_f(error)
end subroutine check_compression_availability