Skip to main content

Constants

Physical and mathematical constants defined as real(kind=double), parameter.

Kind Parameters

Mapped from iso_c_binding:

NameC EquivalentFortran Kind
byteC_SIGNED_CHAR1-byte integer
shortC_SHORT2-byte integer
intgrC_INT4-byte integer
floatC_FLOAT4-byte real
doubleC_DOUBLE8-byte real

Physical Constants

ConstantValueUnitsDescription
pi$4 \arctan(1.0)$Pi
earth_radius6371.0kmAverage radius of Earth
acc_gravity9.80616m/s²Acceleration of gravity
stefan_boltzmann$5.670373 \times 10^-8$W/m²K⁴Stefan–Boltzmann constant
boltzmann$1.38064852 \times 10^-23$J/KBoltzmann constant
speed_of_light299792458.0m/sSpeed of light in vacuum
atomic_mass$1.660539040 \times 10^-27$kgAtomic mass unit
avogadro$6.022140857 \times 10^23$mol⁻¹Avogadro constant

Usage

use fpl
implicit none

real(kind=double) :: circumference
circumference = 2.0 * pi * earth_radius

write(*,*) "Earth circumference:", circumference, "km"