anchor.diff:  ccc   
         dimension xt(ndim),yt(ndim),zt(ndim) !temporal coordinate
         dimension x_n(ndim),y_n(ndim),z_n(ndim) !native structure
  -      dimension x(ndim,nst),y(ndim,nst),z(ndim,nst) !used structures
  -      dimension amat(nst,nst)    !RMSD matrics
  +cjmht dimension x(ndim,nst),y(ndim,nst),z(ndim,nst) !used structures
  +cjmht dimension amat(nst,nst)    !RMSD matrics
  +      real, allocatable :: x(:,:), y(:,:), z(:,:)
  +      real, allocatable :: amat(:,:)
         dimension mark(nst)       !for removing used structures
         dimension n_str_near(nst) !numbef of neighboring structures
         dimension itra(nst),istr(nst),E(nst)
  
positive.code:       
  cjmht Calculate the amat with the all-by-all scores
        if (n_para.eq.-2) then
            call tm_score_all(ndim,nst,n_str,Lch,x,y,z,amat,rmsd_delta,
       &                      rmsd_a)
        elseif (n_para.eq.-3) then
            call read_score_matrix(nst,n_str,amat,rmsd_delta, rmsd_a)
        else
            call rmsd_score_all(ndim,nst,w,n_str,Lch,x,y,z,amat,
       &                        rmsd_delta,rmsd_a)
        endif
  
  
negative.code: c        1         2         3         4         5         6         7 !
  c 345678901234567890123456789012345678901234567890123456789012345678901234567
        program cluster
  
  cjmht Need to add interfaces for all subroutines we call with allocated arrays
        interface
        subroutine tm_score_all(ndim,n_str,Lch,x,y,z,amat,rmsd_delta,
       &                        rmsd_a)
          integer ndim
          integer n_str
          integer Lch
          real, allocatable, intent(in) :: x(:,:), y(:,:), z(:,:)
          real, allocatable, intent(inout) :: amat(:,:)
           real rmsd_delta
           double precision rmsd_a
        end subroutine tm_score_all
        end interface
        interface
  
        subroutine rmsd_score_all(ndim,w,n_str,Lch,x,y,z,amat,
       &                          rmsd_delta,rmsd_a)
          integer ndim
          double precision w(ndim)
          integer n_str
          integer Lch
          real, allocatable, intent(in) :: x(:,:), y(:,:), z(:,:)
          real, allocatable, intent(inout) :: amat(:,:)
           real rmsd_delta
           double precision rmsd_a
        end subroutine rmsd_score_all
        end interface
  cjmht  end of interfaces
  
        parameter(ndim=2000)      !Length
        parameter(nst=13000)      !number of used structure, maximum allowed
  c      parameter(nst=100)      !number of used structure, maximum allowed
  