Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 
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

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690