cleaning - unecessary files deleted
[unres.git] / source / unres / src_CSA / diff12.f
index 3d347ed..13de22e 100644 (file)
@@ -6,9 +6,64 @@ cccccccccccccccccccccccccccccccccc
       include 'COMMON.BANK'
       include 'COMMON.CHAIN'
       include 'COMMON.GEO'
+      include 'COMMON.INTERACT'
+      include 'COMMON.VAR'
       dimension aarray(mxang,maxres,mxch),
      & barray(mxang,maxres,mxch)
+      real x1(maxres),y1(maxres),z1(maxres)
+      integer n_1(maxres),L1
+      real x2(maxres),y2(maxres),z2(maxres)
+      integer n_2(maxres),L2
+      real TM,Rcomm
+      integer Lcomm
 
+
+      IF(tm_score) THEN
+
+      do k=1,numch
+       do j=2,nres-1
+        theta(j+1)=barray(1,j,k)
+        phi(j+2)=barray(2,j,k)
+        alph(j)=barray(3,j,k)
+        omeg(j)=barray(4,j,k)
+       enddo
+      enddo
+      call chainbuild
+      L1=0
+      do i=nnt,nct
+        L1=L1+1
+         n_1(L1)=L1
+         x1(L1)=c(1,i)
+         y1(L1)=c(2,i)
+         z1(L1)=c(3,i)
+      enddo
+
+      do k=1,numch
+       do j=2,nres-1
+        theta(j+1)=aarray(1,j,k)
+        phi(j+2)=aarray(2,j,k)
+        alph(j)=aarray(3,j,k)
+        omeg(j)=aarray(4,j,k)
+       enddo
+      enddo
+      call chainbuild
+      L2=0
+      do i=nnt,nct
+        L2=L2+1
+         n_2(L2)=L2
+         x2(L2)=c(1,i)
+         y2(L2)=c(2,i)
+         z2(L2)=c(3,i)
+      enddo
+
+      call TMscore(L1,x1,y1,z1,n_1,L2,x2,y2,z2,n_2,TM,Rcomm,Lcomm)
+      diff=1.0d0-TM
+
+cd      write(*,*)'TMscore=',TM,diff
+cd      write(*,*)'Number of residues in common=',Lcomm
+cd      write(*,*)'RMSD of the common residues=',Rcomm
+
+      ELSE
       diff=0.d0
       do k=1,numch
        do j=2,nres-1
@@ -21,7 +76,7 @@ c        do i=1,2
         enddo
        enddo
       enddo
-
+      ENDIF
       return
       end
 ccccccccccccccccccccccccccccccccccccccccccccccccc