Read a grib index file and return its contents.
More...
Go to the source code of this file.
|
subroutine | getgi (lugi, mnum, mbuf, cbuf, nlen, nnum, iret) |
| Read a grib index file and return its contents.
|
|
Read a grib index file and return its contents.
- Author
- Mark Iredell
- Date
- 1995-10-31
Definition in file getgi.f.
◆ getgi()
subroutine getgi |
( |
|
lugi, |
|
|
|
mnum, |
|
|
|
mbuf, |
|
|
character, dimension(mbuf) |
cbuf, |
|
|
|
nlen, |
|
|
|
nnum, |
|
|
|
iret |
|
) |
| |
Read a grib index file and return its contents.
Version 1 of the index file has the following format: 81-byte s.lord header with 'gb1ix1' in columns 42-47 followed by 81-byte header with number of bytes to skip before index records, number of bytes in each index record, number of index records, and grib file basename written in format ('ix1form:',3i10,2x,a40). Each following index record corresponds to a grib message and has 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] | lugi | integer unit of the unblocked grib index file. |
[in] | mnum | integer number of index records to skip (usually 0). |
[in] | mbuf | integer length of cbuf in bytes. |
[out] | cbuf | character*1 (mbuf) buffer to receive index data. |
[out] | nlen | integer length of each index record in bytes. |
[out] | nnum | integer number of index records. |
[out] | iret | integer return code.
- 0: all ok.
- 1: cbuf too small to hold index buffer.
- 2: error reading index file buffer.
- 3: error reading index file header.
|
- 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 49 of file getgi.f.