anchor.diff:  
       end subroutine evolve_spawned_walkers
   
  +    subroutine do_fciqmc_spawning_attempt(rng, spawn, bloom_stats, sys, qs, nattempts_current_det, &
  +                                          cdet, determ, determ_parent, pop, imag, ispace, nspawned, nspawned_im, &
  +                                          logging_info) 
  +
  +        use dSFMT_interface, only: dSFMT_t
  +        use system, only: sys_t
  +        use qmc_data, only: qmc_state_t
  +        use logging, only: logging_t
  +        use determinants, only: det_info_t
  +        use bloom_handler, only: bloom_stats_t, accumulate_bloom_stats
  +        use semi_stoch, only: semi_stoch_t, check_if_determ
  +
  +        use excitations, only: excit_t, create_excited_det
  +        use death, only: stochastic_death
  +        use spawn_data, only: spawn_t
  +
  +        type(sys_t), intent(in) :: sys
  +        type(qmc_state_t), intent(in) :: qs
  +        type(logging_t), intent(in) :: logging_info
  +        integer, intent(in) :: nattempts_current_det, ispace
  +        type(det_info_t), intent(in) :: cdet
  +        logical, intent(in) :: determ_parent, imag
  +        integer(int_p), intent(in) :: pop
  +
  +        type(dSFMT_t), intent(inout) :: rng
  +        type(bloom_stats_t), intent(inout) :: bloom_stats
  +        type(spawn_t), intent(inout) :: spawn
  +        integer(int_p), intent(inout) :: nspawned, nspawned_im
  +        type(semi_stoch_t), intent(in) :: determ
  +
  +        type(excit_t) :: connection
  +        integer :: iparticle, space_real, space_imag
  +        integer(i0) :: f_child(sys%basis%string_len)
  +        logical :: determ_child
  +        integer(int_p) :: scratch
  +
  +        ! First, determine the particle types possibly created by spawning.
  +        ! If we have a more sophisticated approach to multiple spaces this will
  +        ! need to be changed.
  +        if (imag) then
  +            space_imag = ispace
  +            space_real = ispace - 1
  +        else
  +            space_real = ispace
  +            space_imag = ispace + 1
  +        end if
  +
  +        ! Attempt spawning and death for a single determinant in a single
  +        ! space.
  +        do iparticle = 1, nattempts_current_det
  +
  +            ! Attempt to spawn.
  +            call spawner_ptr(rng, sys, qs, qs%spawn_store%spawn%cutoff, qs%psip_list%pop_real_factor, &
  +                            cdet, pop, gen_excit_ptr, qs%trial%wfn_dat, &
  +                            logging_info, nspawned, nspawned_im, connection)
  +            if (imag) then
  +                ! If imaginary parent have to factor into resulting signs/reality.
  +                scratch = nspawned_im
  +                nspawned_im = nspawned
  +                nspawned = -scratch
  +            end if
  +
  +            ! Spawn if attempt was successful.
  +            if (nspawned /= 0_int_p) then
  +                if (determ_parent) then
  +                    call create_excited_det(sys%basis, cdet%f, connection, f_child)
  +                    determ_child = check_if_determ(determ%hash_table, determ%dets, f_child)
  +                    ! If the spawning is both from and to the deterministic space, cancel it.
  +                    if (.not. determ_child) then
  +                        call create_spawned_particle_ptr(sys%basis, qs%ref, cdet, connection, nspawned, &
  +                                                         space_real, spawn, f_child)
  +                    else
  +                        nspawned = 0_int_p
  +                    end if
  +                else
  +                    call create_spawned_particle_ptr(sys%basis, qs%ref, cdet, connection, nspawned, space_real, &
  +                                                     spawn)
  +                end if
  +                if (abs(nspawned) >= bloom_stats%nparticles_encoded) &
  +                    call accumulate_bloom_stats(bloom_stats, nspawned)
  +            end if
  +            if (nspawned_im /= 0_int_p) then
  +                call create_spawned_particle_ptr(sys%basis, qs%ref, cdet, connection, nspawned_im, space_imag, &
  +                                                     spawn)
  +                if (abs(nspawned_im) >= bloom_stats%nparticles_encoded) &
  +                    call accumulate_bloom_stats(bloom_stats, nspawned_im)
  +            end if
  +        end do
  +
  +    end subroutine do_fciqmc_spawning_attempt
  +
   end module fciqmc
  
positive.code:         character(36) :: uuid_restart
  
          logical :: soft_exit, write_restart_shift, error
          logical :: determ_parent, determ_child
  
          real :: t1, t2
  
  
negative.code:         type(json_out_t) :: js
          type(qmc_in_t) :: qmc_in_loc
  
          integer :: idet, ireport, icycle, ideterm, ierr, ispace
          integer :: iter, semi_stoch_iter
          integer(int_64) :: nattempts
          real(dp), allocatable :: nparticles_old(:)
  
  
          integer(int_p) :: nspawned, nspawned_im
          integer(int_p) ::  ndeath, ndeath_im
          integer :: nattempts_current_det, nspawn_events
          type(excit_t) :: connection
  