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 
334  {
335  Invalid = -1,
336  OldGoffGratch = 0,
337  GoffGratch = 1,
338  MurphyKoop = 2,
339  Bolton = 3
340  };
@ MurphyKoop
Definition: ERF_SatMethods.H:338
@ Invalid
Definition: ERF_SatMethods.H:335
@ Bolton
Definition: ERF_SatMethods.H:339
@ GoffGratch
Definition: ERF_SatMethods.H:337
@ OldGoffGratch
Definition: ERF_SatMethods.H:336

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.
324  {
325  constexpr auto c1 = amrex::Real(611.2);
326  constexpr auto c2 = amrex::Real(17.67);
327  constexpr auto c3 = amrex::Real(243.5);
328  return c1*exp( (c2*(t - tmelt))/((t - tmelt)+c3) );
329  }
constexpr amrex::Real tmelt
Definition: ERF_MicrophysicsConstants.H:122
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ t
Definition: ERF_WSM6.H:272
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.
230  {
231  // good down to -100 C
232  return pow(amrex::Real(10.), (-amrex::Real(9.09718)*(h2otrip/t-amrex::Real(1))-amrex::Real(3.56654)*
233  log10(h2otrip/t)+amrex::Real(0.876793)*(amrex::Real(1)-t/h2otrip)+
234  log10(amrex::Real(6.1071))))*amrex::Real(100.);
235  }
constexpr amrex::Real h2otrip
Definition: ERF_MicrophysicsConstants.H:123

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.
215  {
216  // uncertain below -70 C
217  return pow(amrex::Real(10.), (-amrex::Real(7.90298)*(tboil/t-amrex::Real(1))+
218  amrex::Real(5.02808)*std::log10(tboil/t)-
219  amrex::Real(1.3816e-7)*(pow(amrex::Real(10.), (amrex::Real(11.344)*(amrex::Real(1)-t/tboil)))-amrex::Real(1))+
220  amrex::Real(8.1328e-3)*(pow(amrex::Real(10.), (-amrex::Real(3.49149)*(tboil/t-amrex::Real(1))))-amrex::Real(1))+
221  std::log10(amrex::Real(1013.246))))*amrex::Real(100.);
222  }
constexpr amrex::Real tboil
Definition: ERF_MicrophysicsConstants.H:124

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.
258  {
259  // (good down to 110 K)
260  return exp(amrex::Real(9.550426) - (amrex::Real(5723.265) / t) + (amrex::Real(3.53068) * log(t))
261  - (amrex::Real(0.00728332) * t));
262  }

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.
244  {
245  // (good for 123 < T < 332 K)
246  return exp(amrex::Real(54.842763) - (amrex::Real(6763.22) / t) - (amrex::Real(4.210) * log(t)) +
247  (amrex::Real(0.000367) * t) + (tanh(amrex::Real(0.0415) * (t - amrex::Real(218.8))) *
248  (amrex::Real(53.878) - (amrex::Real(1331.22) / t) - (amrex::Real(9.44523) * log(t)) +
249  amrex::Real(0.014025) * t)));
250  }

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.
303  {
304  auto term1 = amrex::Real(2.01889049)/(tmelt/t);
305  auto term2 = amrex::Real(3.56654)*log(tmelt/t);
306  auto term3 = amrex::Real(20.947031)*(tmelt/t);
307  return amrex::Real(575.185606e10)*exp(-(term1 + term2 + term3));
308  }

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.
284  {
285  auto ps = amrex::Real(1013.246);
286  auto e1 = amrex::Real(11.344)*(amrex::Real(1) - t/tboil);
287  auto e2 = -amrex::Real(3.49149)*(tboil/t - amrex::Real(1));
288  auto f1 = -amrex::Real(7.90298)*(tboil/t - amrex::Real(1));
289  auto f2 = amrex::Real(5.02808)*log10(tboil/t);
290  auto f3 = -amrex::Real(1.3816)*(pow(amrex::Real(10.0), e1) - amrex::Real(1))/amrex::Real(10000000.0);
291  auto f4 = amrex::Real(8.1328)*(pow(amrex::Real(10.0), e2) - amrex::Real(1))/amrex::Real(1000.0);
292  auto f5 = log10(ps);
293  auto f = f1 + f2 + f3 + f4 + f5;
294  return (pow(amrex::Real(10.0), f))*amrex::Real(100.0);
295  }

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.
93  {
94  // Purpose:
95  // Calculate SVP over ice at a given temperature, and then
96  // calculate and return saturation specific humidity.
97 
98  es = wv_sat_svp_ice(t, idx);
99 
100  qs = wv_sat_svp_to_qsat(es, p);
101 
102  // Ensures returned es is consistent with limiters on qs.
103  es = std::min(es, p);
104  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int idx(int i, int j, int k, int nx, int ny)
Definition: ERF_InitForEnsemble.cpp:396
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:52
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:160
@ qs
Definition: ERF_WDM6.H:30
@ p
Definition: ERF_WSM6.H:280
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.
116  {
117  // Purpose:
118  // Calculate SVP over ice at a given temperature, and then
119  // calculate and return saturation specific humidity.
120 
121  es = wv_sat_svp_trans(t, idx);
122 
123  qs = wv_sat_svp_to_qsat(es, p);
124 
125  // Ensures returned es is consistent with limiters on qs.
126  es = std::min(es, p);
127  }
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:183
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.
70  {
71  // Purpose:
72  // Calculate SVP over water at a given temperature, and then
73  // calculate and return saturation specific humidity.
74 
75  es = wv_sat_svp_water(t, idx);
76 
77  qs = wv_sat_svp_to_qsat(es, p);
78 
79  // Ensures returned es is consistent with limiters on qs.
80  es = std::min(es, p);
81  }
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:137
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.
160  {
161  amrex::Real es;
162  switch(idx)
163  {
164  case GoffGratch:
165  es = GoffGratch_svp_ice(t); break;
166  case MurphyKoop:
167  es = MurphyKoop_svp_ice(t); break;
168  case OldGoffGratch:
169  es = OldGoffGratch_svp_ice(t); break;
170  case Bolton:
171  es = Bolton_svp_water(t); break;
172  }
173  return es;
174  }
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:324
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:303
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:258
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:230

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.
52  {
53  // If pressure is less than SVP, set qs to maximum of amrex::Real(1)
54  if ( (p - es) <= amrex::Real(0) )
55  return amrex::Real(1);
56  else
57  return epsilo*es / (p - omeps*es);
58  }
constexpr amrex::Real epsilo
Definition: ERF_Constants.H:48
constexpr amrex::Real omeps
Definition: ERF_Constants.H:49

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.
183  {
184  amrex::Real esice; // Saturation vapor pressure over ice
185  amrex::Real weight; // Intermediate scratch variable for es transition
186  amrex::Real es;
187 
188  // Water
189  if (t >= (tmelt - ttrice))
190  es = wv_sat_svp_water(t,idx);
191  else
192  es = amrex::Real(0);
193 
194  // Ice
195  if (t < tmelt) {
196  esice = wv_sat_svp_ice(t,idx);
197  if ( (tmelt - t) > ttrice )
198  weight = amrex::Real(1);
199  else
200  weight = (tmelt - t)/ttrice;
201 
202  es = weight*esice + (amrex::Real(1) - weight)*es;
203  }
204  return es;
205  }
constexpr amrex::Real ttrice
Definition: ERF_MicrophysicsConstants.H:125

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.
137  {
138  amrex::Real es;
139  switch(idx)
140  {
141  case GoffGratch:
142  es = GoffGratch_svp_water(t); break;
143  case MurphyKoop:
144  es = MurphyKoop_svp_water(t); break;
145  case OldGoffGratch:
146  es = OldGoffGratch_svp_water(t); break;
147  case Bolton:
148  es = Bolton_svp_water(t); break;
149  }
150  return es;
151  }
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:215
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:284
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:244

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: