



      SUBROUTINE WALSTRIPFILNAM (FILNAM,IERR)

















      IMPLICIT      NONE
      INTEGER       IERR, GVFPLS, GVFPOS, GVFLEN, IPOS, LENTXT
      CHARACTER*(*) FILNAM







      IF (GVFLEN(FILNAM).LE.0) THEN
         CALL GVSTTB ('?M1478')
         CALL GVSKIL
         IERR=1
         GOTO 998
      END IF



      IERR=0
      LENTXT=LEN(FILNAM)



      IPOS=GVFPLS(FILNAM,'/')
      IF (IPOS.GT.0) CALL GVSCTB (FILNAM(1:IPOS),IPOS)
      CALL GVSSHL (FILNAM)



      IPOS=GVFPOS(FILNAM,'.')
      IF (IPOS.GT.0) CALL GVSCTB (FILNAM(IPOS:LENTXT),LENTXT-IPOS+1)



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE PRP101 (ISEQ,FILE,CHAINM)



















      IMPLICIT      NONE
      INTEGER       GVFLEN, I, ISEQ
      CHARACTER*(*) FILE
      CHARACTER*80  LLINE, FMTL
      CHARACTER*1   CHAINM,LCHAIM







      IF (LEN(FILE).LE.0) THEN
         CALL GVSTTB ('?NEWB99')
         GOTO 998
      END IF
      IF (GVFLEN(FILE).LE.0) THEN
         CALL GVSTTB ('?NEWB100')
         GOTO 998
      END IF



      CALL GVSSTX (LCHAIM,CHAINM)
      IF (LCHAIM.EQ.' ') LCHAIM='-'
      CALL GVSCTB (LLINE,80)



      CALL GVSFMTL (FMTL,'?FMT1540')
      WRITE (LLINE,FMTL,ERR=999) (FILE(I:I),I=1,
     + MIN(60,GVFLEN(FILE))),LCHAIM
      IF (ISEQ.GT.0) THEN
         CALL GVSFMTL (FMTL,'?FMT1521')
         WRITE (LLINE(77:80),FMTL,ERR=999) ISEQ
      END IF
      CALL GVSRDB (LLINE)
      CALL GVSTT6 (LLINE)
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('PRP101')



 998  CONTINUE


      RETURN
      END
      SUBROUTINE PRP109 (IIN1,IIN2,POSVEC,IERR)


















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR, IIN1, IIN2, IFT1, IFT2, IUSE, IAA, IONE
      REAL          POSVEC(6), ENDN(3), ENDC(3), XYZ0T3(0:2,1:MAXAA)
      EQUIVALENCE   (XYZ0T3(0,1),XYZCAS(1,1))







      IERR=0
      CALL GVSRT0 (ENDN,3)
      CALL GVSRT0 (ENDC,3)
      CALL GVSRT0 (POSVEC,6)






      IFT1=IIN1
      IFT2=IIN2
      IF (IFT1.EQ.0) CALL WIFGRN (IFT1,IFT2,' ')
      IF (IFT1.EQ.0) GOTO 998
      IF (IFT2-IFT1.LT.3) THEN
         CALL GVSTTE ('?NEWE277')
         GOTO 998
      END IF



      IUSE=0
      DO 10 IAA=IFT1,IFT2
         IUSE=IUSE+1
         XYZ0T3(0,IUSE)=XCOORD(PNTAAC(IAA))
         XYZ0T3(1,IUSE)=YCOORD(PNTAAC(IAA))
         XYZ0T3(2,IUSE)=ZCOORD(PNTAAC(IAA))
   10 CONTINUE



      IONE=1






      POSVEC(1)=ENDN(1)
      POSVEC(2)=ENDN(2)
      POSVEC(3)=ENDN(3)
      POSVEC(4)=ENDC(1)
      POSVEC(5)=ENDC(2)
      POSVEC(6)=ENDC(3)



 998  CONTINUE


      RETURN
      END
      SUBROUTINE PRP140 (IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR
      LOGICAL       GVFISF
      CHARACTER*80  SIGFIL, SIGCOP







      IERR=0



      CALL GVSCCC (SIGFIL,FILDIR(27),'SIGMAP.FIL')
      IF (GVFISF(SIGFIL)) GOTO 998



      CALL GVSCCC (SIGCOP,WHERIS,'SIGMAP.FIL')
      IF (.NOT.GVFISF(SIGCOP)) THEN
         CALL GVSTT6 ('?M3688')
         IERR=1
      END IF



      CALL GVSCPP (SIGFIL,SIGCOP,BIGLIN)



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE PRP107 (NUMDEL)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IAA, NUMDEL
      LOGICAL       WIFIR1, WIFIR3, WIFIRA, WIFROK







      NUMDEL=0



   10 CONTINUE
      DO 20 IAA=NUMAAT,1,-1
         IF (.NOT.WIFIRA(IAA)) GOTO 20
         IF (WIFIR1(IAA).OR.WIFIR3(IAA)) THEN
            IF (.NOT.WIFROK(IAA)) THEN
               CALL MOL105 (IAA)
               NUMDEL=NUMDEL+1
               CALL MOL200
               GOTO 10
            END IF
         END IF
   20 CONTINUE





      RETURN
      END   
      SUBROUTINE PRP107A (NUMDEL)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IAA, IAT, NUMDEL
      LOGICAL       WIFIRA







      NUMDEL=0



   10 CONTINUE
      DO 30 IAA=1,NUMAAT
         IF (.NOT.WIFIRA(IAA)) GOTO 30
         DO 20 IAT=PNTAAS(IAA),PNTAAS(IAA)+3
            IF (.NOT.ISATOK(IAT)) THEN
               CALL MOL105 (IAA)
               NUMDEL=NUMDEL+1
               CALL MOL200
               GOTO 10
            END IF
 20      CONTINUE
 30   CONTINUE





      RETURN
      END   
      SUBROUTINE PRP116


















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'DATBAS.INC'
      INTEGER       ISEQ, I, IERR







      CALL GVSCCC (LINE,FILDIR(27),'ALLDSP.DSP')
      CALL GETFILE (11,' ',LINE,IERR)
      IF (IERR.NE.0) GOTO 998



      CALL GVSCTB (ALLHST,MAXADB*MAXSEQ)



      CALL GVSFMT ('?FMT487')
      DO 10 ISEQ=1,NBINDB
         READ (11,FMT,END=999,ERR=999) (ALLHST(I,ISEQ),I=1,
     +    NAAFIL(ISEQ))
   10 CONTINUE



      CALL GVSCLF (11)
      GOTO 998



  999 CONTINUE
      CALL GVSTTE ('?NEWE271')



 998  CONTINUE


      RETURN
      END
