NCEPLIBS-g2  3.4.7
gribend.F90 File Reference

Finalize a GRIB2 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)
 Finalize a GRIB2 message after all grids and fields have been added. More...
 

Detailed Description

Finalize a GRIB2 message after all grids and fields have been added.

Author
Stephen Gilbert
Date
2000-05-02

Definition in file gribend.F90.

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 
)

Finalize a GRIB2 message after all grids and fields have been added.

This subroutine 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.

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 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.
Author
Stephen Gilbert
Date
2000-05-02

Definition at line 26 of file gribend.F90.

References g2_gbytec(), and g2_sbytec().

Referenced by putgb2().