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