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

[netCDF #NRE-269426]: ncdump -x with netCDF4 files

Hi Meg,

> I've installed netcdf-4.1.1 on an older virtual machine and have tested it 
> against various netcdf4 files.  In my testing, it does not give an explicit 
> error, but it does not generate any useful NcML.  In later versions, the 
> explicit error message was added.  It seems to me that you will not be able 
> to generate NcML with the C libraries/executable.

Ward is right that "ncdump -x" from version 4.1.1 doesn't work for any
netCDF-4 files that use features of the enhanced data model, such as
unsigned types, groups, strings, or user-defined types.  However, it
does provide what looks like useful NcML output for netCDF-4 classic
model files, which use the netCDF-4/HDF5 format but only features from
the classic netCDF-3 data model.  The netCDF-4.3.2 version of ncdump
likewise works to provide NcML output for netCDF-4 classic model files
when the "-x" option is used.  You can check whether a file is
netCDF-4 format or netCDF-4 classic model format using "ncdump -k" on
the file.

Ward is also right that netCDF-Java provides a Java ncdump that works
to provide NcML output even for netCDF-4 files that use the netCDF-4 
enhanced data model, which the C version of the utility can't yet handle.


> I've done a bit of digging, and it appears that you might be able to use the 
> netcdf-java library to generate NcML for netcdf4 files, however.  Most of the 
> netcdf-java developers are out of the office for the upcoming Christmas 
> holiday, but I've done some testing by hand and it appears to work on my test 
> files.
> After downloading the 'netcdfAll-4.5.jar' file from 
> http://www.unidata.ucar.edu/downloads/netcdf/index.jsp, I followed the 
> instructions found at 
> http://www.unidata.ucar.edu/software/thredds/current/netcdf-java/reference/manPages.html#ncdump,
>  e.g.
> $ java -Xmx1g -classpath netcdfAll-4.5.jar ucar.nc2.NCdump 
> $HOME/Desktop/ncfiles/netcdf4_test.nc -ncml
> Perhaps this solution would work for you? I wish I could say with more 
> confidence that netcdf4 support was implemented completely, but it should be 
> fairly easy to test.
> I hope this helps,
> -Ward
> > Hello,
> >
> > We've encountered a strange situation where someone with ncdump version
> > 4.1.1 is able to run ncdump with the -x flag on netCDF4s, whereas those of
> > us with later versions (4.3.2) cannot. My understanding was the NCML
> > extraction feature had never been implemented for netCDF4, but apparently
> > this is incorrect. Can you let me know what the status is? If possible,
> > we'd like to run ncdump -x on netCDF4s.
> >
> > Thanks,
> >
> > Meg Tilton
> >
> > --
> > Margaret Tilton
> > Cooperative Institute for Research in Environmental Sciences (CIRES) at
> > University of Colorado at Boulder and
> > NOAA National Geophysical Data Center, Solar and Terrestrial Physics
> > Division
> > 325 Broadway, E/GC2
> > Boulder, Colorado 80305
> > 303-497-6223
> >
> >

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

Ticket Details
Ticket ID: NRE-269426
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.