1 LOGICAL FUNCTION MSGFULL
(MSIZ
,ITOADD
,MXSIZ
)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 C PRGMMR: J. ATOR ORG: NP12 DATE: 2009-03-23
8 C ABSTRACT: THIS LOGICAL FUNCTION DETERMINES WHETHER THE CURRENT SUBSET
9 C (OF LENGTH ITOADD BYTES) WILL FIT WITHIN THE CURRENT BUFR MESSAGE.
10 C A FINITE AMOUNT OF "WIGGLE ROOM" IS ALLOWED FOR AS SHOWN BELOW.
12 C PROGRAM HISTORY LOG:
13 C 2009-03-23 J. ATOR -- ORIGINAL AUTHOR
15 C USAGE: MSGFULL (MSIZ,ITOADD,MXSIZ)
16 C INPUT ARGUMENT LIST:
17 C MSIZ - INTEGER: SIZE OF CURRENT MESSAGE (IN BYTES)
18 C ITOADD - INTEGER: SIZE OF SUBSET TO BE ADDED (IN BYTES)
19 C MXSIZ - INTEGER: MAXIMUM SIZE OF A BUFR MESSAGE
21 C OUTPUT ARGUMENT LIST:
22 C MSGFULL - LOGICAL: FALSE IF SUBSET WILL FIT; TRUE OTHERWISE
25 C THIS ROUTINE CALLS: None
26 C THIS ROUTINE IS CALLED BY: CPYUPD MSGUPD WRCMPS WRDXTB
27 C Normally not called by any application
31 C LANGUAGE: FORTRAN 77
32 C MACHINE: PORTABLE TO ALL PLATFORMS
39 COMMON /TNKRCP
/ ITRYR
,ITRMO
,ITRDY
,ITRHR
,ITRMI
,CTRT
44 C----------------------------------------------------------------------
45 C----------------------------------------------------------------------
47 C Allow for at least 11 additional bytes of "wiggle room" in the
48 C message, because subroutine MSGWRT may do any or all of the
50 C 3 bytes may be added by a call to subroutine CNVED4
51 C + 1 byte (at most) of padding may be added to Section 4
52 C + 7 bytes (at most) of padding may be added up to the next
53 C word boundary after Section 5
59 C But subroutine MSGWRT may also do any of all of the following:
61 C 6 bytes may be added by a call to subroutine ATRCPT
63 IF(CTRT
.EQ
.'Y') IWGBYT
= IWGBYT
+ 6
65 C (MAXNC*2) bytes (at most) may be added by a call to
68 IF(CSMF
.EQ
.'Y') IWGBYT
= IWGBYT
+ (MAXNC*2
)
70 C Determine whether the subset will fit.
72 IF ( ( MSIZ
+ ITOADD
+ IWGBYT
) .GT
. MXSIZ
) THEN