NCEPLIBS-bufr  11.7.0
 All Data Structures Files Functions Variables Pages
conwin.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 1994-01-06
3 
4 C> THIS SUBROUTINE SEARCHES CONSECUTIVE SUBSET BUFFER SEGMENTS
5 C> FOR AN ELEMENT IDENTIFIED IN THE USER STRING AS A CONDITIONAL NODE
6 C> (I.E. AN ELEMENT WHICH MUST MEET A CONDITION IN ORDER TO BE READ
7 C> FROM OR WRITTEN TO A DATA SUBSET). IF A CONDITIONAL ELEMENT IS
8 C> FOUND AND IT CONFORMS TO THE CONDITION, THEN THE INTERNAL SUBSET
9 C> BUFFER INDICES OF THE "WINDOW" (SEE BELOW REMARKS) ARE RETURNED TO
10 C> THE CALLER FOR PROCESSING.
11 C>
12 C> THE FOUR CONDITIONS WHICH CAN BE EXERCISED ARE:
13 C> '<' - LESS THAN
14 C> '>' - GREATER THAN
15 C> '=' - EQUAL
16 C> '!' - NOT EQUAL
17 C>
18 C> EACH CONDITION IN A STRING IS APPLIED TO ONE ELEMENT, AND ALL
19 C> CONDITIONS ARE 'AND'ED TO EVALUATE AN OUTCOME. FOR EXAMPLE, IF THE
20 C> CONDITION STRING IS: "POB<500 TOB>30 TQM<4" THEN THE ONLY LEVELS OF
21 C> DATA READ OR WRITTEN ARE THOSE WITH PRESSURE LT 500 MB, TEMPERATURE
22 C> GT 30 DEG, AND TEMPERATURE QUALITY MARK < 4.
23 C>
24 C> PROGRAM HISTORY LOG:
25 C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
26 C> 1998-07-08 J. WOOLLEN -- IMPROVED MACHINE PORTABILITY
27 C> 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
28 C> OPENED AT ONE TIME INCREASED FROM 10 TO 32
29 C> (NECESSARY IN ORDER TO PROCESS MULTIPLE
30 C> BUFR FILES UNDER THE MPI)
31 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
32 C> INTERDEPENDENCIES
33 C> 2003-11-04 D. KEYSER -- MAXJL (MAXIMUM NUMBER OF JUMP/LINK ENTRIES)
34 C> INCREASED FROM 15000 TO 16000 (WAS IN
35 C> VERIFICATION VERSION); UNIFIED/PORTABLE FOR
36 C> WRF; ADDED DOCUMENTATION (INCLUDING
37 C> HISTORY)
38 C> 2010-04-27 J. WOOLLEN -- CORRECT LOGICAL FLAW AND ADD DOCUMENTATION
39 C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
40 C>
41 C> USAGE: CALL CONWIN (LUN, INC1, INC2)
42 C> INPUT ARGUMENT LIST:
43 C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
44 C> INC1 - INTEGER: SUBSET BUFFER START INDEX
45 C> INC2 - INTEGER: SUBSET BUFFER ENDING INDEX
46 C>
47 C> OUTPUT ARGUMENT LIST:
48 C> INC1 - INTEGER: SUBSET BUFFER START INDEX
49 C> INC2 - INTEGER: SUBSET BUFFER ENDING INDEX
50 C>
51 C> REMARKS:
52 C>
53 C> SEE THE DOCBLOCK IN BUFR ARCHIVE LIBRARY SUBROUTINE GETWIN FOR AN
54 C> EXPLANATION OF "WINDOWS" WITHIN THE CONTEXT OF A BUFR DATA SUBSET.
55 C>
56 C> FUNCTION CONWIN WORKS WITH FUNCTION INVCON TO IDENTIFY SUBSET
57 C> BUFFER SEGMENTS WHICH CONFORM TO THE SET OF CONDITIONS.
58 C>
59 C> THIS ROUTINE CALLS: GETWIN INVCON
60 C> THIS ROUTINE IS CALLED BY: UFBEVN UFBIN3 UFBRW
61 C> Normally not called by any application
62 C> programs.
63 C>
64  SUBROUTINE conwin(LUN,INC1,INC2)
65 
66  USE moda_usrint
67 
68  COMMON /usrstr/ nnod,ncon,nods(20),nodc(10),ivls(10),kons(10)
69 
70 C----------------------------------------------------------------------
71 C----------------------------------------------------------------------
72 
73 C SPECIAL CASE
74 C ------------
75 
76  IF(ncon.EQ.0) THEN
77 c .... There are no condition nodes in the string
78  inc1 = 1
79  inc2 = nval(lun)
80  goto 100
81  ENDIF
82 
83 C EVALUATE CONDITIONS TO SEE IF ANY MORE CASES
84 C --------------------------------------------
85 
86 15 CALL getwin(nodc(1),lun,inc1,inc2)
87  IF(inc1.GT.0) THEN
88  DO nc=1,ncon
89  icon = invcon(nc,lun,inc1,inc2)
90  IF(icon.EQ.0) goto 15
91  ENDDO
92  ENDIF
93 
94 C EXIT
95 C ----
96 
97 100 RETURN
98  END
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:81
function invcon(NC, LUN, INV1, INV2)
THIS FUNCTION SEARCHES A &quot;WINDOW&quot; (SEE BELOW REMARKS) FOR AN ELEMENT IDENTIFIED IN THE USER STRING AS...
Definition: invcon.f:57
subroutine conwin(LUN, INC1, INC2)
THIS SUBROUTINE SEARCHES CONSECUTIVE SUBSET BUFFER SEGMENTS FOR AN ELEMENT IDENTIFIED IN THE USER STR...
Definition: conwin.f:64