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