visad/src/main/java/ucar/nc2/iosp/gempak/GempakGridReader.java
private synchronized float[] unpackData(int iiword, int nword,
                                          int ipktyp, int kxky, int nbits,
                                          float ref, float scale,
                                          boolean miss, float difmin,
                                          int kx, int decimalScale)
          throws IOException {
    if (ipktyp == MDGGRB) {
      if (!useDP) {
        return unpackGrib1Data(iiword, nword, kxky, nbits, ref,
                scale, miss, decimalScale);
      } else {
        if (nword * 32 < kxky * nbits) { // to account for badly written files
          nword++;
        }
        int[] ksgrid = new int[nword];
        DM_RINT(iiword, ksgrid);
        return DP_UGRB(ksgrid, kxky, nbits, ref, scale, miss,
                decimalScale);
      }
    } else if (ipktyp == MDGNMC) {
      return null;
    } else if (ipktyp == MDGDIF) {
      return null;
    }
    return null;
  }
private synchronized float[] unpackData(int iiword, int nword,
                                          int ipktyp, int kxky, int nbits,
                                          float ref, float scale,
                                          boolean miss, float difmin,
                                          int kx, int decimalScale)
          throws IOException {
    if (ipktyp == MDGGRB) {
      if (!useDP) {
        return unpackGrib1Data(iiword, nword, kxky, nbits, ref,
                scale, miss, decimalScale);
      } else {
        if (nword * 32 < kxky * nbits) { // to account for badly written files
          nword++;
        }
        int[] ksgrid = new int[nword];
        DM_RINT(iiword, ksgrid);
        return DP_UGRB(ksgrid, kxky, nbits, ref, scale, miss,
                decimalScale);
      }
    } else if (ipktyp == MDGNMC) {
      return null;
    } else if (ipktyp == MDGDIF) {
      return null;
    }
    return null;
  }
private synchronized float [ ] unpackData ( int iiword , int nword , int ipktyp , int kxky , int nbits , float ref , float scale , boolean miss , float difmin , int kx , int decimalScale ) throws IOException { if ( ipktyp == MDGGRB ) { if ( ! useDP ) { return unpackGrib1Data ( iiword , nword , kxky , nbits , ref , scale , miss , decimalScale ) ; } else { if ( nword * 32 < kxky * nbits ) { // to account for badly written files nword ++ ; } int [ ] ksgrid = new int [ nword ] ; DM_RINT ( iiword , ksgrid ) ; return DP_UGRB ( ksgrid , kxky , nbits , ref , scale , miss , decimalScale ) ; } } else if ( ipktyp == MDGNMC ) { return null ; } else if ( ipktyp == MDGDIF ) { return null ; } return null ; }
Read packed data

@param iiword       Starting word  (FORTRAN 1 based)
@param nword        Number of words
@param ipktyp       Packing type
@param kxky         Number of grid points
@param nbits        Number of bits
@param ref          Reference minimum value of grid
@param scale        Scaling factor
@param miss         Missing data flag
@param difmin       Minimum value of differences
@param kx           Number of points in x direction
@param decimalScale scale of the values for the units
@return unpacked data
@throws IOException problem reading file
Read packed data