include 'COMMON.SETUP'
include 'COMMON.NAMES'
- do i=1,19
+ do i=1,max_template
distancek(i)=9999999.9
enddo
coskt(k)=dcos(k*theti2)
sinkt(k)=dsin(k*theti2)
enddo
- if (i.gt.3 .and. itype(i-3).ne.ntyp1) then
+ if (i.gt.3 .and. itype(max0(i-3,1)).ne.ntyp1) then
#ifdef OSF
phii=phi(i)
if (phii.ne.phii) phii=150.0
esccor=0.0D0
do i=itau_start,itau_end
esccor_ii=0.0D0
+ if ((itype(i-2).eq.ntyp1).or.(itype(i-1).eq.ntyp1)) cycle
isccori=isccortyp(itype(i-2))
isccori1=isccortyp(itype(i-1))
phii=phi(i)
cosphi=dcos(j*tauangle(intertyp,i))
sinphi=dsin(j*tauangle(intertyp,i))
esccor=esccor+v1ij*cosphi+v2ij*sinphi
-#define DEBUG
#ifdef DEBUG
esccor_ii=esccor_ii+v1ij*cosphi+v2ij*sinphi
#endif
-#undef DEBUG
gloci=gloci+j*(v2ij*cosphi-v1ij*sinphi)
enddo
gloc_sc(intertyp,i-3,icg)=gloc_sc(intertyp,i-3,icg)+wsccor*gloci
#ifdef DEBUG
write (iout,*) "ecorr",i,j,i+1,j1,
& ehbcorr(i,j,i+1,j1,jj,kk,0.72D0,0.32D0)
-#undef DEBUG
+#endif
n_corr=n_corr+1
else if (j1.eq.j) then
C Contacts I-J and I-(J+1) occur simultaneously.