NCEPLIBS-bufr  12.0.1
conwin.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Search consecutive subset buffer segments
3 C> for an element identified in the user string as a conditional node.
4 C> @author Woollen @date 1994-01-06
5 
6 C> This subroutine searches consecutive subset buffer segments for an
7 C> element identified in the user string as a conditional node. A conditional
8 C> node is an element which must meet a condition in order to be read
9 C> from or written to a data subset. If a conditional element is
10 C> found and it conforms to the condition, then the internal subset
11 C> buffer indices of the "window" (see below remarks) are returned to
12 C> the caller for processing.
13 C>
14 C> The four conditions which can be exercised are:
15 C> - '<' - less than
16 C> - '>' - greater than
17 C> - '=' - equal
18 C> - '!' - not equal
19 C>
20 C> Each condition in a string is applied to one element, and all
21 C> conditions are 'and'ed to evaluate an outcome. For example, if the
22 C> condition string is: "POB<500 TOB>30 TQM<4" then the only levels of
23 C> data read or written are those with pressure lt 500 mb, temperature
24 C> gt 30 deg, and temperature quality mark < 4.
25 C>
26 C> See getwin() for an explanation of "windows" within the context of a
27 C> BUFR data subset.
28 C>
29 C> Function conwin() works with function invcon() to identify subset
30 C> buffer segments which conform to the set of conditions.
31 C>
32 C> @param[in] LUN integer I/O stream index into internal memory arrays.
33 C> @param[out] INC1 integer subset buffer start index
34 C> @param[inout] INC2 integer subset buffer ending index
35 C>
36 C> @author Woollen @date 1994-01-06
37  SUBROUTINE conwin(LUN,INC1,INC2)
38 
39  USE moda_usrint
40 
41  COMMON /usrstr/ nnod,ncon,nods(20),nodc(10),ivls(10),kons(10)
42 
43 C----------------------------------------------------------------------
44 C----------------------------------------------------------------------
45 
46 C SPECIAL CASE
47 C ------------
48 
49  IF(ncon.EQ.0) THEN
50 c .... There are no condition nodes in the string
51  inc1 = 1
52  inc2 = nval(lun)
53  GOTO 100
54  ENDIF
55 
56 C EVALUATE CONDITIONS TO SEE IF ANY MORE CASES
57 C --------------------------------------------
58 
59 15 CALL getwin(nodc(1),lun,inc1,inc2)
60  IF(inc1.GT.0) THEN
61  DO nc=1,ncon
62  icon = invcon(nc,lun,inc1,inc2)
63  IF(icon.EQ.0) GOTO 15
64  ENDDO
65  ENDIF
66 
67 C EXIT
68 C ----
69 
70 100 RETURN
71  END
subroutine conwin(LUN, INC1, INC2)
This subroutine searches consecutive subset buffer segments for an element identified in the user str...
Definition: conwin.f:38
subroutine getwin(NODE, LUN, IWIN, JWIN)
Given a node index within the internal jump/link table, this subroutine looks within the current subs...
Definition: getwin.f:48
function invcon(NC, LUN, INV1, INV2)
This function searches a "window" (see below remarks) for an element identified in the user string as...
Definition: invcon.f:32
This module contains declarations for arrays used to store data values and associated metadata for th...
integer, dimension(:), allocatable nval
Number of data values in BUFR data subset.