module pluto
implicit none

   real(8), allocatable :: z(:)
   
   contains
   
   subroutine minnie(x,y,n)
      integer :: n
      real(8),intent(in) :: x(n)
      real(8),intent(out):: y(n)
      
      integer :: i
      if (allocated(z)) deallocate(z)
      allocate(z(n))
      
      y  = sin(x)
      z(1) = y(1)
      do i=2,n
         z(i) = y(i) + z(i-1)
      enddo
      
   end subroutine 
end module
