get_ests_from_spawns Subroutine

public subroutine get_ests_from_spawns(ValidSpawned, proj_energy)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ValidSpawned
real(kind=dp), intent(out) :: proj_energy(lenof_sign)

Contents

Source Code


Source Code

    subroutine get_ests_from_spawns(ValidSpawned, proj_energy)

        use CalcData, only: tPreCond, tReplicaEstimates, tTruncInitiator
        use CalcData, only: tSetInitFlagsBeforeDeath
        use fcimc_helper, only: set_init_flag_spawns_to_occ

        integer, intent(in) :: ValidSpawned
        real(dp), intent(out) :: proj_energy(lenof_sign)

        if (tPreCond .or. tReplicaEstimates) then
            ! The preconditioned energy is used in perturbative estimates
            ! (and also when performing preconditioned FCIQMC).
            call set_timer(proj_e_time, 30)
            call get_proj_e_for_preconditioner(ValidSpawned, proj_energy)
            call halt_timer(proj_e_time)
        end if

        if (tReplicaEstimates) then
            call set_timer(precond_e_time, 30)
            call calc_ests_and_set_init_flags(ValidSpawned, proj_energy)
            call halt_timer(precond_e_time)
        end if

        ! With preconditiong and a time step of 1, death will kill all
        ! walkers entirely, so the initiator criterion will not be applied
        ! unless we set flags now. Do this now, unless done already in
        ! calc_ests_and_set_init_flags (for efficiency improvement).
        if (tSetInitFlagsBeforeDeath .and. (.not. tReplicaEstimates)) then
            if (tTruncInitiator) then
                call set_timer(init_flag_time, 30)
                call set_init_flag_spawns_to_occ(ValidSpawned)
                call halt_timer(init_flag_time)
            end if
        end if

    end subroutine get_ests_from_spawns