do j=1,3
dcostheta(j,1,i)=-(dc_norm(j,i-1)+cost*dc_norm(j,i-2))/
& vbld(i-1)
- if (itype(i-1).ne.ntyp1) dtheta(j,1,i)=-dcostheta(j,1,i)/sint
+c if (itype(i-1).ne.ntyp1)
+ dtheta(j,1,i)=-dcostheta(j,1,i)/sint
dcostheta(j,2,i)=-(dc_norm(j,i-2)+cost*dc_norm(j,i-1))/
& vbld(i)
- if (itype(i-1).ne.ntyp1) dtheta(j,2,i)=-dcostheta(j,2,i)/sint
+c if (itype(i-1).ne.ntyp1)
+ dtheta(j,2,i)=-dcostheta(j,2,i)/sint
enddo
enddo
#if defined(MPI) && defined(PARINTDER)
#else
do i=4,nres
#endif
-c if (itype(i-1).eq.21 .or. itype(i-2).eq.21 ) cycle
+c if (itype(i-2).eq.ntyp1.or. itype(i-1).eq.ntyp1
+c & .or. itype(i).eq.ntyp1 .or. itype(i-3).eq.ntyp1) cycle
c the conventional case
sint=dsin(theta(i))
sint1=dsin(theta(i-1))
c Obtaining the gamma derivatives from sine derivative
if (phi(i).gt.-pi4.and.phi(i).le.pi4.or.
& phi(i).gt.pi34.and.phi(i).le.pi.or.
- & phi(i).gt.-pi.and.phi(i).le.-pi34) then
+ & phi(i).ge.-pi.and.phi(i).le.-pi34) then
call vecpr(dc_norm(1,i-1),dc_norm(1,i-2),vp1)
call vecpr(dc_norm(1,i-3),dc_norm(1,i-1),vp2)
call vecpr(dc_norm(1,i-3),dc_norm(1,i-2),vp3)
ctgt=cost/sint
ctgt1=cost1/sint1
cosg_inv=1.0d0/cosg
- if (itype(i-1).ne.ntyp1 .and. itype(i-2).ne.ntyp1) then
- dsinphi(j,1,i)=-sing*ctgt1*dtheta(j,1,i-1)
+c if (itype(i-1).ne.ntyp1 .and. itype(i-2).ne.ntyp1) then
+ dsinphi(j,1,i)=-sing*ctgt1*dtheta(j,1,i-1)
& -(fac0*vp1(j)+sing*dc_norm(j,i-3))*vbld_inv(i-2)
dphi(j,1,i)=cosg_inv*dsinphi(j,1,i)
dsinphi(j,2,i)=
& +(fac0*vp3(j)-sing*dc_norm(j,i-1))*vbld_inv(i)
c & +(fac0*vp3(j)-sing*dc_norm(j,i-1))*vbld_inv(i-1)
dphi(j,3,i)=cosg_inv*dsinphi(j,3,i)
- endif
+c endif
c Bug fixed 3/24/05 (AL)
enddo
c Obtaining the gamma derivatives from cosine derivative
else
do j=1,3
- if (itype(i-1).ne.ntyp1 .and. itype(i-2).ne.ntyp1) then
+c if (itype(i-1).ne.ntyp1 .and. itype(i-2).ne.ntyp1) then
dcosphi(j,1,i)=fac1*dcostheta(j,1,i-1)+fac3*
& dcostheta(j,1,i-1)-fac0*(dc_norm(j,i-1)-scalp*
& dc_norm(j,i-3))/vbld(i-2)
& dcostheta(j,2,i)-fac0*(dc_norm(j,i-3)-scalp*
& dc_norm(j,i-1))/vbld(i)
dphi(j,3,i)=-1/sing*dcosphi(j,3,i)
- endif
+c endif
enddo
endif
enddo
c Obtaining the gamma derivatives from sine derivative
if (tauangle(1,i).gt.-pi4.and.tauangle(1,i).le.pi4.or.
& tauangle(1,i).gt.pi34.and.tauangle(1,i).le.pi.or.
- & tauangle(1,i).gt.-pi.and.tauangle(1,i).le.-pi34) then
+ & tauangle(1,i).ge.-pi.and.tauangle(1,i).le.-pi34) then
call vecpr(dc_norm(1,i-1),dc_norm(1,i-2),vp1)
call vecpr(dc_norm2(1,i-2+nres),dc_norm(1,i-1),vp2)
call vecpr(dc_norm2(1,i-2+nres),dc_norm(1,i-2),vp3)
c Obtaining the gamma derivatives from sine derivative
if (tauangle(3,i).gt.-pi4.and.tauangle(3,i).le.pi4.or.
& tauangle(3,i).gt.pi34.and.tauangle(3,i).le.pi.or.
- & tauangle(3,i).gt.-pi.and.tauangle(3,i).le.-pi34) then
+ & tauangle(3,i).ge.-pi.and.tauangle(3,i).le.-pi34) then
call vecpr(dc_norm(1,i-1+nres),dc_norm(1,i-2),vp1)
call vecpr(dc_norm2(1,i-2+nres),dc_norm(1,i-1+nres),vp2)
call vecpr(dc_norm2(1,i-2+nres),dc_norm(1,i-2),vp3)
c obtaining the derivatives of omega from sines
if(omeg(i).gt.-pi4.and.omeg(i).le.pi4.or.
& omeg(i).gt.pi34.and.omeg(i).le.pi.or.
- & omeg(i).gt.-pi.and.omeg(i).le.-pi34) then
+ & omeg(i).ge.-pi.and.omeg(i).le.-pi34) then
fac15=dcos(theta(i+1))/(dsin(theta(i+1))*
& dsin(theta(i+1)))
fac16=dcos(alph(i))/(dsin(alph(i))*dsin(alph(i)))
enddo
return
end
-
+c------------------------------------------------------------
subroutine chainbuild_cart
implicit real*8 (a-h,o-z)
include 'DIMENSIONS'
#endif
do j=1,3
c(j,1)=dc(j,0)
+c c(j,1)=c(j,1)
enddo
do i=2,nres
do j=1,3
c(j,i+nres)=c(j,i)+dc(j,i+nres)
enddo
enddo
+C print *,'tutu'
c write (iout,*) "CHAINBUILD_CART"
c call cartprint
call int_from_cart1(.false.)