The Physical Constants unit provides a set of common constants, such as Pi and the gravitational constant, in various systems of measurement units. The default system of units is CGS, so named for having a length unit in centimeters, a mass unit in grams, and a time unit in seconds. In CGS, the charge unit is the esu, and the temperature unit is the Kelvin. The constants can also be obtained in the standard MKS system of units, where length is in meters, mass in kilograms, and time in seconds. For MKS units, charge is in Coloumbs, and temperature in Kelvin.
Any constant can optionally be converted from the standard units into any other available units. This facility makes it easy to ensure that all parts of the code are using a consistent set of physical constant values and unit conversions.
For example, a program using this unit might obtain the value of Newton's gravitational constant in units of Mpc Gyr by calling
In this example, the local variable G is set equal to the result, (to five significant figures).
call PhysicalConstants_get ("Newton", G, len_unit="Mpc", time_unit="Gyr", mass_unit="Msun")
Physical constants are taken from K. Nahamura et al. (Particle Data Group), J. Phys. G 37, 075021 (2010).