	subroutine prepth(nott,dte,etlo,pll,fxtrue,jp)
c	calculates theory for the best fit for nott points at intervals dte
c	in energy starting at etlo and puts result in tht and ths
c
	include '/u1/gcf/e350/crystal/cb/hotsun'
	include '/u1/gcf/e350/crystal/cb/irspec'
	include '/u1/gcf/e350/crystal/cb/wenbin'
	include '/u1/gcf/e350/crystal/cb/clouds'
	include '/u1/gcf/e350/crystal/cb/parms'
	include '/u1/gcf/e350/crystal/cb/they'
	dimension ths(280),tht(280,4)
	equivalence(tht,thy),(ths,th)
c
	include '/u1/gcf/e350/crystal/cb/where'
	include '/u1/gcf/e350/crystal/cb/beam'
	include '/u1/gcf/e350/crystal/cb/datbin'
	include '/u1/gcf/e350/crystal/cb/const'
	include '/u1/gcf/e350/crystal/cb/x'
	external regge,tfixed,resp,bmfunc,ai2
	logical fxtrue
c
	data th/280*0./,thy/1120*0./
c
	ibm=(nobeam+1)/2
	if (.not.fitbem) goto 1
	pinc=param(ibeam)
	call bemset
1	if (fitsga) sigma=param(isigma)
	if (fitfix) pff=param(ifixed)
	ello=etlo
	do 2 i=1,nott
	t=0.
	if (ntr.eq.0) goto 4
	noint=nointr
	do 3 j=1,ntr
	if (jrspec.eq.0) goto 17
	x1=x1a(j)
	x2=x2a(j)
17	continue
	call reglim(ello,dte,ido,j,fxtrue)
	if(ido.eq.0) go to 10
	tht(i,ialpty(j))=0.
	go to 3
10	if (fitalp(1)) alpha=param(ialpha(iusalp(j)))
	if (.not.fitalp(1)) alpha=alfain(iusalp(j))
	const=conal(j)
	if (j.eq.2.and.(jp.eq.3.or.jp.eq.5).and.(.not.ftnorm(2))) goto 14
	if (j.eq.2.and.(jp.eq.4.or.jp.eq.6)) goto 15
	if (.not.ftnorm(j)) goto 9
	if (j.ne.2.or.nfs.or.jp.eq.3.or.jp.eq.5) tp=param(inorm(j))*calct(
& ello,regge,resp,bmfunc)
	if (j.eq.2.and.(.not.nfs).and.jp.le.2) tp=(alimf2*sin(param(inorm
& (j)))**2+alimf1)*pll*calct(ello,regge,resp,bmfunc)
	goto 13
15	tp=0.
	goto 13
14	tp=pll*param(inorm(1))*calct(ello,regge,resp,bmfunc)
	goto 13
9	tp=pll*calct(ello,regge,resp,bmfunc)
13	t=t+tp
	tht(i,ialpty(j))=tp
3	continue
c
4	if (.not.fxtrue) goto 16
	noint=noinfx
	call fixlim(ello,dte,ido)
	if (ido.ne.0) goto 16
	tp=calct(ello,tfixed,resp,bmfunc)
	t=t+tp
	tht(i,ifixty)=tp
	goto 8
16	if (ifixty.gt.0) tht(i,ifixty)=0.
c
8	if (.not.usei2) goto 6
	noint=nointr
	call reglim(ello,dte,ido,0,fxtrue)
	if (ido.eq.0) goto 12
	tht(i,i2norm)=0.
	goto 6
12	tp=calct(ello,ai2,resp,bmfunc)
	t=t+tp
	tht(i,i2norm)=tp
c	if (.not.ftbrem) goto 6
c	call bremlm(ello,dte)
c	tp=param(ibrem)*calct(ello,brem,resp,bmfunc)
c	t=t+tp
c	tht(i,inth(ibrem))=tp
c
6	ths(i)=t
2	ello=ello+dte
	return
c
	end
