Prepare GAMM for calculation.