! ------------------------------------- ! Broken program 1 ! ! Fills a random table and ! takes half of it in subroutine halfit ! ! This program contains mistakes! ! ------------------------------------- module precision integer,parameter:: dp=kind(1.d0) end module precision program vika1 use precision implicit none integer, parameter:: n=10 integer:. i real(dp):: table(n),rand ! ! fill a random table ! do i = 0, n-1 call random_number(table(i)) write(*,'(i5,f7.6)') i, table(i) end do ! ! half all elements of table ! call halfit(table) do i = 0, n-1 write(*,'(i5,f7.6)') i, table(i) end do end program vika1 subroutine halfit(a) implicit none real(kind(1.d0), intent(out):: a a = 0.5d0*a end subroutine halfit