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.
Michael Tiller wrote:
John Caron wrote:I would reccomend to always make dimensions shared, the only possible exception is for char[] lengths. The reason its there is to support other file formats that often dont share dimension, eg HDF. So use: public Dimension addDimension(String dimName, int length); unless its the unlimited dimension, in which case you need the other one.Not to nitpick, but the example in the User's guide uses addDimension(String dimName, int length) where length=-1 to indicate an unlimited dimension. This seems perfectly natural to me (i.e. an unlimited dimension having an exceptional value to indicate its unlimited nature). But your statements here + my experience indicates that the user's guide is wrong (which would be a shame since I like the user's guide approach). Am I missing something?
user guide is very old, it will get rewritten Real Soon Now.
-- Mike