1 C Calculate the distance between the two points and its difference from the
4 write (iout,*) "ELSE: dd",dd," constr_dist",constr_dist
5 if (constr_dist.eq.11) then
6 ehpb=ehpb+fordepth(i)!**4.0d0
7 & *rlornmr1(dd,dhpb(i),dhpb1(i),forcon(i))
8 fac=fordepth(i)!**4.0d0
9 & *rlornmr1prim(dd,dhpb(i),dhpb1(i),forcon(i))/dd
10 if(energy_dec)write (iout,'(a6,2i5,6f10.3)') "edisl",ii,jj,
11 & dd,dhpb(i),dhpb1(i),forcon(i),fordepth(i),ehpb
12 else if (constr_dist.eq.10) then
13 c AL 6//19/2018 cross-link restraints
14 xdis = (dd/forcon(i))**2
15 write (iout,*) "HERE: xdis",xdis
17 aux=(dhpb(i)+dhpb1(i)*xx)*expon+fordepth(i)
18 ehpb=ehpb-wboltzd*dlog(aux)
19 fac=-wboltzd*dhpb1(i)*(1.0d0-xx)*dxpon/(aux*forcon(i)**2)
20 if (energy_dec)write(iout,'(a6,2i5,6f10.3)') "edisl",ii,jj,
21 & dd,dhpb(i),dhpb1(i),forcon(i),fordepth(i),ehpb
23 c Quadratic or quartic restraints
24 if (dhpb1(i).gt.0.0d0) then
25 ehpb=ehpb+2*forcon(i)*gnmr1(dd,dhpb(i),dhpb1(i))
26 fac=forcon(i)*gnmr1prim(dd,dhpb(i),dhpb1(i))/dd
27 c write (iout,*) "alph nmr",
28 c & dd,2*forcon(i)*gnmr1(dd,dhpb(i),dhpb1(i))
31 C Get the force constant corresponding to this distance.
33 C Calculate the contribution to energy.
34 ehpb=ehpb+waga*rdis*rdis
35 c write (iout,*) "alpha reg",dd,waga*rdis*rdis
42 c Calculate Cartesian gradient
44 ggg(j)=fac*(c(j,jj)-c(j,ii))
46 cd print '(i3,3(1pe14.5))',i,(ggg(j),j=1,3)
47 C If this is a SC-SC distance, we need to calculate the contributions to the
48 C Cartesian gradient in the SC vectors (ghpbx).
51 ghpbx(j,iii)=ghpbx(j,iii)-ggg(j)
52 ghpbx(j,jjj)=ghpbx(j,jjj)+ggg(j)
57 cgrad ghpbc(k,j)=ghpbc(k,j)+ggg(k)
61 ghpbc(k,jjj)=ghpbc(k,jjj)+ggg(k)
62 ghpbc(k,iii)=ghpbc(k,iii)-ggg(k)