NCEPLIBS-bufr  12.0.1
icmpdx.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Check whether two BUFR files have the same DX BUFR table
3 C> information.
4 C>
5 C> @author J. Ator @date 2009-06-18
6 
7 C> This function determines whether the full set of associated
8 C> [DX BUFR Table information](@ref dfbftab) is identical between
9 C> two Fortran logical units.
10 C>
11 C> Note that two different logical units can have identical DX BUFR
12 C> Table information associated with them even if they aren't actually
13 C> sharing the same DX BUFR table.
14 C>
15 C> @param[in] LUD -- integer: Internal I/O stream index associated
16 C> with first BUFR file
17 C> @param[in] LUN -- integer: Internal I/O stream index associated
18 C> with second BUFR file
19 C> @returns icmpdx -- integer: Flag indicating whether the
20 C> BUFR file associated with LUD and the BUFR
21 C> file associated with LUN have the same DX
22 C> BUFR table information
23 C> - 0 = No
24 C> - 1 = Yes
25 C>
26 C> @author J. Ator @date 2009-06-18
27  INTEGER FUNCTION icmpdx(LUD,LUN)
28 
29  USE moda_tababd
30 
31 C-----------------------------------------------------------------------
32 C-----------------------------------------------------------------------
33 
34 C First, check whether the two units are actually sharing tables.
35 C If so, then they obviously have the same table information.
36 
37  icmpdx = ishrdx(lud,lun)
38  IF ( icmpdx .EQ. 1 ) RETURN
39 
40 C Otherwise, check whether the internal Table A, B and D entries are
41 C all identical between the two units.
42 
43  IF ( ( ntba(lud) .EQ. 0 ) .OR.
44  . ( ntba(lun) .NE. ntba(lud) ) ) RETURN
45  DO i = 1, ntba(lud)
46  IF ( idna(i,lun,1) .NE. idna(i,lud,1) ) RETURN
47  IF ( idna(i,lun,2) .NE. idna(i,lud,2) ) RETURN
48  IF ( taba(i,lun) .NE. taba(i,lud) ) RETURN
49  ENDDO
50 
51  IF ( ( ntbb(lud) .EQ. 0 ) .OR.
52  . ( ntbb(lun) .NE. ntbb(lud) ) ) RETURN
53  DO i = 1, ntbb(lud)
54  IF ( idnb(i,lun) .NE. idnb(i,lud) ) RETURN
55  IF ( tabb(i,lun) .NE. tabb(i,lud) ) RETURN
56  ENDDO
57 
58  IF ( ( ntbd(lud) .EQ. 0 ) .OR.
59  . ( ntbd(lun) .NE. ntbd(lud) ) ) RETURN
60  DO i = 1, ntbd(lud)
61  IF ( idnd(i,lun) .NE. idnd(i,lud) ) RETURN
62  IF ( tabd(i,lun) .NE. tabd(i,lud) ) RETURN
63  ENDDO
64 
65  icmpdx = 1
66 
67  RETURN
68  END
integer function icmpdx(LUD, LUN)
This function determines whether the full set of associated DX BUFR Table information is identical be...
Definition: icmpdx.f:28
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,...
character *600, dimension(:,:), allocatable tabd
Table D entries for each internal I/O stream.
character *128, dimension(:,:), allocatable taba
Table A entries for each internal I/O stream.
integer, dimension(:,:,:), allocatable idna
Message types (in array element 1) and subtypes (in array element 2) corresponding to taba.
integer, dimension(:), allocatable ntbd
Number of Table D entries for each internal I/O stream (up to a maximum of MAXTBD,...
integer, dimension(:), allocatable ntbb
Number of Table B entries for each internal I/O stream (up to a maximum of MAXTBB,...
integer, dimension(:,:), allocatable idnd
Bit-wise representations of the FXY values corresponding to tabd.
integer, dimension(:,:), allocatable idnb
Bit-wise representations of the FXY values corresponding to tabb.
character *128, dimension(:,:), allocatable tabb
Table B entries for each internal I/O stream.