NCEPLIBS-bufr 11.7.1
setblock.f File Reference

Specify the use of IEEE Fortran control words when writing BUFR messages. More...

Go to the source code of this file.

Functions/Subroutines

subroutine setblock (IBLK)
 This subroutine is used to specify whether BUFR messages output by future calls to message-writing subroutines should be encapsulated with IEEE Fortran control words when being written to output files. More...
 

Detailed Description

Specify the use of IEEE Fortran control words when writing BUFR messages.

Definition in file setblock.f.

Function/Subroutine Documentation

◆ setblock()

subroutine setblock (   IBLK)

This subroutine is used to specify whether BUFR messages output by future calls to message-writing subroutines should be encapsulated with IEEE Fortran control words when being written to output files.

If control words are requested, then one 4-byte control word is written to the output file prior to the start of each BUFR message, and a second 4-byte control word is written to the output file after the end of each BUFR message. Each of these control words contains the byte count for the enclosed BUFR message, and they can be written using either big-endian or little-endian byte ordering, regardless of the native endianness of the local machine.

This subroutine can be called at any time after the first call to subroutine openbf(), and the specified value for IBLK will remain in effect for all future calls to message-writing subroutines for all Fortran logical units that are open for output within the application program, unless a subsequent call is made to this subroutine to reset the value of IBLK again. If this subroutine is never called, a default value of 0 is used for IBLK, as set within subroutine bfrini().

Author
J. Woollen
Date
2012-09-15
Parameters
[in]IBLK– integer: Flag indicating whether future BUFR output messages should be encapsulated with control words
  • -1 = Yes, using little-endian control words
  • 0 = No (the default)
  • 1 = Yes, using big-endian control words
Remarks
  • This subroutine can be used to generate BUFR files consistent with historical archives, dating back to older versions of the BUFRLIB software which used Fortran to directly read/write BUFR messages from/to system files. Standard Fortran historically didn't have a way to read/write binary data streams without control words, so as a result many historical archives contain these by default. However, newer versions of the BUFRLIB software use C to directly read/write BUFR messages from/to system files (including historical archives), so control words are no longer necessary and are therefore now disabled by default when writing BUFR messages to output files.

Program history log:

Date Programmer Comments
2012-09-15 J. Woollen Original author

Definition at line 55 of file setblock.f.

References openbf().