NCEPLIBS-bufr  11.7.0
 All Data Structures Files Functions Variables Pages
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 
4 C> This function determines whether the current data subset in the
5 C> internal arrays will fit within the current BUFR message in the
6 C> internal arrays, based on the prescribed maximum size of a BUFR
7 C> message and the allowance of some extra "wiggle room" that may
8 C> be needed later when writing out the message.
9 C>
10 C> @author J. Ator
11 C> @date 2009-03-23
12 C>
13 C> @param[in] MSIZ -- integer: Size (in bytes) of current BUFR message
14 C> @param[in] ITOADD -- integer: Size (in bytes) of current data subset
15 C> @param[in] MXSIZ -- integer: Maximum size of a BUFR message
16 C> @returns MSGFULL -- logical: Flag indicating whether the current
17 C> data subset will fit within the current BUFR
18 C> message
19 C>
20 C> <b>Program history log:</b>
21 C> | Date | Programmer | Comments |
22 C> | -----|------------|----------|
23 C> | 2009-03-23 | J. Ator | Original author |
24 C>
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 
35 C----------------------------------------------------------------------
36 C----------------------------------------------------------------------
37 
38 C Allow for at least 11 additional bytes of "wiggle room" in the
39 C message, because subroutine MSGWRT may do any or all of the
40 C following:
41 C 3 bytes may be added by a call to subroutine CNVED4
42 C + 1 byte (at most) of padding may be added to Section 4
43 C + 7 bytes (at most) of padding may be added up to the next
44 C word boundary after Section 5
45 C ----
46 C 11
47 
48  iwgbyt = 11
49 
50 C But subroutine MSGWRT may also do any of all of the following:
51 
52 C 6 bytes may be added by a call to subroutine ATRCPT
53 
54  IF(ctrt.EQ.'Y') iwgbyt = iwgbyt + 6
55 
56 C (MAXNC*2) bytes (at most) may be added by a call to
57 C subroutine STNDRD
58 
59  IF(csmf.EQ.'Y') iwgbyt = iwgbyt + (maxnc*2)
60 
61 C 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:25
This module declares and initializes the MAXNC variable.
Definition: modv_MAXNC.f90:9