LOGICAL FUNCTION CLOSE3( FNAME ) CHARACTER*(*), INTENT(IN ) :: FNAME ! file name for query
int close3c( const char * fname ) ;
close3c()
is a C wrapper calling the Fortran
CLOSE3()
SHUT3(), which flushes and closes all I/O API files currently open, and
M3EXIT(), which is a program-shutdown wrapper around SHUT3().
UsingCLOSE3()
from within Models-3 related modeling code is strictly forbidden by order of Joan Novak, head EPA ORD, and Ed Bilicki, head MCNC Environmental Programs, 1995.Was added at the insistence of Todd Plessel, EPA Vis Lab, over the objections of the Models-3 Systems Architect, for use in visualizations programs only. Should not be used from within Models-3 science modules, since it will cause modularity violations with respect to what files other modules think have been opened. (There is no way in the system to keep track of how many modules are in fact using a file, and close it only after all of them have issued a
CLOSE3()
call for it.)Flushes the file with file with logical name FNAME to disk, then closes it. Returns .TRUE. or 1 if it succeeds at closing the file, or .FALSE. or 0 otherwise.
If FNAME is invalid, writes an error message indicating the nature of the problem to the log and returns a FALSE (or 0).
USE M3UTILIO
orINCLUDE 'IODECL3.EXT'
for Fortran, or
#include "iodecl3.h"
for C.FNAME must have length at most 16.
JDATE and JTIME must be expressed in terms of Models-3 date and time conventions.
FNAME must already have been opened by OPEN3() or open3c() and the I/O API must have been initialized with INIT3() or init3c() ).
... USE M3UTILIO ... ... IF ( CLOSE3( 'MYFILE' ) ) THEN !! MYFILE successfully flushed to disk, and closed. ... END IF ...
... #include "iodecl3.h" ... if ( close3c( "MYFILE" ) ) { /* MYFILE successfully flushed to disk, and closed. */ ... } ...
To: Models-3/EDSS I/O API: The Help Pages