SF_CONSTANTS

Description

SciFortran module for physical and mathematical constants

Quick access

Routines:

isinfty(), isnan(), wait(), timestamp(), print_date(), stop_error()

Subroutines and functions

interface  sf_constants/isinfty(a)

Evaluates an integer, real or complex number and returns a logical expression. If .true. the input is infinite.

Parameters:

a [integer, real, complex, in] – Number to evaluate

Return:

bool [logical] – Result

interface  sf_constants/isnan(a)

Evaluates an integer, real or complex quantity and returns a logical expression. If .true. the input is NaN.

Parameters:

a [integer, real, complex, in]

Return:

bool [logical]

interface  sf_constants/wait(time)

Waits for a given time interval (integer, real or double) expressed in milliseconds before continuing execution.

Parameters:

time [integer, real] – desired sleep interval [ms]

subroutine  sf_constants/timestamp([unit])

Prints the date and time to unit. The date is in the format Timestamp: [day][month name][year][h]:[m]:[s].[ms]

Options:

unit [integer] – Output unit. Default 6

subroutine  sf_constants/print_date(dummy, unit)
Parameters:
  • dummy (8) [integer]

  • unit [integer]

subroutine  sf_constants/stop_error(msg)

Aborts the program with nonzero exit code. The statement STOP "msg" will return exit code 0 when compiled using gfortran. stop_error() uses the statement stop 1 which returns an exit code 1 and a print statement to print the message.

Parameters:

msg [character(len=*)] – Message to print on stderr

List of physical and numerical constants

This is a list of all the physical and numerical constants in sf_constants, which are listed as parameters:

Commonly used parameters

dbl, ddp, dp, epsilonq, epsilonr, euler, gamma_euler, max_int, max_real, one, pi, pi2, sp, sqrt2, sqrt3, sqrt6, xi, zero

sf_constants/dbl

“double” precision

Type:

integer

Attributes:

public, parameter

Default:

8

sf_constants/ddp

“quad” precision

Type:

integer

Attributes:

public, parameter

Default:

16

sf_constants/dp

“double” precision, alternative naming

Type:

integer

Attributes:

public, parameter

Default:

8

sf_constants/epsilonq

Smallest quad precision real number

Type:

real

Attributes:

public, parameter

Default:

1.d-30

sf_constants/epsilonr

Smallest double precision real number

Type:

real

Attributes:

public, parameter

Default:

epsilon(1.d0)

sf_constants/euler

Real Euler number \(e\)

Type:

real

Attributes:

public, parameter

Default:

2.7182818284590452353602874713526624977572470936999595749669676277240766303535d0

sf_constants/gamma_euler

Real number Euler-Mascheroni constant \(\gamma\)

Type:

real

Attributes:

public, parameter

Default:

0.57721566490153286060d0

sf_constants/max_int

Largest integer number

Type:

integer

Attributes:

public, parameter

Default:

huge(1)

sf_constants/max_real

Largest real number

Type:

real

Attributes:

public, parameter

Default:

huge(1.d0)

sf_constants/one

Complex number \(1+i0\)

Type:

complex

Attributes:

public, parameter

Default:

(1.d0,0.d0)

sf_constants/pi

Real number \(\pi\)

Type:

real

Attributes:

public, parameter

Default:

3.14159265358979323846264338327950288419716939937510d0

sf_constants/pi2

Real number \(2\pi\)

Type:

real

Attributes:

public, parameter

Default:

6.28318530717959d0

sf_constants/sp

“single” precision

Type:

integer

Attributes:

public, parameter

Default:

kind(1.0)

sf_constants/sqrt2

Real number \(\sqrt(2)\)

Type:

real

Attributes:

public, parameter

Default:

1.41421356237309504880169d0

sf_constants/sqrt3

Real number \(\sqrt(3)\)

Type:

real

Attributes:

public, parameter

Default:

1.73205080756887729352745d0

sf_constants/sqrt6

Real number \(\sqrt(6)\)

Type:

real

Attributes:

public, parameter

Default:

2.44948974278317809819728d0

sf_constants/xi

Complex number \(0+i1\)

