program GravUnitsShort ! BB May 20, Nov 10 2017. c Gravitational units G=c=1. implicit real*8 (a-h,o-z) logical ltest 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) ! Year in [s]. parameter(iuo=6,xly=y*c) ! Light year in [m]. parameter(em=5.972d24,r=6371.d03) ! Earth mass [kg], radius [m]. ltest=.false. if(ltest) stop "GravUnits: ltest." ltest=.true. write(iuo,'(/," Program GravUnitsShort.f:")') write(iuo,'(/," Schwarzschild radius and gravitational units")') write(iuo,'(/," c [m/s]",10x,"=",g11.4,4x,"speed of light")') c write(iuo,'(" G [m^3/(kg*s^2)] =",g11.4, & 4x,"gravitational constant")') G write(iuo,'(" y [s] =",g11.4,4x,"year")') y write(iuo,'(" ly [m]",12x,"=",g11.4,4x,"light year xly")') xly write(iuo,'(" em [kg] =",g11.4,4x,"earth mass")') em write(iuo,'(" r [m] =",g11.4,4x,"earth radius")') r xg=G*em/r**2 write(iuo,'(" g [m/s^2]",8x,"=",f7.4,1x, & "= G*em/r^2 earth surface grav acceleration")') xg sr=2*G*em/c**2 write(iuo,'(/, & "(a) Earth Schwarzschild radius sr=2*G*m/c^2 [m] =",1g12.4)') sr sror=sr/r write(iuo,'(4x,"Ratio sr/r [dimensionless] =",17x,g12.4)') sror c c Everything in seconds: write(iuo,'(/,"(b) G=c=1 and everything in seconds [s]:",/)') s=1.d00 ! one second = 1 xm=s/c ! meter ear=(r*xm) ! Earth radius conversion from [m] to [s]. write(iuo,'(" Earth radius [s]",20x,"=",1g12.4)') ear xkg=G*xm**3/s**2 eam=(em*xkg) ! Earth mass conversion from [kg] to [s]. write(iuo,'(" Earth mass [s]",20x,"=",1g12.4)') eam sror=2*eam/ear write(iuo,'(" Ratio 2*em/r = sr/r [dimensionless] =",g12.4)') sror c c Everything in years: write(iuo,'(/,"(c) G=c=1 and everything in years [y]:",/)') xm=xm/y xkg=xkg/y xg=xg*y ! agrees with xg=em*xkg/(r*xm)**2 cg=xg*c/y ! To convert from [1/y] to [1/s] and then to [m/s^2]. eam=(em*xkg) ear=(r*xm) xmor=2*eam/ear write(iuo,'(" Earth radius [y]",20x,"=",1g12.4)') ear write(iuo,'(" Earth mass [y]",20x,"=",1g12.4)') eam write(iuo,'(" Ratio 2*em/r = sr/r [dimensionless] =",g12.4)') sror c c Everything in meter: write(iuo,'(/,"(d) G=c=1 and everything in meters [m]:",/)') xm=1.d00 s=xm*c xkg=G*xm**3/s**2 xg=em*xkg/(r*xm)**2 cg=xg*c**2 ! To convert from [1/m] to [m/s^2]. write(iuo,'(" g [m/s^2] check",4x,"=",g11.4)') cg eam=(em*xkg) ear=(r*xm) xmor=2*eam/ear write(iuo,'(" Earth radius [m]",20x,"=",1g12.4)') ear write(iuo,'(" Earth mass [m]",20x,"=",1g12.4)') eam write(iuo,'(" Ratio 2*em/r = sr/r [dimensionless] =",g12.4)') sror c c Everything in light years: write(iuo,'(/,"(e) G=c=1 and everything in light years [ly]:")') write(iuo,'(/," The same as everything in years, because")') write(iuo,'(" ly = c*y and we use c = 1 units.",/)') c stop "GravUnits: all done." end