visad/src/main/java/ucar/nc2/iosp/gempak/GempakGridReader.java
private float[] unpackGrib2Data(int iiword, int lendat, int[] iarray, float[] rarray) throws IOException {

    long start = getOffset(iiword);
    rf.seek(start);
    Grib2Record gr = makeGribRecord(rf, start);
    float[] data = gr.readData(rf);

    if (((iarray[3] >> 6) & 1) == 0) {  // -y scanning - flip
      data = gb2_ornt(iarray[1], iarray[2], iarray[3], data);
    }

    return data;
  }
private float[] unpackGrib2Data(int iiword, int lendat, int[] iarray, float[] rarray) throws IOException {

    long start = getOffset(iiword);
    rf.seek(start);
    Grib2Record gr = makeGribRecord(rf, start);
    float[] data = gr.readData(rf);

    if (((iarray[3] >> 6) & 1) == 0) {  // -y scanning - flip
      data = gb2_ornt(iarray[1], iarray[2], iarray[3], data);
    }

    return data;
  }
Read packed Grib2 data

@param iiword Starting word  (FORTRAN 1 based)
@param lendat Number of words
@param iarray integer packing info
@param rarray float packing info
@return unpacked data
@throws IOException problem reading file