Previous: Creating a NetCDF Dataset Next: Reading a NetCDF Dataset with Unknown Names Table of contents Frames 2012 Unidata NetCDF Workshop > Using netCDF in programs

11.2 Reading a NetCDF Dataset with Known Names
Abstract code for reading a netCDF dataset of known structure.

Consider the case where you know the names of not only the netCDF datasets, but also the names of their dimensions, variables, and attributes. The order of typical C calls to read data from those variables in a netCDF dataset is (with arguments and error handling not shown):

     nc_open                /* open existing netCDF dataset */
          ...
        nc_inq_dimid        /* get dimension IDs */
          ...
        nc_inq_varid        /* get variable IDs */
          ...
        nc_get_att          /* get attribute values */
          ...
        nc_get_var          /* get values of variables */
          ...
     nc_close               /* close netCDF dataset */

 


Previous: Creating a NetCDF Dataset Next: Reading a NetCDF Dataset with Unknown Names Table of contents Frames 2012 Unidata NetCDF Workshop > Using netCDF in programs