NCEPLIBS-bufr  11.6.0
 All Data Structures Files Functions Variables Pages
getntbe.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Read the first line of the next entry from a master
3 C> table B, table D or Code/Flag table file
4 
5 C> This subroutine reads the first line of the next entry from
6 C> the specified ASCII master table B, table D or table F (Code/Flag)
7 C> file. This line contains, among other things, the FXY number
8 C> corresponding to this entry.
9 C>
10 C> @author J. Ator
11 C> @date 2007-01-19
12 C>
13 C> @param[in] LUNT -- integer: Fortran logical unit number of
14 C> master table B, table D or Code/Flag table file
15 C> @param[out] IFXYN -- integer: Bit-wise representation of FXY number
16 C> for next table entry
17 C> @param[out] LINE -- character*(*): First line of next table entry
18 C> @param[out] IRET -- integer: return code
19 C> - 0 = normal return
20 C> - -1 = end-of-file encountered while reading
21 C> from LUNT
22 C> - -2 = I/O error encountered while reading
23 C> from LUNT
24 C>
25 C> <b>Program history log:</b>
26 C> | Date | Programmer | Comments |
27 C> | -----|------------|----------|
28 C> | 2007-01-19 | J. Ator | Original author |
29 C>
30  SUBROUTINE getntbe ( LUNT, IFXYN, LINE, IRET )
31 
32  character*(*) line
33  character*128 bort_str1, bort_str2
34  character*20 tags(4)
35  character*6 adsc
36 
37 C-----------------------------------------------------------------------
38 C-----------------------------------------------------------------------
39 
40 C Get the first line of the next entry in the file.
41 
42  iret = igetntbl( lunt, line )
43  IF ( iret .EQ. 0 ) THEN
44 
45 C The first field within this line should contain the
46 C FXY number.
47 
48  CALL parstr( line(1:20), tags, 4, ntag, '|', .false. )
49  IF ( ntag .LT. 1 ) goto 900
50  IF ( igetfxy( tags(1), adsc ) .NE. 0 ) goto 900
51 
52 C Store the bit-wise representation of the FXY number.
53 
54  ifxyn = ifxy( adsc )
55  ENDIF
56 
57  RETURN
58 
59  900 bort_str1 = 'BUFRLIB: GETNTBE - CARD BEGINNING WITH: ' //
60  . line(1:20)
61  bort_str2 = ' HAS BAD OR MISSING FXY NUMBER'
62  CALL bort2(bort_str1,bort_str2)
63 
64  END
subroutine parstr(STR, TAGS, MTAG, NTAG, SEP, LIMIT80)
THIS SUBROUTINE PARSES A STRING CONTAINING ONE OR MORE SUBSTRINGS INTO AN ARRAY OF SUBSTRINGS...
Definition: parstr.f:37
subroutine bort2(STR1, STR2)
This subroutine calls subroutine errwrt() to log two error messages, then calls subroutine bort_exit(...
Definition: bort2.f:22
function igetfxy(STR, CFXY)
THIS FUNCTION LOOKS FOR AND RETURNS A VALID FXY NUMBER FROM WITHIN THE GIVEN INPUT STRING...
Definition: igetfxy.f:30
function ifxy(ADSC)
This function converts an FXY value from its 6 character representation to its bit-wise (integer) rep...
Definition: ifxy.f:42
function igetntbl(LUNT, LINE)
This subroutine reads the next line from an ASCII master table B, table D or Code/Flag table file...
Definition: igetntbl.f:28
subroutine getntbe(LUNT, IFXYN, LINE, IRET)
This subroutine reads the first line of the next entry from the specified ASCII master table B...
Definition: getntbe.f:30