[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #GPR-287619]: netcdf_c++ bug in 4.1.3?



Phil,

> On Tue, 27 Dec 2011, Unidata netCDF Support wrote:
> 
> > The C++ library version in 4.1.3, from the cxx directory, was intended for
> > netCDF classic format files. Are you actually using the experimental cxx4
> > library from the cxx4 directory?
> 
> The library was built (not by me!) using the --enable-netcdf-4 flag to
> configure. The installation note toward the bottom of
> 
> http://www.unidata.ucar.edu/software/netcdf/docs/cxx4/
> 
> is a bit cryptic, as the text says it is necessary to use the
> --enable-netcdf-4 flag in configuring but the following example uses
> --enable-cxx-4. Are these equivalent?

No, --enable-netcdf-4 builds libraries that understand additional formats
and have additional functions in the C or Fortran API, enabled by using
the HDF5 library as a storage layer to support an enhanced data model.
You may find this FAQ answer clarifies the relationships among the data
formats, models, and APIs:

  http://www.unidata.ucar.edu/netcdf/docs/faq.html#formats-and-versions

The --enable-cxx-4 flag requires the enable-netcdf-4 flag, but specifies
that a new version of the old C++ API should be built and tested.  This
new version supports most of the the netCDF-4 enhanced data model and formats.
It is not designed to be backward compatible with the C++ interface, which
was designed before exceptions and templates were even in the C++ standard.

> > So I assume "ncdump -k power_test1.nc" outputs "netCDF-4" for the file 
> > format.
> 
> That's correct.
> 
> > The "1L" type for the bolos:matrix attribute indicates an attribute of
> > type int64 rather than int.  NetCDF-4 files can use 6 primitive types that
> > are not in the netCDF classic data model, including NC_INT64 which has the
> > value 10.
> 
> That's what I assumed it should be from ncdump (I didn't modify the
> netcdf.cpp file, either; this problem just got kind of dumped in my lap).
> I tried replacing it with as_double() - should that have worked?

I don't know, as I'm not familiar with the new cxx4 API yet.

> > From your use of the as_int() method, it looks like you're trying to use the
> > old C++ code for classic format files on a new netCDF-4 format file which is
> > making use of extended types in the netCDF-4 data model.  I'm surprised that
> > the old cxx API can even open a netCDF-4 file; it should just return an
> > unrecognized file type of error when that is attempted.
> 
> > The C++ API we have for netCDF-4 files is in the cxx4 directory and is only
> > built if you use the --enable-cxx-4 flag to configure.  There's a 
> > stand-alone
> > version of the netCDF-4 C++ libraries, separated out from the C software, as
> > announced here:
> >
> >  
> > http://www.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2011/msg00365.html
> >
> > and documented here:
> >
> >  http://www.unidata.ucar.edu/software/netcdf/docs/cxx4/
> 
> What's the difference (if any) between the --enable-cxx-4 and
> --enable-netcdf-4 flags?

I hope that's clear from the explanation above.

--Russ

> > Ticket Details
> > ===================
> > Ticket ID: GPR-287619
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
> 
> 

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: GPR-287619
Department: Support netCDF
Priority: Normal
Status: Closed


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.