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

#include <ERF_Sat_methods.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)
 
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)
 
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)
 
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)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_water (const amrex::Real &t, const int idx=1)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_ice (const amrex::Real &t, const int idx=1)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_trans (const amrex::Real &t, const int idx=1)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real GoffGratch_svp_water (const amrex::Real &t)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real GoffGratch_svp_ice (const amrex::Real &t)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real MurphyKoop_svp_water (const amrex::Real &t)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real MurphyKoop_svp_ice (const amrex::Real &t)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real OldGoffGratch_svp_water (const amrex::Real &t)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real OldGoffGratch_svp_ice (const amrex::Real &t)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real Bolton_svp_water (const amrex::Real &t)
 

Private Types

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

Member Enumeration Documentation

◆ Type

enum SatMethods::Type
private
Enumerator
Invalid 
OldGoffGratch 
GoffGratch 
MurphyKoop 
Bolton 
247  {
248  Invalid = -1,
249  OldGoffGratch = 0,
250  GoffGratch = 1,
251  MurphyKoop = 2,
252  Bolton = 3
253  };
@ MurphyKoop
Definition: ERF_Sat_methods.H:251
@ Invalid
Definition: ERF_Sat_methods.H:248
@ Bolton
Definition: ERF_Sat_methods.H:252
@ GoffGratch
Definition: ERF_Sat_methods.H:250
@ OldGoffGratch
Definition: ERF_Sat_methods.H:249

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
237  {
238  constexpr auto c1 = 611.2;
239  constexpr auto c2 = 17.67;
240  constexpr auto c3 = 243.5;
241  return c1*exp( (c2*(t - tmelt))/((t - tmelt)+c3) );
242  }
constexpr amrex::Real tmelt
Definition: ERF_Constants.H:88

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
168  {
169  // good down to -100 C
170  return pow(10., (-9.09718*(h2otrip/t-1.)-3.56654*
171  log10(h2otrip/t)+0.876793*(1.-t/h2otrip)+
172  log10(6.1071)))*100.;
173  }
constexpr amrex::Real h2otrip
Definition: ERF_Constants.H:89

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
158  {
159  // uncertain below -70 C
160  return pow(10., (-7.90298*(tboil/t-1.)+
161  5.02808*std::log10(tboil/t)-
162  1.3816e-7*(pow(10., (11.344*(1.-t/tboil)))-1.)+
163  8.1328e-3*(pow(10., (-3.49149*(tboil/t-1.)))-1.)+
164  std::log10(1013.246)))*100.;
165  }
constexpr amrex::Real tboil
Definition: ERF_Constants.H:90

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
186  {
187  // (good down to 110 K)
188  return exp(9.550426 - (5723.265 / t) + (3.53068 * log(t))
189  - (0.00728332 * t));
190  }

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
177  {
178  // (good for 123 < T < 332 K)
179  return exp(54.842763 - (6763.22 / t) - (4.210 * log(t)) +
180  (0.000367 * t) + (tanh(0.0415 * (t - 218.8)) *
181  (53.878 - (1331.22 / t) - (9.44523 * log(t)) +
182  0.014025 * t)));
183  }

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
221  {
222  auto term1 = 2.01889049/(tmelt/t);
223  auto term2 = 3.56654*log(tmelt/t);
224  auto term3 = 20.947031*(tmelt/t);
225  return 575.185606e10*exp(-(term1 + term2 + term3));
226  }

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
207  {
208  auto ps = 1013.246;
209  auto e1 = 11.344*(1.0 - t/tboil);
210  auto e2 = -3.49149*(tboil/t - 1.0);
211  auto f1 = -7.90298*(tboil/t - 1.0);
212  auto f2 = 5.02808*log10(tboil/t);
213  auto f3 = -1.3816*(pow(10.0, e1) - 1.0)/10000000.0;
214  auto f4 = 8.1328*(pow(10.0, e2) - 1.0)/1000.0;
215  auto f5 = log10(ps);
216  auto f = f1 + f2 + f3 + f4 + f5;
217  return (pow(10.0, f))*100.0;
218  }

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
67  {
68  // Purpose:
69  // Calculate SVP over ice at a given temperature, and then
70  // calculate and return saturation specific humidity.
71 
72  es = wv_sat_svp_ice(t, idx);
73 
74  qs = wv_sat_svp_to_qsat(es, p);
75 
76  // Ensures returned es is consistent with limiters on qs.
77  es = std::min(es, p);
78  }
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_to_qsat(const amrex::Real &es, const amrex::Real &p)
Definition: ERF_Sat_methods.H:42
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_ice(const amrex::Real &t, const int idx=1)
Definition: ERF_Sat_methods.H:114

