27 SUBROUTINE pkb(NVAL,NBITS,IBAY,IBIT)
29 COMMON /hrdwrd/ nbytw,nbitw,iord(8)
33 CHARACTER*156 BORT_STR
38 IF(nbits.GT.nbitw)
GOTO 900
43 IF(ishft(ival,-nbits).GT.0) ival = -1
44 int = ishft(ival,nbitw-nbits)
46 msk = ishft( -1,nbitw-nbits)
48 ibay(nwd) =
irev(ior(iand(
irev(ibay(nwd)),not(msk)),int))
49 IF(nbt+nbits.GT.nbitw)
THEN
56 int = ishft(ival,2*nbitw-(nbt+nbits))
57 msk = ishft( -1,2*nbitw-(nbt+nbits))
58 ibay(nwd+1) =
irev(ior(iand(
irev(ibay(nwd+1)),not(msk)),int))
64 900
WRITE(bort_str,
'("BUFRLIB: PKB - NUMBER OF BITS BEING PACKED '//
65 .
', NBITS (",I4,"), IS > THE INTEGER WORD LENGTH ON THIS '//
66 .
'MACHINE, NBITW (",I3,")")')
subroutine bort(STR)
Log one error message and abort application program.
function irev(N)
This function will, when the local machine is "little-endian" (i.e., when it uses a right to left sch...
subroutine pkb(NVAL, NBITS, IBAY, IBIT)
This subroutine encodes an integer value within a specified number of bits of an integer array,...