38 SUBROUTINE pkb(NVAL,NBITS,IBAY,IBIT)
40 COMMON /hrdwrd/ nbytw,nbitw,iord(8)
44 CHARACTER*156 bort_str
49 IF(nbits.GT.nbitw) goto 900
54 IF(ishft(ival,-nbits).GT.0) ival = -1
55 int = ishft(ival,nbitw-nbits)
57 msk = ishft( -1,nbitw-nbits)
59 ibay(nwd) =
irev(ior(iand(
irev(ibay(nwd)),not(msk)),int))
60 IF(nbt+nbits.GT.nbitw)
THEN
67 int = ishft(ival,2*nbitw-(nbt+nbits))
68 msk = ishft( -1,2*nbitw-(nbt+nbits))
69 ibay(nwd+1) =
irev(ior(iand(
irev(ibay(nwd+1)),not(msk)),int))
75 900
WRITE(bort_str,
'("BUFRLIB: PKB - NUMBER OF BITS BEING PACKED '//
76 .
', NBITS (",I4,"), IS > THE INTEGER WORD LENGTH ON THIS '//
77 .
'MACHINE, NBITW (",I3,")")')
function irev(N)
THIS FUNCTION WILL, WHEN THE LOCAL MACHINE IS "LITTLE- ENDIAN" (I.E., USES A RIGHT TO LEFT SCHEME ...
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
subroutine pkb(NVAL, NBITS, IBAY, IBIT)
This subroutine encodes an integer value within a specified number of bits of an integer array...