NCEPLIBS-bufr  12.0.0
numtbd.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Search for a Table B or Table D descriptor within the
3 C> internal DX BUFR tables.
4 C>
5 C> @author J. Woollen @date 2002-05-14
6 
7 C> Search for a Table B or Table D descriptor within the
8 C> internal DX BUFR tables.
9 C>
10 C> @param[in] LUN - integer: File ID.
11 C> @param[in] IDN - integer: Bit-wise representation of FXY value
12 C> for Table B or Table D descriptor.
13 C> @param[out] NEMO - character*(*): Mnemonic associated with IDN.
14 C> @param[out] TAB - character: Type associated with IDN:
15 C> - 'B' = Table B descriptor
16 C> - 'D' = Table D descriptor
17 C> @param[out] IRET - integer:
18 C> - Positional index of IDN within internal Table B, if TAB = 'B'
19 C> - Positional index of IDN within internal Table D, if TAB = 'D'
20 C> - 0, otherwise
21 C>
22 C> @author J. Woollen @date 2002-05-14
23  SUBROUTINE numtbd(LUN,IDN,NEMO,TAB,IRET)
24 
25  USE moda_tababd
26 
27  CHARACTER*(*) NEMO
28  CHARACTER*1 TAB
29 
30 C-----------------------------------------------------------------------
31 C-----------------------------------------------------------------------
32 
33  nemo = ' '
34  iret = 0
35  tab = ' '
36 
37  IF(idn.GE.ifxy('300000')) THEN
38 
39 C LOOK FOR IDN IN TABLE D
40 C -----------------------
41 
42  DO i=1,ntbd(lun)
43  IF(idn.EQ.idnd(i,lun)) THEN
44  nemo = tabd(i,lun)(7:14)
45  tab = 'D'
46  iret = i
47  GOTO 100
48  ENDIF
49  ENDDO
50 
51  ELSE
52 
53 C LOOK FOR IDN IN TABLE B
54 C -----------------------
55 
56  DO i=1,ntbb(lun)
57  IF(idn.EQ.idnb(i,lun)) THEN
58  nemo = tabb(i,lun)(7:14)
59  tab = 'B'
60  iret = i
61  GOTO 100
62  ENDIF
63  ENDDO
64 
65  ENDIF
66 
67 C EXIT
68 C ----
69 
70 100 RETURN
71  END
function ifxy(ADSC)
Convert an FXY value from its 6 character representation to its WMO bit-wise representation.
Definition: ifxy.f:34
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
character *600, dimension(:,:), allocatable tabd
Table D entries for each internal I/O stream.
integer, dimension(:), allocatable ntbd
Number of Table D entries for each internal I/O stream (up to a maximum of MAXTBD,...
integer, dimension(:), allocatable ntbb
Number of Table B entries for each internal I/O stream (up to a maximum of MAXTBB,...
integer, dimension(:,:), allocatable idnd
Bit-wise representations of the FXY values corresponding to tabd.
integer, dimension(:,:), allocatable idnb
Bit-wise representations of the FXY values corresponding to tabb.
character *128, dimension(:,:), allocatable tabb
Table B entries for each internal I/O stream.
subroutine numtbd(LUN, IDN, NEMO, TAB, IRET)
Search for a Table B or Table D descriptor within the internal DX BUFR tables.
Definition: numtbd.f:24