|
NEP 2.7.0
NetCDF Extension Pack
|
Demonstrate the NetCDF-4 enhanced data model in a local NcZarr dataset. More...
#include <netcdf.h>#include <stdio.h>#include <stdlib.h>Macros | |
| #define | FILE_URL "file://nczarr_enhanced.zarr#mode=nczarr" |
| #define | NX 5 |
| #define | NTIMES 2 |
| #define | NSTATIONS 3 |
| #define | ERR(e) |
Functions | |
| int | main (void) |
Demonstrate the NetCDF-4 enhanced data model in a local NcZarr dataset.
This example extends nczarr_compression.c by introducing two enhanced-model features that are unavailable in classic NetCDF: hierarchical groups and multiple independent unlimited dimensions. The same nc_def_grp() and NC_UNLIMITED APIs used for NetCDF-4/HDF5 files work identically with NcZarr.
The program creates a NcZarr store with a root group containing a time (unlimited) × x(5) grid of temperature and pressure variables, and a child group obs/ that holds its own independent station (unlimited) dimension with observation value and time-index variables. After writing, the program reopens the store, navigates to the child group by name, verifies that both unlimited dimensions grew independently, and validates all data values.
Learning Objectives:
Key Concepts:
Related Examples:
Compilation:
Usage:
Expected Output: Creates the directory nczarr_enhanced.zarr containing:
| #define ERR | ( | e | ) |
| #define FILE_URL "file://nczarr_enhanced.zarr#mode=nczarr" |
| #define NSTATIONS 3 |
| #define NTIMES 2 |
| #define NX 5 |
| int main | ( | void | ) |