This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Marica, > I'm using the c++ interface of the nectdf-4.1.1 library to read/write > netCDF-4 files and I've found that the call to the constructor of the > NcFile class causes a segmentation fault with the combination of arguments > <FileMode = ReadOnly, FileFormat = netCDF-4>. Yet, if I use the default > "Classic" the program works fine (note that the file I'm trying to read > was created using FileFormat = netCDF-4). Where is the problem? Am I > misusing the interface or is there a bug? The default c++ interface provided with version 4.1.1 only supports the older "classic" data model used in netCDF-3, not the "enhanced" data model used with netCDF-4. There is an experimental contributed C++ library for netCDF-4 that's included with netCDF-4.1.1, but to build and test it, you have to specify --enable-cxx-4 to the configure script. The documentation available for this new netCDF-4 C++ interface is available here: http://www.unidata.ucar.edu/software/netcdf/docs/cxx4/ I thought we had a pointer to this on our documentation page, but it seems to have disappeared. I'll see if I can get that added. We should be announcing this new C++ API, contributed by Lynton Appel of the Culham Centre for Fusion Energy (CCFE) in Oxfordshire, soon. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: QVU-411184 Department: Support netCDF Priority: Normal Status: Closed