Error Handling Routines

The following routines are available for detecting and reporting errors:

Portability Routine Description
IERRNO Returns the last error code
GERROR Returns the IERRNO error code as a string variable
PERROR Sends an error message, preceded by a string, for the last error detected

IERRNO error codes are analogous to errno on U*X systems. The DFPORT module provides parameter definitions for many of U*X's errno names, found typically in errno.h on U*X systems.

IERRNO is updated only when an error occurs. For example, if a call to the GETC function results in an error, but two subsequent calls to PUTC succeed, a call to IERRNO returns the error for the GETC call. Examine IERRNO immediately after returning from one of the portability library routines. Other standard Fortran 90 routines might also change the value to an undefined value.

If your application uses multithreading, remember that IERRNO is set on a per-thread basis.