UFO
Constants.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2018-2019 UCAR
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #ifndef UFO_UTILS_CONSTANTS_H_
9 #define UFO_UTILS_CONSTANTS_H_
10 
11 #include <cmath>
12 
13 //-------------------------------------------------------------------------------------------------
14 
15 namespace ufo {
16 
17 //-------------------------------------------------------------------------------------------------
18 
19 /// Some useful constants
20 struct Constants {
21  static constexpr double deg2rad = M_PI / 180.;
22  static constexpr double rad2deg = 180. * M_1_PI;
23  static constexpr double grav = 9.80665e+0;
24  static constexpr double t0c = 2.7315e+2; // temperature at zero celsius (K)
25  static constexpr double ttp = 2.7316e+2; // temperature at h2o triple point (K)
26  static constexpr double rd = 2.8705e2;
27  static constexpr double rv = 4.6150e2;
28  static constexpr double cp = 1.0046e3; // heat capacity at constant pressure
29  // for air
30  static constexpr double cv = 7.1760e2; // heat capacity at constant volume
31  // for air
32  static constexpr double pref = 1.0e5; // Reference pressure for calculating
33  // exner
34  static constexpr double rd_over_rv = rd/rv;
35  static constexpr double rd_over_cp = rd/cp;
36  static constexpr double cv_over_cp = cv/cp;
37  static constexpr double rv_over_rd = rv/rd;
38  static constexpr double rd_over_g = rd/grav;
39  static constexpr double g_over_rd = grav / rd;
40  static constexpr double mean_earth_rad = 6371.0;
41  static constexpr double zero = 0.0;
42  static constexpr double quarter = 0.25;
43  static constexpr double half = 0.5;
44  static constexpr double one = 1.0;
45  static constexpr double two = 2.0;
46  static constexpr double four = 4.0;
47  static constexpr double five = 5.0;
48  static constexpr double ten = 10.0;
49  static constexpr double k_t = 0.65; // Thermal conductivity of water
50  static constexpr double L_e = 2.26e+06; // Latent heat of vaporization
51  static constexpr double eps = 0.1; // Albedo of sea water
52  static constexpr double sig = 5.67e-6; // Stefan-Boltzmann constant
53  static constexpr double alpha = 2.7e-4; // Water thermal expansion coefficient
54  static constexpr double cw = 0.015; // Water specific heat
55  static constexpr double v_w = 0.8e-6; // Water kinematic viscosity
56  static constexpr double S_B = 0.026;
57  static constexpr double gr = 9.81;
58  static constexpr double Rou = 1000.0;
59  static constexpr double DU = 21.4e-6; // Dobson unit, kg O3/m**2
60  static constexpr double Lclr = 0.0065; // constant lapse rate
61  static constexpr double t2tv = 0.608; // constant lapse rate
62  static constexpr double von_karman = 0.41; // Von Karman Constant
63  static constexpr double es_w_0 = 611.2; // saturation vapor pressure of water at
64  // 0degC
65  static constexpr double euzc_0 = 34.0; // constant for estimating euphotic layer
66  static constexpr double euzc_1 = -0.39; // constant for estimating euphotic layer
67  static constexpr double epsilon = 0.62198; // Ratio of molecular weight of
68  // water and dry air
69 
70  // International Civil Aviation Organization (ICAO) atmosphere.
71  // https://en.wikipedia.org/wiki/International_Standard_Atmosphere#ICAO_Standard_Atmosphere
72  // with gpm = height in geopotential metres
73  static constexpr double icao_lapse_rate_l = 6.5E-03; // Lapse rate for levels up
74  // to 11,000 gpm
75  // (lower boundary of the
76  // isothermal layer) [K/gpm]
77  static constexpr double icao_lapse_rate_u = -1.0E-03; // Lapse rate for levels above
78  // 20,000 gpm
79  // (upper boundary of the
80  // isothermal layer) [K/gpm]
81  static constexpr double icao_height_l = 11000.0; // Height of bottom of isothermal
82  // layer [gpm]
83  static constexpr double icao_height_u = 20000.0; // Height of top of isothermal
84  // layer [gpm]
85  static constexpr double icao_temp_surface = 288.15; // Surface temperature [K]
86  static constexpr double icao_temp_isothermal_layer = 216.65; // Temperature of isothermal
87  // layer [K]
88  static constexpr double icao_pressure_surface = 1013.25; // Assumed surface pressure [hPa]
89  static constexpr double icao_pressure_l = 226.32; // Assumed pressure at 11,000 gpm [hPa]
90  static constexpr double icao_pressure_u = 54.7487; // Assumed pressure at 20,000 gpm [hPa]
91 };
92 
93 //--------------------------------------------------------------------------------------------------
94 } // namespace ufo
95 
96 #endif // UFO_UTILS_CONSTANTS_H_
Definition: RunCRTM.h:27
Some useful constants.
Definition: Constants.h:20
static constexpr double euzc_1
Definition: Constants.h:66
static constexpr double quarter
Definition: Constants.h:42
static constexpr double four
Definition: Constants.h:46
static constexpr double icao_pressure_u
Definition: Constants.h:90
static constexpr double half
Definition: Constants.h:43
static constexpr double grav
Definition: Constants.h:23
static constexpr double von_karman
Definition: Constants.h:62
static constexpr double rd_over_rv
Definition: Constants.h:34
static constexpr double rv_over_rd
Definition: Constants.h:37
static constexpr double DU
Definition: Constants.h:59
static constexpr double es_w_0
Definition: Constants.h:63
static constexpr double v_w
Definition: Constants.h:55
static constexpr double alpha
Definition: Constants.h:53
static constexpr double ttp
Definition: Constants.h:25
static constexpr double five
Definition: Constants.h:47
static constexpr double rd_over_cp
Definition: Constants.h:35
static constexpr double rd_over_g
Definition: Constants.h:38
static constexpr double pref
Definition: Constants.h:32
static constexpr double icao_lapse_rate_u
Definition: Constants.h:77
static constexpr double k_t
Definition: Constants.h:49
static constexpr double icao_pressure_l
Definition: Constants.h:89
static constexpr double icao_temp_surface
Definition: Constants.h:85
static constexpr double sig
Definition: Constants.h:52
static constexpr double icao_height_u
Definition: Constants.h:83
static constexpr double eps
Definition: Constants.h:51
static constexpr double zero
Definition: Constants.h:41
static constexpr double icao_height_l
Definition: Constants.h:81
static constexpr double deg2rad
Definition: Constants.h:21
static constexpr double Rou
Definition: Constants.h:58
static constexpr double epsilon
Definition: Constants.h:67
static constexpr double cw
Definition: Constants.h:54
static constexpr double gr
Definition: Constants.h:57
static constexpr double rv
Definition: Constants.h:27
static constexpr double two
Definition: Constants.h:45
static constexpr double t2tv
Definition: Constants.h:61
static constexpr double icao_pressure_surface
Definition: Constants.h:88
static constexpr double icao_temp_isothermal_layer
Definition: Constants.h:86
static constexpr double rd
Definition: Constants.h:26
static constexpr double cp
Definition: Constants.h:28
static constexpr double L_e
Definition: Constants.h:50
static constexpr double cv
Definition: Constants.h:30
static constexpr double rad2deg
Definition: Constants.h:22
static constexpr double cv_over_cp
Definition: Constants.h:36
static constexpr double euzc_0
Definition: Constants.h:65
static constexpr double t0c
Definition: Constants.h:24
static constexpr double one
Definition: Constants.h:44
static constexpr double Lclr
Definition: Constants.h:60
static constexpr double S_B
Definition: Constants.h:56
static constexpr double mean_earth_rad
Definition: Constants.h:40
static constexpr double ten
Definition: Constants.h:48
static constexpr double icao_lapse_rate_l
Definition: Constants.h:73
static constexpr double g_over_rd
Definition: Constants.h:39