NEP 1.5.1
NetCDF Extension Pack: compression extensions for NetCDF
Loading...
Searching...
No Matches
Functions
ncsqueeze.c File Reference
#include "config.h"
#include "ncsqueeze.h"
#include <hdf5.h>
#include <H5DSpublic.h>
#include <stdlib.h>

Functions

int nc_def_var_bzip2 (int ncid, int varid, int level)
 
int nc_inq_var_bzip2 (int ncid, int varid, int *bzip2p, int *levelp)
 
int nc_def_var_lz4 (int ncid, int varid, int level)
 
int nc_inq_var_lz4 (int ncid, int varid, int *lz4p, int *levelp)
 

Detailed Description

This is the code file for ncsqueeze.

Author
Edward Hartnett
Date
Nov 13, 2025

Function Documentation

◆ nc_def_var_bzip2()

int nc_def_var_bzip2 ( int  ncid,
int  varid,
int  level 
)

ncsqueeze supports compression filters for netCDF/HDF5 files which are not natively supported by the netCDF C library.

BZIP2

Bzip2 is a free and open-source file compression program that uses the Burrows–Wheeler algorithm. For more information see https://www.sourceware.org/bzip2/ and https://en.wikipedia.org/wiki/Bzip2.

In C:

In Fortran:

  • nf90_def_var_bzip2()
  • nf90_inq_var_bzip2() Turn on bzip2 compression for a variable.
Parameters
ncidFile ID.
varidVariable ID.
levelFrom 1 to 9. Set the block size to 100k, 200k ... 900k when compressing. (bzip2 default level is 9).
Returns
0 for success, error code otherwise.
Author
Edward Hartnett

◆ nc_def_var_lz4()

int nc_def_var_lz4 ( int  ncid,
int  varid,
int  level 
)

Turn on lz4 compression for a variable.

Parameters
ncidFile ID.
varidVariable ID.
levelFrom 1 to 9. Set the block size to 100k, 200k ... 900k when compressing. (lz4 default level is 9).
Returns
0 for success, error code otherwise.
Author
Edward Hartnett

◆ nc_inq_var_bzip2()

int nc_inq_var_bzip2 ( int  ncid,
int  varid,
int *  bzip2p,
int *  levelp 
)

Learn whether bzip2 compression is on for a variable, and, if so, the level setting.

Parameters
ncidFile ID.
varidVariable ID.
bzip2pPointer that gets a 0 if bzip2 is not in use for this var, and a 1 if it is. Ignored if NULL.
levelpPointer that gets the level setting (from 1 to 9), if bzip2 is in use. Ignored if NULL.
Returns
0 for success, error code otherwise.
Author
Edward Hartnett

◆ nc_inq_var_lz4()

int nc_inq_var_lz4 ( int  ncid,
int  varid,
int *  lz4p,
int *  levelp 
)

Learn whether lz4 compression is on for a variable, and, if so, the level setting.

Parameters
ncidFile ID.
varidVariable ID.
lz4pPointer that gets a 0 if lz4 is not in use for this var, and a 1 if it is. Ignored if NULL.
levelpPointer that gets the acceleration setting (from 1 to 9). Ignored if NULL.
Returns
0 for success, error code otherwise.
Author
Edward Hartnett