Type:

complex

Attributes:

public, parameter

Default:

(0.d0,1.d0)

sf_constants/zero

Complex number \(0+i0\)

Type:

complex

Attributes:

public, parameter

Default:

(0.d0,0.d0)

Physical constants

Expressed in the SI units

avogadro_constant, bohr_magneton, bohr_magneton_in_evot, bohr_magneton_in_hzot, bohr_magneton_in_inverse_meters_per_tesla, bohr_magneton_in_kot, bohr_radius, boltzmann_constant, boltzmann_constant_in_evok, boltzmann_constant_in_hzok, boltzmann_constant_in_inverse_meters_per_kelvin, compton_wavelength, compton_wavelength_over_2_pi, electric_constant, electron_charge_to_mass_quotient, electron_g_factor, electron_gyromag__ratio, electron_gyromag__ratio_over_2_pi, electron_mag__mom_, electron_mag__mom__to_bohr_magneton_ratio, electron_mass, electron_mass_energy_equivalent, electron_mass_energy_equivalent_in_mev, electron_volt, electron_volt_atomic_mass_unit_relationship, electron_volt_hartree_relationship, electron_volt_hertz_relationship, electron_volt_inverse_meter_relationship, electron_volt_joule_relationship, electron_volt_kelvin_relationship, electron_volt_kilogram_relationship, elementary_charge, elementary_charge_over_h, faraday_constant, faraday_constant_for_conventional_electric_current, fine_structure_constant, josephson_constant, joule_electron_volt_relationship, joule_hertz_relationship, joule_inverse_meter_relationship, joule_kelvin_relationship, joule_kilogram_relationship, kelvin_atomic_mass_unit_relationship, kelvin_electron_volt_relationship, kelvin_hartree_relationship, kelvin_hertz_relationship, kelvin_inverse_meter_relationship, kelvin_joule_relationship, kelvin_kilogram_relationship, kilogram_atomic_mass_unit_relationship, kilogram_electron_volt_relationship, kilogram_hartree_relationship, kilogram_hertz_relationship, kilogram_inverse_meter_relationship, kilogram_joule_relationship, kilogram_kelvin_relationship, lattice_parameter_of_silicon, natural_unit_of_action, natural_unit_of_action_in_ev_s, natural_unit_of_energy, natural_unit_of_energy_in_mev, natural_unit_of_length, natural_unit_of_mass, natural_unit_of_mom_um, natural_unit_of_mom_um_in_mevoc, natural_unit_of_time, natural_unit_of_velocity, newtonian_constant_of_gravitation, planck_constant, planck_constant_in_ev_s, planck_constant_over_2_pi, rydberg_constant, rydberg_constant_times_c_in_hz, rydberg_constant_times_hc_in_ev, rydberg_constant_times_hc_in_j, speed_of_light_in_vacuum, standard_acceleration_of_gravity, stefan_boltzmann_constant

sf_constants/avogadro_constant

