      SUBROUTINE PLOTAM(XL,TIMES,AMPLTD,SIGAMP,NPHASE,TITLE,IEB) 
C     
C     ROUTINE TO PLOT THE AMPLITUDES PRODUCED BY TASK PHASES
C     
      COMMON /PLOTFL/PLNAME
      CHARACTER PLNAME*12
      DIMENSION TIMES(1),AMPLTD(1),SIGAMP(1),DUM(4)   
      CHARACTER TITLE*80     
      YL=4.0
C
C     INITIALISE THE PLOTTING
C
c     CALL SETCC
c     CALL PLFILE(PLNAME)
c     CALL PLOTS(IERR,IDUMMY,28)
c     IF(IERR.NE.0) STOP 'ERROR ON OPENING SPOOLTEK CALL'
c     CALL FACTOR(2.54) 
c     CALL FRAME(XL+4.0,YL+4.0)
c     CALL PLOT(1.5,1.5,-3)   
c     CALL SYMBOL(0.,YL+1.5,0.2,TITLE,0.,60)  
c     CALL SCALE(TIMES,XL,NPHASE,1) 
      AMAX=0.0    
      DO 5 J=1,NPHASE   
    5 IF(AMAX.LT.AMPLTD(J))AMAX=AMPLTD(J) 
      DUM(1)=0.0  
      DUM(2)=AMAX 
c     CALL SCALE(DUM,YL,2,1)  
      AMPLTD(NPHASE+1)=DUM(3) 
      AMPLTD(NPHASE+2)=DUM(4) 
      TT=TIMES(NPHASE+1)
      TTT=TIMES(NPHASE+2)     
      YY=AMPLTD(NPHASE+1)     
      YYY=AMPLTD(NPHASE+2)    
c     CALL AXIS(0.0,0.0,'TIME (S)',-8,XL,0.,TT,TTT)   
c     CALL AXIS(0.0,YL,'TIME (S)',8,XL,0.,TT,TTT)     
c     CALL AXIS(0.,0.,'AMPLITUDE',9,YL,90.0,YY,YYY)   
c     CALL AXIS(XL,0.,'AMPLITUDE',-9,YL,90.0,YY,YYY)  
      DO 10 J=1,NPHASE  
        X=(TIMES(J)-TT)/TTT   
        Y=(AMPLTD(J)-YY)/YYY  
c       CALL SYMBOL(X,Y,0.05,1,0.0,-1)    
        IF (IEB.EQ.0) GOTO 10 
        ERROR=SIGAMP(J)/YYY   
        TOP=Y+ERROR     
        BOTTOM=Y-ERROR  
        IF(TOP.GT.YL)TOP=YL   
        IF(BOTTOM.LT.0.0)BOTTOM=0.0 
c       CALL PLOT(X+0.05,TOP,3)     
c       CALL PLOT(X-0.05,TOP,2)     
c       CALL PLOT(X,TOP,3)    
c       CALL PLOT(X,BOTTOM,2) 
c       CALL PLOT(X+0.05,BOTTOM,3)  
c       CALL PLOT(X-0.05,BOTTOM,2)  
   10 CONTINUE    
c     CALL PLOT(0.0,0.0,999) 
      RETURN
      END   
