TotalView Fortran Serial Exercise 1 - Assignment

Assignment

You can select to see more details on this assignment if you need them. You can also select tips if you need some suggestions to get started on the assignment. Finally, you can select Solution to view a solution to the problem.

Your first assignment is to use TotalView to locate an error in the following program. The program is printing a value of "NAN" or "-Infinity" for one of the values. Compile the code with ifort and locate the source of the error.

 

      PROGRAM NAN

      DOUBLE PRECISION VEC(10)
      INTEGER I

      DO 10 I=2,10
        VEC(I) = 2.D0*I
10    CONTINUE

      DO 20 I=1,10
        VEC(I) = LOG(VEC(I))
20    CONTINUE

      DO 30 I=1,10
        PRINT *, VEC(I)
30    CONTINUE

      STOP
      END