C******************** START FILE GRFFIT.FOR ; GROUP GRFFIT ******************
C----------------------GRFUF1 SUBMODULE-----------------------
C  D. MC CUNE 23 SEP 1985 AT GARCHING
C       MAKE NEW ROUTINE "GRFFIT" BASED ON GRFUF1.
C       PLOT "FIT" CURVE, THEN INDIVIDUAL POINTS "DATA FROM
C       WHICH FIT WAS GENERATED".
C       CURRENT VERSION PLOTS THE POINTS ONLY.  FUTURE:  ERROR BARS?
C         THE NUMBER AND LOCATION OF DATA POINTS MAY BE DIFFERENT FROM
C         NO. AND LOC. OF FIT POINTS.
C
C  REWRITTEN TO USE NEW STANDARDIZED PLOTTING SUBROUTINE CALLS - DMC
C   FEB 1986
C
C
      SUBROUTINE GRFFIT(X,Y,N,IPROC,LBLY,
     1                 LBLX,ISHOT,IDEV,ZDATE,NXTR,XTRVAL,XTRLAB,
     1                 NDPT,XDPT,YDPT)
C
C   *ARGUMENTS SAME AS IN GRFUF1 WITH FOLLOWING ADDITIONS*
C
C  XDPT,YDPT  ARRAYS OF LENGTH NDPT
C    FIT DATA POINTS
C
      DIMENSION X(N),Y(N)
C
      DIMENSION XDPT(NDPT),YDPT(NDPT)
C
      CHARACTER*4 IDEV
      CHARACTER*10 LBLY(3),LBLX(3),ZDATE,XTRLAB(3)
      character*15 zshot
      CHARACTER*10 ZLBL(4),LNSMOO,LYSMOO,LYAVER,LOTHER
C
      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 GRAFXF(X,Y,N,XDPT,YDPT,NDPT,
     >      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 GRAFXF(X,Y,N,XDPT,YDPT,NDPT,
     >      ZSHOT//' '//ZDATE//' '//ZLPROC,
     >      '['//ZSCVAL//'] '//XTRLAB(1)//XTRLAB(2)//' '//XTRLAB(3),
     >      LBLY(1)//LBLY(2)//' VS. '//LBLX(1)//LBLX(2) )
      ENDIF
C
      RETURN
      	END
