get_error_status Subroutine

private subroutine get_error_status(me, istat, error_msg)

Returns the current error code and message.

Type Bound

numdiff_type

Arguments

Type IntentOptional Attributes Name
class(numdiff_type), intent(in) :: me
integer, intent(out), optional :: istat

error code (istat=0 means no errors).

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

error message string.


Source Code

    subroutine get_error_status(me,istat,error_msg)

    implicit none

    class(numdiff_type),intent(in) :: me
    integer,intent(out),optional :: istat  !! error code (`istat=0` means no errors).
    character(len=:),allocatable,intent(out),optional :: error_msg !! error message string.

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

    if (present(error_msg)) then
        if (allocated(me%error_msg)) then
            error_msg = me%error_msg
        else
            error_msg = ''
        end if
    end if

    end subroutine get_error_status