NCEPLIBS-bufr  11.6.0
 All Data Structures Files Functions Variables Pages
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 
5 C> This function determines whether the same
6 C> [DX BUFR Table](@ref dfbftab) is being shared between two
7 C> Fortran logical units.
8 C>
9 C> @author J. Ator
10 C> @date 2009-06-18
11 C>
12 C> @param[in] LUD -- integer: Internal I/O stream index associated
13 C> with first BUFR file
14 C> @param[in] LUN -- integer: Internal I/O stream index associated
15 C> with second BUFR file
16 C> @returns ishrdx -- integer: Flag indicating whether the same
17 C> DX BUFR table is being shared between the
18 C> BUFR file associated with LUD and the BUFR
19 C> file associated with LUN
20 C> - 0 = No
21 C> - 1 = Yes
22 C>
23 C> <b>Program history log:</b>
24 C> | Date | Programmer | Comments |
25 C> | -----|------------|----------|
26 C> | 2009-06-18 | J. Ator | Original author |
27 C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
28 C>
29  INTEGER FUNCTION ishrdx(LUD,LUN)
30 
31  USE moda_tababd
32 
33 C-----------------------------------------------------------------------
34 C-----------------------------------------------------------------------
35 
36 C Note that, for any I/O stream index value LUx, the MTAB(*,LUx)
37 C array contains pointer indices into the internal jump/link table
38 C for each of the Table A mnemonics that is currently defined for
39 C that LUx value. Thus, if all of these indices are identical for
40 C two different LUx values, then the associated logical units are
41 C 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
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
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:29