constant_tol_dp Subroutine

public subroutine constant_tol_dp(tol, target_tol, rnorm, iter, info)

Constant tolerance scheduler for the Newton iteration

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out) :: tol

Tolerance to be used

real(kind=dp), intent(in) :: target_tol

Target tolerance

real(kind=dp), intent(in) :: rnorm

Norm of the residual of the current iterate

integer, intent(in) :: iter

Newton iteration count

integer, intent(out) :: info

Information flag


Source Code

    subroutine constant_tol_dp(tol, target_tol, rnorm, iter, info)
        !! Constant tolerance scheduler for the Newton iteration
        real(dp), intent(out) :: tol
        !! Tolerance to be used
        real(dp), intent(in) :: target_tol
        !! Target tolerance
        real(dp), 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_dp'
        character(len=256) :: msg
        tol = target_tol
        if (target_tol < atol_dp) then
            tol = atol_dp
            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_dp