      SUBROUTINE climPLT60 (Y,NDATA)
C
C	it is assumed that this is
C	climatology and data will be repeated as needed to fill plot
c
c	line plots only
c
c       climplt60 allows form to be longer
c
C
C
C     PLOTS Y ARRAY VS TIME WITH DATE LABELING ON X-AXIS.
C     PLOT BEGINS XDAYS INTO AXIS. PLOT DIMENSION ARE XX BY YY.
C     Y       = ARRAY TO BE PLOTTED.
C     NDATA   = NUMBER OF DATA POINTS IN Y-ARRAY. 
C     DELTIME = TIME (MINUTES) BETWEEN DATA POINTS.
C	IF(DELTIME.EQ.0.) TIME AND DATE OF EACH POINT READ FROM TAPE8
C     DEPTH   = DEPTH OF INSTRUMENT.
C     IAXDAT  = TIME (GMT) OF ORIGIN OF X-AXIS.
C             = DAY, MONTH, YEAR OF X-AXIS ORIGIN.  
C     LAXDAT  = TIME (GMT) OF END OF X-AXIS.
C             = DAY, MONTH, YEAR OF X-AXIS END.  
C     XDAYS   = X-AXIS DISTANCE (IN DAYS) OF FIRST DATA POINT.
C     YMAX    = MAXIMUM VALUE OF Y-AXIS.  
C     YDEL    = Y-AXIS INCREMENT VALUE (FOR LABELING PURPOSES).
C		FOR Y LOG AXES YDEL substituted with INCHES/DECADE
c		computed from yy, ymax and ymin
C     XX      = LENGTH (IN INCHES) OF X-AXIS.
C     YY      = LENGTH (IN INCHES) OF Y-AXIS.
C     XNUM    = HEIGHT (IN INCHES) OF NUMBER LABELING.
C     XSYM    = SIZE OF SYMBOL.
C	XSTEP = DATE LABELING INCREMENT (DAYS)
C	        IF > 30, MONTHS WILL BE LABELED
C	        IF > 90, QUARTERS WILL BE LABELED
C	        IF > 360, YEARS WILL BE LABELED
C		IF < 0, NO NUMBERS, JUST TICKS DRAWN
C     NTYPE   = TYPE OF LINE TO PLOT -
C             = 1 SOLID LINE          : IF NTYPE NEGATIVE
C	      = 2 DOTTED LINE         : DIRECTION PLOT WILL
C             = 3 DASHED LINE         : BE MADE.
C             = 4 CONNECTED SYMBOLS   : NTYPE = -4 OR -5 NOT ALLOWED
C             = 5 UNCONNECTED SYMBOLS : WILL BECOME NTYPE = 5
c
c		for color, add multiples of 10 to NTYPE
c		0 = black,  10 = red,  20 = yellow, 30 = green, 40 = blue
c
c
C	NAX   = TYPE OF AXES TO PLOT
C	      = 0 X AND Y AXES OMITTED
C	      = 1 X AXES OMITTED
C	      = 2 X AND Y AXES PLOTTED, LOWER X AND LEFT Y LABELED
C	      = 3 BOTTOM X AXIS AND BOTH Y AXIS PLOTTED
C	      = 4 TOP X AXIS (NO LABELS) AND BOTH Y AXIS PLOTTED
C	        IF < 0 FIRST AND LAST NUMBERS OMITTED FROM Y AXIS
C		FOR LOGARITHMIC Y AXIS ADD 10 TO IABS(NAX)
C     NSYM    = TYPE OF SYMBOL TO PLOT (SEE DISSPLA MANUAL).  
C     LAB     = Y-AXIS LABEL   
C     NLAB    = NUMBER OF CHARACTERS IN LAB.
C		IF < 0 RIGHT AXIS WILL BE LABELED RATHER THAN LEFT
C
C
C	FOR NTYPE=1,2, OR 3 OUT OF BOUND POINTS WILL BE IGNORED
C	(LINE WILL HAVE GAP) if nchk=0.  If nchk=1 only data
c	with value xbad will be ignored.
C
C     PROGRAMMED BY PAUL FREITAG, MAR 84.
C
	character*40 form*60,lab
      DIMENSION Y(1),IXSTEP(2),RAT(2),JDATE(5),IXTICK(2)
      COMMON/COM1/DELTIME,IAXDAT(5),LAXDAT(5),XDAYS,XSTEP,
     *YMIN,YMAX,YDEL,XX,YY,XNUM1,XDASH,XSYM,MTYPE,NAX,NSYM
      COMMON/COM2/NLAB,LAB
	common /check/ nchk,xbad
	common /inform/form,idate(5),ldate(5)
        common /device_type/idev
	DATA RAT /1.,1./
	data jdate /2*0,1,2*0/
	IYREV=0
	IF(YMAX.LT.YMIN) IYREV=1
	XNUM=XNUM1
	IF(XNUM.LE.0.0) XNUM=.14
	ntype=mod(mtype,10)
	nclr=iabs(mtype)/10
	if(nclr.gt.4) nclr=0
	IF(NTYPE.EQ.0.OR.NTYPE.GT.3) NTYPE = 1
	IF(NTYPE.LT.-3) NTYPE = 5
	ITYPE=IABS(NTYPE)
      IF (DELTIME.EQ.0)  REWIND 8
      DX=DELTIME/1440. 
	NODATE=0
	IF(XSTEP.LT.0.0) then
	NODATE=1
	XSTEP=ABS(XSTEP)
	endif
	sstep=xstep
	nthour=0
	if(xstep.lt.1.) then
	nthour = 1./xstep +.001
	sstep=xstep
	xstep=1	
	endif
	DAYS=DELDAY(IAXDAT,LAXDAT)
	if(days.lt.2.) nthour=days*nthour+.001
	XSC=XX/DAYS
	IXTICK(1)=1
	IXTICK(2)=0
	IF(XSC.GE.0.1) IXTICK(1)='DAYS'
	IXSTEP(1)=XSTEP
	IF(XSTEP.LE.30.) GO TO 100
	IXSTEP(1)='MONT'
	IXSTEP(2)='H'
	IF(XSTEP.LE.90.) GO TO 100
	IXSTEP(1)='QUAR'
	IXSTEP(2)='TER'
	XTI=XSC*30.
	IF(XTI.GE.0.1) THEN
	IXTICK(1)='MONT'
	IXTICK(2)='H'
	ENDIF
	IF(XSTEP.LE.360.) GO TO 100
	IXSTEP(1)='YEAR'
	IXSTEP(2)=' '
	IF(XTI.GE.0.1) GO TO 100
	XTI=XSC*90.
	IF(XTI.GE.0.1) THEN
	IXTICK(1)='QUAR'
	IXTICK(2)='TER'
	ENDIF
