NCEPLIBS-bufr  11.5.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 an ASCII master
3 C> table B, table D or Code/Flag file.
4 
5 C> This subroutine gets the first line of the next entry in
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 ASCII file
14 C> containing master table B, table D or table F (Code/Flag) information
15 C> @param[out] IFXYN integer: bit-wise representation of FXY number for
16 C> 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 from LUNT
21 C> - -2 = I/O error encountered while reading from LUNT
22 C>
23 C> <b>Program history log:</b>
24 C> - 2007-01-19 J. Ator -- Original author
25 C>
26  SUBROUTINE getntbe ( LUNT, IFXYN, LINE, IRET )
27 
28  character*(*) line
29  character*128 bort_str1, bort_str2
30  character*20 tags(4)
31  character*6 adsc
32 
33 C-----------------------------------------------------------------------
34 C-----------------------------------------------------------------------
35 
36 C Get the first line of the next entry in the file.
37 
38  iret = igetntbl( lunt, line )
39  IF ( iret .EQ. 0 ) THEN
40 
41 C The first field within this line should contain the
42 C FXY number.
43 
44  CALL parstr( line(1:20), tags, 4, ntag, '|', .false. )
45  IF ( ntag .LT. 1 ) goto 900
46  IF ( igetfxy( tags(1), adsc ) .NE. 0 ) goto 900
47 
48 C Store the bit-wise representation of the FXY number.
49 
50  ifxyn = ifxy( adsc )
51  ENDIF
52 
53  RETURN
54 
55  900 bort_str1 = 'BUFRLIB: GETNTBE - CARD BEGINNING WITH: ' //
56  . line(1:20)
57  bort_str2 = ' HAS BAD OR MISSING FXY NUMBER'
58  CALL bort2(bort_str1,bort_str2)
59 
60  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:20
function igetfxy(STR, CFXY)
THIS FUNCTION LOOKS FOR AND RETURNS A VALID FXY NUMBER FROM WITHIN THE GIVEN INPUT STRING...
Definition: igetfxy.f:28
function ifxy(ADSC)
THIS FUNCTION RETURNS THE INTEGER CORRESPONDING TO THE BIT-WISE REPRESENTATION OF AN INPUT CHARACTER ...
Definition: ifxy.f:49
function igetntbl(LUNT, LINE)
THIS FUNCTION GETS THE NEXT LINE FROM THE ASCII MASTER TABLE FILE SPECIFIED BY LUNT, IGNORING ANY BLANK LINES OR COMMENT LINES IN THE PROCESS.
Definition: igetntbl.f:31
subroutine getntbe(LUNT, IFXYN, LINE, IRET)
This subroutine gets the first line of the next entry in the specified ASCII master table B...
Definition: getntbe.f:26