def calculate_chunks(dataset):
    """
    For the given dataset, calculate if the size on any dimension is
    worth chunking. Any dimension larger than 4000 will be chunked. This
    is done to ensure that the variable can fit in memory.

    Parameters
    ----------
    dataset : xarray.Dataset
        The dataset to calculate chunks for.

    Returns
    -------
    dict
        The chunk dictionary, where the key is the dimension and the
        value is 4000.
    """
    chunk_dict = {dim: 4000 for dim in dataset.dims
                  if dataset.dims[dim] > 4000
                  and len(dataset.dims) > 1}
    return chunk_dict