An adaptive reduction algorithm for efficient chemical calculations in global atmospheric chemistry models