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