



      SUBROUTINE SHOIAA (IAA) 
















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'ESPACE.INC'
      INCLUDE       'CLUFAM.INC'
      INCLUDE       'GRPINC.INC'
      INCLUDE       'SEARCH.INC'
      INCLUDE       'IRIGRA.INC'
      INCLUDE       'HBONDS.INC'
      INTEGER       ISOUP, ICLU, IFAM, IDUMMY, IAT, IAA, I, J, 
     +              GVFLEN, IBND, ATBT(100), GVFIN0, SHICNT, GVFCBT, 
     +              ATBTCT, IEND, BCNT
      REAL          ATVOUT
      LOGICAL       WIF051, GVFIBN, WIFIRW, WIFIRA, WIFROK, WIFIRR,
     +              WIFIRI, WIFIC2, CH5EQCH5
      CHARACTER*1   ATFLG2, NOBFLG
      CHARACTER*2   BNDFLG
      CHARACTER*3   ATFLAG
      CHARACTER*4   ORGDIF, ATMLOC
      CHARACTER*5   CHAR5
      SAVE          BCNT







      IF (NUMAAT.LE.0) THEN
         CALL GVSTTI ('?M0058',IAA)
         GOTO 998
      END IF
      IF (.NOT.WIFIRI(IAA)) THEN
         CALL GVSTTI ('?M0059',IAA)
         CALL GVSKIL
         GOTO 998
      END IF
      ISOUP=CHAINN(2,IAA)
      IF (.NOT.GVFIBN(ISOUP,1,NUMSOU)) THEN
         CALL GVSTTB ('?BUGG13')
         CALL MOL207
         ISOUP=CHAINN(2,IAA)
         IF (.NOT.GVFIBN(ISOUP,1,NUMSOU)) THEN
            CALL GVSTT6 ('?BUGG14')
            CHAINN(2,IAA)=1
            GOTO 998
         ELSE
            CALL GVSTT6 ('?BUGG15')
         END IF
      END IF



      ATBTCT=0
      CALL GVSCTB (ORGDIF,4)
      CALL GVSIT0 (ATBT,100)

         IF (WIFPAR(114).NE.0) CALL HBO010




      IF (WIFPAR(1003).EQ.0) THEN
         BCNT=0
         CALL GVSNL6 (1)
         WIFPAR(1206)=IAA
      END IF




      IF (WIFIRW(IAA)) THEN
         CALL WIF236 (IAA)
         GOTO 998
      END IF




      IF (.NOT.WIFIRW(IAA)) THEN
         DO 8 IAT=PNTAAS(IAA),PNTAAE(IAA)
            DO 5 IBND=1,8
               IF (BOUND_TO(IBND,IAT).NE.0) THEN
                  IF (ATIAA(BOUND_TO(IBND,IAT)).EQ.IAA) GOTO 5
                  IF (ATBTCT.NE.0) THEN
                     DO 4 J=1,ATBTCT
                        IF (ATBT(J).EQ.ATIAA(BOUND_TO(IBND,IAT))) GOTO 5
 4                   CONTINUE
                  END IF
                  ATBTCT=ATBTCT+1
                  ATBT(ATBTCT)=ATIAA(BOUND_TO(IBND,IAT))
               END IF
 5          CONTINUE
 8       CONTINUE
      END IF



      CALL DIF028 (6,IAA)
      IF (NUMAAF.GT.0) THEN
         SHICNT=GVFCBT(ISSHIT,NUMAAF)
         IF (SHICNT.NE.NUMAAF.AND.SHICNT.NE.0) THEN
            IF (WIFIRR(IAA)) THEN
               IF (WIFROK(IAA)) THEN
                  IF (ISSHIT(IAA)) THEN
                     CALL GVSTT6 ('?M0932')
                  ELSE
                     CALL GVSTT6 ('?M0933')
                  END IF
               ELSE
                  CALL GVSTT6 ('?M0934')
               END IF
            END IF
         END IF
      END IF



      IF (NOBOND(IAA)) CALL GVSTT6 ('?M2132')




      IF (.NOT.GVFIBN(CHAINN(2,IAA),1,NUMSOU)) THEN
         CALL GVSTTB ('?BUGG13')
         GOTO 998
      END IF



      IF (WIFIRA(IAA)) THEN







         IF (NUMFAM.GT.0) THEN
            DO 20 IFAM=1,MAXFAM
               IF (GVFIBN(IFAM,FAMILY(1,IFAM),FAMILY(2,IFAM))) THEN
                  CALL GVSFMT ('?M0149')
                  CALL GVSCTB (LINE,80)
                  WRITE (LINE,FMT,ERR=999) IFAM,FAMILY(1,IFAM),
     +             FAMILY(2,IFAM),(FAMNAM(IFAM)(I:I),I=1,
     +             MIN(45,GVFLEN(FAMNAM(IFAM))))
                  CALL GVSTT6 (LINE)
               END IF
   20       CONTINUE
         END IF
      END IF



      CALL SHOWLAST (IAA,IEND)



      CALL GVSTT6 ('?GENHD1')
      DO 30 IAT=PNTAAS(IAA),IEND



         CALL GVSSTX (CHAR5,ONESAT(IAT))
         IF (ATMLOC(1:3).EQ.'Bug') THEN
            CALL GVSTTB ('?M4640')
            CALL GVSTTI2 ('?M4641',IAA,IAT)
            CALL GVSTTI2 ('?M4642',PNTAAS(IAA),PNTAAE(IAA))
         END IF



         IF (CHAR5(5:5).EQ.' ') THEN
            CHAR5(5:5)=ALTATM(IAT)
         ELSE IF (CHAR5(1:1).EQ.' ') THEN
            CHAR5(1:1)=ALTATM(IAT)
         END IF



         IF ((.NOT.ISATOK(IAT)).OR.CH5EQCH5(ORGNAM(IAT),CHAR5).OR.
     +       (WIFIC2(ONESAT(IAT)).OR.WIFIC2(ORGNAM(IAT)(1:4)).AND.
     +       IAT.LE.PNTAAS(IAA)+3)) THEN
            CALL GVSCTB (ORGDIF,4)
         ELSE
            CALL GVSSTX (ORGDIF,ORGNAM(IAT)(1:4))
         END IF
         CALL GVSCTB (BNDFLG,2)
         CALL SETARR (IAT,IAT,BNDFLG)
         IF (ISATOK(IAT)) THEN
            ATFLAG(1:1)='+'
         ELSE
            ATFLAG(1:1)='-'
         END IF
         IF (PROTON(IAT)) THEN
            ATFLAG(2:2)='P'
         ELSE
            ATFLAG(2:2)=' '
         END IF
         IF (WIFPAR(114).NE.0) THEN
            IF (USABLE(IAT)) THEN
               IF (DONACC(IAT).EQ.-1) THEN
                  ATFLAG(3:3)='A'
               ELSE IF (DONACC(IAT).EQ.0) THEN
                  ATFLAG(3:3)='B'
               ELSE IF (DONACC(IAT).EQ.1) THEN
                  ATFLAG(3:3)='D'
               ELSE 
                  ATFLAG(3:3)='?'
               END IF
            ELSE
               ATFLAG(3:3)=' '
            END IF
         ELSE
            IF (NOBIAT(IAT)) THEN
               ATFLAG(3:3)='-'
            ELSE
               ATFLAG(3:3)=' '
            END IF
         END IF
         IF (NOBOND(IAA)) THEN
            NOBFLG='N'
         ELSE
            NOBFLG=' '
         END IF



         IF (WIFPAR(185).LE.1) THEN
            ATVOUT=ATTVAL(IAT)
         ELSE
            ATVOUT=ATTVL2(IAT)
         END IF



         IF (WIFPAR(1163).EQ.0) THEN
            ATFLG2=' '
         ELSE
            IF (ROW1(IAT)) THEN
               ATFLG2='!'
            ELSE
               ATFLG2=' '
            END IF
         END IF



         CALL SHOW1AT (IAT,CHAR5,NOBFLG,ATFLAG,ATVOUT,BNDFLG,ATFLG2)
   30 CONTINUE



      IF (WIFPAR(1003).EQ.0) THEN
         DO 40 IBND=1,100
            IF (ATBT(IBND).NE.0) THEN
               IDUMMY=ATBT(IBND)
               BCNT=BCNT+1
               IF (BCNT.LE.1) THEN
                  CALL GVSTT6 ('?M2899')
               ELSE
                  CALL GVSTT6 ('?M2900')
               END IF
               CALL SHOIAAX (IDUMMY)
            END IF
   40    CONTINUE
      ELSE
         IF (GVFIN0(ATBT,100).GT.1) THEN
            CALL SHOWTEXT ('?M0852')
            DO 50 J=1,100
               IF (ATBT(J).NE.0.AND.ATBT(J).NE.WIFPAR(1206)) THEN
                  CALL DIF028 (6,ATBT(J))
               END IF
   50       CONTINUE
         END IF
      END IF
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('SHOIAA')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE SHOW1AT (IAT,CHAR5,NOBFLG,ATFLAG,ATVOUT,BNDFLG,ATFLG2)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'ANATRA.INC'
      INCLUDE       'ANISOU.INC'
      INCLUDE       'HBONDS.INC'
      INTEGER       IAT, I, IBND
      REAL          ATVOUT, AX, AY, AZ, ZERO
      LOGICAL       GVFRIN, PRTALT, CH5EQCH5
      CHARACTER*1   ATFLG2, NOBFLG
      CHARACTER*2   BNDFLG
      CHARACTER*3   ATFLAG
      CHARACTER*5   CHAR5, ORG5
      CHARACTER*6   ATVTXT
      CHARACTER*32  BNDTOF







      ZERO=0.0
      CALL GVSCTB (BIGLIN,132)



      IF (GVFRIN(ATVOUT,-99.99999,999.99999)) THEN
         IF (ATVOUT.LT.999.99999) THEN
            CALL GVSFMT ('?FMT731')
            WRITE (ATVTXT,FMT,ERR=999) ATVOUT
         ELSE
            CALL GVSFMT ('?FMT731A')
            WRITE (ATVTXT,FMT,ERR=999) ATVOUT
         END IF
      ELSE
         CALL GVSFMT ('?FMT731B')
         WRITE (ATVTXT,FMT,ERR=999) NINT(ATVOUT)
      END IF



      IF (USEALT) THEN
         IF (ALALAT(IAT).EQ.' ') THEN
            PRTALT=.FALSE.
         ELSE
            AX=ALTX(IAT)
            AY=ALTY(IAT)
            AZ=ALTZ(IAT)
            PRTALT=.TRUE.
         END IF
      ELSE
         PRTALT=.FALSE.
      END IF



      IF (CH5EQCH5(ONESAT(IAT),ORGNAM(IAT))) THEN
         CALL GVSCTB (ORG5,5)
      ELSE
         CALL GVSSTX (ORG5,ORGNAM(IAT))
      END IF



      IF (WIFPAR(157).NE.0) THEN
         CALL GVSCTB (BNDTOF,32)
         DO 10 IBND=1,8
            IF (BOUND_TO(IBND,IAT).NE.0) CALL GVSSTX 
     +       (BNDTOF(4*IBND-3:4*IBND),ONESAT(BOUND_TO(IBND,IAT)))
 10       CONTINUE
       END IF



      IF (WIFPAR(58).NE.0) THEN
         IF (.NOT.PROTON(IAT)) THEN
 1077       FORMAT (A5,3F6.1,F5.1,3F5.1,I5,2(1X,A1),1X,A3,A6,1X,A2,
     +       1X,A5,1X,A1,1X,L1,I3)
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,1077,ERR=999) CHAR5,XCOORD(IAT),
     +       YCOORD(IAT),ZCOORD(IAT),ACCESS(IAT),XBFACT(IAT),
     +       WEIGHT(IAT),VDWRAD(IAT),ATCOLR(IAT),ALTATM(IAT),
     +       NOBFLG,ATFLAG,ATVTXT,BNDFLG,ORG5,ATFLG2,USABLE(IAT),
     +       DONACC(IAT)
            CALL GVSTT6 (BIGLIN)
         END IF
         GOTO 998
      END IF
      IF (PROTON(IAT)) THEN
         CALL GVSFMT ('?FMT1078')
         CALL GVSCTB (BIGLIN,132)
         WRITE (BIGLIN,FMT,ERR=999) CHAR5,XCOORD(IAT),
     +    YCOORD(IAT),ZCOORD(IAT),XBFACT(IAT),
     +    WEIGHT(IAT),VDWRAD(IAT),ATCOLR(IAT),ALTATM(IAT),
     +    NOBFLG,ATFLAG,ATVTXT,BNDFLG,ORG5,ATFLG2

         CALL GVSTT6 (BIGLIN)
         IF (PRTALT) THEN
            CALL GVSFMT ('?FMT1079')
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) ALALAT(IAT),AX,AY,AZ,
     +       ALTXBF(IAT),ALTWGT(IAT)
            CALL GVSTT6 (BIGLIN)
         END IF
      ELSE
         IF (WIFPAR(157).EQ.0) THEN
            CALL GVSFMT ('?FMT1077X')
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) CHAR5,XCOORD(IAT),
     +       YCOORD(IAT),ZCOORD(IAT),ACCESS(IAT),XBFACT(IAT),
     +       WEIGHT(IAT),VDWRAD(IAT),ATCOLR(IAT),ALTATM(IAT),
     +       NOBFLG,ATFLAG,ATVTXT,BNDFLG,ORG5,ATFLG2


            CALL GVSTT6 (BIGLIN)
            IF (PRTALT) THEN
               CALL GVSFMT ('?FMT1079')
               CALL GVSCTB (BIGLIN,132)
               WRITE (BIGLIN,FMT,ERR=999) ALALAT(IAT),AX,AY,AZ,
     +          ALTXBF(IAT),ALTWGT(IAT)
               CALL GVSTT6 (BIGLIN)
            END IF
         ELSE
            CALL GVSFMT ('?FMT1077Y')
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) CHAR5,XCOORD(IAT),
     +       YCOORD(IAT),ZCOORD(IAT),ACCESS(IAT),XBFACT(IAT),
     +       WEIGHT(IAT),VDWRAD(IAT),ATCOLR(IAT),ALTATM(IAT),NOBFLG,
     +       ATFLAG,ATVTXT,BNDFLG,ORG5,ATFLG2,IAT,BNDTOF
            CALL GVSTT6 (BIGLIN)
         END IF
      END IF



      IF (USEANI) THEN
         CALL GVSFMT ('?FMTANI')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) (ANISOU(I,IAT),I=1,6)
         CALL GVSTT6 (LINE)
      END IF
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('SHOW1AT')



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE SHOIAAT (IAA)
















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'ESPACE.INC'
      INCLUDE       'GRPINC.INC'
      INCLUDE       'HBONDS.INC'
      INCLUDE       'SEARCH.INC'
      INTEGER       ISOUP, IAT, IAA
      LOGICAL       GVFIBN, WIFIRI
      CHARACTER*1   ATFLG2, NOBFLG
      CHARACTER*2   BNDFLG
      CHARACTER*3   ATFLAG
      CHARACTER*5   CHAR5







      IF (NUMAAT.LE.0) THEN
         CALL GVSTTI ('?M0058',IAA)
         GOTO 998
      END IF
      IF (.NOT.WIFIRI(IAA)) THEN
         CALL GVSTTI ('?M0059',IAA)
         GOTO 998
      END IF
      ISOUP=CHAINN(2,IAA)
      IF (.NOT.GVFIBN(ISOUP,1,NUMSOU)) THEN
         CALL GVSTTB ('?BUGG13')
         CALL MOL207
         ISOUP=CHAINN(2,IAA)
         IF (.NOT.GVFIBN(ISOUP,1,NUMSOU)) THEN
            CALL GVSTT6 ('?BUGG14')
            CHAINN(2,IAA)=1
            GOTO 998
         ELSE
            CALL GVSTT6 ('?BUGG15')
         END IF
      END IF



      IF (WIFPAR(1003).EQ.0) THEN
         WIFPAR(1206)=IAA
      END IF




         CALL HBO010




      CALL DIF028 (6,IAA)



      CALL GVSTT6 ('?GENHD1')
      DO 30 IAT=PNTAAS(IAA),PNTAAE(IAA)



         CALL GVSCTB (BNDFLG,2)
         CALL SETARR (IAT,IAT,BNDFLG)
         IF (ISATOK(IAT)) THEN
            ATFLAG(1:1)='+'
         ELSE
            ATFLAG(1:1)='-'
         END IF
         IF (PROTON(IAT)) THEN
            ATFLAG(2:2)='P'
         ELSE
            ATFLAG(2:2)=' '
         END IF
         IF (WIFPAR(114).NE.0) THEN
            IF (USABLE(IAT)) THEN
               IF (DONACC(IAT).EQ.-1) THEN
                  ATFLAG(3:3)='A'
               ELSE IF (DONACC(IAT).EQ.0) THEN
                  ATFLAG(3:3)='B'
               ELSE IF (DONACC(IAT).EQ.1) THEN
                  ATFLAG(3:3)='D'
               ELSE 
                  ATFLAG(3:3)='?'
               END IF
            ELSE
               ATFLAG(3:3)=' '
            END IF
         ELSE
            ATFLAG(3:3)=' '
         END IF
         IF (NOBOND(IAA)) THEN
            NOBFLG='N'
         ELSE
            NOBFLG=' '
         END IF



         IF (WIFPAR(1163).EQ.0) THEN
            ATFLG2=' '
         ELSE
            IF (ROW1(IAT)) THEN
               ATFLG2='!'
            ELSE
               ATFLG2=' '
            END IF
         END IF



         CALL GVSSTX (CHAR5,ONESAT(IAT))
         CALL SHOW1AT (IAT,CHAR5,NOBFLG,ATFLAG,ATTVAL(IAT),
     +    BNDFLG,ATFLG2)
   30 CONTINUE
      CALL GVSNL6 (1)



  998 CONTINUE


      RETURN
      END
      SUBROUTINE SHOWLAST (IAA,IEND)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IAA, IEND, GVFFIP
      LOGICAL       WIFIRZ, T54EQUAL







      IEND=PNTAAE(IAA)



      IF (RESTYP(IAA).EQ.2.AND.NUMCYS.GE.1.AND.WIFPAR(84).EQ.1) THEN
         IF (GVFFIP(CYSCYS,IAA,2*NUMCYS).NE.0) THEN
            IF (.NOT.ISATOK(IEND)) THEN
               IEND=IEND-1
               GOTO 998
            END IF
         END IF
      END IF



      IF (WIFIRZ(IAA)) THEN
         IF (T54EQUAL(ONESAT(IEND),' O4 ')) THEN
            IF (.NOT.ISATOK(IEND)) THEN
               IEND=IEND-1
               GOTO 998
            END IF
         END IF
      END IF



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE SHOUAA (IUNIT,IAA)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'ESPACE.INC'
      INCLUDE       'CLUFAM.INC'
      INCLUDE       'GRPINC.INC'
      INCLUDE       'SEARCH.INC'
      INTEGER       ISOUP, ICLU, IFAM, IUNIT, IEND, IAT, IAA, I, GVFLEN, 
     +              IBND, ATBT(100), SHICNT, GVFCBT, ATBTCT
      LOGICAL       WIF051, GVFIBN, WIFIRA, WIFROK, WIFIRR, WIFIRI
      CHARACTER*1   ATFLG2
      CHARACTER*2   ATFLAG, BNDFLG
      CHARACTER*4   T4, ORGDIF, ATMLOC







      IF (NUMAAT.LE.0) THEN
         CALL GVSTTI ('?M0058',IAA)
         GOTO 998
      END IF
      IF (.NOT.WIFIRI(IAA)) THEN
         CALL GVSTTI ('?M0059',IAA)
         GOTO 998
      END IF
      ISOUP=CHAINN(2,IAA)
      IF (.NOT.GVFIBN(ISOUP,1,NUMSOU)) THEN
         CALL GVSTTB ('?BUGG13')
         CALL MOL207
         ISOUP=CHAINN(2,IAA)
         IF (.NOT.GVFIBN(ISOUP,1,NUMSOU)) THEN
            CALL GVSTT6 ('?BUGG14')
            CHAINN(2,IAA)=1
            GOTO 998
         ELSE
            CALL GVSTT6 ('?BUGG15')
         END IF
      END IF



      ATBTCT=0
      CALL GVSIT0 (ATBT,100)



      DO 8 IAT=PNTAAS(IAA),PNTAAE(IAA)
         DO 5 IBND=1,8
            IF (BOUND_TO(IBND,IAT).NE.0) THEN
               ATBTCT=ATBTCT+1
               ATBT(ATBTCT)=ATIAA(BOUND_TO(IBND,IAT))
            END IF
 5       CONTINUE
 8    CONTINUE



      CALL DIF028 (IUNIT,IAA)
      SHICNT=GVFCBT(ISSHIT,NUMAAF)
      IF (SHICNT.NE.NUMAAF.AND.SHICNT.NE.0) THEN
         IF (WIFIRR(IAA)) THEN
            IF (WIFROK(IAA)) THEN
               IF (ISSHIT(IAA)) THEN
                  CALL GVSTTU (IUNIT,'?M0932')
               ELSE
                  CALL GVSTTU (IUNIT,'?M0933')
               END IF
            ELSE
               CALL GVSTTU (IUNIT,'?M0934')
            END IF
         END IF
      END IF




      IF (.NOT.GVFIBN(CHAINN(2,IAA),1,NUMSOU)) THEN
         CALL GVSTTB ('?BUGG13')
         GOTO 998
      END IF



      IF (WIFIRA(IAA)) THEN







         IF (NUMFAM.GT.0) THEN
            DO 20 IFAM=1,MAXFAM
               IF (GVFIBN(IFAM,FAMILY(1,IFAM),FAMILY(2,IFAM))) THEN
                  CALL GVSFMT ('?M0149')
                  CALL GVSCTB (LINE,80)
                  WRITE (LINE,FMT,ERR=999) IFAM,FAMILY(1,IFAM),
     +             FAMILY(2,IFAM),(FAMNAM(IFAM)(I:I),I=1,
     +             MIN(45,GVFLEN(FAMNAM(IFAM))))
                  CALL GVSTTU (IUNIT,LINE)
               END IF
   20       CONTINUE
         END IF
      END IF



      CALL SHOWLAST (IAA,IEND)



      CALL GVSTTU (IUNIT,'?GENHD1')
      DO 30 IAT=PNTAAS(IAA),IEND



         ATMLOC=T4(ONESAT(IAT))



         IF (.NOT.ISATOK(IAT).OR.ORGNAM(IAT)(1:4).EQ.ATMLOC) THEN
            CALL GVSCTB (ORGDIF,5)
         ELSE
            CALL GVSSTX (ORGDIF,T4(ORGNAM(IAT)))
         END IF
         CALL GVSCTB (BNDFLG,2)
         CALL SETARR (IAT,IAT,BNDFLG)
         IF (PROTON(IAT)) THEN
            IF (ISATOK(IAT)) THEN
               ATFLAG='+P'
            ELSE
               ATFLAG='-P'
            END IF
         ELSE
            IF (ISATOK(IAT)) THEN
               ATFLAG='+ '
            ELSE
               ATFLAG='- '
            END IF
         END IF



         IF (WIFPAR(1163).EQ.0) THEN
            ATFLG2=' '
         ELSE
            IF (ROW1(IAT)) THEN
               ATFLG2='!'
            ELSE
               ATFLG2=' '
            END IF
         END IF



         CALL GVSCTB (BIGLIN,132)
         IF (PROTON(IAT)) THEN
            CALL GVSFMT ('?FMT1080')
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) ATMLOC,XCOORD(IAT),
     +       YCOORD(IAT),ZCOORD(IAT),XBFACT(IAT),
     +       WEIGHT(IAT),VDWRAD(IAT),ATCOLR(IAT),
     +       ATFLAG,ATTVAL(IAT),BNDFLG,ORGDIF,ATFLG2
         ELSE
            CALL GVSFMT ('?FMT1081')
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) ATMLOC,XCOORD(IAT),
     +       YCOORD(IAT),ZCOORD(IAT),ACCESS(IAT),XBFACT(IAT),
     +       WEIGHT(IAT),VDWRAD(IAT),ATCOLR(IAT),
     +       ATFLAG,ATTVAL(IAT),BNDFLG,ORGDIF,ATFLG2
         END IF
         CALL GVSTTU (IUNIT,BIGLIN)
   30 CONTINUE




















      GOTO 998



  999 CONTINUE
      CALL GVSTTE ('?NEWE477')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE SHOIAAX (IAA)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IAA







      IF (NUMAAT.EQ.NUMAAF) GOTO 998



      CALL WIFPUSHPPP (1003,1)
      CALL SHOIAA (IAA)
      CALL WIFPOPPPP (1003)



  998 CONTINUE


      RETURN
      END
      SUBROUTINE SHOUAAX (IUNIT,IAA)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IAA, IUNIT







      IF (NUMAAT.EQ.NUMAAF.OR.IAA.LE.NUMAAF) GOTO 998



      WIFPAR(1003)=1
      CALL SHOUAA (IUNIT,IAA)
      WIFPAR(1003)=0



  998 CONTINUE


      RETURN
      END
      SUBROUTINE WIF302

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IFT1, IFT2, IAA, IAT, JAT, JAA
      LOGICAL       WIFIRR







      IF (NUMAAT.LT.1) THEN
         CALL GVSTT6 ('?SOULOW')
         CALL FLUSHAHEAD
         GOTO 998
      END IF
      IF (NUMATF.LT.1) THEN
         CALL GVSTT6 ('?SOULOW')
         CALL FLUSHAHEAD
         GOTO 998
      END IF



      CALL GVSBTF (WRK1TF,MAXAA)



      CALL WIFGRN (IFT1,IFT2,' ')
      IF (IFT1.EQ.0) GOTO 998



      DO 30 IAA=IFT1,IFT2



         IF (IAA.GT.NUMAAF) THEN
            DO 20 IAT=PNTAAS(IAA),PNTAAE(IAA)
               JAT=BOUND_TO(1,IAT)
               IF (JAT.GT.0) THEN
                  JAA=ATIAA(JAT)
                  IF (WIFIRR(JAA)) THEN
                     IF (.NOT.WRK1TF(JAA)) THEN
                        CALL SHOIAA (JAA)
                        WRK1TF(JAA)=.TRUE.
                     END IF
                     GOTO 30
                  END IF
               END IF
 20         CONTINUE
         END IF
         IF (.NOT.WRK1TF(IAA)) THEN
            CALL SHOIAA (IAA)
            WRK1TF(IAA)=.TRUE.
         END IF
   30 CONTINUE



      CALL GVSSTX (LINE,'?LIST-A')
      CALL GVSFMT ('?FMT691')
      WRITE (LINE(61:80),FMT,ERR=999) IFT1,IFT2
      CALL SETHIS (LINE) 
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('WIF302')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE WIF302A

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IAA, IAT, JAT, JAA, IERR
      LOGICAL       WIFIRR







      IF (NUMAAF.LT.1) THEN
         CALL GVSTT6 ('?SOULOW')
         CALL FLUSHAHEAD
         GOTO 998
      END IF
      IF (NUMATF.LT.1) THEN
         CALL GVSTT6 ('?SOULOW')
         CALL FLUSHAHEAD
         GOTO 998
      END IF



      CALL WIFWTF (' ',IERR)
      IF (IERR.NE.0) GOTO 998



      DO 30 IAA=1,NUMAAT
         IF (.NOT.WRK1TF(IAA)) GOTO 30



         IF (IAA.GT.NUMAAF) THEN
            DO 20 IAT=PNTAAS(IAA),PNTAAE(IAA)
               JAT=BOUND_TO(1,IAT)
               IF (JAT.GT.0) THEN
                  JAA=ATIAA(JAT)
                  IF (WIFIRR(JAA)) THEN
                     CALL SHOIAA (JAA)
                     GOTO 30
                  END IF
               END IF
   20       CONTINUE
         END IF
         CALL SHOIAA (IAA)
   30 CONTINUE



      CALL SETHIS ('?LIST-AA')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE WIF303

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IFT1, IFT2, IAA







      IF (NUMAAT.LT.1) THEN
         CALL GVSTT6 ('?SOULOW')
         CALL FLUSHAHEAD
         GOTO 998
      END IF
      IF (NUMATF.LT.1) THEN
         CALL GVSTT6 ('?SOULOW')
         CALL FLUSHAHEAD
         GOTO 998
      END IF



      CALL WIFGRN (IFT1,IFT2,' ')
      IF (IFT1.EQ.0) GOTO 998



      DO 30 IAA=IFT1,IFT2
         CALL SHOIAAT (IAA)
   30 CONTINUE



  998 CONTINUE


      RETURN
      END
      SUBROUTINE WIF304

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IAA, IERR







      CALL WIFWTF (' ',IERR)
      IF (IERR.NE.0) GOTO 998



      IF (WIFPAR(1105).EQ.0) THEN
         CALL GVSTT6 ('?M1190')
      ELSE
         CALL GVSNL6 (1)
         CALL SHOWTEXTIF ('?M1189')
         CALL GVSNL6 (1)
      END IF



      DO 10 IAA=1,NUMAAT
         IF (WRK1TF(IAA)) CALL WIF305 (IAA,IAA)
   10 CONTINUE



  998 CONTINUE


      RETURN
      END
      SUBROUTINE WIF305 (IFT1,IFT2)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'HSTINC.INC'
      INTEGER       IFT1, IFT2, IAA
      CHARACTER*23  IAAS, DIF001







      DO 100 IAA=IFT1,IFT2
         IAAS=DIF001(IAA)
         CALL GVSFMT ('?M0150')
         WRITE (LINE,FMT,ERR=100) IAAS,LOCHST(IAA),
     +    SOUNAM(SOUPNT(IAA))(1:20)
         CALL GVSTT6 (LINE)
  100 CONTINUE





      RETURN
      END
      SUBROUTINE WIF306

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IFT1, IFT2, IAA, IAT, JAT, IBND
      CHARACTER*28  IATS, DIF000







      IF (NUMAAT.LT.1) THEN
         CALL GVSTT6 ('?SOULOW')
         CALL FLUSHAHEAD
         GOTO 998
      END IF
      IF (NUMATF.LT.1) THEN
         CALL GVSTT6 ('?SOULOW')
         CALL FLUSHAHEAD
         GOTO 998
      END IF



      CALL GVSBTF (WRK1TF,MAXAA)



      CALL WIFGRN (IFT1,IFT2,' ')
      IF (IFT1.EQ.0) GOTO 998



      DO 30 IAA=IFT1,IFT2
         CALL SHOIAA (IAA)
         CALL GVSCTB (LINE250,250)
         DO 20 IAT=PNTAAS(IAA),PNTAAE(IAA)
            IATS=DIF000(IAT)
            CALL GVSSTX (LINE250,IATS)
            DO 10 IBND=1,8
               JAT=BOUND_TO(IBND,IAT)
               IF (JAT.GT.0) THEN
                  IATS=DIF000(JAT)
                  CALL GVSCPC (LINE250,IATS)
               END IF
 10         CONTINUE
 20      CONTINUE
 30   CONTINUE



  998 CONTINUE


      RETURN
      END
      SUBROUTINE SHOMAT (IUNIT,MODE,MAT,NUM1,NUM2,IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       NUM1, NUM2
      INTEGER       MODE, MAT(NUM1,NUM2), IERR, IAATYP, JAATYP, IUNIT, 
     +              IMAX, GVFIMX







      IERR=0



      IF (MODE.EQ.1) THEN



 1       CONTINUE
         IMAX=GVFIMX(MAT,NUM1*NUM2)
         IF (IMAX.GT.999) THEN
            CALL GVSIDL (MAT,NUM1*NUM2)
            CALL GVSTT6 ('?M3082')
            GOTO 1
         END IF



         CALL GVSFMT ('?FMT357')
         CALL GVSCTB (BIGLIN,132)
         WRITE (BIGLIN,FMT,ERR=999) (AANAME(IAATYP),IAATYP=1,20)
         CALL GVSTTU (IUNIT,BIGLIN)
         CALL GVSFMT ('?FMT356')



         DO 10 IAATYP=1,20
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) 
     +       AANAME(IAATYP),(MAT(IAATYP,JAATYP),JAATYP=1,20)
            CALL GVSTTU (IUNIT,BIGLIN)
   10    CONTINUE
         GOTO 998



      ELSE IF (MODE.EQ.2) THEN
         CALL GVSFMT ('?FMT357')
         CALL GVSCTB (BIGLIN,132)
         WRITE (BIGLIN,FMT,ERR=999) (AANAME(IAATYP),IAATYP=1,20)
         CALL GVSTTU (IUNIT,BIGLIN)
         CALL GVSFMT ('?FMT356')
         DO 20 JAATYP=1,NUM2
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) 
     +       AANAME(IAATYP),(MAT(IAATYP,JAATYP),IAATYP=1,20)
            CALL GVSTTU (IUNIT,BIGLIN)
   20    CONTINUE
         GOTO 998
      END IF



      CALL GVSTTB ('?M1557')
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('SHOMAT')



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE SHOMTR (IUNIT,MODE,MAT,NUM1,NUM2,IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       NUM1, NUM2, IUNIT
      INTEGER       MODE, IERR, IAATYP, JAATYP, I, IPOS, GVFPOS
      REAL          MAT(NUM1,NUM2), SUM







      IERR=0



      IF (MODE.EQ.1) THEN
         CALL GVSFMT ('?FMT357A')
         CALL GVSCTB (BIGLIN,132)
         WRITE (BIGLIN,FMT,ERR=999) (AANAME(IAATYP),IAATYP=1,20)
         CALL GVSTTU (IUNIT,BIGLIN)
         CALL GVSFMT ('?FMT356A')
         DO 10 IAATYP=1,20
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) 
     +       AANAME(IAATYP),(MAT(IAATYP,JAATYP),JAATYP=1,20)
            CALL GVSTTU (IUNIT,BIGLIN)
   10    CONTINUE
         GOTO 998



      ELSE IF (MODE.EQ.2) THEN
         CALL GVSFMT ('?FMT357A')
         CALL GVSCTB (BIGLIN,132)
         WRITE (BIGLIN,FMT,ERR=999) (AANAME(IAATYP),IAATYP=1,20)
         CALL GVSTTU (IUNIT,BIGLIN)
         CALL GVSFMT ('?FMT356A')
         DO 20 JAATYP=1,NUM2
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) 
     +       AANAME(IAATYP),(MAT(IAATYP,JAATYP),IAATYP=1,20)
            CALL GVSTTU (IUNIT,BIGLIN)
   20    CONTINUE
         GOTO 998



      ELSE IF (MODE.EQ.3) THEN
         CALL GVSFMT ('?FMT357A')
         CALL GVSCTB (BIGLIN,132)
         WRITE (BIGLIN,FMT,ERR=999) (AANAME(IAATYP),IAATYP=1,20)
         CALL GVSTTU (IUNIT,BIGLIN)
         CALL GVSFMT ('?FMT356A')
         DO 30 IAATYP=1,20
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) 
     +       AANAME(IAATYP),(MAT(IAATYP,JAATYP),JAATYP=1,20)
            DO 5 I=1,20
               IPOS=GVFPOS(BIGLIN,'-9.90')
               IF (IPOS.NE.0) CALL GVSCTB (BIGLIN(IPOS:IPOS+4),5)
    5       CONTINUE
            CALL GVSTTU (IUNIT,BIGLIN)
   30    CONTINUE
         GOTO 998



      ELSE IF (MODE.EQ.4) THEN
         CALL GVSFMT ('?FMT357A')
         CALL GVSCTB (BIGLIN,132)
         WRITE (BIGLIN,FMT,ERR=999) (AANAME(IAATYP),IAATYP=1,20)
         CALL GVSTTU (IUNIT,BIGLIN)
         CALL GVSFMT ('?FMT356A')
         DO 40 IAATYP=1,20
            SUM=0.0
            DO 39 JAATYP=1,20
               SUM=SUM+MAT(IAATYP,JAATYP)
   39       CONTINUE
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) AANAME(IAATYP),
     +       (MAT(IAATYP,JAATYP),JAATYP=1,20),SUM
            CALL GVSTTU (IUNIT,BIGLIN)
   40    CONTINUE
         GOTO 998



      ELSE IF (MODE.EQ.5) THEN
         CALL GVSFMT ('?FMT357A')
         CALL GVSCTB (BIGLIN,132)
         WRITE (BIGLIN,FMT,ERR=999) (AANAME(IAATYP),IAATYP=1,20)
         CALL GVSTTU (IUNIT,BIGLIN)
         CALL GVSFMT ('?FMT356B')
         DO 50 IAATYP=1,20
            SUM=0.0
            DO 49 JAATYP=1,20
               SUM=SUM+MAT(IAATYP,JAATYP)
   49       CONTINUE
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) AANAME(IAATYP),
     +       (MAT(IAATYP,JAATYP),JAATYP=1,20),SUM
            CALL GVSTTU (IUNIT,BIGLIN)
   50    CONTINUE
         GOTO 998
      END IF



      CALL GVSTTB ('?M1557')
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('SHOMTR')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE SHOSOU






















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'IRIGRA.INC'
      INTEGER       ISOUP(10), IS, GVFCBT







      IF (NUMAAT.LT.1) THEN
         CALL GVSBOX ('?MOLC07')
         GOTO 998
      END IF



      CALL MOL309C 



      CALL GVSNL6 (1)
      IF (WIFPAR(84).EQ.0) THEN
         CALL SHOWTEXTIF ('?MOLSCO')
      ELSE 
         IF (WIFPAR(1165).EQ.0) THEN
            CALL SHOWTEXTIF ('?MOLSCO')
         ELSE
            CALL SHOWTEXTIF ('?MOLSCOP')
         END IF
      END IF



      IF (WIFPAR(1012).NE.0.AND.WIFPAR(919).EQ.0) THEN
         CALL GVSIT0 (ISOUP,10)
         DO 20 IS=1,NUMSOU
            ISOUP(SOUADM(5,IS)+2)=ISOUP(SOUADM(5,IS)+2)+1
 20      CONTINUE
         ISOUP(10)=GVFCBT(NOBOND,NUMAAT)
         CALL GVSTTI ('?MOLHL1',ISOUP(3))
         CALL GVSTTI ('?MOLHL2',ISOUP(4))
         CALL GVSTTI ('?MOLHL3',ISOUP(5))
         CALL GVSTTI ('?MOLHL4',ISOUP(6))
         CALL GVSTTI ('?MOLHL5',ISOUP(7))
         CALL GVSTTI ('?MOLHL6',ISOUP(8))
         IF (WIFPAR(84).NE.0.AND.WIFPAR(1165).EQ.0) CALL GVSTTI 
     +    ('?MOLHL7',WIFPAR(1166))
         CALL GVSTTI ('?MOLHL8',ISOUP(9))
         IF (ISOUP(10).NE.0) CALL GVSTTI ('?MOLHL9',ISOUP(10))
         IF (USEALT) CALL GVSTTI ('?MOLHL10',GVFCBT(HASALT,NUMAAF))
         CALL GVSNL6 (1)
      END IF



      CALL MOL309 (6,1,NUMAAT)



  998 CONTINUE


      RETURN
      END
      SUBROUTINE SHOSOX (KILROW)






















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'IRIGRA.INC'
      LOGICAL       KILROW(NUMSOU)







      IF (NUMAAT.LT.1) THEN
         CALL GVSBOX ('?MOLC07')
         GOTO 998
      END IF



      CALL MOL309C 



      CALL MOL309X (6,1,NUMAAT,KILROW)



  998 CONTINUE


      RETURN
      END
      SUBROUTINE SHOSUU (IUNIT)






















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IUNIT







      IF (NUMAAT.LT.1) THEN
         CALL GVSBOX ('?MOLC07')
         GOTO 998
      END IF



      CALL MOL309C 



      CALL MOL309 (IUNIT,1,NUMAAT)



  998 CONTINUE


      RETURN
      END
      SUBROUTINE MOL309 (IUNIT,IFT1,IFT2)






















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IFT1, IFT2, ISOUP, IERR, IUNIT
      LOGICAL       WIFIRI
      CHARACTER*132 LOCLIN







      IF ((.NOT.WIFIRI(IFT1)).OR.(.NOT.WIFIRI(IFT2))) THEN
         CALL GVSTTB ('?MOLC19')
         GOTO 998
      END IF
      IF (NUMSOU.LT.1) THEN
         CALL GVSTTB ('?MOLC20')
         GOTO 998
      END IF



      IF (IUNIT.EQ.6) THEN
         CALL GVSTT6 ('?MOLH90')
      ELSE
         CALL GVSTTU (IUNIT,'?MOLH90')
      END IF



      DO 20 ISOUP=1,NUMSOU
         CALL MOL309B (ISOUP,LOCLIN,IERR)
         IF (IERR.EQ.0) THEN
            IF (IUNIT.EQ.6) THEN
                CALL GVSTT6 (LOCLIN)
            ELSE
               CALL GVSTTU (IUNIT,LOCLIN)
            END IF
         END IF
   20 CONTINUE



  998 CONTINUE


      RETURN
      END
      SUBROUTINE MOL309X (IUNIT,IFT1,IFT2,KILROW)






















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IFT1, IFT2, ISOUP, IERR, IUNIT
      LOGICAL       WIFIRI, KILROW(NUMSOU)
      CHARACTER*132 LOCLIN







      IF ((.NOT.WIFIRI(IFT1)).OR.(.NOT.WIFIRI(IFT2))) THEN
         CALL GVSTTB ('?MOLC19')
         GOTO 998
      END IF
      IF (NUMSOU.LT.1) THEN
         CALL GVSTTB ('?MOLC20')
         GOTO 998
      END IF



      IF (IUNIT.EQ.6) THEN
         CALL GVSTT6 ('?MOLH90')
      ELSE
         CALL GVSTTU (IUNIT,'?MOLH90')
      END IF



      DO 20 ISOUP=1,NUMSOU
         CALL MOL309BX (ISOUP,LOCLIN,KILROW(ISOUP),IERR)
         IF (IERR.EQ.0) THEN
            IF (IUNIT.EQ.6) THEN
                CALL GVSTT6 (LOCLIN)
            ELSE
               CALL GVSTTU (IUNIT,LOCLIN)
            END IF
         END IF
   20 CONTINUE



  998 CONTINUE


      RETURN
      END

      SUBROUTINE MOL309B (ISOUP,TEXT,IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       GVFLEN, ISOUP, IPNT, ISTYPE, IAT, JAT, IERR, IAA, 
     +              JAA, IOCNT, IBAT, IBAA
      LOGICAL       GVFIBN, WIFISO, WIFISH, WIFIRA, WIFIRZ, WIFITI,
     +              WIFIRN, WIFIRO
      CHARACTER*1   CHAOUT
      CHARACTER*4   NN1, NN2
      CHARACTER*7   CHAR4
      CHARACTER*8   CHAR8
      CHARACTER*(*) TEXT







      IF (.NOT.GVFIBN(ISOUP,1,NUMSOU)) THEN
         CALL GVSTTI ('?MOLC21',ISOUP)
         CALL MOL010 ('?M4598')
         IERR=1
         CALL GVSKIL
         GOTO 998
      END IF
      IPNT=SOUPNT(SOUADM(1,ISOUP))
      IF (.NOT.GVFIBN(IPNT,1,MAXMOL)) THEN
         CALL GVSTTI ('?MOLC21',ISOUP)
         CALL MOL010 ('?M4599')
         IERR=1
         CALL GVSKIL
         GOTO 998
      END IF



      IF (WIFISH(ISOUP).AND.WIFPAR(1165).EQ.1) THEN
         IERR=1
         GOTO 998
      END IF



      IERR=0
      CALL GVSCTB (CHAR4,7)
      CALL GVSCTB (NN1,4)
      CALL GVSCTB (NN2,4)
      CHAOUT=' '
      CALL GVSCTB (TEXT,LEN(TEXT))



      CALL GVSCTB (CHAR8,8)
      IF (MODNMB(SOUADM(1,ISOUP)).GT.0) THEN
         CALL GVSFMT ('?FMT041')
         WRITE (CHAR8,FMT,ERR=999) MODNMB(SOUADM(1,ISOUP))
      END IF



      CALL GVSSTX (LINE2(1:20),SOUNAM(IPNT)(1:20))
      IF (GVFLEN(SOUNAM(IPNT)).GT.20) LINE2(18:20)='...'



      IAA=SOUADM(1,ISOUP)
      ISTYPE=SOUADM(5,ISOUP)
      IF (ISTYPE.EQ.0) THEN
         ISTYPE=FAMTYP(RESTYP(SOUADM(1,ISOUP)))
         IF (ISTYPE.NE.0) CALL GVSTTI2 ('?M2366',ISOUP,ISTYPE)
      END IF



      IF (ISTYPE.EQ.1) THEN
         CALL GVSSTX (CHAR4,'?M1301')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
      ELSE IF (ISTYPE.EQ.3) THEN



         CALL GVSSTX (CHAR4,'?M1302')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
      ELSE IF (ISTYPE.EQ.7) THEN



         CALL GVSSTX (CHAR4,'?M1302A')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
      ELSE IF (ISTYPE.EQ.2.OR.ISTYPE.EQ.4.OR.ISTYPE.EQ.6) THEN



         CALL GVSSTX (CHAR4(1:4),ONESA3(SOUADM(1,ISOUP)))
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
         IAT=PNTAAS(IAA)



         IF (WIFISO(ISOUP)) THEN
            IF (BOUND_TO(1,PNTAAS(IAA)).EQ.0) THEN
               CALL GVSSTX (CHAR4(1:4),'  O2')
            ELSE
               JAA=ATIAA(BOUND_TO(1,PNTAAS(IAA)))
               IF (.NOT.GVFIBN(JAA,1,NUMAAT)) THEN
                  CALL GVSSTX (CHAR4(1:4),'  O2')
               ELSE
                  IF (WIFIRA(JAA)) THEN
                     CALL GVSSTX (CHAR4(1:4),'  O2')
                  ELSE IF (WIFIRZ(JAA)) THEN
                     CALL GVSSTX (CHAR4(1:4),'  O.')
                  ELSE 
                     CALL GVSSTX (CHAR4(1:4),'  O ')
                  END IF
               END IF
               CALL GVSCTB (CHAR8(1:5),5)
               CALL GVSFMT ('?FMT022')
               WRITE (CHAR8(1:5),FMT,ERR=999) JAA
            END IF
            IF (WIFITI(BOUND_TO(1,IAT))) THEN
               CHAR4(1:1)=A1NAME(RESTYP(ATIAA(BOUND_TO(1,IAT))))
            ELSE
               CHAR4(1:1)=' '
            END IF



         ELSE IF (WIFISH(ISOUP)) THEN
            IF (BOUND_TO(1,PNTAAS(IAA)).EQ.0) THEN
               CALL GVSSTX (CHAR4(1:4),' Auw')
            ELSE
               JAA=ATIAA(BOUND_TO(1,PNTAAS(IAA)))
               IF (.NOT.GVFIBN(JAA,1,NUMAAT)) THEN
                  CALL GVSSTX (CHAR4(1:4),' Oei')
               ELSE
                  IF (SOUADM(4,ISOUP).LE.1) THEN
                     CALL GVSSTX (CHAR4(1:4),'  H.')
                  ELSE IF (SOUADM(4,ISOUP).EQ.2) THEN
                     CALL GVSSTX (CHAR4(1:4),'  H:')
                  ELSE IF (SOUADM(4,ISOUP).GE.3) THEN
                     CALL GVSSTX (CHAR4(1:4),'  Hs')
                  END IF
               END IF
               CALL GVSCTB (CHAR8(1:5),5)
               CALL GVSFMT ('?FMT022')
               WRITE (CHAR8(1:5),FMT,ERR=999) JAA
            END IF
            IBAT=BOUND_TO(1,IAT)
            IF (WIFITI(IBAT)) THEN
               IBAA=ATIAA(IBAT)
               IF (WIFIRO(IBAA)) THEN
                  CALL GVSSTX (CHAR4,'O2 H')
               ELSE
                  CHAR4(1:1)=A1NAME(RESTYP(ATIAA(BOUND_TO(1,IAT))))
               END IF
            ELSE
               CHAR4(1:1)='?'
            END IF
         END IF
      ELSE IF (ISTYPE.EQ.5) THEN



         CALL GVSCTB (CHAR4,7)
         CALL GVSSTX (CHAR4,'?M1303')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
         CALL GVSFMT ('?FMT004')
         IF (WIFPAR(84).EQ.0) THEN
            IF (CHAR8.EQ.'        ') WRITE (CHAR8,FMT,ERR=999) 
     +       SOUADM(4,ISOUP)
         ELSE
            IF (CHAR8.EQ.'        ') THEN
               IOCNT=0
               DO 5 IAT=PNTAAS(SOUADM(1,ISOUP)),PNTAAE(SOUADM(2,ISOUP))
                  IF (.NOT.PROTON(IAT)) IOCNT=IOCNT+1
 5             CONTINUE
               WRITE (CHAR8,FMT,ERR=999) IOCNT
            END IF
         END IF
      ELSE
         CALL GVSTTI2 ('?MOLC22',ISOUP,ISTYPE)
      END IF



      IF ((.NOT.WIFIRA(IAA)).AND.(.NOT.WIFIRN(IAA))) THEN
         DO 11 IAT=PNTAAS(SOUADM(1,ISOUP)),PNTAAE(SOUADM(2,ISOUP))
            JAT=BOUND_TO(1,IAT)
            IF (JAT.NE.0.AND.(JAT.LT.PNTAAS(IAA).OR.JAT.GT.
     +          PNTAAE(IAA))) THEN
               CALL GVSSTX (CHAR4(6:7),'<-')
            END IF
 11      CONTINUE
      END IF



      CALL GVSFMT ('?FMT040')
      CALL GVSCTB (TEXT,LEN(TEXT))
      IF (WIFPAR(1012).EQ.0.AND.WIFPAR(919).EQ.0) THEN
         WRITE (TEXT,FMT,ERR=999) ISOUP,SOUADM(1,ISOUP),NN1,
     +    SOUADM(2,ISOUP),NN2,CHAOUT,CHAR4,CHAR8,LINE2(1:20)
      ELSE
         WRITE (TEXT,FMT,ERR=999) ISOUP,SOUADM(1,ISOUP),NN1,
     +    SOUADM(2,ISOUP),NN2,CHAOUT,CHAR4,CHAR8,LINE2(1:20),
     +    SOUADM(5,ISOUP)
      END IF
      GOTO 998






  999 CONTINUE
      CALL GVSEIW ('MOL309B')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE MOL309BX (ISOUP,TEXT,KILOUT,IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       GVFLEN, ISOUP, IPNT, ISTYPE, IAT, JAT, IERR, IAA, 
     +              JAA, IOCNT, IBAT, IBAA
      LOGICAL       GVFIBN, WIFISO, WIFISH, WIFIRA, WIFIRZ, WIFITI,
     +              WIFIRN, WIFIRO, KILOUT
      CHARACTER*1   CHAOUT
      CHARACTER*4   NN1, NN2
      CHARACTER*7   CHAR4
      CHARACTER*8   CHAR8
      CHARACTER*(*) TEXT







      IF (.NOT.GVFIBN(ISOUP,1,NUMSOU)) THEN
         CALL GVSTTI ('?MOLC21',ISOUP)
         CALL MOL010 ('?M4598')
         IERR=1
         CALL GVSKIL
         GOTO 998
      END IF
      IPNT=SOUPNT(SOUADM(1,ISOUP))
      IF (.NOT.GVFIBN(IPNT,1,MAXMOL)) THEN
         CALL GVSTTI ('?MOLC21',ISOUP)
         CALL MOL010 ('?M4599')
         IERR=1
         CALL GVSKIL
         GOTO 998
      END IF



      IF (WIFISH(ISOUP).AND.WIFPAR(1165).EQ.1) THEN
         IERR=1
         GOTO 998
      END IF



      IERR=0
      CALL GVSCTB (CHAR4,7)
      CALL GVSCTB (NN1,4)
      CALL GVSCTB (NN2,4)
      CHAOUT=' '
      CALL GVSCTB (TEXT,LEN(TEXT))



      CALL GVSCTB (CHAR8,8)
      IF (MODNMB(SOUADM(1,ISOUP)).GT.0) THEN
         CALL GVSFMT ('?FMT041')
         WRITE (CHAR8,FMT,ERR=999) MODNMB(SOUADM(1,ISOUP))
      END IF



      CALL GVSSTX (LINE2(1:20),SOUNAM(IPNT)(1:20))
      IF (GVFLEN(SOUNAM(IPNT)).GT.20) LINE2(18:20)='...'



      IAA=SOUADM(1,ISOUP)
      ISTYPE=SOUADM(5,ISOUP)
      IF (ISTYPE.EQ.0) THEN
         ISTYPE=FAMTYP(RESTYP(SOUADM(1,ISOUP)))
         IF (ISTYPE.NE.0) CALL GVSTTI2 ('?M2366',ISOUP,ISTYPE)
      END IF



      IF (ISTYPE.EQ.1) THEN
         CALL GVSSTX (CHAR4,'?M1301')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
      ELSE IF (ISTYPE.EQ.3) THEN



         CALL GVSSTX (CHAR4,'?M1302')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
      ELSE IF (ISTYPE.EQ.7) THEN



         CALL GVSSTX (CHAR4,'?M1302A')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
      ELSE IF (ISTYPE.EQ.2.OR.ISTYPE.EQ.4.OR.ISTYPE.EQ.6) THEN



         CALL GVSSTX (CHAR4(1:4),ONESA3(SOUADM(1,ISOUP)))
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
         IAT=PNTAAS(IAA)



         IF (WIFISO(ISOUP)) THEN
            IF (BOUND_TO(1,PNTAAS(IAA)).EQ.0) THEN
               CALL GVSSTX (CHAR4(1:4),'  O2')
            ELSE
               JAA=ATIAA(BOUND_TO(1,PNTAAS(IAA)))
               IF (.NOT.GVFIBN(JAA,1,NUMAAT)) THEN
                  CALL GVSSTX (CHAR4(1:4),'  O2')
               ELSE
                  IF (WIFIRA(JAA)) THEN
                     CALL GVSSTX (CHAR4(1:4),'  O2')
                  ELSE IF (WIFIRZ(JAA)) THEN
                     CALL GVSSTX (CHAR4(1:4),'  O.')
                  ELSE 
                     CALL GVSSTX (CHAR4(1:4),'  O ')
                  END IF
               END IF
               CALL GVSCTB (CHAR8(1:5),5)
               CALL GVSFMT ('?FMT022')
               WRITE (CHAR8(1:5),FMT,ERR=999) JAA
            END IF
            IF (WIFITI(BOUND_TO(1,IAT))) THEN
               CHAR4(1:1)=A1NAME(RESTYP(ATIAA(BOUND_TO(1,IAT))))
            ELSE
               CHAR4(1:1)=' '
            END IF



         ELSE IF (WIFISH(ISOUP)) THEN
            IF (BOUND_TO(1,PNTAAS(IAA)).EQ.0) THEN
               CALL GVSSTX (CHAR4(1:4),' Auw')
            ELSE
               JAA=ATIAA(BOUND_TO(1,PNTAAS(IAA)))
               IF (.NOT.GVFIBN(JAA,1,NUMAAT)) THEN
                  CALL GVSSTX (CHAR4(1:4),' Oei')
               ELSE
                  IF (SOUADM(4,ISOUP).LE.1) THEN
                     CALL GVSSTX (CHAR4(1:4),'  H.')
                  ELSE IF (SOUADM(4,ISOUP).EQ.2) THEN
                     CALL GVSSTX (CHAR4(1:4),'  H:')
                  ELSE IF (SOUADM(4,ISOUP).GE.3) THEN
                     CALL GVSSTX (CHAR4(1:4),'  Hs')
                  END IF
               END IF
               CALL GVSCTB (CHAR8(1:5),5)
               CALL GVSFMT ('?FMT022')
               WRITE (CHAR8(1:5),FMT,ERR=999) JAA
            END IF
            IBAT=BOUND_TO(1,IAT)
            IF (WIFITI(IBAT)) THEN
               IBAA=ATIAA(IBAT)
               IF (WIFIRO(IBAA)) THEN
                  CALL GVSSTX (CHAR4,'O2 H')
               ELSE
                  CHAR4(1:1)=A1NAME(RESTYP(ATIAA(BOUND_TO(1,IAT))))
               END IF
            ELSE
               CHAR4(1:1)='?'
            END IF
         END IF
      ELSE IF (ISTYPE.EQ.5) THEN



         CALL GVSCTB (CHAR4,7)
         CALL GVSSTX (CHAR4,'?M1303')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
         CALL GVSFMT ('?FMT004')
         IF (WIFPAR(84).EQ.0) THEN
            IF (CHAR8.EQ.'        ') WRITE (CHAR8,FMT,ERR=999) 
     +       SOUADM(4,ISOUP)
         ELSE
            IF (CHAR8.EQ.'        ') THEN
               IOCNT=0
               DO 5 IAT=PNTAAS(SOUADM(1,ISOUP)),PNTAAE(SOUADM(2,ISOUP))
                  IF (.NOT.PROTON(IAT)) IOCNT=IOCNT+1
 5             CONTINUE
               WRITE (CHAR8,FMT,ERR=999) IOCNT
            END IF
         END IF
      ELSE
         CALL GVSTTI2 ('?MOLC22',ISOUP,ISTYPE)
      END IF
      IF (KILOUT) CALL GVSSTX (CHAR8(5:8),'Kill')



      IF ((.NOT.WIFIRA(IAA)).AND.(.NOT.WIFIRN(IAA))) THEN
         DO 11 IAT=PNTAAS(SOUADM(1,ISOUP)),PNTAAE(SOUADM(2,ISOUP))
            JAT=BOUND_TO(1,IAT)
            IF (JAT.NE.0.AND.(JAT.LT.PNTAAS(IAA).OR.JAT.GT.
     +          PNTAAE(IAA))) THEN
               CALL GVSSTX (CHAR4(6:7),'<-')
            END IF
 11      CONTINUE
      END IF



      CALL GVSFMT ('?FMT040')
      CALL GVSCTB (TEXT,LEN(TEXT))
      IF (WIFPAR(1012).EQ.0.AND.WIFPAR(919).EQ.0) THEN
         WRITE (TEXT,FMT,ERR=999) ISOUP,SOUADM(1,ISOUP),NN1,
     +    SOUADM(2,ISOUP),NN2,CHAOUT,CHAR4,CHAR8,LINE2(1:20)
      ELSE
         WRITE (TEXT,FMT,ERR=999) ISOUP,SOUADM(1,ISOUP),NN1,
     +    SOUADM(2,ISOUP),NN2,CHAOUT,CHAR4,CHAR8,LINE2(1:20),
     +    SOUADM(5,ISOUP)
      END IF
      GOTO 998






  999 CONTINUE
      CALL GVSEIW ('MOL309BX')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE SOUTEX (ISOUP,TEXT,IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       GVFLEN, ISOUP, IPNT, ISTYPE, IAT, IERR, IAA, 
     +              JAA, IOCNT
      LOGICAL       GVFIBN, WIFISO, WIFISH, WIFIRA, WIFIRZ, WIFITI
      CHARACTER*1   CHAOUT
      CHARACTER*4   NN1, NN2
      CHARACTER*7   CHAR4
      CHARACTER*8   CHAR8
      CHARACTER*(*) TEXT







      IF (.NOT.GVFIBN(ISOUP,1,NUMSOU)) THEN
         CALL GVSTTI ('?MOLC21',ISOUP)
         CALL GVSKIL
         GOTO 998
      END IF
      IPNT=SOUPNT(SOUADM(1,ISOUP))
      IF (.NOT.GVFIBN(IPNT,1,MAXMOL)) THEN
         CALL GVSTTI ('?MOLC21',ISOUP)
         CALL GVSKIL
         GOTO 998
      END IF



      IF (WIFISH(ISOUP).AND.WIFPAR(1165).EQ.1) THEN
         IERR=1
         GOTO 998
      END IF



      IERR=0
      CALL GVSCTB (CHAR4,7)
      CALL GVSCTB (NN1,4)
      CALL GVSCTB (NN2,4)
      CHAOUT=' '



      CALL GVSCTB (CHAR8,8)
      IF (MODNMB(SOUADM(1,ISOUP)).GT.0) THEN
         CALL GVSFMT ('?FMT041')
         WRITE (CHAR8,FMT,ERR=999) MODNMB(SOUADM(1,ISOUP))
      END IF



      CALL GVSSTX (LINE2(1:20),SOUNAM(IPNT)(1:20))
      IF (GVFLEN(SOUNAM(IPNT)).GT.20) LINE2(18:20)='...'



      IAA=SOUADM(1,ISOUP)
      ISTYPE=SOUADM(5,ISOUP)
      IF (ISTYPE.EQ.0) THEN
         ISTYPE=FAMTYP(RESTYP(SOUADM(1,ISOUP)))
         IF (ISTYPE.NE.0) CALL GVSTTI2 ('?M2366',ISOUP,ISTYPE)
      END IF
      IF (ISTYPE.EQ.6) ISTYPE=4
      IF (ISTYPE.EQ.1) THEN



         CALL GVSSTX (CHAR4,'?M1301')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
      ELSE IF (ISTYPE.EQ.3) THEN



         CALL GVSSTX (CHAR4,'?M1302')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
      ELSE IF (ISTYPE.EQ.7) THEN



         CALL GVSSTX (CHAR4,'?M1302A')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
      ELSE IF (ISTYPE.EQ.2.OR.ISTYPE.EQ.4.OR.ISTYPE.EQ.6) THEN



         CALL GVSSTX (CHAR4(1:4),ONESA3(SOUADM(1,ISOUP)))
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
         IAT=PNTAAS(IAA)



         IF (WIFISO(ISOUP)) THEN
            IF (BOUND_TO(1,PNTAAS(IAA)).EQ.0) THEN
               CALL GVSSTX (CHAR4(1:4),'  O2')
            ELSE
               JAA=ATIAA(BOUND_TO(1,PNTAAS(IAA)))
               IF (.NOT.GVFIBN(JAA,1,NUMAAT)) THEN
                  CALL GVSSTX (CHAR4(1:4),'  O2')
               ELSE
                  IF (WIFIRA(JAA)) THEN
                     CALL GVSSTX (CHAR4(1:4),'  O2')
                  ELSE IF (WIFIRZ(JAA)) THEN
                     CALL GVSSTX (CHAR4(1:4),'  O.')
                  ELSE 
                     CALL GVSSTX (CHAR4(1:4),'  O ')
                  END IF
               END IF
               CALL GVSCTB (CHAR8(1:5),5)
               CALL GVSFMT ('?FMT022')
               WRITE (CHAR8(1:5),FMT,ERR=999) JAA
            END IF
            IF (WIFITI(BOUND_TO(1,IAT))) THEN
               CHAR4(1:1)=A1NAME(RESTYP(ATIAA(BOUND_TO(1,IAT))))
            ELSE
               CHAR4(1:1)=' '
            END IF



         ELSE IF (WIFISH(ISOUP)) THEN
            IF (BOUND_TO(1,PNTAAS(IAA)).EQ.0) THEN
               CALL GVSSTX (CHAR4(1:4),' Auw')
            ELSE
               JAA=ATIAA(BOUND_TO(1,PNTAAS(IAA)))
               IF (.NOT.GVFIBN(JAA,1,NUMAAT)) THEN
                  CALL GVSSTX (CHAR4(1:4),' Oei')
               ELSE
                  IF (SOUADM(4,ISOUP).LE.1) THEN
                     CALL GVSSTX (CHAR4(1:4),'  H ')
                  ELSE IF (SOUADM(4,ISOUP).EQ.2) THEN
                     CALL GVSSTX (CHAR4(1:4),'  H2')
                  ELSE IF (SOUADM(4,ISOUP).EQ.3) THEN
                     CALL GVSSTX (CHAR4(1:4),'  H3')
                  ELSE IF (SOUADM(4,ISOUP).GE.4) THEN
                     CALL GVSSTX (CHAR4(1:4),'  Hs')
                  END IF
               END IF
               CALL GVSCTB (CHAR8(1:5),5)
               CALL GVSFMT ('?FMT022')
               WRITE (CHAR8(1:5),FMT,ERR=999) JAA
            END IF
            IF (WIFITI(BOUND_TO(1,IAT))) THEN
               CHAR4(1:1)=A1NAME(RESTYP(ATIAA(BOUND_TO(1,IAT))))
            ELSE
               CHAR4(1:1)=' '
            END IF
         END IF



      ELSE IF (ISTYPE.EQ.5) THEN
         CALL GVSCTB (CHAR4,7)
         CALL GVSSTX (CHAR4,'?M1303')
         CALL GVSSTX (NN1,NUMNAM(SOUADM(1,ISOUP))(1:4))
         CALL GVSSTX (NN2,NUMNAM(SOUADM(2,ISOUP))(1:4))
         CHAOUT=CHANAM(SOUADM(1,ISOUP))
         CALL GVSFMT ('?FMT004')
         IF (WIFPAR(84).EQ.0) THEN
            IF (CHAR8.EQ.'        ') WRITE (CHAR8,FMT,ERR=999) 
     +       SOUADM(4,ISOUP)
         ELSE
            IF (CHAR8.EQ.'        ') THEN
               IOCNT=0
               DO 5 IAT=PNTAAS(SOUADM(1,ISOUP)),PNTAAE(SOUADM(2,ISOUP))
                  IF (.NOT.PROTON(IAT)) IOCNT=IOCNT+1
 5             CONTINUE
               WRITE (CHAR8,FMT,ERR=999) IOCNT
            END IF
         END IF
      ELSE
         CALL GVSTTI2 ('?MOLC22',ISOUP,ISTYPE)
      END IF




      CALL SETARR (PNTAAS(SOUADM(1,ISOUP)),PNTAAE(SOUADM(1,ISOUP)),
     + CHAR4(6:7))



      CALL GVSFMT ('?FMT1082')
      CALL GVSCTB (TEXT,LEN(TEXT))
      WRITE (TEXT,FMT,ERR=999) ISOUP,SOUADM(1,ISOUP),NN1,
     + SOUADM(2,ISOUP),NN2,CHAOUT,CHAR4,CHAR8,LINE2(1:20)
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('SOUTEX')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE MOL309C 

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       ISOUP
      LOGICAL       WIFISH







      IF (NUMSOU.LE.0.OR.WIFPAR(84).EQ.0) THEN
         WIFPAR(1164)=99999
         WIFPAR(1165)=1
         GOTO 998
      END IF






      WIFPAR(1166)=0
      WIFPAR(1165)=0



      DO 10 ISOUP=1,NUMSOU
         IF (WIFISH(ISOUP)) WIFPAR(1166)=WIFPAR(1166)+1
   10 CONTINUE



      IF (WIFPAR(1166).GT.WIFPAR(1164)) WIFPAR(1165)=1



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE WIF301

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'DATBAS.INC'
      INCLUDE       'ANATRA.INC'
      INCLUDE       'IRIGRA.INC'
      INTEGER       ISOUP, I, ITO, J
      LOGICAL       WIFISR, WASIR6







      IF (IRSTAT(6).EQ.1) THEN
         WASIR6=.TRUE.
         CALL GRTKON
      ELSE
         WASIR6=.FALSE.
      END IF
      IF (NUMAAT.LE.0) THEN
         CALL GVSTTE ('?NOTLIS')
         GOTO 100
      END IF



      CALL GVSNL6 (1)
      CALL SHOWTEXTIF ('?M1188')
      CALL GVSNL6 (1)



      DO 30 ISOUP=1,NUMSOU
         IF (.NOT.WIFISR(ISOUP)) GOTO 30
         CALL GVSCTB (LINE,80)
         CALL GVSTTI ('?MOLNUM',ISOUP)
         IF (DATLOG.GT.0) CALL GVSTUI (DATLOG,'?MOLNUM',ISOUP)



         IF (WIFPAR(1).EQ.0) THEN



            DO 10 I=SOUADM(1,ISOUP),SOUADM(2,ISOUP),50
               ITO=MIN(SOUADM(2,ISOUP),I+49)
               CALL GVSFMT ('?FMT1083')
               CALL GVSCTB (LINE,80)
               WRITE(LINE,FMT,ERR=999) I,ITO,(A1NAME(RESTYP(J)),J=I,ITO)
               CALL GVSTT6 (LINE)
   10       CONTINUE
         ELSE IF (WIFPAR(1).EQ.1) THEN



            DO 20 I=SOUADM(1,ISOUP),SOUADM(2,ISOUP),10
               ITO=MIN(SOUADM(2,ISOUP),I+9)
               CALL GVSFMT ('?FMT1084')
               CALL GVSCTB (LINE,80)
               WRITE (LINE,FMT,ERR=999) I,ITO,(ONESA3(J),J=I,ITO)
               CALL GVSTT6 (LINE)
               IF (DATLOG.GT.0) CALL GVSTTU (DATLOG,LINE)
   20       CONTINUE
         ELSE
            CALL GVSTTB ('?M3345')
         END IF
   30 CONTINUE
      GOTO 100



  999 CONTINUE
      CALL GVSEIW ('WIF301')



  100 CONTINUE
      IF (WASIR6) CALL GRTKOF





      RETURN
      END
      SUBROUTINE WIF301U (IUNIT)


















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'ANATRA.INC'
      INCLUDE       'IRIGRA.INC'
      INTEGER       ISOUP, I, ITO, J, IUNIT
      LOGICAL       WIFISR







      IF (NUMAAT.LE.0) THEN
         CALL GVSTTE ('?NOTLIS')
         GOTO 998
      END IF



      DO 30 ISOUP=1,NUMSOU
         IF (.NOT.WIFISR(ISOUP)) GOTO 30
         IF (FUTURE(SOUADM(1,ISOUP)).NE.0.AND.
     +       FUTURE(SOUADM(2,ISOUP)).NE.0) GOTO 30
         CALL GVSNLU (IUNIT,1)
         CALL GVSTUI (IUNIT,'?MOLNUM',ISOUP)



         IF (WIFPAR(1).EQ.0) THEN



            DO 10 I=SOUADM(1,ISOUP),SOUADM(2,ISOUP),50
               ITO=MIN(SOUADM(2,ISOUP),I+49)
               CALL GVSFMT ('?FMT1083')
               CALL GVSCTB (LINE,80)
               WRITE(LINE,FMT,ERR=999) I,ITO,(A1NAME(RESTYP(J)),J=I,ITO)
               CALL GVSTTU (IUNIT,LINE)
 10         CONTINUE
         ELSE IF (WIFPAR(1).EQ.1) THEN



            DO 20 I=SOUADM(1,ISOUP),SOUADM(2,ISOUP),10
               ITO=MIN(SOUADM(2,ISOUP),I+9)
               CALL GVSFMT ('?FMT1084')
               CALL GVSCTB (LINE,80)
               WRITE (LINE,FMT,ERR=999) I,ITO,(ONESA3(J),J=I,ITO)
               CALL GVSTTU (IUNIT,LINE)
 20         CONTINUE
         ELSE
            CALL GVSTTB ('?M3345')
         END IF
 30   CONTINUE
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('WIF301')



 998  CONTINUE


      RETURN
      END
      SUBROUTINE SHOIAT (IAA)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'ESPACE.INC'
      INCLUDE       'CLUFAM.INC'
      INCLUDE       'GRPINC.INC'
      INCLUDE       'SEARCH.INC'
      INCLUDE       'IRIGRA.INC'
      INCLUDE       'HBONDS.INC'
      INTEGER       ISOUP, ICLU, IFAM, IDUMMY, IAT, IAA, I, J, 
     +              GVFLEN, IBND, ATBT(100), GVFIN0, SHICNT, GVFCBT, 
     +              ATBTCT, IEND
      REAL          ATVOUT
      LOGICAL       WIF051, GVFIBN, WIFIRW, WIFIRA, WIFROK, WIFIRR,
     +              WIFIRI, CH5EQCH5
      CHARACTER*1   ATFLG2, NOBFLG
      CHARACTER*2   BNDFLG
      CHARACTER*3   ATFLAG
      CHARACTER*4   ORGDIF, ATMLOC, T4
      CHARACTER*5   CHAR5







      IF (NUMAAT.LE.0) THEN
         CALL GVSTTI ('?M0058',IAA)
         GOTO 998
      END IF
      IF (.NOT.WIFIRI(IAA)) THEN
         CALL GVSTTI ('?M0059',IAA)
         GOTO 998
      END IF
      ISOUP=CHAINN(2,IAA)
      IF (.NOT.GVFIBN(ISOUP,1,NUMSOU)) THEN
         CALL GVSTTB ('?BUGG13')
         CALL MOL207
         ISOUP=CHAINN(2,IAA)
         IF (.NOT.GVFIBN(ISOUP,1,NUMSOU)) THEN
            CALL GVSTT6 ('?BUGG14')
            CHAINN(2,IAA)=1
            GOTO 998
         ELSE
            CALL GVSTT6 ('?BUGG15')
         END IF
      END IF



      ATBTCT=0
      CALL GVSIT0 (ATBT,100)

         IF (WIFPAR(114).NE.0) CALL HBO010




      IF (WIFPAR(1003).EQ.0) THEN
         WIFPAR(1206)=IAA
      END IF




      IF (WIFIRW(IAA)) THEN
         CALL GVSTT6 ('Water(s):')
         CALL WIF236A (IAA)
         GOTO 998
      END IF




      IF (.NOT.WIFIRW(IAA)) THEN
         DO 8 IAT=PNTAAS(IAA),PNTAAE(IAA)
            DO 5 IBND=1,8
               IF (BOUND_TO(IBND,IAT).NE.0) THEN
                  ATBTCT=ATBTCT+1
                  ATBT(ATBTCT)=ATIAA(BOUND_TO(IBND,IAT))
               END IF
 5          CONTINUE
 8       CONTINUE
      END IF



      CALL DIF028 (6,IAA)
      SHICNT=GVFCBT(ISSHIT,NUMAAF)
      IF (SHICNT.NE.NUMAAF.AND.SHICNT.NE.0) THEN
         IF (WIFIRR(IAA)) THEN
            IF (WIFROK(IAA)) THEN
               IF (ISSHIT(IAA)) THEN
                  CALL GVSTT6 ('?M0932')
               ELSE
                  CALL GVSTT6 ('?M0933')
               END IF
            ELSE
               CALL GVSTT6 ('?M0934')
            END IF
         END IF
      END IF



      IF (WIFPAR(28).EQ.0.AND.NOBOND(IAA)) CALL GVSTT6 ('?M2132')




      IF (.NOT.GVFIBN(CHAINN(2,IAA),1,NUMSOU)) THEN
         CALL GVSTTB ('?BUGG13')
         GOTO 998
      END IF



      IF (WIFPAR(28).EQ.0.AND.WIFIRA(IAA)) THEN







         IF (NUMFAM.GT.0) THEN
            DO 20 IFAM=1,MAXFAM
               IF (GVFIBN(IFAM,FAMILY(1,IFAM),FAMILY(2,IFAM))) THEN
                  CALL GVSFMT ('?M0149')
                  CALL GVSCTB (LINE,80)
                  WRITE (LINE,FMT,ERR=999) IFAM,FAMILY(1,IFAM),
     +             FAMILY(2,IFAM),(FAMNAM(IFAM)(I:I),I=1,
     +             MIN(45,GVFLEN(FAMNAM(IFAM))))
                  CALL GVSTT6 (LINE)
               END IF
   20       CONTINUE
         END IF
      END IF



      CALL SHOWLAST (IAA,IEND)



      IF (WIFPAR(28).EQ.0) CALL GVSTT6 ('?GENHD1')
      DO 30 IAT=PNTAAS(IAA),IEND
         IF (.NOT.USEAT(IAT)) GOTO 30



         ATMLOC=T4(ONESAT(IAT))
         IF (ATMLOC(1:3).EQ.'Bug') THEN
            CALL GVSTTB ('?M4643')
            CALL GVSTTI2 ('?M4641',IAA,IAT)
            CALL GVSTTI2 ('?M4642',PNTAAS(IAA),PNTAAE(IAA))
         END IF



         CALL GVSCTB (CHAR5,5)
         IF (ATMLOC(1:1).EQ.'''') THEN
            CALL GVSSTX (CHAR5(2:4),ATMLOC(2:4))
            CHAR5(5:5)=''''
         ELSE
            CALL GVSSTX (CHAR5,ATMLOC)
         END IF



         IF (.NOT.ISATOK(IAT).OR.CH5EQCH5(ORGNAM(IAT),CHAR5)) THEN
            CALL GVSCTB (ORGDIF,4)
         ELSE
            CALL GVSSTX (ORGDIF,ORGNAM(IAT)(1:4))
         END IF
         CALL GVSCTB (BNDFLG,2)
         IF (BOUND_TO(1,IAT).NE.0) BNDFLG='<-'
         IF (BOUND_TO(2,IAT).NE.0) BNDFLG='<='
         IF (BOUND_TO(3,IAT).NE.0) BNDFLG='<<'
         IF (ISATOK(IAT)) THEN
            ATFLAG(1:1)='+'
         ELSE
            ATFLAG(1:1)='-'
         END IF
         IF (PROTON(IAT)) THEN
            ATFLAG(2:2)='P'
         ELSE
            ATFLAG(2:2)=' '
         END IF
         IF (WIFPAR(114).NE.0) THEN
            IF (USABLE(IAT)) THEN
               IF (DONACC(IAT).EQ.-1) THEN
                  ATFLAG(3:3)='A'
               ELSE IF (DONACC(IAT).EQ.0) THEN
                  ATFLAG(3:3)='B'
               ELSE IF (DONACC(IAT).EQ.1) THEN
                  ATFLAG(3:3)='D'
               ELSE 
                  ATFLAG(3:3)='?'
               END IF
            ELSE
               ATFLAG(3:3)=' '
            END IF
         ELSE
            ATFLAG(3:3)=' '
         END IF
         IF (NOBOND(IAA)) THEN
            NOBFLG='N'
         ELSE
            NOBFLG=' '
         END IF



         IF (WIFPAR(185).LE.1) THEN
            ATVOUT=ATTVAL(IAT)
         ELSE
            ATVOUT=ATTVL2(IAT)
         END IF



         IF (WIFPAR(1163).EQ.0) THEN
            ATFLG2=' '
         ELSE
            IF (ROW1(IAT)) THEN
               ATFLG2='!'
            ELSE
               ATFLG2=' '
            END IF
         END IF



         CALL GVSCTB (BIGLIN,132)
         IF (PROTON(IAT)) THEN
            CALL GVSFMT ('?FMT1085')
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) CHAR5,XCOORD(IAT),
     +       YCOORD(IAT),ZCOORD(IAT),XBFACT(IAT),
     +       WEIGHT(IAT),VDWRAD(IAT),ATCOLR(IAT),NOBFLG,
     +       ATFLAG,ATVOUT,BNDFLG,ORGDIF,ATFLG2
         ELSE
            CALL GVSFMT ('?FMT1086')
            CALL GVSCTB (BIGLIN,132)
            WRITE (BIGLIN,FMT,ERR=999) CHAR5,XCOORD(IAT),
     +       YCOORD(IAT),ZCOORD(IAT),ACCESS(IAT),XBFACT(IAT),
     +       WEIGHT(IAT),VDWRAD(IAT),ATCOLR(IAT),NOBFLG,
     +       ATFLAG,ATVOUT,BNDFLG,ORGDIF,ATFLG2
         END IF
         CALL GVSTT6 (BIGLIN)
   30 CONTINUE



      IF (WIFPAR(1003).EQ.0) THEN
         DO 40 IBND=1,100
            IF (ATBT(IBND).NE.0) THEN
               IDUMMY=ATBT(IBND)
               CALL SHOIAAX (IDUMMY)
            END IF
   40    CONTINUE
      ELSE
         IF (GVFIN0(ATBT,100).GT.1) THEN
            CALL SHOWTEXT ('?M0852')
            DO 50 J=1,100
               IF (ATBT(J).NE.0.AND.ATBT(J).NE.WIFPAR(1206))
     +          CALL DIF028 (6,ATBT(J))
   50       CONTINUE
         END IF
      END IF
      CALL GVSNL6 (1)
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('SHOIAT')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE SHOCRYPDB

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'MAKMOL.INC'
      INTEGER       ICRY







      CALL MOL018
      IF (WIFPAR(491).LE.1) THEN
         CALL GVSTTE ('?M2372')
         GOTO 998
      END IF



      DO 10 ICRY=1,WIFPAR(491)-1
         CALL GVSTTI ('?M2373',ICRY)
         CALL GVSTT6 (CRYCRD(ICRY))
         CALL GVSTT6 (SCLCR1(ICRY))
         CALL GVSTT6 (SCLCR2(ICRY))
         CALL GVSTT6 (SCLCR3(ICRY))
         CALL GVSNL6 (1)
 10   CONTINUE



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE SETARR (IAT1,IAT2,BNDFLG)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IAT, IAT1, IAT2, IAA, IBND, ARRCNT
      LOGICAL       GVFIBN
      CHARACTER*2   BNDFLG







      ARRCNT=0



      DO 20 IAT=IAT1,IAT2
         IAA=ATIAA(IAT)



         DO 10 IBND=1,8
            IF (BOUND_TO(IBND,IAT).EQ.0) GOTO 20
            IF (GVFIBN(BOUND_TO(IBND,IAT),PNTAAS(IAA),
     +       PNTAAE(IAA))) GOTO 10
            ARRCNT=ARRCNT+1
 10      CONTINUE
 20   CONTINUE



      IF (ARRCNT.EQ.1) THEN
         CALL GVSSTX (BNDFLG,'<-')
      ELSE IF (ARRCNT.EQ.2) THEN
         CALL GVSSTX (BNDFLG,'<=')
      ELSE IF (ARRCNT.GE.3) THEN
         CALL GVSSTX (BNDFLG,'<<')
      END IF





      RETURN
      END   
