NCEPLIBS-bufr  11.5.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> - 2009-07-09 J. Ator -- Original author
40 C> - 2014-12-10 J. Ator -- Use modules instead of COMMON blocks
41 C>
42  INTEGER FUNCTION lcmgdf(LUNIT,SUBSET)
43 
44  USE moda_tables
45 
46  CHARACTER*8 subset
47 
48 C-----------------------------------------------------------------------
49 C-----------------------------------------------------------------------
50 
51 C Get LUN from LUNIT.
52 
53  CALL status(lunit,lun,il,im)
54  IF (il.EQ.0) goto 900
55 
56 C Confirm that SUBSET is defined for this logical unit.
57 
58  CALL nemtba(lun,subset,mtyp,msbt,inod)
59 
60 C Check if there's a long character string in the definition.
61 
62  nte = isc(inod)-inod
63 
64  DO i = 1, nte
65  IF ( (typ(inod+i).EQ.'CHR') .AND. (ibt(inod+i).GT.64) ) THEN
66  lcmgdf = 1
67  RETURN
68  ENDIF
69  ENDDO
70 
71  lcmgdf = 0
72 
73  RETURN
74 900 CALL bort('BUFRLIB: LCMGDF - INPUT BUFR FILE IS CLOSED, IT MUST'//
75  . ' BE OPEN')
76  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:42
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:61
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
subroutine nemtba(LUN, NEMO, MTYP, MSBT, INOD)
THIS SUBROUTINE SEARCHES FOR MNEMONIC NEMO WITHIN THE INTERNAL TABLE A ARRAYS HOLDING THE DICTIONARY ...
Definition: nemtba.f:50