NCEPLIBS-bufr  12.0.1
writcp.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Write a data subset into a BUFR message using compression.
3 C>
4 C> @author J. Woollen @date 2002-05-14
5 
6 C> Write a data subset into a BUFR message using compression.
7 C>
8 C> This subroutine is similar to subroutine writsb(), except that
9 C> when the subset is encoded and packed into the current message
10 C> for the BUFR file associated with logical unit LUNIT, it is
11 C> packed using compression as prescribed within the
12 C> [official WMO BUFR regulations](@ref manual).
13 C>
14 C> This subroutine activates compression via an internal call to
15 C> subroutine cmpmsg(), followed by an internal call to subroutine
16 C> writsb(), followed by a second internal call to subroutine
17 C> cmpmsg() to deactivate compression. For this reason, most
18 C> application programs which write compressed BUFR messages now
19 C> call subroutines cmpmsg() and writsb() directly; however, this
20 C> subroutine is still supported within the BUFRLIB software for
21 C> backwards-compatibility with certain legacy application programs.
22 C>
23 C> @param[in] lunit - integer: Fortran logical unit number for BUFR file.
24 C>
25 C> @author J. Woollen @date 2002-05-14
26 
27  RECURSIVE SUBROUTINE writcp(LUNIT)
28 
29  USE modv_im8b
30 
31 C Check for I8 integers.
32 
33  IF(im8b) THEN
34  im8b=.false.
35 
36  CALL x84(lunit,my_lunit,1)
37  CALL writcp(my_lunit)
38 
39  im8b=.true.
40  RETURN
41  ENDIF
42 
43  CALL cmpmsg('Y')
44 
45  CALL writsb(lunit)
46 
47  CALL cmpmsg('N')
48 
49  RETURN
50  END
subroutine cmpmsg(CF)
Specify the use of compression when writing BUFR messages.
Definition: cmpmsg.f:39
This module declares and initializes the IM8B variable.
logical, public im8b
Status indicator to keep track of whether all future calls to BUFRLIB subroutines and functions from ...
recursive subroutine writcp(LUNIT)
Write a data subset into a BUFR message using compression.
Definition: writcp.f:28
recursive subroutine writsb(LUNIT)
Write a data subset into a BUFR message.
Definition: writsb.f:45
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x84.F:19