ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_ProbCommon.H
Go to the documentation of this file.
1 #ifndef ERF_PROBCOMMON_H_
2 #define ERF_PROBCOMMON_H_
3 
4 #include <AMReX_ParmParse.H>
5 #include <AMReX_Geometry.H>
6 #include <AMReX_FArrayBox.H>
7 #include <AMReX_MultiFab.H>
8 
9 #include "ERF_DataStruct.H"
10 #include "ERF_EOS.H"
11 #include "ERF_HSEUtils.H"
12 #include "ERF_TileNoZ.H"
13 
15  amrex::Real rho_0 = 1.0;
16  amrex::Real T_0 = 300.0;
17 };
18 
19 /**
20  * Class to hold problem-specific routines
21 */
23 {
24 public:
25 
26  /**
27  * Virtual destructor to avoid data leakage with derived class
28  */
29  virtual ~ProblemBase () = default;
30 
31  /**
32  * Function to initialize the hydrostatic reference density
33  *
34  * @param[out] rho_hse hydrostatic reference density
35  * @param[in] z_phys_nd height coordinate at nodes
36  * @param[in] z_phys_cc height coordinate at cell centers
37  * @param[in] geom container for geometric information
38  */
39  virtual void
40  erf_init_dens_hse (amrex::MultiFab& /*rho_hse*/,
41  std::unique_ptr<amrex::MultiFab>& /*z_phys_nd*/,
42  std::unique_ptr<amrex::MultiFab>& /*z_phys_cc*/,
43  amrex::Geometry const& /*geom*/)
44  {
45  amrex::Print() << "Hydrostatically balanced density was NOT set"
46  << " -- an appropriate init_type should probably have been specified"
47  << " (e.g., input_sounding, ideal, real, or metgrid)"
48  << std::endl;
49  amrex::Error("Should never call erf_init_dens_hse for "+name()+" problem");
50  }
51 
52  virtual void
53  erf_init_dens_hse_moist (amrex::MultiFab& /*rho_hse*/,
54  std::unique_ptr<amrex::MultiFab>& /*z_phys_nd*/,
55  amrex::Geometry const& /*geom*/)
56  {
57 
58  }
59 
60  /**
61  * Function to perform custom initialization of a test problem
62  *
63  * @param[in] bx cell-centered box on which to initialize scalars
64  * @param[in] xbx box on which to initialize x-component of velocity
65  * @param[in] ybx box on which to initialize y-component of velocity
66  * @param[in] zbx box on which to initialize z-component of velocity
67  * @param[out] state cell-centered variables to be filled in this routine
68  * @param[out] x_velocity x-component of velocity to be filled in this routine
69  * @param[out] y_velocity y-component of velocity to be filled in this routine
70  * @param[out] z_velocity z-component of velocity to be filled in this routine
71  * @param[out] r_hse hydrostatic reference density
72  * @param[out] p_hse hydrostatic reference pressure
73  * @param[in] z_nd height coordinate at nodes
74  * @param[in] z_cc height coordinate at cell centers
75  * @param[in] qv water vapor
76  * @param[in] qc cloud water
77  * @param[in] qi cloud ice
78  * @param[in] mf_m map factor on cell centers
79  * @param[in] mf_u map factor on x-faces
80  * @param[in] mf_v map factor on y-faces
81  * @param[in] sc SolverChoice structure that carries parameters
82  */
83  virtual void
84  init_custom_pert (const amrex::Box& /*bx*/,
85  const amrex::Box& /*xbx*/,
86  const amrex::Box& /*ybx*/,
87  const amrex::Box& /*zbx*/,
88  amrex::Array4<amrex::Real const> const& /*state*/,
89  amrex::Array4<amrex::Real > const& /*state_pert*/,
90  amrex::Array4<amrex::Real > const& /*x_vel_pert*/,
91  amrex::Array4<amrex::Real > const& /*y_vel_pert*/,
92  amrex::Array4<amrex::Real > const& /*z_vel_pert*/,
93  amrex::Array4<amrex::Real > const& /*r_hse*/,
94  amrex::Array4<amrex::Real > const& /*p_hse*/,
95  amrex::Array4<amrex::Real const> const& /*z_nd*/,
96  amrex::Array4<amrex::Real const> const& /*z_cc*/,
97  amrex::GeometryData const& /*geomdata*/,
98  amrex::Array4<amrex::Real const> const& /*mf_m*/,
99  amrex::Array4<amrex::Real const> const& /*mf_u*/,
100  amrex::Array4<amrex::Real const> const& /*mf_v*/,
101  const SolverChoice& /*sc*/)
102  {
103  amrex::Print() << "No perturbation to background fields supplied for "
104  << name() << " problem" << std::endl;
105  }
106 
107  /**
108  * Function to update user-specified temperature source terms that can
109  * vary with time and height.
110  *
111  * @param[in] time current time
112  * @param[out] rhotheta_source forcing profile
113  * @param[in] geom container for geometric information
114  * @param[in] z_phys_cc height coordinate at cell centers
115  */
116  virtual void
117  update_rhotheta_sources (const amrex::Real& /*time*/,
118  amrex::Vector<amrex::Real>& src,
119  amrex::Gpu::DeviceVector<amrex::Real>& d_src,
120  const amrex::Geometry& geom,
121  std::unique_ptr<amrex::MultiFab>& z_phys_cc)
122  {
123  if (src.empty()) return;
124 
125  if (z_phys_cc) {
126  // use_terrain=1
127  amrex::Error("Temperature forcing not defined for "+name()+" problem with terrain");
128  } else {
129  const int khi = geom.Domain().bigEnd()[2];
130  // const amrex::Real* prob_lo = geom.ProbLo();
131  // const auto dx = geom.CellSize();
132  for (int k = 0; k <= khi; k++)
133  {
134  // const amrex::Real z_cc = prob_lo[2] + (k+0.5)* dx[2];
135  // set RHS term of RhoTheta equation based on time, z_cc here
136  src[k] = 0.0;
137  }
138  }
139 
140  // Copy from host version to device version
141  amrex::Gpu::copy(amrex::Gpu::hostToDevice, src.begin(), src.end(), d_src.begin());
142  }
143 
144  /**
145  * Function to update user-specified moisture source terms that can
146  * vary with time and height.
147  *
148  * @param[in] time current time
149  * @param[out] rhoqt_source moisture forcing profile
150  * @param[in] geom container for geometric information
151  * @param[in] z_phys_cc height coordinate at cell centers
152  */
153  virtual void
154  update_rhoqt_sources (const amrex::Real& /*time*/,
155  amrex::Vector<amrex::Real>& qsrc,
156  amrex::Gpu::DeviceVector<amrex::Real>& d_qsrc,
157  const amrex::Geometry& geom,
158  std::unique_ptr<amrex::MultiFab>& z_phys_cc)
159  {
160  if (qsrc.empty()) return;
161 
162  if (z_phys_cc) {
163  // use_terrain=1
164  amrex::Error("Moisture forcing not defined for "+name()+" problem with terrain");
165  } else {
166  const int khi = geom.Domain().bigEnd()[2];
167  // const amrex::Real* prob_lo = geom.ProbLo();
168  // const auto dx = geom.CellSize();
169  for (int k = 0; k <= khi; k++)
170  {
171  // const amrex::Real z_cc = prob_lo[2] + (k+0.5)* dx[2];
172  // set RHS term of RhoQ1 equation based on time, z_cc here
173  qsrc[k] = 0.0;
174  }
175  }
176 
177  // Copy from host version to device version
178  amrex::Gpu::copy(amrex::Gpu::hostToDevice, qsrc.begin(), qsrc.end(), d_qsrc.begin());
179  }
180 
181  /**
182  * Function to update the vertical velocity profile, used to add subsidence
183  * source terms for x-mom, y-mom, rho*theta, rho*Q1, and rho*Q2.
184  *
185  * TODO: Currently, this is only called by InitData, so there is no time
186  * dependence.
187  *
188  * @param[in] time current time
189  * @param[out] wbar w vel forcing profile
190  * @param[in] geom container for geometric information
191  * @param[in] z_phys_cc height coordinate at cell centers
192  */
193  virtual void
194  update_w_subsidence (const amrex::Real& /*time*/,
195  amrex::Vector<amrex::Real>& wbar,
196  amrex::Gpu::DeviceVector<amrex::Real>& d_wbar,
197  const amrex::Geometry& geom,
198  std::unique_ptr<amrex::MultiFab>& z_phys_cc)
199  {
200  if (wbar.empty()) return;
201 
202  if (z_phys_cc) {
203  // use_terrain=1
204  amrex::Error("Moisture forcing not defined for "+name()+" problem with terrain");
205  } else {
206  const int khi = geom.Domain().bigEnd()[2];
207  // const amrex::Real* prob_lo = geom.ProbLo();
208  // const auto dx = geom.CellSize();
209  for (int k = 0; k <= khi; k++)
210  {
211  // const amrex::Real z_cc = prob_lo[2] + (k+0.5)* dx[2];
212  // set vertical velocity profile based on time, z_cc here
213  wbar[k] = 0.0;
214  }
215  }
216 
217  // Copy from host version to device version
218  amrex::Gpu::copy(amrex::Gpu::hostToDevice, wbar.begin(), wbar.end(), d_wbar.begin());
219  }
220 
221  /**
222  * Function to update user-specified geostrophic wind profile.
223  *
224  * @param[in] time current time
225  * @param[out] u_geos geostrophic wind profile
226  * @param[out] v_geos geostrophic wind profile
227  * @param[in] geom container for geometric information
228  * @param[in] z_phys_cc height coordinate at cell centers
229  */
230  virtual void
231  update_geostrophic_profile (const amrex::Real& /*time*/,
232  amrex::Vector<amrex::Real>& u_geos,
233  amrex::Gpu::DeviceVector<amrex::Real>& d_u_geos,
234  amrex::Vector<amrex::Real>& v_geos,
235  amrex::Gpu::DeviceVector<amrex::Real>& d_v_geos,
236  const amrex::Geometry& geom,
237  std::unique_ptr<amrex::MultiFab>& z_phys_cc)
238  {
239  if (u_geos.empty()) return;
240 
241  if (z_phys_cc) {
242  // use_terrain=1
243  amrex::Error("Geostrophic wind profile not defined for "+name()+" problem with terrain");
244  } else {
245  const int khi = geom.Domain().bigEnd()[2];
246  // const amrex::Real* prob_lo = geom.ProbLo();
247  // const auto dx = geom.CellSize();
248  for (int k = 0; k <= khi; k++)
249  {
250  // const amrex::Real z_cc = prob_lo[2] + (k+0.5)* dx[2];
251  // set RHS term of RhoTheta equation based on time, z_cc here
252  u_geos[k] = 0.0;
253  v_geos[k] = 0.0;
254  }
255  }
256 
257  // Copy from host version to device version
258  amrex::Gpu::copy(amrex::Gpu::hostToDevice, u_geos.begin(), u_geos.end(), d_u_geos.begin());
259  amrex::Gpu::copy(amrex::Gpu::hostToDevice, v_geos.begin(), v_geos.end(), d_v_geos.begin());
260  }
261 
262  /**
263  * Function to perform custom initialization of terrain
264  *
265  * @param[in] geom container for geometric information
266  * @param[out] z_phys_nd height coordinate at nodes
267  * @param[in] time current time
268  */
269  void
270  init_terrain_surface (const amrex::Geometry& geom,
271  amrex::FArrayBox& terrain_fab,
272  const amrex::Real& time)
273  {
274  // Check if a valid text file exists for the terrain
275  std::string fname, fname_usgs;
276  amrex::ParmParse pp("erf");
277  auto valid_fname = pp.query("terrain_file_name",fname);
278  auto valid_fname_USGS = pp.query("terrain_file_name_USGS",fname_usgs);
279 
280  bool is_usgs;
281 
282  if (valid_fname) {
283  is_usgs = false;
284  read_custom_terrain(fname,is_usgs,geom,terrain_fab,time);
285 
286  } else if (valid_fname_USGS) {
287  is_usgs = true;
288  read_custom_terrain(fname_usgs,is_usgs,geom,terrain_fab,time);
289 
290  } else {
291  init_custom_terrain (geom, terrain_fab, time);
292  }
293  }
294 
295  void
296  read_custom_terrain(const std::string& fname,
297  const bool is_usgs,
298  const amrex::Geometry& geom,
299  amrex::FArrayBox& terrain_fab,
300  const amrex::Real& /*time*/)
301  {
302  amrex::Vector<amrex::Real> m_xterrain,m_yterrain,m_zterrain;
303 
304  int nx = 0; int ny = 0;
305 
306  if (amrex::ParallelDescriptor::IOProcessor()) {
307  // Read terrain file
308  amrex::Print()<<"Reading terrain file: "<< fname<< std::endl;
309  std::ifstream file(fname);
310 
311  if (!file.is_open()) {
312  amrex::Abort("Error: Could not open the file " + fname+ "\n");
313  }
314 
315  // Check if file is empty
316  if (file.peek() == std::ifstream::traits_type::eof()) {
317  amrex::Abort("Error: The file " + fname+ " is empty.\n");
318  }
319 
320  amrex::Real value1,value2,value3;
321 
322  if (is_usgs) {
323  amrex::Real lat_min, lon_min;
324 
325  file >> lon_min >> lat_min;
326  if(std::fabs(lon_min) > 180.0) {
327  amrex::Error("The value of longitude for entry in the first line in " + fname
328  + " should not exceed 180. It is " + std::to_string(lon_min));
329  }
330  if(std::fabs(lat_min) > 90.0) {
331  amrex::Error("The value of latitude for entry in the first line in " + fname
332  + " should not exceed 90. It is " + std::to_string(lat_min));
333  }
334 
335  file >> nx >> ny;
336 
337  int counter = 0;
338  while (file >> value1 >> value2 >> value3) {
339  m_xterrain.push_back(value1);
340  if(counter%nx==0) {
341  m_yterrain.push_back(value2);
342  }
343  m_zterrain.push_back(value3);
344  counter += 1;
345  }
346  AMREX_ASSERT(m_xterrain.size() == static_cast<long int>(nx*ny));
347  AMREX_ASSERT(m_yterrain.size() == static_cast<long int>(ny));
348  AMREX_ASSERT(m_zterrain.size() == static_cast<long int>(nx*ny));
349 
350  } else {
351  file >> nx; file >> ny;
352  AMREX_ALWAYS_ASSERT(nx > 0);
353  AMREX_ALWAYS_ASSERT(ny > 0);
354  m_xterrain.resize(nx);
355  m_yterrain.resize(ny);
356  m_zterrain.resize(nx * ny);
357  for (int n = 0; n < nx; n++) {
358  file >> m_xterrain[n];
359  }
360  for (int n = 0; n < ny; n++) {
361  file >> m_yterrain[n];
362  }
363  for (int n = 0; n < nx * ny; n++) {
364  file >> m_zterrain[n];
365  }
366  }
367 
368  amrex::Print() << "NX " << nx << " " << ny << std::endl;
369 
370  // Close the file after reading
371  file.close();
372  }
373 
374  amrex::ParallelDescriptor::Bcast(&nx,1,amrex::ParallelDescriptor::IOProcessorNumber());
375  amrex::ParallelDescriptor::Bcast(&ny,1,amrex::ParallelDescriptor::IOProcessorNumber());
376 
377  int nz = nx * ny;
378 
379  m_xterrain.resize(nx);
380  m_yterrain.resize(ny);
381  m_zterrain.resize(nz);
382 
383  amrex::ParallelDescriptor::Bcast(m_xterrain.data(),nx,amrex::ParallelDescriptor::IOProcessorNumber());
384  amrex::ParallelDescriptor::Bcast(m_yterrain.data(),ny,amrex::ParallelDescriptor::IOProcessorNumber());
385  amrex::ParallelDescriptor::Bcast(m_zterrain.data(),nz,amrex::ParallelDescriptor::IOProcessorNumber());
386 
387  // Copy data to the GPU
388  amrex::Gpu::DeviceVector<amrex::Real> d_xterrain(nx),d_yterrain(ny),d_zterrain(nz);
389  amrex::Gpu::copy(amrex::Gpu::hostToDevice, m_xterrain.begin(), m_xterrain.end(), d_xterrain.begin());
390  amrex::Gpu::copy(amrex::Gpu::hostToDevice, m_yterrain.begin(), m_yterrain.end(), d_yterrain.begin());
391  amrex::Gpu::copy(amrex::Gpu::hostToDevice, m_zterrain.begin(), m_zterrain.end(), d_zterrain.begin());
392 
393  amrex::Real* d_xt = d_xterrain.data();
394  amrex::Real* d_yt = d_yterrain.data();
395  amrex::Real* d_zt = d_zterrain.data();
396 
397  auto dx = geom.CellSizeArray();
398  auto ProbLoArr = geom.ProbLoArray();
399 
400  int ilo = geom.Domain().smallEnd(0);
401  int jlo = geom.Domain().smallEnd(1);
402  int klo = geom.Domain().smallEnd(2);
403  int ihi = geom.Domain().bigEnd(0) + 1;
404  int jhi = geom.Domain().bigEnd(1) + 1;
405 
406  amrex::Box zbx = terrain_fab.box();
407  amrex::Array4<amrex::Real> const& z_arr = terrain_fab.array();
408 
409  amrex::ParallelFor(zbx, [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/)
410  {
411  // Clip indices for ghost cells
412  int ii = amrex::min(amrex::max(i,ilo),ihi);
413  int jj = amrex::min(amrex::max(j,jlo),jhi);
414 
415  // Location of nodes
416  amrex::Real x = ProbLoArr[0] + ii * dx[0] + 1e-3;
417  amrex::Real y = ProbLoArr[1] + jj * dx[1] + 1e-3;
418 
419  int jindex_terrain = -1;
420  for (int it = 0; it < ny && jindex_terrain == -1; it++) {
421  if (d_yt[it] > y) {
422  jindex_terrain = it-1;
423  }
424  }
425  if (jindex_terrain == -1) {
426  jindex_terrain = ny-1;
427  }
428 
429  int ind11, ind12, ind21, ind22;
430  amrex::Real x1, x2, y1, y2;
431 
432  int iindex_terrain=-1;
433  if (is_usgs) {
434  int gstart = (jindex_terrain )*nx;
435  int gend = (jindex_terrain+1)*nx-1;
436  for (int it = gstart; it <= gend && iindex_terrain == -1; it++) {
437  if (d_xt[it] > x) {
438  iindex_terrain = it-gstart;
439  }
440  }
441 
442  // Define the four values to interpolate between
443  ind11 = jindex_terrain*nx + iindex_terrain;
444  ind12 = ind11+nx;
445  ind21 = ind11+1;
446  ind22 = ind12+1;
447  x1 = d_xt[ind11];
448  x2 = d_xt[ind21];
449  y1 = d_yt[jindex_terrain];
450  y2 = d_yt[jindex_terrain+1];
451 
452  } else {
453  for (int it = 0; it < nx && iindex_terrain == -1; it++) {
454  if (d_xt[it] > x) {
455  iindex_terrain = it-1;
456  }
457  }
458  if (iindex_terrain == -1) {
459  iindex_terrain = nx-1;
460  }
461 
462  // Define the four values to interpolate between
463  x1 = d_xt[iindex_terrain];
464  x2 = d_xt[iindex_terrain+1];
465  y1 = d_yt[jindex_terrain];
466  y2 = d_yt[jindex_terrain+1];
467 
468  ind11 = jindex_terrain * nx + iindex_terrain;
469  ind21 = std::min(jindex_terrain+1,ny-1) * nx + iindex_terrain;
470 
471  ind12 = jindex_terrain * nx + std::min(iindex_terrain+1,nx-1);
472  ind22 = std::min(jindex_terrain+1,ny-1) * nx + std::min(iindex_terrain+1,nx-1);
473  }
474 
475  // Do bilinear interpolation
476  amrex::Real denom = (x2-x1)*(y2-y1);
477  amrex::Real w_11 = (x2-x)*(y2-y)/denom;
478  amrex::Real w_12 = (x2-x)*(y-y1)/denom;
479  amrex::Real w_21 = (x-x1)*(y2-y)/denom;
480  amrex::Real w_22 = (x-x1)*(y-y1)/denom;
481 
482  z_arr(i,j,klo) = w_11*d_zt[ind11] + w_12*d_zt[ind12] + w_21*d_zt[ind21] + w_22*d_zt[ind22];
483  });
484  }
485 
486  /**
487  * Function to perform custom initialization of terrain
488  *
489  * Note: Terrain functionality can also be used to provide grid stretching.
490  *
491  * @param[in] geom container for geometric information
492  * @param[out] terrain_mf height coordinate at nodes
493  * @param[in] time current time
494  */
495  virtual void
496  init_custom_terrain (const amrex::Geometry& /*geom*/,
497  amrex::FArrayBox& terrain_fab,
498  const amrex::Real& /*time*/)
499  {
500  amrex::Print() << "Initializing flat terrain" << std::endl;
501 
502  terrain_fab.template setVal<amrex::RunOn::Device>(0.0);
503 
505  }
506 
507 #ifdef ERF_USE_TERRAIN_VELOCITY
508  virtual amrex::Real compute_terrain_velocity(const amrex::Real /*time*/)
509  {
510  amrex::Error("Should never call compute_terrain_velocity for "+name()+" problem");
511  }
512 #endif
513 
514  /**
515  * Function to define the quantities needed to impose Rayleigh damping
516  *
517  * @param[out] rayleigh_ptrs = {strength of Rayleigh damping, reference values for xvel/yvel/zvel/theta used to define Rayleigh damping}
518  * @param[in] geom container for geometric information
519  * @param[in] z_phys_cc height coordinate at cell centers
520  */
521  virtual void
522  erf_init_rayleigh (amrex::Vector<amrex::Vector<amrex::Real> >& /*rayleigh_ptrs*/,
523  amrex::Geometry const& /*geom*/,
524  std::unique_ptr<amrex::MultiFab>& /*z_phys_nd*/,
525  amrex::Real /*zdamp*/)
526  {
527  amrex::Error("Should never call erf_init_rayleigh for "+name()+" problem");
528  }
529 
530  /**
531  * Function to set uniform background density and pressure fields
532  */
533  void
534  init_uniform (const amrex::Box& bx, amrex::Array4<amrex::Real> const& state)
535  {
536  amrex::Real rho_0 = base_parms.rho_0;
537  amrex::Real T_0 = base_parms.T_0;
538  amrex::Print() << "Initializing uniform fields"
539  << " rho=" << rho_0 << " theta=" << T_0
540  << std::endl;
541 
542  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
543  {
544  state(i, j, k, Rho_comp) = rho_0;
545  state(i, j, k, RhoTheta_comp) = rho_0 * T_0;
546  });
547  }
548 
549 protected:
550  // Struct to store problem parameters
552 
553  /**
554  * Function to update default base parameters, currently only used for
555  * init_type == InitType::Uniform
556  */
557  void init_base_parms (amrex::Real rho_0, amrex::Real T_0) {
558  base_parms.rho_0 = rho_0;
559  base_parms.T_0 = T_0;
560  }
561 
562  // descriptor for problem definition
563  virtual std::string name () = 0;
564 };
565 
566 
567 /**
568  * Function to init the physical bounds of the domain
569  * and instantiate a Problem derived from ProblemBase
570 */
571 extern std::unique_ptr<ProblemBase> amrex_probinit (const amrex_real* problo,
572  const amrex_real* probhi) AMREX_ATTRIBUTE_WEAK;
573 
574 #endif
@ wbar
Definition: ERF_DataStruct.H:70
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pp(amrex::Real y)
Definition: ERF_MicrophysicsUtils.H:219
std::unique_ptr< ProblemBase > amrex_probinit(const amrex_real *problo, const amrex_real *probhi) AMREX_ATTRIBUTE_WEAK
Definition: ERF_ProbCommon.H:23
virtual void init_custom_pert(const amrex::Box &, const amrex::Box &, const amrex::Box &, const amrex::Box &, amrex::Array4< amrex::Real const > const &, amrex::Array4< amrex::Real > const &, amrex::Array4< amrex::Real > const &, amrex::Array4< amrex::Real > const &, amrex::Array4< amrex::Real > const &, amrex::Array4< amrex::Real > const &, amrex::Array4< amrex::Real > const &, amrex::Array4< amrex::Real const > const &, amrex::Array4< amrex::Real const > const &, amrex::GeometryData const &, amrex::Array4< amrex::Real const > const &, amrex::Array4< amrex::Real const > const &, amrex::Array4< amrex::Real const > const &, const SolverChoice &)
Definition: ERF_ProbCommon.H:84
virtual std::string name()=0
void init_uniform(const amrex::Box &bx, amrex::Array4< amrex::Real > const &state)
Definition: ERF_ProbCommon.H:534
void init_terrain_surface(const amrex::Geometry &geom, amrex::FArrayBox &terrain_fab, const amrex::Real &time)
Definition: ERF_ProbCommon.H:270
virtual void update_geostrophic_profile(const amrex::Real &, amrex::Vector< amrex::Real > &u_geos, amrex::Gpu::DeviceVector< amrex::Real > &d_u_geos, amrex::Vector< amrex::Real > &v_geos, amrex::Gpu::DeviceVector< amrex::Real > &d_v_geos, const amrex::Geometry &geom, std::unique_ptr< amrex::MultiFab > &z_phys_cc)
Definition: ERF_ProbCommon.H:231
void read_custom_terrain(const std::string &fname, const bool is_usgs, const amrex::Geometry &geom, amrex::FArrayBox &terrain_fab, const amrex::Real &)
Definition: ERF_ProbCommon.H:296
virtual void update_rhoqt_sources(const amrex::Real &, amrex::Vector< amrex::Real > &qsrc, amrex::Gpu::DeviceVector< amrex::Real > &d_qsrc, const amrex::Geometry &geom, std::unique_ptr< amrex::MultiFab > &z_phys_cc)
Definition: ERF_ProbCommon.H:154
virtual void erf_init_rayleigh(amrex::Vector< amrex::Vector< amrex::Real > > &, amrex::Geometry const &, std::unique_ptr< amrex::MultiFab > &, amrex::Real)
Definition: ERF_ProbCommon.H:522
void init_base_parms(amrex::Real rho_0, amrex::Real T_0)
Definition: ERF_ProbCommon.H:557
virtual void init_custom_terrain(const amrex::Geometry &, amrex::FArrayBox &terrain_fab, const amrex::Real &)
Definition: ERF_ProbCommon.H:496
virtual ~ProblemBase()=default
virtual void erf_init_dens_hse_moist(amrex::MultiFab &, std::unique_ptr< amrex::MultiFab > &, amrex::Geometry const &)
Definition: ERF_ProbCommon.H:53
virtual void update_rhotheta_sources(const amrex::Real &, amrex::Vector< amrex::Real > &src, amrex::Gpu::DeviceVector< amrex::Real > &d_src, const amrex::Geometry &geom, std::unique_ptr< amrex::MultiFab > &z_phys_cc)
Definition: ERF_ProbCommon.H:117
ProbParmDefaults base_parms
Definition: ERF_ProbCommon.H:551
virtual void update_w_subsidence(const amrex::Real &, amrex::Vector< amrex::Real > &wbar, amrex::Gpu::DeviceVector< amrex::Real > &d_wbar, const amrex::Geometry &geom, std::unique_ptr< amrex::MultiFab > &z_phys_cc)
Definition: ERF_ProbCommon.H:194
virtual void erf_init_dens_hse(amrex::MultiFab &, std::unique_ptr< amrex::MultiFab > &, std::unique_ptr< amrex::MultiFab > &, amrex::Geometry const &)
Definition: ERF_ProbCommon.H:40
Definition: ERF_ProbCommon.H:14
amrex::Real T_0
Definition: ERF_ProbCommon.H:16
amrex::Real rho_0
Definition: ERF_ProbCommon.H:15
Definition: ERF_DataStruct.H:82
static void set_flat_terrain_flag()
Definition: ERF_DataStruct.H:586