      program Mercury ! BB June 01 2017.
c Calculation of angular momentum and other parameters
c for the Mecury-Sun systems in gravitational units G=c=1.
      implicit real*8 (a-h,o-z)
      logical ltest
      parameter(iuo=6)
      parameter(c=2.998d+08) ! 2.998d+08 [m/s] = 1 -> c.
      parameter(G=6.674d-11) ! 6.674d-11 [m^3 kg^{-1} s^{-2}] = 1 -> G.
      parameter(y=365.d00*24.d00*3600.d0)  ! Earth year in [s].
      parameter(ym=116.d00*24.d00*3600.d0) ! Mercury year in [s].
      parameter(r=70006.D06) ! Mercury distance to sun [m].
      parameter(sm=1.989d30) ! Sun mass [kg].
      ltest=.false.
      if(ltest) stop "Mercury: ltest."
      ltest=.true.
      write(iuo,'(/," sm [kg], r [m] =",2g12.4)') sm,r
c
      write(iuo,'(/," In units of seconds:")') 
      s=1.d00
      xm=s/c            ! meter    in seconds.
      xkg=G*xm**3/s**2  ! kilogram in seconds.
      write(iuo,'(/,"  m [s], kg [s] =",2g12.4)') xm,xkg
c
      smsec=sm*xkg
      rsec=r*xm
      write(iuo,'(" sm [s],  r [s] =",2g12.4)') smsec,rsec
      omega=sqrt(smsec/rsec**3)
      write(iuo,'(" omega [1/s]    =",1g12.4)') omega
      beta=rsec*omega
      phiyear=omega*ym
      write(iuo,'(" phiyear [rad]  =",1g12.4)') phiyear
      pi=acos(-1.d00)
      tpi=2*acos(-1.d00)
      phiyear=360*phiyear/tpi
      write(iuo,'(" phiyear [deg]  =",1g12.4)') phiyear
      write(iuo,'(" The deviation from 360 is due to the",/,
     &  " approximations for omega and the shape of the orbit.",/)')
c
      write(iuo,'(" velocity beta  =",1g12.4)') beta
      h=rsec*beta
      write(iuo,'(" angular mom h  =",1g12.4)') h
c
      write(iuo,'(" Einsteinian advance of the perihelion:")')
      delta=6*pi*(smsec/h)**2 
      write(iuo,'(" delta in radians =",g12.4)') delta 
      delta=(360*delta)/tpi
      write(iuo,'(" delta in degree  =",g12.4)') delta 
      delta=3600*delta
      write(iuo,'(" delta in seconds =",g12.4)') delta 
      delta=(100.d00/0.2056d00)*delta
      write(iuo,'(" seconds in 100 earth years:",g12.4)') delta 
      write(iuo,'(" The deviation from 42.98 comes from the angular",
     &            " momentum approximation.",/)')
c      
      stop "Mercury: all done."
      end
