NCEPLIBS-bufr  12.0.0
invwin.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Search for a specified node within a specified portion
3 C> of the current data subset.
4 C>
5 C> @author Woollen @date 1994-01-06
6 
7 C> This function looks for a specified node within the portion
8 C> of the current subset buffer bounded by the indices inv1 and inv2.
9 C> It is similar to library function invtag(), except that
10 C> invtag() searches based on the mnemonic corresponding to the node.
11 C>
12 C> @param[in] NODE - integer: jump/link table index to look for
13 C> @param[in] LUN - integer: file ID
14 C> @param[in] INV1 - integer: starting index of the portion of the subset buffer in which to look
15 C> @param[in] INV2 - integer: ending index of the portion of the subset buffer in which to look
16 C>
17 C> @return - integer: location index of node within specified portion of subset buffer
18 C> - 0 not found
19 C>
20 C> @author Woollen @date 1994-01-06
21  FUNCTION invwin(NODE,LUN,INV1,INV2)
22 
23  USE moda_usrint
24 
25  COMMON /quiet/ iprt
26 
27 C----------------------------------------------------------------------
28 C----------------------------------------------------------------------
29 
30  invwin = 0
31  IF(node.EQ.0) GOTO 200
32 
33 C SEARCH BETWEEN INV1 AND INV2
34 C ----------------------------
35 
36  DO invwin=inv1,inv2
37  IF(inv(invwin,lun).EQ.node) GOTO 100
38  ENDDO
39 
40  invwin = 0
41 
42  200 IF(iprt.GE.2) THEN
43  CALL errwrt('++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
44  CALL errwrt('BUFRLIB: INVWIN - RETURNING WITH A VALUE OF 0')
45  CALL errwrt('++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
46  CALL errwrt(' ')
47  ENDIF
48 
49 C EXIT
50 C ----
51 
52 100 RETURN
53  END
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
Definition: errwrt.f:36
function invwin(NODE, LUN, INV1, INV2)
This function looks for a specified node within the portion of the current subset buffer bounded by t...
Definition: invwin.f:22
This module contains declarations for arrays used to store data values and associated metadata for th...
integer, dimension(:,:), allocatable, target inv
Inventory pointer which links each data value to its corresponding node in the internal jump/link tab...