Subroutine to test residuals to determine if the current processor has converged.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(pf_pfasst_t), | intent(inout) | :: | pf | |||
logical, | intent(out) | :: | residual_converged | Return true if residual is below tolerances |
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