LOGICAL FUNCTION CHECK3( FNAME, VNAME, JDATE, JTIME ) CHARACTER*(*), INTENT(IN ) :: FNAME ! file name for query CHARACTER*(*), INTENT(IN ) :: VNAME ! vble name for query INTEGER , INTENT(IN ) :: JDATE ! date (YYYYDDD) for query INTEGER , INTENT(IN ) :: JTIME ! time (HHMMSS) for query
int check3c( const char * fname , const char * vname , int jdate , int jtime ) ;
check3c()
is a C wrapper calling the FortranCHECK3()
Returns .TRUE. or 1 if the time step for (JDATE,JTIME) is available in file with logical name FNAME, or .FALSE. or 0 otherwise. If FNAME is time-independent or is a dictionary file, JDATE and JTIME are ignored and only VNAME is significant. If VNAME is the "magic name" ALLVAR3 ( = 'ALL', defined in PARMS3.EXT ), or "ALL" for check3c() ), then TRUE indicates that all variables are available for the specified date and time (FALSE signifies that at least one variable is not available; quite possibly, some variables are available and some not).If either FNAME or VNAME is invalid, writes an error message indicating the nature of the problem to the log and returns a FALSE (or 0).
For Fortran-90 declarations and interface checking:USE M3UTILIO
or elseINCLUDE 'IODECL3.EXT'
for Fortran, or#include "iodecl3.h"
for C.
FNAME
andVNAME
must have length at most 16.
JDATE
andJTIME
must be expressed in terms of Models-3 date and time conventions.
FNAME
must already have been opened byOPEN3()
oropen3c()
and the I/O API must have been initialized withINIT3()
orinit3c()
).
... USE M3UTILIO ... ... IF ( CHECK3( 'MYFILE', 'HNO3', 1988021, 123000 ) ) THEN !! data-record for variable HNO3, date and time !! 12:30:00 PM Jan. 21, 1988 is available in the file !! with logical name MYFILE. ... END IF ... IF ( CHECK3( 'AFILE', 'ALL', 1988021, 123000 ) ) THEN !! data-record for every variable for date and time !! 12:30:00 PM Jan. 21, 1988 is available in the file !! with logical name AFILE. ... END IF ...
... #include "iodecl3.h" ... if ( check3c( "MYFILE", "HNO3", 1988021, 123000 ) ) { /* data-record for variable HNO3 for date and time 12:30:00 PM Jan. 21, 1988 is available in the file with logical name MYFILE */ ... } ...
To: Models-3/EDSS I/O API: The Help Pages