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

Table of contents
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

     JUL2GR (Julian to Gregorian Calendar)

     SUBROUTINE JUL2GR (  YEAR, MONTH, DAY, DOY )

Abstract

     Convert Year Month and Day on the Julian Calendar
     to the Gregorian Calendar

Required_Reading

     None.

Keywords

     TIME

Declarations

     IMPLICIT NONE

     INTEGER               YEAR
     INTEGER               MONTH
     INTEGER               DAY
     INTEGER               DOY

Brief_I/O

     VARIABLE  I/O  DESCRIPTION
     --------  ---  --------------------------------------------------
     YEAR      I-O  Year  of Julian Calendar/Gregorian Calendar
     MONTH     I-O  Month of Julian Calendar/Gregorian Calendar
     DAY       I-O  Day of Month in Julian Calendar/Gregorian Calendar
     DOY        O   Day of Year in Gregorian Calendar

Detailed_Input

     YEAR     is an integer representing the year of an epoch, E, in
              the Julian proleptic calendar. Note that the year 0
              and negative values are required to represent
              years in the pre-Christian era (B.C.) A year, Y B.C.,
              should be represented as -(Y-1).  For example the year
              435 B.C. should be input as -434.

     MONTH    is an integer representing the month of some epoch, E,
              in the Julian proleptic calendar. Months
              outside the usual range from 1 to 12 are converted
              to the standard range using modular arithmetic and
              the input year is adjusted appropriately.


     DAY      is the day of the month of some epoch, E, in the Julian
              proleptic calendar.

              Note to input an epoch as the day of a year, set MONTH
              to 1 and DAY to the day of the year.

Detailed_Output

     YEAR     is an integer representing the year of the epoch, E,
              above in the Gregorian calendar. Note that the year
              0 (zero) and negative values are used to represent
              years in the pre-Christian era (B.C.) A year, Y B.C.,
              is be represented as -(Y-1).  For example the year
              435 B.C. will be returned as -434.

     MONTH    is an integer representing the month of the epoch, E,
              above in the Gregorian Calendar calendar.

     DAY      is the day of the month of the epoch, E, above in the
              Gregorian Calendar

     DOY      is the day of the year of the epoch, E, above in the
              Gregorian Calendar.

Parameters

     None.

Exceptions

     None.

Files

     None.

Particulars

     This is a mid-level utility routine to assist in the assignment
     and presentation of ancient epochs.

     The SPICE software deals primarily with epochs represented on
     in the Gregorian Calendar. However, the Gregorian calendar
     was not adopted until October 15, 1582. As a result, epochs
     prior to that time are usually represented in the Julian
     proleptic calendar.

     Formally, both calendars can be extended indefinitely forward
     and backward in time due the algorithmic nature of the
     determination of calendar representation.

     When converting "parsed" calendar epochs in the SPICE system,
     you need to first convert to the Gregorian Calendar. From that
     point the SPICE toolkit can easily convert the epoch to Julian
     date or seconds past the J2000 epoch.

     This routine allows you to take a numeric representation of
     an epoch represented in the Julian proleptic calendar and
     convert that to an epoch in the Gregorian calendar.

     To convert from Gregorian Calendar to Julian proleptic
     calendar, use the entry point GR2JUL.

Examples

     Suppose you need to find the epoch (in seconds past the
     J2000) of some ancient epoch that occurred at
     3:00 on March 4 of the year 121 B.C. And that this epoch
     is based on the Julian proleptic calendar. We first need
     to convert the Julian Calendar date to the Gregorian Calendar.

     Here's the declarations we'll need

        INTEGER               YEAR
        INTEGER               MONTH
        INTEGER               DAY
        INTEGER               DOY

        DOUBLE PRECISION      TVEC ( 6 )
        DOUBLE PRECISION      TDB

     You first need to convert the calendar date of this epoch
     integers. (We don't need to worry about the hours for a moment).

        YEAR  = -120
        MONTH =  3
        DAY   =  4

     Convert this Year, Month and Day to the Gregorian Calendar.

        CALL JUL2GR ( YEAR, MONTH, DAY, DOY )

     Now construct a time vector for use in the routine TTRANS.
     Note now we use the hour component of the epoch (the fourth
     component of the time vector TVEC).

        TVEC(1) = DBLE( YEAR )
        TVEC(2) = DBLE( MONTH )
        TVEC(3) = DBLE( DAY )
        TVEC(4) = 3.0D0
        TVEC(5) = 0.0D0
        TVEC(6) = 0.0D0

     Now the routine TTRANS can convert the time vector from
     the input YMD format to barycentric dynamical time.

        CALL TTRANS ( 'YDM', 'TDB', TVEC )

        TDB = TVEC(1)

Restrictions

     None.

Literature_References

     None.

Author_and_Institution

     N.J. Bachman       (JPL)
     J. Diaz del Rio    (ODC Space)
     W.L. Taber         (JPL)

Version

    SPICELIB Version 1.2.1, 02-OCT-2021 (JDR)

        Edited the header to comply with NAIF standard.

    SPICELIB Version 1.2.0, 26-AUG-2005 (NJB)

        Updated to remove non-standard use of duplicate arguments
        in RMAINI calls.

    SPICELIB Version 1.1.1, 23-SEP-1999 (WLT)

        Removed the unused variable DPMON.

    SPICELIB Version 1.1.0, 23-FEB-1998 (WLT)

        The routine was upgraded so that it will handle without
        error months that are outside the range from 1 to 12.

    SPICELIB Version 1.0.0, 13-MAR-1996 (WLT)
Fri Dec 31 18:36:29 2021