c****f** test/test c FUNCTION c test -- do nothing, just try to show what will appear in the c binary file. c AUTHOR c Ruo Li, Jan 09, 2005. c SEE ALSO c g77, nm, robodoc c*** c****f** test/cos2 c FUNCTION c cos2 -- calculate cos(2*x) if sin(x) is known using formula c cos(2*x) = 1 - 2*sin^2(x) c USED BY c main c*** subroutine cos2(sinx) double precision sinx sinx = 1.0D0 - 2.0D0*sinx*sinx return end c****f** test/main c FUNCTION c main -- the code will calculate the sum of cos(2*i) for i from 1 c to 20 and print the result. c*** program main implicit none integer i double precision a, b b = 0.0D+0 do 10 i=1, 20 a = sin(dble(i)) call cos2(a) b = a + b 10 continue write (*,*) "b = ", b end c c end of file c