anchor.diff:          call check_allocate('tmat',basis_length*nbasis,ierr)
           allocate(connected_orbs(basis_length,nbasis), stat=ierr)
           call check_allocate('connected_orbs',basis_length*nbasis,ierr)
  +        allocate(connected_sites(2*ndim,nbasis), stat=ierr)
  +        call check_allocate('connected_sites',basis_length*2*ndim,ierr)
   
           tmat = 0
           connected_orbs = 0
  
positive.code: ! excitations.
  integer(i0), allocatable :: connected_orbs(:,:) ! (basis_length, nbasis)
  
  ! True if any site is its own periodic image.
  ! This is the case if one dimension (or more) has only one site per crystal
  ! cell.  If so then the an orbital can incur a kinetic interaction with itself.
  
negative.code:         if (allocated(tmat)) then
              deallocate(tmat, stat=ierr)
              call check_deallocate('tmat',ierr)
          end if
          if (allocated(connected_orbs)) then
              deallocate(connected_orbs, stat=ierr)
              call check_deallocate('connected_orbs',ierr)
          end if
          if (allocated(connected_sites)) then
              deallocate(connected_sites, stat=ierr)
              call check_deallocate('connected_sites',ierr)
          end if
  
      end subroutine end_real_space_hub
  