Fortran 90 three nested loop summation