INTEGER FUNCTION YEAR4( YY )
INTEGER, INTENT(IN ) :: YY
#if __hpux || _AIX
#define YEAR4 year4_
#elif __sgi || __sun || __osf__ || __mips__
#define YEAR4 year4_
#enduf
int YEAR4( const int *yy )
YY > YEAR4_BASE , YEAR4 returns YY. Otherwise,
YY must be in the range 0-99
setenv YEAR4_BASE <century> setenv YEAR4_PIVOT <year>
USE M3UTILIO
In the following, note that V is out-of-range - the call to YEAR4(V) will generate an out-of-range message and stop the program.
...
...
INTEGER YEAR4
INTEGER P, Q, R, S, T, U, V
...
( suppose defaults: YEAR4_BASE = 1900, YEAR4_PIVOT = 1970,
( P = 15, Q = 69, R = 70, S = 93, T = 1985, U = 2020, V = 111 )
WRITE (*,* ) YEAR4( P ) ! is 2015
WRITE (*,* ) YEAR4( Q ) ! is 2069
WRITE (*,* ) YEAR4( R ) ! is 1970
WRITE (*,* ) YEAR4( S ) ! is 1993
WRITE (*,* ) YEAR4( T ) ! is 1985
WRITE (*,* ) YEAR4( U ) ! is 2020
WRITE (*,* ) YEAR4( V ) ! ERROR -- generates out-of-range message
...
Up: Date-Time Manipulation Routines
To: Models-3/EDSS I/O API: The Help Pages