pf_check_residual Subroutine

public subroutine pf_check_residual(pf, residual_converged)

Subroutine to test residuals to determine if the current processor has converged.

Arguments

Type IntentOptional AttributesName
type(pf_pfasst_t), intent(inout) :: pf
logical, intent(out) :: residual_converged

Return true if residual is below tolerances


Called by

proc~~pf_check_residual~~CalledByGraph proc~pf_check_residual pf_check_residual proc~pf_check_convergence_block pf_check_convergence_block proc~pf_check_convergence_block->proc~pf_check_residual proc~pf_block_run pf_block_run proc~pf_block_run->proc~pf_check_convergence_block proc~pf_pfasst_run pf_pfasst_run proc~pf_pfasst_run->proc~pf_block_run

Contents

Source Code


Source Code

  subroutine pf_check_residual(pf, residual_converged)
    type(pf_pfasst_t), intent(inout) :: pf
    logical,           intent(out)   :: residual_converged  !! Return true if residual is below tolerances
    
    residual_converged = .false.

    ! Check to see if relative tolerance is met
    if (pf%levels(pf%nlevels)%residual_rel < pf%rel_res_tol) then
       if (pf%debug) print*, 'DEBUG --', pf%rank, ' residual relative tol met',pf%levels(pf%nlevels)%residual_rel
       residual_converged = .true.
    end if
    ! Check to see if relative tolerance is met       
    if   (pf%levels(pf%nlevels)%residual     < pf%abs_res_tol)  then
       if (pf%debug) print*, 'DEBUG --',pf%rank, 'residual tol met',pf%levels(pf%nlevels)%residual
       residual_converged = .true.
    end if

  end subroutine pf_check_residual