NCEPLIBS-bufr 11.7.1
writsb.f File Reference

Write a data subset into a BUFR message. More...

Go to the source code of this file.

Functions/Subroutines

subroutine writsb (LUNIT)
 This subroutine writes a complete data subset into a BUFR message, for eventual output to logical unit LUNIT. More...
 

Detailed Description

Write a data subset into a BUFR message.

Definition in file writsb.f.

Function/Subroutine Documentation

◆ writsb()

subroutine writsb (   LUNIT)

This subroutine writes a complete data subset into a BUFR message, for eventual output to logical unit LUNIT.

Author
J. Woollen
Date
1994-01-06
Parameters
[in]LUNIT– integer: Fortran logical unit number for BUFR file

This subroutine is called to indicate to the BUFRLIB software that all necessary values for a data subset (i.e. report) have been written, and thus that the subset is ready to be encoded and packed into the current message for the BUFR file associated with logical unit LUNIT. Logical unit LUNIT should have already been opened for output operations via a previous call to subroutine openbf(), and a BUFR message should already be open for output within internal arrays via a previous call to one of the BUFRLIB message-writing subroutines. Furthermore, all of the values for the data subset should have already been written into internal arrays via calls to any of the BUFRLIB values-writing subroutines

Remarks
  • There is a maximum size for any BUFR message that can be written by the BUFRLIB software. This maximum message size is initially set to an internal default value within subroutine bfrini(), but it can be changed to a different value via a separate prior call to subroutine maxout().
  • This subroutine will always check to ensure that the data subset, when encoded and packed, will fit into the current BUFR message that is already open within the internal arrays associated with logical unit LUNIT. If adding the data subset to the current message would cause the maximum message size to be exceeded, then the subroutine will automatically flush the current message to logical unit LUNIT, then open and initialize a new internal message using the same SUBSET and JDATE values that were specified in the most recent call to one of the message-writing subroutines for LUNIT, then encode and pack the data subset into that new message.

Program history log:

Date Programmer Comments
1994-01-06 J. Woollen Original author
1998-07-08 J. Woollen Replaced call to Cray library routine "ABORT" with call to new internal routine bort()
2003-11-04 J. Ator Added documentation
2003-11-04 S. Bender Added remarks and routine interdependencies
2003-11-04 D. Keyser Unified/portable for WRF; added documentation; outputs more complete diagnostic info when routine terminates abnormally
2005-03-09 J. Ator Added capability for compressed messages

Definition at line 52 of file writsb.f.

References bort(), msgupd(), status(), wrcmps(), and wrtree().

Referenced by copysb(), and writcp().