NCEPLIBS-g2c  1.8.0
specpack.c File Reference

Pack a spectral data field 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

void specpack (float *fld, g2int ndpts, g2int JJ, g2int KK, g2int MM, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
 This subroutine packs a spectral data field using the complex packing algorithm for spherical harmonic data as defined in the GRIB2 Data Representation Template 5.51. More...
 

Detailed Description

Pack a spectral data field using the complex packing algorithm for spherical harmonic data.

Author
Stephen Gilbert
Date
2002-12-19

Definition in file specpack.c.

Function Documentation

◆ specpack()

void specpack ( float *  fld,
g2int  ndpts,
g2int  JJ,
g2int  KK,
g2int  MM,
g2int idrstmpl,
unsigned char *  cpack,
g2int lcpack 
)

This subroutine packs a spectral data field using the complex packing algorithm for spherical harmonic data as defined in the GRIB2 Data Representation Template 5.51.

Parameters
fldContains the data values to be packed.
ndptsThe number of data values to pack.
JJJ - pentagonal resolution parameter.
KKK - pentagonal resolution parameter.
MMM - pentagonal resolution parameter.
idrstmplContains the array of 10 values for [Data Representation Template 5.51](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-51.shtml).
cpackPointer that gets the packed data field. Must be allocated by caller.
lcpacklength of packed field cpack.
Author
Stephen Gilbert
Date
2002-12-19

Definition at line 33 of file specpack.c.

References mkieee(), and simpack().

Referenced by g2_addfield().