      PROGRAM TEMP
      IMPLICIT NONE
      REAL      MEAN(0:100,0:100,0:7), SIGMA(0:100,0:100,0:7)
      INTEGER   I, TOTAL, RATIO2, RATIO1
      INTEGER   ANAL_1, DIGI_1, ANAL_2, 
     &          DIGI_2, ANAL_SUM, DIGI_SUM, SUM_DIGI
      PARAMETER ( ANAL_1=1, ANAL_2=2, ANAL_SUM=3,
     &          DIGI_1=4, DIGI_2=5, DIGI_SUM=6, SUM_DIGI=7 )
      REAL      NORM_1, NORM_2
      REAL      PICK_1, PICK_2
      REAL      DIGITIZED_PICK_1, DIGITIZED_PICK_2, DIGITIZED_SUM

      TOTAL = 10000

      DO I = 0 , 7
        DO RATIO1 = 0 , 100
          DO RATIO2 = 0 , 100
            SIGMA (RATIO1,RATIO2,I) = 0
            MEAN (RATIO1,RATIO2,I) = 0
          ENDDO
        ENDDO
      ENDDO

      DO I = 1 , TOTAL

        CALL RANNOR ( NORM_1, NORM_2 )

        DO RATIO1  =  0 , 10

          PICK_1 = NORM_1 * (RATIO1/10.0)
          DIGITIZED_PICK_1 = NINT ( PICK_1 )

          DO RATIO2  =  RATIO1 , 10

            PICK_2 = NORM_2 * (RATIO2/10.0)
            DIGITIZED_PICK_2 = NINT ( PICK_2 )
            DIGITIZED_SUM = NINT ( PICK_1 + PICK_2 )

            MEAN(RATIO1,RATIO2,ANAL_1) = MEAN(RATIO1,RATIO2,ANAL_1)
     &                               + PICK_1
            SIGMA(RATIO1,RATIO2,ANAL_1) = SIGMA(RATIO1,RATIO2,ANAL_1)
     &                                +  PICK_1 **2

            MEAN(RATIO1,RATIO2,ANAL_2) = MEAN(RATIO1,RATIO2,ANAL_2)
     &                               + PICK_2
            SIGMA(RATIO1,RATIO2,ANAL_2) = SIGMA(RATIO1,RATIO2,ANAL_2)
     &                                +  PICK_2 **2

            MEAN(RATIO1,RATIO2,ANAL_SUM) = MEAN(RATIO1,RATIO2,ANAL_SUM)
     &                               + PICK_1 + PICK_2
            SIGMA(RATIO1,RATIO2,ANAL_SUM) =SIGMA(RATIO1,RATIO2,ANAL_SUM)
     &                                +  (PICK_1 + PICK_2) **2

            MEAN(RATIO1,RATIO2,DIGI_1) = MEAN(RATIO1,RATIO2,DIGI_1)
     &                                + DIGITIZED_PICK_1
            SIGMA(RATIO1,RATIO2,DIGI_1) = SIGMA(RATIO1,RATIO2,DIGI_1)
     &                                + DIGITIZED_PICK_1**2

            MEAN(RATIO1,RATIO2,DIGI_2) = MEAN(RATIO1,RATIO2,DIGI_2)
     &                                + DIGITIZED_PICK_2
            SIGMA(RATIO1,RATIO2,DIGI_2) = SIGMA(RATIO1,RATIO2,DIGI_2)
     &                                + DIGITIZED_PICK_2**2

            MEAN(RATIO1,RATIO2,DIGI_SUM) = MEAN(RATIO1,RATIO2,DIGI_SUM)
     &                             + DIGITIZED_SUM 
            SIGMA(RATIO1,RATIO2,DIGI_SUM) =SIGMA(RATIO1,RATIO2,DIGI_SUM)
     &                          + DIGITIZED_SUM**2

            MEAN(RATIO1,RATIO2,SUM_DIGI) = MEAN(RATIO1,RATIO2,SUM_DIGI)
     &                             + DIGITIZED_PICK_1+ DIGITIZED_PICK_2
            SIGMA(RATIO1,RATIO2,SUM_DIGI) =SIGMA(RATIO1,RATIO2,SUM_DIGI)
     &                          + (DIGITIZED_PICK_1+DIGITIZED_PICK_2)**2

          ENDDO

        ENDDO

      ENDDO


      DO RATIO1 = 0 , 10
        DO RATIO2  =  RATIO1 , 10

          DO I = 1 , 7
            MEAN (RATIO1,RATIO2,I) = MEAN (RATIO1,RATIO2,I)
     &                           / FLOAT(TOTAL)
            SIGMA (RATIO1,RATIO2,I) = SIGMA (RATIO1,RATIO2,I)
     &                           / FLOAT(TOTAL)
            SIGMA (RATIO1,RATIO2,I) = SIGMA (RATIO1,RATIO2,I)
     &                            - MEAN (RATIO1,RATIO2,I) **2
            SIGMA (RATIO1,RATIO2,I) = SQRT(SIGMA (RATIO1,RATIO2,I) )
          ENDDO

          WRITE ( 6, 2000, ERR=90 ) (RATIO1/10.0),(RATIO2/10.0),
     &                              (SIGMA (RATIO1,RATIO2,I), I=1,7),
     &                              100.0*(SIGMA(RATIO1,RATIO2,DIGI_SUM)
     &                                  -SIGMA(RATIO1,RATIO2,SUM_DIGI) )
     &                           /(SIGMA(RATIO1,RATIO2,SUM_DIGI)+1.E-10)


 2000     FORMAT ( ' ', 2F5.2, 7F7.2 , F7.2 )

   90     CONTINUE
          ENDDO
        ENDDO

        END
 
