NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
numtbd.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 2002-05-14
3 
4 C> THIS SUBROUTINE SEARCHES FOR AN INTEGER IDN, CONTAINING THE
5 C> BIT-WISE REPRESENTATION OF A DESCRIPTOR (FXY) VALUE, WITHIN THE
6 C> INTERNAL BUFR TABLE B AND D ARRAYS IN MODULE TABABD. IF FOUND,
7 C> IT RETURNS THE CORRESPONDING MNEMONIC AND OTHER INFORMATION FROM
8 C> WITHIN THESE ARRAYS. IF IDN IS NOT FOUND, IT RETURNS WITH IRET=0.
9 C>
10 C> PROGRAM HISTORY LOG:
11 C> 2002-05-14 J. WOOLLEN -- ORIGINAL AUTHOR
12 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
13 C> INTERDEPENDENCIES
14 C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
15 C> DOCUMENTATION (INCLUDING HISTORY)
16 C> 2009-04-21 J. ATOR -- USE IFXY FOR MORE EFFICIENT SEARCHING
17 C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
18 C>
19 C> USAGE: CALL NUMTBD (LUN, IDN, NEMO, TAB, IRET)
20 C> INPUT ARGUMENT LIST:
21 C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
22 C> IDN - INTEGER: BIT-WISE REPRESENTATION OF DESCRIPTOR (FXY)
23 C> VALUE
24 C>
25 C> OUTPUT ARGUMENT LIST:
26 C> NEMO - CHARACTER*(*): MNEMONIC CORRESPONDING TO IDN
27 C> TAB - CHARACTER*1: TYPE OF FXY VALUE THAT IS BIT-WISE
28 C> REPRESENTED BY IDN:
29 C> 'B' = BUFR Table B descriptor
30 C> 'D' = BUFR Table D descriptor
31 C> IRET - INTEGER: RETURN VALUE (SEE REMARKS)
32 C>
33 C> REMARKS:
34 C> THE INTERPRETATION OF THE RETURN VALUE IRET DEPENDS UPON THE
35 C> RETURN VALUE OF TAB, AS FOLLOWS:
36 C>
37 C> IF ( TAB = 'B' ) THEN
38 C> IRET = positional index of IDN within internal BUFR Table B
39 C> array
40 C> ELSE IF ( TAB = 'D') THEN
41 C> IRET = positional index of IDN within internal BUFR Table D
42 C> array
43 C> ELSE IF ( IRET = 0 ) THEN
44 C> IDN was not found in internal BUFR Table B or D
45 C> END IF
46 C>
47 C>
48 C> THIS ROUTINE CALLS: IFXY
49 C> THIS ROUTINE IS CALLED BY: GETCFMNG NUMTAB RESTD STSEQ
50 C> UFDUMP
51 C> Normally not called by any application
52 C> programs.
53 C>
54  SUBROUTINE numtbd(LUN,IDN,NEMO,TAB,IRET)
55 
56  USE moda_tababd
57 
58  CHARACTER*(*) nemo
59  CHARACTER*1 tab
60 
61 C-----------------------------------------------------------------------
62 C-----------------------------------------------------------------------
63 
64  nemo = ' '
65  iret = 0
66  tab = ' '
67 
68  IF(idn.GE.ifxy('300000')) THEN
69 
70 C LOOK FOR IDN IN TABLE D
71 C -----------------------
72 
73  DO i=1,ntbd(lun)
74  IF(idn.EQ.idnd(i,lun)) THEN
75  nemo = tabd(i,lun)(7:14)
76  tab = 'D'
77  iret = i
78  goto 100
79  ENDIF
80  ENDDO
81 
82  ELSE
83 
84 C LOOK FOR IDN IN TABLE B
85 C -----------------------
86 
87  DO i=1,ntbb(lun)
88  IF(idn.EQ.idnb(i,lun)) THEN
89  nemo = tabb(i,lun)(7:14)
90  tab = 'B'
91  iret = i
92  goto 100
93  ENDIF
94  ENDDO
95 
96  ENDIF
97 
98 C EXIT
99 C ----
100 
101 100 RETURN
102  END
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
subroutine numtbd(LUN, IDN, NEMO, TAB, IRET)
THIS SUBROUTINE SEARCHES FOR AN INTEGER IDN, CONTAINING THE BIT-WISE REPRESENTATION OF A DESCRIPTOR (...
Definition: numtbd.f:54
function ifxy(ADSC)
THIS FUNCTION RETURNS THE INTEGER CORRESPONDING TO THE BIT-WISE REPRESENTATION OF AN INPUT CHARACTER ...
Definition: ifxy.f:49