NCEPLIBS-bufr  12.0.1
invtag.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Search for a specified mnemonic 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 mnemonic within the
8 C> portion of the current subset buffer bounded by the indices inv1
9 C> and inv2. It is similar to library function invwin(),
10 C> except that invwin() searches based on the actual node within the
11 C> internal jump/link table, rather than on the mnemonic corresponding
12 C> to that node.
13 C>
14 C> @param[in] NODE - integer: jump/link table index of mnemonic to look for
15 C> @param[in] LUN - integer: file ID
16 C> @param[in] INV1 - integer: starting index of the portion of the subset buffer in which to look
17 C> @param[in] INV2 - integer: ending index of the portion of the subset buffer in which to look
18 C>
19 C> @return - integer: location index of node within specified portion of subset buffer
20 C> - 0 not found
21 C>
22 C> @author Woollen @date 1994-01-06
23  FUNCTION invtag(NODE,LUN,INV1,INV2)
24 
25  USE moda_usrint
26  USE moda_tables
27 
28  COMMON /quiet/ iprt
29 
30  CHARACTER*10 tagn
31 
32 C----------------------------------------------------------------------
33 C----------------------------------------------------------------------
34 
35  invtag = 0
36  IF(node.EQ.0) GOTO 200
37  tagn = tag(node)
38 
39 C SEARCH BETWEEN INV1 AND INV2
40 C ----------------------------
41 
42  DO invtag=inv1,inv2
43  IF(tag(inv(invtag,lun)).EQ.tagn) GOTO 100
44  ENDDO
45 
46  invtag = 0
47 
48 200 IF(iprt.GE.2) THEN
49  CALL errwrt('++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
50  CALL errwrt('BUFRLIB: INVTAG - RETURNING WITH A VALUE OF 0')
51  CALL errwrt('++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
52  CALL errwrt(' ')
53  ENDIF
54 
55 C EXIT
56 C ----
57 
58 100 RETURN
59  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 invtag(NODE, LUN, INV1, INV2)
This function looks for a specified mnemonic within the portion of the current subset buffer bounded ...
Definition: invtag.f:24
This module contains array and variable declarations used to store the internal jump/link table.
character *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.
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...