Constant tolerance scheduler for the Newton iteration
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(out) | :: | tol |
Tolerance to be used |
||
real(kind=sp), | intent(in) | :: | target_tol |
Target tolerance |
||
real(kind=sp), | intent(in) | :: | rnorm |
Norm of the residual of the current iterate |
||
integer, | intent(in) | :: | iter |
Newton iteration count |
||
integer, | intent(out) | :: | info |
Information flag |
subroutine constant_tol_sp(tol, target_tol, rnorm, iter, info) !! Constant tolerance scheduler for the Newton iteration real(sp), intent(out) :: tol !! Tolerance to be used real(sp), intent(in) :: target_tol !! Target tolerance real(sp), intent(in) :: rnorm !! Norm of the residual of the current iterate integer, intent(in) :: iter !! Newton iteration count integer, intent(out) :: info !! Information flag ! internals character(len=*), parameter :: this_procedure = 'constant_tol_sp' character(len=256) :: msg tol = target_tol if (target_tol < atol_sp) then tol = atol_sp write(msg,'(A,E9.2)') 'Input tolerance below atol! Resetting solver tolerance to atol= ', tol call logger%log_warning(msg, this_module, this_procedure) else write(msg,'(A,E9.2)') 'Solver tolerance set to tol= ', tol call logger%log_information(msg, this_module, this_procedure) end if return end subroutine constant_tol_sp