Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program furie
  2. implicit none
  3.    
  4.     integer, parameter ::  mp = 4
  5.     integer :: n, i, k
  6.     complex(mp) :: w
  7.     complex(mp), allocatable, dimension(:) :: X, Y
  8.    
  9.     open(1, file = 'input1')
  10.     read(1,*) n
  11.     allocate ( X(0:n-1), Y(0:n-1) )
  12.    
  13.     read(1,*) X
  14.    
  15.     w = exp( (0.0,1.0)*8*atan(1.0)/n)
  16.     do k = 0, n-1
  17.         Y(k) = 0
  18.         do i = 0, n-1
  19.             Y(k) = Y(k) + X(i)*w**(-k*i)
  20.         end do
  21.     end do
  22.    
  23.     open(2, file = 'input2')
  24.     write(2,*) Y
  25.    
  26.     do i = 0, n-1
  27.         X(i) = 0
  28.         do k = 0, n-1
  29.             X(i) = X(i) + (Y(k)*(w**(k*i)))/n
  30.         end do
  31.     end do
  32.    
  33.     open(3, file = 'output')
  34.     write(3,*) X
  35.    
  36.    
  37. close(1); close(2); close(3)
  38. end program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement