end_iter_stats Subroutine

public subroutine end_iter_stats(TotWalkersNew)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: TotWalkersNew

Contents

Source Code


Source Code

    subroutine end_iter_stats(TotWalkersNew)
        integer, intent(in) :: TotWalkersNew
        integer :: proc, pos, i, k
        real(dp) :: sgn(lenof_sign)
        integer :: run

        ! SumWalkersCyc calculates the total number of walkers over an update
        ! cycle on each process. (used for shift update)
        call add_part_number(SumWalkersCyc)
        ! SumWalkersOut is the total walker number over an output cycle (used for acc. rate)
        call add_part_number(SumWalkersOut)

        ! Write initiator histograms if on the correct iteration.
        ! Why is this done here - before annihilation!
        if ((tHistInitPops .and. mod(iter, HistInitPopsIter) == 0) &
            .or. tPrintHighPop) then
            call FindHighPopDet(TotWalkersNew)
            if (tHistInitPops) then
                root_write(stdout, '(a)') 'Writing out the spread of the &
                                       &initiator determinant populations.'
                call WriteInitPops(iter + PreviousCycles)
            end if
        end if

    contains

        subroutine add_part_number(var)
            real(dp), intent(inout) :: var(inum_runs)

#ifdef CMPLX_
            do run = 1, inum_runs
                var(run) = var(run) + sum(TotParts(min_part_type(run):max_part_type(run)))
            end do
#else
            var = var + TotParts
#endif
        end subroutine add_part_number

    end subroutine end_iter_stats