
C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LSC_MENU2ABS     **
C**************************
C
CD-Routine: Graphical output of scaling results - LSC_MENU2ABS
C This subroutine outputs statistics and the abssorption surface after 
C external scaling when no reference data set is present and an absorption 
C correction has been refined. It is called by the main programm LSCALE.
CD-end
CD-Fortran:
      SUBROUTINE LSC_MENU2ABS (MINDX, EXOUT, CUTOFF, MULTDECONV, IUN)
CD-end
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Output histograms of scaling results
C
C Author:  S. Arzt, September 1997
C
C Arguments:
C
      INTEGER MINDX
      INTEGER IUN
      REAL CUTOFF      
      LOGICAL EXOUT
      LOGICAL MULTDECONV      
CD-Parameters:
C MINDX      i (R)    The index of the Laue Integrated Reflections List     
C CUTOFF     r (R)    Outlier cutoff
C EXOUT      l (R)    Outlier exclusion flag 
C                     .true.  = exclude outliers
C                     .false. = include outliers
C MULTDECONV l (R)    multiples deconvolution flag
C                     .true.  = deconvolute multiples
C                     .false. = don't deconvolute multiples
C IUN        i (R)    Output number for log-file
CD-end
C
C====== PARAMETERS
C 
      INCLUDE 'limits.finc'
C
C====== GLOBALS:
C
      INCLUDE 'view_handles.finc'
      INCLUDE 'get_soft.finc'
      INCLUDE 'screen_params.finc'
C
C====== FUNCTION TYPES:
C
      INTEGER XDLSTR
C
C====== LOCALS:
C
      INTEGER M_REFANA
      INTEGER M_SCSTAT
      INTEGER M_ABSPLOT
      INTEGER M_MULT
      INTEGER NVIEW
      INTEGER IVH
      INTEGER IQUIT
      INTEGER IVHLIST(2)
      INTEGER ITEM
      INTEGER IERR
      LOGICAL ABSFL
      CHARACTER*19 NAMES(4)
      CHARACTER*25 QUITNAM

      DATA NAMES /'External Refinement',
     +            'Scaling Statistics',
     +            'Absorption Surface',
     +            'Multiples Analyses'/
      DATA QUITNAM /'Quit Program'/

      ABSFL = .FALSE.
      
      M_REFANA = 1
      M_SCSTAT = 2
      M_ABSPLOT = 3

 600  IF(.NOT.MULTDECONV) THEN  
         CALL XDLF_MENU_AREA_SETMENU (IVH_MENU, 3, XDLSTR(NAMES), 
     +              19, XDLSTR('External Refinement Results'), 27,
     +              XDLSTR(QUITNAM), 12, 0, IERR)
      ELSE 
         M_MULT = 4
         CALL XDLF_MENU_AREA_SETMENU (IVH_MENU, 4, XDLSTR(NAMES), 
     +              19, XDLSTR('External Refinement Results'), 27,
     +              XDLSTR(QUITNAM), 12, 0, IERR)
      END IF

      NVIEW = 1
      IVHLIST(1) = IVH_MENU
      CALL XDLF_GET_EVENTS (NVIEW, IVHLIST, IVH)
      IF (IVH.EQ.IVH_MENU) THEN
         IF (ABSFL) CALL XDLF_DELETE_VIEW_OBJECT (IVH_ABSURF, IERR)
         ABSFL = .FALSE.
         CALL XDLF_MENU_AREA_GETITEM (IVH_MENU,ITEM, IQUIT)
         IF (IQUIT.EQ.1) THEN
            RETURN
         END IF

         IF (ITEM.EQ.M_REFANA) THEN
            CALL LSC_ANALYSES(MINDX, .TRUE., -1, 1, EXOUT, CUTOFF)
            GO TO 600
         ELSE IF (ITEM.EQ.M_SCSTAT) THEN
            CALL LSC_REFSET_ANALYSES (MINDX, .FALSE., IUN)
            GO TO 600
         ELSE IF (ITEM.EQ.M_ABSPLOT) THEN
            IVH_ABSURF = 4
            CALL LSC_ABSSURFACE_PLOT (MINDX, 800, 600,
     +               64, 1.0)
            ABSFL = .TRUE.
            GO TO 600
         ELSE IF (ITEM.EQ.M_MULT) THEN
            CALL LSC_MULT_ANALYSES (MINDX)
            GO TO 600
         END IF
      END IF

      RETURN

      END
