NCEPLIBS-g2  3.4.5
getlocal.f File Reference

This subroutine returns the contents of Section 2 from a grib2 message. More...

Go to the source code of this file.

Functions/Subroutines

subroutine getlocal (cgrib, lcgrib, localnum, csec2, lcsec2, ierr)
 This subroutine returns the contents of Section 2 from a GRIB2 message. More...
 

Detailed Description

This subroutine returns the contents of Section 2 from a grib2 message.

Author
Stephen Gilbert
Date
2000-05-25

Definition in file getlocal.f.

Function/Subroutine Documentation

◆ getlocal()

subroutine getlocal ( character(len=1), dimension(lcgrib), intent(in)  cgrib,
integer, intent(in)  lcgrib,
integer, intent(in)  localnum,
character(len=1), dimension(*), intent(out)  csec2,
integer, intent(out)  lcsec2,
integer, intent(out)  ierr 
)

This subroutine returns the contents of Section 2 from a GRIB2 message.

Since there can be multiple occurrences of Section 2 within a GRIB message, the calling routine indicates which occurrence is being requested with the localnum argument.

Parameters
[in]cgribCharacter array that contains the GRIB2 message.
[in]lcgribLength (in bytes) of GRIB message array cgrib.
[in]localnumThe nth occurrence of Section 2 requested.
[out]csec2Character array containing information read from Section 2. The dimension of this array can be obtained in advance from argument maxlocal, which is returned from subroutine gb_info().
[out]lcsec2Number of bytes of character array csec2 read from Section 2.
[out]ierrError return code.
  • 0 no error.
  • 1 Beginning characters "GRIB" not found.
  • 2 GRIB message is not Edition 2.
  • 3 The data field request number was not positive.
  • 4 End string "7777" found, but not where expected.
  • 5 End string "7777" not found at end of message.
  • 6 GRIB message did not contain the requested number of data fields.
Note
Note that subroutine gb_info can be used to first determine how many Local Use sections exist in a given GRIB message.
Author
Stephen Gilbert
Date
2000-05-25

Definition at line 36 of file getlocal.f.