|
NEP 1.5.1
NetCDF Extension Pack: compression extensions for NetCDF
|
Demonstrates file size and dimension limits for NetCDF classic formats. More...
#include <stdio.h>#include <stdlib.h>#include <netcdf.h>#include <sys/stat.h>Macros | |
| #define | ERRCODE 2 |
| #define | ERR(e) {printf("Error: %s\n", nc_strerror(e)); exit(ERRCODE);} |
| #define | CLASSIC_DIM 5000 /* ~20KB for float data */ |
| #define | OFFSET_DIM 5000 /* ~20KB for float data */ |
| #define | DATA_DIM 5000 /* ~20KB for float data */ |
| #define | TEST_MODE "SMALL" |
Functions | |
| long | get_file_size (const char *filename) |
| void | print_format_limits (void) |
| void | test_format (const char *filename, int format_flag, const char *format_name, size_t dim_size) |
| int | main () |
Demonstrates file size and dimension limits for NetCDF classic formats.
This example explores the size limitations of the three classic NetCDF formats (CDF-1, CDF-2, CDF-5) by creating test files and explaining theoretical limits. Understanding these limits is essential for choosing the appropriate format for large datasets.
The program runs in small test mode (suitable for CI) by default, creating modest-sized test files and displaying theoretical limits. This helps users understand when they need to upgrade from CDF-1 to CDF-2 or CDF-5 for larger datasets.
Learning Objectives:
Key Concepts:
Format Limits Summary:
Prerequisites:
Related Examples:
Compilation:
Usage:
Expected Output:
| #define CLASSIC_DIM 5000 /* ~20KB for float data */ |
| #define DATA_DIM 5000 /* ~20KB for float data */ |
| #define ERR | ( | e | ) | {printf("Error: %s\n", nc_strerror(e)); exit(ERRCODE);} |
| #define ERRCODE 2 |
| #define OFFSET_DIM 5000 /* ~20KB for float data */ |
| #define TEST_MODE "SMALL" |
| long get_file_size | ( | const char * | filename | ) |
| int main | ( | ) |
| void print_format_limits | ( | void | ) |
| void test_format | ( | const char * | filename, |
| int | format_flag, | ||
| const char * | format_name, | ||
| size_t | dim_size | ||
| ) |