Re: latitude/height grid

Florian Wobbe <[email protected]> Wed, 23 Apr 2014 13:34:23 +0200
Newsgroups gmane.comp.gis.gmt.user
Message-ID <[email protected]>
I don't think Russ fixed the issue yet (https://bugtracking.unidata.ucar.edu/browse/NCF-187). Meanwhile, can somebody test if the workaround mentioned in NCF-133 works with the minimal example from (NCF-187)?

> I have not been able to track this down, but apparently in NetCDF4 it is not supposed to be possible to change the _FillValue.
> This gives a work-around: https://bugtracking.unidata.ucar.edu/browse/NCF-133

According to NCF-133 _FillValue is not supposed to be editable. However, it worked flawlessly with netCDF-3 (NCF-187). Anyway the segfault is a bug and the documentation doesn't state _FillValue is readonly.

> We should incorporate a fix for this, because either:
> 1) Changing _FillValue is truly not allowed and we try to do so.
> 2) There is a bug preventing changing _FillValue and we need to be able to do so.
> Either way we should include a work-around.

We have a fix currently in place to avoid the segfault. However, this means that _FillValue cannot be altered in netCDF-4 grids. This is usually not a problem. If changing _FillValue is required then either use grdreformat to write a new copy or edit a netCDF-3 grid.

I'd rather wait for the upstream fix of NCF-187 than implement a more complicated workaround. Let us change the warning message to:

Warning: cannot modify _FillValue attribute in netCDF-4 file %s due to a bug in netCDF (https://bugtracking.unidata.ucar.edu/browse/NCF-187).


To avoid confusion, maybe issue the warning only when the user tried to change _FillValue but not when the value is untouched.

Florian

> Eduardo, please enter a bug report for this on gmtrac.soest.hawaii.edu
> 
> Cheers,
> Remko
> 
> On 23 Apr 2014, at 12:25, Joaquim Luis <[email protected]> wrote:
> 
>> On 23-04-2014 07:14, Eduardo A. Suárez wrote:
>> 
>>> Second problem, grdedit says:
>>> 
>>> grdedit: Warning: netCDF libraries < 4.3 cannot alter the _FillValue attribute in netCDF-4 files.
>>> 
>>> But gmt (5.1.2_r13078) is linked against netcdf-4.3.0!
>>> 
>>> Eduardo.-
>>> 
>> 
>> Eduardo, I agree that this message is now misleading but the point is that last time I checked (a bit pre netcdf 4.3 release) the bug that prevented changing the _FillValue was still very much alive.
>> I think it was this one that is closed now, but we must verify.
>> 
>> https://bugtracking.unidata.ucar.edu/browse/NCF-186
>> 
>> Joaquim

To unsubscribe, send the message "signoff gmt-help" to [email protected]