SUBROUTINE M3EXIT( CALLER, JDATE, JTIME, EXITTXT, EXITSTAT ) CHARACTER*(*) CALLER ! name of caller INTEGER JDATE ! date YYYYDDD associated with error INTEGER JTIME ! time HHMMSS associated with error CHARACTER*(*) EXITTXT ! caller-supplied error message INTEGER EXITSTAT! termination status
m3exitc() is a C wrapper calling the Fortran M3EXIT()
void m3exitc( const char * caller , int jdate , int jtime , const char * exittxt , int exitstat ) ;
Use EXITSTAT=0 to indicate normal successful completion; nonzero to indicate program failure. By convention,
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 M3ERR() and m3errc(), M3MESG() and m3mesgc(), and M3WARN() and m3warnc() .
#include "iodecl3.h"
if called from C.
JDATE:JTIME represented YYYYDDD:HHMMSS, or are 0.
USE M3UTILIO
(See sample programs LATLON or PRESZ for additional usage examples.)
... CALL M3EXIT( 'myprog:mysub', JDATE, JTIME, & 'Corrupted vble BAR', 2 ) C generates error message with JDATE:JTIME to log, C calls SHUT3() and terminates program via EXIT( 2 ) ...
... #include "iodecl3.h" ... m3exitc( "ME", jdate, jtime, "Bad vble 'foo'", 37 ) ; /* error message followed by SHUT3(); exit( 37 ) */ ...
To: Models-3/EDSS I/O API: The Help Pages