Skip to content

Commit 86d3678

Browse files
committed
updates gravity and adds radians/degrees
1 parent 7dc6eed commit 86d3678

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

components/omega/src/ocn/GlobalConstants.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616

1717
namespace OMEGA {
1818

19+
// Mathematical constants
20+
constexpr Real Pi = M_PI; // Pi
21+
constexpr Real TwoPi = 2.0 * M_PI; // 2*Pi
22+
1923
// Earth constants
20-
constexpr Real Gravity = 9.80616; // Acceleration due to gravity ~ m/s^2
21-
constexpr Real Pi = M_PI; // Pi
22-
constexpr Real TwoPi = 2.0 * M_PI; // 2*Pi
23-
constexpr Real CDay = 86400.0; // Seconds in a calendar day ~ sec
24-
constexpr Real SDay = 86164.0; // Seconds in a sidereal day ~ sec
24+
constexpr Real Gravity = 9.80665; // Acceleration due to gravity ~ m/s^2
25+
constexpr Real CDay = 86400.0; // Seconds in a calendar day ~ sec
26+
constexpr Real SDay = 86164.0; // Seconds in a sidereal day ~ sec
2527
constexpr Real Omega =
2628
2.0 * Pi / SDay; // Angular velocity of the Earth ~ rad/sec
2729
constexpr Real REarth = 6.37122e6; // Mean radius of the Earth ~ m
@@ -51,8 +53,10 @@ constexpr Real Emiss = 1.0; // Emissivity ~ dimensionless
5153
constexpr Real AtmRefP = 101325.0; // Reference atmospheric pressure ~ Pa
5254

5355
// Conversion factors
54-
constexpr Real Sec2Day = 1.0 / 86400.0; // Seconds to days
55-
constexpr Real Day2Sec = 86400.0; // Days to seconds
56+
constexpr Real Sec2Day = 1.0 / 86400.0; // Seconds to days
57+
constexpr Real Day2Sec = 86400.0; // Days to seconds
58+
constexpr Real Rad2Deg = 57.29577951308232; // Radians to degrees
59+
constexpr Real Deg2Rad = 0.017453292519943295; // Degrees to radians
5660
constexpr Real Salt2PPt = 1000.0; // Salinity (kg/kg) to parts per thousand
5761
constexpr Real PPt2Salt = 1.0e-3; // Parts per thousand to salinity (kg/kg)
5862
constexpr Real Mass2Sv = 1.0e-12; // Mass flux (kg/s) to Sverdrup

0 commit comments

Comments
 (0)