MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Meteoconst.h
Go to the documentation of this file.
1 /***********************************************************************************/
2 /* Copyright 2009 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
3 /***********************************************************************************/
4 /* This file is part of MeteoIO.
5  MeteoIO is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  MeteoIO is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef METEOCONST_H
19 #define METEOCONST_H
20 
21 #include <cfloat>
22 
27 #ifndef MIO_VERSION
28  //here below, the double-expansion stringification macro trick...
29  #define STR1(x) #x
30  #define STR2(x) STR1(x)
31  #define MIO_VERSION STR2( _VERSION )
32 #endif
33 
34 namespace mio {
35 
36 namespace Cst {
37  const double stefan_boltzmann = 5.670373e-8; // (W m-2 K-4)
38  const double gravity = 9.80665; // (m s-2)
39  const double std_press = 101325.; // (Pa) at sea level
40  const double std_temp = 288.15; // (K) at sea level
41  const double mean_adiabatique_lapse_rate = 0.0065; // (K/m)
42  const double dry_adiabatique_lapse_rate = 0.0098; // (K/m)
43 
44  const double gaz_constant_dry_air = 287.058; // (J kg-1 K-1)
45  const double gaz_constant_water_vapor = 461.9; // (J kg-1 K-1)
46  const double gaz_constant = 8.31451; // (J mol-1 K-1)
47 
48  const double p_water_triple_pt = 611.73; // (Pa)
49  const double t_water_freezing_pt = 273.15; // (K)
50  const double t_water_triple_pt = 273.16; // (K)
51  const double l_water_sublimation = 2.838e6; // (J kg-1)
52  const double l_water_vaporization = 2.504e6; // (J kg-1)
53  const double l_water_fusion = 3.34e5; // (J Kg-1)
54  const double water_molecular_mass = 18.0153e-3; // (kg)
55  const double dry_air_mol_mass =0.0289644 ; // (kg/mol)
56 
57  const double specific_heat_ice = 2100.0; // (J K-1), at 0C
58  const double specific_heat_water = 4190.0; // (J K-1) at 0C
59  const double specific_heat_air = 1004.67; // (J K-1), see Stull "Meteorology for scientists and engineers" p44
60 
61  const double earth_R0 = 6356766.0; // (m)
62 
63  const double solcon = 1366.1; // (W/m^2)
64 
65  //Math constants
66  const double e = 2.71828182845904523536; // e
67  const double Log2e = 1.44269504088896340736; // log2(e)
68  const double Log10e = 0.434294481903251827651; // log10(e)
69  const double Ln2 = 0.693147180559945309417; // ln(2)
70  const double Ln10 = 2.30258509299404568402; // ln(10)
71  const double PI = 3.14159265358979323846; // pi
72  const double PI2 = 1.57079632679489661923; // pi/2
73  const double PI4 = 0.785398163397448309616; // pi/4
74  const double InvPI = 0.318309886183790671538; // 1/pi
75  const double TwoOverPI = 0.636619772367581343076; // 2/pi
76  const double TwoOverSqrtPI = 1.12837916709551257390; // 2/sqrt(pi)
77  const double Sqrt2 = 1.41421356237309504880; // sqrt(2)
78  const double InvSqrt2 = 0.707106781186547524401; // 1/sqrt(2)
79  const double to_rad = PI/180.; // conversion factor from deg to rad
80  const double to_deg = 180./PI; // conversion factor from rad to deg
81 
82  const double dbl_max = DBL_MAX;
83  const double dbl_min = -DBL_MAX;
84 } //end CST namespace
85 
86 } //end namespace
87 
88 #endif
const double gaz_constant_dry_air
Definition: Meteoconst.h:44
const double l_water_sublimation
Definition: Meteoconst.h:51
const double gravity
Definition: Meteoconst.h:38
const double to_deg
Definition: Meteoconst.h:80
const double solcon
Definition: Meteoconst.h:63
const double TwoOverSqrtPI
Definition: Meteoconst.h:76
const double TwoOverPI
Definition: Meteoconst.h:75
const double to_rad
Definition: Meteoconst.h:79
const double specific_heat_ice
Definition: Meteoconst.h:57
const double dry_air_mol_mass
Definition: Meteoconst.h:55
const double gaz_constant
Definition: Meteoconst.h:46
const double Log2e
Definition: Meteoconst.h:67
const double std_press
Definition: Meteoconst.h:39
const double dbl_min
Definition: Meteoconst.h:83
const double Sqrt2
Definition: Meteoconst.h:77
const double specific_heat_air
Definition: Meteoconst.h:59
const double Log10e
Definition: Meteoconst.h:68
const double l_water_vaporization
Definition: Meteoconst.h:52
const double p_water_triple_pt
Definition: Meteoconst.h:48
const double earth_R0
Definition: Meteoconst.h:61
const double specific_heat_water
Definition: Meteoconst.h:58
const double Ln2
Definition: Meteoconst.h:69
const double t_water_freezing_pt
Definition: Meteoconst.h:49
const double dry_adiabatique_lapse_rate
Definition: Meteoconst.h:42
const double PI4
Definition: Meteoconst.h:73
const double PI
Definition: Meteoconst.h:71
const double std_temp
Definition: Meteoconst.h:40
const double InvSqrt2
Definition: Meteoconst.h:78
const double PI2
Definition: Meteoconst.h:72
const double gaz_constant_water_vapor
Definition: Meteoconst.h:45
const double stefan_boltzmann
Definition: Meteoconst.h:37
const double t_water_triple_pt
Definition: Meteoconst.h:50
const double e
Definition: Meteoconst.h:66
const double mean_adiabatique_lapse_rate
Definition: Meteoconst.h:41
const double water_molecular_mass
Definition: Meteoconst.h:54
const double InvPI
Definition: Meteoconst.h:74
const double dbl_max
Definition: Meteoconst.h:82
const double l_water_fusion
Definition: Meteoconst.h:53
const double Ln10
Definition: Meteoconst.h:70