NCEPLIBS-bufr  12.0.0
msgwrt.f File Reference

Finalize a BUFR message for output and write the message to a BUFR file. More...

Go to the source code of this file.

Functions/Subroutines

subroutine msgwrt (LUNIT, MESG, MGBYT)
 Perform final checks and updates on a BUFR message before writing it to a specified Fortran logical unit. More...
 

Detailed Description

Finalize a BUFR message for output and write the message to a BUFR file.

Author
J. Woollen
Date
1994-01-06

Definition in file msgwrt.f.

Function/Subroutine Documentation

◆ msgwrt()

subroutine msgwrt (   LUNIT,
dimension(*)  MESG,
  MGBYT 
)

Perform final checks and updates on a BUFR message before writing it to a specified Fortran logical unit.

These final checks and updates include:

  • Standardizing the BUFR message, if requested via a previous call subroutine stdmsg()
  • Converting the BUFR message from edition 3 to edition 4, if requested via a previous call to subroutine pkvs01()
  • Storing any customized values into Section 0 or Section 1 of the BUFR message, if requested via one or more previous calls to subroutine pkvs01()
  • Storing a tank receipt time into Section 1 of the BUFR message, if requested via a previous call to subroutine strcpt()
  • For edition 3 BUFR messages, ensuring each section of the message contains an even number of bytes
  • Storing '7777' into the last four bytes of the BUFR message, and storing the final message length in Section 0
  • Appending zeroed-out bytes after the end of the BUFR message, up to the next machine word boundary
  • Encapsulating the BUFR message with IEEE Fortran control words, if requested via a previous call to subroutine setblock()
  • Storing a copy of the final message into internal arrays for possible later retrival via subroutine writsa()
Parameters
[in]LUNIT– integer: Fortran logical unit number for BUFR file
[in]MESG– integer(*): BUFR message
[in]MGBYT– integer: Size (in bytes) of BUFR message
Author
J. Woollen
Date
1994-01-06

Definition at line 37 of file msgwrt.f.

References atrcpt(), blocks(), bort(), moda_s01cm::cmnem, cnved4(), errwrt(), getlens(), idxmsg(), iupbs01(), moda_s01cm::ivmnem, moda_mgwa::mgwa, moda_mgwb::mgwb, moda_bufrmg::msglen, moda_bufrmg::msgtxt, modv_mxmsgl::mxmsgld4, nmwrd(), moda_s01cm::ns01v, moda_nulbfr::null, padmsg(), pkb(), pkbs1(), pkc(), status(), and stndrd().

Referenced by closmg(), copybf(), copymg(), cpymem(), cpyupd(), msgupd(), wrcmps(), and wrdxtb().