ncgen has options to specify what kind of output to generate.
ncgen [-b] [-o file.nc] [-k file_format] [-l output_language]
[-x] file.cdl
[-b] binary output as a netCDF file, uses .nc extension on input
[-o file.nc] like -b except output netCDF to specified filename
[-k] kind of netCDF file for output
[-l c|f77|java] language of program generated to standard output
[-x] don't write fill values for missing data in output
file.cdl name of input CDL file