NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
dxinit.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 1994-01-06
3 
4 C> THIS SUBROUTINE INITIALIZES THE INTERNAL ARRAYS
5 C> (IN MODULE TABABD) HOLDING THE DICTIONARY TABLE. IT THEN
6 C> INITIALIZES THE TABLE WITH APRIORI TABLE B AND D ENTRIES
7 C> (OPTIONAL).
8 C>
9 C> PROGRAM HISTORY LOG:
10 C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
11 C> 1995-06-28 J. WOOLLEN -- INCREASED THE SIZE OF INTERNAL BUFR TABLE
12 C> ARRAYS IN ORDER TO HANDLE BIGGER FILES
13 C> 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
14 C> OPENED AT ONE TIME INCREASED FROM 10 TO 32
15 C> (NECESSARY IN ORDER TO PROCESS MULTIPLE
16 C> BUFR FILES UNDER THE MPI)
17 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
18 C> INTERDEPENDENCIES
19 C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
20 C> DOCUMENTATION (INCLUDING HISTORY)
21 C> 2009-03-23 J. ATOR -- REMOVE INITIALIZATION OF COMMON /MSGCWD/
22 C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
23 C>
24 C> USAGE: CALL DXINIT (LUN, IOI)
25 C> INPUT ARGUMENT LIST:
26 C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
27 C> IOI - INTEGER: SWITCH:
28 C> 0 = do not initialize the table with apriori
29 C> Table B and D entries
30 C> else = initialize the table with apriori Table B
31 C> and D entries
32 C>
33 C> REMARKS:
34 C> THIS ROUTINE CALLS: ADN30 IFXY PKTDD
35 C> THIS ROUTINE IS CALLED BY: CPBFDX OPENBF RDBFDX RDUSDX
36 C> READERME READS3
37 C> Normally not called by any application
38 C> programs.
39 C>
40  SUBROUTINE dxinit(LUN,IOI)
41 
42  USE moda_tababd
43 
44  COMMON /padesc/ ibct,ipd1,ipd2,ipd3,ipd4
45  COMMON /reptab/ idnr(5,2),typs(5,2),reps(5,2),lens(5)
46 
47  CHARACTER*8 inib(6,5),inid(5)
48  CHARACTER*6 adn30
49  CHARACTER*3 typs
50  CHARACTER*1 reps
51 
52  DATA inib /'------','BYTCNT ','BYTES ','+0','+0','16',
53  . '------','BITPAD ','NONE ','+0','+0','1 ',
54  . '031000','DRF1BIT ','NUMERIC','+0','+0','1 ',
55  . '031001','DRF8BIT ','NUMERIC','+0','+0','8 ',
56  . '031002','DRF16BIT','NUMERIC','+0','+0','16'/
57  DATA ninib /5/
58 
59  DATA inid /' ',
60  . 'DRP16BIT',
61  . 'DRP8BIT ',
62  . 'DRPSTAK ',
63  . 'DRP1BIT '/
64  DATA ninid /5/
65 
66 C-----------------------------------------------------------------------
67 C-----------------------------------------------------------------------
68 
69 C CLEAR OUT A TABLE PARTITION
70 C ---------------------------
71 
72  ntba(lun) = 0
73  DO i=1,ntba(0)
74  taba(i,lun) = ' '
75  mtab(i,lun) = 0
76  ENDDO
77 
78  ntbb(lun) = 0
79  DO i=1,ntbb(0)
80  tabb(i,lun) = ' '
81  ENDDO
82 
83  ntbd(lun) = 0
84  DO i=1,ntbd(0)
85  tabd(i,lun) = ' '
86 c .... This zeroes the counter in TABD array, IRET returns as 0 and
87 c is not tested
88  CALL pktdd(i,lun,0,iret)
89  ENDDO
90 
91  IF(ioi.EQ.0) goto 100
92 
93 C INITIALIZE TABLE WITH APRIORI TABLE B AND D ENTRIES
94 C ---------------------------------------------------
95 
96  inib(1,1) = adn30(ibct,6)
97  inib(1,2) = adn30(ipd4,6)
98 
99  DO i=1,ninib
100  ntbb(lun) = ntbb(lun)+1
101  idnb(i,lun) = ifxy(inib(1,i))
102  tabb(i,lun)( 1: 6) = inib(1,i)
103  tabb(i,lun)( 7: 70) = inib(2,i)
104  tabb(i,lun)( 71: 94) = inib(3,i)
105  tabb(i,lun)( 95: 98) = inib(4,i)
106  tabb(i,lun)( 99:109) = inib(5,i)
107  tabb(i,lun)(110:112) = inib(6,i)
108  ENDDO
109 
110  DO i=2,ninid
111  n = ntbd(lun)+1
112  idnd(n,lun) = idnr(i,1)
113  tabd(n,lun)(1: 6) = adn30(idnr(i,1),6)
114  tabd(n,lun)(7:70) = inid(i)
115 c .... DK: what if IRET = -1 ???
116  CALL pktdd(n,lun,idnr(1,1),iret)
117 c .... DK: what if IRET = -1 ???
118  CALL pktdd(n,lun,idnr(i,2),iret)
119  ntbd(lun) = n
120  ENDDO
121 
122 C EXIT
123 C ----
124 
125 100 RETURN
126  END
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
subroutine dxinit(LUN, IOI)
THIS SUBROUTINE INITIALIZES THE INTERNAL ARRAYS (IN MODULE TABABD) HOLDING THE DICTIONARY TABLE...
Definition: dxinit.f:40
character *(*) function adn30(IDN, L30)
This function converts a descriptor from its bit-wise (integer) representation to its 5 or 6 characte...
Definition: adn30.f:27
function ifxy(ADSC)
THIS FUNCTION RETURNS THE INTEGER CORRESPONDING TO THE BIT-WISE REPRESENTATION OF AN INPUT CHARACTER ...
Definition: ifxy.f:49
subroutine pktdd(ID, LUN, IDN, IRET)
THIS SUBROUTINE STORES INFORMATION ABOUT A "CHILD" MNEMONIC WITHIN THE INTERNAL BUFR TABLE D ENTRY (I...
Definition: pktdd.f:54