legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java
public void create() throws java.io.IOException {
    if (!defineMode)
      throw new UnsupportedOperationException("not in define mode");

    if (cached_spiw == null) {
      spi = SPFactory.getServiceProvider();
      spiw = (IOServiceProviderWriter) spi;
    } else {
      spiw = cached_spiw;
      spi = spiw;
    }
    spiw.setFill( fill);
    spiw.create(location, this, extraHeader, preallocateSize, isLargeFile);

    defineMode = false;
  }
public void create() throws java.io.IOException {
    if (!defineMode)
      throw new UnsupportedOperationException("not in define mode");

    if (cached_spiw == null) {
      spi = SPFactory.getServiceProvider();
      spiw = (IOServiceProviderWriter) spi;
    } else {
      spiw = cached_spiw;
      spi = spiw;
    }
    spiw.setFill( fill);
    spiw.create(location, this, extraHeader, preallocateSize, isLargeFile);

    defineMode = false;
  }
After you have added all of the Dimensions, Variables, and Attributes,
call create() to actually create the file. You must be in define mode.
After this call, you are no longer in define mode.
@throws java.io.IOException if I/O error