The ncgen utility can do the following with CDL input:
ncgen -o mslp.nc mslp.cdl
ncgen -c mslp.cdl > mslp.c
ncgen -f mslp.cdl > mslp.f
NetCDF-4 note:
The current snapshot release of netCDF-4
includes an ncgen4 tool that handles features of the netCDF-4 data
model in CDL. It can generate binary netCDF files, C, or NcML, but not
Fortran yet. To build it requires a non-default configure option,
--enable-ncgen4.