GETDATE()

Fortran version:

    INTEGER FUNCTION GETDATE( DEFAULT , PROMPT )
        INTEGER      , INTENT(IN   ) :: DEFAULT ! Default return value
        CHARACTER*(*), INTENT(IN   ) :: PROMPT  ! Prompt for user

NO C version:

Summary:

Display the PROMPT to standard output for a date in either of two formats: YYYYDDD or YYYYMMDD, and get the user's response and convert it into the corresponding value in Julian format YYYYDDD, according to EDSS/Models-3 date and time conventions. Returns DEFAULT if the user hits <RET>. Insists that the result be in the date-range [1970001,2100365], so NOT APPROPRIATE FOR LONG-PERIOD MODELING. Reprompts on error for up to 5 attempts; exits in case of more than 5 entry errors. Logs the value returned, for tracking and validation purposes.

The default is displayed in square brackets at the end of the prompt [LIKE THIS].

For Fortran-90 declarations and interface checking:

    USE M3UTILIO
    

See also GETDTTIME() for current (wall-clock) date and time, GETVAL(), GETDBLE(), GETMENU(), GETNUM(), GETREAL(), GETSTR(), and GETYN().

Preconditions:

none

Fortran Usage:

See sample programs LATLON or PRESZ for additional usage examples.
    ...
    USE M3UTILIO    !! else:  INTEGER, EXTERNAL :: GETDATE
    ...
    INTEGER     L
    ...
    L = GETDATE( 1993201, 'Enter the starting date for the run' )
    ...

C Usage:

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


Previous: DT2STR

Next: GETDTTIME

Up: Date and Time Manipulation Routines

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