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