M3ERR() and m3errc()

Fortran version:

        
    SUBROUTINE M3ERR( CALLER, JDATE, JTIME, ERRTXT, FATAL )
        CHARACTER*(*), INTENT(IN   ) :: CALLER  !  name of caller
        INTEGER      , INTENT(IN   ) :: JDATE   !  date YYYYDDD associated with error
        INTEGER      , INTENT(IN   ) :: JTIME   !  time HHMMSS  associated with error
        CHARACTER*(*), INTENT(IN   ) :: ERRTXT  !  caller-supplied error message
        LOGICAL      , INTENT(IN   ) :: FATAL   !  causes exit iff true

C version:

m3errc() is a C wrapper calling the Fortran M3ERR()
    void m3errc( const char * caller ,
                int           jdate  ,
                int           jtime  ,
                const char  * errtxt ,
                int           fatal ) ;

Summary:

Do not use: Superseded by M3EXIT() and M3WARN() .

Generates an error or warning message to the program log indicating the caller, the simulation date and time if appropriate (the date and time are omitted from the message if they are zero), and the user-supplied error text.

For fatal errors does a CALL SHUT3() to flush files to disk, etc., followed by a CALL EXIT( 2 ) to stop the program.

Models-3 standard: construct error messages and caller names so that it is possible to determine uniquely from the text of the error message the line at which the error occurred, and (to the extent possible) the nature of the error.

See also M3EXIT() and m3exitc() , M3MESG() and m3mesgc() , and M3WARN() and m3warnc().

Preconditions:

#include "iodecl3.h" if called from C.

JDATE:JTIME represented YYYYDDD:HHMMSS according to Models-3 date and time conventions , or are 0.

Fortran Usage:

    ...
    CALL M3ERR( 'myname', 0, 0, 'Trouble with FOO', .FALSE. )
C              generates warning message; no date supplied to log
        ...
    CALL M3ERR( 'myname', JDATE, JTIME, 
 &              'Corrupted vble BAR', .TRUE. )
C              generates error message with JDATE:JTIME to log,
C              calls SHUT3() and terminates program via EXIT( 2 )        
        ...

C Usage:

    ...
    #include "iodecl3.h"
    ...
    m3errc( "ME", jdate, jtime, "Bad vble 'foo'", 1 ) ;
        /*  error message followed by SHUT3(); exit( 2 ) */
    ... 


Previous: LUSTR

Next: M3EXIT

Up: Utility Routines

To: Models-3/EDSS I/O API: The Help Pages