NCEPLIBS-g2  3.4.7
putgb2.F90 File Reference

Packs a single field into a GRIB2 message and writes out that message to the file. More...

Go to the source code of this file.

Functions/Subroutines

subroutine putgb2 (lugb, gfld, iret)
 This subroutine packs a single field into a grib2 message and writes out that message to the file associated with unit lugb. More...
 

Detailed Description

Packs a single field into a GRIB2 message and writes out that message to the file.

Author
Stephen Gilbert
Date
2002-01-11

Definition in file putgb2.F90.

Function/Subroutine Documentation

◆ putgb2()

subroutine putgb2 ( integer, intent(in)  lugb,
type(gribfield), intent(in)  gfld,
integer, intent(out)  iret 
)

This subroutine packs a single field into a grib2 message and writes out that message to the file associated with unit lugb.

Note that file/unit lugb should be opened with a call to subroutine baopen() or baopenw() before this routine is called.

The information to be packed into the grib field is stored in a derived type variable, gfld. gfld is of type gribfield, which is defined in module grib_mod, so users of this routine will need to include the line "use grib_mod" in their calling routine. Each component of the gribfield type is described in the input argument list section below.

Parameters
[in]lugbinteger unit of the unblocked grib data file. File must be opened with baopen() or baopenw() before calling this routine.
[in]gfldderived type grib_mod::gribfield.
[out]iretinteger return code
  • 0 No error.
  • 2 Memory allocation error.
  • 10 No Section 1 info available.
  • 11 No Grid Definition Template info available.
  • 12 Missing some required data field info.
Note
Derived type gribfield contains pointers to many arrays of data (See grib_mod::gribfield). The memory for these arrays is allocated when the values in the arrays are set, to help minimize problems with array overloading. Users must free up this memory, when it is no longer needed, by a call to subroutine gf_free().
Author
Stephen Gilbert
Date
2002-04-22

Definition at line 40 of file putgb2.F90.

References addfield(), addgrid(), addlocal(), gribcreate(), and gribend().