NCEPLIBS-g2  3.5.0
skgb.F90 File Reference

Search a file for the next GRIB1 or GRIB2 message. More...

Go to the source code of this file.

Functions/Subroutines

subroutine skgb (lugb, iseek, mseek, lskip, lgrib)
 Search a file for the next GRIB1 or GRIB2 message. More...
 
subroutine skgb8 (lugb, iseek8, mseek8, lskip8, lgrib8)
 Search a file for the next GRIB1 or GRIB2 message. More...
 

Detailed Description

Search a file for the next GRIB1 or GRIB2 message.

Author
Mark Iredell
Date
1995-10-31

Definition in file skgb.F90.

Function/Subroutine Documentation

◆ skgb()

subroutine skgb ( integer  lugb,
integer  iseek,
integer  mseek,
integer  lskip,
integer  lgrib 
)

Search a file for the next GRIB1 or GRIB2 message.

A grib message is identified by its indicator section, which is an 8-byte sequence with 'GRIB' in bytes 1-4 and a '1' or '2' in byte

  1. If found, the length of the message is decoded from bytes 5-7. The search is done over a given section of the file. The search is terminated if an eof or i/o error is encountered.
Parameters
[in]lugbUnit of the unblocked grib file.
[in]iseekNumber of bytes to skip before search.
[in]mseekMaximum number of bytes to search.
[out]lskipNumber of bytes to skip before message.
[out]lgribNumber of bytes in message (0 if not found).
Author
Mark Iredell
Date
1995-10-31

Definition at line 20 of file skgb.F90.

References skgb8().

◆ skgb8()

subroutine skgb8 ( integer  lugb,
integer*8  iseek8,
integer*8  mseek8,
integer*8  lskip8,
integer*8  lgrib8 
)

Search a file for the next GRIB1 or GRIB2 message.

This function works for GRIB2 files larger than 2 GB, but still requires that each GRIB2 message be less than 2 GB.

A grib message is identified by its indicator section, which is an 8-byte sequence with 'GRIB' in bytes 1-4 and a '1' or '2' in byte

  1. If found, the length of the message is decoded from bytes 5-7. The search is done over a given section of the file. The search is terminated if an eof or i/o error is encountered.
Parameters
[in]lugbUnit of the unblocked grib file.
[in]iseek8Number of bytes to skip before search.
[in]mseek8Maximum number of bytes to search.
[out]lskip8Number of bytes to skip before message.
[out]lgrib8Number of bytes in message (0 if not found).
Author
Edward Hartnett
Date
2023-08-21

Definition at line 52 of file skgb.F90.

References g2_gbytec().

Referenced by getg2i2r(), and skgb().