diff --git a/tests/fortran/cubes.f b/tests/fortran/cubes.f index 55226db..8592ee7 100644 --- a/tests/fortran/cubes.f +++ b/tests/fortran/cubes.f @@ -1,15 +1,15 @@ -cc34567 Cubes program - PROGRAM SUM_OF_CUBES - INTEGER :: H, T, U - ! This program prints all 3-digit numbers that + program sum_of_cubes + implicit none + integer :: h, t, u + ! this program prints all 3-digit numbers that ! equal the sum of the cubes of their digits. - DO H = 1, 9 - DO T = 0, 9 - DO U = 0, 9 - IF (100*H + 10*T + U == H**3 + T**3 + U**3) THEN - PRINT "(3I1)", H, T, U - ENDIF - END DO - END DO - END DO - END PROGRAM SUM_OF_CUBES + do h = 1, 9 + do t = 0, 9 + do u = 0, 9 + if (100*h + 10*t + u == h**3 + t**3 + u**3) then + print "(3I1)", h, t, u + endif + end do + end do + end do + end program sum_of_cubes diff --git a/tests/fortran/cubes.hand-inst.f b/tests/fortran/cubes.hand-inst.f index e553c7a..8b337de 100644 --- a/tests/fortran/cubes.hand-inst.f +++ b/tests/fortran/cubes.hand-inst.f @@ -1,22 +1,22 @@ -cc34567 Cubes program - PROGRAM SUM_OF_CUBES - integer profiler(2) / 0, 0 / - save profiler - INTEGER :: H, T, U +!c34567 Cubes program + program sum_of_cubes + integer profiler(2) / 0, 0 / + save profiler + integer :: H, T, U call TAU_PROFILE_INIT() - call TAU_PROFILE_TIMER(profiler, 'PROGRAM SUM_OF_CUBES') + call TAU_PROFILE_TIMER(profiler, 'program sum_of_cubes') call TAU_PROFILE_START(profiler) call TAU_PROFILE_SET_NODE(0) ! This program prints all 3-digit numbers that ! equal the sum of the cubes of their digits. - DO H = 1, 9 - DO T = 0, 9 - DO U = 0, 9 - IF (100*H + 10*T + U == H**3 + T**3 + U**3) THEN - PRINT "(3I1)", H, T, U - ENDIF - END DO - END DO - END DO + do h = 1, 9 + do t = 0, 9 + do u = 0, 9 + if (100*h + 10*t + u == h**3 + t**3 + u**3) then + print "(3I1)", h, t, u + endif + end do + end do + end do call TAU_PROFILE_STOP(profiler) - END PROGRAM SUM_OF_CUBES + end program sum_of_cubes diff --git a/tests/fortran/loop_test.f90 b/tests/fortran/loop_test.f90 index 647e103..9b10b0e 100644 --- a/tests/fortran/loop_test.f90 +++ b/tests/fortran/loop_test.f90 @@ -15,19 +15,19 @@ subroutine foo(iVal) end do end do - do 10, i = 1, 3 - call bar(i+iVal) -10 continue + do i = 1, 3 + call bar(i+iVal) + end do print *, "after calling bar in foo" - end +end subroutine foo program main integer i print *, "test program" - do 10, i = 1, 3 + do i = 1, 3 call foo(i) -10 continue + end do end program main