1subroutine smo(x,npts,y,nadd)
2
3  real x(npts)
4  real y(npts)
5
6  nh=nadd/2
7  do i=1+nh,npts-nh
8     sum=0.
9     do j=-nh,nh
10        sum=sum + x(i+j)
11     enddo
12     y(i)=sum
13  enddo
14  x=y
15  x(:nh)=0.
16  x(npts-nh+1:)=0.
17
18  return
19end subroutine smo
20