To read grib using wgrib2api, you need to have an index or inventory file.
The index file is used for searching and it is quick to create. The
format of the index file keeps expanding as needed. For example,
chemical tracers was added to the grib format, so naturally the index
file had to include the possibility of a chemical type.
The index file created by grb2_mk_inv('file.grb2', 'file.inv') is the same as created by
wgrib2 file.grb2 -Match_inv > file.inv
The inv file can be created before the fortran program is run.
This may be more efficient if multiple programs need to create
the inv of the same file.
iret = grb2_mk_inv(GRB2, INV)
0 if index file created
1 if index file not created
GRB2: character (len=*) existing grib2 file
INV: character (len=*) index file that is created