Previous: Introduction to Compound Types Next: Using Compound Types Table of contents Frames User guide
2008 Unidata NetCDF Workshop for Developers and Data Providers > User Defined Types in NetCDF-4

16.4 Compound Type CDL Example
This CDL exampls shows a compound type.
types:
  compound wind_vector_t {
    float eastward ;
    float northward ;
    }
dimensions:
    lat = 18 ;
    lon = 36 ;
    pres = 15 ;
    time = 4 ;
variables:
    wind_vector_t gwind(time, pres, lat, lon) ;
       wind:long_name = "geostrophic wind vector" ;
       wind:standard_name = "geostrophic_wind_vector" ;
data:
    gwind = {1, -2.5}, {-1, 2}, {20, 10}, {1.5, 1.5}, ...;
types:
  compound ob_t {
      int station_id ;
      double time ;
      float temperature ;
      float pressure ;
  }
dimensions:
    nstations = unlimited ;
variables:
    ob_t obs(nstations) ;
data:
    obs = {42, 0.0, 20.5, 950.0}, ... ;

 


Previous: Introduction to Compound Types Next: Using Compound Types Table of contents Frames User guide
2008 Unidata NetCDF Workshop for Developers and Data Providers > User Defined Types in NetCDF-4