Previous Scientific Data Formats: Network Common Data Format Next

Specifying Attributes and Variables

Variables and attributes can be referred to either by name or by their ID numbers in most netCDF routines. For example, given the NCDF_VARDEF command shown below, the two NCDF_VARPUT commands shown after it are equivalent:

varid = NCDF_VARDEF(fileid, 'VarName', [d0,d1,d2+d3], /FLOAT)  
; Reference by variable name:  
NCDF_VARPUT, fileid, 'VarName', '12'  
; Reference by variable ID:  
NCDF_VARPUT, fileid, varid,'12'  

  IDL Online Help (March 06, 2007)