NCEPLIBS-bufr 11.7.1
setblock.f
Go to the documentation of this file.
1C> @file
2C> @brief Specify the use of IEEE Fortran control words when writing
3C> BUFR messages.
4
5C> This subroutine is used to specify whether BUFR messages output by
6C> future calls to [message-writing subroutines](@ref hierarchy)
7C> should be encapsulated with IEEE Fortran control words when being
8C> written to output files.
9C>
10C> <p>If control words are requested, then one 4-byte control word is
11C> written to the output file prior to the start of each BUFR message,
12C> and a second 4-byte control word is written to the output file after
13C> the end of each BUFR message. Each of these control words contains
14C> the byte count for the enclosed BUFR message, and they can be
15C> written using either big-endian or little-endian byte ordering,
16C> regardless of the native endianness of the local machine.
17C>
18C> <p>This subroutine can be called at any time after the first call
19C> to subroutine openbf(), and the specified value for IBLK will remain
20C> in effect for all future calls to
21C> [message-writing subroutines](@ref hierarchy) for all Fortran logical
22C> units that are open for output within the application program,
23C> unless a subsequent call is made to this subroutine to reset the
24C> value of IBLK again. If this subroutine is never called, a default
25C> value of 0 is used for IBLK, as set within subroutine bfrini().
26C>
27C> @author J. Woollen
28C> @date 2012-09-15
29C>
30C> @param[in] IBLK -- integer: Flag indicating whether future BUFR
31C> output messages should be encapsulated with
32C> control words
33C> - -1 = Yes, using little-endian control words
34C> - 0 = No (the default)
35C> - 1 = Yes, using big-endian control words
36C>
37C> @remarks
38C> - This subroutine can be used to generate BUFR files consistent
39C> with historical archives, dating back to older versions of the
40C> BUFRLIB software which used Fortran to directly read/write
41C> BUFR messages from/to system files. Standard Fortran historically
42C> didn't have a way to read/write binary data streams without
43C> control words, so as a result many historical archives contain
44C> these by default. However, newer versions of the BUFRLIB software
45C> use C to directly read/write BUFR messages from/to system files
46C> (including historical archives), so control words are no longer
47C> necessary and are therefore now disabled by default when writing
48C> BUFR messages to output files.
49C>
50C> <b>Program history log:</b>
51C> | Date | Programmer | Comments |
52C> | -----|------------|----------|
53C> | 2012-09-15 | J. Woollen | Original author |
54C>
55 SUBROUTINE setblock(IBLK)
56
57 COMMON /endord/ iblock,iordbe(4),iordle(4)
58
59c-----------------------------------------------------------------------
60c-----------------------------------------------------------------------
61
62 CALL openbf(0,'FIRST',0)
63 iblock=iblk
64
65 RETURN
66 END
subroutine openbf(LUNIT, IO, LUNDX)
This subroutine connects a new file to the BUFRLIB software for input or output operations.
Definition: openbf.f:139
subroutine setblock(IBLK)
This subroutine is used to specify whether BUFR messages output by future calls to message-writing su...
Definition: setblock.f:56