Scroll to navigation

comunpack.c(3) NCEPLIBS-g2c comunpack.c(3)

NAME

comunpack.c - Unpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention.

SYNOPSIS

#include <stdio.h>
#include <stdlib.h>
#include 'grib2.h'

Functions


int comunpack (unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float *fld)
This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.2 or 5.3.

Detailed Description

Unpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention.

Author

Stephen Gilbert

Date

2002-10-29

Definition in file comunpack.c.

Function Documentation

int comunpack (unsigned char * cpack, g2int lensec, g2int idrsnum, g2int * idrstmpl, g2int ndpts, g2float * fld)

This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.2 or 5.3. Supports GRIB2 complex packing templates with or without spatial differences (i.e. DRTs 5.2 and 5.3).

PROGRAM HISTORY LOG:

  • 2002-10-29 Gilbert
  • 2004-12-16 Gilbert Added test (provided by Arthur Taylor/MDL) to verify that group widths and lengths are consistent with section length.

Parameters

cpack pointer to the packed data field.
lensec length of section 7 (used for error checking).
idrsnum Data Representation Template number 5.N Must equal 2 or 3.
idrstmpl pointer to the array of values for Data Representation Template 5.2 or 5.3
ndpts The number of data values to unpack
fld Contains the unpacked data values. fld must be allocated with at least ndpts*sizeof(g2float) bytes before calling this routine.

Returns

0 for success, error code otherwise.

Author

Stephen Gilbert

Date

2002-10-29

Definition at line 39 of file comunpack.c.

References gbit(), gbits(), int_power(), and rdieee().

Referenced by g2_unpack7().

Author

Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.

Tue May 3 2022 Version 1.6.4