|
NCEPLIBS-g2
3.4.7
|
Find, read or generate 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) |
| Find, read or generate a GRIB2 index for the GRIB2 file associated with unit lugb. More... | |
| subroutine | gf_finalize (iret) |
| Free all memory associated with the library. More... | |
Find, read or generate a GRIB2 index for the GRIB2 file associated with unit lugb.
Definition in file getidx.F90.
| 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 | ||
| ) |
Find, read or generate 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 GRIB2 file lugb.
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).
This subroutine allocates memory and stores the resulting pointers in an array that is a Fortran "save" variable. The result is that the memory will not be freed by the library and cannot be reached by the caller. To free this memory call gf_finalize() after all library operations are complete.
| [in] | lugb | integer unit of the GRIB2 data file. File must have been opened with baopen() or baopenr() before calling this routine. If 0, then all saved memory will be released. |
| [in] | lugi | integer unit of the GRIB2 index file. If nonzero, file must have been opened with baopen() or baopenr() before calling this routine. Set to 0 to get index information from the GRIB2 file. |
| [in,out] | cindex | character*1 Pointer to a buffer that will get index records. |
| [out] | nlen | integer Total length of all index records. |
| [out] | nnum | integer Number of index records. |
| [out] | iret | integer Return code:
|
Definition at line 43 of file getidx.F90.
References getg2i(), and getg2ir().
Referenced by getgb2(), and gf_finalize().
| subroutine gf_finalize | ( | integer, intent(out) | iret | ) |
Free all memory associated with the library.
| [out] | iret | integer Return code:
|
Definition at line 160 of file getidx.F90.
References getidx().