legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java
public Variable renameVariable(String oldName, String newName) {
    if (!defineMode) throw new UnsupportedOperationException("not in define mode");
    Variable v = findVariable(oldName);
    if (null != v) v.setName(newName);
    return v;
  }
public Variable renameVariable(String oldName, String newName) {
    if (!defineMode) throw new UnsupportedOperationException("not in define mode");
    Variable v = findVariable(oldName);
    if (null != v) v.setName(newName);
    return v;
  }
Rename a Variable. Must be in define mode.
@param oldName existing Variable has this name
@param newName rename to this
@return renamed Variable, or null if not found