A subroutine which can be called from FORTRAN to give the size in bytes of the following GRIB or BUFR product. The return status code must be checked after calling the subroutine.
The routine reads the next product and then repositions back at the beginning of the product; this is not an efficient way to process products in general but it may sometimes be a useful way to find the size of a product before allocating array space.
The format and arguments for the subroutine are:
SUBROUTINE PBSIZE( KUNIT, KRET)
Input parameter is an INTEGER.
KUNIT | Index of a C file pointer obtained from PBOPEN |
Output parameter is an INTEGER.
KRET | Status return code: >0, size in bytes of the next GRIB or BUFR product -2, an error allocating memory for an internal buffer |