C
C     PLOT AND Y LABEL AXIS.
C
100	IF(NAX) 101,102,102
101	CALL YAXEND('NOENDS')
102	INAX=IABS(NAX)
	ILOG=0
	IF(INAX.GT.9) THEN
	ILOG=1
	INAX=INAX-10
	ydel=yy/(alog10(ymax)-alog10(ymin))
	ELSE
	YD=INT(YDEL)
	IF(YD.EQ.YDEL) CALL YINTAX
	ENDIF
	IF(INAX.NE.0.AND.NLAB.GT.0) CALL YNAME(LAB,NLAB)
	if(nthour.ne.0.and.inax.ge.2) then
	ixtick(1)=nthour
	CALL XNAME(' ',1)
	call xnonum
	call xticks(ixtick)
	ixtick(1)=1
	endif
	IF(NLAB.LT.0) then
	CALL YNONUM
	CALL YNAME(' ',1)
	endif
	CALL YAXANG(0.)
	CALL HEIGHT(XNUM)
	IF(ILOG.EQ.0) THEN
	CALL GRAF(0.0,XSTEP,DAYS,YMIN,YDEL,YMAX)
	ELSE
	XSTP=DAYS/XX
	CALL YLOG(0.0,XSTP,YMIN,YDEL)
	ENDIF
	call reset('XNONUM')
	call reset('XNAME')
	IF(INAX.EQ.0) GO TO 110
	IF(NLAB.GT.0) THEN
	CALL YREVTK
	LAB=' '     
	NLAB=1
	CALL YNONUM
	ELSE
	CALL RESET('YNONUM')
	ENDIF
	IF(ILOG.EQ.0) THEN
	CALL YGRAXS(YMIN,YDEL,YMAX,YY,LAB,NLAB,XX,0.0)
        IF(YMIN*YMAX.LT.0.0) CALL RLVEC(0.0,0.0,DAYS,0.0,0)
	ELSE
	CALL YLGAXS(YMIN,YDEL,YY,LAB,NLAB,XX,0.0)
	ENDIF
	CALL RESET('YNONUM')
	CALL RESET('YREVTK')
C
C	PLOT DATA
C
110	go to (205,201,202,203,204) nclr+1
201	call setclr('RED')
	go to 205
202	call setclr('YELLOW')
	go to 205
203	call setclr('GREEN')
	go to 205
204	call setclr('BLUE')
	if(iabs(idev.eq.3)) call setclr('CYAN')
205	IF(ITYPE.EQ.2) CALL DOT
	IF(ITYPE.NE.3) GO TO 112
	IF(XDASH.NE.0.0) CALL MRSCOD(XDASH*2.,2,RAT)
	CALL DASH
112	IMRK=0
	IF(NTYPE.LE.3.AND.XSYM.GT.0.0) CALL THKVEC(XSYM)
       	IF(NTYPE.LE.3) GO TO 115
	IMRK=1
	IF(ITYPE.EQ.5) IMRK=-1
	CALL MARKER(NSYM)
	FAC=XSYM/.08
	IF(XSYM.NE.0.0) CALL SCLPIC(FAC)
