NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
msgfull.f
Go to the documentation of this file.
1 C> @file
2 C> @author J @date 2009-03-23
3 
4 C> THIS LOGICAL FUNCTION DETERMINES WHETHER THE CURRENT SUBSET
5 C> (OF LENGTH ITOADD BYTES) WILL FIT WITHIN THE CURRENT BUFR MESSAGE.
6 C> A FINITE AMOUNT OF "WIGGLE ROOM" IS ALLOWED FOR AS SHOWN BELOW.
7 C>
8 C> PROGRAM HISTORY LOG:
9 C> 2009-03-23 J. ATOR -- ORIGINAL AUTHOR
10 C>
11 C> USAGE: MSGFULL (MSIZ,ITOADD,MXSIZ)
12 C> INPUT ARGUMENT LIST:
13 C> MSIZ - INTEGER: SIZE OF CURRENT MESSAGE (IN BYTES)
14 C> ITOADD - INTEGER: SIZE OF SUBSET TO BE ADDED (IN BYTES)
15 C> MXSIZ - INTEGER: MAXIMUM SIZE OF A BUFR MESSAGE
16 C>
17 C> OUTPUT ARGUMENT LIST:
18 C> MSGFULL - LOGICAL: FALSE IF SUBSET WILL FIT; TRUE OTHERWISE
19 C>
20 C> REMARKS:
21 C> THIS ROUTINE CALLS: None
22 C> THIS ROUTINE IS CALLED BY: CPYUPD MSGUPD WRCMPS WRDXTB
23 C> Normally not called by any application
24 C> programs.
25 C>
26  LOGICAL FUNCTION msgfull(MSIZ,ITOADD,MXSIZ)
27 
28  USE modv_maxnc
29 
30  COMMON /msgstd/ csmf
31  COMMON /tnkrcp/ itryr,itrmo,itrdy,itrhr,itrmi,ctrt
32 
33  CHARACTER*1 csmf
34  CHARACTER*1 ctrt
35 
36 C----------------------------------------------------------------------
37 C----------------------------------------------------------------------
38 
39 C Allow for at least 11 additional bytes of "wiggle room" in the
40 C message, because subroutine MSGWRT may do any or all of the
41 C following:
42 C 3 bytes may be added by a call to subroutine CNVED4
43 C + 1 byte (at most) of padding may be added to Section 4
44 C + 7 bytes (at most) of padding may be added up to the next
45 C word boundary after Section 5
46 C ----
47 C 11
48 
49  iwgbyt = 11
50 
51 C But subroutine MSGWRT may also do any of all of the following:
52 
53 C 6 bytes may be added by a call to subroutine ATRCPT
54 
55  IF(ctrt.EQ.'Y') iwgbyt = iwgbyt + 6
56 
57 C (MAXNC*2) bytes (at most) may be added by a call to
58 C subroutine STNDRD
59 
60  IF(csmf.EQ.'Y') iwgbyt = iwgbyt + (maxnc*2)
61 
62 C Determine whether the subset will fit.
63 
64  IF ( ( msiz + itoadd + iwgbyt ) .GT. mxsiz ) THEN
65  msgfull = .true.
66  ELSE
67  msgfull = .false.
68  ENDIF
69 
70  RETURN
71  END
LOGICAL function msgfull(MSIZ, ITOADD, MXSIZ)
THIS LOGICAL FUNCTION DETERMINES WHETHER THE CURRENT SUBSET (OF LENGTH ITOADD BYTES) WILL FIT WITHIN ...
Definition: msgfull.f:26
This module declares and initializes the MAXNC variable.
Definition: modv_MAXNC.f90:9