subroutine save_current_dets()
use real_time_data, only: TotPartsStorage
! routine to copy the currentDets array and all the associated
! pointers an hashtable related quantities to the 2nd temporary
! list, from which the first spawn and y(n) + k1/2 addition is done
! and the k2 spawing list is created to then use CurrentDets to go to
! the next time-step y(n+1) = y(n) + k2
character(*), parameter :: this_routine = "save_current_dets"
! save the WalkVecDets variable, i think thats the only necessary
! variable, the pointers don't count
temp_det_list(:, 1:TotWalkers) = WalkVecDets(:, 1:TotWalkers)
! for now also store the pointer, but thats not needed i guess
temp_det_pointer => temp_det_list
! and the freeslot.. although this one gets reinitialized to 0
! every iteration or not? yeah it is.. so i only have to reset it
! twice in the rt-fciqmc before the y(n) + k2 combination
! do that in the reload_current_dets routine!
! same with n_determ_states var.
! also have to save current number of determinants! (maybe totparts too?)
temp_totWalkers = TotWalkers
! And save the old TotParts value, as this might have changed and iter_data is reset
! (some weird scenario in which CalcHashTableStats is called at the end of the
! time-step and and then modifies both TotParts and iter_data correctly, but iter_data
! is reset at the beginning of the iteration, so TotParts also has to)
TotPartsStorage = TotParts
end subroutine save_current_dets