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