docs: def check_units(self, ds):
          '''
          Check the units attribute for all variables to ensure they are CF
          compliant under CF §3.1
  
          CF §3.1 The units attribute is required for all variables that represent dimensional quantities
          (except for boundary variables defined in Section 7.1, "Cell Boundaries" and climatology variables
          defined in Section 7.4, "Climatological Statistics").
  
          Units are not required for dimensionless quantities. A variable with no units attribute is assumed
          to be dimensionless. However, a units attribute specifying a dimensionless unit may optionally be
          included.
  
          - units required
          - type must be recognized by udunits
          - if standard name specified, must be consistent with standard name table, must also be consistent with a
            specified cell_methods attribute if present
  
          :param netCDF4.Dataset ds: An open netCDF dataset
          :rtype: list
          :return: List of results
          '''
  
          ret_val = []
  
          coordinate_variables = self._find_coord_vars(ds)
          auxiliary_coordinates = self._find_aux_coord_vars(ds)
          geophysical_variables = self._find_geophysical_vars(ds)
          unit_required_variables = coordinate_variables + auxiliary_coordinates + geophysical_variables
  
          for name in set(unit_required_variables):
              # For reduced horizontal grids, the compression index variable does
              # not require units.
              if cfutil.is_compression_coordinate(ds, name):
                  continue
  
              variable = ds.variables[name]
  
              # Skip instance coordinate variables
              if getattr(variable, 'cf_role', None) is not None:
                  continue
  
              # Skip labels
              if variable.dtype.char == 'S':
                  continue
  
              standard_name = getattr(variable, 'standard_name', None)
              standard_name, standard_name_modifier = self._split_standard_name(standard_name)
  
              units = getattr(variable, 'units', None)
  
              valid_units = self._check_valid_cf_units(ds, name)
              ret_val.append(valid_units)
  
              units_attr_is_string = TestCtx(BaseCheck.MEDIUM, self.section_titles['3.1'])
  
              # side effects, but better than teasing out the individual result
              if units_attr_is_string.assert_true(
                  isinstance(units, basestring),
                  "units ({}) attribute of '{}' must be a string compatible with UDUNITS".format(units, variable.name)
              ):
                  valid_udunits = self._check_valid_udunits(ds, name)
                  ret_val.append(valid_udunits)
              ret_val.append(units_attr_is_string.to_result())
  
              if isinstance(standard_name, basestring):
                  valid_standard_units = self._check_valid_standard_units(ds,
                                                                          name)
                  ret_val.append(valid_standard_units)
  
          return ret_val