Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / external / bufr / igetsc.f
blob38e675b42538cbd0b6f208948a2f2afb8de4d2d6
1 FUNCTION IGETSC(LUNIT)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 C SUBPROGRAM: IGETSC
6 C PRGMMR: J. ATOR ORG: NP12 DATE: 2010-05-11
8 C ABSTRACT: THIS FUNCTION RETURNS ANY STATUS CODE THAT WAS INTERNALLY
9 C SET WITHIN THE BUFR ARCHIVE LIBRARY SOFTWARE FOR A GIVEN LOGICAL
10 C UNIT NUMBER
12 C PROGRAM HISTORY LOG:
13 C 2010-05-11 J. ATOR -- ORIGINAL AUTHOR
15 C USAGE: IGETSC (LUNIT)
16 C INPUT ARGUMENT LIST:
17 C LUNIT - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR BUFR FILE
19 C OUTPUT ARGUMENT LIST:
20 C IGETSC - INTEGER: STATUS CODE FOR LUNIT:
21 C 0 = no problems noted with LUNIT
22 C -1 = unable to position LUNIT for appending,
23 C possibly due to an incomplete BUFR message
24 C at the end of the file
26 C REMARKS:
27 C THIS ROUTINE CALLS: BORT STATUS
28 C THIS ROUTINE IS CALLED BY: None
29 C Normally called only by application
30 C programs.
32 C ATTRIBUTES:
33 C LANGUAGE: FORTRAN 77
34 C MACHINE: PORTABLE TO ALL PLATFORMS
36 C$$$
38 INCLUDE 'bufrlib.prm'
40 COMMON /STCODE/ ISCODES(NFILES)
42 C-----------------------------------------------------------------------
43 C-----------------------------------------------------------------------
45 C Make sure the specified logical unit is connected to the library.
47 CALL STATUS(LUNIT,LUN,IL,IM)
48 IF(IL.EQ.0) GOTO 900
50 IGETSC = ISCODES(LUN)
52 RETURN
53 900 CALL BORT('BUFRLIB: IGETSC - BUFR FILE IS CLOSED, IT MUST BE'//
54 . ' OPEN')
55 END