NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
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 
5 C> This function returns a status code associated with any file that
6 C> was previously opened via a call to subroutine openbf(), so that
7 C> the application program can check whether the BUFRLIB software
8 C> encountered any specific problems while processing the file.
9 C>
10 C> @author J. Ator
11 C> @date 2010-05-11
12 C>
13 C> @param[in] LUNIT - integer: Fortran logical unit number for
14 C> BUFR file
15 C> @returns igetsc - integer:
16 C> - 0 = no problems were encountered
17 C>
18 C> @remarks
19 C> - Once subroutine openbf() has been called for LUNIT, this function
20 C> can then be called any number of times and at any point throughout
21 C> the remainder of the life of the application program. However, it
22 C> is most typically called immediately prior to exiting an application
23 C> program.
24 C>
25 C> <b>Program history log:</b>
26 C> - 2010-05-11 J. Ator -- Original author
27 C> - 2014-12-10 J. Ator -- Use modules instead of COMMON blocks
28 C>
29  FUNCTION igetsc(LUNIT)
30 
31  USE moda_stcode
32 
33 C-----------------------------------------------------------------------
34 C-----------------------------------------------------------------------
35 
36 C Make sure the specified logical unit is connected to the library.
37 
38  CALL status(lunit,lun,il,im)
39  IF(il.EQ.0) goto 900
40 
41  igetsc = iscodes(lun)
42 
43  RETURN
44  900 CALL bort('BUFRLIB: IGETSC - BUFR FILE IS CLOSED, IT MUST BE'//
45  . ' OPEN')
46  END
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
Definition: status.f:61
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
function igetsc(LUNIT)
This function returns a status code associated with any file that was previously opened via a call to...
Definition: igetsc.f:29