Skip to content

Commit 965ddad

Browse files
authored
Merge branch 'rljacob/share/add-pcd' (PR #7719)
Add Fortran and C files containing values for physical constants that were generated from the PhysicalConstantsDictionary. Not yet used in any models. [BFB]
2 parents 2fea744 + c6765b6 commit 965ddad

File tree

3 files changed

+121
-0
lines changed

3 files changed

+121
-0
lines changed

share/util/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ sourcelist_to_parent(share_genf90_sources)
88
list(APPEND share_sources "${share_genf90_sources}")
99

1010
list(APPEND share_sources
11+
pcd_const.F90
1112
shr_file_mod.F90
1213
shr_kind_mod.F90
1314
shr_const_mod.F90

share/util/pcd_const.F90

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
! WARNING! DO NOT EDIT THIS FILE!
2+
! This file was generated automatically from pcd.yaml
3+
! For more information, visit https://github.com/e3sm-project/PhysicalConstantsDictionary
4+
5+
module pcd
6+
implicit none
7+
8+
!define double precision kind
9+
integer, parameter :: dp = selected_real_kind(12)
10+
11+
! pcd.yaml version and institution information
12+
character(len=*), parameter :: pcdversion = "0.0.2"
13+
character(len=*), parameter :: pcdinstitution = "E3SM Project"
14+
15+
!mathematical constants
16+
real(dp), parameter :: pi = 3.141592653589793_dp ! ASHandbook1964
17+
real(dp), parameter :: e = 2.718281828459045_dp ! ASHandbook1964
18+
real(dp), parameter :: em_gamma = 0.5772156649015329_dp ! ASHandbook1964
19+
real(dp), parameter :: radian = 57.29577951308232_dp ! ASHandbook1964
20+
real(dp), parameter :: degree = 0.017453292519943295_dp ! ASHandbook1964
21+
real(dp), parameter :: square_root_of_2 = 1.4142135623730951_dp ! ASHandbook1964
22+
real(dp), parameter :: square_root_of_3 = 1.7320508075688772_dp ! ASHandbook1964
23+
24+
!universal_physical constants
25+
real(dp), parameter :: speed_of_light_in_vacuum = 299792458_dp ! NIST_CODATA2022
26+
real(dp), parameter :: newtonian_gravitation_constant = 6.6743e-11_dp ! NIST_CODATA2022
27+
real(dp), parameter :: standard_acceleration_of_gravity = 9.80665_dp ! NIST_CODATA2022
28+
real(dp), parameter :: standard_atmosphere = 101325_dp ! NIST_CODATA2022
29+
real(dp), parameter :: avogadro_constant = 6.02214076e+23_dp ! NIST_CODATA2022
30+
real(dp), parameter :: boltzmann_constant = 1.380649e-23_dp ! NIST_CODATA2022
31+
real(dp), parameter :: stefan_boltzmann_constant = 5.670374419e-08_dp ! NIST_CODATA2022
32+
real(dp), parameter :: planck_constant = 6.62607015e-34_dp ! NIST_CODATA2022
33+
real(dp), parameter :: molar_gas_constant = 8.314462618_dp ! NIST_CODATA2022
34+
real(dp), parameter :: molar_volume_of_ideal_gas = 0.02271095464_dp ! NIST_CODATA2022
35+
36+
!earth_physical constants
37+
real(dp), parameter :: geocentric_gravitational_constant = 3986005E+08_dp ! GRS80
38+
real(dp), parameter :: semimajor_axis = 6378137_dp ! GRS80
39+
real(dp), parameter :: dynamic_form_factor = 108263E-08_dp ! GRS80
40+
real(dp), parameter :: angular_velocity = 7292115E-11_dp ! GRS80
41+
real(dp), parameter :: semiminor_axis = 6356752.3141_dp ! GRS80
42+
real(dp), parameter :: flattening = 0.00335281068118_dp ! GRS80
43+
real(dp), parameter :: reciprocal_flattening = 298.257222101_dp ! GRS80
44+
real(dp), parameter :: mean_radius = 6371008.7714_dp ! GRS80
45+
real(dp), parameter :: radius_of_sphere_of_same_surface = 6371007.181_dp ! GRS80
46+
real(dp), parameter :: radius_of_sphere_of_same_volume = 6371000.79_dp ! GRS80
47+
48+
!solar constants
49+
real(dp), parameter :: total_solar_irradiance = 1360.8_dp ! TIM_SORCE_2005
50+
51+
!water constants
52+
real(dp), parameter :: water_molar_mass = 18.015268_dp ! IAPWS_95
53+
real(dp), parameter :: water_specific_gas_constant = 0.46151805_dp ! IAPWS_95
54+
real(dp), parameter :: water_triple_point_temperature = 273.16_dp ! IAPWS_95
55+
real(dp), parameter :: water_triple_point_pressure = 611.655_dp ! IAPWS_95
56+
real(dp), parameter :: liquid_water_triple_point_density = 999.793_dp ! IAPWS_95
57+
real(dp), parameter :: vapor_water_triple_point_density = 0.00485458_dp ! IAPWS_95
58+
59+
end module pcd

share/util_cxx/pcd_const.h

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// WARNING! DO NOT EDIT THIS FILE!
2+
// This file was generated automatically from pcd.yaml
3+
// For more information, visit https://github.com/e3sm-project/PhysicalConstantsDictionary
4+
5+
#ifndef PHYSICAL_CONSTANTS_DICTIONARY_HPP
6+
#define PHYSICAL_CONSTANTS_DICTIONARY_HPP
7+
8+
#include <string>
9+
10+
namespace pcd {
11+
12+
// pcd.yaml version and institution information
13+
const std::string pcdversion = "0.0.2";
14+
const std::string pcdinstitution = "E3SM Project";
15+
16+
// mathematical constants
17+
constexpr double pi = 3.141592653589793; // ASHandbook1964
18+
constexpr double e = 2.718281828459045; // ASHandbook1964
19+
constexpr double em_gamma = 0.5772156649015329; // ASHandbook1964
20+
constexpr double radian = 57.29577951308232; // ASHandbook1964
21+
constexpr double degree = 0.017453292519943295; // ASHandbook1964
22+
constexpr double square_root_of_2 = 1.4142135623730951; // ASHandbook1964
23+
constexpr double square_root_of_3 = 1.7320508075688772; // ASHandbook1964
24+
25+
// universal_physical constants
26+
constexpr double speed_of_light_in_vacuum = 299792458; // NIST_CODATA2022
27+
constexpr double newtonian_gravitation_constant = 6.6743e-11; // NIST_CODATA2022
28+
constexpr double standard_acceleration_of_gravity = 9.80665; // NIST_CODATA2022
29+
constexpr double standard_atmosphere = 101325; // NIST_CODATA2022
30+
constexpr double avogadro_constant = 6.02214076e+23; // NIST_CODATA2022
31+
constexpr double boltzmann_constant = 1.380649e-23; // NIST_CODATA2022
32+
constexpr double stefan_boltzmann_constant = 5.670374419e-08; // NIST_CODATA2022
33+
constexpr double planck_constant = 6.62607015e-34; // NIST_CODATA2022
34+
constexpr double molar_gas_constant = 8.314462618; // NIST_CODATA2022
35+
constexpr double molar_volume_of_ideal_gas = 0.02271095464; // NIST_CODATA2022
36+
37+
// earth_physical constants
38+
constexpr double geocentric_gravitational_constant = 3986005E+08; // GRS80
39+
constexpr double semimajor_axis = 6378137; // GRS80
40+
constexpr double dynamic_form_factor = 108263E-08; // GRS80
41+
constexpr double angular_velocity = 7292115E-11; // GRS80
42+
constexpr double semiminor_axis = 6356752.3141; // GRS80
43+
constexpr double flattening = 0.00335281068118; // GRS80
44+
constexpr double reciprocal_flattening = 298.257222101; // GRS80
45+
constexpr double mean_radius = 6371008.7714; // GRS80
46+
constexpr double radius_of_sphere_of_same_surface = 6371007.181; // GRS80
47+
constexpr double radius_of_sphere_of_same_volume = 6371000.79; // GRS80
48+
49+
// solar constants
50+
constexpr double total_solar_irradiance = 1360.8; // TIM_SORCE_2005
51+
52+
// water constants
53+
constexpr double water_molar_mass = 18.015268; // IAPWS_95
54+
constexpr double water_specific_gas_constant = 0.46151805; // IAPWS_95
55+
constexpr double water_triple_point_temperature = 273.16; // IAPWS_95
56+
constexpr double water_triple_point_pressure = 611.655; // IAPWS_95
57+
constexpr double liquid_water_triple_point_density = 999.793; // IAPWS_95
58+
constexpr double vapor_water_triple_point_density = 0.00485458; // IAPWS_95
59+
60+
} // namespace pcd
61+
#endif // PHYSICAL_CONSTANTS_DICTIONARY

0 commit comments

Comments
 (0)