def fill_oc_stress_period_data(stress_period_data, nper):
    """For MODFLOW 2005-style models, repeat last entry in stress_period_data
    for subsequent stress periods (until another entry is encountered),
    as is done by default in MODFLOW 6.
    """
    filled_spd = {}
    last_period_data = {}
    for period in range(nper):
        for (kper, kstp), data in stress_period_data.items():
            if kper == period:
                last_period_data[(kper, kstp)] = data
        last_period_data = {(period, kstp): data for (kper, kstp), data
                            in last_period_data.items()}
        filled_spd.update(last_period_data)
    return filled_spd