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.
>From: address@hidden (Jang Kwang Mi) >Keywords: 199608050842.AA26620 Hi again, > First of all, thankyou very much for your response. I am understand > encoding and decoding using ncgen and ncdump. But I have a question, > How I create Asci file (maybe file.cdl). That is question about > CDL. As I think, at first time, I must have a file.cdl. Is it right? > Please let me know information of CDL. You don't have to have a CDL file to access or create a netCDF file. You can just use one of the library interfaces (from C, Fortran, C++, or perl), for example nccreate() from C. However, the simplest way to create a netCDF file (without writing a program) is to first create an ASCII CDL file, using a text editor of your choice (e.g. vi, emacs, xedit, ...). The CDL syntax is free form, so you can use blanks freely for readability. When you have a CDL file, say file.cdl, you can use ncgen to create the corresponding binary netCDF file, or a C or Fortran program that will create the corresponding binary netCDF file: $ ncgen -b file.cdl -o file.nc # creates file.nc or $ ncgen -c file.cdl > file.c # generates C program to create file.nc or $ ncgen -f file.cdl > file.f # generates Fortran to create file.nc If you want to use CDL, the syntax for CDL is described in the netCDF User's Guide, which is available with the software distribution or on-line from the netCDF web site: http://www.unidata.ucar.edu/packages/netcdf/ --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu