NCEPLIBS-bufr 11.7.1
gettagpr.f
Go to the documentation of this file.
1C> @file
2C> @brief Get the parent for a specified occurrence of a Table B or
3C> Table D mnemonic.
4
5C> This subroutine returns the Table D mnemonic corresponding to the
6C> parent sequence of a specified Table B or Table D mnemonic within
7C> a data subset definition.
8C>
9C> @author J. Ator
10C> @date 2012-09-12
11C>
12C> @param[in] LUNIT -- integer: Fortran logical unit number for
13C> BUFR file
14C> @param[in] TAGCH -- character*(*): Table B or Table D mnemonic
15C> @param[in] NTAGCH -- integer: Ordinal occurrence of TAGCH for
16C> which the parent Table D mnemonic is to be
17C> returned, counting from the beginning of the
18C> overall subset definition
19C> @param[out] TAGPR -- character*(*): Table D mnemonic corresponding
20C> to parent sequence of (NTAGCH)th occurrence
21C> of TAGCH
22C> @param[out] IRET -- integer: return code
23C> - 0 = normal return
24C> - -1 = TAGPR could not be found, or some
25C> other error occurred
26C>
27C> <p>A data subset must already be in scope within the BUFRLIB
28C> internal arrays for LUNIT, either via a previous call to one
29C> of the [subset-reading subroutines](@ref hierarchy)
30C> (when reading BUFR data subsets) or via a previous call to one
31C> of the [message-writing subroutines](@ref hierarchy)
32C> (when writing BUFR data subsets).
33C>
34C> <b>Program history log:</b>
35C> | Date | Programmer | Comments |
36C> | -----|------------|----------|
37C> | 2012-09-12 | J. Ator | Original author |
38C> | 2014-10-02 | J. Ator | Modified to use fstag() |
39C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
40C>
41 SUBROUTINE gettagpr ( LUNIT, TAGCH, NTAGCH, TAGPR, IRET )
42
43 USE moda_usrint
44 USE moda_msgcwd
45 USE moda_tables
46
47 CHARACTER*(*) TAGCH, TAGPR
48
49C----------------------------------------------------------------------
50C----------------------------------------------------------------------
51
52 iret = -1
53
54C Get LUN from LUNIT.
55
56 CALL status( lunit, lun, il, im )
57 IF ( il .EQ. 0 ) RETURN
58 IF ( inode(lun) .NE. inv(1,lun) ) RETURN
59
60C Get TAGPR from the (NTAGCH)th occurrence of TAGCH.
61
62 CALL fstag( lun, tagch, ntagch, 1, nch, iret )
63 IF ( iret .NE. 0 ) RETURN
64
65 tagpr = tag(jmpb(inv(nch,lun)))
66
67 RETURN
68 END
subroutine fstag(LUN, UTAG, NUTAG, NIN, NOUT, IRET)
THIS SUBROUTINE FINDS THE (NUTAG)th OCCURRENCE OF MNEMONIC UTAG WITHIN THE CURRENT OVERALL SUBSET DEF...
Definition: fstag.f:41
subroutine gettagpr(LUNIT, TAGCH, NTAGCH, TAGPR, IRET)
This subroutine returns the Table D mnemonic corresponding to the parent sequence of a specified Tabl...
Definition: gettagpr.f:42
This module contains array and variable declarations used to store the internal jump/link table.
Definition: moda_tables.F:13
character *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.
Definition: moda_tables.F:132
integer, dimension(:), allocatable jmpb
Jump backward indices corresponding to tag and typ:
Definition: moda_tables.F:137
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
Definition: status.f:56