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 Sylwester, > In the netcdf_c++4 API the data/define mode switch is not automatic for > netCDF3 files. Consequently, creating and writing "classic" files with > netcdf_c++4 is impossible without reopening, and redefining classic > files is not possible at all. > > I'm sending in attachment a patch (and a modified source tree as well) > that fixes it. Perhaps there's a more elegant way to implement it > (i.e. without calling nc_enddef/nc_redef with each API call) but this > one is quite straightforward and it works well. > > I've introduced two relevant checks into test_classic.cpp as well. Thanks for your patch! Rather than apply it immediately, I've forwarded it to the developer, Lynton Appel. He is preparing some additional enhancements for the next version of netcdf_c++4, and should be able to combine your patch with those changes. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: VYY-644727 Department: Support netCDF Priority: Normal Status: Closed