netcdf-c icon indicating copy to clipboard operation
netcdf-c copied to clipboard

nc_inq_var_fill does not work NETCDF3 (64BIT or CLASSIC)

Open jswhit opened this issue 8 years ago • 10 comments

Although filling can be turned on and off using nc_set_fill, nc_inq_var_fill always returns no_fill=1 for NETCDF3 formatted files. There needs to be a way of determining whether filling is enabled for NETCDF3 files.

jswhit avatar Oct 13 '17 17:10 jswhit

Just to clarify, does nc_inq_var_fill() still return no_fill=1 for you after turning it off via nc_set_fill()? I’ll look at this.

WardF avatar Oct 13 '17 23:10 WardF

Yes, that's right @WardF. The docs also say nc_inq_var_fill only works with NETCDF4 files.

jswhit avatar Oct 14 '17 02:10 jswhit

Interesting historical artifact. Not sure why it is the way it is but there must be a reason? I will investigate.

WardF avatar Oct 14 '17 19:10 WardF

Try asking Ed Hartnett

DennisHeimbigner avatar Oct 14 '17 22:10 DennisHeimbigner

Per variable fill mode setting and inquiring APIs were originally added for NetCDF-4 files only. Pull request #383 was created to extend these APIs for classic formats.

wkliao avatar Oct 15 '17 20:10 wkliao

From The Tao of Programming

5.4

Does a good farmer neglect a crop he has planted? Does a good teacher overlook even the most humble student? Does a good father allow a single child to starve? Does a good programmer refuse to maintain his code?

On Sun, Oct 15, 2017 at 2:43 PM, Wei-keng Liao [email protected] wrote:

Per variable fill mode setting and inquiring APIs were originally added for NetCDF-4 files only. Pull request #383 https://github.com/Unidata/netcdf-c/pull/383 was created to extend these APIs for classic formats.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Unidata/netcdf-c/issues/499#issuecomment-336740107, or mute the thread https://github.com/notifications/unsubscribe-auth/AEUr3Oh8Aef8rzz6uR9MyOiAU637vuinks5ssm5jgaJpZM4P41s4 .

edhartnett avatar Oct 15 '17 21:10 edhartnett

To answer more seriously, I don't remember any good reason why nc_inq_var_fill() and nc_set_fill() only worked for netCDF-4.

It seems obvious to me now (as a heavy user of netCDF) that these functions should work for all binary formats, and I am very happy to see that there is a PR to achieve that. Thanks to Wei-keng Liao for this fix.

Even the great Homer nods.

Thanks, Ed Hartnett

On Sun, Oct 15, 2017 at 3:23 PM, Ed Hartnett [email protected] wrote:

From The Tao of Programming

5.4

Does a good farmer neglect a crop he has planted? Does a good teacher overlook even the most humble student? Does a good father allow a single child to starve? Does a good programmer refuse to maintain his code?

On Sun, Oct 15, 2017 at 2:43 PM, Wei-keng Liao [email protected] wrote:

Per variable fill mode setting and inquiring APIs were originally added for NetCDF-4 files only. Pull request #383 https://github.com/Unidata/netcdf-c/pull/383 was created to extend these APIs for classic formats.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Unidata/netcdf-c/issues/499#issuecomment-336740107, or mute the thread https://github.com/notifications/unsubscribe-auth/AEUr3Oh8Aef8rzz6uR9MyOiAU637vuinks5ssm5jgaJpZM4P41s4 .

edhartnett avatar Oct 16 '17 00:10 edhartnett

#383 will be reviewed pretty quickly once the 4.5.0 release is out. Recognizing I won't get every feature and issue addressed, 4.5.0 has languished long enough. I'm working on getting it out now!

WardF avatar Oct 16 '17 15:10 WardF

I am encountering this problem now.

edhartnett avatar Dec 20 '17 14:12 edhartnett

THis was fixed and this issue can be closed.

captainkirk99 avatar Dec 06 '25 16:12 captainkirk99