C******************** START FILE GRFUF1.FOR ; GROUP GRFUF1 ******************
C----------------------GRFUF1 SUBMODULE-----------------------
C
C  REWRITTEN DMC FEB 1986 TO USE GRAFX1 SUBROUTINE
C   PART OF PROJECT TO STANDARDIZE GFLIB 2D PLOTTING ROUTINES
C
C  PLOT Y VS. X - UFILES STYLE LABELING
C
C
      SUBROUTINE GRFUF1(X,Y,N,IPROC,LBLY,
     1                 LBLX,ISHOT,IDEV,ZDATE,NXTR,XTRVAL,XTRLAB)
C
C  X(N),Y(N)  DATA TO BE PLOTTED
C   IPROC - UFILES PROCESS CODE (AS IN UF1DRD/WR CF UFILES MANUAL)
C   LBLX,LBLY 30 CHAR UFILES STYLE LABELS FOR X AND Y
C   ISHOT - SHOT NUMBER
C   IDEV - 4 CHAR "DEVICE" I.E. TOKAMAK CODE
C   ZDATE - 10 CHAR LABEL FOR DATE OF ORIGIN OF DATA
C   NXTR - .GT.0 SIGNALS PRESENCE OF "ATTACHED SCALAR DATA ITEM"
C   XTRVAL - SCALAR DATA ITEM TO BE WRITTEN AS A PLOT LABEL
C   XTRLAB - LABEL FOR SCALAR DATA ITEM
C
C
      DIMENSION X(N),Y(N)
      CHARACTER*4 IDEV
      CHARACTER*10 LBLY(3),LBLX(3),ZDATE,XTRLAB(3)
      character*15 zshot
      CHARACTER*10 LNSMOO,LYSMOO,LYAVER,LOTHER
      CHARACTER*25 ZLPROC
      CHARACTER*12 ZSCVAL
C
      DATA LNSMOO/'          '/
      DATA LYSMOO/' SMOOTHED.'/
      DATA LYAVER/' AVERAGED.'/
      DATA LOTHER/' PROCESSED'/
C
C  PREPARE CERTAIN LABELS
      ZLPROC='                         '
      IF((IPROC.EQ.1).OR.(IPROC.EQ.3)) ZLPROC(2:11)=LYAVER
      IF((IPROC.EQ.2).OR.(IPROC.EQ.3)) ZLPROC(14:23)=LYSMOO
      IF(IPROC.EQ.4) ZLPROC(2:11)=LOTHER
C
      WRITE(ZSHOT,7701) IDEV,ISHOT
 7701 FORMAT(A4,I11)
C
C  CALL COMMON PLOTTING/INTERFACE SUBROUTINE - CONSTRUCT LABELS
C   ENCODE ATTACHED SCALAR DATA ITEM IF NECESSARY
C
      IF(NXTR.EQ.0) THEN
        CALL GRAFX1(X,Y,N,LBLX(3),LBLY(3),' ',
     >      ZSHOT//' '//ZDATE//' '//ZLPROC,
     >      LBLY(1)//LBLY(2)//' VS. '//LBLX(1)//LBLX(2) )
      ELSE
C
        WRITE(ZSCVAL,1003) XTRVAL
        IF(ZSCVAL(1:1).EQ.' ') ZSCVAL(1:1)='+'
 1003 FORMAT(1PE12.5)
C
        CALL GRAFX1(X,Y,N,LBLX(3),LBLY(3),
     >      ZSHOT//' '//ZDATE//' '//ZLPROC,
     >      '['//ZSCVAL//'] '//XTRLAB(1)//XTRLAB(2)//' '//XTRLAB(3),
     >      LBLY(1)//LBLY(2)//' VS. '//LBLX(1)//LBLX(2) )
      ENDIF
C
      RETURN
      	END
C******************** END FILE GRFUF1.FOR ; GROUP GRFUF1 ******************
