visad/src/main/java/ucar/nc2/iosp/gempak/GempakSurfaceIOSP.java
private void buildShipFile() {
    // Build variable list (var(station,time))
    List<GempakStation> stations = gemreader.getStations();
    int numObs = stations.size();
    //Trace.msg("GEMPAKSIOSP: now have " + numObs + " stations");
    Dimension record = new Dimension("record", numObs, true,
            (numObs == 0), false);
    ncfile.addDimension(null, record);
    List<Dimension> records = new ArrayList<>(1);
    records.add(record);

    // time
    Variable timeVar = new Variable(ncfile, null, null, TIME_VAR,
            DataType.DOUBLE, (String)null);
    timeVar.addAttribute(
            new Attribute(CDM.UNITS, "seconds since 1970-01-01 00:00:00"));
    timeVar.addAttribute(new Attribute("long_name", TIME_VAR));

    ncfile.addDimension(null, DIM_LEN8);
    ncfile.addDimension(null, DIM_LEN4);
    ncfile.addDimension(null, DIM_LEN2);
    List<Variable> stationVars = makeStationVars(stations, null);

    List<GempakParameter> params =
            gemreader.getParameters(GempakSurfaceFileReader.SFDT);
    if (params == null) {
      return;
    }
    Structure sVar = new Structure(ncfile, null, null, "Obs");
    sVar.setDimensions(records);
    // loop through and add to ncfile
    boolean hasElevation = false;
    for (Variable stnVar : stationVars) {
      if (stnVar.getShortName().equals("SELV")) {
        hasElevation = true;
      }
      sVar.addMemberVariable(stnVar);
    }
    sVar.addMemberVariable(timeVar);

    for (GempakParameter param : params) {
      Variable var = makeParamVariable(param, null);
      sVar.addMemberVariable(var);
    }
    sVar.addMemberVariable(makeMissingVariable());
    String coords = "Obs.time Obs.SLAT Obs.SLON";
    if (hasElevation) {
      coords = coords + " Obs.SELV";
    }
    sVar.addAttribute(new Attribute(CF.COORDINATES, coords));
    ncfile.addVariable(null, sVar);
    ncfile.addAttribute(null,
            new Attribute("CF:featureType",
                    CF.FeatureType.point.toString()));
  }
private void buildShipFile() {
    // Build variable list (var(station,time))
    List<GempakStation> stations = gemreader.getStations();
    int numObs = stations.size();
    //Trace.msg("GEMPAKSIOSP: now have " + numObs + " stations");
    Dimension record = new Dimension("record", numObs, true,
            (numObs == 0), false);
    ncfile.addDimension(null, record);
    List<Dimension> records = new ArrayList<>(1);
    records.add(record);

    // time
    Variable timeVar = new Variable(ncfile, null, null, TIME_VAR,
            DataType.DOUBLE, (String)null);
    timeVar.addAttribute(
            new Attribute(CDM.UNITS, "seconds since 1970-01-01 00:00:00"));
    timeVar.addAttribute(new Attribute("long_name", TIME_VAR));

    ncfile.addDimension(null, DIM_LEN8);
    ncfile.addDimension(null, DIM_LEN4);
    ncfile.addDimension(null, DIM_LEN2);
    List<Variable> stationVars = makeStationVars(stations, null);

    List<GempakParameter> params =
            gemreader.getParameters(GempakSurfaceFileReader.SFDT);
    if (params == null) {
      return;
    }
    Structure sVar = new Structure(ncfile, null, null, "Obs");
    sVar.setDimensions(records);
    // loop through and add to ncfile
    boolean hasElevation = false;
    for (Variable stnVar : stationVars) {
      if (stnVar.getShortName().equals("SELV")) {
        hasElevation = true;
      }
      sVar.addMemberVariable(stnVar);
    }
    sVar.addMemberVariable(timeVar);

    for (GempakParameter param : params) {
      Variable var = makeParamVariable(param, null);
      sVar.addMemberVariable(var);
    }
    sVar.addMemberVariable(makeMissingVariable());
    String coords = "Obs.time Obs.SLAT Obs.SLON";
    if (hasElevation) {
      coords = coords + " Obs.SELV";
    }
    sVar.addAttribute(new Attribute(CF.COORDINATES, coords));
    ncfile.addVariable(null, sVar);
    ncfile.addAttribute(null,
            new Attribute("CF:featureType",
                    CF.FeatureType.point.toString()));
  }
Build a ship station structure.  Here the columns are the
stations/reports and the rows (1) are the reports.