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.
Coy, In ansswer to your last question: > Maybe there is a better way to go about my end goal then having a lot of > unlimited dimensions. The data I writ to file is acquired using > different modes (sets of parameters). When I create the file for the > first time, I do not know what modes I will be trying to write to the > file in the future. In NetCDF-3, I am forced to guess and often make > unnecessary room in the file for future modes. With NetCDF-4, I thought > I would just make the number of modes unlimited so I could add future > modes without issue. This also requires I make other dimensions > unlimited as some of the parameters may change the amount of data > acquired. Is there a better approach to this problem then using > unlimited dimensions? I believe the better way is to use variable-length user-defined types, which are intended for representing such structures as ragged arrays. An example of the use of variable-length types in C is in the source distribution, ncdump/tst_vlen_data.c. In addition to the documentation in the C Users Guide on the functions used, there's also some material on use of variable-length data types in the white paper "Developing Conventions for netCDF-4 (Draft)" at http://www.unidata.ucar.edu/netcdf/papers/nc4_conventions.html An example CDL file showing how ncdump represents variable-length types is in the source release in ncdump/ref_tst_vlen_data.cdl. We need to provide more guidance on use of multiple unlimited dimensions versus variable-length types, and plan to do so in the future, but for now, I hope this helps. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: TLB-677315 Department: Support netCDF Priority: Normal Status: Closed