Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Problem finding the dimension name

> <This is like  a loop.. My question is how do i find out
> <the name of a dimension if i dont know its dimid..
> 
> The source code for the ncdump program may be informative.

Yes, and it's in the netCDF User's Guide as well, though perhaps not where
one would expect to find it.  In section 4.3, "Reading a netCDF File with
Unknown Names":

     Dimension IDs are assigned by using consecutive integers (beginning
  at 0 in C, 1 in FORTRAN).  Also dimensions, once created, cannot be
  deleted.  Therefore, knowing the number of dimension IDs in a netCDF
  means knowing all the dimension IDs: they are the integers 0, 1, 2,
  ..., (or 1, 2, 3, ... in FORTRAN).  For each dimension ID, a call to
  the inquire function `ncdiminq' (or `NCDINQ') returns the dimension
  name and size.

--Russ


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690