INTEGER FUNCTION JSTEP3( JDATE, JTIME, SDATE, STIME, TSTEP )
INTEGER, INTENT(IN ) :: JDATE ! requested date YYYYDDD
INTEGER, INTENT(IN ) :: JTIME ! requested time HHMMSS
INTEGER, INTENT(IN ) :: SDATE ! starting date YYYYDDD
INTEGER, INTENT(IN ) :: STIME ! starting time HHMMSS
INTEGER, INTENT(IN ) :: TSTEP ! time step H*MMSS
int JSTEP3( int * jdate, int * jtime, int * sdate, int * stime, int * tstep ) ;
JDATE:JTIME for the timestep sequence
starting at SDATE:STIME, with time step increment
TSTEP, if JDATE:JTIME is exactly on the
timestep sequence, or -1 otherwise.
See also subroutines CURRSTEP(), LASTTIME(), and NEXTIME().
#include "iodecl3.h" if called from C.
USE M3UTILIO
Code example:
...
USE M3UTILIO ! or: INTEGER, EXTERNAL :: JSTEP3
...
INTEGER JDATE, JTIME, TSTEP ! current simulation time
INTEGER SDATE, STIME, OUTSTEP ! define output time step sequence
...
!! set SDATE:STIME:OUTSTEP for output-file timestep sequence
!! and JDATE:JTIME to the model simulation-clock
...
DO STEP = 1, NSTEPS
....
IF ( JSTEP3( JDATE, JTIME, SDATE, STIME, OUTSTEP ) .GT. 0 ) THEN
!! this is a valid time step for the output sequence:
...
END IF
CALL NEXTIME( JDATE, JTIME, TSTEP )
END DO
...
#include "iodecl3.h"
...
int jdate, jtime, sdate, stime, tstep ;
int irec ;
<type> foo[ MAXRECS ] ;
...
irec = JSTEP3( &jdate, &jtime, &sdate, &stime, &tstep ) ;
if ( irec > 0 )
{ /* jdate:jtime IS a valid element of the sequence */
foo[ irec-1 ] = ...
...
}
else{ /* jdate:jtime IS NOT a valid element of the sequence */
...
} ;
...
Up: Date-Time Manipulation Routines
To: Models-3/EDSS I/O API: The Help Pages