NCEPLIBS-g2  3.4.5
gribend.f File Reference

This subroutines finalizes a GRIB message after all grids and fields have been added. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gribend (cgrib, lcgrib, lengrib, ierr)
 This subroutine finalizes a GRIB message after all grids and fields have been added. More...
 

Detailed Description

This subroutines finalizes a GRIB message after all grids and fields have been added.

Author
Stephen Gilbert
Date
2000-05-02

Definition in file gribend.f.

Function/Subroutine Documentation

◆ gribend()

subroutine gribend ( character(len=1), dimension(lcgrib), intent(inout)  cgrib,
integer, intent(in)  lcgrib,
integer, intent(out)  lengrib,
integer, intent(out)  ierr 
)

This subroutine finalizes a GRIB message after all grids and fields have been added.

It adds the End Section ( "7777" ) to the end of the GRIB message and calculates the length and stores it in the appropriate place in Section 0. This routine is used with routines gribcreate(), addlocal(), addgrid(), and addfield() to create a complete GRIB2 message. Subroutine gribcreate() must be called first to initialize a new GRIB2 message.

Parameters
[in,out]cgribCharacter array to contain the GRIB2 message.
[in]lcgribMaximum Length (in bytes) of array cgrib.
[out]lengribLength of the final GRIB2 message in octets (bytes).
[out]ierrError return code.
  • 0 no error.
  • 1 GRIB message was not initialized. call routine gribcreate() first.
  • 2 GRIB message already complete.
  • 3 Sum of Section byte counts doesn't add to total byte count.
  • 4 Previous Section was not 7.
Note
This routine is intended for use with routines gribcreate(), addlocal(), addgrid(), and addfield().
Author
Stephen Gilbert
Date
2000-05-02

Definition at line 32 of file gribend.f.