SET WINDOW X FROM 2 TO 9
SET LABEL SIZE 1.25
SET TITLE SIZE 2.0
SET SCALE X .2 1 Y 5 1 

SET WINDOW X FROM  1 TO  3 Y FROM  1 TO  3
SET LIMITS  XMIN 0 XMAX 1 YMIN -20 YMAX 80 

SET ORDER X  Y dummy dummy dummy  Dummy  dummy  dummy dummy dummy dummy
( 0.10  *****  44.02   8.80  2.30   2.33   0.71  1.02   0.60  0.24  0.20)
  0.20  44.96  73.32  25.83  8.37   4.62   2.91  2.60   1.68  1.40  1.14
  0.30   8.66  24.23  11.42  2.37   0.67  -0.67 -0.73  -0.88 -0.85 -0.16
  0.40   2.09   7.40   1.56 -2.47  -4.60  -5.04 -4.25  -3.41 -2.75 -1.88
  0.50   1.58   4.70   0.58 -3.85  -6.13  -5.56 -4.55  -3.40 -2.80 -1.87
  0.60   1.26   3.31   0.41 -3.82  -5.21  -4.96 -3.83  -3.15 -2.52 -2.31
  0.70   0.95   2.92  -0.12 -2.99  -4.07  -3.43 -2.46  -2.51 -2.19 -2.00
  0.80   0.97   2.27  -0.21 -2.83  -3.25  -3.17 -2.85  -3.09 -2.84 -2.40
  0.90   1.15   1.73  -0.38 -1.96  -2.43  -2.82 -3.00  -3.15 -2.48 -1.95
  1.00   0.72   1.36   0.14 -0.88  -1.93  -2.21 -2.41  -2.72 -1.91 -1.35
JOIN 1
TITLE BOTTOM '0.1'

SET WINDOW X FROM  4 TO  6 Y FROM  1 TO  3
SET LIMITS  XMIN 0 XMAX 1 YMIN -20 YMAX 80
SET ORDER X  dummy Y dummy dummy  Dummy  dummy  dummy dummy dummy dummy
  0.10  00000  44.02   8.80  2.30   2.33   0.71  1.02   0.60  0.24  0.20
  0.20  44.96  73.32  25.83  8.37   4.62   2.91  2.60   1.68  1.40  1.14
  0.30   8.66  24.23  11.42  2.37   0.67  -0.67 -0.73  -0.88 -0.85 -0.16
  0.40   2.09   7.40   1.56 -2.47  -4.60  -5.04 -4.25  -3.41 -2.75 -1.88
  0.50   1.58   4.70   0.58 -3.85  -6.13  -5.56 -4.55  -3.40 -2.80 -1.87
  0.60   1.26   3.31   0.41 -3.82  -5.21  -4.96 -3.83  -3.15 -2.52 -2.31
  0.70   0.95   2.92  -0.12 -2.99  -4.07  -3.43 -2.46  -2.51 -2.19 -2.00
  0.80   0.97   2.27  -0.21 -2.83  -3.25  -3.17 -2.85  -3.09 -2.84 -2.40
  0.90   1.15   1.73  -0.38 -1.96  -2.43  -2.82 -3.00  -3.15 -2.48 -1.95
  1.00   0.72   1.36   0.14 -0.88  -1.93  -2.21 -2.41  -2.72 -1.91 -1.35
