NCEPLIBS-bufr 11.7.1
numtab.f
Go to the documentation of this file.
1C> @file
2C> @brief Get information about a descriptor, based on the FXY value
3
4C> This subroutine returns information about a descriptor from the
5C> internal DX BUFR tables, based on the bit-wise representation of
6C> the FXY value associated with that descriptor.
7C>
8C> @author J. Woollen
9C> @date 1994-01-06
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 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> - 'C' = Table C operator
20C> - 'R' = Replication descriptor
21C> - 'F' = Replication factor
22C> @param[out] IRET -- integer:
23C> - Positional index of IDN within internal
24C> Table B, if TAB = 'B'
25C> - Positional index of IDN within internal
26C> Table D, if TAB = 'D'
27C> - The X portion of the FXY value in IDN, if
28C> TAB = 'C'
29C> - ((-1) * the Y portion of the FXY value in IDN),
30C> if TAB = 'R' and the replication is regular
31C> (i.e. non-delayed)
32C> - 5, if TAB = 'R' or TAB = 'F' and the
33C> replication is 1-bit delayed
34C> - 4, if TAB = 'R' or TAB = 'F' and the
35C> replication is 8-bit delayed (stack)
36C> - 3, if TAB = 'R' or TAB = 'F' and the
37C> replication is 8-bit delayed
38C> - 2, if TAB = 'R' or TAB = 'F' and the
39C> replication is 16-bit delayed
40C> - 0, otherwise
41C>
42C> <b>Program history log:</b>
43C> | Date | Programmer | Comments |
44C> | -----|------------|----------|
45C> | 1994-01-06 | J. Woollen | Original author |
46C> | 1995-06-28 | J. Woollen | Increased the size of internal BUFR table arrays in order to handle bigger files |
47C> | 1999-11-18 | J. Woollen | The number of BUFR files which can be opened at one time increased from 10 to 32 |
48C> | 2000-09-19 | J. Woollen | Added capability to encode and decode data using the operator descriptors (BUFR table C) for changing width and changing scale |
49C> | 2003-11-04 | J. Ator | Added documentation |
50C> | 2003-11-04 | S. Bender | Added remarks and routine interdependencies |
51C> | 2003-11-04 | D. Keyser | Unified/portable for WRF; added history documentation; corrected typo |
52C> | 2005-11-29 | J. Ator | Added support for 207 and 208 operators |
53C> | 2009-04-21 | J. Ator | Use numtbd() |
54C> | 2010-03-19 | J. Ator | Added support for 204 and 205 operators |
55C> | 2012-03-02 | J. Ator | Added support for 203 operator |
56C> | 2015-02-25 | J. Ator | Allow processing of 2-2x, 2-3x and 2-4X non-marker operators in DX tables |
57C>
58 SUBROUTINE numtab(LUN,IDN,NEMO,TAB,IRET)
59
60C Note that the values within the COMMON /REPTAB/ arrays were
61C initialized within subroutine BFRINI.
62
63 COMMON /reptab/ idnr(5,2),typs(5,2),reps(5,2),lens(5)
64
65 CHARACTER*(*) NEMO
66 CHARACTER*6 ADN30,CID
67 CHARACTER*3 TYPS
68 CHARACTER*1 REPS,TAB
69
70C-----------------------------------------------------------------------
71C-----------------------------------------------------------------------
72
73 nemo = ' '
74 iret = 0
75 tab = ' '
76
77C LOOK FOR A REPLICATOR OR A REPLICATION FACTOR DESCRIPTOR
78C --------------------------------------------------------
79
80 IF(idn.GE.idnr(1,1) .AND. idn.LE.idnr(1,2)) THEN
81
82C Note that the above test is checking whether IDN is the bit-
83C wise representation of a FXY (descriptor) value denoting F=1
84C regular (i.e. non-delayed) replication, since, as was
85C initialized within subroutine BFRINI,
86C IDNR(1,1) = IFXY('101000'), and IDNR(1,2) = IFXY('101255').
87
88 tab = 'R'
89 iret = -mod(idn,256)
90 GOTO 100
91 ENDIF
92
93 DO i=2,5
94 IF(idn.EQ.idnr(i,1)) THEN
95 tab = 'R'
96 iret = i
97 GOTO 100
98 ELSEIF(idn.EQ.idnr(i,2)) THEN
99 tab = 'F'
100 iret = i
101 GOTO 100
102 ENDIF
103 ENDDO
104
105C LOOK FOR IDN IN TABLE B AND TABLE D
106C -----------------------------------
107
108 CALL numtbd(lun,idn,nemo,tab,iret)
109 IF(iret.NE.0) GOTO 100
110
111C LOOK FOR IDN IN TABLE C
112C -----------------------
113
114 cid = adn30(idn,6)
115 IF (iokoper(cid).EQ.1) THEN
116 nemo = cid(1:6)
117 READ(nemo,'(1X,I2)') iret
118 tab = 'C'
119 GOTO 100
120 ENDIF
121
122C EXIT
123C ----
124
125100 RETURN
126 END
integer function iokoper(NEMO)
This function determines whether a specified mnemonic is a Table C operator supported by the BUFRLIB ...
Definition: iokoper.f:24
subroutine numtab(LUN, IDN, NEMO, TAB, IRET)
This subroutine returns information about a descriptor from the internal DX BUFR tables,...
Definition: numtab.f:59
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