Index Page
texpyr
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Procedure
Abstract
Required_Reading
Keywords
Declarations
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version

Procedure

      TEXPYR ( Time --- Expand year )
 
      SUBROUTINE TEXPYR ( YEAR )
 

Abstract

    Expand an abbreviated year to a full year specification.

Required_Reading

     None.

Keywords

     TIME

Declarations

 
      IMPLICIT NONE
      INTEGER               YEAR
 

Brief_I/O

     VARIABLE  I/O  DESCRIPTION
     --------  ---  --------------------------------------------------
     YEAR      I/O  The year of some epoch abbreviated/expanded.

Detailed_Input

     YEAR      is an "abbreviated year."  In other words the 98 of
               1998,  05 of 2005, etc.

Detailed_Output

     YEAR      is the expansion of the abbreviated year according
               to the lower bound established in the entry point
               TSETYR.  By default if YEAR is 69 to 99, the output
               is 1900 + the input value of YEAR.  If YEAR is 0 to 68
               the output value of YEAR is 2000 + the input value of
               YEAR.

               See the entry point TSETRY to modify this behavior.

Parameters

     None.

Exceptions

     Error free.

     1) If on input YEAR is not in the inclusive interval from
        0 to 99, YEAR is returned unchanged.

Files

     None.

Particulars

     This routine allows all of the SPICE time subsystem to handle
     uniformly the expansion of "abbreviated" years.  (i.e. the
     remainder after dividing the actual year by 100).

     By using this routine together with the routine TSETYR you
     can recover the actual year to associate with an abbreviation.

     The default behavior is as follows

     YEAR input      YEAR Output
     ----------      -----------
     00              2000
     01              2001
      .                .
      .                .
      .                .
     66              2066
     67              2067
     68              2068
     69              1969
      .                .
      .                .
      .                .
     99              1999

Examples

     Suppose that you use TPARTV to parse time strings and that
     you want to treat years components in the range from 0 to 99
     as being abbreviations for years in the range from
     1980 to 2079 (provided that the years are not modified by
     an ERA substring).  The code fragment below shows how you
     could go about this.

        Early in your application set up the lower bound for the
        expansion of abbreviated years.

        CALL TSETYR ( 1980 )


        After calling TPARTV or some other suitable parsing routine
        get the integer value of the year.

        YEAR = NINT( TVEC(1) )

        Having satisfied yourself that the year does not represent
        a year in the range from 99 to 1 B.C. or in the range
        from 1 to 99 A.D.  Expand Year to the appropriate value.

        IF ( YEAR .LT. 100 ) THEN

           CALL TEXPYR ( YEAR )

        END IF

Restrictions

     None.

Literature_References

     None.

Author_and_Institution

     W.L. Taber      (JPL)

Version

    SPICELIB Version 2.0.0, 18-NOV-1997 (WLT)

        The default century was change from 1950-2049 to 1969-2068

    SPICELIB Version 1.0.0, 8-APR-1996 (WLT)
Wed Apr  5 17:47:38 2017