NCEPLIBS-bufr  11.6.0
 All Data Structures Files Functions Variables Pages
numtab.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Get information about a descriptor, based on the FXY value
3 
4 C> This subroutine returns information about a descriptor from the
5 C> internal DX BUFR tables, based on the bit-wise representation of
6 C> the FXY value associated with that descriptor.
7 C>
8 C> @author J. Woollen
9 C> @date 1994-01-06
10 C>
11 C> @param[in] LUN -- integer: Internal I/O stream index associated
12 C> with DX BUFR tables
13 C> @param[in] IDN -- integer: Bit-wise representation of FXY value
14 C> for descriptor
15 C> @param[out] NEMO -- character*(*): Mnemonic associated with IDN
16 C> @param[out] TAB -- character: Type associated with IDN
17 C> - 'B' = Table B descriptor
18 C> - 'D' = Table D descriptor
19 C> - 'C' = Table C operator
20 C> - 'R' = Replication descriptor
21 C> - 'F' = Replication factor
22 C> @param[out] IRET -- integer:
23 C> - Positional index of IDN within internal
24 C> Table B, if TAB = 'B'
25 C> - Positional index of IDN within internal
26 C> Table D, if TAB = 'D'
27 C> - The X portion of the FXY value in IDN, if
28 C> TAB = 'C'
29 C> - ((-1) * the Y portion of the FXY value in IDN),
30 C> if TAB = 'R' and the replication is regular
31 C> (i.e. non-delayed)
32 C> - 5, if TAB = 'R' or TAB = 'F' and the
33 C> replication is 1-bit delayed
34 C> - 4, if TAB = 'R' or TAB = 'F' and the
35 C> replication is 8-bit delayed (stack)
36 C> - 3, if TAB = 'R' or TAB = 'F' and the
37 C> replication is 8-bit delayed
38 C> - 2, if TAB = 'R' or TAB = 'F' and the
39 C> replication is 16-bit delayed
40 C> - 0, otherwise
41 C>
42 C> <b>Program history log:</b>
43 C> | Date | Programmer | Comments |
44 C> | -----|------------|----------|
45 C> | 1994-01-06 | J. Woollen | Original author |
46 C> | 1995-06-28 | J. Woollen | Increased the size of internal BUFR table arrays in order to handle bigger files |
47 C> | 1999-11-18 | J. Woollen | The number of BUFR files which can be opened at one time increased from 10 to 32 |
48 C> | 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 |
49 C> | 2003-11-04 | J. Ator | Added documentation |
50 C> | 2003-11-04 | S. Bender | Added remarks and routine interdependencies |
51 C> | 2003-11-04 | D. Keyser | Unified/portable for WRF; added history documentation; corrected typo |
52 C> | 2005-11-29 | J. Ator | Added support for 207 and 208 operators |
53 C> | 2009-04-21 | J. Ator | Use numtbd() |
54 C> | 2010-03-19 | J. Ator | Added support for 204 and 205 operators |
55 C> | 2012-03-02 | J. Ator | Added support for 203 operator |
56 C> | 2015-02-25 | J. Ator | Allow processing of 2-2x, 2-3x and 2-4X non-marker operators in DX tables |
57 C>
58  SUBROUTINE numtab(LUN,IDN,NEMO,TAB,IRET)
59 
60 C Note that the values within the COMMON /REPTAB/ arrays were
61 C 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 
70 C-----------------------------------------------------------------------
71 C-----------------------------------------------------------------------
72 
73  nemo = ' '
74  iret = 0
75  tab = ' '
76 
77 C LOOK FOR A REPLICATOR OR A REPLICATION FACTOR DESCRIPTOR
78 C --------------------------------------------------------
79 
80  IF(idn.GE.idnr(1,1) .AND. idn.LE.idnr(1,2)) THEN
81 
82 C Note that the above test is checking whether IDN is the bit-
83 C wise representation of a FXY (descriptor) value denoting F=1
84 C regular (i.e. non-delayed) replication, since, as was
85 C initialized within subroutine BFRINI,
86 C 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 
105 C LOOK FOR IDN IN TABLE B AND TABLE D
106 C -----------------------------------
107 
108  CALL numtbd(lun,idn,nemo,tab,iret)
109  IF(iret.NE.0) goto 100
110 
111 C LOOK FOR IDN IN TABLE C
112 C -----------------------
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 
122 C EXIT
123 C ----
124 
125 100 RETURN
126  END
subroutine numtab(LUN, IDN, NEMO, TAB, IRET)
This subroutine returns information about a descriptor from the internal DX BUFR tables, based on the bit-wise representation of the FXY value associated with that descriptor.
Definition: numtab.f:58
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:35
character *(*) function adn30(IDN, L30)
This function converts an FXY value from its bit-wise (integer) representation to its 5 or 6 characte...
Definition: adn30.f:28
INTEGER function iokoper(NEMO)
This function determines whether a specified mnemonic is a Table C operator supported by the BUFRLIB ...
Definition: iokoper.f:23