get_status Subroutine

private subroutine get_status(me, istat, message)

Return the status code and message from the nlesolver_type class.

Status codes

  • -1 -- Error: Invalid alpha
  • -2 -- Error: Invalid alpha_min
  • -3 -- Error: Invalid alpha_max
  • -4 -- Error: Alpha_min must be < alpha_max
  • -5 -- Error: Invalid step_mode
  • -6 -- Error solving linear system
  • -7 -- Error: More than 5 steps in the uphill direction
  • -8 -- Error: Divide by zero when computing Broyden update
  • -9 -- Error: Out of memory
  • -10 -- Error: function routine is not associated
  • -11 -- Error: gradient routine is not associated
  • -12 -- Error: backtracking linesearch c must be in range (0, 1)
  • -13 -- Error: backtracking linesearch tau must be in range (0, 1)
  • -14 -- Error: must specify grad_sparse, irow, and icol for sparsity_mode > 1
  • -15 -- Error: irow and icol must be the same length
  • -999 -- Error: class has not been initialized
  • 0 -- Class successfully initialized in initialize
  • 1 -- Required accuracy achieved
  • 2 -- Solution cannot be improved
  • 3 -- Maximum number of iterations reached
  • 4 -- Stopped by the user

Type Bound

nlesolver_type

Arguments

Type IntentOptional Attributes Name
class(nlesolver_type), intent(inout) :: me
integer, intent(out), optional :: istat

Integer status code.

character(len=:), intent(out), optional, allocatable :: message

Text status message


Source Code

    subroutine get_status(me, istat, message)

    implicit none

    class(nlesolver_type),intent(inout) :: me
    integer,intent(out),optional :: istat  !! Integer status code.
    character(len=:),allocatable,intent(out),optional :: message  !! Text status message

    if (present(istat)) istat = me%istat

    if (present(message)) then
        if (allocated(me%message)) then
            message = trim(me%message)
        else
            message = 'Error: class has not been initialized'
        end if
    end if

    end subroutine get_status