diff options
Diffstat (limited to 'fortran/test/tH5Z.f90')
-rw-r--r-- | fortran/test/tH5Z.f90 | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/fortran/test/tH5Z.f90 b/fortran/test/tH5Z.f90 index 4260fca..c64d99b 100644 --- a/fortran/test/tH5Z.f90 +++ b/fortran/test/tH5Z.f90 @@ -145,7 +145,6 @@ endif endif - RETURN END SUBROUTINE filters_test @@ -181,7 +180,6 @@ INTEGER :: num_errors = 0 ! Number of data errors INTEGER :: i, j !general purpose integers - INTEGER :: config_flags ! for h5zget_filter_info_f INTEGER(HSIZE_T), DIMENSION(2) :: data_dims INTEGER(HID_T) :: crp_list INTEGER :: options_mask, pix_per_block @@ -191,26 +189,36 @@ INTEGER :: filter_flag = -1 INTEGER(SIZE_T) :: cd_nelemnts = 4 INTEGER(SIZE_T) :: filter_name_len = 4 - INTEGER, DIMENSION(4) :: cd_values + INTEGER, DIMENSION(4) :: cd_values + INTEGER :: config_flag = 0 ! for h5zget_filter_info_f ! ! Verify that SZIP exists and has an encoder ! - CALL h5zfilter_avail_f(H5Z_FILTER_SZIP_F, flag, error) - CALL check("h5zfilter_avail_f", error, total_error) - if(.NOT. flag) then + CALL h5zget_filter_info_f(H5Z_FILTER_SZIP_F, config_flag, error) + CALL check("h5zget_filter_info", error, total_error) + if ( IAND(config_flag, H5Z_FILTER_ENCODE_ENABLED_F) .EQ. 0 ) then szip_flag = .FALSE. total_error = -1 return endif + CALL h5zfilter_avail_f(H5Z_FILTER_SZIP_F, flag, error) + CALL check("h5zfilter_avail", error, total_error) - CALL h5zget_filter_info_f(H5Z_FILTER_SZIP_F, config_flags, error) - CALL check("h5zget_filter_info_f", error, total_error) - if(.NOT. (IAND(config_flags, H5Z_FILTER_ENCODE_ENABLED_F) .eq. 1) ) then - szip_flag = .FALSE. - total_error = -1 - return - endif + ! + ! Make sure h5zget_filter_info_f returns the right flag + ! + if( flag ) then + if ( config_flag .NE. IOR( H5Z_FILTER_ENCODE_ENABLED_F, H5Z_FILTER_DECODE_ENABLED_F) ) then + error = -1 + CALL check("h5zget_filter_info config_flag", error, total_error) + endif + else + if ( config_flag .NE. 0 ) then + error = -1 + CALL check("h5zget_filter_info config_flag", error, total_error) + endif + endif options_mask = H5_SZIP_NN_OM_F pix_per_block = 32 @@ -255,6 +263,8 @@ CALL h5pclose_f(crp_list, error) CALL h5sclose_f(dspace_id, error) CALL h5fclose_f(file_id, error) + szip_flag = .FALSE. + total_error = -1 return endif |