NCEPLIBS-g2c  1.8.0
specunpack.c File Reference

Unpack a spectral data field that was packed using the complex packing algorithm for spherical harmonic data. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "grib2_int.h"

Go to the source code of this file.

Functions

g2int specunpack (unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, float *fld)
 This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for spherical harmonic data as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.51. More...
 

Detailed Description

Unpack a spectral data field that was packed using the complex packing algorithm for spherical harmonic data.

Author
Stephen Gilbert
Date
2000-06-21

Definition in file specunpack.c.

Function Documentation

◆ specunpack()

g2int specunpack ( unsigned char *  cpack,
g2int idrstmpl,
g2int  ndpts,
g2int  JJ,
g2int  KK,
g2int  MM,
float *  fld 
)

This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for spherical harmonic data as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.51.

Parameters
cpackpointer to the packed data field.
idrstmplpointer to the array of values for Data Representation Template 5.51.
ndptsThe number of data values to unpack (real and imaginary parts).
JJpentagonal resolution parameter.
KKpentagonal resolution parameter.
MMpentagonal resolution parameter.
fldContains the unpacked data values. fld must be allocated with at least ndpts * sizeof(float) bytes before calling this routine.
Returns
0 for success, -3 for wrong type.
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 35 of file specunpack.c.

References G2_NO_ERROR, G2_SPECUNPACK_TYPE, gbits(), int_power(), and rdieee().

Referenced by g2c_unpack7_int().