NCEPLIBS-bufr  12.0.1
igetsc.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Check for an abnormal status code associated with the
3 C> processing of a file.
4 C>
5 C> @author J. Ator @date 2010-05-11
6 
7 C> Check for an abnormal status code associated with the
8 C> processing of a file.
9 C>
10 C> This function returns a status code associated with any file that
11 C> was previously opened via a call to subroutine openbf(), so that
12 C> the application program can check whether the BUFRLIB software
13 C> encountered any specific problems while processing the file.
14 C>
15 C> @param[in] LUNIT - integer: Fortran logical unit number for BUFR file.
16 C> @returns igetsc - integer:
17 C> - 0 = no problems were encountered
18 C> - 1 = replication factor overflow in subroutine usrtpl()
19 C>
20 C> @remarks
21 C> - Once subroutine openbf() has been called for LUNIT, this function
22 C> can then be called any number of times and at any point throughout
23 C> the remainder of the life of the application program.
24 C>
25 C> @author J. Ator @date 2010-05-11
26  RECURSIVE FUNCTION igetsc(LUNIT) RESULT(IRET)
27 
28  USE modv_im8b
29 
30  USE moda_stcode
31 
32 C-----------------------------------------------------------------------
33 C-----------------------------------------------------------------------
34 
35 C Check for I8 integers.
36 
37  IF (im8b) THEN
38  im8b = .false.
39 
40  CALL x84(lunit,my_lunit,1)
41  iret = igetsc(my_lunit)
42 
43  im8b = .true.
44  RETURN
45  END IF
46 
47  iret = 0
48 
49 C Make sure the specified logical unit is connected to the library.
50 
51  CALL status(lunit,lun,il,im)
52  IF(il.EQ.0) GOTO 900
53 
54  iret = iscodes(lun)
55 
56  RETURN
57  900 CALL bort('BUFRLIB: IGETSC - BUFR FILE IS CLOSED, IT MUST BE'//
58  . ' OPEN')
59  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
recursive function igetsc(LUNIT)
Check for an abnormal status code associated with the processing of a file.
Definition: igetsc.f:27
This module contains an array declaration used to store a status code for each internal I/O stream in...
integer, dimension(:), allocatable iscodes
Abnormal status codes.
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 status(LUNIT, LUN, IL, IM)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
Definition: status.f:36
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x84.F:19