ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
SatMethods Class Reference

Methods for estimating the saturation vapor pressure of water. More...

#include <ERF_SatMethods.H>

Static Public Member Functions

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_to_qsat (const amrex::Real &es, const amrex::Real &p)
 Get saturation specific humidity given pressure and SVP. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE void wv_sat_qsat_water (const amrex::Real &t, const amrex::Real &p, amrex::Real &es, amrex::Real &qs, const int idx=1)
 Calculate SVP over water and saturation specific humidity. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE void wv_sat_qsat_ice (const amrex::Real &t, const amrex::Real &p, amrex::Real &es, amrex::Real &qs, const int idx=1)
 Calculate SVP over ice and saturation specific humidity. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE void wv_sat_qsat_trans (const amrex::Real &t, const amrex::Real &p, amrex::Real &es, amrex::Real &qs, const int idx=1)
 Calculate transition SVP and saturation specific humidity. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_water (const amrex::Real &t, const int idx=1)
 Dispatcher for saturation vapor pressure over water. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_ice (const amrex::Real &t, const int idx=1)
 Dispatcher for saturation vapor pressure over ice. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_trans (const amrex::Real &t, const int idx=1)
 Calculate transition saturation vapor pressure. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real GoffGratch_svp_water (const amrex::Real &t)
 Goff & Gratch (1946) saturation vapor pressure over water. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real GoffGratch_svp_ice (const amrex::Real &t)
 Goff & Gratch (1946) saturation vapor pressure over ice. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real MurphyKoop_svp_water (const amrex::Real &t)
 Murphy & Koop (2005) saturation vapor pressure over water. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real MurphyKoop_svp_ice (const amrex::Real &t)
 Murphy & Koop (2005) saturation vapor pressure over ice. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real OldGoffGratch_svp_water (const amrex::Real &t)
 Old CAM implementation of Goff & Gratch (1946) SVP over water. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real OldGoffGratch_svp_ice (const amrex::Real &t)
 Old CAM implementation of Goff & Gratch (1946) SVP over ice. More...
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real Bolton_svp_water (const amrex::Real &t)
 Bolton (1980) saturation vapor pressure over water. More...
 

Private Types

enum  Type {
  Invalid = -1 , OldGoffGratch = 0 , GoffGratch = 1 , MurphyKoop = 2 ,
  Bolton = 3
}
 

Detailed Description

Methods for estimating the saturation vapor pressure of water.

Member Enumeration Documentation

◆ Type

enum SatMethods::Type
private
Enumerator
Invalid 
OldGoffGratch 
GoffGratch 
MurphyKoop 
Bolton 
333  {
334  Invalid = -1,
335  OldGoffGratch = 0,
336  GoffGratch = 1,
337  MurphyKoop = 2,
338  Bolton = 3
339  };
@ MurphyKoop
Definition: ERF_SatMethods.H:337
@ Invalid
Definition: ERF_SatMethods.H:334
@ Bolton
Definition: ERF_SatMethods.H:338
@ GoffGratch
Definition: ERF_SatMethods.H:336
@ OldGoffGratch
Definition: ERF_SatMethods.H:335

Member Function Documentation

◆ Bolton_svp_water()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real SatMethods::Bolton_svp_water ( const amrex::Real t)
inlinestatic

Bolton (1980) saturation vapor pressure over water.

Parameters
[in]tTemperature.
Returns
Saturation vapor pressure.
323  {
324  constexpr auto c1 = amrex::Real(611.2);
325  constexpr auto c2 = amrex::Real(17.67);
326  constexpr auto c3 = amrex::Real(243.5);
327  return c1*exp( (c2*(t - tmelt))/((t - tmelt)+c3) );
328  }
constexpr amrex::Real tmelt
Definition: ERF_Constants.H:130
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ t
Definition: ERF_WSM6.H:183
real(c_double), parameter c2
Definition: ERF_module_model_constants.F90:35
real(c_double), private c1
Definition: ERF_module_mp_morr_two_moment.F90:212

Referenced by wv_sat_svp_ice(), and wv_sat_svp_water().

Here is the caller graph for this function:

◆ GoffGratch_svp_ice()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real SatMethods::GoffGratch_svp_ice ( const amrex::Real t)
inlinestatic

Goff & Gratch (1946) saturation vapor pressure over ice.

