anchor.diff:          call check_allocate('real_population', qs%psip_list%nspaces, ierr)
           allocate(weighted_population(qs%psip_list%nspaces), stat=ierr)
           call check_allocate('weighted_population', qs%psip_list%nspaces, ierr)
  -        allocate(nattempts_current_det(qs%psip_list%nspaces), stat=ierr)
  -        call check_allocate('nattempts_current_det', qs%psip_list%nspaces, ierr)
   
           call dSFMT_init(qmc_in%seed+iproc, 50000, rng)
           if (restart_in%restart_rng .and. allocated(qs%rng_state%dsfmt_state)) then
  
positive.code:                         ! Extract the real sign from the encoded sign.
                          real_population(ispace) = real(qs%psip_list%pops(ispace,idet),p)/qs%psip_list%pop_real_factor
                          weighted_population(ispace) = importance_sampling_weight(qs%trial, cdet, real_population(ispace))
                          nattempts_current_det(ispace) = decide_nattempts(rng, real_population(ispace))
                      end do
  
                      ! If we use a weighted excitation generator where weights can be pre-calculated, need additional decoder:
                      if (qs%excit_gen_data%weight_decoder) then
                          call decoder_excit_gen_ptr(sys, cdet, qs%excit_gen_data, nattempts=sum(nattempts_current_det))
                      end if
  
                      ! If this is a deterministic state then copy its population
  
negative.code:         real(dp), allocatable :: nparticles_old(:)
  
          integer(int_p) :: ndeath
          ! [todo] - Should some of these be int_p?
          integer :: nspawn_events, nattempts_current_det_ispace
          type(excit_t) :: connection
          type(hmatel_t) :: hmatel
          real(p), allocatable :: real_population(:), weighted_population(:)
  