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