|
NEP 1.7.0
NetCDF Extension Pack: compression extensions for NetCDF
|
NEP (NetCDF Extension Pack) extends NetCDF-4 with high-performance compression and multi-format data access:
NEP provides flexible compression options and unified data access for diverse scientific data workflows.
NEP includes 26 comprehensive example programs demonstrating NetCDF API usage in both C and Fortran. These examples cover classic NetCDF and NetCDF-4 features, providing practical learning resources for users at all levels.
Quickstart Examples (2 programs):
C Classic Examples (6 programs):
C NetCDF-4 Examples (6 programs):
Fortran Classic Examples (6 programs):
Fortran NetCDF-4 Examples (6 programs):
-DBUILD_EXAMPLES=OFF or --disable-examplesAbsolute Beginners: Start with quickstart.c / f_quickstart.f90 - the simplest possible introduction with just 6 data values
Beginners: Progress to simple_2D.c / f_simple_2D.f90 → coord_vars.c / f_coord_vars.f90 → unlimited_dim.c / f_unlimited_dim.f90
Intermediate: Continue with format_variants.c / f_format_variants.f90 → size_limits.c / f_size_limits.f90 → var4d.c / f_var4d.f90
Advanced (NetCDF-4): Master simple_nc4.c / f_simple_nc4.f90 → compression.c / f_compression.f90 → chunking_performance.c / f_chunking_performance.f90 → groups.c / f_groups.f90 → multi_unlimited.c / f_multi_unlimited.f90 → user_types.c / f_user_types.f90
See examples/README.md for complete details, build instructions, and usage guides.
LZ4 is a lossless data compression algorithm from the LZ77 family of byte-oriented compression schemes. It prioritizes compression and decompression speed while maintaining good compression ratios.
Key Features:
Performance Characteristics:
BZIP2 is a lossless data compression algorithm using the Burrows-Wheeler block sorting algorithm. It prioritizes achieving high compression ratios, making it ideal for archival storage and bandwidth-constrained scenarios.
Key Features:
Performance Characteristics:
NEP provides a User-Defined Format (UDF) handler that enables reading NASA Common Data Format (CDF) files using the familiar NetCDF API.
The Common Data Format (CDF) is a self-describing data format developed by NASA's Space Physics Data Facility (SPDF). CDF is widely used in space physics and heliophysics research for storing time-series and multi-dimensional scientific data from space missions.
Key Characteristics:
Transparent Access: Read CDF files using standard NetCDF functions (nc_open(), nc_get_var(), nc_get_att()) without file conversion.
Automatic Type Mapping: CDF data types are automatically mapped to NetCDF equivalents:
Attribute Conventions: CDF attributes are automatically converted to NetCDF conventions (e.g., FILLVAL → _FillValue).
Use Cases:
CDF support is disabled by default (mutually exclusive with GRIB2). To enable:
Requirements: NASA CDF library v3.9+ must be installed. Download from: https://spdf.gsfc.nasa.gov/pub/software/cdf/dist/latest/
Spack Users: Install CDF separately with spack install cdf.
NEP provides a User-Defined Format (UDF) handler that enables reading GRIB2 (General Regularly-distributed Information in Binary form, Edition 2) files using the familiar NetCDF API.
GRIB2 is the standard binary format used by meteorological and oceanographic agencies worldwide (NOAA, ECMWF, and others) for distributing numerical weather prediction (NWP) model output, wave forecasts, and observational data.
Key Characteristics:
Transparent Access: Read GRIB2 files using standard NetCDF functions (nc_open(), nc_get_var(), ncdump) without file conversion.
Product-to-Variable Mapping: Each GRIB2 product is exposed as a named NC_FLOAT NetCDF variable with shared [y, x] dimensions. Variable names come from g2c_param_abbrev(); duplicate names are uniquified with _2, _3 suffixes.
Full Grid Expansion: NC_GRIB2_get_vara() uses g2_getfld(expand=1) to expand the full [ny, nx] grid, substituting _FillValue = 9.999e20f for bitmap-masked (e.g., land) points.
Metadata: Per-variable attributes (long_name, _FillValue, GRIB2_discipline, GRIB2_category, GRIB2_param_number) and global attributes (Conventions = "GRIB2", GRIB2_edition = 2).
**.ncrc Autoload**: Place the .ncrc file in your home directory and nc_open() / ncdump work on .grib2 files with no code changes.
Use Cases:
GRIB2 support is enabled by default. To disable:
Requirements: NOAA NCEPLIBS-g2c (>= 2.1.0) and libjasper (>= 3.0.0) must be installed. Supply the g2c install path at configure time.
Note: GRIB2 and CDF are mutually exclusive — both use UDF slot 2. Enable one or the other, not both.
NEP provides a User-Defined Format (UDF) handler that enables reading GeoTIFF files using the familiar NetCDF API.
GeoTIFF is a public domain metadata standard that allows georeferencing information to be embedded within a TIFF (Tagged Image File Format) file. GeoTIFF is widely used in geographic information systems (GIS), remote sensing, and earth science applications for storing geospatial raster data.
Key Characteristics:
Transparent Access: Read GeoTIFF files using standard NetCDF functions (nc_open(), nc_get_var(), nc_inq_dim()) without file conversion.
Automatic Dimension Mapping: GeoTIFF structure is automatically mapped to NetCDF dimensions:
CF-1.8 CRS Metadata: Coordinate reference system information is emitted as a CF-1.8 compliant crs grid-mapping variable with coordinate variables (lon/lat or x/y) and optional bounds. See docs/cf-compliance.md for the full attribute specification.
Metadata Preservation: GeoTIFF tags and geospatial metadata are accessible as NetCDF attributes, including coordinate reference system information.
Use Cases:
GeoTIFF support is enabled by default. To disable:
Requirements: libgeotiff and libtiff libraries must be installed.
Spack Users: Install with spack install nep +geotiff.
NEP requires:
Build with CMake or Autotools:
Once installed, both LZ4 and BZIP2 compression filters are available to NetCDF-4 applications through HDF5 filter plugins. Set the HDF5_PLUGIN_PATH environment variable and use standard NetCDF-4 compression APIs:
Choose the algorithm that best fits your workflow requirements—LZ4 for speed or BZIP2 for compression ratio.
When CDF support is enabled, open and read CDF files using standard NetCDF functions:
No special code is needed—the CDF UDF handler automatically detects and processes CDF files.
When GRIB2 support is enabled (the default), open and read GRIB2 files using standard NetCDF functions:
Or use ncdump directly after installing the .ncrc file:
No special code is needed — the GRIB2 UDF handler automatically detects and processes GRIB2 files.
When GeoTIFF support is enabled (the default), open and read GeoTIFF files using standard NetCDF functions:
No special code is needed—the GeoTIFF UDF handler automatically detects and processes GeoTIFF files.
crs variable, coordinate variables, bounds)docs/cf-compliance.md for the CF grid mapping attribute specificationNC_FLOAT variable with [y, x] dimensions_FillValue for bitmap-masked (land) pointsConventions = "GRIB2".ncrc autoload support for zero-code-change nc_open() / ncdump access--disable-geotiff / --disable-grib2netcdf-fortran library when enabledSee the dedicated build and configuration page for full details on CMake and Autotools options:
The API documentation is generated directly from the C and Fortran source code.
/NEP/v1.2.0/api/).latest alias points to the most recent release documentation.Key API reference pages:
Refer to the documentation header for the exact version of NEP corresponding to this build.
See the COPYRIGHT file for licensing information.