---
name: "misspack.c"
section: "3"
platform: "linux"
package: "libg2c-dev"
version: "2.1.0-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/misspack.c"
---

# misspack.c(3)

Pack a data field using a complex packing algorithm as defined in the GRIB2 documention.

## NAME

misspack.c - Pack a data field using a complex packing algorithm as defined in the GRIB2 documention.

## SYNOPSIS

`#include 'grib2_int.h'`\
 `#include <math.h>`\
 `#include <stdlib.h>`\

### Functions

void **misspack** (float \*fld, **g2int** ndpts, **g2int** idrsnum, **g2int** \*idrstmpl, unsigned char \*cpack, **g2int** \*lcpack)\
 Pack a data field using a complex packing algorithm.

## Detailed Description

Pack a data field using a complex packing algorithm as defined in the GRIB2 documention.

**Author**

Stephen Gilbert

**Date**

2000-06-21

Definition in file **misspack.c**.

## Function Documentation

### void misspack (float \* fld, g2int ndpts, g2int idrsnum, g2int \* idrstmpl, unsigned char \* cpack, g2int \* lcpack)

Pack a data field using a complex packing algorithm. This funciton supports GRIB2 complex packing templates with or without spatial differences (See `Template 5.2` and `Template 5.3`).

This function fills in GRIB2 Data Representation template arrays with the appropriate values.

**Parameters**

*fld* Contains the data values to pack \
 *ndpts* The number of data values in array fld \
 *idrsnum* Data Representation Template number. Must equal 2 or 3. \
 *idrstmpl* Contains the array of values for Data Representation Template 5.2 or 5.3.

- •

  0 Reference value - ignored on input, set by misspack routine.

- •

  1 Binary Scale Factor - used on input.

- •

  2 Decimal Scale Factor- used on input.

- •

  6 Missing value management.

- •

  7 Primary missing value.

- •

  8 Secondary missing value.

- •

  16 Order of Spatial Differencing (1 or 2).

*cpack* The packed data field (character\*1 array). \
 *lcpack* length of packed field cpack.

**Author**

Stephen Gilbert

**Date**

2000-06-21

Definition at line **43** of file **misspack.c**.

References **ALOG2**, **int\_power()**, **mkieee()**, **pack\_gp()**, **rdieee()**, **sbit()**, and **sbits()**.

Referenced by **cmplxpack()**.

## Author

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