TestMCExit Function

public function TestMCExit(Iter, RDMSamplingIter) result(ExitCriterion)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Iter
integer, intent(in) :: RDMSamplingIter

Return Value logical


Contents

Source Code


Source Code

    function TestMCExit(Iter, RDMSamplingIter) result(ExitCriterion)
        integer, intent(in) :: Iter, RDMSamplingIter
        logical :: ExitCriterion

        if ((Iter > NMCyc) .and. (NMCyc /= -1)) then
            write(stdout, "(A)") "Total iteration number limit reached. Finishing FCIQMC loop..."
            ExitCriterion = .true.
        else if ((RDMSamplingIter > iSampleRDMIters) .and. (iSampleRDMIters /= -1)) then
            write(stdout, "(A)") "RDM Sampling iteration number limit reached. Finishing FCIQMC loop..."
            ExitCriterion = .true.
        else if (Iter - maxval(VaryShiftIter) >= eq_cyc .and. eq_cyc > -1 &
                 .and. all(.not. tSinglePartPhase)) then
            write(stdout, "(A)") "Equilibrated iteration number limit reached. Finishing FCIQMC loop..."
            ExitCriterion = .true.
        else
            ExitCriterion = .false.
        end if

    end function TestMCExit