def get_lat_name(ds):
    """ Get the name for the latitude values (could be either lat or latitude).

    :param ds:    xarray dataset of CMIP data.

    :return:    the string name for the latitude variable.
    """
    for lat_name in ['lat', 'latitude']:
        if lat_name in ds.coords:
            return lat_name
    raise RuntimeError("Couldn't find a latitude coordinate")