program propagation implicit none real odd pi sum integer open unit 20

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
program propagation
implicit none
real :: x,v,t, odd, pi,f,sum
integer :: i,j,k
open(unit=20, file='p1.txt',status='unknown')
pi=4.*atan(1.)
do j=0,200
x=j/10.
sum=0.0
do i=1,5
odd=2*i-1
sum=sum+(1./odd)*sin(odd*x))
f=(4./pi)*sum
end do
write(20,*) i, x, f
print*, i, x, f
end do
end program