NCEPLIBS-bufr  12.0.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

recursive subroutine setblock (IBLK)
 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.

Author
J. Woollen
Date
2012-09-15

Definition in file setblock.f.

Function/Subroutine Documentation

◆ setblock()

recursive subroutine setblock (   IBLK)

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().

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 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 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.
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
Author
J. Woollen
Date
2012-09-15

Definition at line 50 of file setblock.f.

References modv_im8b::im8b, openbf(), and x84().