Parameters
[in]tTemperature.
Returns
Saturation vapor pressure.
229  {
230  // good down to -100 C
231  return pow(amrex::Real(10.), (-amrex::Real(9.09718)*(h2otrip/t-amrex::Real(1))-amrex::Real(3.56654)*
232  log10(h2otrip/t)+amrex::Real(0.876793)*(amrex::Real(1)-t/h2otrip)+
233  log10(amrex::Real(6.1071))))*amrex::Real(100.);
234  }
constexpr amrex::Real h2otrip
Definition: ERF_Constants.H:131

Referenced by wv_sat_svp_ice().

Here is the caller graph for this function:

◆ GoffGratch_svp_water()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real SatMethods::GoffGratch_svp_water ( const amrex::Real t)
inlinestatic

Goff & Gratch (1946) saturation vapor pressure over water.

Parameters
[in]tTemperature.
Returns
Saturation vapor pressure.
214  {
215  // uncertain below -70 C
216  return pow(amrex::Real(10.), (-amrex::Real(7.90298)*(tboil/t-amrex::Real(1))+
217  amrex::Real(5.02808)*std::log10(tboil/t)-
218  amrex::Real(1.3816e-7)*(pow(amrex::Real(10.), (amrex::Real(11.344)*(amrex::Real(1)-t/tboil)))-amrex::Real(1))+
219  amrex::Real(8.1328e-3)*(pow(amrex::Real(10.), (-amrex::Real(3.49149)*(tboil/t-amrex::Real(1))))-amrex::Real(1))+
220  std::log10(amrex::Real(1013.246))))*amrex::Real(100.);
221  }
constexpr amrex::Real tboil
Definition: ERF_Constants.H:132

Referenced by wv_sat_svp_water().

Here is the caller graph for this function:

◆ MurphyKoop_svp_ice()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real SatMethods::MurphyKoop_svp_ice ( const amrex::Real t)
inlinestatic

Murphy & Koop (2005) saturation vapor pressure over ice.

Parameters
[in]tTemperature.
Returns
Saturation vapor pressure.
257  {
258  // (good down to 110 K)
259  return exp(amrex::Real(9.550426) - (amrex::Real(5723.265) / t) + (amrex::Real(3.53068) * log(t))
260  - (amrex::Real(0.00728332) * t));
261  }

Referenced by wv_sat_svp_ice().

Here is the caller graph for this function:

◆ MurphyKoop_svp_water()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real SatMethods::MurphyKoop_svp_water ( const amrex::Real t)
inlinestatic

Murphy & Koop (2005) saturation vapor pressure over water.

Parameters
[in]tTemperature.
Returns
Saturation vapor pressure.
243  {
244  // (good for 123 < T < 332 K)
245  return exp(amrex::Real(54.842763) - (amrex::Real(6763.22) / t) - (amrex::Real(4.210) * log(t)) +
246  (amrex::Real(0.000367) * t) + (tanh(amrex::Real(0.0415) * (t - amrex::Real(218.8))) *
247  (amrex::Real(53.878) - (amrex::Real(1331.22) / t) - (amrex::Real(9.44523) * log(t)) +
248  amrex::Real(0.014025) * t)));
249  }

Referenced by wv_sat_svp_water().

Here is the caller graph for this function:

◆ OldGoffGratch_svp_ice()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real SatMethods::OldGoffGratch_svp_ice ( const amrex::Real t)
inlinestatic

Old CAM implementation of Goff & Gratch (1946) SVP over ice.

Parameters
[in]tTemperature.
Returns
Saturation vapor pressure.
302  {
303  auto term1 = amrex::Real(2.01889049)/(tmelt/t);
304  auto term2 = amrex::Real(3.56654)*log(tmelt/t);
305  auto term3 = amrex::Real(20.947031)*(tmelt/t);
306  return amrex::Real(575.185606e10)*exp(-(term1 + term2 + term3));
307  }

Referenced by wv_sat_svp_ice().

Here is the caller graph for this function:

◆ OldGoffGratch_svp_water()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real SatMethods::OldGoffGratch_svp_water ( const amrex::Real t)
inlinestatic

Old CAM implementation of Goff & Gratch (1946) SVP over water.

Parameters
[in]tTemperature.
Returns
Saturation vapor pressure.
283  {
284  auto ps = amrex::Real(1013.246);
285  auto e1 = amrex::Real(11.344)*(amrex::Real(1) - t/tboil);
286  auto e2 = -amrex::Real(3.49149)*(tboil/t - amrex::Real(1));
287  auto f1 = -amrex::Real(7.90298)*(tboil/t - amrex::Real(1));
288  auto f2 = amrex::Real(5.02808)*log10(tboil/t);
289  auto f3 = -amrex::Real(1.3816)*(pow(amrex::Real(10.0), e1) - amrex::Real(1))/amrex::Real(10000000.0);
290  auto f4 = amrex::Real(8.1328)*(pow(amrex::Real(10.0), e2) - amrex::Real(1))/amrex::Real(1000.0);
291  auto f5 = log10(ps);
292  auto f = f1 + f2 + f3 + f4 + f5;
293  return (pow(amrex::Real(10.0), f))*amrex::Real(100.0);
294  }

