Patch for netcdf-3.4/src/cxx ================================== To apply, invoke the following command from the netcdf-3.4/src/cxx directory, where you should replace PATCHFILE by the name for this file: patch < PATCHFILE Then rebuild with "make all". Test with "make test". Install with "make install". Index: netcdf.cc =================================================================== RCS file: /upc/share/CVS/netcdf-3/cxx/netcdf.cc,v retrieving revision 1.8 diff -c -r1.8 netcdf.cc *** 1.8 1998/01/16 19:48:26 --- netcdf.cc 1998/03/23 23:25:13 *************** *** 297,321 **** return the_id; } ! NcFile::NcFile( const char * path, FileMode fmode ) { NcError err(NcError::silent_nonfatal); // constructor must not fail int mode = NC_NOWRITE; switch (fmode) { case Write: mode = NC_WRITE; /*FALLTHRU*/ case ReadOnly: ! the_id = ncopen(path, mode); in_define_mode = 0; break; case New: mode = NC_NOCLOBBER; /*FALLTHRU*/ case Replace: ! the_id = nccreate(path, mode); in_define_mode = 1; break; default: --- 297,336 ---- return the_id; } ! NcFile::NcFile( const char * path, FileMode fmode, ! size_t *chunksizeptr, size_t initialsize ) { NcError err(NcError::silent_nonfatal); // constructor must not fail int mode = NC_NOWRITE; + int status; switch (fmode) { case Write: mode = NC_WRITE; /*FALLTHRU*/ case ReadOnly: ! // use netcdf-3 interface to permit specifying tuning parameter ! status = nc__open(path, mode, chunksizeptr, &the_id); ! if(status != NC_NOERR) ! { ! nc_advise("ncopen", status, "filename \"%s\"", path); ! the_id = -1; ! } in_define_mode = 0; break; case New: mode = NC_NOCLOBBER; /*FALLTHRU*/ case Replace: ! // use netcdf-3 interface to permit specifying tuning parameters ! status = nc__create(path, mode, initialsize, ! chunksizeptr, &the_id); ! if(status != NC_NOERR) ! { ! nc_advise("nccreate", status, "filename \"%s\"", path); ! the_id = -1; ! } in_define_mode = 1; break; default: Index: netcdf.hh =================================================================== RCS file: /upc/share/CVS/netcdf-3/cxx/netcdf.hh,v retrieving revision 1.6 diff -c -r1.6 netcdf.hh *** 1.6 1997/11/19 20:33:31 --- netcdf.hh 1998/03/23 22:50:10 *************** *** 41,47 **** New // create new file, fail if already exists }; ! NcFile( const char * path, FileMode = ReadOnly ); NcBool is_valid( void ) const; // opened OK in ctr, still valid --- 41,49 ---- New // create new file, fail if already exists }; ! NcFile( const char * path, FileMode = ReadOnly , ! size_t *chunksizeptr = NULL, // optional tuning parameters ! size_t initialsize = 0 ); NcBool is_valid( void ) const; // opened OK in ctr, still valid *************** *** 151,157 **** virtual ~NcDim( void ); // to construct dimensions, since constructor is private ! friend NcFile::NcFile( const char *, NcFile::FileMode ); friend NcBool NcFile::sync( void ); friend NcDim* NcFile::add_dim( NcToken, long ); // to delete dimensions, since destructor is private --- 153,160 ---- virtual ~NcDim( void ); // to construct dimensions, since constructor is private ! friend NcFile::NcFile( const char *, NcFile::FileMode, size_t* = NULL, ! size_t = 0 ); friend NcBool NcFile::sync( void ); friend NcDim* NcFile::add_dim( NcToken, long ); // to delete dimensions, since destructor is private *************** *** 358,364 **** void init_cur( void ); // to make variables, since constructor is private ! friend NcFile::NcFile( const char *, NcFile::FileMode ); friend NcBool NcFile::sync( void ); friend NcVar* NcFile::add_var( NcToken varname, NcType type, const NcDim*, --- 361,368 ---- void init_cur( void ); // to make variables, since constructor is private ! friend NcFile::NcFile( const char *, NcFile::FileMode, ! size_t* = NULL, size_t = 0); friend NcBool NcFile::sync( void ); friend NcVar* NcFile::add_var( NcToken varname, NcType type, const NcDim*, *************** *** 398,404 **** NcAtt( NcFile*, NcToken); // global attribute // To make attributes, since constructor is private ! friend NcFile::NcFile( const char *, NcFile::FileMode ); friend NcAtt* NcVar::get_att( NcToken ) const; }; --- 402,409 ---- NcAtt( NcFile*, NcToken); // global attribute // To make attributes, since constructor is private ! friend NcFile::NcFile( const char *, NcFile::FileMode, ! size_t* = NULL, size_t = 0); friend NcAtt* NcVar::get_att( NcToken ) const; };