Re: Can't exit DEFINE mode in netCDF File [message #68254 is a reply to message #68119] |
Wed, 07 October 2009 11:22   |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article
<1a1cedb2-981d-4b52-af3e-1af44caf7830@x5g2000prf.googlegroups.com>,
"dcleon@gmail.com" <dcleon@gmail.com> wrote:
>> Where is it written, though, that the _FillValue attribute has
>> to be the same data type as the variable it is an attribute of?
>> And why doesn't *that* cause an error, instead of this action at
>> a distance thing?
>
> I've run into this problem several times. I think with the ncdf_
> routines that if the type on any attribute or variable fails to match
> the declared type, that you're going to get an error when you close
> the file. Seems like the ncdf routines should give you the error when
> you define the attribute/variable not down the road when you go to
> close the file. Anyway, the bottom line is check types very carefully
> when writing NetCDF files.
>
> Cheers,
> dave
Well, you learn something new every day (if you're lucky). Or
perhaps unlearn something wrong that you thought you knew.
I always interpreted the NCDF_CONTROL man page to imply that
fill values could not be changed, when it fact it (correctly)
states that the *default* fill values cannot be changed.
Use of the _FillValue attribute is rather well hidden on pages
91 and 133 of the netCDF C-interface documentation
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c.pd f
I thought this usage was restricted to the netCDF utilities (such as
ncgen) and not a property of the API.
Section 6.30 of the docs does say that errors can result when
attempting to convert a fill value from one type to another.
IDL seems to be reporting this in a particularly opaque
manner. (That's a polite euphemism for damned incomprehensible
IDL error message.)
Ken Bowman
|
|
|