NCEPLIBS-bufr 11.7.1
bfrini.f90
Go to the documentation of this file.
1
3
37subroutine bfrini
38
39USE modv_maxjl
45
46USE moda_stbfr
47USE moda_idrdm
48USE moda_msglim
50USE moda_bufrmg
51USE moda_bufrsr
53USE moda_usrint
55USE moda_h4wlc
57
58COMMON /maxcmp/ maxcmb,maxrow,maxcol,ncmsgs,ncsubs,ncbyts
59COMMON /padesc/ ibct,ipd1,ipd2,ipd3,ipd4
60COMMON /reptab/ idnr(5,2),typs(5,2),reps(5,2),lens(5)
61COMMON /dxtab / maxdx,idxv,nxstr(10),ldxa(10),ldxb(10),ldxd(10), &
62 ld30(10),dxstr(10)
63COMMON /mrgcom/ nrpl,nmrg,namb,ntot
64COMMON /dateln/ lendat
65COMMON /acmode/ iac
66COMMON /msgstd/ csmf
67COMMON /msgcmp/ ccmf
68COMMON /tablef/ cdmf
69COMMON /tnkrcp/ itryr,itrmo,itrdy,itrhr,itrmi,ctrt
70COMMON /endord/ iblock,iordbe(4),iordle(4)
71
72character*100 CMTDIR
73character*56 DXSTR
74character*6 ADSN(5,2),DNDX(25,10)
75character*3 TYPX(5,2),TYPS
76character*1 REPX(5,2),REPS
77character*1 CSMF
78character*1 CCMF
79character*1 CDMF
80character*1 CTRT
81dimension ndndx(10),nldxa(10),nldxb(10),nldxd(10),nld30(10)
82dimension lenx(5)
83
84data adsn / '101000','360001','360002','360003','360004' , &
85 '101255','031002','031001','031001','031000' /
86data typx / 'REP', 'DRP', 'DRP', 'DRS' , 'DRB' , &
87 'SEQ', 'RPC', 'RPC', 'RPS' , 'SEQ' /
88data repx / '"', '(', '{', '[' , '<' , &
89 '"', ')', '}', ']' , '>' /
90data lenx / 0 , 16 , 8 , 8 , 1 /
91
92data (dndx(i,1),i=1,25)/ &
93'102000','031001','000001','000002', &
94'110000','031001','000010','000011','000012','000013','000015', &
95 '000016','000017','000018','000019','000020', &
96'107000','031001','000010','000011','000012','000013','101000', &
97 '031001','000030'/
98
99data (dndx(i,2),i=1,15)/ &
100'103000','031001','000001','000002','000003', &
101'101000','031001','300004', &
102'105000','031001','300003','205064','101000','031001','000030'/
103
104data ndndx / 25 , 15 , 8*0 /
105data nldxa / 35 , 67 , 8*0 /
106data nldxb / 80 , 112 , 8*0 /
107data nldxd / 38 , 70 , 8*0 /
108data nld30 / 5 , 6 , 8*0 /
109
110!-----------------------------------------------------------------------
111!-----------------------------------------------------------------------
112
113! Initialize /ENDORD/ to control output blocking -1=LE 0=NONE +1=BE
114! -----------------------------------------------------------------
115
116iblock = 0
117
118! Initialize module BITBUF
119! ------------------------
120
121maxbyt = min(10000,mxmsgl)
122
123! Initialize module H4WLC
124! -----------------------
125
126nh4wlc = 0
127
128! Initialize /MAXCMP/
129! -------------------
130
131maxcmb = maxbyt
132maxrow = 0
133maxcol = 0
134ncmsgs = 0
135ncsubs = 0
136ncbyts = 0
137
138! Initialize /PADESC/
139! -------------------
140
141ibct = ifxy('063000')
142ipd1 = ifxy('102000')
143ipd2 = ifxy('031001')
144ipd3 = ifxy('206001')
145ipd4 = ifxy('063255')
146
147! Initialize module STBFR
148! -----------------------
149
150do i=1,nfiles
151 iolun(i) = 0
152 iomsg(i) = 0
153enddo
154
155! Initialize module IDRDM
156! -----------------------
157
158do i=1,nfiles
159 idrdm(i) = 0
160enddo
161
162! Initialize module MSGLIM
163! ------------------------
164
165do i=1,nfiles
166 msglim(i) = 3
167enddo
168
169! Initialize module USRINT
170! ------------------------
171
172do i=1,nfiles
173 nval(i) = 0
174enddo
175
176! Initialize /REPTAB/
177! -------------------
178
179do i=1,5
180 lens(i) = lenx(i)
181 do j=1,2
182 idnr(i,j) = ifxy(adsn(i,j))
183 typs(i,j) = typx(i,j)
184 reps(i,j) = repx(i,j)
185 enddo
186enddo
187
188! Initialize TABABD (internal arrays holding dictionary table)
189! ------------------------------------------------------------
190
191! NTBA(0) is the maximum number of entries w/i internal BUFR table A
192
193ntba(0) = maxtba
194
195! NTBB(0) is the maximum number of entries w/i internal BUFR Table B
196
197ntbb(0) = maxtbb
198
199! NTBD(0) is the maximum number of entries w/i internal BUFR Table D
200
201ntbd(0) = maxtbd
202
203! Initialize /DXTAB/
204! ------------------
205
206maxdx = maxbyt
207! .... IDXV is the version number of the local tables
208idxv = 1
209
210do j=1,10
211 ldxa(j) = nldxa(j)
212 ldxb(j) = nldxb(j)
213 ldxd(j) = nldxd(j)
214 ld30(j) = nld30(j)
215 dxstr(j) = ' '
216 nxstr(j) = ndndx(j)*2
217 do i=1,ndndx(j)
218 i1 = i*2-1
219 call ipkm(dxstr(j)(i1:i1),2,ifxy(dndx(i,j)))
220 enddo
221enddo
222
223! Initialize module TABLES
224! ------------------------
225
227
228! Initialize module BUFRMG
229! ------------------------
230
231do i=1,nfiles
232 msglen(i) = 0
233enddo
234
235! Initialize /MRGCOM/
236! -------------------
237
238nrpl = 0
239nmrg = 0
240namb = 0
241ntot = 0
242
243! Initialize /DATELN/
244! -------------------
245
246if(lendat.ne.10) lendat = 8
247
248! Initialize /ACMODE/
249! -------------------
250
251iac = 0
252
253! Initialize module BUFRSR
254! ------------------------
255
256do i=1,nfiles
257 jsr(i) = 0
258enddo
259
260! Initialize /DSCACH/
261! -------------------
262
263ncnem = 0
264
265! Initialize /MSGSTD/
266! -------------------
267
268csmf = 'N'
269
270! Initialize /MSGCMP/
271! -------------------
272
273ccmf = 'N'
274
275! Initialize /TABLEF/
276! -------------------
277
278cdmf = 'N'
279
280! Initialize /TNKRCP/
281! -------------------
282
283ctrt = 'N'
284
285! Initialize /MSTINF/
286! -------------------
287
288cmtdir = &
289'/home/jeffa/build/install/tables'
290call mtinfo(cmtdir,98,99)
291
292return
293end
subroutine bfrini
This subroutine initializes numerous global variables and arrays within internal modules and COMMON b...
Definition: bfrini.f90:38
function ifxy(ADSC)
This function converts an FXY value from its 6 character representation to its bit-wise (integer) rep...
Definition: ifxy.f:43
subroutine ipkm(CBAY, NBYT, N)
This subroutine encodes an integer value within a specified number of bytes of a character string,...
Definition: ipkm.f:28
subroutine mtinfo(CMTDIR, LUNMT1, LUNMT2)
This subroutine allows the specification of the directory location and Fortran logical unit numbers t...
Definition: mtinfo.f:47
This module contains array and variable declarations used to store BUFR messages internally for multi...
Definition: moda_bitbuf.F:10
integer maxbyt
Maximum length of an output BUFR message.
Definition: moda_bitbuf.F:22
This module contains array and variable declarations for the internal Table A mnemonic cache that is ...
Definition: moda_dscach.F:15
integer ncnem
Number of entries in the internal Table A mnemonic cache (up to a maximum of MXCNEM).
Definition: moda_dscach.F:36
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
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
This module contains array and variable declarations used to store the internal jump/link table.
Definition: moda_tables.F:13
integer maxtab
Maximum number of entries in the jump/link table; equivalent to MAXJL.
Definition: moda_tables.F:130
This module declares and initializes the MAXJL variable.
Definition: modv_MAXJL.f:13
integer maxjl
Maximum number of entries in the internal jump/link table.
Definition: modv_MAXJL.f:18
This module declares and initializes the MAXTBA variable.
Definition: modv_MAXTBA.f:13
integer maxtba
Maximum number of entries in the internal BUFR Table A for each BUFR file that is connected to the BU...
Definition: modv_MAXTBA.f:19
This module declares and initializes the MAXTBB variable.
Definition: modv_MAXTBB.f:13
integer maxtbb
Maximum number of entries in the internal BUFR Table B for each BUFR file that is connected to the BU...
Definition: modv_MAXTBB.f:19
This module declares and initializes the MAXTBD variable.
Definition: modv_MAXTBD.f:13
integer maxtbd
Maximum number of entries in the internal BUFR Table D for each BUFR file that is connected to the BU...
Definition: modv_MAXTBD.f:19
This module declares and initializes the MXMSGL variable.
Definition: modv_MXMSGL.f:13
integer mxmsgl
Maximum length (in bytes) of a BUFR message that can be read or written by the BUFRLIB software.
Definition: modv_MXMSGL.f:22
This module declares and initializes the NFILES variable.
Definition: modv_NFILES.f90:12
integer, public nfiles
Maximum number of BUFR files that can be connected to the BUFRLIB software (for reading or writing) a...
Definition: modv_NFILES.f90:17