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

#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)
 
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_SatMethods.H:251
@ Invalid
Definition: ERF_SatMethods.H:248
@ Bolton
Definition: ERF_SatMethods.H:252
@ GoffGratch
Definition: ERF_SatMethods.H:250
@ OldGoffGratch
Definition: ERF_SatMethods.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 = amrex::Real(611.2);
239  constexpr auto c2 = amrex::Real(17.67);
240  constexpr auto c3 = amrex::Real(243.5);
241  return c1*exp( (c2*(t - tmelt))/((t - tmelt)+c3) );
242  }
constexpr amrex::Real tmelt
Definition: ERF_Constants.H:98
Real * t
Definition: ERF_InitCustomPert_SquallLine.H:60
amrex::Real Real
Definition: ERF_ShocInterface.H:19
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
168  {
169  // good down to -100 C
170  return pow(amrex::Real(10.), (-amrex::Real(9.09718)*(h2otrip/t-amrex::Real(1))-amrex::Real(3.56654)*
171  log10(h2otrip/t)+amrex::Real(0.876793)*(amrex::Real(1)-t/h2otrip)+
172  log10(amrex::Real(6.1071))))*amrex::Real(100.);
173  }
constexpr amrex::Real h2otrip
Definition: ERF_Constants.H:99

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

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(amrex::Real(9.550426) - (amrex::Real(5723.265) / t) + (amrex::Real(3.53068) * log(t))
189  - (amrex::Real(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(amrex::Real(54.842763) - (amrex::Real(6763.22) / t) - (amrex::Real(4.210) * log(t)) +
180  (amrex::Real(0.000367) * t) + (tanh(amrex::Real(0.0415) * (t - amrex::Real(218.8))) *
181  (amrex::Real(53.878) - (amrex::Real(1331.22) / t) - (amrex::Real(9.44523) * log(t)) +
182  amrex::Real(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 = amrex::Real(2.01889049)/(tmelt/t);
223  auto term2 = amrex::Real(3.56654)*log(tmelt/t);
224  auto term3 = amrex::Real(20.947031)*(tmelt/t);
225  return amrex::Real(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 = amrex::Real(1013.246);
209  auto e1 = amrex::Real(11.344)*(amrex::Real(1) - t/tboil);
210  auto e2 = -amrex::Real(3.49149)*(tboil/t - amrex::Real(1));
211  auto f1 = -amrex::Real(7.90298)*(tboil/t - amrex::Real(1));
212  auto f2 = amrex::Real(5.02808)*log10(tboil/t);
213  auto f3 = -amrex::Real(1.3816)*(pow(amrex::Real(10.0), e1) - amrex::Real(1))/amrex::Real(10000000.0);
214  auto f4 = amrex::Real(8.1328)*(pow(amrex::Real(10.0), e2) - amrex::Real(1))/amrex::Real(1000.0);
215  auto f5 = log10(ps);
216  auto f = f1 + f2 + f3 + f4 + f5;
217  return (pow(amrex::Real(10.0), f))*amrex::Real(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  }
Real * p
Definition: ERF_InitCustomPert_SquallLine.H:61
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_SatMethods.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_SatMethods.H:114
@ qs
Definition: ERF_WSM6.H:28

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_SatMethods.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_SatMethods.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_SatMethods.H:237
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real OldGoffGratch_svp_ice(const amrex::Real &t)
Definition: ERF_SatMethods.H:221
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real MurphyKoop_svp_ice(const amrex::Real &t)
Definition: ERF_SatMethods.H:186
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real GoffGratch_svp_ice(const amrex::Real &t)
Definition: ERF_SatMethods.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 amrex::Real(1)
44  if ( (p - es) <= amrex::Real(0) )
45  return amrex::Real(1);
46  else
47  return epsilo*es / (p - omeps*es);
48  }
constexpr amrex::Real epsilo
Definition: ERF_Constants.H:102
constexpr amrex::Real omeps
Definition: ERF_Constants.H:103

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 = amrex::Real(0);
141 
142  // Ice
143  if (t < tmelt) {
144  esice = wv_sat_svp_ice(t,idx);
145  if ( (tmelt - t) > ttrice )
146  weight = amrex::Real(1);
147  else
148  weight = (tmelt - t)/ttrice;
149 
150  es = weight*esice + (amrex::Real(1) - weight)*es;
151  }
152  return es;
153  }
constexpr amrex::Real ttrice
Definition: ERF_Constants.H:101

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_SatMethods.H:158
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real OldGoffGratch_svp_water(const amrex::Real &t)
Definition: ERF_SatMethods.H:207
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real MurphyKoop_svp_water(const amrex::Real &t)
Definition: ERF_SatMethods.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: