          SUBROUTINE ANNOTATE_OLD(LUS,ANNOTATE,BUFFER,NAME1)
C
C----------------------------------------------------------------------
C.IDENTIFICATION: Subroutine ANNOTATE_OLD
C.LIBRARY:        XASGRAPH
C.AUTHOR:         L.Chiappetti - IFCTR Milano
C.VERSIONS:       0.0 - 13 Oct 93 - Prototype
C.PURPOSE:        plot a spectrum oas solid line
C.SYNTAX:         CALL ANNOTATE_OLD(LUS,ANNOTATE,BUFFER,NAME1)
C.PARAMETERS:     INTEGER LUS(2)       : the graphics logical units
C                 CHARACTER ANNOTATE   : annotate flag (N|S|L)
C                 CHARACTER*(*) BUFFER : work buffer
C                 CHARACTER*(*) NAME1  : the XAS file name
C----------------------------------------------------------------------
C
          INTEGER LUS,IERR,TRUE_LENGTH,I,J,I70,ZC_TIME
          CHARACTER ANNOTATE,BUFFER*(*),NAME1*(*)
          INCLUDE 'pencommon.inc'

          CALL Y_COORDINATES(LUS,1)
C-->      the viewports for annotations may be later
C         controlled by external config files
          IF(ANNOTATE.EQ.'N')THEN
             RETURN      
          ELSEIF(ANNOTATE.EQ.'S')THEN
C            always write name of overwritten file on top
             CALL Y_VIEWPORT(LUS,0.0,1.0,0.98,1.0)
             CALL Y_CLEAR_VIEWPORT(LUS) 
             CALL Y_MOVE(LUS,0.05,0.00)
          ELSE
C-->         so far just write the last filename on
C            same line along to primary filename
C-->         later may either write all overwritten names
C            in a column, one below the other
C-->         or write full info in "offset" boxes          
*            CALL Y_VIEWPORT(LUS,0.5,1.0,0.1,0.45)
*            CALL Y_CLEAR_VIEWPORT(LUS) 
C-->         replaced as below to clear only the lower
C-->         part with the name (but place the name at
C-->         the right place) for overplotting residuals
             CALL Y_VIEWPORT(LUS,0.5,1.0,0.1,0.20)
             CALL Y_CLEAR_VIEWPORT(LUS) 
             CALL Y_VIEWPORT(LUS,0.5,1.0,0.1,0.45)
             CALL Y_MOVE(LUS,0.1,0.25)
          ENDIF
          CALL Y_COLOUR(LUS,PENCOMMON_TXT)
C
C       plot just file name without path            
C
        BUFFER=NAME1
        CALL DEPATH(BUFFER)
        I=TRUE_LENGTH(BUFFER)
        CALL Y_COLOUR(LUS,PENCOMMON_TXT) 
        CALL Y_TEXT(LUS,BUFFER(:I),2)
        RETURN
        END
