|
| 1 | +#ifndef OMEGA_GLOBALCONSTANTS_H |
| 2 | +#define OMEGA_GLOBALCONSTANTS_H |
| 3 | +//===-- ocn/GlobalConstants.h - Global Constants --------------------*- C++ |
| 4 | +//-*-===// |
| 5 | +// |
| 6 | +/// \file |
| 7 | +/// \brief Contains global constants for use across Omega |
| 8 | +/// |
| 9 | +/// This header defines constants to be used across Omega (to be replaced by a |
| 10 | +/// shared E3SM constants file when that becomes available) |
| 11 | +// |
| 12 | +//===----------------------------------------------------------------------===// |
| 13 | + |
| 14 | +namespace OMEGA { |
| 15 | + |
| 16 | +// Earth constants |
| 17 | +constexpr double Gravity = 9.80616; // Acceleration due to gravity ~ m/s^2 |
| 18 | +constexpr double Pi = 3.14159265358979323846; // Pi |
| 19 | +constexpr double CDay = 86400.0; // Seconds in a calendar day ~ sec |
| 20 | +constexpr double SDay = 86164.0; // Seconds in a sidereal day ~ sec |
| 21 | +constexpr double Omega = |
| 22 | + 2.0 * Pi / SDay; // Angular velocity of the Earth ~ rad/sec |
| 23 | +constexpr double REarth = 6.37122e6; // Mean radius of the Earth ~ m |
| 24 | + |
| 25 | +/// Physical constants |
| 26 | +constexpr double TkTrip = 273.16; // Triple point of fresh water ~ K |
| 27 | +constexpr double TkFrz = 273.15; // Freezing point of fresh water ~ K |
| 28 | +constexpr double TkFrzSw = TkFrz - 1.8; // Freezing point of seawater ~ K |
| 29 | +constexpr double RhoAir = 1.2; // Density of air ~ kg/m^3 |
| 30 | +constexpr double RhoFw = 1.000e3; // Density of fresh water ~ kg/m^3 |
| 31 | +constexpr double RhoSw = 1.026e3; // Density of seawater ~ kg/m^3 |
| 32 | +constexpr double RhoIce = 0.917e3; // Density of ice ~ kg/m^3 |
| 33 | +constexpr double CpAir = 1005.0; // Specific heat capacity of air ~ J/(kg*K) |
| 34 | +constexpr double CpFw = |
| 35 | + 4.188e3; // Specific heat capacity of fresh water ~ J/(kg*K) |
| 36 | +constexpr double CpSw = |
| 37 | + 3.996e3; // Specific heat capacity of seawater ~ J/(kg*K) |
| 38 | +constexpr double CpIce = 2.108e3; // Specific heat capacity of ice ~ J/(kg*K) |
| 39 | +constexpr double LatIce = 3.337e5; // Latent heat of fusion ~ J/kg |
| 40 | +constexpr double LatVap = 2.501e6; // Latent heat of vaporization ~ J/kg |
| 41 | +constexpr double LatSub = LatIce + LatVap; // Latent heat of sublimation ~ J/kg |
| 42 | +constexpr double CondIce = 2.1; // Universal gas constant ~ J/(mol*K) |
| 43 | +constexpr double OcnRefSal = 34.7; // Reference ocean salinity ~ psu |
| 44 | +constexpr double IceRefSal = 4.0; // Reference ice salinity ~ psu |
| 45 | +constexpr double Sound = 1.5e2; // Speed of sound ~ m/s |
| 46 | +constexpr double VonKar = 0.4; // Von Karman constant ~ dimensionless |
| 47 | +constexpr double Emiss = 1.0; // Emissivity ~ dimensionless |
| 48 | +constexpr double AtmRefP = 101325.0; // Reference atmospheric pressure ~ Pa |
| 49 | + |
| 50 | +// Conversion factors |
| 51 | +constexpr double Sec2Day = 1.0 / 86400.0; // Seconds to days |
| 52 | +constexpr double Day2Sec = 86400.0; // Days to seconds |
| 53 | +constexpr double Salt2PPt = 1000.0; // Salinity (kg/kg) to parts per thousand |
| 54 | +constexpr double PPt2Salt = 1.0e-3; // Parts per thousand to salinity (kg/kg) |
| 55 | +constexpr double Mass2Sv = 1.0e-12; // Mass flux (kg/s) to Sverdrup |
| 56 | +constexpr double Heat2Pw = 4.186e-15; // Heat flux (W) to Petawatt |
| 57 | +constexpr double Salt2SvPpt = 1.0e-9; // Salt flux (kg/s) to Sv*ppt |
| 58 | +constexpr double Salt2MmDay = 3.1536e+5; // Salt flux to water flux (mm/day) |
| 59 | +constexpr double Db2Pa = 1.0e4; // Decibar to Pascal |
| 60 | +constexpr double Pa2Db = 1.0e-4; // Pascal to Decibar |
| 61 | +constexpr double Cm2M = 1.0e-2; // Centimeters to meters |
| 62 | +constexpr double M2Cm = 1.0e2; // Meters to centimeters |
| 63 | +constexpr double HFluxFac = |
| 64 | + 1.0 / (RhoSw * CpSw); // Heat flux (W/m^2) to temp flux (C*m/s) |
| 65 | +constexpr double FwFluxFac = 1.e-6; // Fw flux (kg/m^2/s) to salt((msu/psu)*m/s) |
| 66 | +constexpr double SaltFac = |
| 67 | + -OcnRefSal * FwFluxFac; // Fw flux (kg/m^2/s) to salt flux (msu*m/s) |
| 68 | +constexpr double SFluxFac = 1.0; // Salt flux (kg/m^2/s) to salt flux (msu*m/s) |
| 69 | + |
| 70 | +} // namespace OMEGA |
| 71 | +#endif |
0 commit comments