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