legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java
public Variable addVariable(String varName, DataType dataType, Dimension[] dims) {
    ArrayList<Dimension> list = new ArrayList<Dimension>();
    list.addAll(Arrays.asList(dims));
    return addVariable(varName, dataType, list);
  }
public Variable addVariable(String varName, DataType dataType, Dimension[] dims) {
    ArrayList<Dimension> list = new ArrayList<Dimension>();
    list.addAll(Arrays.asList(dims));
    return addVariable(varName, dataType, list);
  }
Add a variable to the file. Must be in define mode.

@param varName  name of Variable, must be unique with the file.
@param dataType type of underlying element
@param dims     array of Dimensions for the variable, must already have been added. Use an array of length 0
for a scalar variable.
@return the Variable that has been added