LOGICAL FUNCTION SHUT3()
shut3c() is a C wrapper calling the Fortran SHUT3()
int shut3c( ) ;
SHUT3() and shut3c() flush to disk and close all Models-3
I/O API files currently open.
Return .TRUE. or 1, respectively, on success, and .FALSE.
or 0 on failure. Failure also generates log-messages
attempting to describe the error.
Calling INIT3() after
SHUT3()
may cause strange results on some systems. (Calls of INIT3()
subsequent to SHUT3() will generate a warning message from INIT3()
to the program log ).
Note that M3ERR() and
M3EXIT() do a
CALL SHUT3() prior to terminating a program.
USE M3UTILIO or
INCLUDE 'IODECL3.EXT'
for Fortran, or #include "iodecl3.h" for C.
I/O API must already be initialized by a call to
INIT3().
...
USE M3UTILIO
...
IF ( .NOT. SHUT3( ) ) THEN
C Unable to flush or close some file now open. How to deal
C with it?? -- probably an unrecoverable-error situation.
...
END IF
STOP
...
END
...
#include "iodecl3.h"
...
if ( ! shut3c( ) )
{
/* unrecoverable-error situation ?? */
...
exit( 2 ) ;
}
exit( 0 ) ;
}
Up: I/O API: Public Routines Up: Utility Routines
To: Models-3/EDSS I/O API: The Help Pages