ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_UpdateRhoQtSources_RICO.H
Go to the documentation of this file.
1  ParmParse pp_prob("prob");
2 
3  Real advection_moisture_rate = zero; pp_prob.query("advection_moisture_rate", advection_moisture_rate);
4  // RICO (van Zanten et al. 2011): linear in z up to 2980 m and constant above. Above the
5  // cutoff the source keeps its value at the cutoff, so it is continuous there
6  Real moisture_cutoff = amrex::Real(2980.0); pp_prob.query("moisture_source_cutoff", moisture_cutoff);
7 
8  // Only apply moisture source below nominal inversion height
9  for (MFIter mfi(*qsrc, TilingIfNotGPU()); mfi.isValid(); ++mfi)
10  {
11  const auto &box = mfi.tilebox();
12  const Array4<Real>& qsrc_arr = qsrc->array(mfi);
13  if (box.length(0) == 1)
14  {
15  ParallelFor(box, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
16  const Real z_cc = d_zlevels_arr[k];
17  if (z_cc < moisture_cutoff) {
18  qsrc_arr(i, j, k) = amrex::Real(5.226199353716133e-12)*z_cc + advection_moisture_rate;
19  } else {
20  qsrc_arr(i, j, k) = amrex::Real(5.226199353716133e-12)*moisture_cutoff + advection_moisture_rate;
21  }
22  });
23  }
24  }
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Real moisture_cutoff
Definition: ERF_UpdateRhoQtSources_RICO.H:6
ParmParse pp_prob("prob")
Real advection_moisture_rate
Definition: ERF_UpdateRhoQtSources_RICO.H:3