! version double precision

	module convolution_sub

	contains
	subroutine convol(a,b,conv)
	implicit none

	real(kind(0d0)), intent(in) :: a(:),b(:)
	real(kind(0d0)),intent(out) :: conv(:)
	integer :: i,k,n,na,nb

	na=size(a) ; nb=size(b)
	n=na+nb-1

	do i=2,n+1
!	 print*,i,a(:),b(:)
	 conv(i-1)=0d0
	 do k=max(1,i-nb),min(i-1,na)
	  conv(i-1)=conv(i-1)+a(k)*b(i-k)
	 enddo
	enddo

	end subroutine convol

	end module
