linalg_error_handling Subroutine

public pure subroutine linalg_error_handling(ierr, ierr_out)

Flow control: on output flag present, return it; otherwise, halt on error

Arguments

Type IntentOptional Attributes Name
type(linalg_state_type), intent(in) :: ierr
type(linalg_state_type), intent(out), optional :: ierr_out

Source Code

     pure subroutine linalg_error_handling(ierr,ierr_out)
         type(linalg_state_type),intent(in) :: ierr
         type(linalg_state_type),optional,intent(out) :: ierr_out

         character(len=:),allocatable :: err_msg

         if (present(ierr_out)) then
             ! Return error flag
             ierr_out = ierr
         elseif (ierr%error()) then
             err_msg = ierr%print()
             error stop err_msg
         end if

     end subroutine linalg_error_handling