NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3ai41.f File Reference

Constant size binary string unpacker. More...

Go to the source code of this file.

Functions/Subroutines

subroutine w3ai41 (kfld, kout, klen, knum, koff)
 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.
 

Detailed Description

Constant size binary string unpacker.

Author
Robert Allard
Date
1980-04-01

Definition in file w3ai41.f.

Function/Subroutine Documentation

◆ w3ai41()

subroutine w3ai41 ( integer, dimension(*)  kfld,
integer, dimension(*)  kout,
  klen,
  knum,
  koff 
)

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().

Program history log:

  • Robert Allard 1980-04-01 R.ALLARD (ORIGINAL AUTHOR) ASMEMBLER LANGUAGE VERSION.
  • Ralph Jones 1984-07-05 Recompiled for NAS-9050
  • Ralph Jones 1988-07-05 Wrote fortran version of w3ai41 to unpack variable size binary strings, added code to reverse orfer of bytes.
  • Ralph Jones 1989-11-04 Convert to craf CFT77 FORTRAN
  • Boi Vuong 1998-03-10 Remove the cdir$ integer=64 directive.
Parameters
[in]KFLDInteger array contining binary string(s).
[in]KLENInteger number of bits per string (0 < klen < 65).
[in]KNUMInteger number of strings to unpack. this value must not exceed the dimension of 'kout'.
[in]KOFFInteger 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 ).
[out]KOUTInteger*4 array holding unpacked string(s).

Exit states: error - 'koff' < 0 if 'klen' has an illegal value or 'knum' < 1 then 'kout' has no strings stored.

Note
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 gbytes() can be used instead of this subroutine.
Author
Robert Allard
Date
1980-04-01

Definition at line 43 of file w3ai41.f.