updated top-level README and version_decl for V4.5 (#1847)
[WRF.git] / var / external / bufr / getntbe.f
blob8e56f737a8e6b13075a7df4c9c15dc34d884667b
1 SUBROUTINE GETNTBE ( LUNT, IFXYN, LINE, IRET )
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 C SUBPROGRAM: GETNTBE
6 C PRGMMR: ATOR ORG: NP12 DATE: 2007-01-19
8 C ABSTRACT: THIS SUBROUTINE GETS THE FIRST LINE OF THE NEXT ENTRY IN
9 C THE SPECIFIED ASCII MASTER TABLE B OR MASTER TABLE D FILE. THIS
10 C LINE CONTAINS, AMONG OTHER THINGS, THE FXY NUMBER CORRESPONDING TO
11 C THIS ENTRY.
13 C PROGRAM HISTORY LOG:
14 C 2007-01-19 J. ATOR -- ORIGINAL AUTHOR
16 C USAGE: CALL GETNTBE ( LUNT, IFXYN, LINE, IRET )
17 C INPUT ARGUMENT LIST:
18 C LUNT - INTEGER: FORTRAN LOGICAL UNIT NUMBER OF ASCII FILE
19 C CONTAINING MASTER TABLE B OR MASTER TABLE D INFORMATION
21 C OUTPUT ARGUMENT LIST:
22 C IFXYN - INTEGER: BIT-WISE REPRESENTATION OF FXY NUMBER FOR
23 C NEXT TABLE ENTRY
24 C LINE - CHARACTER*(*): FIRST LINE OF NEXT TABLE ENTRY
25 C IRET - INTEGER: RETURN CODE:
26 C 0 = normal return
27 C -1 = end-of-file encountered while reading
28 C from LUNT
29 C -2 = I/O error encountered while reading
30 C from LUNT
32 C REMARKS:
33 C THIS ROUTINE CALLS: BORT2 IGETNTBL IGETFXY IFXY
34 C PARSTR
35 C THIS ROUTINE IS CALLED BY: RDMTBB RDMTBD
36 C Normally not called by any application
37 C programs.
39 C ATTRIBUTES:
40 C LANGUAGE: FORTRAN 77
41 C MACHINE: PORTABLE TO ALL PLATFORMS
43 C$$$
45 CHARACTER*(*) LINE
46 CHARACTER*128 BORT_STR1, BORT_STR2
47 CHARACTER*20 TAGS(4)
48 CHARACTER*6 ADSC
50 C-----------------------------------------------------------------------
51 C-----------------------------------------------------------------------
53 C Get the first line of the next entry in the file.
55 IRET = IGETNTBL ( LUNT, LINE )
56 IF ( IRET .EQ. 0 ) THEN
58 C The first field within this line should contain the
59 C FXY number.
61 CALL PARSTR ( LINE(1:20), TAGS, 4, NTAG, '|', .FALSE. )
62 IF ( NTAG .LT. 1 ) GOTO 900
63 IF ( IGETFXY ( TAGS(1), ADSC ) .NE. 0 ) GOTO 900
65 C Store the bit-wise representation of the FXY number.
67 IFXYN = IFXY ( ADSC )
68 ENDIF
70 RETURN
72 900 BORT_STR1 = 'BUFRLIB: GETNTBE - CARD BEGINNING WITH: ' //
73 . LINE(1:20)
74 BORT_STR2 = ' HAS BAD OR MISSING FXY NUMBER'
75 CALL BORT2(BORT_STR1,BORT_STR2)
77 END