W3AI40

The W3AI40 routine packs constant size binary strings into an array.

USAGE: CALL W3AI40 (KFLD,KOUT,KLEN,KNUM,KOFF)

   Input argument list:
      KFLD     INTEGER INPUT ARRAY OF RIGHT ADJUSTED STRINGS
      KLEN     INTEGER NUMBER OF BITS PER STRING (0 < KLEN < 33)
      KNUM     INTEGER NUMBER OF STRINGS IN 'KFLD' TO PACK
      KOFF     INTEGER NUMBER SPECIFYING THE BIT OFFSET OF THE
               FIRST OUTPUT STRING. THE OFFSET VALUE IS RESET TO
               INCLUDE THE LOW ORDER BIT OF THE LAST PACKED STRING

   Output argument list:
      KOUT     INTEGER OUTPUT ARRAY TO HOLD PACKED STRING(S)
 
   Exit states:
      ERROR    KOFF < 0 IF KLEN HAS AN ILLEGAL VALUE OR KNUM < 1
               THEN KOUT HAS NO STRINGS STORED.
 
REMARKS:
        This subroutine should be written in assembler language.
        The FORTRAN version runs two or three times slower than the
        asembler version. The FORTRAN version can be converted to
        run on other computers with a few changes. The bit manipulation
        functions are the same in IBM370 vs FORTRAN 4.1, MICROSOFT
        FORTRAN 4.10, VAX FORTRAN.  Most modern FORTRAN compiler have
        AND, OR, SHIFT functions. If you are running on a PC, VAX and
        your input was made on a IBM370, APOLLO SUN, H.P.. etc.
        You may have to add more code to reverse the order O bytes in 
        an integer word. NCAR sbytes can be used instead of this subroutine.
        Please use NCAR sbytes subroutine instead of this subroutine.

 
W3lib.tar Library contains Fortran 90 decoder/encoder routines for GRIB edition 1. (Fortran90)
Date posted: 2/22/2007