NCEPLIBS-bufr 11.7.1
lcmgdf.f
Go to the documentation of this file.
1C> @file
2C> @brief Check for the existence of any long character strings
3C> (greater than 8 bytes) within a data subset definition.
4
5C> This function checks whether the subset definition for a given
6C> message type contains any long character strings (greater
7C> than 8 bytes).
8C>
9C> @author J. Ator
10C> @date 2009-07-09
11C>
12C> @param[in] LUNIT -- integer: Fortran logical unit number for
13C> BUFR file
14C> @param[in] SUBSET -- character*8: Table A mnemonic of message
15C> type to be checked
16C> @returns lcmgdf -- integer:
17C> - 0 = SUBSET does not contain any long
18C> character strings
19C> - 1 = SUBSET contains at least one long
20C> character string
21C>
22C> @remarks
23C> - LUNIT may be open for either input or output operations via a
24C> previous call to subroutine openbf(). However, in either case,
25C> SUBSET must already be defined within the BUFR tables that are
26C> associated with LUNIT, typically as [DX BUFR tables](@ref dfbftab)
27C> information supplied via argument LUNDX when openbf() was called,
28C> or, if openbf() was called with IO = 'SEC3', then as
29C> [master BUFR table](@ref dfbfmstab) information during a previous
30C> call to one of the [message-reading subroutines](@ref hierarchy).
31C> - Note that this function does not return mnemonic(s) associated
32C> with any long character string(s) found within SUBSET; rather,
33C> it only checks whether at least one such mnemonic exists. If any
34C> are found, the application program can process them via a
35C> separate call to subroutine readlc() (when reading BUFR data
36C> subsets) or subroutine writlc() (when writing BUFR data subsets).
37C>
38C> <b>Program history log:</b>
39C> | Date | Programmer | Comments |
40C> | -----|------------|----------|
41C> | 2009-07-09 | J. Ator | Original author |
42C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
43C>
44 INTEGER FUNCTION lcmgdf(LUNIT,SUBSET)
45
46 USE moda_tables
47
48 CHARACTER*8 subset
49
50C-----------------------------------------------------------------------
51C-----------------------------------------------------------------------
52
53C Get LUN from LUNIT.
54
55 CALL status(lunit,lun,il,im)
56 IF (il.EQ.0) GOTO 900
57
58C Confirm that SUBSET is defined for this logical unit.
59
60 CALL nemtba(lun,subset,mtyp,msbt,inod)
61
62C Check if there's a long character string in the definition.
63
64 nte = isc(inod)-inod
65
66 DO i = 1, nte
67 IF ( (typ(inod+i).EQ.'CHR') .AND. (ibt(inod+i).GT.64) ) THEN
68 lcmgdf = 1
69 RETURN
70 ENDIF
71 ENDDO
72
73 lcmgdf = 0
74
75 RETURN
76900 CALL bort('BUFRLIB: LCMGDF - INPUT BUFR FILE IS CLOSED, IT MUST'//
77 . ' BE OPEN')
78 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
integer function lcmgdf(LUNIT, SUBSET)
This function checks whether the subset definition for a given message type contains any long charact...
Definition: lcmgdf.f:45
This module contains array and variable declarations used to store the internal jump/link table.
Definition: moda_tables.F:13
integer, dimension(:), allocatable isc
Scale factors corresponding to tag and typ:
Definition: moda_tables.F:140
character *3, dimension(:), allocatable typ
Type indicators corresponding to tag:
Definition: moda_tables.F:133
integer, dimension(:), allocatable ibt
Bit widths corresponding to tag and typ:
Definition: moda_tables.F:138
subroutine nemtba(LUN, NEMO, MTYP, MSBT, INOD)
This subroutine searches for a descriptor within Table A of the internal DX BUFR tables.
Definition: nemtba.f:36
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
Definition: status.f:56