NCEPLIBS-bufr  12.0.0
iupb.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Decode an integer value from an integer array.
3 C>
4 C> @author J. Woollen @date 1994-01-06
5 
6 C> Decode an integer value from an integer array.
7 C>
8 C> This function decodes an integer value from within a specified
9 C> number of bits of an integer array, starting with the first
10 C> bit of a specified byte of the array.
11 C>
12 C> @param[in] MBAY - integer(*): Array containing encoded value.
13 C> @param[in] NBYT - integer: Byte within MBAY at whose first
14 C> bit to begin decoding.
15 C> @param[in] NBIT - integer: Number of bits to be decoded.
16 C>
17 C> @returns - integer: Decoded value
18 C>
19 C> @author J. Woollen @date 1994-01-06
20  RECURSIVE FUNCTION iupb(MBAY,NBYT,NBIT) RESULT(IRET)
21 
22  USE modv_im8b
23 
24  dimension mbay(*)
25 
26 C----------------------------------------------------------------------
27 C----------------------------------------------------------------------
28 
29 C Check for I8 integers.
30 
31  IF(im8b) THEN
32  im8b=.false.
33 
34  CALL x84(nbyt,my_nbyt,1)
35  CALL x84(nbit,my_nbit,1)
36  iret = iupb(mbay,my_nbyt,my_nbit)
37 
38  im8b=.true.
39  RETURN
40  ENDIF
41 
42  mbit = (nbyt-1)*8
43  CALL upb(iret,nbit,mbay,mbit)
44 
45  RETURN
46  END
recursive function iupb(MBAY, NBYT, NBIT)
Decode an integer value from an integer array.
Definition: iupb.f:21
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 ...
subroutine upb(NVAL, NBITS, IBAY, IBIT)
This subroutine decodes an integer value from within a specified number of bits of an integer array,...
Definition: upb.f:28
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x84.F:19