NCEPLIBS-bufr 11.7.1
ifbget.f
Go to the documentation of this file.
1C> @file
2C> @brief Check whether there are any more data subsets available to be
3C> read from a BUFR message.
4
5C> This function checks whether there are any more data subsets
6C> available to be read from within the BUFR message that is
7C> open for reading via the most recent call to any of the
8C> [message-reading subroutines](@ref hierarchy) for a specified
9C> Fortran logical unit.
10C>
11C> @author J. Woollen
12C> @date 1994-01-06
13C>
14C> @param[in] LUNIT -- integer: Fortran logical unit number for
15C> BUFR file
16C> @returns ifbget -- integer:
17C> - 0 = there is at least one more data subset
18C> to be read from the BUFR message
19C> - -1 = there are no more data subsets
20C> to be read from the BUFR message
21C>
22C> <b>Program history log:</b>
23C> | Date | Programmer | Comments |
24C> | -----|------------|----------|
25C> | 1994-01-06 | J. Woollen | Original author |
26C> | 1998-07-08 | J. Woollen | Replaced call to Cray library routine ABORT with call to new internal routine bort() |
27C> | 1999-11-18 | J. Woollen | The number of BUFR files which can be opened at one time increased from 10 to 32 (necessary in order to process multiple BUFR files under the MPI) |
28C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
29C>
30 FUNCTION ifbget(LUNIT)
31
32 USE moda_msgcwd
33
34C-----------------------------------------------------------------------
35C-----------------------------------------------------------------------
36
37C MAKE SURE A FILE/MESSAGE IS OPEN FOR INPUT
38C ------------------------------------------
39
40 CALL status(lunit,lun,il,im)
41 IF(il.EQ.0) GOTO 900
42 IF(il.GT.0) GOTO 901
43 IF(im.EQ.0) GOTO 902
44
45C SEE IF THERE IS ANOTHER SUBSET IN THE MESSAGE
46C ---------------------------------------------
47
48 IF(nsub(lun).LT.msub(lun)) THEN
49 ifbget = 0
50 ELSE
51 ifbget = -1
52 ENDIF
53
54C EXITS
55C -----
56
57 RETURN
58900 CALL bort('BUFRLIB: IFBGET - INPUT BUFR FILE IS CLOSED, IT '//
59 . 'MUST BE OPEN FOR INPUT')
60901 CALL bort('BUFRLIB: IFBGET - INPUT BUFR FILE IS OPEN FOR '//
61 . 'OUTPUT, IT MUST BE OPEN FOR INPUT')
62902 CALL bort('BUFRLIB: IFBGET - A MESSAGE MUST BE OPEN IN INPUT '//
63 . 'BUFR FILE, NONE ARE')
64 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
function ifbget(LUNIT)
This function checks whether there are any more data subsets available to be read from within the BUF...
Definition: ifbget.f:31
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
Definition: status.f:56