	subroutine reglim(ello,del,ido,iterm,fxtrue)
c
	include '/u1/gcf/e350/crystal/cb/irspec'
c
	include '/u1/gcf/e350/crystal/cb/beam'
c
	include '/u1/gcf/e350/crystal/cb/wenbin'
c
	include '/u1/gcf/e350/crystal/cb/clouds'
c
	include '/u1/gcf/e350/crystal/cb/fixcom'
c
	logical fxtrue
c
	ido=0
	do 1 ibm=1,nbeam
	ave=ello+.5*del
	sigcur=resolv(ave)
	thlo=ave-3.*sigcur
	thhi=amin1(enhigh(ibm),ave+3.*sigcur)
	if(irspec.eq.0.or.iterm.eq.0) go to 3
	thhi=amin1(thhi,erup(iterm))
	thlo=amax1(thlo,erdown(iterm))
3		continue
	if (fxtrue) thhi=amin1(thhi,efromm(vm3,-ave*avt/ebm(ibm)))
	if (thhi.le.thlo) goto 2
	call wgtint(thlo,thhi,noint,val(1,ibm),wgt(1,ibm))
1		continue
	return
c
2		ido=1
	return
c
	end
