      SUBROUTINE CMPTIM(GVNTIM,SCTSC,NLIN,CLCTIM)
C***********************************************************************
C    NAME- CMPTIM
C
C    LANGUAGE- FORTRAN 77    TYPE- SUBROUTINE   COMPUTER- CRAY   
C
C    VERSION- 1.0     DATE- 6/7/91   PROGRAMMER- CARLA NEIGH (SMSRC)
C    VERSION- 2.0     DATE- 5/7/96   PROGRAMMER- ALEX POZDNYAK (FDC)
C       FOR REHOSTING TO THE CRAY, CHANGED ALL I*4 DECLARATIONS TO
C       INTEGER. 
C
C    FUNCTION-  THIS SUBROUTINE COMPUTES THE TIME OF A SCAN LINE THAT
C               IS NLIN NUMBER OF SCAN LINES AWAY FROM A GIVEN SCAN
C               LINE.  IF NLIN IS NEGATIVE, THE COMPUTED TIME OCCURS
C               NLIN LINES IN TIME BEFORE THE GIVEN TIME.  IF NLIN IS
C               POSITIVE, THE COMPUTED TIME OCCURS NLIN LINES IN TIME
C               AFTER THE GIVEN TIME.
C
C    CALLING SEQUENCE PARAMETERS-
C      VARIABLE  TYPE  I/O  DESCRIPTION
C      --------  ----  ---  -----------
C      GVNTIM    INT    I   ARRAY OF GIVEN SCAN LINE TIME
C                           (IN CENTURY DAY, MILLISECOND OF DAY)
C      SCTSC     INT    I   INSTRUMENT SCAN-TO-SCAN TIME (MSEC)
C      NLIN      INT    I   NUMBER OF SCAN LINES FROM GVNTIM TO
C                           CALCULATE CLCTIM
C      CLCTIM    INT    O   CALCULATED SCAN LINE TIME
C                           (IN CENTURY DAY, MILLISECOND OF DAY)
C
C    EXIT STATES- NONE
C
C***********************************************************************
C
      INTEGER  GVNTIM(2), SCTSC, NLIN, CLCTIM(2)
C
C   INITIALIZE CLCTIM.
C
      CLCTIM(1) = 0
      CLCTIM(2) = 0
C
C   CALCULATE CLCTIM.
C
      CLCTIM(2) = GVNTIM(2) + SCTSC*(NLIN)
      IF (CLCTIM(2).GT.86400000) THEN
         CLCTIM(2) = CLCTIM(2) - 86400000
         CLCTIM(1) = GVNTIM(1) + 1
      ELSEIF (CLCTIM(2).LT.0) THEN
         CLCTIM(2) = CLCTIM(2) + 86400000
         CLCTIM(1) = GVNTIM(1) - 1
      ELSE
         CLCTIM(1) = GVNTIM(1)
      ENDIF
C
      RETURN
      END
