ERROR_HANDLER.F90 Subprograms

Last modified: Fri Feb 11 14:23:42 2005.


List of Subprograms


Subprogram Descriptions

DISPLAY_MESSAGE

[Next Subprogram] [List of Subprograms]
 NAME:
       Display_Message

 PURPOSE:
       RECURSIVE subroutine to display messages.

 CATEGORY:
       Utility

 LANGUAGE:
       Fortran-95

 CALLING SEQUENCE:
       CALL Display_Message( Routine_Name, &
                             Message,      &
                             Error_State,  &
                             Message_Log = Message_Log )

 INPUT ARGUMENTS:
       Routine_Name: Name of the routine in which the message originated.
                     UNITS:      N/A
                     TYPE:       CHARACTER( * )
                     DIMENSION:  Scalar
                     ATTRIBUTES: INTENT( IN )

       Message:      Message text
                     UNITS:      N/A
                     TYPE:       CHARACTER( * )
                     DIMENSION:  Scalar
                     ATTRIBUTES: INTENT( IN )

       Error_State:  Flag corresponding to one of the defined error states.
                     If not, the error state is set to UNDEFINED.
                     UNITS:      N/A
                     TYPE:       INTEGER
                     DIMENSION:  Scalar
                     ATTRIBUTES: INTENT( IN )

 OPTIONAL INPUT ARGUMENTS:
       Message_Log:  Character string specifying a filename in which any
                     messages will be logged. If not specified, or if an
                     error occurs opening the log file, the default action
                     is to output messages to the screen.
                     UNITS:      N/A
                     TYPE:       CHARACTER( * )
                     DIMENSION:  Scalar
                     ATTRIBUTES: INTENT( IN ), OPTIONAL

 CALLS:
      Open_Message_Log:  Function to open the message log file.

      This routine calls itself if the optional argument Message_Log is passed
      and an error occurs opening the output log file.

 FILES ACCESSED:
      The user specified, if any, message log file.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       None.

 PROCEDURE:
       Output message format is:

         "routine name"("state description") : "message"

       For example, if an error occurs in this routine the output is:

         "DISPLAY_MESSAGE(FAILURE) : Error opening message log file"

(See Error_Handler.f90)


OPEN_MESSAGE_LOG

[Previous Subprogram] [List of Subprograms]
 NAME:
       Open_Message_Log

 PURPOSE:
       Function to open the message log file.

 CATEGORY:
       Utility

 LANGUAGE:
       Fortran-95

 CALLING SEQUENCE:
       Error_Status =  open_Message_Log( Message_Log, &  ! Input
                                         File_ID      )  ! Output

 INPUTS:
       Message_Log:  Character string specifying the filename to open.
                     UNITS:      N/A
                     TYPE:       CHARACTER( * )
                     DIMENSION:  Scalar
                     ATTRIBUTES: INTENT( IN )

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       File_ID:      Logical unit number associated with the
                     Message_Log file.
                     Return value is undefined if an error occurs.
                     UNITS:      None
                     TYPE:       INTEGER
                     DIMENSION:  Scalar
                     ATTRIBUTES: INTENT( OUT )

 OPTIONAL OUTPUTS:
       None.

 FUNCTION RESULT:
       Error_Status: The return value is an integer defining the error status.
                     The error codes are defined in the ERROR_HANDLER module.
                     If == SUCCESS the Message_Log file was successfully opened.
                        == FAILURE an unrecoverable error occurred.
                     UNITS:      N/A
                     TYPE:       INTEGER
                     DIMENSION:  Scalar

 CALLS:
      Get_Lun:       Function to return a free logical unit number for
                     file access.
                     SOURCE: FILE_UTILITY module

 SIDE EFFECTS:
       The file is opened for SEQUENTIAL, FORMATTED access with
       UNKNOWN status, position of APPEND, and action of READWRITE.
       The latter is to assuage some compilers that seem to cough
       when the specified position is APPEND and the action is WRITE.

       Hopefully all of these options will not cause an existing file
       to be inadvertantly overwritten.

 RESTRICTIONS:
       None.

(See Error_Handler.f90)