visad/src/main/java/ucar/nc2/iosp/gempak/GempakSurfaceFileReader.java
public static void main(String[] args) throws IOException {
    if (args.length == 0) {
      System.out.println("need to supply a GEMPAK surface file name");
      System.exit(1);
    }
    try {
      GempakParameters.addParameters(
              "resources/nj22/tables/gempak/params.tbl");
    } catch (Exception e) {
      System.out.println("unable to init param tables");
    }

    GempakSurfaceFileReader gsfr = getInstance(getFile(args[0]), true);
    System.out.println("Type = " + gsfr.getSurfaceFileType());
    gsfr.printFileLabel();
    gsfr.printKeys();
    gsfr.printHeaders();
    gsfr.printParts();
    //gsfr.printDates();
    //gsfr.printStations(false);
    int row = 1;
    int col = 1;
    if (args.length > 1) {
      row = Integer.parseInt(args[1]);
    }
    if (args.length > 2) {
      col = Integer.parseInt(args[2]);
    }
    gsfr.printOb(row, col);
  }
public static void main(String[] args) throws IOException {
    if (args.length == 0) {
      System.out.println("need to supply a GEMPAK surface file name");
      System.exit(1);
    }
    try {
      GempakParameters.addParameters(
              "resources/nj22/tables/gempak/params.tbl");
    } catch (Exception e) {
      System.out.println("unable to init param tables");
    }

    GempakSurfaceFileReader gsfr = getInstance(getFile(args[0]), true);
    System.out.println("Type = " + gsfr.getSurfaceFileType());
    gsfr.printFileLabel();
    gsfr.printKeys();
    gsfr.printHeaders();
    gsfr.printParts();
    //gsfr.printDates();
    //gsfr.printStations(false);
    int row = 1;
    int col = 1;
    if (args.length > 1) {
      row = Integer.parseInt(args[1]);
    }
    if (args.length > 2) {
      col = Integer.parseInt(args[2]);
    }
    gsfr.printOb(row, col);
  }
Run the program

@param args [0] filename (required),
[1] variable name (X for default),
[2] X to not list grids
@throws IOException problem reading the file