NCEPLIBS-bufr  12.0.0
dxinit.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Initialize the internal arrays which contain the DX BUFR table.
3 C>
4 C> @author Woollen @date 1994-01-06
5 
6 C> This subroutine initializes the internal arrays
7 C> (in module @ref moda_tababd) holding the DX BUFR table. It then
8 C> initializes the table with apriori Table B and D entries
9 C> (optional).
10 C>
11 C> @param[in] LUN - integer: I/O stream index into internal memory arrays.
12 C> @param[in] IOI - integer: switch:
13 C> - 0 do not initialize the table with apriori Table B and D entries.
14 C> - else initialize the table with apriori Table B and D entries.
15 C>
16 C> @author Woollen @date 1994-01-06
17  SUBROUTINE dxinit(LUN,IOI)
18 
19  USE moda_tababd
20 
21  COMMON /padesc/ ibct,ipd1,ipd2,ipd3,ipd4
22  COMMON /reptab/ idnr(5,2),typs(5,2),reps(5,2),lens(5)
23 
24  CHARACTER*8 INIB(6,5),INID(5)
25  CHARACTER*6 ADN30
26  CHARACTER*3 TYPS
27  CHARACTER*1 REPS
28 
29  DATA inib /'------','BYTCNT ','BYTES ','+0','+0','16',
30  . '------','BITPAD ','NONE ','+0','+0','1 ',
31  . '031000','DRF1BIT ','NUMERIC','+0','+0','1 ',
32  . '031001','DRF8BIT ','NUMERIC','+0','+0','8 ',
33  . '031002','DRF16BIT','NUMERIC','+0','+0','16'/
34  DATA ninib /5/
35 
36  DATA inid /' ',
37  . 'DRP16BIT',
38  . 'DRP8BIT ',
39  . 'DRPSTAK ',
40  . 'DRP1BIT '/
41  DATA ninid /5/
42 
43 C-----------------------------------------------------------------------
44 C-----------------------------------------------------------------------
45 
46 C CLEAR OUT A TABLE PARTITION
47 C ---------------------------
48 
49  ntba(lun) = 0
50  DO i=1,ntba(0)
51  taba(i,lun) = ' '
52  mtab(i,lun) = 0
53  ENDDO
54 
55  ntbb(lun) = 0
56  DO i=1,ntbb(0)
57  tabb(i,lun) = ' '
58  ENDDO
59 
60  ntbd(lun) = 0
61  DO i=1,ntbd(0)
62  tabd(i,lun) = ' '
63  CALL pktdd(i,lun,0,iret)
64  ENDDO
65 
66  IF(ioi.EQ.0) GOTO 100
67 
68 C INITIALIZE TABLE WITH APRIORI TABLE B AND D ENTRIES
69 C ---------------------------------------------------
70 
71  inib(1,1) = adn30(ibct,6)
72  inib(1,2) = adn30(ipd4,6)
73 
74  DO i=1,ninib
75  ntbb(lun) = ntbb(lun)+1
76  idnb(i,lun) = ifxy(inib(1,i))
77  tabb(i,lun)( 1: 6) = inib(1,i)(1:6)
78  tabb(i,lun)( 7: 70) = inib(2,i)
79  tabb(i,lun)( 71: 94) = inib(3,i)
80  tabb(i,lun)( 95: 98) = inib(4,i)(1:4)
81  tabb(i,lun)( 99:109) = inib(5,i)
82  tabb(i,lun)(110:112) = inib(6,i)(1:3)
83  ENDDO
84 
85  DO i=2,ninid
86  n = ntbd(lun)+1
87  idnd(n,lun) = idnr(i,1)
88  tabd(n,lun)(1: 6) = adn30(idnr(i,1),6)
89  tabd(n,lun)(7:70) = inid(i)
90  CALL pktdd(n,lun,idnr(1,1),iret)
91  CALL pktdd(n,lun,idnr(i,2),iret)
92  ntbd(lun) = n
93  ENDDO
94 
95 C EXIT
96 C ----
97 
98 100 RETURN
99  END
subroutine dxinit(LUN, IOI)
This subroutine initializes the internal arrays (in module moda_tababd) holding the DX BUFR table.
Definition: dxinit.f:18
function ifxy(ADSC)
Convert an FXY value from its 6 character representation to its WMO bit-wise representation.
Definition: ifxy.f:34
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
integer, dimension(:), allocatable ntba
Number of Table A entries for each internal I/O stream (up to a maximum of MAXTBA,...
character *600, dimension(:,:), allocatable tabd
Table D entries for each internal I/O stream.
character *128, dimension(:,:), allocatable taba
Table A entries for each internal I/O stream.
integer, dimension(:,:), allocatable mtab
Entries within jump/link table corresponding to taba.
integer, dimension(:), allocatable ntbd
Number of Table D entries for each internal I/O stream (up to a maximum of MAXTBD,...
integer, dimension(:), allocatable ntbb
Number of Table B entries for each internal I/O stream (up to a maximum of MAXTBB,...
integer, dimension(:,:), allocatable idnd
Bit-wise representations of the FXY values corresponding to tabd.
integer, dimension(:,:), allocatable idnb
Bit-wise representations of the FXY values corresponding to tabb.
character *128, dimension(:,:), allocatable tabb
Table B entries for each internal I/O stream.
subroutine pktdd(ID, LUN, IDN, IRET)
Store information about a child mnemonic within the internal arrays.
Definition: pktdd.f:26