NCEPLIBS-bufr  12.0.1
msgfull.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Check whether a data subset will fit within a BUFR message
3 C>
4 C> @author J. Ator @date 2009-03-23
5 
6 C> This function determines whether the current data subset in the
7 C> internal arrays will fit within the current BUFR message in the
8 C> internal arrays, based on the prescribed maximum size of a BUFR
9 C> message and the allowance of some extra "wiggle room" that may
10 C> be needed later when writing out the message.
11 C>
12 C> @param[in] MSIZ -- integer: Size (in bytes) of current BUFR message
13 C> @param[in] ITOADD -- integer: Size (in bytes) of current data subset
14 C> @param[in] MXSIZ -- integer: Maximum size of a BUFR message
15 C> @returns MSGFULL -- logical: Flag indicating whether the current
16 C> data subset will fit within the current BUFR
17 C> message
18 C>
19 C> @author J. Ator @date 2009-03-23
20  LOGICAL FUNCTION msgfull(MSIZ,ITOADD,MXSIZ)
21 
22  USE modv_maxnc
23 
24  COMMON /msgstd/ csmf
25  COMMON /tnkrcp/ itryr,itrmo,itrdy,itrhr,itrmi,ctrt
26 
27  CHARACTER*1 csmf
28  CHARACTER*1 ctrt
29 
30 C----------------------------------------------------------------------
31 C----------------------------------------------------------------------
32 
33 C Allow for at least 11 additional bytes of "wiggle room" in the
34 C message, because subroutine MSGWRT may do any or all of the
35 C following:
36 C 3 bytes may be added by a call to subroutine CNVED4
37 C + 1 byte (at most) of padding may be added to Section 4
38 C + 7 bytes (at most) of padding may be added up to the next
39 C word boundary after Section 5
40 C ----
41 C 11
42 
43  iwgbyt = 11
44 
45 C But subroutine MSGWRT may also do any of all of the following:
46 
47 C 6 bytes may be added by a call to subroutine ATRCPT
48 
49  IF(ctrt.EQ.'Y') iwgbyt = iwgbyt + 6
50 
51 C (MAXNC*2) bytes (at most) may be added by a call to
52 C subroutine STNDRD
53 
54  IF(csmf.EQ.'Y') iwgbyt = iwgbyt + (maxnc*2)
55 
56 C Determine whether the subset will fit.
57 
58  IF ( ( msiz + itoadd + iwgbyt ) .GT. mxsiz ) THEN
59  msgfull = .true.
60  ELSE
61  msgfull = .false.
62  ENDIF
63 
64  RETURN
65  END
logical function msgfull(MSIZ, ITOADD, MXSIZ)
This function determines whether the current data subset in the internal arrays will fit within the c...
Definition: msgfull.f:21
This module declares and initializes the MAXNC variable.
integer, parameter, public maxnc
Maximum number of descriptors within Section 3 of a BUFR message.