NCEPLIBS-g2  3.4.7
addlocal.F90 File Reference

Add a Local Use Section (Section 2) to a GRIB2 message. More...

Go to the source code of this file.

Functions/Subroutines

subroutine addlocal (cgrib, lcgrib, csec2, lcsec2, ierr)
 Add a Local Use Section (Section 2) to a GRIB2 message. More...
 

Detailed Description

Add a Local Use Section (Section 2) to a GRIB2 message.

Author
Stephen Gilbert
Date
2000-05-01

Definition in file addlocal.F90.

Function/Subroutine Documentation

◆ addlocal()

subroutine addlocal ( character(len = 1), dimension(lcgrib), intent(inout)  cgrib,
integer, intent(in)  lcgrib,
character(len = 1), dimension(lcsec2), intent(in)  csec2,
integer, intent(in)  lcsec2,
integer, intent(out)  ierr 
)

Add a Local Use Section (Section 2) to a GRIB2 message.

This routine is used with routines gribcreate(), addlocal(), addfield(), and gribend() to create a complete GRIB2 message. Subroutine gribcreate must be called first to initialize a new GRIB2 message.

The Local Use Section (Section 2) can only follow Section 1 or Section 7 in a GRIB2 message.

Parameters
[in,out]cgribCharacter array to contain the GRIB2 message.
[in]lcgribMaximum length (bytes) of array cgrib.
[in]csec2Character array containing information to be added to Section 2.
[in]lcsec2Number of bytes of character array csec2 to be added to Section 2.
[out]ierrError return code.
  • 0 no error
  • 1 GRIB message was not initialized. Need to call routine gribcreate first.
  • 2 GRIB message already complete. Cannot add new section.
  • 3 Sum of Section byte counts doesn't add to total byte count.
  • 4 Previous Section was not 1 or 7.
Author
Stephen Gilbert
Date
2000-05-01

Definition at line 29 of file addlocal.F90.

References g2_gbytec(), and g2_sbytec().

Referenced by putgb2().