cdm/src/main/java/ucar/nc2/NetcdfFile.java
public boolean removeDimension(Group g, String dimName) {
    if (immutable) throw new IllegalStateException("Cant modify");
    if (g == null) g = rootGroup;
    return g.removeDimension(dimName);
  }
public boolean removeDimension(Group g, String dimName) {
    if (immutable) throw new IllegalStateException("Cant modify");
    if (g == null) g = rootGroup;
    return g.removeDimension(dimName);
  }
Remove a shared Dimension from a Group by name.

@param g       remove from this group. If group is null, use root group
@param dimName name of Dimension to remove.
@return true if found and removed.