JOIN 1
TITLE BOTTOM '0.2'

SET WINDOW X FROM  7 TO  9 Y FROM  1 TO  3
SET LIMITS  XMIN 0 XMAX 1 YMIN -20 YMAX 80
SET ORDER X  dummy dummy Y dummy  Dummy  dummy  dummy dummy dummy dummy
  0.10  00000  44.02   8.80  2.30   2.33   0.71  1.02   0.60  0.24  0.20
  0.20  44.96  73.32  25.83  8.37   4.62   2.91  2.60   1.68  1.40  1.14
  0.30   8.66  24.23  11.42  2.37   0.67  -0.67 -0.73  -0.88 -0.85 -0.16
  0.40   2.09   7.40   1.56 -2.47  -4.60  -5.04 -4.25  -3.41 -2.75 -1.88
  0.50   1.58   4.70   0.58 -3.85  -6.13  -5.56 -4.55  -3.40 -2.80 -1.87
  0.60   1.26   3.31   0.41 -3.82  -5.21  -4.96 -3.83  -3.15 -2.52 -2.31
  0.70   0.95   2.92  -0.12 -2.99  -4.07  -3.43 -2.46  -2.51 -2.19 -2.00
  0.80   0.97   2.27  -0.21 -2.83  -3.25  -3.17 -2.85  -3.09 -2.84 -2.40
  0.90   1.15   1.73  -0.38 -1.96  -2.43  -2.82 -3.00  -3.15 -2.48 -1.95
  1.00   0.72   1.36   0.14 -0.88  -1.93  -2.21 -2.41  -2.72 -1.91 -1.35
JOIN 1
TITLE BOTTOM '0.3'

SET WINDOW X FROM 10 TO 12 Y FROM  1 TO  3
SET LIMITS  XMIN 0 XMAX 1 YMIN -20 YMAX 80
SET ORDER X  dummy dummy dummy  Y Dummy  dummy  dummy dummy dummy dummy
  0.10  00000  44.02   8.80  2.30   2.33   0.71  1.02   0.60  0.24  0.20
  0.20  44.96  73.32  25.83  8.37   4.62   2.91  2.60   1.68  1.40  1.14
  0.30   8.66  24.23  11.42  2.37   0.67  -0.67 -0.73  -0.88 -0.85 -0.16
  0.40   2.09   7.40   1.56 -2.47  -4.60  -5.04 -4.25  -3.41 -2.75 -1.88
  0.50   1.58   4.70   0.58 -3.85  -6.13  -5.56 -4.55  -3.40 -2.80 -1.87
  0.60   1.26   3.31   0.41 -3.82  -5.21  -4.96 -3.83  -3.15 -2.52 -2.31
  0.70   0.95   2.92  -0.12 -2.99  -4.07  -3.43 -2.46  -2.51 -2.19 -2.00
  0.80   0.97   2.27  -0.21 -2.83  -3.25  -3.17 -2.85  -3.09 -2.84 -2.40
  0.90   1.15   1.73  -0.38 -1.96  -2.43  -2.82 -3.00  -3.15 -2.48 -1.95
  1.00   0.72   1.36   0.14 -0.88  -1.93  -2.21 -2.41  -2.72 -1.91 -1.35
JOIN 1
TITLE BOTTOM '0.4'

SET WINDOW X FROM  1 TO  3 Y FROM  4 TO  6
SET LIMITS  XMIN 0 XMAX 1 YMIN -20 YMAX 80
SET ORDER X  dummy dummy dummy  Dummy  Y dummy  dummy dummy dummy dummy
  0.10  00000  44.02   8.80  2.30   2.33   0.71  1.02   0.60  0.24  0.20
  0.20  44.96  73.32  25.83  8.37   4.62   2.91  2.60   1.68  1.40  1.14
  0.30   8.66  24.23  11.42  2.37   0.67  -0.67 -0.73  -0.88 -0.85 -0.16
  0.40   2.09   7.40   1.56 -2.47  -4.60  -5.04 -4.25  -3.41 -2.75 -1.88
  0.50   1.58   4.70   0.58 -3.85  -6.13  -5.56 -4.55  -3.40 -2.80 -1.87
  0.60   1.26   3.31   0.41 -3.82  -5.21  -4.96 -3.83  -3.15 -2.52 -2.31
  0.70   0.95   2.92  -0.12 -2.99  -4.07  -3.43 -2.46  -2.51 -2.19 -2.00
  0.80   0.97   2.27  -0.21 -2.83  -3.25  -3.17 -2.85  -3.09 -2.84 -2.40
  0.90   1.15   1.73  -0.38 -1.96  -2.43  -2.82 -3.00  -3.15 -2.48 -1.95
  1.00   0.72   1.36   0.14 -0.88  -1.93  -2.21 -2.41  -2.72 -1.91 -1.35
