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'