21 use modv_vars,
only: mxbtm, mxbtmse
30 integer,
intent(in) :: n, lun, ival
31 integer node, nodtam, ii, jj, lstjpb
37 if (
tag(node)(1:5) ==
'DPRI ' )
then
42 nodtam = lstjpb( node, lun,
'SUB' )
47 (
inodtco(ii,jj) < node ) )
then
48 if (
ctco(ii,jj) ==
'236000' )
then
50 else if ( (
ctco(ii,jj) ==
'235000' ) .or. (
ctco(ii,jj) ==
'237255' ) )
then
58 if ( .not. isbtme )
then
64 if (
nbtm >= mxbtm )
call bort(
'BUFRLIB: STRBTM - MXBTM OVERFLOW')
74 if (
nbtmse(
nbtm) >= mxbtmse )
call bort(
'BUFRLIB: STRBTM - MXBTMSE OVERFLOW')
78 else if (
itp(node) > 1 )
then
109 recursive subroutine gettagre ( lunit, tagi, ntagi, tagre, ntagre, iret )
113 use modv_vars,
only: im8b
121 integer,
intent(in) :: lunit, ntagi
122 integer,
intent(out) :: iret, ntagre
123 integer my_lunit, my_ntagi, lun, il, im, ni, nre, ltre, ii, lci, ntrchr, ltr,
bort_target_set
125 character*(*),
intent(in) :: tagi
126 character*(*),
intent(out) :: tagre
127 character*10 tagtmp, ctagi, ctagre
133 call x84(lunit,my_lunit,1)
134 call x84(ntagi,my_ntagi,1)
135 call gettagre(my_lunit,tagi,my_ntagi,tagre,ntagre,iret)
136 call x48(ntagre,ntagre,1)
137 call x48(iret,iret,1)
147 call strsuc( tagi, ctagi, lci )
149 ltr = min( len(tagre), ntrchr )
150 tagre(1:ltr) = ctagre(1:ltr)
159 call status( lunit, lun, il, im )
160 if ( il == 0 )
return
161 if (
inode(lun) /=
inv(1,lun) )
return
165 call fstag( lun, tagi, ntagi, 1, ni, iret )
166 if ( iret /= 0 )
return
171 call strsuc( tagre, tagtmp, ltre )
174 if (
tag(
inv(ii,lun))(1:ltre) == tagre(1:ltre) )
then
197 integer function igetrfel ( n, lun )
result ( iret )
207 integer,
intent(in) :: n, lun
208 integer node, ii, jj, nn, idxta, idn, ntc, nodflw, nodl236, nodbmap, nodrfe, nodnn, nodtam, idxbtm, iemrk, iect, &
211 character*(*),
parameter :: bort_str_mrkopr = &
212 'BUFRLIB: IGETRFEL - UNABLE TO FIND PREVIOUS ELEMENT REFERENCED BY MARKER OPERATOR '
213 character*128 bort_str
214 character*6 cflwopr,
adn30, fxy
221 if (
itp(node) > 1 )
then
222 if ( node ==
lstnod )
then
230 if (
ntamc > 0 )
then
231 nodtam =
lstjpb( node, lun,
'SUB' )
239 if ( ( idxta > 0 ) .and. (
nbtm > 0 ) )
then
244 cflwopr =
tag(node)(1:3) //
'000'
246 call nemtab( lun,
tag(node), idn, tab, nn )
247 if ( tab ==
'B' )
then
249 if ( fxy(2:3) ==
'33' ) cflwopr =
'222000'
252 if ( cflwopr ==
'XXXXXX' )
return
257 if ( (
ctco(idxta,jj) == cflwopr ) .and. (
inodtco(idxta,jj) >=
inode(lun) ) .and. &
260 if ( nodflw == 0 )
then
262 write(bort_str,
'("BUFRLB: IGETRFEL - UNABLE TO FIND FOLLOW OPERATOR ",A," IN SUBSET")') cflwopr
272 do while ( ( jj <= ntc ) .and. (
inodtco(idxta,jj) >=
inode(lun) ) .and. &
274 if (
ctco(idxta,jj) ==
'236000' )
then
276 if (
inodtco(idxta,jj) == nodflw ) nodbmap = nodflw
277 else if ( (
ctco(idxta,jj) ==
'235000' ) .or. (
ctco(idxta,jj) ==
'237255' ) )
then
279 else if ( (
ctco(idxta,jj) ==
'237000' ) .and. (
inodtco(idxta,jj) == nodflw ) .and. ( nodl236 /= 0 ) )
then
284 if ( nodbmap == 0 )
then
291 do while ( ( idxbtm == 0 ) .and. ( nn <=
nval(lun) ) )
292 if (
inv( nn, lun ) > nodbmap )
then
294 do while ( ( idxbtm == 0 ) .and. ( ii <=
nbtm ) )
295 if ( nn ==
istbtm(ii) )
then
304 if ( idxbtm == 0 )
then
306 write(bort_str,
'("BUFRLB: IGETRFEL - UNABLE TO FIND BITMAP FOR MARKER OPERATOR ",A)')
tag(node)
319 do while ( ( nn >= 1 ) .and. ( iret == 0 ) )
320 nodnn =
inv( nn, lun )
321 if ( nodnn <= nodbmap )
then
323 if ( ( nodnn ==
inodtco(idxta,jj) ) .and. (
ctco(idxta,jj) ==
'235000' ) )
then
328 if (
itp(nodnn) > 1 )
then
330 if ( iect == iemrk ) iret = nn
335 if ( iret == 0 )
then
342 nodrfe =
inv( iret, lun )
344 if (
tag(node)(1:3) ==
'225' )
then
345 ibt(node) =
ibt(nodrfe) + 1
346 irf(node) = -1 * (2 **
ibt(nodrfe))
352 if ( ( nodrfe /=
inodnrv(ii) ) .and. (
tag(nodrfe)(1:8) ==
tagnrv(ii) ) .and. &
353 ( nodrfe >=
isnrv(ii) ) .and. ( nodrfe <=
ienrv(ii) ) )
then
379 character*(*),
intent(in) :: nemo
381 if (len(nemo)<6)
then
383 else if ( ( nemo(4:6)==
'255' ) .and. &
384 ( ( nemo(1:3)==
'223' ) .or. ( nemo(1:3)==
'224' ) .or. ( nemo(1:3)==
'225' ) .or. ( nemo(1:3)==
'232' ) ) )
then
integer function igetrfel(n, lun)
Check whether a subset element refers to a previous element within the same subset via an internal bi...
subroutine strbtm(n, lun, ival)
Store internal information in module moda_bitmaps if the input element is part of a bitmap.
recursive subroutine gettagre(lunit, tagi, ntagi, tagre, ntagre, iret)
Check whether a specified Table B mnemonic references another Table B mnemonic within the same data s...
integer function imrkopr(nemo)
Check whether a specified mnemonic is a Table C marker operator.
recursive subroutine bort(str)
Log an error message, then either return to or abort the application program.
subroutine bort_target_unset
Clear any existing bort target.
integer function bort_target_set()
Sets a new bort target, if bort catching is enabled and such a target doesn't already exist.
subroutine nemtab(lun, nemo, idn, tab, iret)
Get information about a descriptor, based on a mnemonic.
character *(*) function adn30(idn, ldn)
Convert an FXY value from its WMO bit-wise representation to a character string of length 5 or 6.
subroutine fstag(lun, utag, nutag, nin, nout, iret)
Search for a specified occurrence of a specified mnemonic within a data subset definition,...
integer function lstjpb(node, lun, jbtyp)
Search backwards, beginning from a given node within the jump/link table, until finding the most rece...
subroutine strsuc(str1, str2, lens)
Remove leading and trailing blanks from a character string.
Wrap C NCEPLIBS-bufr functions so they can be called from within the Fortran part of the library.
Declare arrays and variables used to store bitmaps internally within a data subset definition.
integer, dimension(:), allocatable iszbtm
Size of bitmap (total number of entries, whether "set" (set to a value of 0) or not).
integer lstnod
Most recent jump/link table entry that was processed by function igetrfel() and whose corresponding v...
integer, dimension(:,:), allocatable inodtco
Entries within jump/link table which contain Table C operators.
integer ntamc
Number of Table A mnemonics in jump/link table (up to a maximum of mxtamc) which contain at least one...
integer, dimension(:), allocatable istbtm
Ordinal position in data subset definition corresponding to the first entry of the bitmap.
integer nbtm
Number of stored bitmaps for the current data subset (up to a maximum of mxbtm).
integer, dimension(:), allocatable inodtamc
Entries within jump/link table which contain Table A mnemonics.
integer, dimension(:,:), allocatable ibtmse
Ordinal positions in bitmap of bits that were "set" (set to a value of 0); these ordinal positions ca...
integer lstnodct
Current count of consecutive occurrences of lstnod.
logical linbtm
Set to .true.
integer, dimension(:), allocatable nbtmse
Number of "set" entries (set to a value of 0) in the bitmap.
character *6, dimension(:,:), allocatable ctco
Table C operators corresponding to inodtco.
integer, dimension(:), allocatable ntco
Number of Table C operators (with an XX value of 21 or greater) within the data subset definition of ...
Declare arrays used to store information about the current BUFR message that is in the process of bei...
integer, dimension(:), allocatable inode
Table A mnemonic for type of BUFR message.
Declare arrays and variables for use with any 2-03-YYY (change reference value) operators present wit...
integer, dimension(:), allocatable ienrv
End of entry range in jump/link table, within which the corresponding new reference value in nrv will...
character *8, dimension(:), allocatable tagnrv
Table B mnemonic to which the corresponding new reference value in nrv applies.
integer, dimension(:), allocatable isnrv
Start of entry range in jump/link table, within which the corresponding new reference value in nrv wi...
integer nnrv
Number of entries in the jump/link table which contain new reference values (up to a maximum of mxnrv...
integer *8, dimension(:), allocatable nrv
New reference values corresponding to inodnrv.
integer, dimension(:), allocatable inodnrv
Entries within jump/link table which contain new reference values.
Declare arrays and variables used to store the internal jump/link table.
integer, dimension(:), allocatable irf
Reference values corresponding to tag and typ:
integer, dimension(:), allocatable isc
Scale factors corresponding to tag and typ:
integer, dimension(:), allocatable ibt
Bit widths corresponding to tag and typ:
character *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.
integer, dimension(:), allocatable itp
Integer type values corresponding to typ:
Declare arrays used to store data values and associated metadata for the current BUFR data subset in ...
integer, dimension(:), allocatable nval
Number of data values in BUFR data subset.
integer, dimension(:,:), allocatable, target inv
Inventory pointer which links each data value to its corresponding node in the internal jump/link tab...
integer, dimension(:,:), allocatable nrfelm
Referenced data value, for data values which refer to a previous data value in the BUFR data subset v...
recursive subroutine status(lunit, lun, il, im)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
subroutine x48(iin4, iout8, nval)
Encode one or more 4-byte integer values as 8-byte integer values.
subroutine x84(iin8, iout4, nval)
Encode one or more 8-byte integer values as 4-byte integer values.