simple Program

Uses

  • program~~simple~~UsesGraph program~simple simple module~fordebug fordebug program~simple->module~fordebug fortime fortime module~fordebug->fortime iso_fortran_env iso_fortran_env module~fordebug->iso_fortran_env

Calls

program~~simple~~CallsGraph program~simple simple proc~debug_loc debug_loc program~simple->proc~debug_loc proc~reset debug%reset program~simple->proc~reset proc~set debug%set program~simple->proc~set

Variables

Type Attributes Name Initial
type(debug) :: err

Source Code

program simple
   use fordebug, only: debug, debug_loc
   implicit none

   type(debug) :: err

   print*, " "
   print*, "Running simple example..."

   ! Info: starting a numerical solve
   call err%set(&
      severity   = 3, &
      code       = 10, &
      category   = "initialization", &
      message    = "Starting Cholesky factorization", &
      location   = debug_loc(__FILE__, 9), &
      suggestion = "Proceed; this is a standard setup step." )
   call err%print()

   ! Warning: potential numerical issue
   call err%set(&
      severity   = 2, &
      code       = 20, &
      category   = "numerical-warning", &
      message    = "Matrix is not positive definite", &
      location   = "simple.f90:18", &
      suggestion = "Check matrix symmetry and eigenvalues before factorization." )
   call err%print()

   ! Error: hard failure
   call err%set(&
      severity   = 1, &
      code       = 30, &
      category   = "arithmetic-error", &
      message    = "Division by zero detected in pivot step", &
      location   = "simple.f90:27", &
      suggestion = "Ensure pivot elements are nonzero; consider partial pivoting." )
   call err%print()

   call err%reset()
end program simple