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.
> Organization: NOAA - ETL > Keywords: 199407140734.AA17175 Hi Daniel, > Anyone know if I can call ncgen during run time to create a > netcdf file. > > I want the user to be able to update the database structure > for future nc files as new info becomes available. I figure > it will simpler to update the cdl files, than bother with my > c code. Yes, I do this in some of my programs for exactly the reasons you cite. I install the CDL files in a known place, and when new data comes in the program writes it to the appropriate netCDF file if the file already exists or first creates the netCDF file using a system() call that invokes ncgen with the appropriate CDL file if the netCDF file doesn't exist yet. This seems to work fine. --Russ