Previous: Introuction to Variable Length Types Next: CDL Example of Nested Variable-Length Types Table of contents Frames User guide
2009 Unidata NetCDF Workshop for Developers and Data Providers > User Defined Types in NetCDF-4

23.13 CDL Example of Variable-Length Types
This CDL example shows a 1D VLEN array.
Simple example: ragged array
  types:
    float(*) row_of_floats;
  dimensions:
    m = 50;
  variables:
    row_of_floats ragged_array(m);
Nested example: in situ observations
types:
  compound obs_t {               // type for a single observation
    float pressure ;
    float temperature ;
    float salinity ;
  }
  obs_t some_obs_t(*) ;          // type for some observations
  compound profile_t {           // type for a single profile
    float latitude ;
    float longitude ;
    int time ;
    some_obs_t obs ;
  }
  profile_t some_profiles_t(*) ; // type for some profiles
  compound track_t {             // type for a single track
    string id ;
    string description ;
    some_profiles_t profiles;
  }
dimensions: 
  tracks = 42;
variables:  
  track_t cruise(tracks); // this cruise has 42 tracks

Notes on netCDF-4 Variable-Length Types

 


Previous: Introuction to Variable Length Types Next: CDL Example of Nested Variable-Length Types Table of contents Frames User guide
2009 Unidata NetCDF Workshop for Developers and Data Providers > User Defined Types in NetCDF-4