1 SUBROUTINE NUMTBD
(LUN
,IDN
,NEMO
,TAB
,IRET
)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 2002-05-14
8 C ABSTRACT: THIS SUBROUTINE SEARCHES FOR AN INTEGER IDN, CONTAINING THE
9 C BIT-WISE REPRESENTATION OF A DESCRIPTOR (FXY) VALUE, WITHIN THE
10 C INTERNAL BUFR TABLE B AND D ARRAYS IN COMMON BLOCK /TABABD/. IF
11 C FOUND, IT RETURNS THE CORRESPONDING MNEMONIC AND OTHER INFORMATION
12 C FROM WITHIN THESE ARRAYS. IF IDN IS NOT FOUND, IT RETURNS WITH
15 C PROGRAM HISTORY LOG:
16 C 2002-05-14 J. WOOLLEN -- ORIGINAL AUTHOR
17 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
19 C 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
20 C DOCUMENTATION (INCLUDING HISTORY)
21 C 2009-04-21 J. ATOR -- USE IFXY FOR MORE EFFICIENT SEARCHING
23 C USAGE: CALL NUMTBD (LUN, IDN, NEMO, TAB, IRET)
24 C INPUT ARGUMENT LIST:
25 C LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
26 C IDN - INTEGER: BIT-WISE REPRESENTATION OF DESCRIPTOR (FXY)
29 C OUTPUT ARGUMENT LIST:
30 C NEMO - CHARACTER*(*): MNEMONIC CORRESPONDING TO IDN
31 C TAB - CHARACTER*1: TYPE OF FXY VALUE THAT IS BIT-WISE
33 C 'B' = BUFR Table B descriptor
34 C 'D' = BUFR Table D descriptor
35 C IRET - INTEGER: RETURN VALUE (SEE REMARKS)
38 C THE INTERPRETATION OF THE RETURN VALUE IRET DEPENDS UPON THE
39 C RETURN VALUE OF TAB, AS FOLLOWS:
41 C IF ( TAB = 'B' ) THEN
42 C IRET = positional index of IDN within internal BUFR Table B
44 C ELSE IF ( TAB = 'D') THEN
45 C IRET = positional index of IDN within internal BUFR Table D
47 C ELSE IF ( IRET = 0 ) THEN
48 C IDN was not found in internal BUFR Table B or D
52 C THIS ROUTINE CALLS: IFXY
53 C THIS ROUTINE IS CALLED BY: NUMTAB RESTD STSEQ
54 C Normally not called by any application
58 C LANGUAGE: FORTRAN 77
59 C MACHINE: PORTABLE TO ALL PLATFORMS
65 COMMON /TABABD
/ NTBA
(0:NFILES
),NTBB
(0:NFILES
),NTBD
(0:NFILES
),
66 . MTAB
(MAXTBA
,NFILES
),IDNA
(MAXTBA
,NFILES
,2),
67 . IDNB
(MAXTBB
,NFILES
),IDND
(MAXTBD
,NFILES
),
68 . TABA
(MAXTBA
,NFILES
),TABB
(MAXTBB
,NFILES
),
77 C-----------------------------------------------------------------------
78 C-----------------------------------------------------------------------
84 IF(IDN
.GE
.IFXY
('300000')) THEN
86 C LOOK FOR IDN IN TABLE D
87 C -----------------------
90 IF(IDN
.EQ
.IDND
(I
,LUN
)) THEN
91 NEMO
= TABD
(I
,LUN
)(7:14)
100 C LOOK FOR IDN IN TABLE B
101 C -----------------------
104 IF(IDN
.EQ
.IDNB
(I
,LUN
)) THEN
105 NEMO
= TABB
(I
,LUN
)(7:14)