JOIN 1
TITLE BOTTOM '0.5'

SET WINDOW X FROM  4 TO  6 Y FROM  4 TO  6
SET LIMITS  XMIN 0 XMAX 1 YMIN -20 YMAX 80
SET ORDER X  dummy dummy dummy  Dummy  dummy  Y dummy dummy dummy dummy
  0.10  00000  44.02   8.80  2.30   2.33   0.71  1.02   0.60  0.24  0.20
  0.20  44.96  73.32  25.83  8.37   4.62   2.91  2.60   1.68  1.40  1.14
  0.30   8.66  24.23  11.42  2.37   0.67  -0.67 -0.73  -0.88 -0.85 -0.16
  0.40   2.09   7.40   1.56 -2.47  -4.60  -5.04 -4.25  -3.41 -2.75 -1.88
  0.50   1.58   4.70   0.58 -3.85  -6.13  -5.56 -4.55  -3.40 -2.80 -1.87
  0.60   1.26   3.31   0.41 -3.82  -5.21  -4.96 -3.83  -3.15 -2.52 -2.31
  0.70   0.95   2.92  -0.12 -2.99  -4.07  -3.43 -2.46  -2.51 -2.19 -2.00
  0.80   0.97   2.27  -0.21 -2.83  -3.25  -3.17 -2.85  -3.09 -2.84 -2.40
  0.90   1.15   1.73  -0.38 -1.96  -2.43  -2.82 -3.00  -3.15 -2.48 -1.95
  1.00   0.72   1.36   0.14 -0.88  -1.93  -2.21 -2.41  -2.72 -1.91 -1.35
JOIN 1
TITLE BOTTOM '0.6'

SET WINDOW X FROM  7 TO  9 Y FROM  4 TO  6
SET LIMITS  XMIN 0 XMAX 1 YMIN -20 YMAX 80
SET ORDER X  dummy dummy dummy  Dummy  dummy  dummy Y dummy dummy dummy
  0.10  00000  44.02   8.80  2.30   2.33   0.71  1.02   0.60  0.24  0.20
  0.20  44.96  73.32  25.83  8.37   4.62   2.91  2.60   1.68  1.40  1.14
  0.30   8.66  24.23  11.42  2.37   0.67  -0.67 -0.73  -0.88 -0.85 -0.16
  0.40   2.09   7.40   1.56 -2.47  -4.60  -5.04 -4.25  -3.41 -2.75 -1.88
  0.50   1.58   4.70   0.58 -3.85  -6.13  -5.56 -4.55  -3.40 -2.80 -1.87
  0.60   1.26   3.31   0.41 -3.82  -5.21  -4.96 -3.83  -3.15 -2.52 -2.31
  0.70   0.95   2.92  -0.12 -2.99  -4.07  -3.43 -2.46  -2.51 -2.19 -2.00
  0.80   0.97   2.27  -0.21 -2.83  -3.25  -3.17 -2.85  -3.09 -2.84 -2.40
  0.90   1.15   1.73  -0.38 -1.96  -2.43  -2.82 -3.00  -3.15 -2.48 -1.95
  1.00   0.72   1.36   0.14 -0.88  -1.93  -2.21 -2.41  -2.72 -1.91 -1.35
JOIN 1
TITLE BOTTOM '0.7'

