GETGB1
The GETGB1 routine reads and unpacks a grib message. The routine
reads an associated grib index file (unless it already was read).
and finds in the index file a reference to the grib message requested.
the grib message request specifies the number of messages to skip
and the unpacked pds and gds parameters. (a requested parameter
of -1 means to allow any value of this parameter to be found.)
If the requested grib message is found, then it is read from the
grib file and unpacked. Its message number is returned along with
the unpacked pds and gds parameters, the unpacked bitmap (if any),
and the unpacked data. If the grib message is not found, then the
return code will be nonzero.
USAGE: CALL GETGB1(LUGB,LUGI,JF,J,JPDS,JGDS,
GRIB,KF,K,KPDS,KGDS,LB,F,IRET)
Input arguments:
LUGB LOGICAL UNIT OF THE UNBLOCKED GRIB DATA FILE
LUGI LOGICAL UNIT OF THE UNBLOCKED GRIB INDEX FILE
JF INTEGER MAXIMUM NUMBER OF DATA POINTS TO UNPACK
J INTEGER NUMBER OF MESSAGES TO SKIP
(=0 TO SEARCH FROM BEGINNING)
(<0 TO REOPEN INDEX FILE AND SEARCH FROM BEGINNING)
JPDS INTEGER (25) PDS PARAMETERS FOR WHICH TO SEARCH
(=-1 FOR WILDCARD)
LOOK IN DOC BLOCK OF W3FI63 FOR ARRAY KPDS
FOR LIST OF ORDER OF UNPACKED PDS VALUES. IN
MOST CASES YOU ONLY NEED TO SET 4 OR 5 VALUES
TO PICK UP RECORD.
JGDS INTEGER (22) GDS PARAMETERS FOR WHICH TO SEARCH
(ONLY SEARCHED IF JPDS(3)=255)
(=-1 FOR WILDCARD)
Output arguments:
GRIB GRIB DATA ARRAY BEFORE IT IS UNPACKED
KF INTEGER NUMBER OF DATA POINTS UNPACKED
K INTEGER MESSAGE NUMBER UNPACKED
(CAN BE SAME AS J IN CALLING PROGRAM
IN ORDER TO FACILITATE MULTIPLE SEARCHES)
KPDS INTEGER (25) UNPACKED PDS PARAMETERS
KGDS INTEGER (22) UNPACKED GDS PARAMETERS
LB LOGICAL (KF) UNPACKED BITMAP IF PRESENT
F REAL (KF) UNPACKED DATA
IRET INTEGER RETURN CODE
0 ALL OK
96 ERROR READING INDEX FILE
97 ERROR READING GRIB FILE
98 NUMBER OF DATA POINTS GREATER THAN JF
99 REQUEST NOT FOUND
OTHER W3FI63 GRIB UNPACKER RETURN CODE