      SUBROUTINE BIGTICK(XX1,XX2,YY1,YY2,XLOW,XHIGH,SPAN,
     C                   XLAB,XTLEN,TYPE)
C
C PRODUCE LARGE TICK MARKS AND LABELS ALONG INDEPENDENT AXIS (TIME)
C AT USER DEFINED INTERVALS IN DAYS.  RANGE OF AXIS VALUES AND USER 
C SPECIFIED SPACING DETERMINE NUMBER OF TICK MARKS.  DEVICE 
C COORDINATES USED FOR LOCATING MARKS.
C
      CHARACTER*10 XCHAR
      INTEGER*4 XLAB,TYPE
      REAL*8 XLOW,XHIGH,XVAL,VAL,YR1,YR2,FRAC1,FRAC2
C
      Y0 = YY1 - XTLEN/2.
      Y1 = YY1 + XTLEN
      Y2 = YY2 - XTLEN
      IF (TYPE.GT.-5) THEN
       XDIFF = REAL((XHIGH-XLOW)*365.25D0)
      ELSE
       XDIFF = REAL(XHIGH-XLOW)
      END IF
      YDIFF = YY2 - YY1
      ISTOP = NINT(XDIFF/SPAN) + 1
      XVAL = XLOW
      DO 50 I=1,ISTOP
       XLIN = XX1 + (XX2-XX1) * REAL((XVAL-XLOW)/(XHIGH-XLOW))
       ERR = XVAL/XHIGH
       IF (ERR.GT.1.0) GOTO 50
C       ERR = REAL(XVAL-XHIGH)/REAL(XHIGH-XLOW)
C       IF (ERR.GT.0.0001) GOTO 50
C       IF (XVAL.GT.XHIGH) GOTO 50
       CALL MGOLINE(XLIN,YY1,XLIN,Y1)
       CALL MGOLINE(XLIN,YY2,XLIN,Y2)
       IF ( XLAB.EQ.4 ) GOTO 30
       CALL CALENDAR(XVAL,IY,ID,IH)
C BUILD SCALE STRING
       IF (TYPE.EQ.-1) WRITE(XCHAR,'(I2,I3.3)') IY,ID
       IF (TYPE.EQ.-2) WRITE(XCHAR,'(I3.3,I2.2)') ID,IH
       IF (TYPE.EQ.-3) WRITE(XCHAR,'(I3.3)') ID
       IF (TYPE.EQ.-4) WRITE(XCHAR,'(I2.2)') IH
       IF (TYPE.EQ.-5) WRITE(XCHAR,'(I2.2)') IY
       IF (TYPE.EQ.-6) WRITE(XCHAR,'(I2.2,I3.3)') IY,ID
       INUM = 0
       DO ILET=1,10
        LVAL = ICHAR(XCHAR(ILET:ILET))
        IF ( LVAL.NE.32 ) INUM = INUM + 1
       END DO
       IF ( XLAB.EQ.1.AND.I.EQ.1 ) GOTO 30
       IF ( XLAB.EQ.2.AND.I.EQ.ISTOP ) GOTO 30
       IF ( XLAB.EQ.3.AND.(I.EQ.1.OR.I.EQ.ISTOP) ) GOTO 30
       CALL MGOGRELOCATE(XLIN,Y0)
C       TYPE*,'X LABEL *'//XCHAR//'*'
       CALL MGOPUTLABEL(INUM,XCHAR,2)
   30  IF (I.EQ.ISTOP) GOTO 50
       IF (TYPE.GT.-5) THEN
C BALANCE CALENDAR ARITHMETIC ACROSS CHANGE OF YEAR
        YR1 = DBLE(INT(XVAL))
        VAL = XVAL + DBLE(SPAN) / DBLE(DAYS(XVAL))
        IF (INT(VAL).GT.INT(XVAL)) THEN
         YR2 = YR1 + 1.D0
         FRAC1 = (YR2 - XVAL) * DBLE(DAYS(XVAL))
         FRAC2 = DBLE(SPAN) - FRAC1 
         VAL = YR2 + FRAC2 / DBLE(DAYS(YR2))
        ENDIF
        XVAL = VAL
       ELSE
        XVAL = XVAL + SPAN
       END IF
   50 CONTINUE
C
      RETURN
      END
