NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
getgir.f File Reference

Read a grib index file and return its index contents. More...

Go to the source code of this file.

Functions/Subroutines

subroutine getgir (lugb, msk1, msk2, mnum, mbuf, cbuf, nlen, nnum, iret)
 Read a grib file and return its index contents.
 

Detailed Description

Read a grib index file and return its index contents.

Author
Mark Iredell
Date
1995-10-31

Definition in file getgir.f.

Function/Subroutine Documentation

◆ getgir()

subroutine getgir (   lugb,
  msk1,
  msk2,
  mnum,
  mbuf,
character, dimension(mbuf)  cbuf,
  nlen,
  nnum,
  iret 
)

Read a grib file and return its index contents.

The index buffer returned contains index records with the internal format:

  • byte 001-004: bytes to skip in data file before grib message.
  • byte 005-008: bytes to skip in message before pds.
  • byte 009-012: bytes to skip in message before gds (0 if no gds).
  • byte 013-016: bytes to skip in message before bms (0 if no bms).
  • byte 017-020: bytes to skip in message before bds.
  • byte 021-024: bytes total in the message.
  • byte 025-025: grib version number.
  • byte 026-053: product definition section (pds).
  • byte 054-095: grid definition section (gds) (or nulls).
  • byte 096-101: first part of the bit map section (bms) (or nulls).
  • byte 102-112: first part of the binary data section (bds).
  • byte 113-172: (optional) bytes 41-100 of the pds.
  • byte 173-184: (optional) bytes 29-40 of the pds.
  • byte 185-320: (optional) bytes 43-178 of the gds.

Program history log:

  • Mark Iredell 1995-10-31
  • Mark Iredell 1996-10-31 Augmented optional definitions to byte 320.
Parameters
[in]lugbinteger unit of the unblocked grib file.
[in]msk1integer number of bytes to search for first message.
[in]msk2integer number of bytes to search for other messages.
[in]mnuminteger number of index records to skip (usually 0).
[in]mbufinteger length of cbuf in bytes.
[out]cbufcharacter*1 (mbuf) buffer to receive index data.
[out]nleninteger length of each index record in bytes.
[out]nnuminteger number of index records (=0 if no grib messages are found).
[out]iretinteger return code.
  • 0: all ok.
  • 1: cbuf too small to hold index data.
Note
Subprogram can be called from a multiprocessing environment. Do not engage the same logical unit from more than one processor.
Author
Mark Iredell
Date
1995-10-31

Definition at line 44 of file getgir.f.