anchor.diff:  c     write(*,*)'Total number structures=',n_str_all
         close(4)
   c^^^^^^^^^^^^^^^^^^^^^^^^ n_str_all done ^^^^^^^^^^^^^^^^^^^^^^^^
  +
  +cjmht we can now allocate the arrays
  +      allocate(x(Lch,n_str_all))
  +      allocate(y(Lch,n_str_all))
  +      allocate(z(Lch,n_str_all))
  +      allocate(amat(n_str_all,n_str_all))
  +cjmht check this will be sufficient for native if used for that
  +      allocate(x1(Lch),y1(Lch),z1(Lch))
  +      allocate(x2(Lch),y2(Lch),z2(Lch))
  +      allocate(nn1(Lch))
  +      allocate(nn2(Lch))
         
   cccccccccccc read native structure cccccccccccccccccccc
         i=0
  
positive.code:       n_rmsd=0
  !$OMP PARALLEL DEFAULT(NONE)
  !$OMP& SHARED(n_str,Lch,x,y,z,amat,n_rmsd,rmsd_a,rmsd2_a)
  !$OMP DO
  !$OMP& PRIVATE(i,j,k,x1,y1,z1,x2,y2,z2,nn1,nn2,TM,Rcomm,Lcomm,rmsd)
  !$OMP& REDUCTION(+:n_rmsd,rmsd_a,rmsd2_a)
  !$OMP& COLLAPSE(2)
        do i=1,n_str
           do j=1,n_str
              if (j .ge. i) then
                  if (j .eq. i) then
                      rmsd = 0.0
  
negative.code:       return
        end
  
        subroutine tm_score_all(ndim,n_str,Lch,x,y,z,amat,rmsd_delta,
       &                        rmsd_a)
        implicit none
  
        interface
        subroutine TMscore(L1,x1,y1,z1,n1,L2,x2,y2,z2,n2,TM,Rcomm,Lcomm)
            integer L1, L2
            real, allocatable, intent(inout) :: x1(:),y1(:),z1(:)
            integer, allocatable, intent(in) :: n1(:)
            real, allocatable, intent(inout) :: x2(:),y2(:),z2(:)
            integer, allocatable, intent(in) :: n2(:)
            real TM, Rcomm
            integer Lcomm
        end subroutine TMscore
        end interface
  
  !     Intent In
        integer ndim
        integer n_str ! Number of structures in use
        integer Lch ! Chain length of the structures (all same)
  c      real x(ndim,nst),y(ndim,nst),z(ndim,nst)
        real, allocatable, intent(in) :: x(:,:),y(:,:), z(:,:)
        real, allocatable, intent(inout) :: amat(:,:)
  !     Intent Out
  c      real amat(nst,nst)
        real rmsd_delta
        double precision rmsd_a
  
  