def add_units2ds(ds):
    """
    Add input ancillary units to xarray dataset
    """
    unit_dict = {
        u'DOC': '<UNIT NOT SET>',
        u'DOCaccum': '<UNIT NOT SET>',
        u'Depth_GEBCO': 'm',
        u'Prod': '<UNIT NOT SET>',
        u'SWrad': '<UNIT NOT SET>',
        u'SeaWIFs_ChlrA': "mg m$^{-3}$",
        u'WOA_Dissolved_O2': '<UNIT NOT SET>',
        u'WOA_MLDpd': '<UNIT NOT SET>',
        u'WOA_MLDpd_max': '<UNIT NOT SET>',
        u'WOA_MLDpd_sum': '<UNIT NOT SET>',
        u'WOA_MLDpt': '<UNIT NOT SET>',
        u'WOA_MLDpt_max': '<UNIT NOT SET>',
        u'WOA_MLDpt_sum': '<UNIT NOT SET>',
        u'WOA_MLDvd': '<UNIT NOT SET>',
        u'WOA_MLDvd_max': '<UNIT NOT SET>',
        u'WOA_MLDvd_sum': '<UNIT NOT SET>',
        u'WOA_Nitrate': "$\mu$M",
        u'WOA_Phosphate': '<UNIT NOT SET>',
        u'WOA_Salinity': 'PSU',
        u'WOA_Silicate': '<UNIT NOT SET>',
        u'WOA_TEMP': '$^{o}$C',
        u'WOA_TEMP_K': '$^{o}$K',
    }
    # Loop data variables and add units
    for var_ in ds.data_vars:
        updated_units = False
        attrs = ds[var_].attrs.copy()
        if ('units' not in attrs.keys()):
            attrs['units'] = unit_dict[var_]
            updated_units = True
        if updated_units:
            ds[var_].attrs = attrs
    return ds