integer :: i,nstart,maxsi,nsi,maxnit,nit,niter
integer :: it1,it2,it,j
!d print *,' CG Processor',me,' maxgen=',maxgen
- maxsi=100
-!d write (iout,*) 'Gen_Rand_conf: nstart=',nstart
+ maxsi=1000
+! write (iout,*) 'Gen_Rand_conf: nstart=',nstart
if (nstart.lt.5) then
it1=iabs(itype(2,1))
phi(4)=gen_phi(4,iabs(itype(2,1)),iabs(itype(3,1)))
! write(iout,*)'phi(4)=',rad2deg*phi(4)
if (nstart.lt.3) theta(3)=gen_theta(iabs(itype(2,1)),pi,phi(4))
! write(iout,*)'theta(3)=',rad2deg*theta(3)
- if ((it1.ne.10).and.(it.ne.ntyp1)) then
+ if ((it1.ne.10).and.(it1.ne.ntyp1)) then
nsi=0
fail=.true.
do while (fail.and.nsi.le.maxsi)
it1=iabs(itype(i-1,molnum(i-1)))
it2=iabs(itype(i-2,molnum(i-2)))
it=iabs(itype(i,molnum(i)))
-! print *,'Gen_Rand_Conf: i=',i,' it=',it,' it1=',it1,' it2=',it2,
-! & ' nit=',nit,' niter=',niter,' maxgen=',maxgen
+! print *,'Gen_Rand_Conf: i=',i,' it=',it,' it1=',it1,' it2=',it2,&
+! ' nit=',nit,' niter=',niter,' maxgen=',maxgen
phi(i+1)=gen_phi(i+1,it1,it)
if (back) then
phi(i)=gen_phi(i+1,it2,it1)
! print *,'phi(',i,')=',phi(i)
theta(i-1)=gen_theta(it2,phi(i-1),phi(i))
+! print *,"theta",theta(i-1),phi(i)
if ((it2.ne.10).and.(it2.ne.ntyp1)) then
nsi=0
fail=.true.
call locate_next_res(i-1)
endif
theta(i)=gen_theta(it1,phi(i),phi(i+1))
+ write(iout,*) "theta(i),",theta(i)
if ((it1.ne.10).and.(it1.ne.ntyp1)) then
nsi=0
fail=.true.
do while (fail.and.nsi.le.maxsi)
call gen_side(it1,theta(i),alph(i-1),omeg(i-1),fail)
+! write(iout,*)"alpha,omeg(i-1)",alph(i-1),omeg(i-1),i,nsi,maxsi
nsi=nsi+1
enddo
if (nsi.gt.maxsi) return 1
endif
call locate_next_res(i)
+ write(iout,*) "overlap,",overlap(i-1)
if (overlap(i-1)) then
if (nit.lt.maxnit) then
back=.true.
endif
endif
else
+ write(iout,*) "tu dochodze"
back=.false.
nit=0
i=i+1
z(2)=0.0D0
endif
thet_pred_mean=a0thet(it)
+ write(iout,*),it,thet_pred_mean,"gen_thet"
do k=1,2
thet_pred_mean=thet_pred_mean+athet(k,it,1,1)*y(k) &
+bthet(k,it,1,1)*z(k)