netcdf implicit_grid{
dimensions: lon = 101; lat = 101; level = 5; time = UNLIMITED ; //(7 currently) variables:
float A(time,level,lat,lon); A:units = "meters/second"; float level(level);
level:units = "millibars"; float time(time);
time:units = "hours"; //global attributes:
:x_min = -180.f; :x_max = 180.f; :x_units = "degrees_east"; :x_label = "longitude"; :y_min = -90.f; :y_max = 90.f; :y_units = "degrees_north"; :y_label = "latitude";
:z_label = "level"; :t_label = "time";
data: level = 1000, 850, 700, 500, 300 ; time = 0, 2, 4, 6, 8, 10, 12 ;
The command ncgen' is the inverse of
ncdump'; it converts an ASCII CDL file to a binary netCDF file. For example
ncgen -o sample.nc sample.cdl converts the CDL file sample.cdl' to the netCDF file
sample.nc'. The easiest way to create a netCDF file is to (1) write all the header data (the name, dimensions, variable and attribute specifications, and the values of any coordinate variables) to a CDL file, (2) convert the CDL file to a netCDF file using ncgen, and (3) continue writing the main data arrays to this netCDF file.