      SUBROUTINE BAREND(BTYPE,LAST)                                     BARE001
C-----------------------------------------------------------------------BARE002
C                                                                       BARE003
C  SUBROUTINE BAREND  -  Finish current page                            BARE004
C                                                                       BARE005
C----------------------------------------------------------------------+BARE006
                                                                        BARE007
CHECK v.3.2-->                                                          BARE008
C      SUBROUTINE BAREND(BTYPE)                                         BARE009
CHECK v.3.2<--                                                          BARE010
                                                                        BARE011
      INCLUDE 'bplot.inc'                                               BARE012
                                                                        BARE013
      CHARACTER*1   BTYPE                                               BARE014
      CHARACTER*5   RINGDV, OTHDV                                       BARE015
      CHARACTER*38  IREC                                                BARE016
CHECK v.3.2-->                                                          BARE017
      LOGICAL       LAST                                                BARE018
CHECK v.3.2<--                                                          BARE019
      REAL          XCENT, X1, X2, YMID, Y1, Y2                         BARE020
                                                                        BARE021
C---- Print explanatory note about highlighted residues                 BARE022
      XCENT = (BBOXX1 + BBOXX2) / 2.0                                   BARE023
      X1 = BBOXX1 + 30.0                                                BARE024
      Y1 = BBOXY1 + 30.0                                                BARE025
      Y2 = Y1 + 0.05 * YFQWID                                           BARE026
      YMID = (Y1 + Y2) / 2.0                                            BARE027
      IF (BTYPE.EQ.'P') THEN                                            BARE028
          CALL PSCTXT(XCENT,Y1 + 40.0,10.0,'Histograms showing RMS' //  BARE029
     &        ' distances of planar atoms from best-fit plane.')        BARE030
      ELSE                                                              BARE031
          WRITE(IREC,20) LIMRES(PLTYPE)                                 BARE032
 20       FORMAT('Black bars > ',F4.1,' st. devs. from mean.')          BARE033
          CALL PSTEXT(X1,YMID,10.0,IREC)                                BARE034
      ENDIF                                                             BARE035
                                                                        BARE036
C---- Print explanatory note about arrows at bottom of page             BARE037
      IF (GOTOFF) THEN                                                  BARE038
          X1 = BBOXX1 + 235.0                                           BARE039
          X2 = X1 + 0.03 * XFQWID                                       BARE040
          IF (BTYPE.NE.'P') THEN                                        BARE041
              CALL PSHADE(0.0,COLPLT(PLTYPE,4),RGB,MXCOLR,              BARE042
     &            INCOLR(PLTYPE))                                       BARE043
              CALL PSTRIA(X1,YMID,X2,Y1,X2,Y2)                          BARE044
              CALL PSCTXT(X1+12.0,YMID,10.0,'or')                       BARE045
          ENDIF                                                         BARE046
          X2 = X1 + 19.0                                                BARE047
          X1 = X2 + 0.03 * XFQWID                                       BARE048
          CALL PSHADE(0.0,COLPLT(PLTYPE,4),RGB,MXCOLR,INCOLR(PLTYPE))   BARE049
          CALL PSTRIA(X1,YMID,X2,Y1,X2,Y2)                              BARE050
          CALL PSTEXT(X1+7.0,YMID,10.0,'signifies data points' //       BARE051
     &        ' off the graph in the direction shown.')                 BARE052
      ENDIF                                                             BARE053
                                                                        BARE054
C---- Print explanatory note about lines at bottom of page              BARE055
      X1 = BBOXX1 + 30.0                                                BARE056
      Y1 = BBOXY1 + 20.0                                                BARE057
      IF (BTYPE.EQ.'P') THEN                                            BARE058
          WRITE(RINGDV,120) LIMPLN(1)                                   BARE059
 120      FORMAT(F5.2)                                                  BARE060
          WRITE(OTHDV,120) LIMPLN(2)                                    BARE061
          CALL PSCTXT(XCENT,Y1 + 40.0,10.0,'Black bars indicate lar' // BARE062
     &        'ge deviations from planarity: RMS dist >' // RINGDV //   BARE063
     &        ' for rings, and >' // OTHDV // ' otherwise.')            BARE064
      ELSE                                                              BARE065
          CALL PSTEXT(X1,Y1,10.0,'Solid and dashed lines represent' //  BARE066
     &        ' the mean and standard deviation values as per Engh ' // BARE067
     &        '& Huber small-molecule data.')                           BARE068
      ENDIF                                                             BARE069
                                                                        BARE070
C---- Close the current PostScript file                                 BARE071
CHECK v.3.2-->                                                          BARE072
C      CALL PSCLOS(BBOXX1,BBOXX2,BBOXY1,BBOXY2)                         BARE073
      CALL PSENDP                                                       BARE074
      IF (.NOT.COMBPS .OR. LAST) THEN                                   BARE075
          CALL PSCLOS(BBOXX1,BBOXX2,BBOXY1,BBOXY2)                      BARE076
      ENDIF                                                             BARE077
CHECK v.3.2<--                                                          BARE078
                                                                        BARE079
      RETURN                                                            BARE080
      END                                                               BARE081
