NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
nemtab.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 1994-01-06
3 
4 C> THIS SUBROUTINE SEARCHES FOR MNEMONIC NEMO WITHIN THE
5 C> INTERNAL TABLE B AND D ARRAYS HOLDING THE DICTIONARY TABLE (ARRAYS
6 C> IN MODULE TABABD) AND, IF FOUND, RETURNS INFORMATION ABOUT
7 C> THAT MNEMONIC FROM WITHIN THESE ARRAYS. OTHERWISE, IT CHECKS
8 C> WHETHER NEMO IS A TABLE C OPERATOR DESCRIPTOR AND, IF SO, DIRECTLY
9 C> COMPUTES AND RETURNS SIMILAR INFORMATION ABOUT THAT DESCRIPTOR.
10 C> THIS SUBROUTINE MAY BE USEFUL TO APPLICATION PROGRAMS WHICH WANT
11 C> TO CHECK WHETHER A PARTICULAR MNEMONIC IS IN THE DICTIONARY. IN
12 C> THIS CASE, BUFR ARCHIVE LIBRARY SUBROUTINE OPENBF MUST FIRST BE
13 C> CALLED TO STORE THE DICTIONARY TABLE INTERNALLY, AND BUFR ARCHIVE
14 C> LIBRARY SUBROUTINE STATUS MUST BE CALLED TO CONNECT THE LOGICAL
15 C> UNIT NUMBER FOR THE BUFR FILE OPENED IN OPENBF TO LUN.
16 C>
17 C> PROGRAM HISTORY LOG:
18 C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
19 C> 1995-06-28 J. WOOLLEN -- INCREASED THE SIZE OF INTERNAL BUFR TABLE
20 C> ARRAYS IN ORDER TO HANDLE BIGGER FILES
21 C> 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
22 C> OPENED AT ONE TIME INCREASED FROM 10 TO 32
23 C> (NECESSARY IN ORDER TO PROCESS MULTIPLE
24 C> BUFR FILES UNDER THE MPI)
25 C> 2000-09-19 J. WOOLLEN -- ADDED CAPABILITY TO ENCODE AND DECODE DATA
26 C> USING THE OPERATOR DESCRIPTORS (BUFR TABLE
27 C> C) FOR CHANGING WIDTH AND CHANGING SCALE
28 C> 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
29 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
30 C> INTERDEPENDENCIES
31 C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED HISTORY
32 C> DOCUMENTATION
33 C> 2005-11-29 J. ATOR -- ADDED SUPPORT FOR 207 AND 208 OPERATORS
34 C> 2010-03-19 J. ATOR -- ADDED SUPPORT FOR 204 AND 205 OPERATORS
35 C> 2012-03-02 J. ATOR -- ADDED SUPPORT FOR 203 OPERATOR
36 C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
37 C> 2015-02-25 J. ATOR -- ALLOW PROCESSING OF 2-2X, 2-3X AND 2-4X
38 C> NON-MARKER OPERATORS IN DX TABLES
39 C>
40 C> USAGE: CALL NEMTAB (LUN, NEMO, IDN, TAB, IRET)
41 C> INPUT ARGUMENT LIST:
42 C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
43 C> NEMO - CHARACTER*(*): MNEMONIC TO SEARCH FOR
44 C>
45 C> OUTPUT ARGUMENT LIST:
46 C> IDN - INTEGER: BIT-WISE REPRESENTATION OF FXY VALUE
47 C> CORRESPONDING TO NEMO (IF NEMO WAS FOUND)
48 C> TAB - CHARACTER*1: INTERNAL TABLE ARRAY IN WHICH NEMO WAS
49 C> FOUND:
50 C> 'B' = Table B array
51 C> 'C' = Table C array
52 C> 'D' = Table D array
53 C> IRET - INTEGER: POSITIONAL INDEX OF NEMO WITHIN TAB
54 C> 0 = NEMO was not found within any of the Table
55 C> B, C, or D arrays
56 C>
57 C> REMARKS:
58 C> THIS ROUTINE CALLS: IFXY IOKOPER
59 C> THIS ROUTINE IS CALLED BY: CHEKSTAB CMSGINI ELEMDX GETCFMNG
60 C> IGETRFEL MSGINI NEMDEFS SEQSDX
61 C> STSEQ TABSUB UFBDMP UFBQCD
62 C> UFDUMP UPFTBV
63 C> Also called by application programs
64 C> (see ABSTRACT).
65 C>
66  SUBROUTINE nemtab(LUN,NEMO,IDN,TAB,IRET)
67 
68  USE moda_tababd
69 
70  CHARACTER*(*) nemo
71  CHARACTER*8 nemt
72  CHARACTER*1 tab
73  LOGICAL folval
74 
75 C-----------------------------------------------------------------------
76 C-----------------------------------------------------------------------
77 
78  folval = nemo(1:1).EQ.'.'
79  iret = 0
80  tab = ' '
81 
82 C LOOK FOR NEMO IN TABLE B
83 C ------------------------
84 
85  DO 1 i=1,ntbb(lun)
86  nemt = tabb(i,lun)(7:14)
87  IF(nemt.EQ.nemo) THEN
88  idn = idnb(i,lun)
89  tab = 'B'
90  iret = i
91  goto 100
92  ELSEIF(folval.AND.nemt(1:1).EQ.'.') THEN
93  DO j=2,len(nemt)
94  IF(nemt(j:j).NE.'.' .AND. nemt(j:j).NE.nemo(j:j)) goto 1
95  ENDDO
96  idn = idnb(i,lun)
97  tab = 'B'
98  iret = i
99  goto 100
100  ENDIF
101 1 ENDDO
102 
103 C DON'T LOOK IN TABLE D FOR FOLLOWING VALUE-MNEMONICS
104 C ---------------------------------------------------
105 
106  IF(folval) goto 100
107 
108 C LOOK IN TABLE D IF WE GOT THIS FAR
109 C ----------------------------------
110 
111  DO i=1,ntbd(lun)
112  nemt = tabd(i,lun)(7:14)
113  IF(nemt.EQ.nemo) THEN
114  idn = idnd(i,lun)
115  tab = 'D'
116  iret = i
117  goto 100
118  ENDIF
119  ENDDO
120 
121 C IF STILL NOTHING, CHECK HERE FOR TABLE C OPERATOR DESCRIPTORS
122 C -------------------------------------------------------------
123 
124  IF (iokoper(nemo).EQ.1) THEN
125  READ(nemo,'(1X,I2)') iret
126  idn = ifxy(nemo)
127  tab = 'C'
128  goto 100
129  ENDIF
130 
131 C EXIT
132 C ----
133 
134 100 RETURN
135  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 RETURNS THE INTEGER CORRESPONDING TO THE BIT-WISE REPRESENTATION OF AN INPUT CHARACTER ...
Definition: ifxy.f:49
subroutine nemtab(LUN, NEMO, IDN, TAB, IRET)
THIS SUBROUTINE SEARCHES FOR MNEMONIC NEMO WITHIN THE INTERNAL TABLE B AND D ARRAYS HOLDING THE DICTI...
Definition: nemtab.f:66
INTEGER function iokoper(NEMO)
This function determines whether a specified mnemonic is a Table C operator supported by the BUFRLIB ...
Definition: iokoper.f:22