[netcdfgroup] nf90_def_var, deflate requires shuffle?

Hello,
I was recently trying to create a compressed variable through the F90 
interface.  However, nf90_def_var requires  the shuffle option be present 
before applying the deflate filter.  Is this expected?  The documentation 
doesn't mention this:
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90/NF90_005fDEF_005fVAR.html

Taking a peek into the source code, netcdf4_variables.f90 includes the 
following block in various places:
! Handle deflate and shuffle.
if (present(deflate_level)) then
  if (deflate_level .gt. 0) then
    if (present(shuffle)) then
      if (shuffle) then
        nf90_def_var_ManyDims = nf_def_var_deflate(ncid, varid, 1, 1, 
deflate_level)
       else
         nf90_def_var_ManyDims = nf_def_var_deflate(ncid, varid, 0, 1, 
deflate_level)
      end if
    end if
  end if
endif

Maybe it should be something like:
! Handle deflate and shuffle.
if (present(deflate_level)) then
  if (deflate_level .gt. 0) then
    if (present(shuffle)) then
      if (shuffle) then
        nf90_def_var_ManyDims = nf_def_var_deflate(ncid, varid, 1, 1, 
deflate_level)
       else
         nf90_def_var_ManyDims = nf_def_var_deflate(ncid, varid, 0, 1, 
deflate_level)
      end if
    else
      nf90_def_var_ManyDims = nf_def_var_deflate(ncid, varid, 0, 1, 
deflate_level)
    end if
  end if
end if

Regards,
-Corey



  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: