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