1 subroutine geom_to_var(n,x)
3 C Transfer the geometry parameters to the variable array.
4 C The positions of variables are as follows:
5 C 1. Virtual-bond torsional angles: 1 thru nres-3
6 C 2. Virtual-bond valence angles: nres-2 thru 2*nres-5
7 C 3. The polar angles alpha of local SC orientation: 2*nres-4 thru
9 C 4. The torsional angles omega of SC orientation: 2*nres-4+nside+1
10 C thru 2*nre-4+2*nside
15 include 'COMMON.CHAIN'
17 cd print *,'nres',nres,' nphi',nphi,' ntheta',ntheta,' nvar',nvar
20 cd print *,i,i-3,phi(i)
25 cd print *,i,i-2+nphi,theta(i)
27 if (n.eq.nphi+ntheta) return
29 if (ialph(i,1).gt.0) then
31 x(ialph(i,1)+nside)=omeg(i)
32 cd print *,i,ialph(i,1),ialph(i,1)+nside,alph(i),omeg(i)
37 C--------------------------------------------------------------------
38 subroutine var_to_geom(n,x)
40 C Update geometry parameters according to the variable array.
44 include 'COMMON.CHAIN'
53 if (n.eq.nphi+ntheta) return
55 alph(ialph(i,2))=x(nphi+ntheta+i)
56 omeg(ialph(i,2))=pinorm(x(nphi+ntheta+nside+i))