texpyr |
Table of contents
ProcedureTEXPYR ( Time --- Expand year ) SUBROUTINE TEXPYR ( YEAR ) AbstractExpand an abbreviated year to a full year specification. Required_ReadingTIME KeywordsTIME DeclarationsIMPLICIT NONE INTEGER YEAR Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- YEAR I-O The year of some epoch abbreviated/expanded. Detailed_InputYEAR is an "abbreviated year." In other words the 98 of 1998, 05 of 2005, etc. Detailed_OutputYEAR 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. ParametersNone. ExceptionsError free. 1) If on input YEAR is not in the inclusive interval from 0 to 99, YEAR is returned unchanged. FilesNone. ParticularsThis 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 ExamplesThe numerical results shown for this example may differ across platforms. The results depend on the SPICE kernels used as input, the compiler and supporting libraries, and the machine specific arithmetic implementation. 1) Demonstrate the default behavior of routine TEXPYR and then modify it in order to set the lower bound of the expansion to 1980. Example code begins here. PROGRAM TEXPYR_EX1 IMPLICIT NONE C C Local parameters. C INTEGER NYEARS PARAMETER ( NYEARS = 10 ) C C Local variables. C INTEGER I INTEGER EXYEAR INTEGER YEARS ( NYEARS ) C C Set the input years. C DATA YEARS / 0, 1, 68, 69, 70, . 78, 79, 80, 81, 99 / C C Display the default behavior. C WRITE(*,'(A)') 'Default behavior:' WRITE(*,*) WRITE(*,'(A)') 'In Expansion' WRITE(*,'(A)') '-- ---------' DO I=1, NYEARS EXYEAR = YEARS(I) CALL TEXPYR ( EXYEAR ) WRITE(*,'(I2.2,5X,I4)') YEARS(I), EXYEAR END DO C C Set up the lower bound for the expansion of abbreviated C years to 1980. C CALL TSETYR ( 1980 ) C C Display the new behavior. C WRITE(*,*) WRITE(*,'(A)') 'Lower bound for expansion set to 1980:' WRITE(*,*) WRITE(*,'(A)') 'In Expansion' WRITE(*,'(A)') '-- ---------' DO I=1, NYEARS EXYEAR = YEARS(I) CALL TEXPYR ( EXYEAR ) WRITE(*,'(I2.2,5X,I4)') YEARS(I), EXYEAR END DO END When this program was executed on a Mac/Intel/gfortran/64-bit platform, the output was: Default behavior: In Expansion -- --------- 00 2000 01 2001 68 2068 69 1969 70 1970 78 1978 79 1979 80 1980 81 1981 99 1999 Lower bound for expansion set to 1980: In Expansion -- --------- 00 2000 01 2001 68 2068 69 2069 70 2070 78 2078 79 2079 80 1980 81 1981 99 1999 RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) W.L. Taber (JPL) VersionSPICELIB Version 2.0.1, 23-SEP-2020 (JDR) Edited the header to comply with NAIF standard. Added complete example code. Added TIME to the list of Required Readings. SPICELIB Version 2.0.0, 18-NOV-1997 (WLT) The default century was changed from 1950-2049 to 1969-2068 SPICELIB Version 1.0.0, 08-APR-1996 (WLT) |
Fri Dec 31 18:37:02 2021