NCEPLIBS-bufr  12.0.0
pad.f File Reference

Pad a BUFR data subset with zeroed-out bits up to the next byte boundary. More...

Go to the source code of this file.

Functions/Subroutines

subroutine pad (IBAY, IBIT, IBYT, IPADB)
 This subroutine first packs the value for the number of bits being "padded" (we'll get to that later), starting with bit ibit+1 and using eight bits in the packed array ibay (which represents a subset packed into ibit bits). More...
 

Detailed Description

Pad a BUFR data subset with zeroed-out bits up to the next byte boundary.

Author
Woollen
Date
1994-01-06

Definition in file pad.f.

Function/Subroutine Documentation

◆ pad()

subroutine pad ( dimension(*)  IBAY,
  IBIT,
  IBYT,
  IPADB 
)

This subroutine first packs the value for the number of bits being "padded" (we'll get to that later), starting with bit ibit+1 and using eight bits in the packed array ibay (which represents a subset packed into ibit bits).

Then, starting with ibit+9, it packs zeroes (i.e., "pads") to the specified bit boundary (ipadb). (Note: it's the number of bits padded here that was packed in bits ibit+1 through ibit+8 - this is actually a delayed replication factor). IPADB must be a multiple of eight and represents the bit boundary on which the packed subset in ibay should end after padding. For example, if ipabd is "8", then the number of bits in ibay actually consumed by packed data (including the padding) will be a multiple of eight. If ipadb is "16", it will be a multiple of sixteen. in either (or any) case, this ensures that the packed subset will always end on a full byte boundary.

Parameters
[in,out]IBAY- integer(*):
  • on input, contains BUFR data subset to be padded
  • on output, contains BUFR data subset padded with zeroed-out bits up to IPADB
[in,out]IBIT- integer:
  • on input, contains bit pointer within IBAY after which to begin padding.
  • on output, contains bit pointer within IBAY to last bit that was padded.
[out]IBYT- integer: number of bytes within IBAY containing packed data, including padding
[in]IPADB- integer: bit boundary to pad to (must be a multiple of 8).
Author
Woollen
Date
1994-01-06

Definition at line 34 of file pad.f.

References bort(), and pkb().

Referenced by msgupd().