rezero_iter_stats_update_cycle Subroutine

public subroutine rezero_iter_stats_update_cycle(iter_data, tot_parts_new_all)

Arguments

Type IntentOptional Attributes Name
type(fcimc_iter_data), intent(inout) :: iter_data
real(kind=dp), intent(in), dimension(lenof_sign) :: tot_parts_new_all

Contents


Source Code

    subroutine rezero_iter_stats_update_cycle(iter_data, tot_parts_new_all)

        type(fcimc_iter_data), intent(inout) :: iter_data
        real(dp), dimension(lenof_sign), intent(in) :: tot_parts_new_all

        ! Zero all of the variables which accumulate for each iteration.
        SumWalkersCyc(:) = 0.0_dp
        SpawnFromSing = 0.0_dp
        ENumCyc = 0.0_dp
        InitsENumCyc = 0.0_dp
        ENumCycAbs = 0.0_dp
        HFCyc = 0.0_dp
        cyc_proje_denominator = 0.0_dp

        ! also reset the real-time specific quantities:
        ! and maybe have to call this routine twice to rezero also the
        ! inputted iter_data for both RK steps..
        ! Reset TotWalkersOld so that it is the number of walkers now
        TotWalkersOld = TotWalkers
        TotPartsOld = TotParts

        ! Save the number at HF to use in the HFShift
        OldAllNoatHF = AllNoatHF
        !OldAllHFCyc is the average HF value for this update cycle
        OldAllHFCyc = AllHFCyc / real(StepsSft, dp)
        !OldAllAvWalkersCyc gives the average number of walkers per iteration in the last update cycle
        !TODO CMO: are these summed across real/complex?
        OldAllAvWalkersCyc = AllSumWalkersCyc / real(StepsSft, dp)

        ! Also the cumulative global variables
        AllTotWalkersOld = AllTotWalkers
        AllTotPartsOld = AllTotParts
        AllNoAbortedOld = AllNoAborted

        ! also reset the real-time specific quantities:
        ! and maybe have to call this routine twice to rezero also the
        ! inputted iter_data for both RK steps..
        iter_data_fciqmc%update_growth = 0.0_dp
        iter_data_fciqmc%update_iters = 0

        ! and the norm
        old_norm_psi = norm_psi

        ! Reset the counters
        iter_data%update_growth = 0.0_dp
        iter_data%update_iters = 0
        iter_data%tot_parts_old = tot_parts_new_all

        cont_spawn_attempts = 0
        cont_spawn_success = 0
        tfirst_cycle = .false.
        if (t_calc_double_occ) then
            call rezero_double_occ_stats()
            if (t_spin_measurements) then
                call rezero_spin_diff()
            end if
        end if

        if (t_measure_local_spin) then
            call rezero_local_spin_stats()
        end if

    end subroutine rezero_iter_stats_update_cycle