NCEPLIBS-bufr 11.7.1
ishrdx.f
Go to the documentation of this file.
1C> @file
2C> @brief Check whether two BUFR files are sharing the same DX BUFR
3C> table.
4
5C> This function determines whether the same
6C> [DX BUFR Table](@ref dfbftab) is being shared between two
7C> Fortran logical units.
8C>
9C> @author J. Ator
10C> @date 2009-06-18
11C>
12C> @param[in] LUD -- integer: Internal I/O stream index associated
13C> with first BUFR file
14C> @param[in] LUN -- integer: Internal I/O stream index associated
15C> with second BUFR file
16C> @returns ishrdx -- integer: Flag indicating whether the same
17C> DX BUFR table is being shared between the
18C> BUFR file associated with LUD and the BUFR
19C> file associated with LUN
20C> - 0 = No
21C> - 1 = Yes
22C>
23C> <b>Program history log:</b>
24C> | Date | Programmer | Comments |
25C> | -----|------------|----------|
26C> | 2009-06-18 | J. Ator | Original author |
27C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
28C>
29 INTEGER FUNCTION ishrdx(LUD,LUN)
30
31 USE moda_tababd
32
33C-----------------------------------------------------------------------
34C-----------------------------------------------------------------------
35
36C Note that, for any I/O stream index value LUx, the MTAB(*,LUx)
37C array contains pointer indices into the internal jump/link table
38C for each of the Table A mnemonics that is currently defined for
39C that LUx value. Thus, if all of these indices are identical for
40C two different LUx values, then the associated logical units are
41C sharing table information.
42
43 IF ( ( ntba(lud) .GE. 1 ) .AND.
44 + ( ntba(lud) .EQ. ntba(lun) ) ) THEN
45 ii = 1
46 ishrdx = 1
47 DO WHILE ( ( ii .LE. ntba(lud) ) .AND. ( ishrdx .EQ. 1 ) )
48 IF ( ( mtab(ii,lud) .NE. 0 ) .AND.
49 + ( mtab(ii,lud) .EQ. mtab(ii,lun) ) ) THEN
50 ii = ii + 1
51 ELSE
52 ishrdx = 0
53 ENDIF
54 ENDDO
55 ELSE
56 ishrdx = 0
57 ENDIF
58
59 RETURN
60 END
integer function ishrdx(LUD, LUN)
This function determines whether the same DX BUFR Table is being shared between two Fortran logical u...
Definition: ishrdx.f:30
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
integer, dimension(:,:), allocatable mtab
Entries within jump/link table corresponding to taba.
Definition: moda_tababd.F:54
integer, dimension(:), allocatable ntba
Number of Table A entries for each internal I/O stream (up to a maximum of MAXTBA,...
Definition: moda_tababd.F:51