Implement calculation of the phi array for each run.