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