include 'COMMON.SBRIDGE'
include 'COMMON.CHAIN'
double precision fact(6)
-cd write(iout, '(a,i2)')'Calling etotal ipot=',ipot
+Cd write(iout, '(a,i2)')'Calling etotal ipot=',ipot
cd print *,'nnt=',nnt,' nct=',nct
C
C Compute the side-chain and electrostatic interaction energy
c if (icall.gt.0) lprn=.true.
ind=0
do i=iatsc_s,iatsc_e
+C write(iout,*) i,"i",iatsc_s,iatsc_e
itypi=iabs(itype(i))
if (itypi.eq.ntyp1) cycle
itypi1=iabs(itype(i+1))
enddo! k
ELSE
ind=ind+1
+C write(iout,*) j,"j",istart(i,iint),iend(i,iint)
+
itypj=iabs(itype(j))
if (itypj.eq.ntyp1) cycle
dscj_inv=vbld_inv(j+nres)
double precision unmat(3,3) /1.0d0,0.0d0,0.0d0,
& 0.0d0,1.0d0,0.0d0,
& 0.0d0,0.0d0,1.0d0/
-cd write(iout,*) 'In EELEC'
+ write(iout,*) 'In EELEC'
cd do i=1,nloctyp
cd write(iout,*) 'Type',i
cd write(iout,*) 'B1',B1(:,i)
gcorr_loc(i)=0.0d0
enddo
do i=iatel_s,iatel_e
- if (i.eq.1) then
- if (itype(i).eq.ntyp1.or. itype(i+1).eq.ntyp1
- & .or. itype(i+2).eq.ntyp1) cycle
- else
+ write (iout,*) i,"i2",itype(i)
+ if (i.eq.1) cycle
+C if (itype(i).eq.ntyp1.or. itype(i+1).eq.ntyp1
+C & .or. itype(i+2).eq.ntyp1) cycle
+C else
if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
& .or. itype(i+2).eq.ntyp1
& .or. itype(i-1).eq.ntyp1
&) cycle
- endif
+C endif
if (itel(i).eq.0) goto 1215
dxi=dc(1,i)
dyi=dc(2,i)
num_conti=0
C write (iout,*) 'i',i,' ielstart',ielstart(i),' ielend',ielend(i)
do j=ielstart(i),ielend(i)
+C write(iout,*) j,"j2"
+
if (j.eq.1) then
if (itype(j).eq.ntyp1 .or. itype(j+1).eq.ntyp1
& .or.itype(j+2).eq.ntyp1
& .or.itype(j-1).eq.ntyp1
&) cycle
endif
+C write(iout,*) j,"j2"
C
C) cycle
if (itel(j).eq.0) goto 1216
& +0.5d0*(pizda(1,1)+pizda(2,2))
enddo
endif
- else if (j.eq.i+3 .and. itype(i+2).ne.ntyp1) then
+ else if (j.eq.i+3 .and. itype(i+2).ne.ntyp1.and.(i.gt.1)) then
if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
C changes suggested by Ana to avoid out of bounds
& .or.((i+5).gt.nres)
c 1215 continue
enddo
ethetacnstr=0.0d0
-C print *,ithetaconstr_start,ithetaconstr_end,"TU"
+ print *,ntheta_constr,"TU"
do i=1,ntheta_constr
itheta=itheta_constr(i)
thetiii=theta(itheta)
C & rad2deg*theta_constr0(i), rad2deg*theta_drange(i),
C & rad2deg*difi,0.25d0*for_thet_constr(i)*difi**4,
C & gloc(itheta+nphi-2,icg)
- endif
+C endif
enddo
C Ufff.... We've done all this!!!
return