& evdwij
endif
- if (energy_dec) write (iout,'(a6,2i5,0pf7.3)')
- & 'evdw',i,j,evdwij
-
+ if (energy_dec) then
+ write (iout,'(a6,2i5,0pf7.3)') 'evdw',i,j,evdwij
+ call flush(iout)
+ endif
C Calculate gradient components.
e1=e1*eps1*eps2rt**2*eps3rt**2
fac=-expon*(e1+evdwij)*rij_shift
include 'COMMON.VAR'
include 'COMMON.INTERACT'
include 'COMMON.IOUNITS'
+ include 'COMMON.CONTROL'
dimension ggg(3)
ehpb=0.0D0
cd write(iout,*)'edis: nhpb=',nhpb,' fbr=',fbr
else if (ii.gt.nres .and. jj.gt.nres) then
c Restraints from contact prediction
dd=dist(ii,jj)
+ if (constr_dist.eq.11) then
+ ehpb=ehpb+fordepth(i)**4.0d0
+ & *rlornmr1(dd,dhpb(i),dhpb1(i),forcon(i))
+ fac=fordepth(i)**4.0d0
+ & *rlornmr1prim(dd,dhpb(i),dhpb1(i),forcon(i))/dd
+ if (energy_dec) write (iout,'(a6,2i5,f15.6,2f8.3)')
+ & "edisl",ii,jj,
+ & fordepth(i)**4.0d0*rlornmr1(dd,dhpb(i),dhpb1(i),forcon(i)),
+ & fordepth(i),dd
+ else
if (dhpb1(i).gt.0.0d0) then
ehpb=ehpb+2*forcon(i)*gnmr1(dd,dhpb(i),dhpb1(i))
fac=forcon(i)*gnmr1prim(dd,dhpb(i),dhpb1(i))/dd
C Evaluate gradient.
C
fac=waga*rdis/dd
- endif
+ endif
+ endif
do j=1,3
ggg(j)=fac*(c(j,jj)-c(j,ii))
enddo
C Calculate the distance between the two points and its difference from the
C target distance.
dd=dist(ii,jj)
+ if (constr_dist.eq.11) then
+ ehpb=ehpb+fordepth(i)**4.0d0
+ & *rlornmr1(dd,dhpb(i),dhpb1(i),forcon(i))
+ fac=fordepth(i)**4.0d0
+ & *rlornmr1prim(dd,dhpb(i),dhpb1(i),forcon(i))/dd
+ if (energy_dec) write (iout,'(a6,2i5,f15.6,2f8.3)')
+ 7 "edisl",ii,jj,
+ & fordepth(i)**4.0d0*rlornmr1(dd,dhpb(i),dhpb1(i),forcon(i)),
+ & fordepth(i),dd
+c if (energy_dec)
+c & write (iout,*) fac
+ else
if (dhpb1(i).gt.0.0d0) then
ehpb=ehpb+2*forcon(i)*gnmr1(dd,dhpb(i),dhpb1(i))
fac=forcon(i)*gnmr1prim(dd,dhpb(i),dhpb1(i))/dd
C
fac=waga*rdis/dd
endif
+ endif
cd print *,'i=',i,' ii=',ii,' jj=',jj,' dhpb=',dhpb(i),' dd=',dd,
cd & ' waga=',waga,' fac=',fac
do j=1,3
enddo
endif
enddo
- ehpb=0.5D0*ehpb
+ if (constr_dist.ne.11) ehpb=0.5D0*ehpb
+c do i=1,nres
+c write (iout,*) "ghpbc",i,(ghpbc(j,i),j=1,3)
+c enddo
return
end
C--------------------------------------------------------------------------
diff=vbld(i+nres)-vbldsc0(1,iti)
c write (iout,*) i,iti,vbld(i+nres),vbldsc0(1,iti),diff,
c & AKSC(1,iti),AKSC(1,iti)*diff*diff
- if (energy_dec) write (iout,*)
- & "estr sc",i,iti,vbld(i+nres),vbldsc0(1,iti),diff,
- & AKSC(1,iti),AKSC(1,iti)*diff*diff
+ if (energy_dec) then
+ write (iout,*)
+ & "estr sc",i,iti,vbld(i+nres),vbldsc0(1,iti),diff,
+ & AKSC(1,iti),AKSC(1,iti)*diff*diff
+ call flush(iout)
+ endif
estr=estr+0.5d0*AKSC(1,iti)*diff*diff
do j=1,3
gradbx(j,i)=AKSC(1,iti)*diff*dc(j,i+nres)/vbld(i+nres)
sinkt(k)=dsin(k*theti2)
enddo
C if (i.gt.3) then
- if (i.gt.3 .and. itype(i-3).ne.ntyp1) then
+ if (i.gt.3 .and. itype(imax0(i-3,1)).ne.ntyp1) then
#ifdef OSF
phii=phi(i)
if (phii.ne.phii) phii=150.0
endif
enddo
- min_odl=minval(distancek)
+
+c min_odl=minval(distancek)
+ do kk=1,constr_homology
+ if(l_homo(kk,ii)) then
+ min_odl=distancek(kk)
+ exit
+ endif
+ enddo
+ do kk=1,constr_homology
+ if(l_homo(kk,ii) .and. distancek(kk).lt.min_odl)
+ & min_odl=distancek(kk)
+ enddo
c write (iout,* )"min_odl",min_odl
#ifdef DEBUG
write (iout,*) "ij dij",i,j,dij
do i=idihconstr_start_homo,idihconstr_end_homo
kat2=0.0d0
c betai=beta(i,i+1,i+2,i+3)
- betai = phi(i+3)
+ betai = phi(i)
c write (iout,*) "betai =",betai
do k=1,constr_homology
dih_diff(k)=pinorm(dih(k,i)-betai)