NCEPLIBS-g2  3.4.5
getidx.f File Reference

This subroutine finds, reads or generates a grib2 index for the grib2 file associated with unit lugb. More...

Go to the source code of this file.

Functions/Subroutines

subroutine getidx (LUGB, LUGI, CINDEX, NLEN, NNUM, IRET)
 This subroutine finds, reads or generates a grib2 index for the grib2 file associated with unit lugb. More...
 

Detailed Description

This subroutine finds, reads or generates a grib2 index for the grib2 file associated with unit lugb.

Author
Stephen Gilbert
Date
2005-03-15

Definition in file getidx.f.

Function/Subroutine Documentation

◆ getidx()

subroutine getidx ( integer, intent(in)  LUGB,
integer, intent(in)  LUGI,
character(len=1), dimension(:), pointer  CINDEX,
integer, intent(out)  NLEN,
integer, intent(out)  NNUM,
integer, intent(out)  IRET 
)

This subroutine finds, reads or generates a grib2 index for the grib2 file associated with unit lugb.

If the index already exists, it is returned. otherwise, the index is (1) read from an existing indexfile associated with unit LUGI. or (2) generated from the grib2file LUGI. Users can force a regeneration of an index. If LUGI equals LUGB, the index will be regenerated from the data in file LUGB. If LUGI is less than zero, then the index is re read from index file abs(lugi).

PROGRAM HISTORY LOG:

  • 2005-03-15 Stephen Gilbert Initial Programming
  • 2009-07-09 Boi Vuong Fixed bug for checking (LUGB) unit index file
  • 2016-03-29 Boi Vuong Restore original getidx.f from version 1.2.3 modified getidex to allow to open range of unit file number up to 9999 added new parameters and new product definition template numbers: 4.60, 4.61
Parameters
[in]LUGBinteger unit of the unblocked grib data file. file must be opened with baopen or baopenr before calling this routine.
[in]LUGIinteger unit of the unblocked grib index file. if nonzero, file must be opened with baopen baopenr before calling this routine. (=0 to get index buffer from the grib file)
[out]CINDEXcharacter*1 pointer to a buffer that contains index records.
[out]NLENinteger total length of all index records
[out]NNUMinteger number of index records
[out]IRETinteger return code
  • 0 all ok
  • 90 unit number out of range
  • 96 error reading/creating index file
Note
allow file unit numbers in range 0 - 9999 the grib index will automatically generate the index file.
Author
Stephen Gilbert
Date
2005-03-15

Definition at line 47 of file getidx.f.