my one of most favorite tool for handling NetCDF data.
ncatted -a att_nm, var_nm, mode, att_typ, att_val in.nc [out.nc]
for mode: a=append, c=create, d=delete, m=modify, o=overwrite
for att_typ: f=float, d=double, l=long, s=short, c=character, b=byte, i=integer
6) For files to be intelligently handled by the Live Access Software, a file needs to have the following defined: units, long_name, and title. In addition, I like to put in an extended history variable.
ncatted -O -a units,air,c,c,"units goes here" filename.nc
where “-a” is followed by “attribute name, variable name, mode (append, create, delete, modify, overwrite), attribute variable type (float, character, …), attribute value”
ncatted -O -a long_name,air,c,c,"long_name goes here" filename.nc “\n” (no quotes) can be used to put in a carriage return.
ncatted -O -h -a title,global,o,c,"title goes here" filename.nc
ncatted -O -h -a history,global,o,c,'history goes here' filename.nc