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.
Hi Amita, > I am creating netcdf data files using IDL. Every once in a while I have > problem with switching modes (from definition to data. For example, > after defining dimensions and variable when I use > > ncdf_control,id,/ENDEF, I get the following error: > > NCDF_CONTROL: Attempt to take the file out of define mode (ENDEF) failed. > (NC_ERROR=-45) We don't provide support for the IDL interface, but NCDF_CONTROL is evidently calling the netCDF function nc_enddef, and the documentation for that function http://www.unidata.ucar.edu/netcdf/docs/netcdf-c.html#nc_005fenddef says it can return an error for several reasons, including: * The specified netCDF dataset is not in define mode. * The specified netCDF ID does not refer to an open netCDF dataset. * The size of one or more variables exceed the size constraints for whichever variant of the file format is in use). See Large File Support. The netCDF error -45 corresponds to the error "Not a netcdf data type", which may mean you are trying to create a variable or attribute using a type code that doesn't correspond to one of the five numeric types or one character type that netCDF-3 permits. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: EEV-727668 Department: Support netCDF Priority: Normal Status: Closed