NCEPLIBS-bufr 11.7.1
dxinit.f
Go to the documentation of this file.
1C> @file
2C> @author WOOLLEN @date 1994-01-06
3
4C> THIS SUBROUTINE INITIALIZES THE INTERNAL ARRAYS
5C> (IN MODULE TABABD) HOLDING THE DICTIONARY TABLE. IT THEN
6C> INITIALIZES THE TABLE WITH APRIORI TABLE B AND D ENTRIES
7C> (OPTIONAL).
8C>
9C> PROGRAM HISTORY LOG:
10C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
11C> 1995-06-28 J. WOOLLEN -- INCREASED THE SIZE OF INTERNAL BUFR TABLE
12C> ARRAYS IN ORDER TO HANDLE BIGGER FILES
13C> 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
14C> OPENED AT ONE TIME INCREASED FROM 10 TO 32
15C> (NECESSARY IN ORDER TO PROCESS MULTIPLE
16C> BUFR FILES UNDER THE MPI)
17C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
18C> INTERDEPENDENCIES
19C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
20C> DOCUMENTATION (INCLUDING HISTORY)
21C> 2009-03-23 J. ATOR -- REMOVE INITIALIZATION OF COMMON /MSGCWD/
22C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
23C>
24C> USAGE: CALL DXINIT (LUN, IOI)
25C> INPUT ARGUMENT LIST:
26C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
27C> IOI - INTEGER: SWITCH:
28C> 0 = do not initialize the table with apriori
29C> Table B and D entries
30C> else = initialize the table with apriori Table B
31C> and D entries
32C>
33C> REMARKS:
34C> THIS ROUTINE CALLS: ADN30 IFXY PKTDD
35C> THIS ROUTINE IS CALLED BY: CPBFDX OPENBF RDBFDX RDUSDX
36C> READERME READS3
37C> Normally not called by any application
38C> programs.
39C>
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
66C-----------------------------------------------------------------------
67C-----------------------------------------------------------------------
68
69C CLEAR OUT A TABLE PARTITION
70C ---------------------------
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) = ' '
86c .... This zeroes the counter in TABD array, IRET returns as 0 and
87c is not tested
88 CALL pktdd(i,lun,0,iret)
89 ENDDO
90
91 IF(ioi.EQ.0) GOTO 100
92
93C INITIALIZE TABLE WITH APRIORI TABLE B AND D ENTRIES
94C ---------------------------------------------------
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)
115c .... DK: what if IRET = -1 ???
116 CALL pktdd(n,lun,idnr(1,1),iret)
117c .... DK: what if IRET = -1 ???
118 CALL pktdd(n,lun,idnr(i,2),iret)
119 ntbd(lun) = n
120 ENDDO
121
122C EXIT
123C ----
124
125100 RETURN
126 END
subroutine dxinit(LUN, IOI)
THIS SUBROUTINE INITIALIZES THE INTERNAL ARRAYS (IN MODULE TABABD) HOLDING THE DICTIONARY TABLE.
Definition: dxinit.f:41
function ifxy(ADSC)
This function converts an FXY value from its 6 character representation to its bit-wise (integer) rep...
Definition: ifxy.f:43
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
integer, dimension(:,:), allocatable idnb
Bit-wise representations of the FXY values corresponding to tabb.
Definition: moda_tababd.F:56
character *128, dimension(:,:), allocatable tabb
Table B entries for each internal I/O stream.
Definition: moda_tababd.F:59
character *128, dimension(:,:), allocatable taba
Table A entries for each internal I/O stream.
Definition: moda_tababd.F:58
integer, dimension(:,:), allocatable mtab
Entries within jump/link table corresponding to taba.
Definition: moda_tababd.F:54
integer, dimension(:), allocatable ntbd
Number of Table D entries for each internal I/O stream (up to a maximum of MAXTBD,...
Definition: moda_tababd.F:53
integer, dimension(:), allocatable ntbb
Number of Table B entries for each internal I/O stream (up to a maximum of MAXTBB,...
Definition: moda_tababd.F:52
integer, dimension(:), allocatable ntba
Number of Table A entries for each internal I/O stream (up to a maximum of MAXTBA,...
Definition: moda_tababd.F:51
integer, dimension(:,:), allocatable idnd
Bit-wise representations of the FXY values corresponding to tabd.
Definition: moda_tababd.F:57
character *600, dimension(:,:), allocatable tabd
Table D entries for each internal I/O stream.
Definition: moda_tababd.F:60
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:55