Referenced by WaterVaporSat::qsat_ice().

Here is the call graph for this function:
Here is the caller 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
82  {
83  // Purpose:
84  // Calculate SVP over ice at a given temperature, and then
85  // calculate and return saturation specific humidity.
86 
87  es = wv_sat_svp_trans(t, idx);
88 
89  qs = wv_sat_svp_to_qsat(es, p);
90 
91  // Ensures returned es is consistent with limiters on qs.
92  es = std::min(es, p);
93  }
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_trans(const amrex::Real &t, const int idx=1)
Definition: ERF_Sat_methods.H:131
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
52  {
53  // Purpose:
54  // Calculate SVP over water at a given temperature, and then
55  // calculate and return saturation specific humidity.
56 
57  es = wv_sat_svp_water(t, idx);
58 
59  qs = wv_sat_svp_to_qsat(es, p);
60 
61  // Ensures returned es is consistent with limiters on qs.
62  es = std::min(es, p);
63  }
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real wv_sat_svp_water(const amrex::Real &t, const int idx=1)
Definition: ERF_Sat_methods.H:97

Referenced by WaterVaporSat::qsat_water().

Here is the call graph for this function:
Here is the caller 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
114  {
115  amrex::Real es;
116  switch(idx)
117  {
118  case GoffGratch:
119  es = GoffGratch_svp_ice(t); break;
120  case MurphyKoop:
121  es = MurphyKoop_svp_ice(t); break;
122  case OldGoffGratch:
123  es = OldGoffGratch_svp_ice(t); break;
124  case Bolton:
125  es = Bolton_svp_water(t); break;
126  }
127  return es;
128  }
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real Bolton_svp_water(const amrex::Real &t)
Definition: ERF_Sat_methods.H:237
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real OldGoffGratch_svp_ice(const amrex::Real &t)
Definition: ERF_Sat_methods.H:221
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real MurphyKoop_svp_ice(const amrex::Real &t)
Definition: ERF_Sat_methods.H:186
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real GoffGratch_svp_ice(const amrex::Real &t)
Definition: ERF_Sat_methods.H:168

Referenced by WaterVaporSat::svp_ice(), 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
42  {
43  // If pressure is less than SVP, set qs to maximum of 1.
44  if ( (p - es) <= 0. )
45  return 1.0;
46  else
47  return epsilo*es / (p - omeps*es);
48  }
constexpr amrex::Real epsilo
Definition: ERF_Constants.H:92
constexpr amrex::Real omeps
Definition: ERF_Constants.H:93

Referenced by WaterVaporSat::qsat(), 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
131  {
132  amrex::Real esice; // Saturation vapor pressure over ice
133  amrex::Real weight; // Intermediate scratch variable for es transition
134  amrex::Real es;
135 
136  // Water
137  if (t >= (tmelt - ttrice))
138  es = wv_sat_svp_water(t,idx);
139  else
140  es = 0.0;
141 
142  // Ice
143  if (t < tmelt) {
144  esice = wv_sat_svp_ice(t,idx);
145  if ( (tmelt - t) > ttrice )
146  weight = 1.0;
147  else
148  weight = (tmelt - t)/ttrice;
149 
150  es = weight*esice + (1.0 - weight)*es;
151  }
152  return es;
153  }
constexpr amrex::Real ttrice
Definition: ERF_Constants.H:91

Referenced by WaterVaporSat::svp_trans(), and 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
97  {
98  amrex::Real es;
99  switch(idx)
100  {
101  case GoffGratch:
102  es = GoffGratch_svp_water(t); break;
103  case MurphyKoop:
104  es = MurphyKoop_svp_water(t); break;
105  case OldGoffGratch:
106  es = OldGoffGratch_svp_water(t); break;
107  case Bolton:
108  es = Bolton_svp_water(t); break;
109  }
110  return es;
111  }
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real GoffGratch_svp_water(const amrex::Real &t)
Definition: ERF_Sat_methods.H:158
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real OldGoffGratch_svp_water(const amrex::Real &t)
Definition: ERF_Sat_methods.H:207
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real MurphyKoop_svp_water(const amrex::Real &t)
Definition: ERF_Sat_methods.H:177

Referenced by WaterVaporSat::svp_water(), 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: