2007 Unidata NetCDF Workshop for Developers and Data Providers > NetCDF Utilities
4.1 ncgen
The ncgen utility can generate a netCDF file, a C program, or a
Fortran program from a human-readable (and editable) CDL file.
The ncgen utility can do the following with CDL input:
- Reverse what ncdump does, converting CDL to
binary netCDF
- Generate a C or Fortran program that, when compiled and run, will create a
netCDF file corresponding to the CDL
You can use ncdump and ncgen
together for some simple netCDF editing:
- Use ncdump to convert netCDF file to CDL
- Use a text editor to change CDL (for example add, fix, or delete
metadata or data)
- Use ncgen to turn modified CDL back into
modified netCDF file
- This is not very practical for large netCDF files
The Java tool toolsUI available with the netCDF
Java package can similarly be used to convert back and forth between
netCDF data and editable NcML.
2007 Unidata NetCDF Workshop for Developers and Data Providers > NetCDF Utilities