



      SUBROUTINE MOL500



















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR







      IF (WIFPAR(1176).NE.0) GOTO 998



      CALL MOL505 (IERR)



      CALL MOL507 (IERR)



      CALL MOL506



 998  CONTINUE


      RETURN
      END
      SUBROUTINE MOL503


















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







      IF (WIFPAR(1176).NE.0) GOTO 998
      IF (NUMAAF.LE.1) THEN
         CALL GVSTTE ('?SOULOW')
         GOTO 998
      END IF



      DO 10 IAA=1,NUMAAF-1



         IF (CHAINN(2,IAA).EQ.CHAINN(2,IAA+1)) GOTO 10
         IF (SOUPNT(IAA).NE.SOUPNT(IAA+1)) GOTO 10



         CALL MOL307A (IAA,IERR)
         IF (IERR.EQ.0) THEN
            CALL GVSTTI ('?M0139',IAA)
            GOTO 10
         END IF



         CALL GVSTTE ('?MOLC15')
   10 CONTINUE



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE MOL504 (IFT1,IFT2,TEXT,IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      LOGICAL       WIFIRI
      CHARACTER*(*) TEXT
      INTEGER       IFT1, IFT2, IERR, IAA, GVFLEN







      IF (WIFPAR(1176).NE.0) GOTO 998
      IF (.NOT.WIFIRI(IFT1)) GOTO 998
      IF (.NOT.WIFIRI(IFT2)) GOTO 998
      IF (GVFLEN(TEXT).LE.0) GOTO 998



      IERR=1



      DO 10 IAA=IFT1,IFT2
         CALL GVSSTX (SOUNAM(SOUPNT(IAA)),TEXT)
   10 CONTINUE



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE MOL505 (IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR, IAA, GVFLEN, IPNT, ILOOP, PPNT







      IF (WIFPAR(1176).NE.0) GOTO 998
      IF (NUMAAT.LE.0) GOTO 998
      IF (NUMAAT.GT.1.AND.GVFLEN(SOUNAM(1)).LE.0) THEN
         CALL GVSTT6 ('?M3962')
         CALL GVSSTX (SOUNAM(1),'DIRTY HACK')
         CALL GVSKIL
      END IF



      IERR=0
      PPNT=0



      DO 20 ILOOP=1,10
         DO 10 IAA=1,NUMAAT
            IPNT=SOUPNT(IAA)
            IF (IPNT.NE.PPNT) THEN
               IF (GVFLEN(SOUNAM(IPNT)).LE.0) THEN
                  IERR=1
                  IF (WIFPAR(1012).GE.1) THEN
                     CALL GVSTT6 ('?M3959')
                     CALL DIF008 ('?M3960',IAA)
                     CALL GVSTTI ('?M3961',IPNT)
                     CALL MOL010 ('?M3963')
                     SOUPNT(IAA)=1
                     CALL GVSKIL
                  END IF
               END IF
            END IF
            PPNT=SOUPNT(IAA)
   10    CONTINUE
         IF (IERR.EQ.0) GOTO 998
   20 CONTINUE



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE MOL506

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IAA







      IF (WIFPAR(1176).NE.0) GOTO 998
      IF (NUMAAT.LT.2) GOTO 998



      DO 10 IAA=2,NUMAAT
         IF (FAMTYP(RESTYP(IAA)).EQ.6) THEN
            CALL MOL208 (IAA)
         END IF
   10 CONTINUE



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE MOL507 (IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       ISOUP, IAA, IERR, I
      LOGICAL       CLEANROW(MAXSET), GVFIBN







      IF (WIFPAR(1176).NE.0) GOTO 998
      IF (NUMAAT.LE.0) THEN
         DO 10 ISOUP=1,MAXSET
            DO 5 I=1,80
               SOUNAM(ISOUP)(I:I)=' '
 5          CONTINUE
   10    CONTINUE
         IERR=1
         GOTO 998
      END IF



      IERR=0
      CALL GVSBTT (CLEANROW,MAXSET)



      IF (NUMAAT.GT.0) THEN
         DO 20 IAA=1,NUMAAT
            IF (.NOT.GVFIBN(SOUPNT(IAA),1,MAXSET)) THEN
               SOUPNT(IAA)=1
            END IF
            CLEANROW(SOUPNT(IAA))=.FALSE.
   20    CONTINUE
      END IF



      DO 40 ISOUP=1,MIN(NUMSOU+5,MAXSET)
         IF (CLEANROW(ISOUP)) THEN

            DO 30 I=1,80
               SOUNAM(ISOUP)(I:I)=' '
 30         CONTINUE
         END IF
   40 CONTINUE



  998 CONTINUE


      RETURN
      END   
