check_compression_availability Subroutine

public subroutine check_compression_availability()

Checks whether dataset compression is available

Arguments

None

Calls

proc~~check_compression_availability~~CallsGraph proc~check_compression_availability check_compression_availability h5zget_filter_info_f h5zget_filter_info_f proc~check_compression_availability->h5zget_filter_info_f h5close_f h5close_f proc~check_compression_availability->h5close_f h5open_f h5open_f proc~check_compression_availability->h5open_f h5zfilter_avail_f h5zfilter_avail_f proc~check_compression_availability->h5zfilter_avail_f

Called by

proc~~check_compression_availability~~CalledByGraph proc~check_compression_availability check_compression_availability program~generate_tables generate_tables program~generate_tables->proc~check_compression_availability program~fidasim fidasim program~fidasim->proc~check_compression_availability

Contents


Source Code

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