NCEPLIBS-bufr  11.7.0
 All Data Structures Files Functions Variables Pages
nemtab.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Get information about a descriptor, based on the mnemonic
3 
4 C> This subroutine returns information about a descriptor from the
5 C> internal DX BUFR tables, based on the mnemonic associated with
6 C> 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] NEMO -- character*(*): Mnemonic
14 C> @param[out] IDN -- integer: Bit-wise representation of FXY value
15 C> for descriptor associated with NEMO
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> @param[out] IRET -- integer:
21 C> - Positional index of IDN within internal
22 C> Table B, if TAB = 'B'
23 C> - Positional index of IDN within internal
24 C> Table D, if TAB = 'D'
25 C> - The X portion of the FXY value in IDN, if
26 C> TAB = 'C'
27 C> - 0, otherwise
28 C>
29 C> <b>Program history log:</b>
30 C> | Date | Programmer | Comments |
31 C> | -----|------------|----------|
32 C> | 1994-01-06 | J. Woollen | Original author |
33 C> | 1995-06-28 | J. Woollen | Increased the size of internal BUFR table arrays in order to handle bigger files |
34 C> | 1999-11-18 | J. Woollen | The number of BUFR files which can be opened at one time increased from 10 to 32 |
35 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 |
36 C> | 2003-11-04 | J. Ator | Added documentation |
37 C> | 2003-11-04 | S. Bender | Added remarks and routine interdependencies |
38 C> | 2003-11-04 | D. Keyser | Unified/portable for WRF; added documentation |
39 C> | 2005-11-29 | J. Ator | Added support for 207 and 208 operators |
40 C> | 2010-03-19 | J. Ator | Added support for 204 and 205 operators |
41 C> | 2012-03-02 | J. Ator | Added support for 203 operator |
42 C> | 2015-02-25 | J. Ator | Allow processing of 2-2x, 2-3x and 2-4X non-marker operators in DX tables |
43 C>
44  SUBROUTINE nemtab(LUN,NEMO,IDN,TAB,IRET)
45 
46  USE moda_tababd
47 
48  CHARACTER*(*) nemo
49  CHARACTER*8 nemt
50  CHARACTER*1 tab
51  LOGICAL folval
52 
53 C-----------------------------------------------------------------------
54 C-----------------------------------------------------------------------
55 
56  folval = nemo(1:1).EQ.'.'
57  iret = 0
58  tab = ' '
59 
60 C LOOK FOR NEMO IN TABLE B
61 C ------------------------
62 
63  DO 1 i=1,ntbb(lun)
64  nemt = tabb(i,lun)(7:14)
65  IF(nemt.EQ.nemo) THEN
66  idn = idnb(i,lun)
67  tab = 'B'
68  iret = i
69  goto 100
70  ELSEIF(folval.AND.nemt(1:1).EQ.'.') THEN
71  DO j=2,len(nemt)
72  IF(nemt(j:j).NE.'.' .AND. nemt(j:j).NE.nemo(j:j)) goto 1
73  ENDDO
74  idn = idnb(i,lun)
75  tab = 'B'
76  iret = i
77  goto 100
78  ENDIF
79 1 ENDDO
80 
81 C DON'T LOOK IN TABLE D FOR FOLLOWING VALUE-MNEMONICS
82 C ---------------------------------------------------
83 
84  IF(folval) goto 100
85 
86 C LOOK IN TABLE D IF WE GOT THIS FAR
87 C ----------------------------------
88 
89  DO i=1,ntbd(lun)
90  nemt = tabd(i,lun)(7:14)
91  IF(nemt.EQ.nemo) THEN
92  idn = idnd(i,lun)
93  tab = 'D'
94  iret = i
95  goto 100
96  ENDIF
97  ENDDO
98 
99 C IF STILL NOTHING, CHECK HERE FOR TABLE C OPERATOR DESCRIPTORS
100 C -------------------------------------------------------------
101 
102  IF (iokoper(nemo).EQ.1) THEN
103  READ(nemo,'(1X,I2)') iret
104  idn = ifxy(nemo)
105  tab = 'C'
106  goto 100
107  ENDIF
108 
109 C EXIT
110 C ----
111 
112 100 RETURN
113  END
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
function ifxy(ADSC)
This function converts an FXY value from its 6 character representation to its bit-wise (integer) rep...
Definition: ifxy.f:42
subroutine nemtab(LUN, NEMO, IDN, TAB, IRET)
This subroutine returns information about a descriptor from the internal DX BUFR tables, based on the mnemonic associated with that descriptor.
Definition: nemtab.f:44
INTEGER function iokoper(NEMO)
This function determines whether a specified mnemonic is a Table C operator supported by the BUFRLIB ...
Definition: iokoper.f:23