Known Problems with the netCDF 3.3.1 Distribution
This is where we document some reported problems with the current release (netCDF
version 3.3.1) and their workarounds. Reported problems and workarounds are also
available for some previous releases: version
3.3, version 2.4.3, and version 2.4.2.
Problem with IRIX 6 and NFS
When building on IRIX 6.x, with a NFS mounted build directory,
you may have problems with 'make test' in the libsrc directory.
You may also have problems later on using netcdf on IRIX 6.x
with NFS mounted directories. Here is a patch to src/libsrc/posixio.c
to fix the problem.
Thanks to Ethan Alpert for reporting this.
Problem using gcc under SunOS 4
Depending on how gcc is installed on a SunOS 4.1.x platfrom, it may be necessary
to use the compiler flag -D__USE_FIXED_PROTOTYPES__ when building netCDF,
to make sure gcc sees the prototype for the strtod() function when building ncgen.
If your gcc needs this flag but doesn't set it, then when "make test"
tries to test the ncdump utility, it will invoke an incorrectly built ncgen utility
that will create a huge netCDF test file. To test whether your gcc needs to use
this flag, use gcc to compile and run this program.
If running the program indicates you need to use the compiler flag with gcc,
rebuild your netCDF distribution by following these steps:
- Go to the top-level source directory (the directory containing the INSTALL
file).
- Remove the file "config.cache" if it exists.
- Set the environment variable CPPFLAGS to include -D__USE_FIXED_PROTOTYPES__.
- Re-execute the configure script.
- Execute the command "make clean".
- Execute the command "make".
- Execute the command "make test".
- If you are installing the library, utilities, and documents somewhere else,
execute the command "make install".
Thanks to David Aubert for reporting the problem.
Bug in ncgen handling global _FillValue
attribute
If a global attribute named _FillValue is specified using the usual CDL notation:
:_FillValue= -9999.99f ;
ncgen gets a segmentation violation when trying to check whether its type matches
the "type" of the non-existent global psuedo-variable to which global
attributes are attached.
A patch to ncgen/ncgen.y fixes the problem. This
fix will be included in the next minor release. Thanks to John Caron for reporting
the problem.
Bug in ncgen handling of multidimensional
character variables
An undocumented feature of ncgen in netCDF-2 was that null padding was added to
strings that were shorter than the last dimension of a multidimensional character
variable, instead of just concatenating them. This permitted using strings of
different lengths in an array in CDL, for example:
netcdf bug {
dimensions:
scan = 4 ;
string_len = 10 ;
variables:
char name(scan, string_len) ;
data:
name =
"Methane",
"Ammonia",
"Water",
"Acetylene" ;
}
In versions 3.3 and 3.3.1, unfortunately this feature no longer works. Instead
the strings are just concatenated, as they would be with a 1-dimensional variable.
For example, when the above CDL file is converted to a netCDF file using the "-b"
option to ncgen, running ncdump on the result produces:
netcdf bug {
dimensions:
scan = 4 ;
string_len = 10 ;
variables:
char name(scan, string_len) ;
data:
name =
"MethaneAmm",
"oniaWaterA",
"cetylene",
"" ;
}
instead of the original CDL.
A patch to files in ncgen/ fixes the problem. This
fix will be included in the next minor release.
Memory leak in the C++ interface
Mike Romberg has reported and provided a fix for a memory leak in the netcdf C++
library. All of the NcTypedComponent::as_*() functions were getting a
pointer to a new NcValues but not deleting it. It turns out this problem was also
reported by Tomas Johannesson in 1995.
A patch to cxx/netcdf.cc fixes the problem. This
fix will be included in the next minor release.
Use of nclong in the C++ interface
The C++ interface in netCDF 3.3.1 still uses the deprecated nclong typedef for
the external type of 32-bit integers. There are now updates to the C++ interface
so that the deprecated nclong typedef should no longer be required and casts to
nclong no longer necessary.
A patch fixes the problem. This patch also includes
the fix to the memory leak in the C++ interface described above as well as documentation
revisions. This fix will be included in the next release.
Fixed INSTALL instructions for
IRIX configurations
Several of the settings for IRIX systems under the "TESTED SYSTEMS"
section in the INSTALL document were missing quotes and contained some unnecessary
flags.
A corrected version of the INSTALL document is available.
Thanks to Matt Banta for reporting the problem.
Version 2 Fortran error codes
not backward compatible
The error codes returned by the version 2 Fortran interface of the netCDF 3.3.1
package are not backward compatible with the symbolic constants of version 2.
This means that a Fortran program written to the netCDF version 2 API might not
interpret errors correctly. For example, the following code
call NCPOPT(0)
ncid = NCOPN('not_a_netcdf_file.nc', 0, ierr)! wrong format file
if (ncid .eq. -1 .and. ierr .eq. NCENOTNC)
...
will not work as expected because the value for ierr will not be NCENOTNC.
The solution is to apply this patch to the
netCDF-3 file fortran/netcdf.inc and then rebuild and reinstall the
netCDF-3 distribution. This bug will be fixed in the next release. Thanks to
Mark Borges for reporting the problem.