INTEGER FUNCTION GETDATE( DEFAULT , PROMPT ) INTEGER , INTENT(IN ) :: DEFAULT ! Default return value CHARACTER*(*), INTENT(IN ) :: PROMPT ! Prompt for user
Display thePROMPT
to standard output for a date in either of two formats:YYYYDDD
orYYYYMMDD
, 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. ReturnsDEFAULT
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 M3UTILIOSee also GETDTTIME() for current (wall-clock) date and time, GETVAL(), GETDBLE(), GETMENU(), GETNUM(), GETREAL(), GETSTR(), and GETYN().
none
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' ) ...
Don't, unless you're already very comfortable with mixed-language programming.
Up: Date and Time Manipulation Routines
To: Models-3/EDSS I/O API: The Help Pages