SET WINDOW X FROM 10 TO 12 Y FROM  4 TO  6
SET LIMITS  XMIN 0 XMAX 1 YMIN -20 YMAX 80
SET ORDER X  dummy dummy dummy  Dummy  dummy  dummy dummy Y dummy dummy
  0.10  00000  44.02   8.80  2.30   2.33   0.71  1.02   0.60  0.24  0.20
  0.20  44.96  73.32  25.83  8.37   4.62   2.91  2.60   1.68  1.40  1.14
  0.30   8.66  24.23  11.42  2.37   0.67  -0.67 -0.73  -0.88 -0.85 -0.16
  0.40   2.09   7.40   1.56 -2.47  -4.60  -5.04 -4.25  -3.41 -2.75 -1.88
  0.50   1.58   4.70   0.58 -3.85  -6.13  -5.56 -4.55  -3.40 -2.80 -1.87
  0.60   1.26   3.31   0.41 -3.82  -5.21  -4.96 -3.83  -3.15 -2.52 -2.31
  0.70   0.95   2.92  -0.12 -2.99  -4.07  -3.43 -2.46  -2.51 -2.19 -2.00
  0.80   0.97   2.27  -0.21 -2.83  -3.25  -3.17 -2.85  -3.09 -2.84 -2.40
  0.90   1.15   1.73  -0.38 -1.96  -2.43  -2.82 -3.00  -3.15 -2.48 -1.95
  1.00   0.72   1.36   0.14 -0.88  -1.93  -2.21 -2.41  -2.72 -1.91 -1.35
JOIN 1
TITLE BOTTOM '0.8'

SET WINDOW X FROM  1 TO  3 Y FROM  7 TO  9
SET LIMITS  XMIN 0 XMAX 1 YMIN -20 YMAX 80
SET ORDER X  dummy dummy dummy  Dummy  dummy  dummy dummy dummy Y dummy
  0.10  00000  44.02   8.80  2.30   2.33   0.71  1.02   0.60  0.24  0.20
  0.20  44.96  73.32  25.83  8.37   4.62   2.91  2.60   1.68  1.40  1.14
  0.30   8.66  24.23  11.42  2.37   0.67  -0.67 -0.73  -0.88 -0.85 -0.16
  0.40   2.09   7.40   1.56 -2.47  -4.60  -5.04 -4.25  -3.41 -2.75 -1.88
  0.50   1.58   4.70   0.58 -3.85  -6.13  -5.56 -4.55  -3.40 -2.80 -1.87
  0.60   1.26   3.31   0.41 -3.82  -5.21  -4.96 -3.83  -3.15 -2.52 -2.31
  0.70   0.95   2.92  -0.12 -2.99  -4.07  -3.43 -2.46  -2.51 -2.19 -2.00
  0.80   0.97   2.27  -0.21 -2.83  -3.25  -3.17 -2.85  -3.09 -2.84 -2.40
  0.90   1.15   1.73  -0.38 -1.96  -2.43  -2.82 -3.00  -3.15 -2.48 -1.95
  1.00   0.72   1.36   0.14 -0.88  -1.93  -2.21 -2.41  -2.72 -1.91 -1.35
JOIN 1
TITLE BOTTOM '0.9'

SET WINDOW X FROM  4 TO  6 Y FROM  7 TO  9
SET LIMITS  XMIN 0 XMAX 1 YMIN -20 YMAX 80
SET ORDER X  dummy dummy dummy  Dummy  dummy  dummy dummy dummy dummy  Y
  0.10  00000  44.02   8.80  2.30   2.33   0.71  1.02   0.60  0.24  0.20
  0.20  44.96  73.32  25.83  8.37   4.62   2.91  2.60   1.68  1.40  1.14
  0.30   8.66  24.23  11.42  2.37   0.67  -0.67 -0.73  -0.88 -0.85 -0.16
  0.40   2.09   7.40   1.56 -2.47  -4.60  -5.04 -4.25  -3.41 -2.75 -1.88
  0.50   1.58   4.70   0.58 -3.85  -6.13  -5.56 -4.55  -3.40 -2.80 -1.87
  0.60   1.26   3.31   0.41 -3.82  -5.21  -4.96 -3.83  -3.15 -2.52 -2.31
  0.70   0.95   2.92  -0.12 -2.99  -4.07  -3.43 -2.46  -2.51 -2.19 -2.00
  0.80   0.97   2.27  -0.21 -2.83  -3.25  -3.17 -2.85  -3.09 -2.84 -2.40
  0.90   1.15   1.73  -0.38 -1.96  -2.43  -2.82 -3.00  -3.15 -2.48 -1.95
  1.00   0.72   1.36   0.14 -0.88  -1.93  -2.21 -2.41  -2.72 -1.91 -1.35
JOIN 1
TITLE BOTTOM '1.0'