115	IX=0
	IY=1
	IF(NDATA.LE.0) GO TO 210
c
c	line plots
c
	x0=0.0
	ix=iaxdat(4)
	jdate(5)=iaxdat(5)
	y0=y(ix)
	iflg1=1
	if(nchk.eq.0) then
	IF(IYREV.EQ.0.AND.(y0.LT.YMIN.OR.y0.GT.YMAX)) IFLG1=0
	IF(IYREV.EQ.1.AND.(y0.GT.YMIN.OR.y0.LT.YMAX)) IFLG1=0
	else
	if(y0.eq.xbad) IFLG1=0
	endif
150	IX=IX+1
	iflg2=1
	IF(IX.GT.NDATA) then
	ix=ix-12
	jdate(5)=jdate(5)+1
	endif
	jdate(4)=ix
	X1=DELDAY(IAXDAT,JDATE)
	IF(X1.GT.DAYS) x1=days
	y1=y(ix)
	if(nchk.eq.0) then
	IF(IYREV.EQ.0.AND.(Y1.LT.YMIN.OR.Y1.GT.YMAX)) IFLG2=0
	IF(IYREV.EQ.1.AND.(Y1.GT.YMIN.OR.Y1.LT.YMAX)) IFLG2=0
	else
	if(y1.eq.xbad) IFLG2=0
	endif
	IF(IFLG1.ne.0.and.VLNGTH(X0,Y0,X1,Y0).NE.0.0) 
     1	CALL RLVEC(X0,Y0,X1,Y0,0)
	IF(IFLG1*IFLG2.ne.0.and.VLNGTH(X1,Y0,X1,Y1).NE.0.0) 
     1	CALL RLVEC(X1,Y0,X1,Y1,0)
	IFLG1=IFLG2
	X0=X1
	Y0=Y1
	if(x0.lt.days) GO TO 150
C
C	PLOT DATE AXES
C
210	call setclr('FORE')
	call reset('THKVEC')
	call reset('DASH')
	call reset('DOT')
	IF(INAX.LT.2) GO TO 300
	XNUM2=XNUM+.028
	CALL HEIGHT(XNUM2)
	CALL XAXCTR
	IF (NODATE.EQ.1.or.nthour.gt.0) CALL XNONUM
	IF(IXTICK(1).NE.1.or.nthour.ne.0)CALL XTICKS(IXTICK)
	SDF=1.0-(IAXDAT(1)+IAXDAT(2)/60.)/24.
	EDF=(LAXDAT(1)+LAXDAT(2)/60.)/24.
	IF(SDF.EQ.1.0) SDF = 0.0
	call sub_date(iaxdat,jdate)
	IF(SDF.GT.0.0) CALL DATINC(jdate(3))
	SDATI=DIS_DATE(jdate(3))
	EDATI=DIS_DATE(LAXDAT(3))
	X1=SDF*XSC
	X2=EDF*XSC
	XLENG=XX-X1-X2
	IF(INAX.EQ.4) GO TO 230
	CALL VECTOR(0.0,0.0,XX,0.0,0)
        if(edati.gt.sdati) 
     1	CALL XDTAXS(SDATI,IXSTEP,EDATI,XLENG,' ',1,X1,0.0)
	IF(IAXDAT(5).NE.LAXDAT(5)) THEN
	CALL HEIGHT(XNUM2*2.)
	CALL XNONUM
	CALL XTICKS(1)
	CALL XDTAXS(SDATI,'YEAR',EDATI,XLENG,' ',1,X1,0.0)
	CALL RESET('XNONUM')
	ENDIF
	xstep=sstep
	IF(inax.gt.1.and.NTHOUR.NE.0.and.nodate.eq.0) 
     1	CALL HRLAB(nthour,xsc)
230	IF(INAX.EQ.3) GO TO 300
	IF(IXTICK(1).NE.1.or.nthour.ne.0)CALL XTICKS(IXTICK)
	CALL XREVTK
	CALL XNONUM
	CALL HEIGHT(XNUM2)
	CALL VECTOR(0.0,YY,XX,YY,0)
        if(edati.gt.sdati) 
     1	CALL XDTAXS(SDATI,IXSTEP,EDATI,XLENG,' ',1,X1,YY)
	CALL HEIGHT(XNUM2*2.)
	CALL XTICKS(1)
	IF(IAXDAT(5).NE.LAXDAT(5)) 
     1	CALL XDTAXS(SDATI,'YEAR',EDATI,XLENG,' ',1,X1,YY)
	IF(XNUM.GT.0.0) CALL HEIGHT(XNUM)
	CALL RESET('XNONUM')
	CALL RESET('XREVTK')
300	CALL XTICKS(1)
	CALL HEIGHT(XNUM)
	RETURN
        END 
