c
c
c
c     =================================================
      function fdisc(x,y)
c     =================================================

      implicit double precision (a-h,o-z)
      common /comcirc/ x0circ(100),y0circ(100),rcirc(100),r2circ(100),
     &                 ncircles
      common /comzc/ zout,cout,zin(100),cin(100)

c
c     # for computing cell averages for initial data that has a
c     # discontinuity along some curve.  

c     # for ncirles circular inclusions.  If (x,y) is in the i'th circle
c     # then fdisc=i, else fdisc = -1

      call mapc2p(x,y,xp,yp)

      fdisc = -1.d0

      do i=1,ncircles
         if ((xp-x0circ(i))**2+(yp-y0circ(i))**2 .lt. rcirc(i)**2) then
            fdisc = i + 1.d-6
            endif
         enddo

c
      return
      end
