      program FigV03 ! BB June 012017.
c Gravitational units G=c=1.
c Parameter values in units of the central mass.
      implicit real*8 (a-h,o-z)
      logical ltest
      parameter(iuo=6,iud=8,ngnu=2000)
      parameter(sm=1.d00,h=4*sm) ! Central mass, angular momentum.
      parameter(rmin=3*sm,rmax=20*sm) ! Distance range.
      ltest=.false.
      if(ltest) stop "FigV03: ltest."
      ltest=.true.
      write(iuo,'(/," sm, rmax =",2g12.4,/)') sm,rmax
      h2=h**2
      tmr=2*sm*rmax
      write(iuo,'(" h, tmr   =",2g12.4,/)') h,tmr
c
      dr=(rmax-rmin)/ngnu
      open(iud,file="V03.d",form='formatted',status='unknown')
      do i=0,ngnu
        r=rmin+i*dr
        xn1=2*sm/r        ! 1. Newton contribution.
        xn2=(h/r)**2      ! 2. Newton contribution.
        vn=xn2-xn1        ! Newton effective potential.
        tmr=2*sm*r
        vnn=(h2-tmr)/r**2 ! vnn=vn tested.
c xn1 and gr have the same sign (negative contributions)
        gr=2*sm*h**2/r**3 ! Schwarzschild gravity contribution.
        vg=vn-gr          ! Gravity effective potential.
        dv=vg-vn
        write(iud,'(i9,4g16.7)') i,r,vn,vg,dv
      enddo
      close(iud)
      stop "FigV03: all done."
      end
