NCEPLIBS-g2  3.4.5
gf_unpack3.f File Reference

This subroutine unpacks Section 3 (Grid Definition Section). More...

Go to the source code of this file.

Functions/Subroutines

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

Detailed Description

This subroutine unpacks Section 3 (Grid Definition Section).

Author
Stephen Gilbert
Date
2000-05-26

Definition in file gf_unpack3.f.

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  mapgridlen,
integer, dimension(:), pointer  ideflist,
integer, intent(out)  idefnum,
integer, intent(out)  ierr 
)

This subroutine unpacks Section 3 (Grid Definition Section) starting at octet 6 of that Section.

PROGRAM HISTORY LOG:

  • 2000-05-26 Stephen Gilbert Initial development.
  • 2002-01-24 Stephen Gilbert Changed to dynamically allocate arrays and to pass pointers to those arrays through the argument list.
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.
Note
Uses Fortran 90 module gridtemplates and module re_alloc.
Author
Stephen Gilbert
Date
2000-05-26

Definition at line 54 of file gf_unpack3.f.