diff --git a/tests/unit/ncdf_tests.F90 b/tests/unit/ncdf_tests.F90 index dc2525fbac5..831a06d28fb 100644 --- a/tests/unit/ncdf_tests.F90 +++ b/tests/unit/ncdf_tests.F90 @@ -472,12 +472,19 @@ Subroutine test_nc4(test_id, err_msg) ret_val = PIO_def_var_deflate(pio_file, pio_var, shuffle, deflate, & deflate_level) - ! Should not have worked except for netCDF-4/HDF5. - if ((iotype .eq. PIO_iotype_netcdf4c .or. iotype .eq. PIO_iotype_netcdf4p) & - .and. ret_val .ne. PIO_NOERR) then + ! Should not have worked except for netCDF-4/HDF5 sequential, and + ! perhaps parallel. + if (iotype .eq. PIO_iotype_netcdf4c .and. ret_val .ne. PIO_NOERR) then err_msg = "Could not turn on compression for variable foo2222" call PIO_closefile(pio_file) return + else if (iotype .eq. PIO_iotype_netcdf4p) then + !err_msg = "Could not turn on compression for variable foo2222" + ! if (ret_val .ne. PIO_NOERR) then + ! call PIO_closefile(pio_file) + ! return + ! end if + ! return else if (iotype .eq. PIO_iotype_pnetcdf .and. ret_val .eq. PIO_NOERR) then err_msg = "Did not get expected error when trying to turn deflate on for pnetcdf file" call PIO_closefile(pio_file) @@ -510,8 +517,8 @@ Subroutine test_nc4(test_id, err_msg) print*, 'testing PIO_inq_var_deflate' ret_val = PIO_inq_var_deflate(pio_file, pio_var, shuffle, deflate, my_deflate_level) - ! Should not have worked except for netCDF-4/HDF5. - if (iotype .eq. PIO_iotype_netcdf4c .or. iotype .eq. PIO_iotype_netcdf4p) then + ! Should not have worked except for netCDF-4/HDF5 sequential, and maybe parallel. + if (iotype .eq. PIO_iotype_netcdf4c) then if (ret_val .ne. PIO_NOERR) then err_msg = "Got error trying to inquire about deflate on for serial netcdf-4 file" call PIO_closefile(pio_file) @@ -524,6 +531,15 @@ Subroutine test_nc4(test_id, err_msg) return end if end if + else if (iotype .eq. PIO_iotype_netcdf4p) then + ! if (ret_val .eq. PIO_NOERR) then + ! print *,shuffle, deflate, deflate_level, my_deflate_level + ! if (shuffle .ne. 0 .or. deflate .ne. 1 .or. my_deflate_level .ne. deflate_level) then + ! err_msg = "Wrong values for deflate and shuffle for parallel netcdf-4 file" + ! call PIO_closefile(pio_file) + ! return + ! end if + ! end if else if ((iotype .eq. PIO_iotype_pnetcdf .or. iotype .eq. PIO_iotype_netcdf) .and. ret_val .eq. PIO_NOERR) then err_msg = "Did not get expected error when trying to check deflate for non-netcdf-4 file" call PIO_closefile(pio_file) @@ -548,10 +564,10 @@ Subroutine test_nc4(test_id, err_msg) err_msg = "Did not get expected error when trying to turn deflate on for netcdf classic file" call PIO_closefile(pio_file) return - else if (iotype .eq. PIO_iotype_netcdf4p .and. ret_val .ne. PIO_NOERR) then - err_msg = "Could not turn on compression for variable foo2222 second time" - call PIO_closefile(pio_file) - return + else if (iotype .eq. PIO_iotype_netcdf4p) then +! err_msg = "Could not turn on compression for variable foo2222 second time" +! call PIO_closefile(pio_file) +! return end if ! Leave define mode @@ -584,17 +600,17 @@ Subroutine test_nc4(test_id, err_msg) call PIO_closefile(pio_file) return else if (iotype .eq. PIO_iotype_netcdf4p) then - if (ret_val .ne. PIO_NOERR) then - err_msg = "Got error trying to inquire about deflate on for parallel netcdf-4 file" - call PIO_closefile(pio_file) - return - else - if (shuffle .ne. 0 .or. deflate .ne. 1 .or. my_deflate_level .ne. deflate_level_2) then - err_msg = "Wrong values for deflate and shuffle for parallel netcdf-4 file" - call PIO_closefile(pio_file) - return - end if - end if + ! if (ret_val .ne. PIO_NOERR) then + ! err_msg = "Got error trying to inquire about deflate on for parallel netcdf-4 file" + ! call PIO_closefile(pio_file) + ! return + ! else + ! if (shuffle .ne. 0 .or. deflate .ne. 1 .or. my_deflate_level .ne. deflate_level_2) then + ! err_msg = "Wrong values for deflate and shuffle for parallel netcdf-4 file" + ! call PIO_closefile(pio_file) + ! return + ! end if + ! end if end if ! Write foo2