      subroutine modetrap

      implicit double precision(a-h,o-z)

      common/trap/per0,perH,perHe,alpha2,ane,l
      double precision p1(300),p2(300),pfind(300)

      alpha2=2.0
      pmin=50.
      pmax=1000.
      dp=0.1
      do l=1,2
      i=0
      do p=pmin,pmax,dp
	pcalc=pdisc(p)
	discr=pdisc(p)*pdisc(p-dp)
	if (discr.lt.0) then
	  if (abs(pdisc(p-2.*dp)).gt.abs(pdisc(p-dp))) then
	    i=i+1
	    p1(i)=p-dp
	    p2(i)=p
	  endif
	endif
      enddo
      tol=1.0d-06
      do k=1,i
        pfind(k)=zbrent(pdisc,p1(k),p2(k),tol)
      enddo
      enddo

      return
      end

************************************************************************

