This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Tony, > I'm searching for a C program that gathers information about netCDF4 > files. This C program knows nothing about the particular netCDF4 file > it's reading and therefore must make inquiries to the file to find out > the number of groups/sub-groups, dimensions, variables, attributes it > contains, the names of all the above, the variable shapes, etc. My > question: Does such a C program exist? Can you tell me where I can > download it? If it does not exist I will take a crack at writing one. > I've been searching online but so far haven't found anything. The two utilities "ncdump" and "nccopy" both gather all that information. "ncdump -h" outputs just the metadata information in CDL, a small language for representing netCDF data in text form. If you have netCDF installed, the ncdump man page shows all the options. The nccopy utility makes a copy of a netCDF-4 file using only the netCDF-4 API, so it also has to inquire about everything. It might be easiest to modify nccopy source to just report what you want. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: HGQ-329307 Department: Support netCDF Priority: Normal Status: Closed