Reverse procesdure: reorder input per output year and loop years