Number of particles per mole \(N_{A} [mol^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.602214129000d+24

sf_constants/bohr_magneton

Natural unit of the electron magnetic moment \(\mu_{B} = \frac{e\hbar}{2m_{e}} [J\cdot T^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.927400968000d-23

sf_constants/bohr_magneton_in_evot

Natural unit of the electron magnetic moment \(\mu_{B} = \frac{e\hbar}{2m_{e}} [eV\cdot T^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.578838180660d-04

sf_constants/bohr_magneton_in_hzot

Natural unit of the electron magnetic moment \(\mu_{B} = \frac{e\hbar}{2m_{e}} [Hz\cdot T^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.139962455500d+11

sf_constants/bohr_magneton_in_inverse_meters_per_tesla

Natural unit of the electron magnetic moment \(\mu_{B} = \frac{e\hbar}{2m_{e}} [m^{-1}\cdot T^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

46.6864498d0000

sf_constants/bohr_magneton_in_kot

Natural unit of the electron magnetic moment \(\mu_{B} = \frac{e\hbar}{2m_{e}} [K \cdot T^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.67171388d000

sf_constants/bohr_radius

Approximate nucleus-electron distance in an Hydrogen atom \(a_{0} = \frac{4\pi\epsilon_{0}\hbar^{2}}{e^{2}m_{e}} [m]\)

Type:

real

Attributes:

public, parameter

Default:

0.529177210920d-10

sf_constants/boltzmann_constant

Proportionality constant between energy and temperature of an ideal gas \(k_{B} [J \cdot K^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.138064880000d-22

sf_constants/boltzmann_constant_in_evok

Proportionality constant between energy and temperature of an ideal gas \(k_{B} [eV \cdot K^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.861733240000d-04

sf_constants/boltzmann_constant_in_hzok

Proportionality constant between energy and temperature of an ideal gas \(k_{B} [Hz \cdot K^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.208366180000d+11

sf_constants/boltzmann_constant_in_inverse_meters_per_kelvin

Proportionality constant between energy and temperature of an ideal gas \(k_{B} [m^{-1} \cdot K^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

69.503476d00000

sf_constants/compton_wavelength

Wavelength of a photon having the same rest energy as the electron \(\lambda_{c} = \frac{h}{m_{e}c} [m]\)

Type:

real

Attributes:

public, parameter

Default:

0.242631023890d-11

sf_constants/compton_wavelength_over_2_pi

Normalized Compton wavelength \(\lambda_{c} = \frac{\hbar}{m_{e}c} [m]\)

Type:

real

Attributes:

public, parameter

Default:

0.386159268000d-12

sf_constants/electric_constant

Vacuum permittivity \(\epsilon_{0} [F\cdot m^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.885418781700d-11

sf_constants/electron_charge_to_mass_quotient

Ratio between electronic charge and mass \(\frac{q_{e}}{m_{e}} [C \cdot kg^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

-0.175882008800d+12

sf_constants/electron_g_factor

Electron g-factor \(g\) (Dimensionless)

Type:

real

Attributes:

public, parameter

Default:

-0.200231930436d+01

sf_constants/electron_gyromag__ratio

Electron gyromagnetic ratio \(\gamma_{e} = \frac{g_{e}\mu_{B}}{\hbar}[rad\cdot s^{-1}\cdot T^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.176085970800d+12

sf_constants/electron_gyromag__ratio_over_2_pi

Normalized electron gyromagnetic ratio \(\gamma_{e} = \frac{g_{e}\mu_{B}}{2\pi\hbar}[rad\cdot s^{-1}\cdot T^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.280249526600d+05

sf_constants/electron_mag__mom_

Electron magnetic moment \(\mu_{e} [J\cdot T^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

-0.928476430000d-23

sf_constants/electron_mag__mom__to_bohr_magneton_ratio

Ratio between electron magnetic moment and Bohr magneton \(\frac{\mu_{e}}{\mu_{e}}=\frac{g}{2}\)

Type:

real

Attributes:

public, parameter

Default:

-0.100115965218d+01

sf_constants/electron_mass

Mass of the electron \(m_{e}\;[kg]\)

Type:

real

Attributes:

public, parameter

Default:

0.910938291000d-30

sf_constants/electron_mass_energy_equivalent

Electron rest energy \([J]\)

Type:

real

Attributes:

public, parameter

Default:

0.818710506000d-13

sf_constants/electron_mass_energy_equivalent_in_mev

Electron rest energy \([MeV]\)

Type:

real

Attributes:

public, parameter

Default:

0.510998928d00

sf_constants/electron_volt

Equivalent of \(1\;eV\;[J]\)

Type:

real

Attributes:

public, parameter

Default:

0.160217656500d-18

sf_constants/electron_volt_atomic_mass_unit_relationship

Atomic mass unit equivalence of \(1\;eV\)

Type:

real

Attributes:

public, parameter

Default:

0.107354415000d-08

sf_constants/electron_volt_hartree_relationship

Equivalent of \(1\;eV\;[Ha]\)

Type:

real

Attributes:

public, parameter

Default:

0.03674932379d0

sf_constants/electron_volt_hertz_relationship

Equivalent of \(1\;eV\;[Hz]\)

Type:

real

Attributes:

public, parameter

Default:

0.241798934800d+15

sf_constants/electron_volt_inverse_meter_relationship

Equivalent of \(1\;eV\;[m^-1]\)

Type:

real

Attributes:

public, parameter

Default:

0.806554429000d+06

sf_constants/electron_volt_joule_relationship

Equivalent of \(1\;eV\;[J]\)

Type:

real

Attributes:

public, parameter

Default:

0.160217656500d-18

sf_constants/electron_volt_kelvin_relationship

Equivalent of \(1\;eV\;[K]\)

Type:

real

Attributes:

public, parameter

Default:

0.116045190000d+05

sf_constants/electron_volt_kilogram_relationship

Equivalent of \(1\;eV\;[kg]\)

Type:

real

Attributes:

public, parameter

Default:

0.178266184500d-35

sf_constants/elementary_charge

Charge unit (charge of the proton) \([C]\)

Type:

real

Attributes:

public, parameter

Default:

0.160217656500d-18

sf_constants/elementary_charge_over_h

Charge unit (charge of the proton) divided by \(h\;[m^{-2} kg^{-1} s^{2} A]\)

Type:

real

Attributes:

public, parameter

Default:

0.241798934800d+15

sf_constants/faraday_constant

Quotient between total charge and number of charge carriers (2019 SI units) \(\frac{q}{n}=eN_{A}\;[C\;mol^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.964853328900d+05

sf_constants/faraday_constant_for_conventional_electric_current

Quotient between total charge and number of charge carriers (1990 “conventional” values) \(\frac{q}{n}=eN_{A}\;[C\;mol^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.964853251000d+05

sf_constants/fine_structure_constant

Fundamental constant characterizing the strength of the electromagnetic interaction between elementary charged particles \(\alpha=\frac{e^2}{2\epsilon_{0}hc}\)

Type:

real

Attributes:

public, parameter

Default:

0.729735256980d-02

sf_constants/josephson_constant

Inverse of the magnetic flux quantum \(K_{J}=\frac{2e}{h}\;[Hz\;V^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

0.483597870000d+15

sf_constants/joule_electron_volt_relationship

Equivalent of \(1J\) in \([eV]\)

Type:

real

Attributes:

public, parameter

Default:

0.624150934000d+19

sf_constants/joule_hertz_relationship

Equivalent of \(1J\) in \([Hz]\), from \(f=\frac{E}{h}\)

Type:

real

Attributes:

public, parameter

Default:

0.150919031100d+34

sf_constants/joule_inverse_meter_relationship

Equivalent of \(1J\) in \([m^{-1}]\), from \(\frac{1}{\lambda}=\frac{E}{hc}\)

Type:

real

Attributes:

public, parameter

Default:

0.503411701000d+25

sf_constants/joule_kelvin_relationship

Equivalent of \(1J\) in \([K]\), from \(T=\frac{E}{k_{B}}\)

Type:

real

Attributes:

public, parameter

Default:

0.724297160000d+23

sf_constants/joule_kilogram_relationship

Equivalent of \(1J\) in \([kg]\), from \(m=\frac{E}{c^{2}}\)

Type:

real

Attributes:

public, parameter

Default:

0.111265005600d-16

sf_constants/kelvin_atomic_mass_unit_relationship

Equivalent of \(1K\) in \([amu]\)

Type:

real

Attributes:

public, parameter

Default:

0.925108680000d-13

sf_constants/kelvin_electron_volt_relationship

Equivalent of \(1K\) in \([eV]\)

Type:

real

Attributes:

public, parameter

Default:

0.861733240000d-04

sf_constants/kelvin_hartree_relationship

Equivalent of \(1K\) in \([Ha]\)

Type:

real

Attributes:

public, parameter

Default:

0.316681140000d-05

sf_constants/kelvin_hertz_relationship

Equivalent of \(1K\) in \([Hz]\)

Type:

real

Attributes:

public, parameter

Default:

0.208366180000d+11

sf_constants/kelvin_inverse_meter_relationship

Equivalent of \(1K\) in \([m^{-1}]\)

Type:

real

Attributes:

public, parameter

Default:

69.503476d00000

sf_constants/kelvin_joule_relationship

Equivalent of \(1K\) in \([J]\) (Boltzmann constant)

Type:

real

Attributes:

public, parameter

Default:

0.138064880000d-22

sf_constants/kelvin_kilogram_relationship

Equivalent of \(1K\) in \([kg]\)

Type:

real

Attributes:

public, parameter

Default:

0.153617900000d-39

sf_constants/kilogram_atomic_mass_unit_relationship
Type:

real

Attributes:

public, parameter

Default:

0.602214129000d+27

sf_constants/kilogram_electron_volt_relationship
Type:

real

Attributes:

public, parameter

Default:

0.560958885000d+36

sf_constants/kilogram_hartree_relationship
Type:

real

Attributes:

public, parameter

Default:

0.206148596800d+35

sf_constants/kilogram_hertz_relationship
Type:

real

Attributes:

public, parameter

Default:

0.135639260800d+50

sf_constants/kilogram_inverse_meter_relationship
Type:

real

Attributes:

public, parameter

Default:

0.452443873000d+42

sf_constants/kilogram_joule_relationship
Type:

real

Attributes:

public, parameter

Default:

0.898755178700d+17

sf_constants/kilogram_kelvin_relationship
Type:

real

Attributes:

public, parameter

Default:

0.650965820000d+40

sf_constants/lattice_parameter_of_silicon
Type:

real

Attributes:

public, parameter

Default:

0.543102050400d-09

sf_constants/natural_unit_of_action
Type:

real

Attributes:

public, parameter

Default:

0.105457172600d-33

sf_constants/natural_unit_of_action_in_ev_s
Type:

real

Attributes:

public, parameter

Default:

0.658211928000d-15

sf_constants/natural_unit_of_energy
Type:

real

Attributes:

public, parameter

Default:

0.818710506000d-13

sf_constants/natural_unit_of_energy_in_mev
Type:

real

Attributes:

public, parameter

Default:

0.510998928d00

sf_constants/natural_unit_of_length
Type:

real

Attributes:

public, parameter

Default:

0.386159268000d-12

sf_constants/natural_unit_of_mass
Type:

real

Attributes:

public, parameter

Default:

0.910938291000d-30

sf_constants/natural_unit_of_mom_um
Type:

real

Attributes:

public, parameter

Default:

0.273092429000d-21

sf_constants/natural_unit_of_mom_um_in_mevoc
Type:

real

Attributes:

public, parameter

Default:

0.510998928d0

sf_constants/natural_unit_of_time
Type:

real

Attributes:

public, parameter

Default:

0.128808866833d-20

sf_constants/natural_unit_of_velocity
Type:

real

Attributes:

public, parameter

Default:

0.299792458000d+09

sf_constants/newtonian_constant_of_gravitation
Type:

real

Attributes:

public, parameter

Default:

0.667384000000d-10

sf_constants/planck_constant
Type:

real

Attributes:

public, parameter

Default:

0.662606957000d-33

sf_constants/planck_constant_in_ev_s
Type:

real

Attributes:

public, parameter

Default:

0.413566751600d-14

sf_constants/planck_constant_over_2_pi
Type:

real

Attributes:

public, parameter

Default:

0.105457172600d-33

sf_constants/rydberg_constant
Type:

real

Attributes:

public, parameter

Default:

0.109737315685d+08

sf_constants/rydberg_constant_times_c_in_hz
Type:

real

Attributes:

public, parameter

Default:

0.328984196036d+16

sf_constants/rydberg_constant_times_hc_in_ev
Type:

real

Attributes:

public, parameter

Default:

13.60569253d000

sf_constants/rydberg_constant_times_hc_in_j
Type:

real

Attributes:

public, parameter

Default:

0.217987217100d-17

sf_constants/speed_of_light_in_vacuum
Type:

real

Attributes:

public, parameter

Default:

0.299792458000d+09

sf_constants/standard_acceleration_of_gravity
Type:

real

Attributes:

public, parameter

Default:

9.80665d000000

sf_constants/stefan_boltzmann_constant
Type:

real

Attributes:

public, parameter

Default:

0.567037300000d-07