      SUBROUTINE GETXIT (XI,YI,ZI,B,ISN,ITIME)

*** OBTAIN X,Y,Z COORDINATES IF ISN OR ITIME IS NEW

      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      IMPLICIT INTEGER (I-N)
      DIMENSION B(*)
      COMMON /LASTXT/ ISNZ,JSNZ,KSNZ,ITIMEZ,JTIMEZ,KTIMEZ

      IF (ISN.NE.ISNZ .OR. ITIME.NE.ITIMEZ) THEN
        CALL GETXYZ (XI,YI,ZI,B,ISN,ITIME)
        ISNZ = ISN
        ITIMEZ = ITIME
      ENDIF

      RETURN
      END
      SUBROUTINE GETXJT (XJ,YJ,ZJ,B,JSN,JTIME)

*** OBTAIN X,Y,Z COORDINATES IF JSN OR JTIME IS NEW

      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      IMPLICIT INTEGER (I-N)
      DIMENSION B(*)
      COMMON /LASTXT/ ISNZ,JSNZ,KSNZ,ITIMEZ,JTIMEZ,KTIMEZ

      IF (JSN.NE.JSNZ .OR. JTIME.NE.JTIMEZ) THEN
        CALL GETXYZ (XJ,YJ,ZJ,B,JSN,JTIME)
        JSNZ = JSN
        JTIMEZ = JTIME
      ENDIF

      RETURN
      END
      SUBROUTINE GETXKT (XK,YK,ZK,B,KSN,KTIME)

*** OBTAIN X,Y,Z COORDINATES IF KSN OR KTIME IS NEW

      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      IMPLICIT INTEGER (I-N)
      DIMENSION B(*)
      COMMON /LASTXT/ ISNZ,JSNZ,KSNZ,ITIMEZ,JTIMEZ,KTIMEZ

      IF (KSN.NE.KSNZ .OR. KTIME.NE.KTIMEZ) THEN
        CALL GETXYZ (XK,YK,ZK,B,KSN,KTIME)
        KSNZ = KSN
        KTIMEZ = KTIME
      ENDIF

      RETURN
      END
      SUBROUTINE GETXYZ (X,Y,Z,B,ISN,ITIME)

*** OBTAIN XYZ-CORRDINATES AT SPECIFIED TIME

      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      IMPLICIT INTEGER (I-N)
      DIMENSION B(*)

      CALL GETGLA (GLAT0,ISN,B)
      CALL GETGLO (GLON0,ISN,B)
      CALL GETMSL (GMSL0,ISN,B)
      CALL GETGH (GH0,ISN,B)
      EHT0 = GMSL0 + GH0

      CALL TCOORD (GLAT0,GLON0,EHT0,B,
     &             GLAT,GLON,EHT,ITIME,DTIME)
      CALL TOXYZ (GLAT,GLON,EHT,X,Y,Z)

      RETURN
      END
