GMT4.5.18 Netcdf I/O gives nans

Added by Thorsten 5 months ago


I had to recompile GMT4 (4.5.18) on my Fedora 28 Linux box and all Netcdf grd file operations ceased to function.
I have tried my own netcdf libraries with version 3.6.* and 4.* and the defaults that come with Fedora, and I have also reproduced the problem on Fedora 29.

If I use GMT5, my netcdf files read just fine (actual values). If I use GMT4, I get

GMT Warning: scale_factor should not be 0.

and then all values are -nan. It seems that similar problems arose in parts of the code, where in a few instances the scale factor is checked for being zero, and then set to unity.
I've added another such check and was able to resurrect grdinfo, but grd2xyz is still all -nan, and xyz2grd gives me

NetCDF: Numeric conversion not representable

so, I wonder if there's some NetCDF I/O problem in general.

Any help would be much appreciated.



Thanks much!


Replies (1)

RE: GMT4.5.18 Netcdf I/O gives nans - Added by Paul 5 months ago

The netcdf library introduced a bad bug in 4.6.2 that was fixed in 4.6.3. Perhaps your distro has 4.6.2?
I just compiled GMT4 with the latest netcdf and I don't see any errors. I can read files prepared with GMT5 and I can create new files, e.g., with grdmath and all is well.
If you still ahve problems then we need to know more, including examples demonstrating failure. But I suspect your netcdf lib.

Also note that we recommend posting issues on our GitHub site (see front page on this wiki).