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

# simunpack.c(3)

Unpack a data field that was packed using a simple packing algorithm.

## NAME

simunpack.c - Unpack a data field that was packed using a simple packing algorithm.

## SYNOPSIS

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

### Functions

**g2int** **simunpack** (unsigned char \*cpack, **g2int** \*idrstmpl, **g2int** ndpts, float \*fld)\
 Unpack a data field that was packed using a simple packing algorithm, using info from the GRIB2 Data Representation Template 5.0.

## Detailed Description

Unpack a data field that was packed using a simple packing algorithm.

**Author**

Stephen Gilbert

**Date**

2002-10-29

Definition in file **simunpack.c**.

## Function Documentation

### g2int simunpack (unsigned char \* cpack, g2int \* idrstmpl, g2int ndpts, float \* fld)

Unpack a data field that was packed using a simple packing algorithm, using info from the GRIB2 Data Representation Template 5.0.

**Parameters**

*cpack* pointer to the packed data field. \
 *idrstmpl* pointer to the array of values for Data Representation Template 5.0. \
 *ndpts* The number of data values to unpack. \
 *fld* A pointer that gets the unpacked data values. fld must be \`\* allocated with at least ndpts \* sizeof(float) bytes before calling this routine.

**Returns**

0 for success, error code otherwise.

**Author**

Stephen Gilbert

**Date**

2002-10-29

Definition at line **28** of file **simunpack.c**.

References **G2\_JPCUNPACK\_MEM**, **G2\_NO\_ERROR**, **gbits()**, **int\_power()**, **LOG**, and **rdieee()**.

Referenced by **g2c\_unpack7\_int()**.

## Author

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