NCEPLIBS-bufr  12.0.0
nmwrd.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Determine the array size needed to store a BUFR message.
3 C>
4 C> @author J. Ator @date 2005-11-29
5 
6 C> Given an integer array containing Section 0 from a BUFR
7 C> message, this function determines the array size (in integers)
8 C> needed to store the entire BUFR message.
9 C>
10 C> This function is similar to function lmsg(), except that it
11 C> takes an integer array as input rather than a character string.
12 C>
13 C> @param[in] MBAY -- integer(*): Section 0 from a BUFR message
14 C> @returns nmwrd -- integer: Array size (in integers) needed to
15 C> store entire BUFR message
16 C>
17 C> @remarks
18 C> - In some cases, the value returned may be slightly larger than
19 C> the minimum number of integers needed to store the entire BUFR
20 C> message.
21 C>
22 C> @author J. Ator @date 2005-11-29
23  RECURSIVE FUNCTION nmwrd(MBAY) RESULT(IRET)
24 
25  USE modv_im8b
26 
27  COMMON /hrdwrd/ nbytw,nbitw,iord(8)
28 
29  dimension mbay(*)
30 
31 C-----------------------------------------------------------------------
32 C-----------------------------------------------------------------------
33 
34 C Check for I8 integers.
35 
36  IF (im8b) THEN
37  im8b = .false.
38 
39  iret = nmwrd(mbay)
40 
41  im8b = .true.
42  RETURN
43  END IF
44 
45  lenm = iupbs01(mbay,'LENM')
46  IF(lenm.EQ.0) THEN
47  iret = 0
48  ELSE
49  iret = ((lenm/8)+1)*(8/nbytw)
50  ENDIF
51 
52  RETURN
53  END
recursive function iupbs01(MBAY, S01MNEM)
Read a data value from Section 0 or Section 1 of a BUFR message.
Definition: iupbs01.f:69
This module declares and initializes the IM8B variable.
logical, public im8b
Status indicator to keep track of whether all future calls to BUFRLIB subroutines and functions from ...
recursive function nmwrd(MBAY)
Given an integer array containing Section 0 from a BUFR message, this function determines the array s...
Definition: nmwrd.f:24