c     ============================================
      subroutine setaux(maxmx,mbc,mx,xlower,dx,maux,aux)
c     ============================================
c
c     # set auxiliary arrays 
c     # aux(i,1) = velocity u_i in i'th cell for advection
c
c     
      implicit double precision (a-h,o-z)
      dimension aux(1-mbc:maxmx+mbc, maux)

      do i=1-mbc,mx+mbc
	 xi = xlower + (i-0.5d0)*dx
	 aux(i,1) = 1.d0 + 0.5d0*exp(-10.d0*(xi-1.d0)**2) 
     &               * dsin(15.d0*(xi-1.d0))
         write(17,*) xi, aux(i,1)
	 enddo
c
c      # for periodic boundary conditions, extend aux array periodically:
       do ibc=1,mbc
          aux(1-ibc,1) = aux(mx+1-ibc,1)
          aux(mx+ibc,1) = aux(ibc,1)
          enddo
c
       return
       end
