1 SUBROUTINE PADMSG(MESG,LMESG,NPBYT)
3 !$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 ! PRGMMR: ATOR ORG: NP12 DATE: 2005-11-29
8 ! ABSTRACT: THIS SUBROUTINE PADS A BUFR MESSAGE WITH ZEROED-OUT BYTES
9 ! FROM THE END OF THE MESSAGE UP TO THE NEXT 8-BYTE BOUNDARY.
11 ! PROGRAM HISTORY LOG:
12 ! 2005-11-29 J. ATOR -- ORIGINAL AUTHOR
14 ! USAGE: CALL PADMSG (MESG, LMESG, NPBYT )
15 ! INPUT ARGUMENT LIST:
16 ! MESG - INTEGER: *-WORD PACKED BINARY ARRAY CONTAINING BUFR
18 ! LMESG - INTEGER: DIMENSIONED SIZE (IN INTEGER WORDS) OF MESG;
19 ! USED BY THE SUBROUTINE TO ENSURE THAT IT DOES NOT
20 ! OVERFLOW THE MESG ARRAY
22 ! OUTPUT ARGUMENT LIST:
23 ! MESG - INTEGER: *-WORD PACKED BINARY ARRAY CONTAINING BUFR
24 ! MESSAGE WITH NPBYT ZEROED-OUT BYTES APPENDED TO THE END
25 ! NPBYT - INTEGER: NUMBER OF ZEROED-OUT BYTES APPENDED TO MESG
28 ! THIS ROUTINE CALLS: BORT IUPBS01 NMWRD PKB
29 ! THIS ROUTINE IS CALLED BY: MSGWRT
30 ! Also called by application programs.
33 ! LANGUAGE: FORTRAN 77
34 ! MACHINE: PORTABLE TO ALL PLATFORMS
38 COMMON /HRDWRD/ NBYTW,NBITW,NREV,IORD(8)
42 !-----------------------------------------------------------------------
43 !-----------------------------------------------------------------------
45 ! Make sure that the array is big enough to hold the additional
46 ! byte padding that will be appended to the end of the message.
49 IF(NMW.GT.LMESG) GOTO 900
51 ! Pad from the end of the message up to the next 8-byte boundary.
53 NMB = IUPBS01(MESG,'LENM')
55 NPBYT = ( NMW * NBYTW ) - NMB
57 CALL PKB(0,8,MESG,IBIT)
61 900 CALL BORT('BUFRLIB: PADMSG - CANNOT ADD PADDING TO MESSAGE '// &
62 'ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')