NCEPLIBS-bufr  12.0.1
strbtm.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Store information about a bitmap element.
3 C>
4 C> @author J Ator @date 2016-05-27
5 
6 C> This subroutine stores internal information in
7 c> module bitmaps if the input element is part of a bitmap.
8 C>
9 C> @param[in] N - integer: subset element.
10 C> @param[in] LUN - integer: I/O stream index into internal memory arrays.
11 C>
12 C> @author J. Ator @date 2016-05-27
13  SUBROUTINE strbtm ( N, LUN )
14 
15  USE modv_mxbtm
16  USE modv_mxbtmse
17 
18  USE moda_msgcwd
19  USE moda_usrint
20  USE moda_tables
21  USE moda_bitmaps
22 
23  LOGICAL ISBTME
24 
25 C-----------------------------------------------------------------------
26 C-----------------------------------------------------------------------
27 
28  node = inv( n, lun )
29 
30  IF ( tag(node)(1:5) .EQ. 'DPRI ' ) THEN
31 
32 C Confirm that this is really an entry within a bitmap.
33 C Although it is rare, it is possible for a DPRI element
34 C to appear in a subset definition outside of a bitmap.
35 
36  isbtme = .false.
37  IF ( ntamc .GT. 0 ) THEN
38  nodtam = lstjpb( node, lun, 'SUB' )
39  DO ii = 1, ntamc
40  IF ( nodtam .EQ. inodtamc(ii) ) THEN
41  DO jj = 1, ntco(ii)
42  IF ( ( inodtco(ii,jj) .GE. inode(lun) ) .AND.
43  . ( inodtco(ii,jj) .LE. isc(inode(lun)) ) .AND.
44  . ( inodtco(ii,jj) .LT. node ) ) THEN
45  IF ( ctco(ii,jj) .EQ. '236000' ) THEN
46  isbtme = .true.
47  ELSE IF ( ( ctco(ii,jj) .EQ. '235000' ) .OR.
48  . ( ctco(ii,jj) .EQ. '237255' ) ) THEN
49  isbtme = .false.
50  END IF
51  END IF
52  END DO
53  END IF
54  END DO
55  END IF
56  IF ( .NOT. isbtme ) THEN
57  linbtm = .false.
58  RETURN
59  ELSE IF ( .NOT. linbtm ) THEN
60 
61 C This is the start of a new bitmap.
62 
63  IF ( nbtm .GE. mxbtm ) GOTO 900
64  nbtm = nbtm + 1
65  istbtm(nbtm) = n
66  iszbtm(nbtm) = 0
67  nbtmse(nbtm) = 0
68  linbtm = .true.
69  END IF
70  iszbtm(nbtm) = iszbtm(nbtm) + 1
71  IF ( ibfms(val(n,lun)) .EQ. 0 ) THEN
72 
73 C This is a "set" (value=0) entry in the bitmap.
74 
75  IF ( nbtmse(nbtm) .GE. mxbtmse ) GOTO 901
76  nbtmse(nbtm) = nbtmse(nbtm) + 1
78  END IF
79  ELSE IF ( itp(node) .GT. 1 ) THEN
80  linbtm = .false.
81  END IF
82 
83  RETURN
84 900 CALL bort('BUFRLIB: STRBTM - MXBTM OVERFLOW')
85 901 CALL bort('BUFRLIB: STRBTM - MXBTMSE OVERFLOW')
86  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
integer function ibfms(R8VAL)
Test whether a real*8 data value is "missing".
Definition: ibfms.f:28
function lstjpb(NODE, LUN, JBTYP)
This function searches backwards, beginning from a given node within the jump/link table,...
Definition: lstjpb.f:30
This module contains array and variable declarations used to store bitmaps internally within a data s...
integer, dimension(:), allocatable iszbtm
Size of bitmap (total number of entries, whether "set" (set to a value of 0) or not).
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...
logical linbtm
true if a bitmap is in the process of being read for the current data subset; false otherwise.
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 ...
This module contains declarations for arrays used to store information about the current BUFR message...
integer, dimension(:), allocatable inode
Table A mnemonic for type of BUFR message.
This module contains array and variable declarations used to store the internal jump/link table.
integer, dimension(:), allocatable isc
Scale factors 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:
This module contains declarations for arrays used to store data values and associated metadata for th...
real *8, dimension(:,:), allocatable, target val
Data values.
integer, dimension(:,:), allocatable, target inv
Inventory pointer which links each data value to its corresponding node in the internal jump/link tab...
This module declares and initializes the MXBTM variable.
integer mxbtm
Maximum number of bitmaps that can be stored internally for a data subset.
This module declares and initializes the MXBTMSE variable.
integer mxbtmse
Maximum number of "set" entries (set to a value of 0) within a bitmap.
subroutine strbtm(N, LUN)
This subroutine stores internal information in module bitmaps if the input element is part of a bitma...
Definition: strbtm.f:14