	PROGRAM GRAPHOC_TITLE  GRAPH  Dummy main routine, Initializes database dimensions for GRUSER.C_CALLS  XGDATA7C_HISTORY R.GURULE  88Apr27  USGS, FLAGSTAFF, AZ. 86001HC_DESCRIPTION The program GRAPH is a dummy main routine which drives theGC routine GRUSER.  GRAPH interfaces with the XG software extracting the@C user requested variables and passing them on to module GRUSER.C_PAUSE@	PARAMETER (ID1= 30)	!Set to max number of columns to be allowed=C ID1 = Number of input cols (principal + ick + constraints).7C     + Number of internal use cols (up to programmer).2C     + Number of output cols (0 in this version).=	PARAMETER (ID2= 600)	!This must be 240:480:600 for IR:MW:MI.6	PARAMETER (ID3= 20)	!Number of time ranges in a list.$	INTEGER*2 IA(120, ID1), INDEX( ID2)?	EXTERNAL GRUSER		!May change this, but must do so in 3 places.	CHARACTER*16 PN	DATA PN /'GRAPH:88JUN6'/        DATA IPCF,IPR/2,-2/:	INDEX(1)=1	!Define only those databases for which program5	INDEX(2)=2	!is valid.  0 Entries must be the latter. 	INDEX(3)=3	!Locations of INDEX.6	MXNVAR = 3	!Set to max number of principal variables.7	CALL XGDATA (IA,ID1, INDEX,ID2,ID3, MXNVAR, PN,GRUSER)	STOP	END$	SUBROUTINE GRUSER (IQ,IA,NLINES,IR)@C_TITLE  GRUSER  Controls the plotting of data for module GRAPH.C_ARGUMENTSA	INTEGER IQ	       ![I] Control code variable, determines program			       !flow.C	INTEGER*2 IA(NLINES,*) ![I] Contains requested database variables.5	INTEGER NLINES	       ![I] Number of lines per page.,	INTEGER IR	       ![I] Returns status code.C_CALLS  GRAPHIT'C_HISTORY  86Feb05  R.Gurule  FlagstaffJC_DESCRIPTION  Main workhorse program of GRAPH, This routine is called by LC XGDATA, which sends the database variables to this routine.  This routine OC controls the calling sequence and delivery of variables to the main plotting C routines of GRAPH.C_VARIABLES9	INCLUDE 'RAD$INC:XXGCOM.INC/LIST'   !Uses:  NCOLP,IDCON.<                                            !Modifies: NVAR.>	INCLUDE 'RAD$INC:XXCOM.INC/LIST'    !Uses:  IOUT,ILIST,J1,J2.=                                            !Modifies:  NONE.F	INCLUDE 'RAD$INC:XXSCOM.INC/LIST'   !Uses:  MTITLE.  Modifies:  NONE.D	INCLUDE 'RAD$INC:XXDCOM.INC/LIST'   !Uses:  KDEF.  Modifies:  NONE.D	INCLUDE 'RAD$INC:XXTAE.INC/LIST'    !Uses:  LOUT.  Modifies:  NONE.C_END	INTEGER*2 KPTIME		LOGICAL LINIT 	EQUIVALENCE (KPTIME,IDCON(4,1))	REAL*4 XX(120),YY(120),ZZ(120)	INTEGER*4 IW(9)		LOGICAL LGSEQ        NVAR=2	IR=0	GO TO (100,200,300,400,500),IQC______Initialization.100	LINIT = .FALSE.1	WRITE(IOUT,*)' Principal variables: 1=X 2=Y 3=Z'/	NCOLP = 0	!Number of predefined variables = 0.	LGSEQ=.FALSE.	RETURN200	IF (LINIT) GO TO 220	LINIT = .TRUE.	IF (NVAR.LT.2) THEN	  IR=6	  GOTO 290
        ENDIF	XSCALE=KDEF(7,1)	YSCALE=KDEF(7,2)	ZSCALE=KDEF(7,3)!-----Initialize the IW array.
	IW(1) = 6
	IW(2) = 6
	IW(3) = 6        IW(4) = ILIST	5	IW(5) = LOUT                                        	IF (NVAR.LT.3) IW(3)=09	CALL GRAPHIT (1,KDEF(1,1),KDEF(1,2),KDEF(1,3),NW,IW,IER)220	CONTINUE<!-----Sequences lumped together and not first good sequence?%	IF (LUMPSQ.NE.0.AND.LGSEQ) GO TO 290
	LGSEQ=.TRUE.(	NP = 1					    !Page flag; 0=same page.'	IW(1)=0					    !Not a new curve type.(	IW(3)=40				    !Length of curve title.,	CALL GRAPHIT (2,IDUM,IDUM,MTITLE,NP,IW,IER)	IF(IER.NE.0) GOTO 80
290	RETURN300	K=0	DO 350 J=J1,J2@	IF (IA(J,KPTIME).LT.0) GO TO 350	    !Point failed constraints.	    K=K+1				    !No, save it.	    XX(K) = IA(J,1) / XSCALE	    YY(K) = IA(J,2) / YSCALE,	    IF (NVAR.GT.2) ZZ(K) = IA(J,3) / ZSCALE350	CONTINUE4	IF (K.GT.0) CALL GRAPHIT (3,XX, YY, ZZ, K, IW, IER)	IF(IER.NE.0) GOTO 80	RETURN400	CONTINUE				$!------ Insert end of sequence code.6	IF (LUMPSQ.NE.0) GOTO 9			!Sequences lumped together?.	CALL GRAPHIT (4,IDUM,IDUM,IDUM,IDUM,IDUM,IER)	IF(IER.NE.0) GOTO 80	RETURN500	CONTINUEK!-----Final processing - skip if sequences already processed independently..	CALL GRAPHIT (5,IDUM,IDUM,IDUM,IDUM,IDUM,IER)	IF(IER.NE.0) GOTO 80	RETURN!-------Graphit error section.80	WRITE(IOUT,81) IQ,IER681	FORMAT (' PLOT AT IQ=',I2,' GOT GRAPHIT ERROR=',I5)	IR=69	RETURN	END