anchor.diff:              write (6,'()')
           end if
   
  +        if (.not.t_store) then
  +            ! Should tidy up and deallocate everything we allocated.
  +            call end_basis_fns()
  +        end if
  +
       end subroutine init_model_basis_fns
   
       pure function spin_symmetry(i, j) result(spin_match)
  
positive.code: 
      end subroutine write_basis_fn
  
      subroutine init_model_basis_fns()
  
          ! Produce the basis functions for model Hamiltonian systems.
          !
          ! The number of wavevectors is equal to the number of sites in the
          ! crystal cell (ie the number of k-points used to sample the FBZ of the
  
negative.code:         use errors, only: stop_all
          use parallel, only: parent
  
          logical, intent(in), optional :: store_info
  
          logical :: t_store
  
          integer :: limits(3,3), nmax(3), kp(3) ! Support a maximum of 3 dimensions.
          integer :: i, j, k, ibasis, ierr, nspatial
          type(basis_fn), allocatable, target :: tmp_basis_fns(:)
          type(basis_fn), pointer :: basis_fn_p
          integer, allocatable :: basis_fns_ranking(:)
  
          if (present(store_info)) then
              t_store = store_info
          else
              t_store = .true.
          end if
  
          ! Find basis functions.
  
  