The W3AI41 routine unpack consecutive binary strings of the same size
from one user supplied array and store them in the same order
right aligned in another array. w3ai41 is the reverse of w3ai40.
USAGE: CALL W3AI41 (KFLD, KOUT, KLEN, KNUM, KOFF)
Input argument list:
KFLD INTEGER ARRAY CONTINING BINARY STRING(S)
KLEN INTEGER NUMBER OF BITS PER STRING (0 < KLEN < 65)
KNUM INTEGER NUMBER OF STRINGS TO UNPACK. THIS VALUE MUST
NOT EXCEED THE DIMENSION OF 'KOUT'.
KOFF INTEGER NUMBER SPECIFYING THE BIT OFFSET OF THE
FIRST STRING 'KFLD'. THE OFFSET VALUE IS RESET TO
INCLUDE THE LOW ORDER BIT OF THE LAST STRING UNPACKED
('KOFF' > 0 )
Output argument list:
KOUT INTEGER*4 ARRAY HOLDING UNPACKED STRING(S)
ERROR 'KOFF' < 0 IF 'KLEN' HAS AN ILLEGAL VALUE OR 'KNUM' < 1
THEN 'KOUT' HAS NO STRINGS STORED.
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.
||Library contains Fortran 90 decoder/encoder
routines for GRIB edition 1. (Fortran90)
Date posted: 2/22/2007