      real*8 FUNCTION DVNENE(rnene)
c  original Aziz-Slaman routine used reduced units.  This version has
c  r and v in atomic units.  Russ Pack 98/5/5
      IMPLICIT NONE
      real*8 a, alpha, c6, c8, c10, c, d, chnge, b, beta, en, em
      real*8 epsnene, rmnene, vnene, x, x2, x6, x8, x10, rnene
      real*8 ua, ub, dub, uc, duc, d1x, dd1x, ud, dud
      integer icall
      character*8 procname
      parameter (procname='vnene   ')
c  ------1---------2---------3---------4---------5---------6---------7--
      COMMON/POTNENE/A,ALPHA,C6,C8,C10,C,D,CHNGE,B,BETA,EN,EM
      data icall /0/
      save
c  determine parameters on first call.
      if (icall.eq.0) then
         call nenedat
c  well depth and rm, both in au.
         epsnene = 1.337985194d-04
         rmnene = 5.841143031d0
         icall=1
      end if
c  start here on further calls
      vnene = 0.d0
      x = rnene/rmnene
      if(x.gt.1.d04) return
      X2=X*X
      X6=X2**3
      X8=X2*X6
      X10=X8*X2
      UA=A
      
	UB=ALPHA*X-BETA*X*X
      !DUB=ALPHA-2.D0*BETA*X		
	!UB and DUB are Modified by Keming Zhang
	IF(174.D0<UB) THEN 
		UB=174.D0
		DUB=0
	ELSE
		DUB=ALPHA-2*BETA*X
	END IF

      UC=C6/X6+C8/X8+C10/X10
      DUC=-(6.d0*C6/X6+8.D0*C8/X8+10.D0*C10/X10)/X
      D1X=D/X-1.D0
      DD1X=-D/X2
      IF(174.D0.LT.C*D1X*D1X)THEN
         UD=DEXP(-174.D0)
         DUD=0.D0
         IF(174.D0.lt.UB)THEN
            IF(X.GE.CHNGE) then
               DVNENE=-DUC
            else
               DVNENE=-DUC*UD-UC*DUD
            end if
         ELSE
            IF(X.GE.CHNGE) then
               DVNENE=-UA*DEXP(-UB)*DUB-DUC
            else
               DVNENE=-UA*DEXP(-UB)*DUB-DUC*UD-UC*DUD
            end if
         END IF
      ELSE
         UD=DEXP(-C*D1X*D1X)
         DUD=-2.d0*C*D1X*DD1X*UD
         IF(174.D0.lt.UB)THEN
            IF(X.GE.CHNGE) then
               DVNENE=-DUC
            else
               DVNENE=-DUC*UD-UC*DUD
            end if
         ELSE
            IF(X.GE.CHNGE) then
               DVNENE=-UA*DEXP(-UB)*DUB-DUC
            else
               DVNENE=-UA*DEXP(-UB)*DUB-DUC*UD-UC*DUD
            end if
         END IF
      END IF
      dvnene = epsnene*dvnene/rmnene
      RETURN
      END
