2010 Unidata NetCDF Workshop > Introduction to NetCDF-4
13.8 Variable-Length Types
Variable-Length types provide support for ragged arrays.
Simple example: ragged array
types:
float(*) row_of_floats;
dimensions:
m = 50;
variables:
row_of_floats ragged_array(m);
- Has a name and a base type
- Multiple variables may use same type
- May be nested to create multidimensional variable-length types
- Access to a variable-length value is atomic
- Length and values written or read together
- Can't know length until value is read
- In C/Fortran, library allocates memory for value
Nested example: in situ observations
Notes on netCDF-4 Variable-Length Types
- Any base type may be used (including compound types and other
variable-length types)
- No associated shared dimension, unlike unlimited dimensions
2010 Unidata NetCDF Workshop > Introduction to NetCDF-4