RUNSPEC()

Fortran version:

    SUBROUTINE RUNSPEC( FNAME, USEENV, SDATE, STIME, TSTEP, NRECS )
        CHARACTER(LEN=*), INTENT(IN   ) :: FNAME        !!  input file
        LOGICAL,          INTENT(IN   ) :: USEENV       !!  input file
        INTEGER,          INTENT(  OUT) :: SDATE        !!  starting date YYYYDDD
        INTEGER,          INTENT(  OUT) :: STIME        !!  starting time  H*MMSS
        INTEGER,          INTENT(  OUT) :: TSTEP        !!  time step      H*MMSS
        INTEGER,          INTENT(  OUT) :: NRECS        !!  Number of records

NO C version

Summary:

Return time step sequence SDATE:STIME:TSTEP:NRECS consistent with (and with default values from) file FNAME.

If FNAME is blank, defaults are from the current wall-clock date&time.
If FNAME is time independent, SDATE=STIME=TSTEP=0; NRECS=1
If USEENV, get values from environment variables SDATE, STIME, TSTEP, EDATE, ETIME and use them to determine the results; else prompt the user for those values.

NOTE: does not assume that FNAME is already completed (it would be an error to do so within some modeling workflows).

I/O API-3.2 or later, only.

For Fortran-90 declarations and interface checking:

    USE M3UTILIO
    
See also CURREC(), GETDATE(), GETDTTIME(), ENVINT(), GETNUM(), JSTEP3().

Preconditions:

If USEENV:
    setenv SDATE <starting date (YYYYDDD)>
    setenv STIME <starting time  (HHMMSS)>
    setenv TSTEP <time step      (H*MMSS)>
    setenv EDATE <ending date   (YYYYDDD)>
    setenv ETIME <ending date    (HHMMSS)>
    

Fortran Usage:

The following example will prompt the user for SDATE, STIME, TSTEP, EDATE, ETIME (since argument USEENV=.FALSE.), and then run accordingly:
    ...
    USE M3UTILIO
    ...
    CHARACTER, PARAMETER :: FNAME = 'METCRO2D'
    ...
    INTEGER     SDATE, STIME, TSTEP, NRECS
    INTEGER     JDATE, JTIME, N
    ...
    IF ( OPEN3( FNAME...
    ...
    CALL RUNSPEC( FNAME, .FALSE., SDATE, STIME, TSTEP, NRECS )
    ...
    JDATE = SDATE
    JTIME = STIME
    DO N = 1, NRECS     !!  main loop on time steps
        ...
        CALL NEXTIME( JDATE, JTIME, TSTEP )
    END DO              !!  end loop on timesteps
    ...

C Usage:

Don't, unless you're already very comfortable with mixed-language programming.


Previous: NEXTIME

Previous: READ4D

Next: SEC2TIME

Next: WRITE4D

Up: Date-Time Manipulation Routines

Up: Public I/O Routines

To: Models-3/EDSS I/O API: The Help Pages