



      SUBROUTINE VDW000 (DONE)


















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'OPTION.INC'
      LOGICAL       DONE



      IF (OPTIN.EQ.MEN6COD(44)) RETURN
      CALL MEN027 (OPTIN,DONE)

      RETURN
      END

      REAL FUNCTION WIFVDW(CHAR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      LOGICAL       MOL009
      CHARACTER*(*) CHAR
      INTEGER       IC, IC1



      IC1=ICHAR(CHAR(1:1))
      IC=ICHAR(CHAR(2:2))
      IF (IC1.EQ.ICHAR(' ').OR.CHAR(1:1).EQ.'''') THEN
         IF (IC.EQ.ICHAR('C')) THEN
            WIFVDW=WIFPAR(200)/100.0
         ELSE IF (IC.EQ.ICHAR('N')) THEN
            WIFVDW=WIFPAR(201)/100.0
         ELSE IF (IC.EQ.ICHAR('O')) THEN
            WIFVDW=WIFPAR(202)/100.0
         ELSE IF (IC.EQ.ICHAR('S')) THEN
            WIFVDW=WIFPAR(203)/100.0
         ELSE IF (IC.EQ.ICHAR('P')) THEN
            WIFVDW=WIFPAR(204)/100.0
         ELSE IF (IC.EQ.ICHAR('I')) THEN
            WIFVDW=WIFPAR(205)/100.0
         ELSE IF (IC.EQ.ICHAR('Z')) THEN
            WIFVDW=WIFPAR(206)/100.0
         ELSE IF (IC.EQ.ICHAR('A')) THEN
            WIFVDW=WIFPAR(207)/100.0
         ELSE IF (MOL009(CHAR)) THEN
            WIFVDW=WIFPAR(211)/100.0
         ELSE IF (IC.EQ.ICHAR('B')) THEN
            WIFVDW=WIFPAR(212)/100.0
         ELSE IF (IC.EQ.ICHAR('H').OR.
     +            IC.EQ.ICHAR('D').OR.
     +            IC.EQ.ICHAR('M').OR.
     +            IC.EQ.ICHAR('Q')) THEN
            WIFVDW=WIFPAR(209)/100.0
         ELSE
            WIFVDW=WIFPAR(210)/100.0
         END IF
      ELSE IF (IC1.LE.ICHAR('6').AND.IC1.GE.ICHAR('1')) THEN
         WIFVDW=WIFPAR(209)/100.0         
      ELSE IF (CHAR(1:2).EQ.'FE') THEN
         WIFVDW=WIFPAR(208)/100.0
      ELSE
         WIFVDW=WIFPAR(210)/100.0
      END IF

      RETURN
      END
      SUBROUTINE VDW002

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IUNIT, IAA, IAT, I, IERR, GVFLFR
      REAL          VDWVAL
      LOGICAL       GVFISF, GRTFILE, CH4EQCH4, CH5EQCH5
      CHARACTER*4   AATYPE
      CHARACTER*5   ATTYPE
      CHARACTER*80  LOCLIN







      CALL GVSCCC (LINE,WHERIS,'VDWRAD.LST')
      IF (.NOT.GVFISF(LINE)) CALL GVSSTX (LINE,'VDWRAD.LST')
      IF (.NOT.GRTFILE(IUNIT,LINE)) GOTO 999



 10   CONTINUE



         CALL GVSCTB (LOCLIN,80)
         CALL GETLINE (IUNIT,LOCLIN,IERR)
         IF (LOCLIN(1:4).EQ.'*END') GOTO 998
         IF (IERR.NE.0) GOTO 999



         CALL SPLITLINE (LOCLIN,AATYPE,LINE2)
         CALL SPLITLINE (LINE2,ATTYPE,LINE3)
         I=GVFLFR(1,VDWVAL,LINE3)
         IF (I.LE.0) GOTO 999



         DO 100 IAA=1,NUMAAT
            IF (CH4EQCH4(ONESA3(IAA),AATYPE)) THEN
               DO 90 IAT=PNTAAS(IAA),PNTAAE(IAA)
                  IF (CH5EQCH5(ONESAT(IAT),ATTYPE)) VDWRAD(IAT)=VDWVAL
 90            CONTINUE
            END IF
 100     CONTINUE
      GOTO 10



  999 CONTINUE
      CALL GVSEIR ('VDW002')



  998 CONTINUE
      CALL GVSCLF (IUNIT)


      RETURN
      END   
      SUBROUTINE VDW003

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IUNIT, IAA, IAT, JAA
      LOGICAL       GOTFILE, CH4EQCH4







      CALL GVSBTF (WRK2TF,MAXAA)



      CALL GVSDEL ('VDWRAD.OUT')
      IF (.NOT.GOTFILE(IUNIT,'VDWRAD.OUT')) GOTO 999



      CALL GVSFMT ('?FMT1321')
      DO 100 IAA=1,NUMAAT
         IF (WRK2TF(IAA)) GOTO 100



         DO 10 IAT=PNTAAS(IAA),PNTAAE(IAA)
            CALL GVSCTB (LINE,80)
            WRITE (LINE,FMT,ERR=999) ONESA3(IAA),ONESAT(IAT),VDWRAD(IAT)
            CALL GVSTTU (IUNIT,LINE)
 10      CONTINUE



         DO 20 JAA=1,NUMAAT
            IF (CH4EQCH4(ONESA3(IAA),ONESA3(JAA))) WRK2TF(JAA)=.TRUE.
 20      CONTINUE
 100  CONTINUE
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('VDW003')



  998 CONTINUE
      CALL GVSTTU (IUNIT,'*END')
      CALL GVSCLF (IUNIT)


      RETURN
      END   
      SUBROUTINE VDW004

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IAA, IAT, JAA, JAT, IERR, I, GVFFFF
      REAL          VDWVAL
      LOGICAL       CH4EQCH4, CH5EQCH5







      CALL WIFGAT (' ',IAA,IAT,IERR)
      IF (IAT.LE.0.OR.IERR.NE.0) GOTO 998



      CALL R1PROMPT ('?P_RADIUS2',1.8)



      I=GVFFFF(1,VDWVAL)



      DO 100 JAA=1,NUMAAT
         IF (CH4EQCH4(ONESA3(IAA),ONESA3(JAA))) THEN
            DO 90 JAT=PNTAAS(JAA),PNTAAE(JAA)
               IF (CH5EQCH5(ONESAT(IAT),ONESAT(JAT))) VDWRAD(JAT)=VDWVAL
 90         CONTINUE
         END IF
 100  CONTINUE



  998 CONTINUE


      RETURN
      END   
