NCEPLIBS-bufr  12.0.1
lstjpb.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Search backwards from a specified node of the jump/link table
3 C> for a node of a specified type.
4 C>
5 C> @author Woollen @date 1994-01-06
6 
7 C> This function searches backwards, beginning from a given
8 C> node within the jump/link table, until it finds the most recent
9 C> node of type jbtyp. The internal jmpb array is used to jump
10 C> backwards within the jump/link table, and the function returns
11 C> the table index of the found node. If the input node itself is
12 C> of type jbtyp, then the function simply returns the index of that
13 C> same node.
14 C>
15 C> @note See tabsub() for an
16 C> explanation of the various node types present within an internal
17 C> jump/link table.
18 C>
19 C> @param[in] NODE - integer: jump/link table index of entry to begin
20 C> searching backwards from
21 C> @param[in] LUN - integer: I/O stream index into internal memory arrays
22 C> @param[in] JBTYP - character*(*): type of node for which to search
23 C>
24 C> @return - integer: index of first node of type jbtyp found by
25 C> jumping backwards from input node
26 C> - 0 no such node found
27 C>
28 C> @author Woollen @date 1994-01-06
29  FUNCTION lstjpb(NODE,LUN,JBTYP)
30 
31  USE moda_msgcwd
32  USE moda_tables
33 
34  CHARACTER*(*) jbtyp
35  CHARACTER*128 bort_str
36 
37 C----------------------------------------------------------------------
38 C----------------------------------------------------------------------
39 
40  IF(node.LT.inode(lun)) GOTO 900
41  IF(node.GT.isc(inode(lun))) GOTO 901
42 
43  nod = node
44 
45 C FIND THIS OR THE PREVIOUS "JBTYP" NODE
46 C --------------------------------------
47 
48 10 IF(typ(nod).NE.jbtyp) THEN
49  nod = jmpb(nod)
50  IF(nod.NE.0) GOTO 10
51  ENDIF
52 
53  lstjpb = nod
54 
55 C EXITS
56 C -----
57 
58  RETURN
59 900 WRITE(bort_str,'("BUFRLIB: LSTJPB - TABLE NODE (",I7,") IS OUT '//
60  . 'OF BOUNDS, < LOWER BOUNDS (",I7,"); TAG IS ",A10)')
61  . node,inode(lun),tag(node)
62  CALL bort(bort_str)
63 901 WRITE(bort_str,'("BUFRLIB: LSTJPB - TABLE NODE (",I7,") IS OUT '//
64  . 'OF BOUNDS, > UPPER BOUNDS (",I7,"); TAG IS ",A10)')
65  . node,isc(inode(lun)),tag(node)
66  CALL bort(bort_str)
67  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
function lstjpb(NODE, LUN, JBTYP)
This function searches backwards, beginning from a given node within the jump/link table,...
Definition: lstjpb.f:30
This module contains declarations for arrays used to store information about the current BUFR message...
integer, dimension(:), allocatable inode
Table A mnemonic for type of BUFR message.
This module contains array and variable declarations used to store the internal jump/link table.
integer, dimension(:), allocatable isc
Scale factors corresponding to tag and typ:
character *3, dimension(:), allocatable typ
Type indicators corresponding to tag:
integer, dimension(:), allocatable jmpb
Jump backward indices corresponding to tag and typ:
character *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.