A Parallel Automatic Differentiation Algorithm for Simulation Models