NCEPLIBS-bufr  12.0.1
cmpmsg.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Specify the use of compression when writing BUFR messages.
3 C>
4 C> @author J. Ator @date 2005-03-09
5 
6 C> Specify the use of compression when writing BUFR messages.
7 C>
8 C> This subroutine is used to specify whether BUFR messages output
9 C> by future calls to [message-writing subroutines](@ref hierarchy) and
10 C> [subset-writing subroutines](@ref hierarchy) are to be compressed.
11 C>
12 C> This subroutine can be called at any time after the first call
13 C> to subroutine openbf(), and the specified value for CF will remain
14 C> in effect for all future calls to
15 C> [message-writing subroutines](@ref hierarchy) and
16 C> [subset-writing subroutines](@ref hierarchy) for all Fortran logical
17 C> units that are open for output within the application program, unless
18 C> a subsequent call is made to this subroutine to reset the value of
19 C> CF again. If this subroutine is never called, a default value of
20 C> 'N' is used for CF, as set within subroutine bfrini().
21 C>
22 C> When compression is activated, it is implemented using the
23 C> algorithm for data subset compression prescribed within the
24 C> [official WMO BUFR regulations](@ref manual).
25 C> Compression is most useful when the data subsets to be
26 C> compressed are devoid of any delayed replication, and when
27 C> there is minimal variation of corresponding data values among
28 C> different data subsets within the same BUFR message. Otherwise,
29 C> compression may provide little to no benefit, and which is why
30 C> it is not activated by default.
31 C>
32 C> @param[in] CF - character*1: Flag indicating whether future BUFR
33 C> output messages are to be compressed
34 C> - 'N' = No (the default)
35 C> - 'Y' = Yes
36 C>
37 C> @author J. Ator @date 2005-03-09
38  SUBROUTINE cmpmsg(CF)
39 
40  COMMON /msgcmp/ ccmf
41 
42  CHARACTER*128 BORT_STR
43  CHARACTER*1 CCMF, CF
44 
45 C-----------------------------------------------------------------------
46 C-----------------------------------------------------------------------
47 
48  CALL capit(cf)
49  IF(cf.NE.'Y'.AND. cf.NE.'N') GOTO 900
50  ccmf = cf
51 
52 C EXITS
53 C -----
54 
55  RETURN
56 900 WRITE(bort_str,'("BUFRLIB: CMPMSG - INPUT ARGUMENT IS ",A1,'//
57  . '", IT MUST BE EITHER Y OR N")') cf
58  CALL bort(bort_str)
59  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
subroutine capit(STR)
This subroutine capitalizes all of the alphabetic characters in a string.
Definition: capit.f:13
subroutine cmpmsg(CF)
Specify the use of compression when writing BUFR messages.
Definition: cmpmsg.f:39