TTTAI Subroutine

public subroutine TTTAI(tt1, tt2, tai1, tai2, j)

Time scale transformation: Terrestrial Time, TT, to International Atomic Time, TAI.

Status: canonical.

Note

TT1+TT2 is Julian Date, apportioned in any convenient way between the two arguments, for example where TT1 is the Julian Day Number and TT2 is the fraction of a day. The returned TAI1,TAI2 follow suit.

References

  • McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), IERS Technical Note No. 32, BKG (2004)

  • Explanatory Supplement to the Astronomical Almanac, P. Kenneth Seidelmann (ed), University Science Books (1992)

History

  • IAU SOFA revision: 2019 June 20

Arguments

TypeIntentOptionalAttributesName
real(kind=wp), intent(in) :: tt1

TT as a 2-part Julian Date

real(kind=wp), intent(in) :: tt2

TT as a 2-part Julian Date

real(kind=wp), intent(out) :: tai1

TAI as a 2-part Julian Date

real(kind=wp), intent(out) :: tai2

TAI as a 2-part Julian Date

integer, intent(out) :: j

Contents

Source Code


Source Code

    subroutine TTTAI ( tt1, tt2, tai1, tai2, j )

    implicit none

    real(wp),intent(in) :: tt1 !! TT as a 2-part Julian Date
    real(wp),intent(in) :: tt2 !! TT as a 2-part Julian Date
    real(wp),intent(out) :: tai1 !! TAI as a 2-part Julian Date
    real(wp),intent(out) :: tai2 !! TAI as a 2-part Julian Date
    integer,intent(out) :: j !! status:  0 = OK

    !  TT minus TAI (days).
    real(wp),parameter :: dtat = 32.184_wp/86400.0_wp

    !  Result, safeguarding precision.
    if ( abs(tt1)>abs(tt2) ) then
       tai1 = tt1
       tai2 = tt2 - dtat
    else
       tai1 = tt1 - dtat
       tai2 = tt2
    end if

    !  Status (always OK).
    j = 0

    end subroutine TTTAI