Depending on the difference between the minimum and maximum and the value resolution of a netcdf variable, a smaller sized integer variable like short or byte can be used to compact the data. A scale factor and offset will be used to fit the data in the smaller sized variable and will added to the netCDF variable as attributes . All with names scale_factor and add_offset. All standard netCDF viewers will take these attributes into account automatically, but other tools and especially scripts might not.
...