NCEPLIBS-g2  3.4.8
gf_unpack3.F90 File Reference

Unpack Section 3 (Grid Definition Section) of a GRIB2 message. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gf_unpack3 (cgrib, lcgrib, iofst, igds, igdstmpl, mapgridlen, ideflist, idefnum, ierr)
 Unpack Section 3 (Grid Definition Section) of a GRIB2 message, starting at octet 6 of that Section. More...
 

Detailed Description

Unpack Section 3 (Grid Definition Section) of a GRIB2 message.

Author
Stephen Gilbert
Date
2000-05-26

Definition in file gf_unpack3.F90.

Function/Subroutine Documentation

◆ gf_unpack3()

subroutine gf_unpack3 ( character(len = 1), dimension(lcgrib), intent(in)  cgrib,
integer, intent(in)  lcgrib,
integer, intent(inout)  iofst,
integer, dimension(5), intent(out)  igds,
integer, dimension(:), pointer  igdstmpl,
integer, intent(out)  mapgridlen,
integer, dimension(:), pointer  ideflist,
integer, intent(out)  idefnum,
integer, intent(out)  ierr 
)

Unpack Section 3 (Grid Definition Section) of a GRIB2 message, starting at octet 6 of that Section.

Parameters
[in]cgribCharacter array that contains the GRIB2 message.
[in]lcgribLength (in bytes) of GRIB message array cgrib.
[in,out]iofstBit offset of the beginning/end(returned) of Section 3.
[out]igdsContains information read from the appropriate GRIB Grid Definition Section 3 for the field being returned. Must be dimensioned >= 5.
  • igds(1) Source of grid definition (see Code Table 3.0).
  • igds(2) Number of grid points in the defined grid.
  • igds(3) Number of octets needed for each additional grid points definition. Used to define number of points in each row (or column) for non-regular grids. = 0, if using regular grid.
  • igds(4) Interpretation of list for optional points definition (Code Table 3.11).
  • igds(5) Grid Definition Template Number (Code Table 3.1).
[out]igdstmplContains the data values for the specified Grid Definition Template (NN=igds(5)). Each element of this integer array contains an entry (in the order specified) of Grid Defintion Template 3.NN. A safe dimension for this array can be obtained in advance from maxvals(2), which is returned from subroutine gribinfo().
[out]mapgridlenNumber of elements in igdstmpl. i.e. number of entries in Grid Defintion Template 3.NN (NN=igds(5)).
[out]ideflist(Used if igds(3) .ne. 0) This array contains the number of grid points contained in each row (or column). (part of Section 3) A safe dimension for this array can be obtained in advance from maxvals(3), which is returned from subroutine gribinfo().
[out]idefnum(Used if igds(3) .ne. 0) The number of entries in array ideflist. i.e. number of rows (or columns) for which optional grid points are defined.
[out]ierrError return code.
  • 0 no error.
  • 5 "GRIB" message contains an undefined Grid Definition Template.
  • 6 memory allocation error.
Author
Stephen Gilbert
Date
2000-05-26

Definition at line 50 of file gf_unpack3.F90.

References gridtemplates::extgridtemplate(), g2_gbytec(), g2_gbytesc(), and gridtemplates::getgridtemplate().

Referenced by getdim(), getgb2s(), getpoly(), and gf_getfld().