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 Tom, > We're writing some test code and we noticed that a call to > NcVar::rename() gave us an error, stating that the file was not in > define mode. After a careful examination of the code, we discovered > that NcVar::rename() does not call define_mode(), like > NcFile::add_var(), for example. Yes, we had discovered this and made the change for netCDF 2.4 also. But thanks for reporting the problem. > By the way, any word on an "official" release of the C++ interface to > netCDF? I'm working hard to have a beta release of netCDF 2.4, with changes to the C++ interface, ready by the end of this week or next. There are a number of other changes to the netCDF C++ interface that I should warn you about. Rather than explaining them all now, I've appended a log of descriptions of recent changes, and would be happy to discuss any you're wondering about. I hope you guys will grab the beta release and let me know about any problems or serious backward incompatibilities that we can fix before the final release. --Russ ============================================================================= RCS file: /upc/share/CVS/netcdf/c++/netcdf.cc,v Working file: netcdf.cc head: 1.62 ... ---------------------------- revision 1.62 date: 1995/09/27 22:40:51; author: russ; state: Exp; lines: +108 -6 Changed as_long() members to as_nclong(). Got rid of more int and int* overloading in ncvalues, to discourage nonportable use of int constants to dteremine types for netCDF variables and attributes. For the same reason, got rid of ncInt type enum. Ported to HPUX C++ compiler by copying name2 macro from generic.h and giving it a different name for nested invocations. Added Dan Schmitt's rec_size, set_rec, put_rec, get_rec, and get_index member functions. ---------------------------- revision 1.61 date: 1995/09/18 22:25:11; author: russ; state: Exp; lines: +1 -18 nctst.cc: Changed attribute value from "1" to "1L". Can't use int constants for attributes with implied types anymore, because of ambiguity (nclong is long on some platforms, int on others). Compiler would have to decide among char, short, nclong from constant value. netcdf.hh: Removed member functions add_att, put, and get member functions that have int values or int* pointers to arrays of int values in their signatures, because these are the same as corresponding nclong functions on 64-bit platforms. The ambiguity of whether int means short or long must be resolved by declaration. netcdf.cc: Removed member functions add_att, put, and get member functions that have int values or int* pointers to arrays of int values in their signatures, because these are the same as corresponding nclong functions on 64-bit platforms. The ambiguity of whether int means short or long must be resolved by declaration. Removed auxiliary functions NcFile_add_scalar_att, NcFile_add_vector_att, NcVar_put_array, NcVar_put_nd_array, NcVar_get_array, NcVar_get_nd_array for the same reason. ---------------------------- revision 1.60 date: 1995/09/18 21:21:09; author: russ; state: Exp; lines: +10 -10 First try at long to nclong changes for Alpha platform. netcdf.hh: Changed "long" to "nclong" in add_att(), put(), get() member functions. netcdf.cc: Changed "long" to "nclong" in add_scalar_att(), add_vector_att(), NcVar_put_array(), NcVar_put_nd_array(), NcVar_get_array(), NcVar_get_nd_array(), NcVar_add_scalar_att(), and NcVar_add_vector_att(), put(), and get() member functions. Use NcValues_nclong() instead of NcValues_long() ncvalues.hh: Added constant ncBad_nclong and declared an NcValues_nclong class. ncvalues.cc Added implementation of NcValues_nclong class conversions from nclong type to other basic types. ---------------------------- revision 1.59 date: 1995/09/15 20:13:36; author: russ; state: Exp; lines: +5 -3 Pulled int i declaration out of some for-loop headers, to work with new standard scoping rules for loop indices. ---------------------------- revision 1.58 date: 1995/09/14 16:46:07; author: russ; state: Exp; lines: +25 -24 Eliminate NcOldFile and NcNewFile classes. Just use NcFile class, with new mode parameter in the constructor to specify whetehr file exists or not, and how it should be opened. NcOldFile and NcNewFile macros defined as NcFile for backward compatibility. ---------------------------- revision 1.57 date: 1995/08/23 22:44:34; author: russ; state: Exp; lines: +5 -5 Moved return(1) in NcFile::sync(), to be after dimension and variable sync loops. Added comments about why we are doing this. ---------------------------- revision 1.56 date: 1995/08/21 15:07:13; author: russ; state: Exp; lines: +66 -16 Added sync() member function to NcDim and NcVar, used to fix a memory leak in NcFile::sync(). If a dimension or variable has been renamed (perhaps by another process) on disk, invoking the approriate sync() function synchronizes the object name to the on-disk name. NcVar::sync() also re-initializes the variable cursor. Added a parameter to get_space(). ---------------------------- revision 1.55 date: 1995/07/31 15:01:51; author: russ; state: Exp; lines: +3 -2 Moved counter declaration out of for loop. ---------------------------- revision 1.54 date: 1995/07/31 14:59:58; author: russ; state: Exp; lines: +6 -3 Moved counter declaration out of for loop. ---------------------------- revision 1.53 date: 1995/07/31 14:54:47; author: russ; state: Exp; lines: +4 -2 Moved declaration of i out of for loop. ---------------------------- revision 1.52 date: 1995/07/20 15:11:56; author: russ; state: Exp; lines: +14 -2 In rename member functions, check whether file needs to be in define mode, and if so, attempt to put it in define mode before calling C rename function. ---------------------------- revision 1.51 date: 1995/04/12 19:30:45; author: russ; state: Exp; lines: +9 -3 Changed Makefile LIBS order to look in current directory first. Fixed scope of Clobber constant in example.cc. Fixed a memory leak in netcdf.cc. ---------------------------- ...