def convert_units(g_per_m2, cell_size_ha):
    """Convert a quantity in g per square m to kg per grid cell."""

    kg_per_m2 = float(g_per_m2) / 1000.
    kg_per_ha = kg_per_m2 * 10000.
    kg = kg_per_ha * cell_size_ha
    return kg