legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java
public Dimension renameDimension(String oldName, String newName) {
    if (!defineMode)
      throw new UnsupportedOperationException("not in define mode");

    Dimension dim = findDimension(oldName);
    if (null != dim) dim.setName(newName);
    return dim;
  }
public Dimension renameDimension(String oldName, String newName) {
    if (!defineMode)
      throw new UnsupportedOperationException("not in define mode");

    Dimension dim = findDimension(oldName);
    if (null != dim) dim.setName(newName);
    return dim;
  }
Rename a Dimension. Must be in define mode.
@param oldName existing dimension has this name
@param newName rename to this
@return renamed dimension, or null if not found