      SUBROUTINE BARLIN(XL,XR,YB,YT,IMAIN,SCALEX)                       BARL001
C-----------------------------------------------------------------------BARL002
C                                                                       BARL003
C  SUBROUTINE BARLIN  -  Draw the mean and standard deviation lines     BARL004
C                                                                       BARL005
C----------------------------------------------------------------------+BARL006
                                                                        BARL007
      INCLUDE 'bplot.inc'                                               BARL008
                                                                        BARL009
      INTEGER       IMAIN, IPLANE                                       BARL010
      REAL          CUTOFF, SCALEX, VALUE, X, XL, XR, YB, YT            BARL011
                                                                        BARL012
                                                                        BARL013
C---- Initialise plot positions                                         BARL014
      CALL PSLWID(0.1)                                                  BARL015
                                                                        BARL016
C---- For a planar group, draw dotted line depending on whether group   BARL017
C     is a ring or not                                                  BARL018
      IF (IMAIN.GT.NMAIN) THEN                                          BARL019
          IPLANE = IMAIN - NMAIN                                        BARL020
          IF (NPATOM(IPLANE).EQ.4) THEN                                 BARL021
              CUTOFF = LIMPLN(2)                                        BARL022
          ELSE                                                          BARL023
              CUTOFF = LIMPLN(1)                                        BARL024
          ENDIF                                                         BARL025
          X = XL + SCALEX * (CUTOFF - MCHMIN(IMAIN))                    BARL026
          CALL PSDASH(2)                                                BARL027
          CALL PSLINE(X,YB,X,YT)                                        BARL028
          CALL PSDASH(0)                                                BARL029
                                                                        BARL030
C---- Otherwise, use Engh & Huber parameters                            BARL031
      ELSE                                                              BARL032
                                                                        BARL033
C----     Draw in mean                                                  BARL034
          X = XL + SCALEX * (ENGMEA(IMAIN) - MCHMIN(IMAIN))             BARL035
          IF (X.GE.XL .AND. X.LE.XR) THEN                               BARL036
              CALL PSLINE(X,YB,X,YT)                                    BARL037
          ENDIF                                                         BARL038
                                                                        BARL039
C----     Draw standard deviations either side                          BARL040
          VALUE = ENGMEA(IMAIN) - ENGSTD(IMAIN)                         BARL041
          X = XL + SCALEX * (VALUE - MCHMIN(IMAIN))                     BARL042
          IF (X.GE.XL .AND. X.LE.XR) THEN                               BARL043
              CALL PSDASH(2)                                            BARL044
              CALL PSLINE(X,YB,X,YT)                                    BARL045
              CALL PSDASH(0)                                            BARL046
          ENDIF                                                         BARL047
          VALUE = ENGMEA(IMAIN) + ENGSTD(IMAIN)                         BARL048
          X = XL + SCALEX * (VALUE - MCHMIN(IMAIN))                     BARL049
          IF (X.GE.XL .AND. X.LE.XR) THEN                               BARL050
              CALL PSDASH(2)                                            BARL051
              CALL PSLINE(X,YB,X,YT)                                    BARL052
              CALL PSDASH(0)                                            BARL053
          ENDIF                                                         BARL054
      ENDIF                                                             BARL055
                                                                        BARL056
      RETURN                                                            BARL057
      END                                                               BARL058
