      SUBROUTINE DISTGM                                                 DIST001
C-----------------------------------------------------------------------DIST002
C                                                                       DIST003
C  SUBROUTINE DISTGM  -  Plot distorted geometries: bond lengths, bond  DIST004
C                        angles and planar groups                       DIST005
C                                                                       DIST006
C----------------------------------------------------------------------+DIST007
                                                                        DIST008
      INCLUDE 'bplot.inc'                                               DIST009
                                                                        DIST010
      INTEGER       IPAGE, NDONEA, NDONEL, NDONEP                       DIST011
CHECK v.3.2-->                                                          DIST012
      LOGICAL       LAST                                                DIST013
CHECK v.3.2<--                                                          DIST014
                                                                        DIST015
C---- Initialise values                                                 DIST016
      IPAGE = 0                                                         DIST017
      NDONEA = 0                                                        DIST018
      NDONEL = 0                                                        DIST019
      NDONEP = 0                                                        DIST020
      PLTYPE = 4                                                        DIST021
                                                                        DIST022
C---- Plot distorted bond lengths                                       DIST023
      CALL DGPLOT('L',IPAGE,NDONEA,NDONEL,NDONEP)                       DIST024
      IF (IFAIL) GO TO 999                                              DIST025
                                                                        DIST026
C---- Plot distorted bond angles                                        DIST027
      CALL DGPLOT('A',IPAGE,NDONEA,NDONEL,NDONEP)                       DIST028
      IF (IFAIL) GO TO 999                                              DIST029
                                                                        DIST030
C---- Plot distorted planes                                             DIST031
      CALL DGPLOT('P',IPAGE,NDONEA,NDONEL,NDONEP)                       DIST032
      IF (IFAIL) GO TO 999                                              DIST033
                                                                        DIST034
C---- Finish off the last page                                          DIST035
CHECK v.3.2-->                                                          DIST036
C      IF (IPAGE.GT.0) CALL DISEND                                      DIST037
      LAST = .TRUE.                                                     DIST038
      IF (IPAGE.GT.0) CALL DISEND(LAST)                                 DIST039
CHECK v.3.2<--                                                          DIST040
                                                                        DIST041
C---- Show total numbers of distorted bonds, etc                        DIST042
      PRINT*, '   * Distorted main-chain bonds: ', NDONEL               DIST043
      PRINT*, '   * Distorted main-chain angles:', NDONEA               DIST044
      PRINT*, '   * Distorted planar groups:    ', NDONEP               DIST045
                                                                        DIST046
 999  CONTINUE                                                          DIST047
      RETURN                                                            DIST048
      END                                                               DIST049
