Module Math_Constants ! Define double precision math constants
  implicit none
  ! INTEGER, PARAMETER :: DP = SELECTED REAL KIND (15,307)
  INTEGER, PARAMETER :: DP = KIND (1.d0) ! Alternate form
  real(DP), parameter:: Deg_Per_Rad = 57.295779513082320876798155_DP
  real(DP), parameter:: Rad_Per_Deg = 0.017453292519943295769237_DP
  real(DP), parameter:: e_Value = 2.71828182845904523560287_DP
  real(DP), parameter:: e_Recip = 0.3678794411714423215955238_DP
  real(DP), parameter:: e_Squared = 7.389056098930650227230427_DP
  real(DP), parameter:: Log10_of_e = 0.4342944819032518276511289_DP
  real(DP), parameter:: Euler = 0.5772156649015328606_DP
  real(DP), parameter:: Euler_Log = -0.5495393129816448223_DP
  real(DP), parameter:: Gamma_val = 0.577215664901532860606512_DP
  real(DP), parameter:: Gamma_Log = -0.549539312981644822337662_DP
  real(DP), parameter:: Golden_Ratio = 1.618033988749894848_DP
  real(DP), parameter:: Ln_2 = 0.6931471805599453094172321_DP
  real(DP), parameter:: Ln_10 = 2.3025850929940456840179915_DP
  real(DP), parameter:: Log10_of_2 = 0.3010299956639811952137389_DP
  real(DP), parameter:: pi_Value = 3.141592653589793238462643_DP
  real(DP), parameter:: pi_Ln = 1.144729885849400174143427_DP
  real(DP), parameter:: pi_Log10 = 0.4971498726941338543512683_DP
  real(DP), parameter:: pi_Over_2 = 1.570796326794896619231322_DP
  real(DP), parameter:: pi_Over_3 = 1.047197551196597746154214_DP
  real(DP), parameter:: pi_Over_4 = 0.7853981633974483096156608_DP
  real(DP), parameter:: pi_Recip = 0.3183098861837906715377675_DP
  real(DP), parameter:: pi_Squared = 9.869604401089358618834491_DP
  real(DP), parameter:: pi_Sq_Root = 1.772453850905516027298167_DP
  real(DP), parameter:: Sq_Root_of_2 = 1.4142135623730950488_DP
  real(DP), parameter:: Sq_Root_of_3 = 1.7320508075688772935_DP
End Module Math_Constants

Program Test
  use Math_Constants ! Access all constants
  real :: pi ! Define local data type
  print *, 'pi Value: ', pi_Value ! Display a constant
  pi = pi_Value; print *, 'pi = ', pi ! Convert to lower precision
End Program Test ! Running gives:
! pi Value: 3.1415926535897931 ! pi = 3.14159274

