NCEPLIBS-bufr  12.0.1
ireadmg.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Read the next message from a BUFR file that was previously
3 C> opened for reading.
4 C>
5 C> @author J. Woollen @date 1994-01-06
6 
7 C> Calls NCEPLIBS-bufr subroutine readmg() and passes
8 C> back its return code as the function value.
9 C>
10 C> The use of this function allows the return code from readmg() to be
11 C> used as the target variable within an iterative program loop.
12 C>
13 C> @param[in] LUNIT - integer: Fortran logical unit number for BUFR file
14 C> @param[out] SUBSET - character*8: Table A mnemonic for type of BUFR
15 C> message that was read (see [DX BUFR Tables](@ref dfbftab)
16 C> for further information about Table A mnemonics)
17 C> @param[out] IDATE - integer: date-time stored within Section 1 of
18 C> BUFR message that was read, in format of either YYMMDDHH or YYYYMMDDHH,
19 C> depending on the most recent call to subroutine datelen()
20 C> @returns ireadmg - integer: Return code:
21 C> - 0 = new BUFR message was successfully read into internal arrays
22 C> - -1 = there are no more BUFR messages in the file connected to logical
23 C> unit LUNIT
24 C>
25 C> @author J. Woollen @date 1994-01-06
26  RECURSIVE FUNCTION ireadmg(LUNIT,SUBSET,IDATE) RESULT(IRET)
27 
28  USE modv_im8b
29 
30  CHARACTER*8 subset
31 
32  IF(im8b) THEN
33  im8b=.false.
34 
35  CALL x84(lunit,my_lunit,1)
36  iret=ireadmg(my_lunit,subset,idate)
37  CALL x48(idate,idate,1)
38 
39  im8b=.true.
40  RETURN
41  ENDIF
42 
43  CALL readmg(lunit,subset,idate,iret)
44 
45  END FUNCTION
recursive function ireadmg(LUNIT, SUBSET, IDATE)
Calls NCEPLIBS-bufr subroutine readmg() and passes back its return code as the function value.
Definition: ireadmg.f:27
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 subroutine readmg(LUNXX, SUBSET, JDATE, IRET)
Reads the next BUFR message from logical unit ABS(LUNXX) into internal arrays.
Definition: readmg.f:52
subroutine x48(IIN4, IOUT8, NVAL)
Encode one or more 4-byte integer values as 8-byte integer values.
Definition: x48.F:19
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x84.F:19