Constant size binary string packer.
More...
Go to the source code of this file.
|
subroutine | w3ai40 (kfld, kout, klen, knum, koff) |
| Packs constant size binary strings into an array.
|
|
Constant size binary string packer.
- Author
- Robert Allard
- Date
- 1980-04-01
Definition in file w3ai40.f.
◆ w3ai40()
subroutine w3ai40 |
( |
integer, dimension(*) |
kfld, |
|
|
integer, dimension(*) |
kout, |
|
|
|
klen, |
|
|
|
knum, |
|
|
|
koff |
|
) |
| |
Packs constant size binary strings into an array.
This packing replaces bits in the part of the output array indicated by the offset value. W3AI40 is the reverse of W3AI41. (see W3AI32 to pack variable size binary strings.)
Program history log:
- Robert Allard 1980-04-01 Asmembler language version.
- Ralph Jones 1984-07-05 Recompiled for nas-9050.
- Ralph Jones 1989-11-04 Wrote fortran version of w3ai40 to pack constant size binary strings.
- Ralph Jones 1989-11-05 Convert to cray cft77 fortran.
- Boi Vuong 1998-03-10 Remove the cdir$ integer=64 directive.
- Parameters
-
[in] | KFLD | Integer input array of right adjusted strings. |
[in] | KLEN | Integer number of bits per string (0 < klen < 33). |
[in] | KNUM | Integer number of strings in 'kfld' to pack. |
[in] | 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. |
[out] | 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.
- 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 of bytes in an integer word. NCAR sbytes() can be used instead of this subroutine. Please use NCAR sbytes() subroutine instead of this subroutine.
- Author
- Robert Allard
- Date
- 1980-04-01
Definition at line 43 of file w3ai40.f.