need to id netcdf files

Jim Edwards jedwards at ucar.edu
Tue Feb 2 11:17:01 CST 2010


Hi Russ,


Maybe I can distill the essence of this function since my goal is to use it
before I call the netcdf open function.


I think that 64-bit-offset is the pnetcdf format that I was referring to.

Thanks for the hint about hdf5 files.


- Jim


On Tue, Feb 2, 2010 at 9:58 AM, Russ Rew <russ at unidata.ucar.edu> wrote:

> Jim,
>
> > I am in need of a function that can identify a file as netcdf3, netcdf4,
> or
> > pnetcdf 64-bit.
> > Preferably I would like this function to work without having linked any
> of
> > the mentioned netcdf libraries.
> >
> > Does anyone have or know of one?
>
> Although it doesn't match your preference for independence from netCDF
> libraries, the nc_inq_format() function documented here:
>
>
> http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c.html#nc_005finq-Family
>
> distinguishes among the 4 netCDF format variants:
>
>  http://www.unidata.ucar.edu/software/netcdf/docs/faq.html#fv1
>
> in the netCDF-4 library or between classic and 64-bit-offset formats in
> a netCDF-3 library.  It doesn't recognize the pnetcdf 64-bit variant.
>
> By the way, an HDF5 file can't necessarily be distinguished by its first
> 4 bytes, because HDF5 files may begin with a "user-block" of size 512,
> 1024, 2048, ... bytes, before the 4-byte file-type signature.
>
> --Russ
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/parallel-netcdf/attachments/20100202/2ce49d78/attachment.htm>


More information about the parallel-netcdf mailing list