NCEPLIBS-bufr  12.0.1
writsb.f File Reference

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

Go to the source code of this file.

Functions/Subroutines

recursive subroutine writsb (LUNIT)
 Write a data subset into a BUFR message. More...
 

Detailed Description

Write a data subset into a BUFR message.

Author
J. Woollen
Date
1994-01-06

Definition in file writsb.f.

Function/Subroutine Documentation

◆ writsb()

recursive subroutine writsb (   LUNIT)

Write a data subset into a BUFR message.

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

This subroutine is called when all necessary values for a data subset (i.e. report) have been written, and 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. 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](hierarchy).

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.

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

Definition at line 44 of file writsb.f.

References bort(), modv_im8b::im8b, msgupd(), status(), wrcmps(), wrtree(), and x84().

Referenced by copysb(), and writcp().