Referenced by wv_sat_svp_water().

Here is the caller graph for this function:

◆ wv_sat_qsat_ice()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE void SatMethods::wv_sat_qsat_ice ( const amrex::Real t,
const amrex::Real p,
amrex::Real es,
amrex::Real qs,
const int  idx = 1 
)
inlinestatic

Calculate SVP over ice and saturation specific humidity.

Parameters
[in]tTemperature.
[in]pTotal pressure.
[out]esSaturation vapor pressure.
[out]qsSaturation specific humidity.
[in]idxScheme index.
92  {
93  // Purpose:
94  // Calculate SVP over ice at a given temperature, and then
95  // calculate and return saturation specific humidity.
96 
97  es = wv_sat_svp_ice(t, idx);
98 
99  qs = wv_sat_svp_to_qsat(es, p);
100 
101  // Ensures returned es is consistent with limiters on qs.
102  es = std::min(es, p);
103  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int idx(int i, int j, int k, int nx, int ny)
Definition: ERF_InitForEnsemble.cpp:365
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_to_qsat(const amrex::Real &es, const amrex::Real &p)
Get saturation specific humidity given pressure and SVP.
Definition: ERF_SatMethods.H:51
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_ice(const amrex::Real &t, const int idx=1)
Dispatcher for saturation vapor pressure over ice.
Definition: ERF_SatMethods.H:159
@ qs
Definition: ERF_WDM6.H:29
@ p
Definition: ERF_WSM6.H:191
Here is the call graph for this function:

◆ wv_sat_qsat_trans()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE void SatMethods::wv_sat_qsat_trans ( const amrex::Real t,
const amrex::Real p,
amrex::Real es,
amrex::Real qs,
const int  idx = 1 
)
inlinestatic

Calculate transition SVP and saturation specific humidity.

Parameters
[in]tTemperature.
[in]pTotal pressure.
[out]esSaturation vapor pressure.
[out]qsSaturation specific humidity.
[in]idxScheme index.
115  {
116  // Purpose:
117  // Calculate SVP over ice at a given temperature, and then
118  // calculate and return saturation specific humidity.
119 
120  es = wv_sat_svp_trans(t, idx);
121 
122  qs = wv_sat_svp_to_qsat(es, p);
123 
124  // Ensures returned es is consistent with limiters on qs.
125  es = std::min(es, p);
126  }
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_trans(const amrex::Real &t, const int idx=1)
Calculate transition saturation vapor pressure.
Definition: ERF_SatMethods.H:182
Here is the call graph for this function:

◆ wv_sat_qsat_water()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE void SatMethods::wv_sat_qsat_water ( const amrex::Real t,
const amrex::Real p,
amrex::Real es,
amrex::Real qs,
const int  idx = 1 
)
inlinestatic

Calculate SVP over water and saturation specific humidity.

Parameters
[in]tTemperature.
[in]pTotal pressure.
[out]esSaturation vapor pressure.
[out]qsSaturation specific humidity.
[in]idxScheme index.
69  {
70  // Purpose:
71  // Calculate SVP over water at a given temperature, and then
72  // calculate and return saturation specific humidity.
73 
74  es = wv_sat_svp_water(t, idx);
75 
76  qs = wv_sat_svp_to_qsat(es, p);
77 
78  // Ensures returned es is consistent with limiters on qs.
79  es = std::min(es, p);
80  }
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_water(const amrex::Real &t, const int idx=1)
Dispatcher for saturation vapor pressure over water.
Definition: ERF_SatMethods.H:136
Here is the call graph for this function:

◆ wv_sat_svp_ice()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real SatMethods::wv_sat_svp_ice ( const amrex::Real t,
const int  idx = 1 
)
inlinestatic

Dispatcher for saturation vapor pressure over ice.

Parameters
[in]tTemperature.
[in]idxScheme index.
Returns
Saturation vapor pressure over ice.
159  {
160  amrex::Real es;
161  switch(idx)
162  {
163  case GoffGratch:
164  es = GoffGratch_svp_ice(t); break;
165  case MurphyKoop:
166  es = MurphyKoop_svp_ice(t); break;
167  case OldGoffGratch:
168  es = OldGoffGratch_svp_ice(t); break;
169  case Bolton:
170  es = Bolton_svp_water(t); break;
171  }
172  return es;
173  }
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real Bolton_svp_water(const amrex::Real &t)
Bolton (1980) saturation vapor pressure over water.
Definition: ERF_SatMethods.H:323
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real OldGoffGratch_svp_ice(const amrex::Real &t)
Old CAM implementation of Goff & Gratch (1946) SVP over ice.
Definition: ERF_SatMethods.H:302
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real MurphyKoop_svp_ice(const amrex::Real &t)
Murphy & Koop (2005) saturation vapor pressure over ice.
Definition: ERF_SatMethods.H:257
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real GoffGratch_svp_ice(const amrex::Real &t)
Goff & Gratch (1946) saturation vapor pressure over ice.
Definition: ERF_SatMethods.H:229

Referenced by wv_sat_qsat_ice(), and wv_sat_svp_trans().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wv_sat_svp_to_qsat()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real SatMethods::wv_sat_svp_to_qsat ( const amrex::Real es,
const amrex::Real p 
)
inlinestatic

Get saturation specific humidity given pressure and SVP.

Parameters
[in]esSaturation vapor pressure.
[in]pTotal pressure.
Returns
Saturation specific humidity.
51  {
52  // If pressure is less than SVP, set qs to maximum of amrex::Real(1)
53  if ( (p - es) <= amrex::Real(0) )
54  return amrex::Real(1);
55  else
56  return epsilo*es / (p - omeps*es);
57  }
constexpr amrex::Real epsilo
Definition: ERF_Constants.H:134
constexpr amrex::Real omeps
Definition: ERF_Constants.H:135

Referenced by wv_sat_qsat_ice(), wv_sat_qsat_trans(), and wv_sat_qsat_water().

Here is the caller graph for this function:

◆ wv_sat_svp_trans()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real SatMethods::wv_sat_svp_trans ( const amrex::Real t,
const int  idx = 1 
)
inlinestatic

Calculate transition saturation vapor pressure.

Parameters
[in]tTemperature.
[in]idxScheme index.
Returns
Transition saturation vapor pressure.
182  {
183  amrex::Real esice; // Saturation vapor pressure over ice
184  amrex::Real weight; // Intermediate scratch variable for es transition
185  amrex::Real es;
186 
187  // Water
188  if (t >= (tmelt - ttrice))
189  es = wv_sat_svp_water(t,idx);
190  else
191  es = amrex::Real(0);
192 
193  // Ice
194  if (t < tmelt) {
195  esice = wv_sat_svp_ice(t,idx);
196  if ( (tmelt - t) > ttrice )
197  weight = amrex::Real(1);
198  else
199  weight = (tmelt - t)/ttrice;
200 
201  es = weight*esice + (amrex::Real(1) - weight)*es;
202  }
203  return es;
204  }
constexpr amrex::Real ttrice
Definition: ERF_Constants.H:133

Referenced by wv_sat_qsat_trans().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wv_sat_svp_water()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real SatMethods::wv_sat_svp_water ( const amrex::Real t,
const int  idx = 1 
)
inlinestatic

Dispatcher for saturation vapor pressure over water.

Parameters
[in]tTemperature.
[in]idxScheme index.
Returns
Saturation vapor pressure over water.
136  {
137  amrex::Real es;
138  switch(idx)
139  {
140  case GoffGratch:
141  es = GoffGratch_svp_water(t); break;
142  case MurphyKoop:
143  es = MurphyKoop_svp_water(t); break;
144  case OldGoffGratch:
145  es = OldGoffGratch_svp_water(t); break;
146  case Bolton:
147  es = Bolton_svp_water(t); break;
148  }
149  return es;
150  }
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real GoffGratch_svp_water(const amrex::Real &t)
Goff & Gratch (1946) saturation vapor pressure over water.
Definition: ERF_SatMethods.H:214
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real OldGoffGratch_svp_water(const amrex::Real &t)
Old CAM implementation of Goff & Gratch (1946) SVP over water.
Definition: ERF_SatMethods.H:283
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real MurphyKoop_svp_water(const amrex::Real &t)
Murphy & Koop (2005) saturation vapor pressure over water.
Definition: ERF_SatMethods.H:243

Referenced by wv_sat_qsat_water(), and wv_sat_svp_trans().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: