NCEPLIBS-bufr 11.7.1
getntbe.f
Go to the documentation of this file.
1C> @file
2C> @brief Read the first line of the next entry from a master
3C> table B, table D or Code/Flag table file
4
5C> This subroutine reads the first line of the next entry from
6C> the specified ASCII master table B, table D or table F (Code/Flag)
7C> file. This line contains, among other things, the FXY number
8C> corresponding to this entry.
9C>
10C> @author J. Ator
11C> @date 2007-01-19
12C>
13C> @param[in] LUNT -- integer: Fortran logical unit number of
14C> master table B, table D or Code/Flag table file
15C> @param[out] IFXYN -- integer: Bit-wise representation of FXY number
16C> for next table entry
17C> @param[out] LINE -- character*(*): First line of next table entry
18C> @param[out] IRET -- integer: return code
19C> - 0 = normal return
20C> - -1 = end-of-file encountered while reading
21C> from LUNT
22C> - -2 = I/O error encountered while reading
23C> from LUNT
24C>
25C> <b>Program history log:</b>
26C> | Date | Programmer | Comments |
27C> | -----|------------|----------|
28C> | 2007-01-19 | J. Ator | Original author |
29C>
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
37C-----------------------------------------------------------------------
38C-----------------------------------------------------------------------
39
40C Get the first line of the next entry in the file.
41
42 iret = igetntbl( lunt, line )
43 IF ( iret .EQ. 0 ) THEN
44
45C The first field within this line should contain the
46C 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
52C 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 bort2(STR1, STR2)
This subroutine calls subroutine errwrt() to log two error messages, then calls subroutine bort_exit(...
Definition: bort2.f:23
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:31
function ifxy(ADSC)
This function converts an FXY value from its 6 character representation to its bit-wise (integer) rep...
Definition: ifxy.f:43
function igetfxy(STR, CFXY)
THIS FUNCTION LOOKS FOR AND RETURNS A VALID FXY NUMBER FROM WITHIN THE GIVEN INPUT STRING.
Definition: igetfxy.f:31
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:29
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:38