1 FUNCTION NVNWIN
(NODE
,LUN
,INV1
,INV2
,INVN
,NMAX
)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS FUNCTION LOOKS FOR AND RETURNS ALL OCCURRENCES OF A
9 C SPECIFIED NODE WITHIN THE PORTION OF THE CURRENT SUBSET BUFFER
10 C BOUNDED BY THE INDICES INV1 AND INV2. THE RESULTING LIST IS A
11 C STACK OF "EVENT" INDICES FOR THE REQUESTED NODE.
13 C PROGRAM HISTORY LOG:
14 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
15 C 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
16 C "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
18 C 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
19 C OPENED AT ONE TIME INCREASED FROM 10 TO 32
20 C (NECESSARY IN ORDER TO PROCESS MULTIPLE
21 C BUFR FILES UNDER THE MPI)
22 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
24 C 2003-11-04 D. KEYSER -- MAXJL (MAXIMUM NUMBER OF JUMP/LINK ENTRIES)
25 C INCREASED FROM 15000 TO 16000 (WAS IN
26 C VERIFICATION VERSION); UNIFIED/PORTABLE FOR
27 C WRF; ADDED DOCUMENTATION (INCLUDING
28 C HISTORY); OUTPUTS MORE COMPLETE DIAGNOSTIC
29 C INFO WHEN ROUTINE TERMINATES ABNORMALLY OR
30 C UNUSUAL THINGS HAPPEN
31 C 2009-03-23 J. ATOR -- USE 1E9 TO PREVENT OVERFLOW WHEN
32 C INITIALIZING INVN; USE ERRWRT
33 C 2009-03-31 J. WOOLLEN -- ADDED DOCUMENTATION
35 C USAGE: NVNWIN (NODE, LUN, INV1, INV2, INVN, NMAX)
36 C INPUT ARGUMENT LIST:
37 C NODE - INTEGER: JUMP/LINK TABLE INDEX TO LOOK FOR
38 C LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
39 C INV1 - INTEGER: STARTING INDEX OF THE PORTION OF THE SUBSET
40 C BUFFER IN WHICH TO LOOK
41 C INV2 - INTEGER: ENDING INDEX OF THE PORTION OF THE SUBSET
42 C BUFFER IN WHICH TO LOOK
43 C NMAX - INTEGER: DIMENSIONED SIZE OF INVN; USED BY THE
44 C FUNCTION TO ENSURE THAT IT DOES NOT OVERFLOW THE
47 C OUTPUT ARGUMENT LIST:
48 C INVN - INTEGER: ARRAY OF STACK "EVENT" INDICES FOR NODE
49 C NVNWIN - INTEGER: NUMBER OF INDICES RETURNED WITHIN INVN
52 C THIS ROUTINE CALLS: BORT ERRWRT
53 C THIS ROUTINE IS CALLED BY: UFBEVN
54 C Normally not called by any application
58 C LANGUAGE: FORTRAN 77
59 C MACHINE: PORTABLE TO ALL PLATFORMS
65 COMMON /USRINT
/ NVAL
(NFILES
),INV
(MAXSS
,NFILES
),VAL
(MAXSS
,NFILES
)
68 CHARACTER*128 BORT_STR
72 C----------------------------------------------------------------------
73 C----------------------------------------------------------------------
79 CALL ERRWRT
('+++++++++++++++++++++WARNING+++++++++++++++++++++++')
80 CALL ERRWRT
('BUFRLIB: NVNWIN - NODE=0, IMMEDIATE RETURN')
81 CALL ERRWRT
('+++++++++++++++++++++WARNING+++++++++++++++++++++++')
91 C SEARCH BETWEEN INV1 AND INV2
92 C ----------------------------
95 IF(INV
(N
,LUN
).EQ
.NODE
) THEN
96 IF(NVNWIN
+1.GT
.NMAX
) GOTO 900
106 900 WRITE(BORT_STR
,'("BUFRLIB: NVNWIN - THE NUMBER OF EVENTS, '//
107 . 'NVNWIN (",I5,") EXCEEDS THE LIMIT, NMAX (",I5,")")') NVNWIN
,NMAX