        SUBROUTINE MULTIPLY_RMFARF(RMFDATA,ARFDATA,
     .  EBN_LW,EBN_UP,NEBN,NEOUT)
C
C----------------------------------------------------------------------
C
C.IDENTIFICATION: Subroutine MULTIPLY_RMFARF
C.LIBRARY:        XASLIB
C.AUTHOR:         L.Chiappetti - IFCTR Milano
C.VERSIONS:       0.0 - 23 May 96 - First version
C.PURPOSE:        multiply response by effective area
C.METHOD:         plain algebra
C.SYNTAX:         CALL MULTIPLY_RMFARF(RMFDATA,ARFDATA,
C              .  EBN_LW,EBN_UP,NEBN,NEOUT)
C
C.PARAMETERS:     REAL    RMFDATA   : response matrix       (in/out)
C                 REAL    ARFDATA   : effective area vector (in)
C                 REAL    EBN_LW    : lower bounds of input energy bins
C                 REAL    EBN_UO    : upper bounds of input energy bins
C                 INTEGER NEBN      : number of input energy bins
C                 INTEGER NEOUT     : number of PHA channels
C.RESTRICTIONS:   
C.NOTES:          RMFDATA returns the product of RMF by ARF and by
C                 energy bin width (i.e. in cm2 keV)
C.FILES:          
C.REFERENCES:     
C
C----------------------------------------------------------------------
C
        INTEGER NEBN,NEOUT,I,J
        REAL RMFDATA(NEBN,NEOUT),ARFDATA(NEBN),DELTA
        REAL EBN_LW(NEBN),EBN_UP(NEBN)
C        
        WRITE(*,*)' Multiplying RMF by ARF and delta-E'
        DO 10 I=1,NEBN
C       must compute EGRID and DELTA
C-->    all to be checked
C-->    refer to code in FROMOGIP
C-->    just take the average
*       EGRID=(EBN_LW(I)+EBN_UP(I))/2
        DELTA=EBN_UP(I)-EBN_LW(I)
        DELTA=DELTA*ARFDATA(I)
        DO 9 J=1,NEOUT
        RMFDATA(I,J)=RMFDATA(I,J)*DELTA
  9     CONTINUE
 10     CONTINUE
        RETURN
        END
