1 subroutine Econstr_back
2 c MD with umbrella_sampling using Wolyne's distance measure as a constraint
3 implicit real*8 (a-h,o-z)
5 include 'COMMON.CONTROL'
9 include 'COMMON.LANGEVIN'
11 c include 'COMMON.LANGEVIN.lang0'
13 include 'COMMON.CHAIN'
14 include 'COMMON.DERIV'
16 include 'COMMON.LOCAL'
17 include 'COMMON.INTERACT'
18 include 'COMMON.IOUNITS'
19 include 'COMMON.NAMES'
20 include 'COMMON.TIME1'
31 ii = ifrag_back(2,i,iset)-ifrag_back(1,i,iset)
33 c Deviations from theta angles
36 do j=ifrag_back(1,i,iset)+2,ifrag_back(2,i,iset)
37 dtheta_i=theta(j)-thetaref(j)
38 utheta_i=utheta_i+0.5d0*dtheta_i*dtheta_i
39 dutheta(j-2)=dutheta(j-2)+wfrag_back(1,i,iset)*dtheta_i/(ii-1)
41 utheta(i)=utheta_i/(ii-1)
43 c Deviations from gamma angles
46 do j=ifrag_back(1,i,iset)+3,ifrag_back(2,i,iset)
47 dgamma_i=pinorm(phi(j)-phiref(j))
48 c write (iout,*) j,phi(j),phi(j)-phiref(j)
49 ugamma_i=ugamma_i+0.5d0*dgamma_i*dgamma_i
50 dugamma(j-3)=dugamma(j-3)+wfrag_back(2,i,iset)*dgamma_i/(ii-2)
51 c write (iout,*) i,j,dgamma_i,wfrag_back(2,i,iset),dugamma(j-3)
53 ugamma(i)=ugamma_i/(ii-2)
55 c Deviations from local SC geometry
58 do j=ifrag_back(1,i,iset)+1,ifrag_back(2,i,iset)-1
62 uscdiff(i)=uscdiff(i)+dxx*dxx+dyy*dyy+dzz*dzz
64 duscdiff(k,j-1)=duscdiff(k,j-1)+wfrag_back(3,i,iset)*
65 & (dXX_C1tab(k,j)*dxx+dYY_C1tab(k,j)*dyy+dZZ_C1tab(k,j)*dzz)/
67 duscdiff(k,j)=duscdiff(k,j)+wfrag_back(3,i,iset)*
68 & (dXX_Ctab(k,j)*dxx+dYY_Ctab(k,j)*dyy+dZZ_Ctab(k,j)*dzz)/
70 duscdiffx(k,j)=duscdiffx(k,j)+wfrag_back(3,i,iset)*
71 & (dXX_XYZtab(k,j)*dxx+dYY_XYZtab(k,j)*dyy+dZZ_XYZtab(k,j)*dzz)
74 c write (iout,'(i5,6f10.5)') j,xxtab(j),yytab(j),zztab(j),
75 c & xxref(j),yyref(j),zzref(j)
77 uscdiff(i)=0.5d0*uscdiff(i)/(ii-1)
78 c write (iout,*) i," uscdiff",uscdiff(i)
80 c Put together deviations from local geometry
82 Uconst_back=Uconst_back+wfrag_back(1,i,iset)*utheta(i)+
83 & wfrag_back(2,i,iset)*ugamma(i)+wfrag_back(3,i,iset)*uscdiff(i)
84 c write(iout,*) "i",i," utheta",utheta(i)," ugamma",ugamma(i),
85 c & " uconst_back",uconst_back
86 utheta(i)=dsqrt(utheta(i))
87 ugamma(i)=dsqrt(ugamma(i))
88 uscdiff(i)=dsqrt(uscdiff(i))