Closed karlmsmith closed 6 years ago
Comment by @AnsleyManke on 11 Oct 2006 19:04 UTC This occurs also on our linux systems, so I can work on it here and track down what's happening
Comment by @AnsleyManke on 11 Oct 2006 20:11 UTC This seems to be an interaction with this particular file and perhaps this version of the netcdf/DODS library (does it happen with both the Altix netcdf and DODS executables?)
For some reason, the netcdf library routine nc_inq_att called by Ferret, is returning an incorrect string length for the units attribute of the variable zt. Its units are "m" but the nc call returns a string length of 128.
The buffers used to convert C strings to Fortran strings are not blanked out between calls, and so variable ZT gets this wierd string for its units "m: \unitsSINCEsinceyyyymmddhhmmss -4713DAY" which is resulting in the parsing error in the code that follows.
For robustness, Ferret can check the actual length of the attribute string after it's read from the netcdf file, and reset the attribute length to that length. (NCF_Util.c, routine ncf_add_dset). Also initialize hollerith buffers in tm_ftoc_strng.F and tm_ctof_strng.F
Comment by remik.ziemlinski on 11 Oct 2006 20:39 UTC This error has been confirmed with GFDL's IA64 DODS and CDF2 builds of Ferret 6.00.
Comment by @AnsleyManke on 16 Oct 2006 18:22 UTC This may be something nonstandard in the file, but a workaround is to compare the actual length of the attribute string after it's read, against the value of the returned value of "attlen", and if the string that has been is shorter than "attlen" use the actual length instead. This is in NC_Util.c, routine ncf_add_dset
Attachment from remik.ziemlinski on 11 Oct 2006 18:40 UTC Opening this file results in the errors. bug.nc.zip
Reported by remik.ziemlinski on 11 Oct 2006 18:38 UTC Ferret 6.00 on IA64 has trouble parsing netcdf attributes, which previously worked on IRIX 6.5 with FERRET v5.70.
To reproduce the problem at GFDL:
Migrated-From: http://dunkel.pmel.noaa.gov/trac/ferret/ticket/1455