(git:374b731)
Loading...
Searching...
No Matches
physcon.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Definition of physical constants:
10!>
11!> a_bohr : Bohr radius [m]
12!> a_fine : Fine-structure constant
13!> a_mass : Atomic mass unit [kg]; conversion factor [u] -> [kg]
14!> angstrom : Conversion factor [Bohr] -> [Angstrom]
15!> bar : Conversion factor [a.u.] -> [bar]
16!> bohr : Conversion factor [Angstrom] -> [Bohr]
17!> boltzmann : Boltzmann constant [J/K]
18!> c_light : Speed of light in vacuum [m/s]
19!> c_light_au : Speed of light in vacuum [a.u.]
20!> e_charge : Elementary charge [C]
21!> e_mass : Electron mass [kg]
22!> e_gfactor : Electron g factor [ ]
23!> esu : Conversion factors [a.u.] -> [esu]
24!> evolt : Conversion factor [a.u.] -> [eV]
25!> femtoseconds: Conversion factor [a.u.] -> [fs]
26!> h_bar : Planck constant [J*s]
27!> h_planck : Planck constant [J*s]
28!> hertz : Conversion factor [a.u.] -> [Hz]
29!> joule : Conversion factor [a.u.] -> [J]
30!> kcalmol : Conversion factor [a.u.] -> [kcal/mol]
31!> kelvin : Conversion factor [a.u.] -> [K]
32!> kjmol : Conversion factor [a.u.] -> [kJ/mol]
33!> massunit : Conversion factor [u] -> [a.u.]
34!> mu_perm : Magnetic constant or permeability of vacuum [N/A**2]
35!> n_avogadro : Avogadro constant [1/mol]
36!> newton : Conversion factor [a.u.] -> [N]
37!> pascal : Conversion factor [a.u.] -> [Pa]
38!> permittivity: Electric constant or permittivity of vacuum [F/m]
39!> picoseconds : Conversion factor [a.u.] -> [ps]
40!> rydberg : Rydberg constant [1/m]
41!> seconds : Conversion factor [a.u.] -> [s]
42!> vibfac : Conversion factor [a.u./Bohr**2] -> [1/cm]
43!> wavenumbers : Conversion factor [a.u.] -> [1/cm]
44!> debye : Conversion factor [a.u.] -> Debye
45!> \note
46!> Fundamental physical constants (SI units)
47!> Literature: - P. J. Mohr and B. N. Taylor,
48!> "CODATA recommended values of the fundamental physical
49!> constants: 1998 Rev. Mod. Phys. 72, 351-495 (2000)
50!> - P. J. Mohr and B. N. Taylor,
51!> "CODATA recommended values of the fundamental physical
52!> constants: 2002", Rev. Mod. Phys. 77, 1 (2005).
53!> - P. J. Mohr, B. N. Taylor, and D. B. Newell,
54!> "CODATA recommended values of the fundamental physical
55!> constants: 2006 Rev. Mod. Phys. 80, 633 (2008)
56!> - P. J. Mohr, B. N. Taylor, and D. B. Newell,
57!> "CODATA recommended values of the fundamental physical
58!> constants: 2010", Rev. Mod. Phys. 84, 1527-1605 (2012)
59!> \par History
60!> - Adapted for use in CP2K (JGH)
61!> - Updated to CODATA 1998 and cleaned (05.09.2003,MK)
62!> - Updated to CODATA 2006. (26.03.2008,AK)
63!> - Updated to CODATA 2010. (10.12.2012,MK)
64!> - Turned constants into Fortran parameters (2014, Ole Schuett)
65!> - Remove all but CODATA 2006 (2015, Ole Schuett)
66!> \author Matthias Krack (MK)
67! **************************************************************************************************
68MODULE physcon
69
70 USE kinds, ONLY: dp
71 USE mathconstants, ONLY: pi
72
73 IMPLICIT NONE
74
75 PRIVATE
76
81
82 PUBLIC :: write_physcon
83
84 ! CP2K uses the CODATA from 2006
85
86 ! Exact constants
87 ! Speed of light in vacuum [m/s]
88 REAL(KIND=dp), PARAMETER :: c_light = 299792458.0_dp
89 ! Speed of light in vacuum, in atomic units (=1/a_fine)
90 REAL(kind=dp), PARAMETER :: c_light_au = 137.035999679_dp
91
92 ! Magnetic constant or permeability of vacuum [N/A**2]
93 REAL(kind=dp), PARAMETER :: mu_perm = 4.0_dp*pi*1.0e-7_dp
94
95 ! Electric constant or permittivity of vacuum [F/m]
96 REAL(kind=dp), PARAMETER :: permittivity = 1.0_dp/(mu_perm*c_light**2)
97
98 ! Recommended fundamental constants of physics
99 ! and chemistry based on the 2006 adjustment
100
101 ! Planck constant [J*s]
102 REAL(kind=dp), PARAMETER :: h_planck = 6.62606896e-34_dp
103 REAL(kind=dp), PARAMETER :: h_bar = h_planck/(2.0_dp*pi)
104
105 ! Elementary charge [C]
106 REAL(kind=dp), PARAMETER :: e_charge = 1.602176487e-19_dp
107
108 ! Electron mass [kg]
109 REAL(kind=dp), PARAMETER :: e_mass = 9.10938215e-31_dp
110
111 ! Proton mass [kg]
112 REAL(kind=dp), PARAMETER :: p_mass = 1.672621637e-27_dp
113
114 ! Electron g factor [ ]
115 REAL(kind=dp), PARAMETER :: e_gfactor = -2.0023193043622_dp
116
117 ! Fine-structure constant
118!MK a_fine = 0.5_dp*mu_perm*c_light*e_charge**2/h_planck
119 REAL(kind=dp), PARAMETER :: a_fine = 7.2973525376e-3_dp
120
121 ! Rydberg constant [1/m]
122!MK rydberg = 0.5_dp*e_mass*c_light*a_fine**2/h_planck
123 REAL(kind=dp), PARAMETER :: rydberg = 10973731.568527_dp
124
125 ! Avogadro constant [1/mol]
126 REAL(kind=dp), PARAMETER :: n_avogadro = 6.02214179e+23_dp
127
128 ! Boltzmann constant [J/K]
129 REAL(kind=dp), PARAMETER :: boltzmann = 1.3806504e-23_dp
130
131 ! Atomic mass unit [kg]; conversion factor [u] -> [kg]
132 REAL(kind=dp), PARAMETER :: a_mass = 1.660538782e-27_dp
133
134 ! Bohr radius [m]
135!MK a_bohr = a_fine/(4.0_dp*pi*rydberg)
136 REAL(kind=dp), PARAMETER :: a_bohr = 0.52917720859e-10_dp
137
138 ! Conversion factors
139
140 ! [u] -> [a.u.]
141 REAL(kind=dp), PARAMETER :: massunit = a_mass/e_mass
142
143 ! [Bohr] -> [Angstrom]
144 REAL(kind=dp), PARAMETER :: angstrom = 1.0e+10_dp*a_bohr
145
146 ! [Angstrom] -> [Bohr]
147 REAL(kind=dp), PARAMETER :: bohr = 1.0_dp/angstrom
148
149 ! [a.u.] -> [s]
150 REAL(kind=dp), PARAMETER :: seconds = 1.0_dp/(4.0_dp*pi*rydberg*c_light)
151
152 ! [a.u.] -> [fs]
153 REAL(kind=dp), PARAMETER :: femtoseconds = 1.0e+15_dp*seconds
154
155 ! [a.u.] -> [ps]
156 REAL(kind=dp), PARAMETER :: picoseconds = 1.0e+12_dp*seconds
157
158 ! [a.u.] -> [J]
159 REAL(kind=dp), PARAMETER :: joule = 2.0_dp*rydberg*h_planck*c_light
160
161 ! [a.u.] -> [N]
162 REAL(kind=dp), PARAMETER :: newton = joule/a_bohr
163
164 ! [a.u.] -> [K]
165 REAL(kind=dp), PARAMETER :: kelvin = joule/boltzmann
166
167 ! [a.u.] -> [kJ/mol]
168 REAL(kind=dp), PARAMETER :: kjmol = 0.001_dp*joule*n_avogadro
169
170 ! [a.u.] -> [kcal/mol]
171 REAL(kind=dp), PARAMETER :: kcalmol = kjmol/4.184_dp
172
173 ! [a.u.] -> [Pa]
174 REAL(kind=dp), PARAMETER :: pascal = joule/a_bohr**3
175
176 ! [a.u.] -> [bar]
177 REAL(kind=dp), PARAMETER :: bar = pascal/1.0e+5_dp
178
179 ! [a.u.] -> [atm]
180 REAL(kind=dp), PARAMETER :: atm = pascal/1.013250e+5_dp
181
182 ! [a.u.] -> [eV]
183 REAL(kind=dp), PARAMETER :: evolt = joule/e_charge
184
185 ! [a.u.] -> [Hz]
186 REAL(kind=dp), PARAMETER :: hertz = joule/h_planck
187
188 ! [a.u./Bohr**2] -> [1/cm] (wave numbers)
189 REAL(kind=dp), PARAMETER :: vibfac = 5.0_dp*sqrt(kjmol)/(pi*a_bohr*c_light)
190
191 ! [a.u.] -> [1/cm] (wave numbers)
192 REAL(kind=dp), PARAMETER :: wavenumbers = 0.02_dp*rydberg
193
194 ! [a.u.] -> [esu] (electrostatic units)
195 REAL(kind=dp), PARAMETER :: esu_1 = 1.0e+21_dp*a_bohr*c_light*e_charge
196 !REAL(KIND=dp), PARAMETER :: esu_2 = esu_1/bohr
197 !REAL(KIND=dp), PARAMETER :: esu_3 = esu_2/bohr
198 !REAL(KIND=dp), PARAMETER :: esu(3) = (/ esu_1, esu_2, esu_3 /)
199
200 ! [a.u.] -> [debye] (electrostatic units)
201 REAL(kind=dp), PARAMETER :: debye = esu_1
202
203CONTAINS
204
205! **************************************************************************************************
206!> \brief Write all basic physical constants used by CP2K to a logical
207!> output unit.
208!> \param output_unit ...
209!> \date 14.11.2000
210!> \par History
211!> - Updated to CODATA 1998 and cleaned (05.09.2003,MK)
212!> - Updated to CODATA 2006. (26.03.2008,AK)
213!> \author JGH
214!> \version 1.1
215! **************************************************************************************************
216 SUBROUTINE write_physcon(output_unit)
217
218 INTEGER, INTENT(IN) :: output_unit
219
220 WRITE (unit=output_unit, fmt="(T2,/,T2,A,/,/,(T2,A))") &
221 "*** Fundamental physical constants (SI units) ***", &
222 "*** Literature: B. J. Mohr and B. N. Taylor,", &
223 "*** CODATA recommended values of the fundamental physical", &
224 "*** constants: 2006, Web Version 5.1", &
225 "*** http://physics.nist.gov/constants"
226
227 WRITE (unit=output_unit, fmt="(/,T2,A,T61,ES20.14)") &
228 "Speed of light in vacuum [m/s]", c_light
229 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
230 "Magnetic constant or permeability of vacuum [N/A**2]", mu_perm
231 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
232 "Electric constant or permittivity of vacuum [F/m]", permittivity
233 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
234 "Planck constant (h) [J*s]", h_planck
235 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
236 "Planck constant (h-bar) [J*s]", h_bar
237 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
238 "Elementary charge [C]", e_charge
239 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
240 "Electron mass [kg]", e_mass
241 WRITE (unit=output_unit, fmt="(T2,A,T60,ES21.14)") &
242 "Electron g factor [ ]", e_gfactor
243 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
244 "Proton mass [kg]", p_mass
245 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
246 "Fine-structure constant", a_fine
247 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
248 "Rydberg constant [1/m]", rydberg
249 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
250 "Avogadro constant [1/mol]", n_avogadro
251 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
252 "Boltzmann constant [J/K]", boltzmann
253 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
254 "Atomic mass unit [kg]", a_mass
255 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
256 "Bohr radius [m]", a_bohr
257
258 ! Conversion factors
259
260 WRITE (unit=output_unit, fmt="(/,T2,A,/)") &
261 "*** Conversion factors ***"
262
263 WRITE (unit=output_unit, fmt="(T2,A,T61,ES20.14)") &
264 "[u] -> [a.u.]", massunit, &
265 "[Angstrom] -> [Bohr] = [a.u.]", bohr, &
266 "[a.u.] = [Bohr] -> [Angstrom]", angstrom, &
267 "[a.u.] -> [s]", seconds, &
268 "[a.u.] -> [fs]", femtoseconds, &
269 "[a.u.] -> [J]", joule, &
270 "[a.u.] -> [N]", newton, &
271 "[a.u.] -> [K]", kelvin, &
272 "[a.u.] -> [kJ/mol]", kjmol, &
273 "[a.u.] -> [kcal/mol]", kcalmol, &
274 "[a.u.] -> [Pa]", pascal, &
275 "[a.u.] -> [bar]", bar, &
276 "[a.u.] -> [atm]", atm, &
277 "[a.u.] -> [eV]", evolt, &
278 "[a.u.] -> [Hz]", hertz, &
279 "[a.u.] -> [1/cm] (wave numbers)", wavenumbers, &
280 "[a.u./Bohr**2] -> [1/cm]", vibfac
281 WRITE (unit=output_unit, fmt="(T2,A)") ""
282
283 END SUBROUTINE write_physcon
284
285END MODULE physcon
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public mu_perm
Definition physcon.F:93
real(kind=dp), parameter, public boltzmann
Definition physcon.F:129
real(kind=dp), parameter, public a_mass
Definition physcon.F:132
real(kind=dp), parameter, public a_bohr
Definition physcon.F:136
real(kind=dp), parameter, public a_fine
Definition physcon.F:119
real(kind=dp), parameter, public kcalmol
Definition physcon.F:171
real(kind=dp), parameter, public vibfac
Definition physcon.F:189
real(kind=dp), parameter, public e_charge
Definition physcon.F:106
real(kind=dp), parameter, public n_avogadro
Definition physcon.F:126
real(kind=dp), parameter, public femtoseconds
Definition physcon.F:153
real(kind=dp), parameter, public atm
Definition physcon.F:180
real(kind=dp), parameter, public joule
Definition physcon.F:159
real(kind=dp), parameter, public kelvin
Definition physcon.F:165
real(kind=dp), parameter, public newton
Definition physcon.F:162
real(kind=dp), parameter, public h_bar
Definition physcon.F:103
real(kind=dp), parameter, public c_light_au
Definition physcon.F:90
real(kind=dp), parameter, public seconds
Definition physcon.F:150
real(kind=dp), parameter, public hertz
Definition physcon.F:186
real(kind=dp), parameter, public evolt
Definition physcon.F:183
real(kind=dp), parameter, public p_mass
Definition physcon.F:112
real(kind=dp), parameter, public angstrom
Definition physcon.F:144
real(kind=dp), parameter, public e_mass
Definition physcon.F:109
real(kind=dp), parameter, public picoseconds
Definition physcon.F:156
real(kind=dp), parameter, public e_gfactor
Definition physcon.F:115
real(kind=dp), parameter, public wavenumbers
Definition physcon.F:192
real(kind=dp), parameter, public bar
Definition physcon.F:177
real(kind=dp), parameter, public massunit
Definition physcon.F:141
real(kind=dp), parameter, public kjmol
Definition physcon.F:168
real(kind=dp), parameter, public pascal
Definition physcon.F:174
subroutine, public write_physcon(output_unit)
Write all basic physical constants used by CP2K to a logical output unit.
Definition physcon.F:217
real(kind=dp), parameter, public bohr
Definition physcon.F:147
real(kind=dp), parameter, public debye
Definition physcon.F:201