anchor.diff:          integer(int_p), intent(out) :: tot_pop
           logical, intent(in) :: complx
   
  -        procedure(i_get_pop_contrib), pointer :: get_pop_contrib_ptr => null()
  -
           integer :: i
   
  -        if (complx) then
  -            get_pop_contrib_ptr => get_pop_contrib_cmplx
  -        else
  -            get_pop_contrib_ptr => get_pop_contrib_real
  -        end if
  -
           ! Need to combine spaces if doing complex; we choose combining in quadrature.
  -        cumulative_pops(1) = nint(get_pop_contrib_ptr(pops(:,1), real_factor))
  +        cumulative_pops(1) = nint(get_pop_contrib(pops(:,1), real_factor, complx))
           if (D0_proc == iproc) then
               ! Let's be a bit faster: unroll loops and skip over the reference
               ! between the loops.
               do i = 2, d0_pos-1
                   cumulative_pops(i) = cumulative_pops(i-1) + &
  -                                        nint(get_pop_contrib_ptr(pops(:,i), real_factor))
  +                                        nint(get_pop_contrib(pops(:,i), real_factor, complx))
               end do
               ! Set cumulative on the reference to be the running total merely so we
               ! can continue accessing the running total from the i-1 element in the
  
positive.code:             if (d0_pos > 1) cumulative_pops(d0_pos) = cumulative_pops(d0_pos-1)
              do i = d0_pos+1, nactive
                  cumulative_pops(i) = cumulative_pops(i-1) + &
                                          nint(get_pop_contrib_ptr(pops(:,i), real_factor))
              end do
          else
              ! V simple on other processors: no reference to get in the way!
              do i = 2, nactive
                  cumulative_pops(i) = cumulative_pops(i-1) + &
                                          nint(get_pop_contrib_ptr(pops(:,i), real_factor))
              end do
          end if
          if (nactive > 0) then
  
negative.code: use const, only: i0, p, int_p
  
  implicit none
  
  contains
  
  