gel_loc_turn3(i+1)=gel_loc_turn3(i+1)
& +0.5d0*(pizda(1,1)+pizda(2,2))
C Cartesian derivatives
+!DIR$ UNROLL(0)
do l=1,3
c ghalf1=0.5d0*agg(l,1)
c ghalf2=0.5d0*agg(l,2)
sinkt(k)=dsin(k*theti2)
enddo
C if (i.gt.3) then
- if (i.gt.3 .and. itype(imax0(i-3,1)).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
c write(iout,*)i,k,gdih,sgdih,beta(i+1,i+2,i+3,i+4),grad_dih3
ccc write(iout,747) "GRAD_KAT_1", i, nphi, icg, grad_dih3,
ccc & gloc(nphi+i-3,icg)
- gloc(i,icg)=gloc(i,icg)+grad_dih3
+ gloc(i-3,icg)=gloc(i-3,icg)+grad_dih3
c if (i.eq.25) then
c write(iout,*) "i",i,"icg",icg,"gloc(",i,icg,")",gloc(i,icg)
c endif