combined 4 inner loops in ftw97_pd into 2