NCEPLIBS-bufr 11.7.1
numtbd.f
Go to the documentation of this file.
1C> @file
2C> @brief Search for a Table B or Table D descriptor within the
3C> internal DX BUFR tables
4
5C> This subroutine searches for a descriptor within Table B and
6C> Table D of the internal DX BUFR tables.
7C>
8C> @author J. Woollen
9C> @date 2002-05-14
10C>
11C> @param[in] LUN -- integer: Internal I/O stream index associated
12C> with DX BUFR tables
13C> @param[in] IDN -- integer: Bit-wise representation of FXY value
14C> for Table B or Table D descriptor
15C> @param[out] NEMO -- character*(*): Mnemonic associated with IDN
16C> @param[out] TAB -- character: Type associated with IDN
17C> - 'B' = Table B descriptor
18C> - 'D' = Table D descriptor
19C> @param[out] IRET -- integer:
20C> - Positional index of IDN within internal
21C> Table B, if TAB = 'B'
22C> - Positional index of IDN within internal
23C> Table D, if TAB = 'D'
24C> - 0, otherwise
25C>
26C> <b>Program history log:</b>
27C> | Date | Programmer | Comments |
28C> | -----|------------|----------|
29C> | 2002-05-14 | J. Woollen | Original author |
30C> | 2003-11-04 | S. Bender | Added remarks and routine interdependencies |
31C> | 2003-11-04 | D. Keyser | Unified/portable for WRF; added history documentation |
32C> | 2009-04-21 | J. Ator | Use ifxy() for more efficient searching |
33C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
34C>
35 SUBROUTINE numtbd(LUN,IDN,NEMO,TAB,IRET)
36
37 USE moda_tababd
38
39 CHARACTER*(*) NEMO
40 CHARACTER*1 TAB
41
42C-----------------------------------------------------------------------
43C-----------------------------------------------------------------------
44
45 nemo = ' '
46 iret = 0
47 tab = ' '
48
49 IF(idn.GE.ifxy('300000')) THEN
50
51C LOOK FOR IDN IN TABLE D
52C -----------------------
53
54 DO i=1,ntbd(lun)
55 IF(idn.EQ.idnd(i,lun)) THEN
56 nemo = tabd(i,lun)(7:14)
57 tab = 'D'
58 iret = i
59 GOTO 100
60 ENDIF
61 ENDDO
62
63 ELSE
64
65C LOOK FOR IDN IN TABLE B
66C -----------------------
67
68 DO i=1,ntbb(lun)
69 IF(idn.EQ.idnb(i,lun)) THEN
70 nemo = tabb(i,lun)(7:14)
71 tab = 'B'
72 iret = i
73 GOTO 100
74 ENDIF
75 ENDDO
76
77 ENDIF
78
79C EXIT
80C ----
81
82100 RETURN
83 END
function ifxy(ADSC)
This function converts an FXY value from its 6 character representation to its bit-wise (integer) rep...
Definition: ifxy.f:43
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
integer, dimension(:,:), allocatable idnb
Bit-wise representations of the FXY values corresponding to tabb.
Definition: moda_tababd.F:56
character *128, dimension(:,:), allocatable tabb
Table B entries for each internal I/O stream.
Definition: moda_tababd.F:59
integer, dimension(:), allocatable ntbd
Number of Table D entries for each internal I/O stream (up to a maximum of MAXTBD,...
Definition: moda_tababd.F:53
integer, dimension(:), allocatable ntbb
Number of Table B entries for each internal I/O stream (up to a maximum of MAXTBB,...
Definition: moda_tababd.F:52
integer, dimension(:,:), allocatable idnd
Bit-wise representations of the FXY values corresponding to tabd.
Definition: moda_tababd.F:57
character *600, dimension(:,:), allocatable tabd
Table D entries for each internal I/O stream.
Definition: moda_tababd.F:60
subroutine numtbd(LUN, IDN, NEMO, TAB, IRET)
This subroutine searches for a descriptor within Table B and Table D of the internal DX BUFR tables.
Definition: numtbd.f:36