c enddo
if (nres.lt.2) return
if ((nres.lt.3).and.(itype(1).eq.10)) return
- if ((itype(1).ne.10).and.(itype(1).ne.21)) then
+ if ((itype(1).ne.10).and.(itype(1).ne.ntyp1)) then
do j=1,3
cc Derviative was calculated for oposite vector of side chain therefore
c there is "-" sign before gloc_sc
& dtauangle(j,1,1,3)
gcart(j,1)=gcart(j,1)+gloc_sc(1,0,icg)*
& dtauangle(j,1,2,3)
- if ((itype(2).ne.10).and.(itype(2).ne.21)) then
+ if ((itype(2).ne.10).and.(itype(2).ne.ntyp1)) then
gxcart(j,1)= gxcart(j,1)
& -gloc_sc(3,0,icg)*dtauangle(j,3,1,3)
gcart(j,1)=gcart(j,1)+gloc_sc(3,0,icg)*
endif
enddo
endif
- if ((nres.ge.3).and.(itype(3).ne.10).and.(itype(3).ne.21))
+ if ((nres.ge.3).and.(itype(3).ne.10).and.(itype(3).ne.ntyp1))
& then
do j=1,3
gcart(j,1)=gcart(j,1)+gloc_sc(2,1,icg)*dtauangle(j,2,1,4)
c Calculating the remainder of dE/ddc2
do j=1,3
- if((itype(2).ne.10).and.(itype(2).ne.21)) then
+ if((itype(2).ne.10).and.(itype(2).ne.ntyp1)) then
if (itype(1).ne.10) gxcart(j,2)=gxcart(j,2)+
& gloc_sc(3,0,icg)*dtauangle(j,3,3,3)
- if ((itype(3).ne.10).and.(nres.ge.3).and.(itype(3).ne.21)) then
+ if ((itype(3).ne.10).and.(nres.ge.3).and.(itype(3).ne.ntyp1)) then
gxcart(j,2)=gxcart(j,2)-gloc_sc(3,1,icg)*dtauangle(j,3,1,4)
cc the - above is due to different vector direction
gcart(j,2)=gcart(j,2)+gloc_sc(3,1,icg)*dtauangle(j,3,2,4)
c write(iout,*) gloc_sc(1,1,icg),dtauangle(j,1,1,4),"gx"
endif
endif
- if ((itype(1).ne.10).and.(itype(1).ne.21)) then
+ if ((itype(1).ne.10).and.(itype(1).ne.ntyp1)) then
gcart(j,2)=gcart(j,2)+gloc_sc(1,0,icg)*dtauangle(j,1,3,3)
c write(iout,*) gloc_sc(1,0,icg),dtauangle(j,1,3,3)
endif
c Setting dE/ddnres-1
if(nres.ge.4) then
do j=1,3
- if ((itype(nres-1).ne.10).and.(itype(nres-1).ne.21)) then
+ if ((itype(nres-1).ne.10).and.(itype(nres-1).ne.ntyp1)) then
gxcart(j,nres-1)=gxcart(j,nres-1)+gloc_sc(2,nres-3,icg)
& *dtauangle(j,2,3,nres)
c write (iout,*) "gxcart(nres-1)", gloc_sc(2,nres-3,icg),
gxcart(j,nres-1)=gxcart(j,nres-1)+gloc_sc(3,nres-3,icg)
& *dtauangle(j,3,3,nres)
endif
- if ((itype(nres).ne.10).and.(itype(nres).ne.21)) then
+ if ((itype(nres).ne.10).and.(itype(nres).ne.ntyp1)) then
gxcart(j,nres-1)=gxcart(j,nres-1)-gloc_sc(3,nres-2,icg)
& *dtauangle(j,3,1,nres+1)
gcart(j,nres-1)=gcart(j,nres-1)+gloc_sc(3,nres-2,icg)
& *dtauangle(j,3,2,nres+1)
endif
endif
- if ((itype(nres-2).ne.10).and.(itype(nres-2).ne.21)) then
+ if ((itype(nres-2).ne.10).and.(itype(nres-2).ne.ntyp1)) then
gcart(j,nres-1)=gcart(j,nres-1)+gloc_sc(1,nres-3,icg)*
& dtauangle(j,1,3,nres)
endif
- if ((itype(nres).ne.10).and.(itype(nres).ne.21)) then
+ if ((itype(nres).ne.10).and.(itype(nres).ne.ntyp1)) then
gcart(j,nres-1)=gcart(j,nres-1)+gloc_sc(2,nres-2,icg)*
& dtauangle(j,2,2,nres+1)
c write (iout,*) "gcart(nres-1)", gloc_sc(2,nres-2,icg),