NCEPLIBS-bufr  11.6.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> | Date | Programmer | Comments |
27 C> | -----|------------|----------|
28 C> | 2010-05-11 | J. Ator | Original author |
29 C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
30 C>
31  FUNCTION igetsc(LUNIT)
32 
33  USE moda_stcode
34 
35 C-----------------------------------------------------------------------
36 C-----------------------------------------------------------------------
37 
38 C Make sure the specified logical unit is connected to the library.
39 
40  CALL status(lunit,lun,il,im)
41  IF(il.EQ.0) goto 900
42 
43  igetsc = iscodes(lun)
44 
45  RETURN
46  900 CALL bort('BUFRLIB: IGETSC - BUFR FILE IS CLOSED, IT MUST BE'//
47  . ' OPEN')
48  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:55
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22
function igetsc(LUNIT)
This function returns a status code associated with any file that was previously opened via a call to...
Definition: igetsc.f:31