ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_UpdateRhoThetaSources_GATE.H
Go to the documentation of this file.
1  const auto dx = geom.CellSizeArray();
2  bool use_zlevels = (z_phys_cc != nullptr);
3 
4  for (MFIter mfi(*src, TilingIfNotGPU()); mfi.isValid(); ++mfi)
5  {
6  const auto &box = mfi.tilebox();
7  const Array4<Real>& src_arr = src->array(mfi);
8  if (box.length(0) != 1)
9  {
10  src->setVal(0.0);
11  } else {
12  ParallelFor(box, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
13  const Real z_cc = (use_zlevels) ? d_zlevels_arr[k] : (k+0.5)*dx[2];
14  if ((z_cc < 15000) && (z_cc > 380)) {
15  Real f_a[6] = {-1.22998448e-24, 5.86487977e-20, -1.11949167e-15,
16  1.03417521e-11, -3.80858898e-08, -1.39371490e-05};
17  Real result = f_a[0];
18  for (int ind = 1; ind < 6; ++ind) {
19  result = result * z_cc + f_a[ind];
20  }
21  src_arr(i, j, k) = result;
22  } else if (z_cc <= 380) {
23  Real f_a[2] = {1.73461284e-08, -3.00569096e-05};
24  Real result = f_a[0];
25  for (int ind = 1; ind < 2; ++ind) {
26  result = result * z_cc + f_a[ind];
27  }
28  src_arr(i, j, k) = result;
29  } else {
30  src_arr(i, j, k) = 0.0;
31  }
32  });
33  }
34  }
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);})
amrex::Real Real
Definition: ERF_ShocInterface.H:19
bool use_zlevels
Definition: ERF_UpdateRhoThetaSources_GATE.H:2
const auto dx
Definition: ERF_UpdateRhoThetaSources_GATE.H:1