NCEPLIBS-bufr 11.7.1
nvnwin.f
Go to the documentation of this file.
1C> @file
2C> @author WOOLLEN @date 1994-01-06
3
4C> THIS FUNCTION LOOKS FOR AND RETURNS ALL OCCURRENCES OF A
5C> SPECIFIED NODE WITHIN THE PORTION OF THE CURRENT SUBSET BUFFER
6C> BOUNDED BY THE INDICES INV1 AND INV2. THE RESULTING LIST IS A
7C> STACK OF "EVENT" INDICES FOR THE REQUESTED NODE.
8C>
9C> PROGRAM HISTORY LOG:
10C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
11C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
12C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
13C> ROUTINE "BORT"
14C> 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
15C> OPENED AT ONE TIME INCREASED FROM 10 TO 32
16C> (NECESSARY IN ORDER TO PROCESS MULTIPLE
17C> BUFR FILES UNDER THE MPI)
18C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
19C> INTERDEPENDENCIES
20C> 2003-11-04 D. KEYSER -- MAXJL (MAXIMUM NUMBER OF JUMP/LINK ENTRIES)
21C> INCREASED FROM 15000 TO 16000 (WAS IN
22C> VERIFICATION VERSION); UNIFIED/PORTABLE FOR
23C> WRF; ADDED DOCUMENTATION (INCLUDING
24C> HISTORY); OUTPUTS MORE COMPLETE DIAGNOSTIC
25C> INFO WHEN ROUTINE TERMINATES ABNORMALLY OR
26C> UNUSUAL THINGS HAPPEN
27C> 2009-03-23 J. ATOR -- USE 1E9 TO PREVENT OVERFLOW WHEN
28C> INITIALIZING INVN; USE ERRWRT
29C> 2009-03-31 J. WOOLLEN -- ADDED DOCUMENTATION
30C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
31C>
32C> USAGE: NVNWIN (NODE, LUN, INV1, INV2, INVN, NMAX)
33C> INPUT ARGUMENT LIST:
34C> NODE - INTEGER: JUMP/LINK TABLE INDEX TO LOOK FOR
35C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
36C> INV1 - INTEGER: STARTING INDEX OF THE PORTION OF THE SUBSET
37C> BUFFER IN WHICH TO LOOK
38C> INV2 - INTEGER: ENDING INDEX OF THE PORTION OF THE SUBSET
39C> BUFFER IN WHICH TO LOOK
40C> NMAX - INTEGER: DIMENSIONED SIZE OF INVN; USED BY THE
41C> FUNCTION TO ENSURE THAT IT DOES NOT OVERFLOW THE
42C> INVN ARRAY
43C>
44C> OUTPUT ARGUMENT LIST:
45C> INVN - INTEGER: ARRAY OF STACK "EVENT" INDICES FOR NODE
46C> NVNWIN - INTEGER: NUMBER OF INDICES RETURNED WITHIN INVN
47C>
48C> REMARKS:
49C> THIS ROUTINE CALLS: BORT ERRWRT
50C> THIS ROUTINE IS CALLED BY: UFBEVN
51C> Normally not called by any application
52C> programs.
53C>
54 FUNCTION nvnwin(NODE,LUN,INV1,INV2,INVN,NMAX)
55
56 USE moda_usrint
57
58 COMMON /quiet / iprt
59
60 CHARACTER*128 bort_str
61 dimension invn(nmax)
62
63C----------------------------------------------------------------------
64C----------------------------------------------------------------------
65
66 nvnwin = 0
67
68 IF(node.EQ.0) THEN
69 IF(iprt.GE.1) THEN
70 CALL errwrt('+++++++++++++++++++++WARNING+++++++++++++++++++++++')
71 CALL errwrt('BUFRLIB: NVNWIN - NODE=0, IMMEDIATE RETURN')
72 CALL errwrt('+++++++++++++++++++++WARNING+++++++++++++++++++++++')
73 CALL errwrt(' ')
74 ENDIF
75 GOTO 100
76 ENDIF
77
78 DO i=1,nmax
79 invn(i) = 1e9
80 ENDDO
81
82C SEARCH BETWEEN INV1 AND INV2
83C ----------------------------
84
85 DO n=inv1,inv2
86 IF(inv(n,lun).EQ.node) THEN
87 IF(nvnwin+1.GT.nmax) GOTO 900
88 nvnwin = nvnwin+1
89 invn(nvnwin) = n
90 ENDIF
91 ENDDO
92
93C EXITS
94C -----
95
96100 RETURN
97900 WRITE(bort_str,'("BUFRLIB: NVNWIN - THE NUMBER OF EVENTS, '//
98 . 'NVNWIN (",I5,") EXCEEDS THE LIMIT, NMAX (",I5,")")') nvnwin,nmax
99 CALL bort(bort_str)
100 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
Definition: errwrt.f:42
function nvnwin(NODE, LUN, INV1, INV2, INVN, NMAX)
THIS FUNCTION LOOKS FOR AND RETURNS ALL OCCURRENCES OF A SPECIFIED NODE WITHIN THE PORTION OF THE CUR...
Definition: nvnwin.f:55