Use getValue method of NetcdfVariable if var is scalar.