@@ -258,8 +258,6 @@ nc_inq_varnatts(int ncid, int varid, int *nattsp)
258258/** \ingroup variables
259259Learn the storage and deflate settings for a variable.
260260
261- This is a wrapper for nc_inq_var_all().
262-
263261\param ncid NetCDF or group ID, from a previous call to nc_open(),
264262nc_create(), nc_def_grp(), or associated inquiry functions such as
265263nc_inq_ncid().
@@ -274,12 +272,15 @@ function will write a 1 if the deflate filter is turned on for this
274272variable, and a 0 otherwise. \ref ignored_if_null.
275273
276274\param deflate_levelp If the deflate filter is in use for this
277- variable, the deflate_level will be written here. \ref ignored_if_null.
275+ variable, the deflate_level will be written here. If deflate is not in
276+ use, and deflate_levelp is provided, it will get a zero. (This
277+ behavior is expected by the Fortran APIs). \ref ignored_if_null.
278278
279279\returns ::NC_NOERR No error.
280280\returns ::NC_ENOTNC4 Not a netCDF-4 file.
281281\returns ::NC_EBADID Bad ncid.
282282\returns ::NC_ENOTVAR Invalid variable ID.
283+ \author Ed Hartnett, Dennis Heimbigner
283284*/
284285int
285286nc_inq_var_deflate (int ncid , int varid , int * shufflep , int * deflatep , int * deflate_levelp )
@@ -306,10 +307,11 @@ nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, int *defla
306307 return NC_EFILTER ; /* bad # params */
307308 /* Param[0] should be level */
308309 if (deflate_levelp ) * deflate_levelp = (int )params [0 ];
309- }
310- /* also get the shuffle state */
311- if (!shufflep )
312- return NC_NOERR ;
310+ } else if (deflate_levelp )
311+ * deflate_levelp = 0 ;
312+ /* also get the shuffle state */
313+ if (!shufflep )
314+ return NC_NOERR ;
313315 return ncp -> dispatch -> inq_var_all (
314316 ncid , varid ,
315317 NULL , /*name*/
0 commit comments