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  Real moisture_cutoff = amrex::Real(500.0); pp_prob.query("moisture_source_cutoff", moisture_cutoff);
5 
6  // Only apply moisture source below nominal inversion height
7  for (MFIter mfi(*qsrc, TilingIfNotGPU()); mfi.isValid(); ++mfi)
8  {
9  const auto &box = mfi.tilebox();
10  const Array4<Real>& qsrc_arr = qsrc->array(mfi);
11  if (box.length(0) == 1)
12  {
13  ParallelFor(box, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
14  const Real z_cc = d_zlevels_arr[k];
15  if (z_cc < moisture_cutoff) {
16  qsrc_arr(i, j, k) = amrex::Real(5.226199353716133e-12)*z_cc + advection_moisture_rate;
17  } else {
18  qsrc_arr(i, j, k) = amrex::Real(5.226199353716133e-12)*amrex::Real(2980.0) + advection_moisture_rate;
19  }
20  });
21  }
22  }
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real *dx=geomdata.CellSize();const Real x=(i+0.5) *dx[0];const Real y=(j+0.5) *dx[1];const Real Omg=erf_vortex_Gaussian(x, y, xc, yc, R, beta, sigma);const Real deltaT=-(gamma - 1.0)/(2.0 *sigma *sigma) *Omg *Omg;const Real rho_norm=std::pow(1.0+deltaT, inv_gm1);const Real T=(1.0+deltaT) *T_inf;const Real p=std::pow(rho_norm, Gamma)/Gamma *rho_0 *a_inf *a_inf;const Real rho_theta=rho_0 *rho_norm *(T *std::pow(p_0/p, rdOcp));state_pert(i, j, k, RhoTheta_comp)=rho_theta - getRhoThetagivenP(p_hse(i, j, k));const Real r2d_xy=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc));state_pert(i, j, k, RhoScalar_comp)=0.25 *(1.0+std::cos(PI *std::min(r2d_xy, R)/R));})
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Real moisture_cutoff
Definition: ERF_UpdateRhoQtSources_RICO.H:4
ParmParse pp_prob("prob")
Real advection_moisture_rate
Definition: ERF_UpdateRhoQtSources_RICO.H:3