diff --git a/ERF__Constants_8H.html b/ERF__Constants_8H.html index 074097fff8..22e3fa84f2 100644 --- a/ERF__Constants_8H.html +++ b/ERF__Constants_8H.html @@ -968,7 +968,7 @@

-

Referenced by derived::erf_dersoundspeed(), erf_fast_rhs_MT(), erf_fast_rhs_N(), erf_fast_rhs_T(), ERF::estTimeStep(), getdPdRgivenConstantTheta(), getExnergivenRTh(), getPgivenRTh(), getRhoThetagivenP(), getTgivenRandRTh(), and make_fast_coeffs().

+

Referenced by derived::erf_dersoundspeed(), erf_fast_rhs_MT(), erf_fast_rhs_N(), erf_fast_rhs_T(), ERF::estTimeStep(), getdPdRgivenConstantTheta(), getExnergivenRTh(), getPgivenRTh(), getRhoThetagivenP(), getTgivenRandRTh(), and make_fast_coeffs().

@@ -1564,7 +1564,7 @@

-

Referenced by InputSoundingData::calc_rho_p(), SAM::Cloud(), SAM::Compute_Coefficients(), erf_fast_rhs_MT(), erf_fast_rhs_N(), erf_fast_rhs_T(), erf_init_dens_hse(), getdPdRgivenConstantTheta(), getExnergivenRTh(), getPgivenRTh(), getRhogivenThetaPress(), getRhoThetagivenP(), getTgivenRandRTh(), getThgivenRandT(), SolverChoice::init_params(), make_fast_coeffs(), and ERF::WritePlotFile().

+

Referenced by InputSoundingData::calc_rho_p(), SAM::Cloud(), SAM::Compute_Coefficients(), erf_fast_rhs_MT(), erf_fast_rhs_N(), erf_fast_rhs_T(), erf_init_dens_hse(), getdPdRgivenConstantTheta(), getExnergivenRTh(), getPgivenRTh(), getRhogivenThetaPress(), getRhoThetagivenP(), getTgivenRandRTh(), getThgivenRandT(), SolverChoice::init_params(), make_fast_coeffs(), and ERF::WritePlotFile().

diff --git a/ERF__MRI_8H_source.html b/ERF__MRI_8H_source.html index 8ed752e6ff..8c3061dd81 100644 --- a/ERF__MRI_8H_source.html +++ b/ERF__MRI_8H_source.html @@ -361,106 +361,110 @@
273  nsubsteps = 1; dtau = timestep;
274  } else {
275  nsubsteps = substep_ratio; dtau = sub_timestep;
-
276  }
-
277  time_stage = time + timestep;
-
278  }
-
279 
-
280  // step 1 starts with S_stage = S^n and we always start substepping at the old time
-
281  // step 2 starts with S_stage = S^* and we always start substepping at the old time
-
282  // step 3 starts with S_stage = S^** and we always start substepping at the old time
+
276 
+
277  // STRT HACK -- this hack can be used to approximate the no-substepping algorithm
+
278  // nsubsteps = 1; dtau = timestep;
+
279  // END HACK
+
280  }
+
281  time_stage = time + timestep;
+
282  }
283 
-
284  // All pre_update does is call cons_to_prim, and we have done this with the old
-
285  // data already before starting the RK steps
-
286  if (nrk > 0) {
-
287  pre_update(S_new, S_new[IntVars::cons].nGrow());
-
288  }
-
289 
-
290  // S_scratch also holds the average momenta over the fast iterations --
-
291  // to be used to update the slow variables -- we will initialize with
-
292  // the momenta used in the first call to the slow_rhs, then update
-
293  // inside fast_rhs, then use these values in the later call to slow_rhs
-
294 
-
295  slow_rhs_pre(*F_slow, S_old, S_new, *S_scratch, time, old_time_stage, time_stage, nrk);
-
296 
-
297  amrex::Real inv_fac = 1.0 / static_cast<amrex::Real>(nsubsteps);
+
284  // step 1 starts with S_stage = S^n and we always start substepping at the old time
+
285  // step 2 starts with S_stage = S^* and we always start substepping at the old time
+
286  // step 3 starts with S_stage = S^** and we always start substepping at the old time
+
287 
+
288  // All pre_update does is call cons_to_prim, and we have done this with the old
+
289  // data already before starting the RK steps
+
290  if (nrk > 0) {
+
291  pre_update(S_new, S_new[IntVars::cons].nGrow());
+
292  }
+
293 
+
294  // S_scratch also holds the average momenta over the fast iterations --
+
295  // to be used to update the slow variables -- we will initialize with
+
296  // the momenta used in the first call to the slow_rhs, then update
+
297  // inside fast_rhs, then use these values in the later call to slow_rhs
298 
-
299  // ****************************************************
-
300  // Acoustic substepping
-
301  // ****************************************************
-
302  if (!no_substepping)
-
303  {
-
304  // *******************************************************************************
-
305  // Update the fast variables
-
306  // *******************************************************************************
-
307  for (int ks = 0; ks < nsubsteps; ++ks)
-
308  {
-
309  fast_rhs(ks, nsubsteps, nrk, *F_slow, S_old, S_new, *S_sum, *S_scratch, dtau, inv_fac,
-
310  time + ks*dtau, time + (ks+1) * dtau);
-
311 
-
312  } // ks
-
313 
-
314  } else {
-
315  no_substep(*S_sum, S_old, *F_slow, time + nsubsteps*dtau, nsubsteps*dtau, nrk);
-
316  }
+
299  slow_rhs_pre(*F_slow, S_old, S_new, *S_scratch, time, old_time_stage, time_stage, nrk);
+
300 
+
301  amrex::Real inv_fac = 1.0 / static_cast<amrex::Real>(nsubsteps);
+
302 
+
303  // ****************************************************
+
304  // Acoustic substepping
+
305  // ****************************************************
+
306  if (!no_substepping)
+
307  {
+
308  // *******************************************************************************
+
309  // Update the fast variables
+
310  // *******************************************************************************
+
311  for (int ks = 0; ks < nsubsteps; ++ks)
+
312  {
+
313  fast_rhs(ks, nsubsteps, nrk, *F_slow, S_old, S_new, *S_sum, *S_scratch, dtau, inv_fac,
+
314  time + ks*dtau, time + (ks+1) * dtau);
+
315 
+
316  } // ks
317 
-
318  // ****************************************************
-
319  // Evaluate F_slow(S_stage) only for the slow variables
-
320  // Note that we are using the current stage versions (in S_new) of the slow variables
-
321  // (because we didn't update the slow variables in the substepping)
-
322  // but we are using the "new" versions (in S_sum) of the velocities
-
323  // (because we did update the fast variables in the substepping)
-
324  // ****************************************************
-
325  slow_rhs_post(*F_slow, S_old, S_new, *S_sum, *S_scratch, time, old_time_stage, time_stage, nrk);
-
326 
-
327  // Call the post-update hook for S_new after all the fast steps completed
-
328  // This will update S_prim that is used in the slow RHS
-
329  post_update(S_new, time + nsubsteps*dtau, S_new[IntVars::cons].nGrow(), S_new[IntVars::xmom].nGrow());
-
330  } // nrk
-
331 
-
332  } else {
-
333  // RK2 for anelastic integrator
-
334  for (int nrk = 0; nrk < 2; nrk++)
-
335  {
-
336  // Capture the time we got to in the previous RK step
-
337  old_time_stage = time_stage;
-
338 
-
339  if (nrk == 0) { nsubsteps = 1; dtau = timestep; time_stage = time + timestep; }
-
340  if (nrk == 1) { nsubsteps = 1; dtau = timestep; time_stage = time + timestep; }
-
341 
-
342  // All pre_update does is call cons_to_prim, and we have done this with the old
-
343  // data already before starting the RK steps
-
344  if (nrk > 0) {
-
345  pre_update(S_new, S_new[IntVars::cons].nGrow());
-
346  }
-
347 
-
348  // S_scratch also holds the average momenta over the fast iterations --
-
349  // to be used to update the slow variables -- we will initialize with
-
350  // the momenta used in the first call to the slow_rhs, then update
-
351  // inside fast_rhs, then use these values in the later call to slow_rhs
-
352 
-
353  slow_rhs_inc(*F_slow, S_old, S_new, *S_scratch, time, old_time_stage, time_stage, nrk);
-
354 
-
355  no_substep(*S_sum, S_old, *F_slow, time + nsubsteps*dtau, nsubsteps*dtau, nrk);
+
318  } else {
+
319  no_substep(*S_sum, S_old, *F_slow, time + nsubsteps*dtau, nsubsteps*dtau, nrk);
+
320  }
+
321 
+
322  // ****************************************************
+
323  // Evaluate F_slow(S_stage) only for the slow variables
+
324  // Note that we are using the current stage versions (in S_new) of the slow variables
+
325  // (because we didn't update the slow variables in the substepping)
+
326  // but we are using the "new" versions (in S_sum) of the velocities
+
327  // (because we did update the fast variables in the substepping)
+
328  // ****************************************************
+
329  slow_rhs_post(*F_slow, S_old, S_new, *S_sum, *S_scratch, time, old_time_stage, time_stage, nrk);
+
330 
+
331  // Call the post-update hook for S_new after all the fast steps completed
+
332  // This will update S_prim that is used in the slow RHS
+
333  post_update(S_new, time + nsubsteps*dtau, S_new[IntVars::cons].nGrow(), S_new[IntVars::xmom].nGrow());
+
334  } // nrk
+
335 
+
336  } else {
+
337  // RK2 for anelastic integrator
+
338  for (int nrk = 0; nrk < 2; nrk++)
+
339  {
+
340  // Capture the time we got to in the previous RK step
+
341  old_time_stage = time_stage;
+
342 
+
343  if (nrk == 0) { nsubsteps = 1; dtau = timestep; time_stage = time + timestep; }
+
344  if (nrk == 1) { nsubsteps = 1; dtau = timestep; time_stage = time + timestep; }
+
345 
+
346  // All pre_update does is call cons_to_prim, and we have done this with the old
+
347  // data already before starting the RK steps
+
348  if (nrk > 0) {
+
349  pre_update(S_new, S_new[IntVars::cons].nGrow());
+
350  }
+
351 
+
352  // S_scratch also holds the average momenta over the fast iterations --
+
353  // to be used to update the slow variables -- we will initialize with
+
354  // the momenta used in the first call to the slow_rhs, then update
+
355  // inside fast_rhs, then use these values in the later call to slow_rhs
356 
-
357  slow_rhs_post(*F_slow, S_old, S_new, *S_sum, *S_scratch, time, old_time_stage, time_stage, nrk);
+
357  slow_rhs_inc(*F_slow, S_old, S_new, *S_scratch, time, old_time_stage, time_stage, nrk);
358 
-
359  post_update(S_new, time + nsubsteps*dtau, S_new[IntVars::cons].nGrow(), S_new[IntVars::xmom].nGrow());
-
360  } // nrk
-
361  }
+
359  no_substep(*S_sum, S_old, *F_slow, time + nsubsteps*dtau, nsubsteps*dtau, nrk);
+
360 
+
361  slow_rhs_post(*F_slow, S_old, S_new, *S_sum, *S_scratch, time, old_time_stage, time_stage, nrk);
362 
-
363  // Return timestep
-
364  return timestep;
-
365  }
+
363  post_update(S_new, time + nsubsteps*dtau, S_new[IntVars::cons].nGrow(), S_new[IntVars::xmom].nGrow());
+
364  } // nrk
+
365  }
366 
-
367  void map_data (std::function<void(T&)> Map)
-
368  {
-
369  for (auto& F : T_store) {
-
370  Map(*F);
-
371  }
-
372  }
-
373 };
-
374 
-
375 #endif
+
367  // Return timestep
+
368  return timestep;
+
369  }
+
370 
+
371  void map_data (std::function<void(T&)> Map)
+
372  {
+
373  for (auto& F : T_store) {
+
374  Map(*F);
+
375  }
+
376  }
+
377 };
+
378 
+
379 #endif
@@ -469,7 +473,7 @@
T * F_slow
Definition: ERF_MRI.H:70
amrex::Vector< std::unique_ptr< T > > T_store
Definition: ERF_MRI.H:67
void set_slow_rhs_pre(std::function< void(T &, T &, T &, T &, const amrex::Real, const amrex::Real, const amrex::Real, const int)> F)
Definition: ERF_MRI.H:137
-
void map_data(std::function< void(T &)> Map)
Definition: ERF_MRI.H:367
+
void map_data(std::function< void(T &)> Map)
Definition: ERF_MRI.H:371
std::function< void(T &, T &, T &, T &, T &, const amrex::Real, const amrex::Real, const amrex::Real, const int)> slow_rhs_post
Definition: ERF_MRI.H:24
void set_no_substep(std::function< void(T &, T &, T &, amrex::Real, amrex::Real, int)> F)
Definition: ERF_MRI.H:177
void set_slow_rhs_inc(std::function< void(T &, T &, T &, T &, const amrex::Real, const amrex::Real, const amrex::Real, const int)> F)
Definition: ERF_MRI.H:141
diff --git a/ERF__TI__fast__headers_8H.html b/ERF__TI__fast__headers_8H.html index c9fdb995a0..590fc8f65d 100644 --- a/ERF__TI__fast__headers_8H.html +++ b/ERF__TI__fast__headers_8H.html @@ -198,18 +198,18 @@ - - - - - - + + + + + +

Functions

void erf_fast_rhs_N (int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
 
void erf_fast_rhs_T (int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
 
void erf_fast_rhs_MT (int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stg_data, const amrex::MultiFab &S_stg_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const bool use_lagged_delta_rt, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_t_rk, const amrex::MultiFab *z_t_pert, std::unique_ptr< amrex::MultiFab > &z_phys_nd_old, std::unique_ptr< amrex::MultiFab > &z_phys_nd_new, std::unique_ptr< amrex::MultiFab > &z_phys_nd_stg, std::unique_ptr< amrex::MultiFab > &detJ_cc_old, std::unique_ptr< amrex::MultiFab > &detJ_cc_new, std::unique_ptr< amrex::MultiFab > &detJ_cc_stg, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
 
void erf_fast_rhs_N (int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
 
void erf_fast_rhs_T (int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
 
void erf_fast_rhs_MT (int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stg_data, const amrex::MultiFab &S_stg_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const bool use_lagged_delta_rt, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_t_rk, const amrex::MultiFab *z_t_pert, std::unique_ptr< amrex::MultiFab > &z_phys_nd_old, std::unique_ptr< amrex::MultiFab > &z_phys_nd_new, std::unique_ptr< amrex::MultiFab > &z_phys_nd_stg, std::unique_ptr< amrex::MultiFab > &detJ_cc_old, std::unique_ptr< amrex::MultiFab > &detJ_cc_new, std::unique_ptr< amrex::MultiFab > &detJ_cc_stg, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
 
void make_fast_coeffs (int level, amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::Geometry geom, const bool use_moisture, const bool use_terrain, const amrex::Real gravity, const amrex::Real c_p, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::MultiFab *r0, const amrex::MultiFab *pi0, const amrex::Real dtau, const amrex::Real beta_s, amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &phys_bc_type)
 

Function Documentation

- -

◆ erf_fast_rhs_MT()

+ +

◆ erf_fast_rhs_MT()

@@ -416,7 +416,13 @@

bool  - l_reflux  + l_reflux, + + + + + bool  + l_implicit_substepping  @@ -429,8 +435,8 @@

-

◆ erf_fast_rhs_N()

+ +

◆ erf_fast_rhs_N()

@@ -577,7 +583,13 @@

bool  - l_reflux  + l_reflux, + + + + + bool  + l_implicit_substepping  @@ -590,8 +602,8 @@

-

◆ erf_fast_rhs_T()

+ +

◆ erf_fast_rhs_T()

@@ -756,7 +768,13 @@

bool  - l_reflux  + l_reflux, + + + + + bool  + l_implicit_substepping  diff --git a/ERF__TI__fast__headers_8H.js b/ERF__TI__fast__headers_8H.js index ddcf6ff119..7d35853a6c 100644 --- a/ERF__TI__fast__headers_8H.js +++ b/ERF__TI__fast__headers_8H.js @@ -1,7 +1,7 @@ var ERF__TI__fast__headers_8H = [ - [ "erf_fast_rhs_MT", "ERF__TI__fast__headers_8H.html#abdacd58e8e0a4cb99d45bf970cfadfea", null ], - [ "erf_fast_rhs_N", "ERF__TI__fast__headers_8H.html#a5f53a08aa97926523055fe74b41141ce", null ], - [ "erf_fast_rhs_T", "ERF__TI__fast__headers_8H.html#af993ea724f392520e7240055ecbe58bb", null ], + [ "erf_fast_rhs_MT", "ERF__TI__fast__headers_8H.html#aa794768e78c35584724f923852dc5b79", null ], + [ "erf_fast_rhs_N", "ERF__TI__fast__headers_8H.html#a25b4f2c626cbe895f44d04b262cd0938", null ], + [ "erf_fast_rhs_T", "ERF__TI__fast__headers_8H.html#a600146ca54f6fbeecc08fe9c93e5031c", null ], [ "make_fast_coeffs", "ERF__TI__fast__headers_8H.html#adfda58e818c53254b1fa053669e911e8", null ] ]; \ No newline at end of file diff --git a/ERF__TI__fast__headers_8H_source.html b/ERF__TI__fast__headers_8H_source.html index 4ccb8290e8..bd8b8f67dc 100644 --- a/ERF__TI__fast__headers_8H_source.html +++ b/ERF__TI__fast__headers_8H_source.html @@ -107,7 +107,7 @@
19  * Function for computing the fast RHS with no terrain
20  *
21  */
-
22 void erf_fast_rhs_N (int step, int nrk, int level, int finest_level,
+
22 void erf_fast_rhs_N (int step, int nrk, int level, int finest_level,
23  amrex::Vector<amrex::MultiFab >& S_slow_rhs,
24  const amrex::Vector<amrex::MultiFab >& S_prev,
25  amrex::Vector<amrex::MultiFab >& S_stage_data,
@@ -125,97 +125,100 @@
37  std::unique_ptr<amrex::MultiFab>& mapfac_v,
38  amrex::YAFluxRegister* fr_as_crse,
39  amrex::YAFluxRegister* fr_as_fine,
-
40  bool l_use_moisture, bool l_reflux);
-
41 
-
42 /**
-
43  * Function for computing the fast RHS with fixed terrain
-
44  *
-
45  */
-
46 void erf_fast_rhs_T (int step, int nrk, int level, int finest_level,
-
47  amrex::Vector<amrex::MultiFab >& S_slow_rhs,
-
48  const amrex::Vector<amrex::MultiFab >& S_prev,
-
49  amrex::Vector<amrex::MultiFab >& S_stage_data,
-
50  const amrex::MultiFab& S_stage_prim,
-
51  const amrex::MultiFab& pi_stage,
-
52  const amrex::MultiFab& fast_coeffs,
-
53  amrex::Vector<amrex::MultiFab >& S_data,
-
54  amrex::Vector<amrex::MultiFab >& S_scratch,
-
55  const amrex::Geometry geom,
-
56  const amrex::Real gravity,
-
57  amrex::MultiFab& Omega,
-
58  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
-
59  std::unique_ptr<amrex::MultiFab>& detJ_cc,
-
60  const amrex::Real dtau, const amrex::Real beta_s,
-
61  const amrex::Real facinv,
-
62  std::unique_ptr<amrex::MultiFab>& mapfac_m,
-
63  std::unique_ptr<amrex::MultiFab>& mapfac_u,
-
64  std::unique_ptr<amrex::MultiFab>& mapfac_v,
-
65  amrex::YAFluxRegister* fr_as_crse,
-
66  amrex::YAFluxRegister* fr_as_fine,
-
67  bool l_use_moisture, bool l_reflux);
-
68 
-
69 /**
-
70  * Function for computing the fast RHS with moving terrain
-
71  *
-
72  */
-
73 void erf_fast_rhs_MT (int step, int nrk, int level, int finest_level,
-
74  amrex::Vector<amrex::MultiFab >& S_slow_rhs,
-
75  const amrex::Vector<amrex::MultiFab >& S_prev,
-
76  amrex::Vector<amrex::MultiFab >& S_stg_data,
-
77  const amrex::MultiFab& S_stg_prim,
-
78  const amrex::MultiFab& pi_stage,
-
79  const amrex::MultiFab& fast_coeffs,
-
80  amrex::Vector<amrex::MultiFab >& S_data,
-
81  amrex::Vector<amrex::MultiFab >& S_scratch,
-
82  const amrex::Geometry geom,
-
83  const amrex::Real gravity,
-
84  const bool use_lagged_delta_rt,
-
85  amrex::MultiFab& Omega,
-
86  std::unique_ptr<amrex::MultiFab>& z_t_rk,
-
87  const amrex::MultiFab* z_t_pert,
-
88  std::unique_ptr<amrex::MultiFab>& z_phys_nd_old,
-
89  std::unique_ptr<amrex::MultiFab>& z_phys_nd_new,
-
90  std::unique_ptr<amrex::MultiFab>& z_phys_nd_stg,
-
91  std::unique_ptr<amrex::MultiFab>& detJ_cc_old,
-
92  std::unique_ptr<amrex::MultiFab>& detJ_cc_new,
-
93  std::unique_ptr<amrex::MultiFab>& detJ_cc_stg,
-
94  const amrex::Real dtau, const amrex::Real beta_s,
-
95  const amrex::Real facinv,
-
96  std::unique_ptr<amrex::MultiFab>& mapfac_m,
-
97  std::unique_ptr<amrex::MultiFab>& mapfac_u,
-
98  std::unique_ptr<amrex::MultiFab>& mapfac_v,
-
99  amrex::YAFluxRegister* fr_as_crse,
-
100  amrex::YAFluxRegister* fr_as_fine,
-
101  bool l_use_moisture, bool l_reflux);
-
102 
-
103 /**
-
104  * Function for computing the coefficients for the tridiagonal solver used in the fast
-
105  * integrator (the acoustic substepping).
-
106  */
-
107 void make_fast_coeffs (int level,
-
108  amrex::MultiFab& fast_coeffs,
-
109  amrex::Vector<amrex::MultiFab >& S_stage_data,
-
110  const amrex::MultiFab& S_stage_prim,
-
111  const amrex::MultiFab& pi_stage,
-
112  const amrex::Geometry geom,
-
113  const bool use_moisture,
-
114  const bool use_terrain,
-
115  const amrex::Real gravity,
-
116  const amrex::Real c_p,
-
117  std::unique_ptr<amrex::MultiFab>& detJ_cc,
-
118  const amrex::MultiFab* r0,
-
119  const amrex::MultiFab* pi0,
-
120  const amrex::Real dtau,
-
121  const amrex::Real beta_s,
-
122  amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> &phys_bc_type);
-
123 
-
124 #endif
+
40  bool l_use_moisture, bool l_reflux,
+
41  bool l_implicit_substepping);
+
42 
+
43 /**
+
44  * Function for computing the fast RHS with fixed terrain
+
45  *
+
46  */
+
47 void erf_fast_rhs_T (int step, int nrk, int level, int finest_level,
+
48  amrex::Vector<amrex::MultiFab >& S_slow_rhs,
+
49  const amrex::Vector<amrex::MultiFab >& S_prev,
+
50  amrex::Vector<amrex::MultiFab >& S_stage_data,
+
51  const amrex::MultiFab& S_stage_prim,
+
52  const amrex::MultiFab& pi_stage,
+
53  const amrex::MultiFab& fast_coeffs,
+
54  amrex::Vector<amrex::MultiFab >& S_data,
+
55  amrex::Vector<amrex::MultiFab >& S_scratch,
+
56  const amrex::Geometry geom,
+
57  const amrex::Real gravity,
+
58  amrex::MultiFab& Omega,
+
59  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
+
60  std::unique_ptr<amrex::MultiFab>& detJ_cc,
+
61  const amrex::Real dtau, const amrex::Real beta_s,
+
62  const amrex::Real facinv,
+
63  std::unique_ptr<amrex::MultiFab>& mapfac_m,
+
64  std::unique_ptr<amrex::MultiFab>& mapfac_u,
+
65  std::unique_ptr<amrex::MultiFab>& mapfac_v,
+
66  amrex::YAFluxRegister* fr_as_crse,
+
67  amrex::YAFluxRegister* fr_as_fine,
+
68  bool l_use_moisture, bool l_reflux,
+
69  bool l_implicit_substepping);
+
70 
+
71 /**
+
72  * Function for computing the fast RHS with moving terrain
+
73  *
+
74  */
+
75 void erf_fast_rhs_MT (int step, int nrk, int level, int finest_level,
+
76  amrex::Vector<amrex::MultiFab >& S_slow_rhs,
+
77  const amrex::Vector<amrex::MultiFab >& S_prev,
+
78  amrex::Vector<amrex::MultiFab >& S_stg_data,
+
79  const amrex::MultiFab& S_stg_prim,
+
80  const amrex::MultiFab& pi_stage,
+
81  const amrex::MultiFab& fast_coeffs,
+
82  amrex::Vector<amrex::MultiFab >& S_data,
+
83  amrex::Vector<amrex::MultiFab >& S_scratch,
+
84  const amrex::Geometry geom,
+
85  const amrex::Real gravity,
+
86  const bool use_lagged_delta_rt,
+
87  amrex::MultiFab& Omega,
+
88  std::unique_ptr<amrex::MultiFab>& z_t_rk,
+
89  const amrex::MultiFab* z_t_pert,
+
90  std::unique_ptr<amrex::MultiFab>& z_phys_nd_old,
+
91  std::unique_ptr<amrex::MultiFab>& z_phys_nd_new,
+
92  std::unique_ptr<amrex::MultiFab>& z_phys_nd_stg,
+
93  std::unique_ptr<amrex::MultiFab>& detJ_cc_old,
+
94  std::unique_ptr<amrex::MultiFab>& detJ_cc_new,
+
95  std::unique_ptr<amrex::MultiFab>& detJ_cc_stg,
+
96  const amrex::Real dtau, const amrex::Real beta_s,
+
97  const amrex::Real facinv,
+
98  std::unique_ptr<amrex::MultiFab>& mapfac_m,
+
99  std::unique_ptr<amrex::MultiFab>& mapfac_u,
+
100  std::unique_ptr<amrex::MultiFab>& mapfac_v,
+
101  amrex::YAFluxRegister* fr_as_crse,
+
102  amrex::YAFluxRegister* fr_as_fine,
+
103  bool l_use_moisture, bool l_reflux,
+
104  bool l_implicit_substepping);
+
105 
+
106 /**
+
107  * Function for computing the coefficients for the tridiagonal solver used in the fast
+
108  * integrator (the acoustic substepping).
+
109  */
+
110 void make_fast_coeffs (int level,
+
111  amrex::MultiFab& fast_coeffs,
+
112  amrex::Vector<amrex::MultiFab >& S_stage_data,
+
113  const amrex::MultiFab& S_stage_prim,
+
114  const amrex::MultiFab& pi_stage,
+
115  const amrex::Geometry geom,
+
116  const bool use_moisture,
+
117  const bool use_terrain,
+
118  const amrex::Real gravity,
+
119  const amrex::Real c_p,
+
120  std::unique_ptr<amrex::MultiFab>& detJ_cc,
+
121  const amrex::MultiFab* r0,
+
122  const amrex::MultiFab* pi0,
+
123  const amrex::Real dtau,
+
124  const amrex::Real beta_s,
+
125  amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> &phys_bc_type);
+
126 
+
127 #endif
-
void erf_fast_rhs_N(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
-
void erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stg_data, const amrex::MultiFab &S_stg_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const bool use_lagged_delta_rt, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_t_rk, const amrex::MultiFab *z_t_pert, std::unique_ptr< amrex::MultiFab > &z_phys_nd_old, std::unique_ptr< amrex::MultiFab > &z_phys_nd_new, std::unique_ptr< amrex::MultiFab > &z_phys_nd_stg, std::unique_ptr< amrex::MultiFab > &detJ_cc_old, std::unique_ptr< amrex::MultiFab > &detJ_cc_new, std::unique_ptr< amrex::MultiFab > &detJ_cc_stg, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
+
void erf_fast_rhs_N(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
+
void erf_fast_rhs_T(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
+
void erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stg_data, const amrex::MultiFab &S_stg_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const bool use_lagged_delta_rt, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_t_rk, const amrex::MultiFab *z_t_pert, std::unique_ptr< amrex::MultiFab > &z_phys_nd_old, std::unique_ptr< amrex::MultiFab > &z_phys_nd_new, std::unique_ptr< amrex::MultiFab > &z_phys_nd_stg, std::unique_ptr< amrex::MultiFab > &detJ_cc_old, std::unique_ptr< amrex::MultiFab > &detJ_cc_new, std::unique_ptr< amrex::MultiFab > &detJ_cc_stg, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
void make_fast_coeffs(int level, amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::Geometry geom, const bool use_moisture, const bool use_terrain, const amrex::Real gravity, const amrex::Real c_p, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::MultiFab *r0, const amrex::MultiFab *pi0, const amrex::Real dtau, const amrex::Real beta_s, amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &phys_bc_type)
-
void erf_fast_rhs_T(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
diff --git a/ERF__TI__fast__rhs__fun_8H_source.html b/ERF__TI__fast__rhs__fun_8H_source.html index d056f12ab7..9508c667d9 100644 --- a/ERF__TI__fast__rhs__fun_8H_source.html +++ b/ERF__TI__fast__rhs__fun_8H_source.html @@ -108,172 +108,178 @@
20  // Per p2902 of Klemp-Skamarock-Dudhia-2007
21  // beta_s = -1.0 : fully explicit
22  // beta_s = 1.0 : fully implicit
-
23  Real beta_s = 0.1;
-
24 
-
25  // *************************************************************************
-
26  // Set up flux registers if using two_way coupling
-
27  // *************************************************************************
-
28  const bool l_reflux = (solverChoice.coupling_type == CouplingType::TwoWay);
-
29 
-
30  YAFluxRegister* fr_as_crse = nullptr;
-
31  YAFluxRegister* fr_as_fine = nullptr;
-
32  if (l_reflux) {
-
33  if (level < finest_level) {
-
34  fr_as_crse = getAdvFluxReg(level+1);
-
35  }
-
36  if (level > 0) {
-
37  fr_as_fine = getAdvFluxReg(level);
-
38  }
-
39  }
-
40 
-
41  // Moving terrain
-
42  std::unique_ptr<MultiFab> z_t_pert;
-
43  if ( solverChoice.use_terrain && (solverChoice.terrain_type == TerrainType::Moving) )
-
44  {
-
45  // Make "old" fast geom -- store in z_phys_nd for convenience
-
46  if (verbose) Print() << "Making geometry at start of substep time: " << old_substep_time << std::endl;
-
47  prob->init_custom_terrain(fine_geom,*z_phys_nd[level],old_substep_time);
-
48  init_terrain_grid (level,fine_geom,*z_phys_nd[level], zlevels_stag[level], phys_bc_type);
-
49  make_J (fine_geom,*z_phys_nd[level], *detJ_cc[level]);
-
50 
-
51  // Make "new" fast geom
-
52  if (verbose) Print() << "Making geometry for end of substep time :" << new_substep_time << std::endl;
-
53  prob->init_custom_terrain(fine_geom,*z_phys_nd_new[level],new_substep_time);
-
54  init_terrain_grid (level,fine_geom,*z_phys_nd_new[level], zlevels_stag[level], phys_bc_type);
-
55  make_J (fine_geom,*z_phys_nd_new[level], *detJ_cc_new[level]);
-
56  make_areas (fine_geom,*z_phys_nd_new[level], *ax_new[level], *ay_new[level], *az_new[level]);
-
57 
-
58  Real inv_dt = 1./dtau;
-
59 
-
60  z_t_pert = std::make_unique<MultiFab>(S_data[IntVars::zmom].boxArray(), S_data[IntVars::zmom].DistributionMap(), 1, 1);
-
61 
-
62  for (MFIter mfi(*z_t_rk[level],TilingIfNotGPU()); mfi.isValid(); ++mfi)
-
63  {
-
64  Box gbx = mfi.growntilebox(IntVect(1,1,0));
+
23  Real beta_s;
+
24  if (solverChoice.substepping_type[level] == SubsteppingType::Implicit)
+
25  {
+
26  beta_s = 0.1;
+
27  } else { // Fully explicit
+
28  beta_s = -1.0;
+
29  }
+
30 
+
31  // *************************************************************************
+
32  // Set up flux registers if using two_way coupling
+
33  // *************************************************************************
+
34  const bool l_reflux = (solverChoice.coupling_type == CouplingType::TwoWay);
+
35 
+
36  YAFluxRegister* fr_as_crse = nullptr;
+
37  YAFluxRegister* fr_as_fine = nullptr;
+
38  if (l_reflux) {
+
39  if (level < finest_level) {
+
40  fr_as_crse = getAdvFluxReg(level+1);
+
41  }
+
42  if (level > 0) {
+
43  fr_as_fine = getAdvFluxReg(level);
+
44  }
+
45  }
+
46 
+
47  // Moving terrain
+
48  std::unique_ptr<MultiFab> z_t_pert;
+
49  if ( solverChoice.use_terrain && (solverChoice.terrain_type == TerrainType::Moving) )
+
50  {
+
51  // Make "old" fast geom -- store in z_phys_nd for convenience
+
52  if (verbose) Print() << "Making geometry at start of substep time: " << old_substep_time << std::endl;
+
53  prob->init_custom_terrain(fine_geom,*z_phys_nd[level],old_substep_time);
+
54  init_terrain_grid (level,fine_geom,*z_phys_nd[level], zlevels_stag[level], phys_bc_type);
+
55  make_J (fine_geom,*z_phys_nd[level], *detJ_cc[level]);
+
56 
+
57  // Make "new" fast geom
+
58  if (verbose) Print() << "Making geometry for end of substep time :" << new_substep_time << std::endl;
+
59  prob->init_custom_terrain(fine_geom,*z_phys_nd_new[level],new_substep_time);
+
60  init_terrain_grid (level,fine_geom,*z_phys_nd_new[level], zlevels_stag[level], phys_bc_type);
+
61  make_J (fine_geom,*z_phys_nd_new[level], *detJ_cc_new[level]);
+
62  make_areas (fine_geom,*z_phys_nd_new[level], *ax_new[level], *ay_new[level], *az_new[level]);
+
63 
+
64  Real inv_dt = 1./dtau;
65 
-
66  const Array4<Real >& z_t_arr = z_t_rk[level]->array(mfi);
-
67  const Array4<Real >& zp_t_arr = z_t_pert->array(mfi);
-
68 
-
69  const Array4<Real const>& z_nd_new_arr = z_phys_nd_new[level]->const_array(mfi);
-
70  const Array4<Real const>& z_nd_old_arr = z_phys_nd[level]->const_array(mfi);
+
66  z_t_pert = std::make_unique<MultiFab>(S_data[IntVars::zmom].boxArray(), S_data[IntVars::zmom].DistributionMap(), 1, 1);
+
67 
+
68  for (MFIter mfi(*z_t_rk[level],TilingIfNotGPU()); mfi.isValid(); ++mfi)
+
69  {
+
70  Box gbx = mfi.growntilebox(IntVect(1,1,0));
71 
-
72  // Loop over horizontal plane
-
73  amrex::ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
-
74  {
-
75  // Evaluate between RK stages assuming the geometry is linear between old and new time
-
76  zp_t_arr(i,j,k) = 0.25 * inv_dt * (z_nd_new_arr(i+1,j+1,k) - z_nd_old_arr(i+1,j+1,k)
-
77  +z_nd_new_arr(i ,j+1,k) - z_nd_old_arr( i,j+1,k)
-
78  +z_nd_new_arr(i+1,j ,k) - z_nd_old_arr(i+1,j ,k)
-
79  +z_nd_new_arr(i ,j ,k) - z_nd_old_arr(i ,j ,k));
-
80  // Convert to perturbation: z"_t(t) = z_t(t) - z_t^{RK}
-
81  zp_t_arr(i,j,k) -= z_t_arr(i,j,k);
-
82  });
-
83  } // mfi
-
84 
-
85  // We have to call this each step since it depends on the substep time now
-
86  // Note we pass in the *old* detJ here
-
87  make_fast_coeffs(level, fast_coeffs, S_stage, S_prim, pi_stage, fine_geom,
-
88  l_use_moisture, solverChoice.use_terrain, solverChoice.gravity, solverChoice.c_p,
-
89  detJ_cc[level], r0, pi0, dtau, beta_s, phys_bc_type);
+
72  const Array4<Real >& z_t_arr = z_t_rk[level]->array(mfi);
+
73  const Array4<Real >& zp_t_arr = z_t_pert->array(mfi);
+
74 
+
75  const Array4<Real const>& z_nd_new_arr = z_phys_nd_new[level]->const_array(mfi);
+
76  const Array4<Real const>& z_nd_old_arr = z_phys_nd[level]->const_array(mfi);
+
77 
+
78  // Loop over horizontal plane
+
79  amrex::ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
+
80  {
+
81  // Evaluate between RK stages assuming the geometry is linear between old and new time
+
82  zp_t_arr(i,j,k) = 0.25 * inv_dt * (z_nd_new_arr(i+1,j+1,k) - z_nd_old_arr(i+1,j+1,k)
+
83  +z_nd_new_arr(i ,j+1,k) - z_nd_old_arr( i,j+1,k)
+
84  +z_nd_new_arr(i+1,j ,k) - z_nd_old_arr(i+1,j ,k)
+
85  +z_nd_new_arr(i ,j ,k) - z_nd_old_arr(i ,j ,k));
+
86  // Convert to perturbation: z"_t(t) = z_t(t) - z_t^{RK}
+
87  zp_t_arr(i,j,k) -= z_t_arr(i,j,k);
+
88  });
+
89  } // mfi
90 
-
91  if (fast_step == 0) {
-
92  // If this is the first substep we pass in S_old as the previous step's solution
-
93  erf_fast_rhs_MT(fast_step, nrk, level, finest_level,
-
94  S_slow_rhs, S_old, S_stage, S_prim, pi_stage, fast_coeffs,
-
95  S_data, S_scratch, fine_geom,
-
96  solverChoice.gravity, solverChoice.use_lagged_delta_rt,
-
97  Omega, z_t_rk[level], z_t_pert.get(),
-
98  z_phys_nd[level], z_phys_nd_new[level], z_phys_nd_src[level],
-
99  detJ_cc[level], detJ_cc_new[level], detJ_cc_src[level],
-
100  dtau, beta_s, inv_fac,
-
101  mapfac_m[level], mapfac_u[level], mapfac_v[level],
-
102  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux);
-
103  } else {
-
104  // If this is not the first substep we pass in S_data as the previous step's solution
-
105  erf_fast_rhs_MT(fast_step, nrk, level, finest_level,
-
106  S_slow_rhs, S_data, S_stage, S_prim, pi_stage, fast_coeffs,
-
107  S_data, S_scratch, fine_geom,
-
108  solverChoice.gravity, solverChoice.use_lagged_delta_rt,
-
109  Omega, z_t_rk[level], z_t_pert.get(),
-
110  z_phys_nd[level], z_phys_nd_new[level], z_phys_nd_src[level],
-
111  detJ_cc[level], detJ_cc_new[level], detJ_cc_src[level],
-
112  dtau, beta_s, inv_fac,
-
113  mapfac_m[level], mapfac_u[level], mapfac_v[level],
-
114  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux);
-
115  }
-
116  } else if (solverChoice.use_terrain && solverChoice.terrain_type == TerrainType::Static) {
-
117  if (fast_step == 0) {
-
118 
-
119  // If this is the first substep we make the coefficients since they are based only on stage data
-
120  make_fast_coeffs(level, fast_coeffs, S_stage, S_prim, pi_stage, fine_geom,
-
121  l_use_moisture, solverChoice.use_terrain, solverChoice.gravity, solverChoice.c_p,
-
122  detJ_cc[level], r0, pi0, dtau, beta_s, phys_bc_type);
-
123 
-
124  // If this is the first substep we pass in S_old as the previous step's solution
-
125  erf_fast_rhs_T(fast_step, nrk, level, finest_level,
-
126  S_slow_rhs, S_old, S_stage, S_prim, pi_stage, fast_coeffs,
-
127  S_data, S_scratch, fine_geom, solverChoice.gravity, Omega,
-
128  z_phys_nd[level], detJ_cc[level], dtau, beta_s, inv_fac,
-
129  mapfac_m[level], mapfac_u[level], mapfac_v[level],
-
130  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux);
-
131  } else {
-
132  // If this is not the first substep we pass in S_data as the previous step's solution
-
133  erf_fast_rhs_T(fast_step, nrk, level, finest_level,
-
134  S_slow_rhs, S_data, S_stage, S_prim, pi_stage, fast_coeffs,
-
135  S_data, S_scratch, fine_geom, solverChoice.gravity, Omega,
-
136  z_phys_nd[level], detJ_cc[level], dtau, beta_s, inv_fac,
-
137  mapfac_m[level], mapfac_u[level], mapfac_v[level],
-
138  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux);
-
139  }
-
140  } else {
-
141  if (fast_step == 0) {
-
142 
-
143  // If this is the first substep we make the coefficients since they are based only on stage data
-
144  make_fast_coeffs(level, fast_coeffs, S_stage, S_prim, pi_stage, fine_geom,
-
145  l_use_moisture, solverChoice.use_terrain, solverChoice.gravity, solverChoice.c_p,
-
146  detJ_cc[level], r0, pi0, dtau, beta_s, phys_bc_type);
-
147 
-
148  // If this is the first substep we pass in S_old as the previous step's solution
-
149  erf_fast_rhs_N(fast_step, nrk, level, finest_level,
-
150  S_slow_rhs, S_old, S_stage, S_prim, pi_stage, fast_coeffs,
-
151  S_data, S_scratch, fine_geom, solverChoice.gravity,
-
152  dtau, beta_s, inv_fac,
-
153  mapfac_m[level], mapfac_u[level], mapfac_v[level],
-
154  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux);
-
155  } else {
-
156  // If this is not the first substep we pass in S_data as the previous step's solution
-
157  erf_fast_rhs_N(fast_step, nrk, level, finest_level,
-
158  S_slow_rhs, S_data, S_stage, S_prim, pi_stage, fast_coeffs,
-
159  S_data, S_scratch, fine_geom, solverChoice.gravity,
-
160  dtau, beta_s, inv_fac,
-
161  mapfac_m[level], mapfac_u[level], mapfac_v[level],
-
162  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux);
-
163  }
-
164  }
-
165 
-
166  // Even if we update all the conserved variables we don't need
-
167  // to fillpatch the slow ones every acoustic substep
-
168 
-
169  // NOTE: Numerical diffusion is tested on in FillPatchIntermediate and dictates the size of the
-
170  // box over which VelocityToMomentum is computed. V2M requires one more ghost cell be
-
171  // filled for rho than velocity. This logical condition ensures we fill enough ghost cells
-
172  // when use_NumDiff is true.
-
173  int ng_cons = S_data[IntVars::cons].nGrowVect().max() - 1;
-
174  int ng_vel = S_data[IntVars::xmom].nGrowVect().max();
-
175  if (!solverChoice.use_NumDiff) {
-
176  ng_cons = 1;
-
177  ng_vel = 1;
-
178  }
-
179  apply_bcs(S_data, new_substep_time, ng_cons, ng_vel, fast_only=true, vel_and_mom_synced=false);
-
180  };
+
91  // We have to call this each step since it depends on the substep time now
+
92  // Note we pass in the *old* detJ here
+
93  make_fast_coeffs(level, fast_coeffs, S_stage, S_prim, pi_stage, fine_geom,
+
94  l_use_moisture, solverChoice.use_terrain, solverChoice.gravity, solverChoice.c_p,
+
95  detJ_cc[level], r0, pi0, dtau, beta_s, phys_bc_type);
+
96 
+
97  if (fast_step == 0) {
+
98  // If this is the first substep we pass in S_old as the previous step's solution
+
99  erf_fast_rhs_MT(fast_step, nrk, level, finest_level,
+
100  S_slow_rhs, S_old, S_stage, S_prim, pi_stage, fast_coeffs,
+
101  S_data, S_scratch, fine_geom,
+
102  solverChoice.gravity, solverChoice.use_lagged_delta_rt,
+
103  Omega, z_t_rk[level], z_t_pert.get(),
+
104  z_phys_nd[level], z_phys_nd_new[level], z_phys_nd_src[level],
+
105  detJ_cc[level], detJ_cc_new[level], detJ_cc_src[level],
+
106  dtau, beta_s, inv_fac,
+
107  mapfac_m[level], mapfac_u[level], mapfac_v[level],
+
108  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux, l_implicit_substepping);
+
109  } else {
+
110  // If this is not the first substep we pass in S_data as the previous step's solution
+
111  erf_fast_rhs_MT(fast_step, nrk, level, finest_level,
+
112  S_slow_rhs, S_data, S_stage, S_prim, pi_stage, fast_coeffs,
+
113  S_data, S_scratch, fine_geom,
+
114  solverChoice.gravity, solverChoice.use_lagged_delta_rt,
+
115  Omega, z_t_rk[level], z_t_pert.get(),
+
116  z_phys_nd[level], z_phys_nd_new[level], z_phys_nd_src[level],
+
117  detJ_cc[level], detJ_cc_new[level], detJ_cc_src[level],
+
118  dtau, beta_s, inv_fac,
+
119  mapfac_m[level], mapfac_u[level], mapfac_v[level],
+
120  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux, l_implicit_substepping);
+
121  }
+
122  } else if (solverChoice.use_terrain && solverChoice.terrain_type == TerrainType::Static) {
+
123  if (fast_step == 0) {
+
124 
+
125  // If this is the first substep we make the coefficients since they are based only on stage data
+
126  make_fast_coeffs(level, fast_coeffs, S_stage, S_prim, pi_stage, fine_geom,
+
127  l_use_moisture, solverChoice.use_terrain, solverChoice.gravity, solverChoice.c_p,
+
128  detJ_cc[level], r0, pi0, dtau, beta_s, phys_bc_type);
+
129 
+
130  // If this is the first substep we pass in S_old as the previous step's solution
+
131  erf_fast_rhs_T(fast_step, nrk, level, finest_level,
+
132  S_slow_rhs, S_old, S_stage, S_prim, pi_stage, fast_coeffs,
+
133  S_data, S_scratch, fine_geom, solverChoice.gravity, Omega,
+
134  z_phys_nd[level], detJ_cc[level], dtau, beta_s, inv_fac,
+
135  mapfac_m[level], mapfac_u[level], mapfac_v[level],
+
136  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux, l_implicit_substepping);
+
137  } else {
+
138  // If this is not the first substep we pass in S_data as the previous step's solution
+
139  erf_fast_rhs_T(fast_step, nrk, level, finest_level,
+
140  S_slow_rhs, S_data, S_stage, S_prim, pi_stage, fast_coeffs,
+
141  S_data, S_scratch, fine_geom, solverChoice.gravity, Omega,
+
142  z_phys_nd[level], detJ_cc[level], dtau, beta_s, inv_fac,
+
143  mapfac_m[level], mapfac_u[level], mapfac_v[level],
+
144  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux, l_implicit_substepping);
+
145  }
+
146  } else {
+
147  if (fast_step == 0) {
+
148 
+
149  // If this is the first substep we make the coefficients since they are based only on stage data
+
150  make_fast_coeffs(level, fast_coeffs, S_stage, S_prim, pi_stage, fine_geom,
+
151  l_use_moisture, solverChoice.use_terrain, solverChoice.gravity, solverChoice.c_p,
+
152  detJ_cc[level], r0, pi0, dtau, beta_s, phys_bc_type);
+
153 
+
154  // If this is the first substep we pass in S_old as the previous step's solution
+
155  erf_fast_rhs_N(fast_step, nrk, level, finest_level,
+
156  S_slow_rhs, S_old, S_stage, S_prim, pi_stage, fast_coeffs,
+
157  S_data, S_scratch, fine_geom, solverChoice.gravity,
+
158  dtau, beta_s, inv_fac,
+
159  mapfac_m[level], mapfac_u[level], mapfac_v[level],
+
160  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux, l_implicit_substepping);
+
161  } else {
+
162  // If this is not the first substep we pass in S_data as the previous step's solution
+
163  erf_fast_rhs_N(fast_step, nrk, level, finest_level,
+
164  S_slow_rhs, S_data, S_stage, S_prim, pi_stage, fast_coeffs,
+
165  S_data, S_scratch, fine_geom, solverChoice.gravity,
+
166  dtau, beta_s, inv_fac,
+
167  mapfac_m[level], mapfac_u[level], mapfac_v[level],
+
168  fr_as_crse, fr_as_fine, l_use_moisture, l_reflux, l_implicit_substepping);
+
169  }
+
170  }
+
171 
+
172  // Even if we update all the conserved variables we don't need
+
173  // to fillpatch the slow ones every acoustic substep
+
174 
+
175  // NOTE: Numerical diffusion is tested on in FillPatchIntermediate and dictates the size of the
+
176  // box over which VelocityToMomentum is computed. V2M requires one more ghost cell be
+
177  // filled for rho than velocity. This logical condition ensures we fill enough ghost cells
+
178  // when use_NumDiff is true.
+
179  int ng_cons = S_data[IntVars::cons].nGrowVect().max() - 1;
+
180  int ng_vel = S_data[IntVars::xmom].nGrowVect().max();
+
181  if (!solverChoice.use_NumDiff) {
+
182  ng_cons = 1;
+
183  ng_vel = 1;
+
184  }
+
185  apply_bcs(S_data, new_substep_time, ng_cons, ng_vel, fast_only=true, vel_and_mom_synced=false);
+
186  };
auto fast_rhs_fun
Definition: ERF_TI_fast_rhs_fun.H:4
auto apply_bcs
Definition: ERF_TI_utils.H:53
void init_terrain_grid(int lev, const Geometry &geom, MultiFab &z_phys_nd, Vector< Real > const &z_levels_h, GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &phys_bc_type)
Definition: ERF_TerrainMetrics.cpp:89
void make_areas(const Geometry &geom, MultiFab &z_phys_nd, MultiFab &ax, MultiFab &ay, MultiFab &az)
Definition: ERF_TerrainMetrics.cpp:622
void make_J(const Geometry &geom, MultiFab &z_phys_nd, MultiFab &detJ_cc)
Definition: ERF_TerrainMetrics.cpp:584
-
void erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stg_data, const MultiFab &S_stg_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const bool use_lagged_delta_rt, MultiFab &Omega, std::unique_ptr< MultiFab > &z_t_rk, const MultiFab *z_t_pert, std::unique_ptr< MultiFab > &z_phys_nd_old, std::unique_ptr< MultiFab > &z_phys_nd_new, std::unique_ptr< MultiFab > &z_phys_nd_stg, std::unique_ptr< MultiFab > &detJ_cc_old, std::unique_ptr< MultiFab > &detJ_cc_new, std::unique_ptr< MultiFab > &detJ_cc_stg, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
Definition: ERF_fast_rhs_MT.cpp:44
-
void erf_fast_rhs_N(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
Definition: ERF_fast_rhs_N.cpp:34
-
void erf_fast_rhs_T(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, MultiFab &Omega, std::unique_ptr< MultiFab > &z_phys_nd, std::unique_ptr< MultiFab > &detJ_cc, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
Definition: ERF_fast_rhs_T.cpp:37
+
void erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stg_data, const MultiFab &S_stg_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const bool use_lagged_delta_rt, MultiFab &Omega, std::unique_ptr< MultiFab > &z_t_rk, const MultiFab *z_t_pert, std::unique_ptr< MultiFab > &z_phys_nd_old, std::unique_ptr< MultiFab > &z_phys_nd_new, std::unique_ptr< MultiFab > &z_phys_nd_stg, std::unique_ptr< MultiFab > &detJ_cc_old, std::unique_ptr< MultiFab > &detJ_cc_new, std::unique_ptr< MultiFab > &detJ_cc_stg, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool)
Definition: ERF_fast_rhs_MT.cpp:46
+
void erf_fast_rhs_N(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
Definition: ERF_fast_rhs_N.cpp:36
+
void erf_fast_rhs_T(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, MultiFab &Omega, std::unique_ptr< MultiFab > &z_phys_nd, std::unique_ptr< MultiFab > &detJ_cc, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool)
Definition: ERF_fast_rhs_T.cpp:39
void make_fast_coeffs(int, MultiFab &fast_coeffs, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const amrex::Geometry geom, bool l_use_moisture, bool l_use_terrain, Real gravity, Real c_p, std::unique_ptr< MultiFab > &detJ_cc, const MultiFab *r0, const MultiFab *pi0, Real dtau, Real beta_s, amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &phys_bc_type)
Definition: ERF_make_fast_coeffs.cpp:27
@ cons
Definition: ERF_IndexDefines.H:131
@ zmom
Definition: ERF_IndexDefines.H:134
diff --git a/ERF__TerrainMetrics_8H.html b/ERF__TerrainMetrics_8H.html index de9eb35aa5..05eeab2633 100644 --- a/ERF__TerrainMetrics_8H.html +++ b/ERF__TerrainMetrics_8H.html @@ -621,7 +621,7 @@

164  return met_h_eta;

165 }
-

Referenced by DiffusionSrcForState_T(), erf_fast_rhs_MT(), erf_fast_rhs_T(), erf_slow_rhs_pre(), ERFPhysBCFunct_v::impose_vertical_yvel_bcs(), MOSTAverage::set_rotated_fields(), and ERF::WritePlotFile().

+

Referenced by DiffusionSrcForState_T(), erf_fast_rhs_MT(), erf_fast_rhs_T(), erf_slow_rhs_pre(), ERFPhysBCFunct_v::impose_vertical_yvel_bcs(), MOSTAverage::set_rotated_fields(), and ERF::WritePlotFile().

Here is the caller graph for this function:
@@ -629,8 +629,8 @@

- - + + @@ -1030,7 +1030,7 @@

107  return met_h_xi;

108 }

-

Referenced by DiffusionSrcForState_T(), erf_fast_rhs_MT(), erf_fast_rhs_T(), erf_slow_rhs_pre(), ERFPhysBCFunct_u::impose_vertical_xvel_bcs(), rotate_stress_tensor(), MOSTAverage::set_rotated_fields(), and ERF::WritePlotFile().

+

Referenced by DiffusionSrcForState_T(), erf_fast_rhs_MT(), erf_fast_rhs_T(), erf_slow_rhs_pre(), ERFPhysBCFunct_u::impose_vertical_xvel_bcs(), rotate_stress_tensor(), MOSTAverage::set_rotated_fields(), and ERF::WritePlotFile().

Here is the caller graph for this function:
@@ -1038,8 +1038,8 @@

- - + + @@ -1512,7 +1512,7 @@

92  return met_h_zeta;

93 }
-

Referenced by DiffusionSrcForState_T(), erf_fast_rhs_MT(), erf_fast_rhs_T(), erf_make_tau_terms(), erf_slow_rhs_pre(), ERFPhysBCFunct_u::impose_vertical_xvel_bcs(), and ERF::WritePlotFile().

+

Referenced by DiffusionSrcForState_T(), erf_fast_rhs_MT(), erf_fast_rhs_T(), erf_make_tau_terms(), erf_slow_rhs_pre(), ERFPhysBCFunct_u::impose_vertical_xvel_bcs(), and ERF::WritePlotFile().

Here is the caller graph for this function:
@@ -1520,8 +1520,8 @@

- - + + @@ -1581,7 +1581,7 @@

135  return met_h_zeta;

136 }

-

Referenced by DiffusionSrcForState_T(), erf_fast_rhs_MT(), erf_fast_rhs_T(), erf_make_tau_terms(), erf_slow_rhs_pre(), ERFPhysBCFunct_v::impose_vertical_yvel_bcs(), and ERF::WritePlotFile().

+

Referenced by DiffusionSrcForState_T(), erf_fast_rhs_MT(), erf_fast_rhs_T(), erf_make_tau_terms(), erf_slow_rhs_pre(), ERFPhysBCFunct_v::impose_vertical_yvel_bcs(), and ERF::WritePlotFile().

Here is the caller graph for this function:
@@ -1589,8 +1589,8 @@

- - + + @@ -1956,15 +1956,15 @@

397 }

@ omega
Definition: ERF_SAM.H:49
-

Referenced by erf_fast_rhs_MT(), erf_fast_rhs_T(), erf_make_tau_terms(), and erf_slow_rhs_pre().

+

Referenced by erf_fast_rhs_MT(), erf_fast_rhs_T(), erf_make_tau_terms(), and erf_slow_rhs_pre().

Here is the caller graph for this function:
- - + + @@ -2372,15 +2372,15 @@

421  return w;

422 }
-

Referenced by erf_fast_rhs_MT(), erf_fast_rhs_T(), ERFPhysBCFunct_w::impose_lateral_zvel_bcs(), ERFPhysBCFunct_w::impose_vertical_zvel_bcs(), and WFromOmega().

+

Referenced by erf_fast_rhs_MT(), erf_fast_rhs_T(), ERFPhysBCFunct_w::impose_lateral_zvel_bcs(), ERFPhysBCFunct_w::impose_vertical_zvel_bcs(), and WFromOmega().

Here is the caller graph for this function:
- - + + diff --git a/ERF__TerrainMetrics_8H_a2116df83b61a39fb50b9a2d7474c00d7_icgraph.map b/ERF__TerrainMetrics_8H_a2116df83b61a39fb50b9a2d7474c00d7_icgraph.map index 84cd49ec8b..a70d549423 100644 --- a/ERF__TerrainMetrics_8H_a2116df83b61a39fb50b9a2d7474c00d7_icgraph.map +++ b/ERF__TerrainMetrics_8H_a2116df83b61a39fb50b9a2d7474c00d7_icgraph.map @@ -1,8 +1,8 @@ - - + + diff --git a/ERF__TerrainMetrics_8H_a2116df83b61a39fb50b9a2d7474c00d7_icgraph.md5 b/ERF__TerrainMetrics_8H_a2116df83b61a39fb50b9a2d7474c00d7_icgraph.md5 index 2eab86202b..41245a348d 100644 --- a/ERF__TerrainMetrics_8H_a2116df83b61a39fb50b9a2d7474c00d7_icgraph.md5 +++ b/ERF__TerrainMetrics_8H_a2116df83b61a39fb50b9a2d7474c00d7_icgraph.md5 @@ -1 +1 @@ -c8cab173d493b12165d67ada8d9e1841 \ No newline at end of file +764ac914445dd907c33057ae9bc6376a \ No newline at end of file diff --git a/ERF__TerrainMetrics_8H_a53ec395d493c2308315f7512c5438087_icgraph.map b/ERF__TerrainMetrics_8H_a53ec395d493c2308315f7512c5438087_icgraph.map index cc017a32ac..c1b1b9ed1c 100644 --- a/ERF__TerrainMetrics_8H_a53ec395d493c2308315f7512c5438087_icgraph.map +++ b/ERF__TerrainMetrics_8H_a53ec395d493c2308315f7512c5438087_icgraph.map @@ -1,7 +1,7 @@ - - + + diff --git a/ERF__TerrainMetrics_8H_a53ec395d493c2308315f7512c5438087_icgraph.md5 b/ERF__TerrainMetrics_8H_a53ec395d493c2308315f7512c5438087_icgraph.md5 index 5008f458c0..82eea0c850 100644 --- a/ERF__TerrainMetrics_8H_a53ec395d493c2308315f7512c5438087_icgraph.md5 +++ b/ERF__TerrainMetrics_8H_a53ec395d493c2308315f7512c5438087_icgraph.md5 @@ -1 +1 @@ -0b1d6ec269ad583cac72fbbdf74d1aa8 \ No newline at end of file +3f5ae60ff61f5bb049016513d7d7d39d \ No newline at end of file diff --git a/ERF__TerrainMetrics_8H_a6a4bf1524412edfd6efcbb867256db18_icgraph.map b/ERF__TerrainMetrics_8H_a6a4bf1524412edfd6efcbb867256db18_icgraph.map index 0abbfc348c..131d5113ab 100644 --- a/ERF__TerrainMetrics_8H_a6a4bf1524412edfd6efcbb867256db18_icgraph.map +++ b/ERF__TerrainMetrics_8H_a6a4bf1524412edfd6efcbb867256db18_icgraph.map @@ -1,7 +1,7 @@ - - + + diff --git a/ERF__TerrainMetrics_8H_a6a4bf1524412edfd6efcbb867256db18_icgraph.md5 b/ERF__TerrainMetrics_8H_a6a4bf1524412edfd6efcbb867256db18_icgraph.md5 index ae72ba2801..c52a65b627 100644 --- a/ERF__TerrainMetrics_8H_a6a4bf1524412edfd6efcbb867256db18_icgraph.md5 +++ b/ERF__TerrainMetrics_8H_a6a4bf1524412edfd6efcbb867256db18_icgraph.md5 @@ -1 +1 @@ -50f797538e78083ada5ea1d943471d3b \ No newline at end of file +d29aa472b953f390803b6f84c75b9e7c \ No newline at end of file diff --git a/ERF__TerrainMetrics_8H_a8d96671d41364f1e24391375a2bc0f1e_icgraph.map b/ERF__TerrainMetrics_8H_a8d96671d41364f1e24391375a2bc0f1e_icgraph.map index 07b0677657..95dd7ccc1c 100644 --- a/ERF__TerrainMetrics_8H_a8d96671d41364f1e24391375a2bc0f1e_icgraph.map +++ b/ERF__TerrainMetrics_8H_a8d96671d41364f1e24391375a2bc0f1e_icgraph.map @@ -1,8 +1,8 @@ - - + + diff --git a/ERF__TerrainMetrics_8H_a8d96671d41364f1e24391375a2bc0f1e_icgraph.md5 b/ERF__TerrainMetrics_8H_a8d96671d41364f1e24391375a2bc0f1e_icgraph.md5 index f05f6cf58e..0c2f79a7dd 100644 --- a/ERF__TerrainMetrics_8H_a8d96671d41364f1e24391375a2bc0f1e_icgraph.md5 +++ b/ERF__TerrainMetrics_8H_a8d96671d41364f1e24391375a2bc0f1e_icgraph.md5 @@ -1 +1 @@ -673849d495ba4a891e6e45539d18fc59 \ No newline at end of file +e3084dda87629d686bd32aeb3a97fcaa \ No newline at end of file diff --git a/ERF__TerrainMetrics_8H_ada12bcb6beb3fa0d00dbdacb37f3c60f_icgraph.map b/ERF__TerrainMetrics_8H_ada12bcb6beb3fa0d00dbdacb37f3c60f_icgraph.map index 9e03a16178..f31f8c14c8 100644 --- a/ERF__TerrainMetrics_8H_ada12bcb6beb3fa0d00dbdacb37f3c60f_icgraph.map +++ b/ERF__TerrainMetrics_8H_ada12bcb6beb3fa0d00dbdacb37f3c60f_icgraph.map @@ -1,8 +1,8 @@ - - + + diff --git a/ERF__TerrainMetrics_8H_ada12bcb6beb3fa0d00dbdacb37f3c60f_icgraph.md5 b/ERF__TerrainMetrics_8H_ada12bcb6beb3fa0d00dbdacb37f3c60f_icgraph.md5 index a8bad63cc8..112bc58769 100644 --- a/ERF__TerrainMetrics_8H_ada12bcb6beb3fa0d00dbdacb37f3c60f_icgraph.md5 +++ b/ERF__TerrainMetrics_8H_ada12bcb6beb3fa0d00dbdacb37f3c60f_icgraph.md5 @@ -1 +1 @@ -13e956a00fb963ef6fae651a2b16a04f \ No newline at end of file +6035f7093477414af16a694d846c6a5e \ No newline at end of file diff --git a/ERF__TerrainMetrics_8H_ae609a5c1f84347b66e9a8b712271c4ce_icgraph.map b/ERF__TerrainMetrics_8H_ae609a5c1f84347b66e9a8b712271c4ce_icgraph.map index bc1b90e7b5..e976ea9279 100644 --- a/ERF__TerrainMetrics_8H_ae609a5c1f84347b66e9a8b712271c4ce_icgraph.map +++ b/ERF__TerrainMetrics_8H_ae609a5c1f84347b66e9a8b712271c4ce_icgraph.map @@ -1,8 +1,8 @@ - - + + diff --git a/ERF__TerrainMetrics_8H_ae609a5c1f84347b66e9a8b712271c4ce_icgraph.md5 b/ERF__TerrainMetrics_8H_ae609a5c1f84347b66e9a8b712271c4ce_icgraph.md5 index fb959ed314..2627e52a9d 100644 --- a/ERF__TerrainMetrics_8H_ae609a5c1f84347b66e9a8b712271c4ce_icgraph.md5 +++ b/ERF__TerrainMetrics_8H_ae609a5c1f84347b66e9a8b712271c4ce_icgraph.md5 @@ -1 +1 @@ -0bf278f7f4f231083b7fc2e300272824 \ No newline at end of file +45d542442ae70c647e07c973874be0dc \ No newline at end of file diff --git a/ERF__TileNoZ_8H.html b/ERF__TileNoZ_8H.html index 38b523bb5b..098af81bf3 100644 --- a/ERF__TileNoZ_8H.html +++ b/ERF__TileNoZ_8H.html @@ -190,7 +190,7 @@

20  }

21 }
-

Referenced by add_thin_body_sources(), ERF::Advance(), ERF::advance_dycore(), TurbulentPerturbation::calc_tpi_meanMag_perBox(), MYNNPBLH::compute_pblh(), MOSTAverage::compute_plane_averages(), MOSTAverage::compute_region_averages(), ComputeTurbulentViscosityLES(), ERF::erf_enforce_hse(), erf_fast_rhs_N(), erf_fast_rhs_T(), erf_init_dens_hse(), erf_make_tau_terms(), erf_slow_rhs_pre(), SAM::IceFall(), Kessler::Init(), SAM::Init(), ERF::init_custom(), ERF::init_from_hse(), Radiation::initialize(), make_fast_coeffs(), make_sources(), TurbulentPerturbation::netZeroBuoyantAdd(), TurbulentPerturbation::netZeroBuoyantAdjust(), SAM::PrecipFall(), TurbulentPerturbation::pseudoRandomPert(), MOSTAverage::set_k_indices_T(), MOSTAverage::set_norm_indices_T(), MOSTAverage::set_norm_positions_T(), MOSTAverage::set_rotated_fields(), MOSTAverage::set_z_positions_T(), ERF::turbPert_amplitude(), MOSTAverage::write_averages(), MOSTAverage::write_k_indices(), MOSTAverage::write_norm_indices(), and MOSTAverage::write_xz_positions().

+

Referenced by add_thin_body_sources(), ERF::Advance(), ERF::advance_dycore(), TurbulentPerturbation::calc_tpi_meanMag_perBox(), MYNNPBLH::compute_pblh(), MOSTAverage::compute_plane_averages(), MOSTAverage::compute_region_averages(), ComputeTurbulentViscosityLES(), ERF::erf_enforce_hse(), erf_fast_rhs_N(), erf_fast_rhs_T(), erf_init_dens_hse(), erf_make_tau_terms(), erf_slow_rhs_pre(), SAM::IceFall(), Kessler::Init(), SAM::Init(), ERF::init_custom(), ERF::init_from_hse(), Radiation::initialize(), make_fast_coeffs(), make_sources(), TurbulentPerturbation::netZeroBuoyantAdd(), TurbulentPerturbation::netZeroBuoyantAdjust(), SAM::PrecipFall(), TurbulentPerturbation::pseudoRandomPert(), MOSTAverage::set_k_indices_T(), MOSTAverage::set_norm_indices_T(), MOSTAverage::set_norm_positions_T(), MOSTAverage::set_rotated_fields(), MOSTAverage::set_z_positions_T(), ERF::turbPert_amplitude(), MOSTAverage::write_averages(), MOSTAverage::write_k_indices(), MOSTAverage::write_norm_indices(), and MOSTAverage::write_xz_positions().

Here is the caller graph for this function:
- - + +

Functions

void erf_fast_rhs_MT (int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stg_data, const MultiFab &S_stg_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const bool use_lagged_delta_rt, MultiFab &Omega, std::unique_ptr< MultiFab > &z_t_rk, const MultiFab *z_t_pert, std::unique_ptr< MultiFab > &z_phys_nd_old, std::unique_ptr< MultiFab > &z_phys_nd_new, std::unique_ptr< MultiFab > &z_phys_nd_stg, std::unique_ptr< MultiFab > &detJ_cc_old, std::unique_ptr< MultiFab > &detJ_cc_new, std::unique_ptr< MultiFab > &detJ_cc_stg, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
 
void erf_fast_rhs_MT (int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stg_data, const MultiFab &S_stg_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const bool use_lagged_delta_rt, MultiFab &Omega, std::unique_ptr< MultiFab > &z_t_rk, const MultiFab *z_t_pert, std::unique_ptr< MultiFab > &z_phys_nd_old, std::unique_ptr< MultiFab > &z_phys_nd_new, std::unique_ptr< MultiFab > &z_phys_nd_stg, std::unique_ptr< MultiFab > &detJ_cc_old, std::unique_ptr< MultiFab > &detJ_cc_new, std::unique_ptr< MultiFab > &detJ_cc_stg, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool)
 

Function Documentation

-
-

◆ erf_fast_rhs_MT()

+ +

◆ erf_fast_rhs_MT()

@@ -345,7 +345,13 @@

bool  - l_reflux  + l_reflux, + + + + + bool  +   @@ -389,564 +395,566 @@

[in]mapfac_vmap factor at y-faces [in,out]fr_as_crseYAFluxRegister at level l at level l / l+1 interface [in,out]fr_as_fineYAFluxRegister at level l at level l-1 / l interface + [in]l_use_moisture [in]l_refluxshould we add fluxes to the FluxRegisters? + [in]l_implicit_substepping -
75 {
-
76  BL_PROFILE_REGION("erf_fast_rhs_MT()");
-
77 
-
78  Real beta_1 = 0.5 * (1.0 - beta_s); // multiplies explicit terms
-
79  Real beta_2 = 0.5 * (1.0 + beta_s); // multiplies implicit terms
+
78 {
+
79  BL_PROFILE_REGION("erf_fast_rhs_MT()");
80 
-
81  // How much do we project forward the (rho theta) that is used in the horizontal momentum equations
-
82  Real beta_d = 0.1;
+
81  Real beta_1 = 0.5 * (1.0 - beta_s); // multiplies explicit terms
+
82  Real beta_2 = 0.5 * (1.0 + beta_s); // multiplies implicit terms
83 
-
84  const Real* dx = geom.CellSize();
-
85  const GpuArray<Real, AMREX_SPACEDIM> dxInv = geom.InvCellSizeArray();
+
84  // How much do we project forward the (rho theta) that is used in the horizontal momentum equations
+
85  Real beta_d = 0.1;
86 
-
87  Real dxi = dxInv[0];
-
88  Real dyi = dxInv[1];
-
89  Real dzi = dxInv[2];
-
90 
-
91  MultiFab coeff_A_mf(fast_coeffs, make_alias, 0, 1);
-
92  MultiFab inv_coeff_B_mf(fast_coeffs, make_alias, 1, 1);
-
93  MultiFab coeff_C_mf(fast_coeffs, make_alias, 2, 1);
-
94  MultiFab coeff_P_mf(fast_coeffs, make_alias, 3, 1);
-
95  MultiFab coeff_Q_mf(fast_coeffs, make_alias, 4, 1);
-
96 
-
97  // *************************************************************************
-
98  // Set gravity as a vector
-
99  const Array<Real,AMREX_SPACEDIM> grav{0.0, 0.0, -gravity};
-
100  const GpuArray<Real,AMREX_SPACEDIM> grav_gpu{grav[0], grav[1], grav[2]};
-
101 
-
102  MultiFab extrap(S_data[IntVars::cons].boxArray(),S_data[IntVars::cons].DistributionMap(),1,1);
-
103 
-
104  // *************************************************************************
-
105  // Define updates in the current RK stg
-
106  // *************************************************************************
-
107 #ifdef _OPENMP
-
108 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
109 #endif
-
110  {
-
111  FArrayBox temp_rhs_fab;
-
112 
-
113  FArrayBox RHS_fab;
-
114  FArrayBox soln_fab;
+
87  const Real* dx = geom.CellSize();
+
88  const GpuArray<Real, AMREX_SPACEDIM> dxInv = geom.InvCellSizeArray();
+
89 
+
90  Real dxi = dxInv[0];
+
91  Real dyi = dxInv[1];
+
92  Real dzi = dxInv[2];
+
93 
+
94  MultiFab coeff_A_mf(fast_coeffs, make_alias, 0, 1);
+
95  MultiFab inv_coeff_B_mf(fast_coeffs, make_alias, 1, 1);
+
96  MultiFab coeff_C_mf(fast_coeffs, make_alias, 2, 1);
+
97  MultiFab coeff_P_mf(fast_coeffs, make_alias, 3, 1);
+
98  MultiFab coeff_Q_mf(fast_coeffs, make_alias, 4, 1);
+
99 
+
100  // *************************************************************************
+
101  // Set gravity as a vector
+
102  const Array<Real,AMREX_SPACEDIM> grav{0.0, 0.0, -gravity};
+
103  const GpuArray<Real,AMREX_SPACEDIM> grav_gpu{grav[0], grav[1], grav[2]};
+
104 
+
105  MultiFab extrap(S_data[IntVars::cons].boxArray(),S_data[IntVars::cons].DistributionMap(),1,1);
+
106 
+
107  // *************************************************************************
+
108  // Define updates in the current RK stg
+
109  // *************************************************************************
+
110 #ifdef _OPENMP
+
111 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
112 #endif
+
113  {
+
114  FArrayBox temp_rhs_fab;
115 
-
116  std::array<FArrayBox,AMREX_SPACEDIM> flux;
-
117 
-
118  // NOTE: we leave tiling off here for efficiency -- to make this loop work with tiling
-
119  // will require additional changes
-
120  for ( MFIter mfi(S_stg_data[IntVars::cons],false); mfi.isValid(); ++mfi)
-
121  {
-
122  Box bx = mfi.tilebox();
-
123  Box tbx = surroundingNodes(bx,0);
-
124  Box tby = surroundingNodes(bx,1);
-
125  Box tbz = surroundingNodes(bx,2);
-
126 
-
127  Box vbx = mfi.validbox();
-
128  const auto& vbx_hi = ubound(vbx);
+
116  FArrayBox RHS_fab;
+
117  FArrayBox soln_fab;
+
118 
+
119  std::array<FArrayBox,AMREX_SPACEDIM> flux;
+
120 
+
121  // NOTE: we leave tiling off here for efficiency -- to make this loop work with tiling
+
122  // will require additional changes
+
123  for ( MFIter mfi(S_stg_data[IntVars::cons],false); mfi.isValid(); ++mfi)
+
124  {
+
125  Box bx = mfi.tilebox();
+
126  Box tbx = surroundingNodes(bx,0);
+
127  Box tby = surroundingNodes(bx,1);
+
128  Box tbz = surroundingNodes(bx,2);
129 
-
130  const Array4<const Real> & stg_cons = S_stg_data[IntVars::cons].const_array(mfi);
-
131  const Array4<const Real> & stg_xmom = S_stg_data[IntVars::xmom].const_array(mfi);
-
132  const Array4<const Real> & stg_ymom = S_stg_data[IntVars::ymom].const_array(mfi);
-
133  const Array4<const Real> & stg_zmom = S_stg_data[IntVars::zmom].const_array(mfi);
-
134  const Array4<const Real> & prim = S_stg_prim.const_array(mfi);
-
135 
-
136  const Array4<const Real>& slow_rhs_cons = S_slow_rhs[IntVars::cons].const_array(mfi);
-
137  const Array4<const Real>& slow_rhs_rho_u = S_slow_rhs[IntVars::xmom].const_array(mfi);
-
138  const Array4<const Real>& slow_rhs_rho_v = S_slow_rhs[IntVars::ymom].const_array(mfi);
-
139  const Array4<const Real>& slow_rhs_rho_w = S_slow_rhs[IntVars::zmom].const_array(mfi);
-
140 
-
141  const Array4<Real>& cur_cons = S_data[IntVars::cons].array(mfi);
-
142  const Array4<Real>& cur_xmom = S_data[IntVars::xmom].array(mfi);
-
143  const Array4<Real>& cur_ymom = S_data[IntVars::ymom].array(mfi);
-
144  const Array4<Real>& cur_zmom = S_data[IntVars::zmom].array(mfi);
-
145 
-
146  const Array4<Real>& lagged_delta_rt = S_scratch[IntVars::cons].array(mfi);
-
147 
-
148  const Array4<const Real>& prev_cons = S_prev[IntVars::cons].const_array(mfi);
-
149  const Array4<const Real>& prev_xmom = S_prev[IntVars::xmom].const_array(mfi);
-
150  const Array4<const Real>& prev_ymom = S_prev[IntVars::ymom].const_array(mfi);
-
151  const Array4<const Real>& prev_zmom = S_prev[IntVars::zmom].const_array(mfi);
-
152 
-
153  // These store the advection momenta which we will use to update the slow variables
-
154  const Array4<Real>& avg_xmom = S_scratch[IntVars::xmom].array(mfi);
-
155  const Array4<Real>& avg_ymom = S_scratch[IntVars::ymom].array(mfi);
-
156  const Array4<Real>& avg_zmom = S_scratch[IntVars::zmom].array(mfi);
-
157 
-
158  const Array4<const Real>& z_nd_old = z_phys_nd_old->const_array(mfi);
-
159  const Array4<const Real>& z_nd_new = z_phys_nd_new->const_array(mfi);
-
160  const Array4<const Real>& z_nd_stg = z_phys_nd_stg->const_array(mfi);
-
161  const Array4<const Real>& detJ_old = detJ_cc_old->const_array(mfi);
-
162  const Array4<const Real>& detJ_new = detJ_cc_new->const_array(mfi);
-
163  const Array4<const Real>& detJ_stg = detJ_cc_stg->const_array(mfi);
-
164 
-
165  const Array4<const Real>& z_t_arr = z_t_rk->const_array(mfi);
-
166  const Array4<const Real>& zp_t_arr = z_t_pert->const_array(mfi);
+
130  Box vbx = mfi.validbox();
+
131  const auto& vbx_hi = ubound(vbx);
+
132 
+
133  const Array4<const Real> & stg_cons = S_stg_data[IntVars::cons].const_array(mfi);
+
134  const Array4<const Real> & stg_xmom = S_stg_data[IntVars::xmom].const_array(mfi);
+
135  const Array4<const Real> & stg_ymom = S_stg_data[IntVars::ymom].const_array(mfi);
+
136  const Array4<const Real> & stg_zmom = S_stg_data[IntVars::zmom].const_array(mfi);
+
137  const Array4<const Real> & prim = S_stg_prim.const_array(mfi);
+
138 
+
139  const Array4<const Real>& slow_rhs_cons = S_slow_rhs[IntVars::cons].const_array(mfi);
+
140  const Array4<const Real>& slow_rhs_rho_u = S_slow_rhs[IntVars::xmom].const_array(mfi);
+
141  const Array4<const Real>& slow_rhs_rho_v = S_slow_rhs[IntVars::ymom].const_array(mfi);
+
142  const Array4<const Real>& slow_rhs_rho_w = S_slow_rhs[IntVars::zmom].const_array(mfi);
+
143 
+
144  const Array4<Real>& cur_cons = S_data[IntVars::cons].array(mfi);
+
145  const Array4<Real>& cur_xmom = S_data[IntVars::xmom].array(mfi);
+
146  const Array4<Real>& cur_ymom = S_data[IntVars::ymom].array(mfi);
+
147  const Array4<Real>& cur_zmom = S_data[IntVars::zmom].array(mfi);
+
148 
+
149  const Array4<Real>& lagged_delta_rt = S_scratch[IntVars::cons].array(mfi);
+
150 
+
151  const Array4<const Real>& prev_cons = S_prev[IntVars::cons].const_array(mfi);
+
152  const Array4<const Real>& prev_xmom = S_prev[IntVars::xmom].const_array(mfi);
+
153  const Array4<const Real>& prev_ymom = S_prev[IntVars::ymom].const_array(mfi);
+
154  const Array4<const Real>& prev_zmom = S_prev[IntVars::zmom].const_array(mfi);
+
155 
+
156  // These store the advection momenta which we will use to update the slow variables
+
157  const Array4<Real>& avg_xmom = S_scratch[IntVars::xmom].array(mfi);
+
158  const Array4<Real>& avg_ymom = S_scratch[IntVars::ymom].array(mfi);
+
159  const Array4<Real>& avg_zmom = S_scratch[IntVars::zmom].array(mfi);
+
160 
+
161  const Array4<const Real>& z_nd_old = z_phys_nd_old->const_array(mfi);
+
162  const Array4<const Real>& z_nd_new = z_phys_nd_new->const_array(mfi);
+
163  const Array4<const Real>& z_nd_stg = z_phys_nd_stg->const_array(mfi);
+
164  const Array4<const Real>& detJ_old = detJ_cc_old->const_array(mfi);
+
165  const Array4<const Real>& detJ_new = detJ_cc_new->const_array(mfi);
+
166  const Array4<const Real>& detJ_stg = detJ_cc_stg->const_array(mfi);
167 
-
168  const Array4< Real>& omega_arr = Omega.array(mfi);
-
169 
-
170  const Array4<const Real>& pi_stage_ca = pi_stage.const_array(mfi);
-
171 
-
172  const Array4<Real>& theta_extrap = extrap.array(mfi);
-
173 
-
174  // Map factors
-
175  const Array4<const Real>& mf_m = mapfac_m->const_array(mfi);
-
176  const Array4<const Real>& mf_u = mapfac_u->const_array(mfi);
-
177  const Array4<const Real>& mf_v = mapfac_v->const_array(mfi);
-
178 
-
179  // Note: it is important to grow the tilebox rather than use growntilebox because
-
180  // we need to fill the ghost cells of the tilebox so we can use them below
-
181  Box gbx = mfi.tilebox(); gbx.grow(1);
-
182  Box gtbx = mfi.nodaltilebox(0); gtbx.grow(1); gtbx.setSmall(2,0);
-
183  Box gtby = mfi.nodaltilebox(1); gtby.grow(1); gtby.setSmall(2,0);
-
184 
-
185  {
-
186  BL_PROFILE("fast_rhs_copies_0");
-
187  if (step == 0) {
-
188  ParallelFor(gbx,
-
189  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
190  cur_cons(i,j,k,Rho_comp) = prev_cons(i,j,k,Rho_comp);
-
191  cur_cons(i,j,k,RhoTheta_comp) = prev_cons(i,j,k,RhoTheta_comp);
-
192 
-
193  Real delta_rt = cur_cons(i,j,k,RhoTheta_comp) - stg_cons(i,j,k,RhoTheta_comp);
-
194  theta_extrap(i,j,k) = delta_rt;
+
168  const Array4<const Real>& z_t_arr = z_t_rk->const_array(mfi);
+
169  const Array4<const Real>& zp_t_arr = z_t_pert->const_array(mfi);
+
170 
+
171  const Array4< Real>& omega_arr = Omega.array(mfi);
+
172 
+
173  const Array4<const Real>& pi_stage_ca = pi_stage.const_array(mfi);
+
174 
+
175  const Array4<Real>& theta_extrap = extrap.array(mfi);
+
176 
+
177  // Map factors
+
178  const Array4<const Real>& mf_m = mapfac_m->const_array(mfi);
+
179  const Array4<const Real>& mf_u = mapfac_u->const_array(mfi);
+
180  const Array4<const Real>& mf_v = mapfac_v->const_array(mfi);
+
181 
+
182  // Note: it is important to grow the tilebox rather than use growntilebox because
+
183  // we need to fill the ghost cells of the tilebox so we can use them below
+
184  Box gbx = mfi.tilebox(); gbx.grow(1);
+
185  Box gtbx = mfi.nodaltilebox(0); gtbx.grow(1); gtbx.setSmall(2,0);
+
186  Box gtby = mfi.nodaltilebox(1); gtby.grow(1); gtby.setSmall(2,0);
+
187 
+
188  {
+
189  BL_PROFILE("fast_rhs_copies_0");
+
190  if (step == 0) {
+
191  ParallelFor(gbx,
+
192  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
193  cur_cons(i,j,k,Rho_comp) = prev_cons(i,j,k,Rho_comp);
+
194  cur_cons(i,j,k,RhoTheta_comp) = prev_cons(i,j,k,RhoTheta_comp);
195 
-
196  // We define lagged_delta_rt for our next step as the current delta_rt
-
197  lagged_delta_rt(i,j,k,RhoTheta_comp) = delta_rt;
-
198  });
-
199  } else if (use_lagged_delta_rt) {
-
200  // This is the default for cases with no or static terrain
-
201  ParallelFor(gbx,
-
202  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
203  Real delta_rt = cur_cons(i,j,k,RhoTheta_comp) - stg_cons(i,j,k,RhoTheta_comp);
-
204  theta_extrap(i,j,k) = delta_rt + beta_d * (delta_rt - lagged_delta_rt(i,j,k,RhoTheta_comp));
-
205 
-
206  // We define lagged_delta_rt for our next step as the current delta_rt
-
207  lagged_delta_rt(i,j,k,RhoTheta_comp) = delta_rt;
-
208  });
-
209  } else {
-
210  // For the moving wave problem, this choice seems more robust
-
211  ParallelFor(gbx,
-
212  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
213  theta_extrap(i,j,k) = cur_cons(i,j,k,RhoTheta_comp) - stg_cons(i,j,k,RhoTheta_comp);
-
214  });
-
215  } // if step
-
216  } // end profile
-
217 
-
218  RHS_fab.resize (tbz,1, The_Async_Arena());
-
219  soln_fab.resize (tbz,1, The_Async_Arena());
-
220  temp_rhs_fab.resize(tbz,2, The_Async_Arena());
-
221 
-
222  auto const& RHS_a = RHS_fab.array();
-
223  auto const& soln_a = soln_fab.array();
-
224  auto const& temp_rhs_arr = temp_rhs_fab.array();
-
225 
-
226  auto const& coeffA_a = coeff_A_mf.array(mfi);
-
227  auto const& inv_coeffB_a = inv_coeff_B_mf.array(mfi);
-
228  auto const& coeffC_a = coeff_C_mf.array(mfi);
-
229  auto const& coeffP_a = coeff_P_mf.array(mfi);
-
230  auto const& coeffQ_a = coeff_Q_mf.array(mfi);
-
231 
-
232  // *********************************************************************
-
233  // Define updates in the RHS of {x, y, z}-momentum equations
-
234  // *********************************************************************
-
235  {
-
236  BL_PROFILE("fast_rhs_xymom_T");
-
237  ParallelFor(tbx, tby,
-
238  [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
239  {
-
240  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
-
241  Real h_xi_old = Compute_h_xi_AtIface(i, j, k, dxInv, z_nd_old);
-
242  Real h_zeta_old = Compute_h_zeta_AtIface(i, j, k, dxInv, z_nd_old);
-
243  Real gp_xi = (theta_extrap(i,j,k) - theta_extrap(i-1,j,k)) * dxi;
-
244  Real gp_zeta_on_iface = (k == 0) ?
-
245  0.5 * dzi * ( theta_extrap(i-1,j,k+1) + theta_extrap(i,j,k+1)
-
246  -theta_extrap(i-1,j,k ) - theta_extrap(i,j,k ) ) :
-
247  0.25 * dzi * ( theta_extrap(i-1,j,k+1) + theta_extrap(i,j,k+1)
-
248  -theta_extrap(i-1,j,k-1) - theta_extrap(i,j,k-1) );
-
249  Real gpx = h_zeta_old * gp_xi - h_xi_old * gp_zeta_on_iface;
-
250  gpx *= mf_u(i,j,0);
-
251 
-
252  if (l_use_moisture) {
-
253  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i-1,j,k,PrimQ1_comp)
-
254  +prim(i,j,k,PrimQ2_comp) + prim(i-1,j,k,PrimQ2_comp) );
-
255  gpx /= (1.0 + q);
-
256  }
-
257 
-
258  Real pi_c = 0.5 * (pi_stage_ca(i-1,j,k,0) + pi_stage_ca(i ,j,k,0));
-
259  Real fast_rhs_rho_u = -Gamma * R_d * pi_c * gpx;
+
196  Real delta_rt = cur_cons(i,j,k,RhoTheta_comp) - stg_cons(i,j,k,RhoTheta_comp);
+
197  theta_extrap(i,j,k) = delta_rt;
+
198 
+
199  // We define lagged_delta_rt for our next step as the current delta_rt
+
200  lagged_delta_rt(i,j,k,RhoTheta_comp) = delta_rt;
+
201  });
+
202  } else if (use_lagged_delta_rt) {
+
203  // This is the default for cases with no or static terrain
+
204  ParallelFor(gbx,
+
205  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
206  Real delta_rt = cur_cons(i,j,k,RhoTheta_comp) - stg_cons(i,j,k,RhoTheta_comp);
+
207  theta_extrap(i,j,k) = delta_rt + beta_d * (delta_rt - lagged_delta_rt(i,j,k,RhoTheta_comp));
+
208 
+
209  // We define lagged_delta_rt for our next step as the current delta_rt
+
210  lagged_delta_rt(i,j,k,RhoTheta_comp) = delta_rt;
+
211  });
+
212  } else {
+
213  // For the moving wave problem, this choice seems more robust
+
214  ParallelFor(gbx,
+
215  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
216  theta_extrap(i,j,k) = cur_cons(i,j,k,RhoTheta_comp) - stg_cons(i,j,k,RhoTheta_comp);
+
217  });
+
218  } // if step
+
219  } // end profile
+
220 
+
221  RHS_fab.resize (tbz,1, The_Async_Arena());
+
222  soln_fab.resize (tbz,1, The_Async_Arena());
+
223  temp_rhs_fab.resize(tbz,2, The_Async_Arena());
+
224 
+
225  auto const& RHS_a = RHS_fab.array();
+
226  auto const& soln_a = soln_fab.array();
+
227  auto const& temp_rhs_arr = temp_rhs_fab.array();
+
228 
+
229  auto const& coeffA_a = coeff_A_mf.array(mfi);
+
230  auto const& inv_coeffB_a = inv_coeff_B_mf.array(mfi);
+
231  auto const& coeffC_a = coeff_C_mf.array(mfi);
+
232  auto const& coeffP_a = coeff_P_mf.array(mfi);
+
233  auto const& coeffQ_a = coeff_Q_mf.array(mfi);
+
234 
+
235  // *********************************************************************
+
236  // Define updates in the RHS of {x, y, z}-momentum equations
+
237  // *********************************************************************
+
238  {
+
239  BL_PROFILE("fast_rhs_xymom_T");
+
240  ParallelFor(tbx, tby,
+
241  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
242  {
+
243  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
+
244  Real h_xi_old = Compute_h_xi_AtIface(i, j, k, dxInv, z_nd_old);
+
245  Real h_zeta_old = Compute_h_zeta_AtIface(i, j, k, dxInv, z_nd_old);
+
246  Real gp_xi = (theta_extrap(i,j,k) - theta_extrap(i-1,j,k)) * dxi;
+
247  Real gp_zeta_on_iface = (k == 0) ?
+
248  0.5 * dzi * ( theta_extrap(i-1,j,k+1) + theta_extrap(i,j,k+1)
+
249  -theta_extrap(i-1,j,k ) - theta_extrap(i,j,k ) ) :
+
250  0.25 * dzi * ( theta_extrap(i-1,j,k+1) + theta_extrap(i,j,k+1)
+
251  -theta_extrap(i-1,j,k-1) - theta_extrap(i,j,k-1) );
+
252  Real gpx = h_zeta_old * gp_xi - h_xi_old * gp_zeta_on_iface;
+
253  gpx *= mf_u(i,j,0);
+
254 
+
255  if (l_use_moisture) {
+
256  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i-1,j,k,PrimQ1_comp)
+
257  +prim(i,j,k,PrimQ2_comp) + prim(i-1,j,k,PrimQ2_comp) );
+
258  gpx /= (1.0 + q);
+
259  }
260 
-
261  // We have already scaled the source terms to have the extra factor of dJ
-
262  cur_xmom(i,j,k) = h_zeta_old * prev_xmom(i,j,k) + dtau * fast_rhs_rho_u
-
263  + dtau * slow_rhs_rho_u(i,j,k);
-
264  },
-
265  [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
266  {
-
267  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
-
268  Real h_eta_old = Compute_h_eta_AtJface(i, j, k, dxInv, z_nd_old);
-
269  Real h_zeta_old = Compute_h_zeta_AtJface(i, j, k, dxInv, z_nd_old);
-
270  Real gp_eta = (theta_extrap(i,j,k) -theta_extrap(i,j-1,k)) * dyi;
-
271  Real gp_zeta_on_jface = (k == 0) ?
-
272  0.5 * dzi * ( theta_extrap(i,j,k+1) + theta_extrap(i,j-1,k+1)
-
273  -theta_extrap(i,j,k ) - theta_extrap(i,j-1,k ) ) :
-
274  0.25 * dzi * ( theta_extrap(i,j,k+1) + theta_extrap(i,j-1,k+1)
-
275  -theta_extrap(i,j,k-1) - theta_extrap(i,j-1,k-1) );
-
276  Real gpy = h_zeta_old * gp_eta - h_eta_old * gp_zeta_on_jface;
-
277  gpy *= mf_v(i,j,0);
-
278 
-
279  if (l_use_moisture) {
-
280  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i,j-1,k,PrimQ1_comp)
-
281  +prim(i,j,k,PrimQ2_comp) + prim(i,j-1,k,PrimQ2_comp) );
-
282  gpy /= (1.0 + q);
-
283  }
-
284 
-
285  Real pi_c = 0.5 * (pi_stage_ca(i,j-1,k,0) + pi_stage_ca(i,j ,k,0));
-
286  Real fast_rhs_rho_v = -Gamma * R_d * pi_c * gpy;
+
261  Real pi_c = 0.5 * (pi_stage_ca(i-1,j,k,0) + pi_stage_ca(i ,j,k,0));
+
262  Real fast_rhs_rho_u = -Gamma * R_d * pi_c * gpx;
+
263 
+
264  // We have already scaled the source terms to have the extra factor of dJ
+
265  cur_xmom(i,j,k) = h_zeta_old * prev_xmom(i,j,k) + dtau * fast_rhs_rho_u
+
266  + dtau * slow_rhs_rho_u(i,j,k);
+
267  },
+
268  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
269  {
+
270  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
+
271  Real h_eta_old = Compute_h_eta_AtJface(i, j, k, dxInv, z_nd_old);
+
272  Real h_zeta_old = Compute_h_zeta_AtJface(i, j, k, dxInv, z_nd_old);
+
273  Real gp_eta = (theta_extrap(i,j,k) -theta_extrap(i,j-1,k)) * dyi;
+
274  Real gp_zeta_on_jface = (k == 0) ?
+
275  0.5 * dzi * ( theta_extrap(i,j,k+1) + theta_extrap(i,j-1,k+1)
+
276  -theta_extrap(i,j,k ) - theta_extrap(i,j-1,k ) ) :
+
277  0.25 * dzi * ( theta_extrap(i,j,k+1) + theta_extrap(i,j-1,k+1)
+
278  -theta_extrap(i,j,k-1) - theta_extrap(i,j-1,k-1) );
+
279  Real gpy = h_zeta_old * gp_eta - h_eta_old * gp_zeta_on_jface;
+
280  gpy *= mf_v(i,j,0);
+
281 
+
282  if (l_use_moisture) {
+
283  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i,j-1,k,PrimQ1_comp)
+
284  +prim(i,j,k,PrimQ2_comp) + prim(i,j-1,k,PrimQ2_comp) );
+
285  gpy /= (1.0 + q);
+
286  }
287 
-
288  // We have already scaled the source terms to have the extra factor of dJ
-
289  cur_ymom(i, j, k) = h_zeta_old * prev_ymom(i,j,k) + dtau * fast_rhs_rho_v
-
290  + dtau * slow_rhs_rho_v(i,j,k);
-
291  });
-
292  } // end profile
-
293 
-
294  // *************************************************************************
-
295  // Define flux arrays for use in advection
-
296  // *************************************************************************
-
297  for (int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
-
298  flux[dir].resize(surroundingNodes(bx,dir),2);
-
299  flux[dir].setVal<RunOn::Device>(0.);
-
300  }
-
301  const GpuArray<const Array4<Real>, AMREX_SPACEDIM>
-
302  flx_arr{{AMREX_D_DECL(flux[0].array(), flux[1].array(), flux[2].array())}};
-
303 
-
304  // *********************************************************************
-
305  {
-
306  BL_PROFILE("fast_T_making_rho_rhs");
-
307  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
+
288  Real pi_c = 0.5 * (pi_stage_ca(i,j-1,k,0) + pi_stage_ca(i,j ,k,0));
+
289  Real fast_rhs_rho_v = -Gamma * R_d * pi_c * gpy;
+
290 
+
291  // We have already scaled the source terms to have the extra factor of dJ
+
292  cur_ymom(i, j, k) = h_zeta_old * prev_ymom(i,j,k) + dtau * fast_rhs_rho_v
+
293  + dtau * slow_rhs_rho_v(i,j,k);
+
294  });
+
295  } // end profile
+
296 
+
297  // *************************************************************************
+
298  // Define flux arrays for use in advection
+
299  // *************************************************************************
+
300  for (int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
+
301  flux[dir].resize(surroundingNodes(bx,dir),2);
+
302  flux[dir].setVal<RunOn::Device>(0.);
+
303  }
+
304  const GpuArray<const Array4<Real>, AMREX_SPACEDIM>
+
305  flx_arr{{AMREX_D_DECL(flux[0].array(), flux[1].array(), flux[2].array())}};
+
306 
+
307  // *********************************************************************
308  {
-
309  Real h_zeta_stg_xlo = Compute_h_zeta_AtIface(i, j , k, dxInv, z_nd_stg);
-
310  Real h_zeta_stg_xhi = Compute_h_zeta_AtIface(i+1,j , k, dxInv, z_nd_stg);
-
311  Real xflux_lo = cur_xmom(i ,j,k) - stg_xmom(i ,j,k)*h_zeta_stg_xlo;
-
312  Real xflux_hi = cur_xmom(i+1,j,k) - stg_xmom(i+1,j,k)*h_zeta_stg_xhi;
-
313 
-
314  Real h_zeta_stg_yhi = Compute_h_zeta_AtJface(i, j+1, k, dxInv, z_nd_stg);
-
315  Real h_zeta_stg_ylo = Compute_h_zeta_AtJface(i, j , k, dxInv, z_nd_stg);
-
316  Real yflux_lo = cur_ymom(i,j ,k) - stg_ymom(i,j ,k)*h_zeta_stg_ylo;
-
317  Real yflux_hi = cur_ymom(i,j+1,k) - stg_ymom(i,j+1,k)*h_zeta_stg_yhi;
-
318 
-
319  // NOTE: we are saving the (1/J) weighting for later when we add this to rho and theta
-
320  temp_rhs_arr(i,j,k,0) = ( xflux_hi - xflux_lo ) * dxi + ( yflux_hi - yflux_lo ) * dyi;
-
321  temp_rhs_arr(i,j,k,1) = (( xflux_hi * (prim(i,j,k,0) + prim(i+1,j,k,0)) -
-
322  xflux_lo * (prim(i,j,k,0) + prim(i-1,j,k,0)) ) * dxi +
-
323  ( yflux_hi * (prim(i,j,k,0) + prim(i,j+1,k,0)) -
-
324  yflux_lo * (prim(i,j,k,0) + prim(i,j-1,k,0)) ) * dyi) * 0.5;
-
325 
-
326  (flx_arr[0])(i,j,k,0) = xflux_lo;
-
327  (flx_arr[0])(i,j,k,1) = (flx_arr[0])(i ,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i-1,j,k,0));
+
309  BL_PROFILE("fast_T_making_rho_rhs");
+
310  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
+
311  {
+
312  Real h_zeta_stg_xlo = Compute_h_zeta_AtIface(i, j , k, dxInv, z_nd_stg);
+
313  Real h_zeta_stg_xhi = Compute_h_zeta_AtIface(i+1,j , k, dxInv, z_nd_stg);
+
314  Real xflux_lo = cur_xmom(i ,j,k) - stg_xmom(i ,j,k)*h_zeta_stg_xlo;
+
315  Real xflux_hi = cur_xmom(i+1,j,k) - stg_xmom(i+1,j,k)*h_zeta_stg_xhi;
+
316 
+
317  Real h_zeta_stg_yhi = Compute_h_zeta_AtJface(i, j+1, k, dxInv, z_nd_stg);
+
318  Real h_zeta_stg_ylo = Compute_h_zeta_AtJface(i, j , k, dxInv, z_nd_stg);
+
319  Real yflux_lo = cur_ymom(i,j ,k) - stg_ymom(i,j ,k)*h_zeta_stg_ylo;
+
320  Real yflux_hi = cur_ymom(i,j+1,k) - stg_ymom(i,j+1,k)*h_zeta_stg_yhi;
+
321 
+
322  // NOTE: we are saving the (1/J) weighting for later when we add this to rho and theta
+
323  temp_rhs_arr(i,j,k,0) = ( xflux_hi - xflux_lo ) * dxi + ( yflux_hi - yflux_lo ) * dyi;
+
324  temp_rhs_arr(i,j,k,1) = (( xflux_hi * (prim(i,j,k,0) + prim(i+1,j,k,0)) -
+
325  xflux_lo * (prim(i,j,k,0) + prim(i-1,j,k,0)) ) * dxi +
+
326  ( yflux_hi * (prim(i,j,k,0) + prim(i,j+1,k,0)) -
+
327  yflux_lo * (prim(i,j,k,0) + prim(i,j-1,k,0)) ) * dyi) * 0.5;
328 
-
329  (flx_arr[1])(i,j,k,0) = yflux_lo;
-
330  (flx_arr[1])(i,j,k,1) = (flx_arr[0])(i,j ,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j-1,k,0));
+
329  (flx_arr[0])(i,j,k,0) = xflux_lo;
+
330  (flx_arr[0])(i,j,k,1) = (flx_arr[0])(i ,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i-1,j,k,0));
331 
-
332  if (i == vbx_hi.x) {
-
333  (flx_arr[0])(i+1,j,k,0) = xflux_hi;
-
334  (flx_arr[0])(i+1,j,k,1) = (flx_arr[0])(i+1,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i+1,j,k,0));
-
335  }
-
336  if (j == vbx_hi.y) {
-
337  (flx_arr[1])(i,j+1,k,0) = yflux_hi;
-
338  (flx_arr[1])(i,j+1,k,1) = (flx_arr[1])(i,j+1,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j+1,k,0));
-
339  }
-
340  });
-
341  } // end profile
-
342 
-
343  // *********************************************************************
-
344  // This must be done before we set cur_xmom and cur_ymom, since those
-
345  // in fact point to the same array as prev_xmom and prev_ymom
+
332  (flx_arr[1])(i,j,k,0) = yflux_lo;
+
333  (flx_arr[1])(i,j,k,1) = (flx_arr[0])(i,j ,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j-1,k,0));
+
334 
+
335  if (i == vbx_hi.x) {
+
336  (flx_arr[0])(i+1,j,k,0) = xflux_hi;
+
337  (flx_arr[0])(i+1,j,k,1) = (flx_arr[0])(i+1,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i+1,j,k,0));
+
338  }
+
339  if (j == vbx_hi.y) {
+
340  (flx_arr[1])(i,j+1,k,0) = yflux_hi;
+
341  (flx_arr[1])(i,j+1,k,1) = (flx_arr[1])(i,j+1,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j+1,k,0));
+
342  }
+
343  });
+
344  } // end profile
+
345 
346  // *********************************************************************
-
347  Box gbxo = mfi.nodaltilebox(2);
-
348  {
-
349  BL_PROFILE("fast_MT_making_omega");
-
350  Box gbxo_lo = gbxo; gbxo_lo.setBig(2,0);
-
351  ParallelFor(gbxo_lo, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
352  omega_arr(i,j,k) = 0.;
-
353  });
-
354  Box gbxo_hi = gbxo; gbxo_hi.setSmall(2,gbxo.bigEnd(2));
-
355  ParallelFor(gbxo_hi, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
356  omega_arr(i,j,k) = prev_zmom(i,j,k) - stg_zmom(i,j,k) - zp_t_arr(i,j,k);
-
357  });
-
358  Box gbxo_mid = gbxo; gbxo_mid.setSmall(2,1); gbxo_mid.setBig(2,gbxo.bigEnd(2)-1);
-
359  ParallelFor(gbxo_mid, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
360  omega_arr(i,j,k) =
-
361  (OmegaFromW(i,j,k,prev_zmom(i,j,k),prev_xmom,prev_ymom,z_nd_old,dxInv)
-
362  -OmegaFromW(i,j,k, stg_zmom(i,j,k), stg_xmom, stg_ymom,z_nd_old,dxInv)) - zp_t_arr(i,j,k);
-
363  });
-
364  } // end profile
-
365  // *********************************************************************
-
366 
-
367  ParallelFor(tbx, tby,
-
368  [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
369  {
-
370  Real h_zeta_new = Compute_h_zeta_AtIface(i, j, k, dxInv, z_nd_new);
-
371  cur_xmom(i, j, k) /= h_zeta_new;
-
372  avg_xmom(i,j,k) += facinv*(cur_xmom(i,j,k) - stg_xmom(i,j,k));
-
373  },
-
374  [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
375  {
-
376  Real h_zeta_new = Compute_h_zeta_AtJface(i, j, k, dxInv, z_nd_new);
-
377  cur_ymom(i, j, k) /= h_zeta_new;
-
378  avg_ymom(i,j,k) += facinv*(cur_ymom(i,j,k) - stg_ymom(i,j,k));
-
379  });
-
380 
-
381  Box bx_shrunk_in_k = bx;
-
382  int klo = tbz.smallEnd(2);
-
383  int khi = tbz.bigEnd(2);
-
384  bx_shrunk_in_k.setSmall(2,klo+1);
-
385  bx_shrunk_in_k.setBig(2,khi-1);
-
386 
-
387  // Note that the notes use "g" to mean the magnitude of gravity, so it is positive
-
388  // We set grav_gpu[2] to be the vector component which is negative
-
389  // We define halfg to match the notes (which is why we take the absolute value)
-
390  Real halfg = std::abs(0.5 * grav_gpu[2]);
-
391 
-
392  {
-
393  BL_PROFILE("fast_loop_on_shrunk_t");
-
394  //Note we don't act on the bottom or top boundaries of the domain
-
395  ParallelFor(bx_shrunk_in_k, [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
396  {
-
397  Real dJ_old_kface = 0.5 * (detJ_old(i,j,k) + detJ_old(i,j,k-1));
-
398  Real dJ_new_kface = 0.5 * (detJ_new(i,j,k) + detJ_new(i,j,k-1));
-
399  Real dJ_stg_kface = 0.5 * (detJ_stg(i,j,k) + detJ_stg(i,j,k-1));
-
400 
-
401  Real coeff_P = coeffP_a(i,j,k);
-
402  Real coeff_Q = coeffQ_a(i,j,k);
+
347  // This must be done before we set cur_xmom and cur_ymom, since those
+
348  // in fact point to the same array as prev_xmom and prev_ymom
+
349  // *********************************************************************
+
350  Box gbxo = mfi.nodaltilebox(2);
+
351  {
+
352  BL_PROFILE("fast_MT_making_omega");
+
353  Box gbxo_lo = gbxo; gbxo_lo.setBig(2,0);
+
354  ParallelFor(gbxo_lo, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
355  omega_arr(i,j,k) = 0.;
+
356  });
+
357  Box gbxo_hi = gbxo; gbxo_hi.setSmall(2,gbxo.bigEnd(2));
+
358  ParallelFor(gbxo_hi, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
359  omega_arr(i,j,k) = prev_zmom(i,j,k) - stg_zmom(i,j,k) - zp_t_arr(i,j,k);
+
360  });
+
361  Box gbxo_mid = gbxo; gbxo_mid.setSmall(2,1); gbxo_mid.setBig(2,gbxo.bigEnd(2)-1);
+
362  ParallelFor(gbxo_mid, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
363  omega_arr(i,j,k) =
+
364  (OmegaFromW(i,j,k,prev_zmom(i,j,k),prev_xmom,prev_ymom,z_nd_old,dxInv)
+
365  -OmegaFromW(i,j,k, stg_zmom(i,j,k), stg_xmom, stg_ymom,z_nd_old,dxInv)) - zp_t_arr(i,j,k);
+
366  });
+
367  } // end profile
+
368  // *********************************************************************
+
369 
+
370  ParallelFor(tbx, tby,
+
371  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
372  {
+
373  Real h_zeta_new = Compute_h_zeta_AtIface(i, j, k, dxInv, z_nd_new);
+
374  cur_xmom(i, j, k) /= h_zeta_new;
+
375  avg_xmom(i,j,k) += facinv*(cur_xmom(i,j,k) - stg_xmom(i,j,k));
+
376  },
+
377  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
378  {
+
379  Real h_zeta_new = Compute_h_zeta_AtJface(i, j, k, dxInv, z_nd_new);
+
380  cur_ymom(i, j, k) /= h_zeta_new;
+
381  avg_ymom(i,j,k) += facinv*(cur_ymom(i,j,k) - stg_ymom(i,j,k));
+
382  });
+
383 
+
384  Box bx_shrunk_in_k = bx;
+
385  int klo = tbz.smallEnd(2);
+
386  int khi = tbz.bigEnd(2);
+
387  bx_shrunk_in_k.setSmall(2,klo+1);
+
388  bx_shrunk_in_k.setBig(2,khi-1);
+
389 
+
390  // Note that the notes use "g" to mean the magnitude of gravity, so it is positive
+
391  // We set grav_gpu[2] to be the vector component which is negative
+
392  // We define halfg to match the notes (which is why we take the absolute value)
+
393  Real halfg = std::abs(0.5 * grav_gpu[2]);
+
394 
+
395  {
+
396  BL_PROFILE("fast_loop_on_shrunk_t");
+
397  //Note we don't act on the bottom or top boundaries of the domain
+
398  ParallelFor(bx_shrunk_in_k, [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
399  {
+
400  Real dJ_old_kface = 0.5 * (detJ_old(i,j,k) + detJ_old(i,j,k-1));
+
401  Real dJ_new_kface = 0.5 * (detJ_new(i,j,k) + detJ_new(i,j,k-1));
+
402  Real dJ_stg_kface = 0.5 * (detJ_stg(i,j,k) + detJ_stg(i,j,k-1));
403 
-
404  if (l_use_moisture) {
-
405  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i,j,k-1,PrimQ1_comp)
-
406  +prim(i,j,k,PrimQ2_comp) + prim(i,j,k-1,PrimQ2_comp) );
-
407  coeff_P /= (1.0 + q);
-
408  coeff_Q /= (1.0 + q);
-
409  }
-
410 
-
411  Real theta_t_lo = 0.5 * ( prim(i,j,k-2,PrimTheta_comp) + prim(i,j,k-1,PrimTheta_comp) );
-
412  Real theta_t_mid = 0.5 * ( prim(i,j,k-1,PrimTheta_comp) + prim(i,j,k ,PrimTheta_comp) );
-
413  Real theta_t_hi = 0.5 * ( prim(i,j,k ,PrimTheta_comp) + prim(i,j,k+1,PrimTheta_comp) );
-
414 
-
415  // line 2 last two terms (order dtau)
-
416  Real R0_tmp = coeff_P * cur_cons(i,j,k ,RhoTheta_comp) * dJ_old_kface
-
417  + coeff_Q * cur_cons(i,j,k-1,RhoTheta_comp) * dJ_old_kface
-
418  - coeff_P * stg_cons(i,j,k ,RhoTheta_comp) * dJ_stg_kface
-
419  - coeff_Q * stg_cons(i,j,k-1,RhoTheta_comp) * dJ_stg_kface
-
420  - halfg * ( cur_cons(i,j,k,Rho_comp) + cur_cons(i,j,k-1,Rho_comp) ) * dJ_old_kface
-
421  + halfg * ( stg_cons(i,j,k,Rho_comp) + stg_cons(i,j,k-1,Rho_comp) ) * dJ_stg_kface;
-
422 
-
423  // line 3 residuals (order dtau^2) 1.0 <-> beta_2
-
424  Real R1_tmp = - halfg * ( slow_rhs_cons(i,j,k ,Rho_comp) +
-
425  slow_rhs_cons(i,j,k-1,Rho_comp) )
-
426  + ( coeff_P * slow_rhs_cons(i,j,k ,RhoTheta_comp) +
-
427  coeff_Q * slow_rhs_cons(i,j,k-1,RhoTheta_comp) );
-
428 
-
429  Real Omega_kp1 = omega_arr(i,j,k+1);
-
430  Real Omega_k = omega_arr(i,j,k );
-
431  Real Omega_km1 = omega_arr(i,j,k-1);
-
432 
-
433  // consolidate lines 4&5 (order dtau^2)
-
434  R1_tmp += ( halfg ) *
-
435  ( beta_1 * dzi * (Omega_kp1 - Omega_km1) + temp_rhs_arr(i,j,k,Rho_comp) + temp_rhs_arr(i,j,k-1,Rho_comp));
-
436 
-
437  // consolidate lines 6&7 (order dtau^2)
-
438  R1_tmp += -(
-
439  coeff_P * ( beta_1 * dzi * (Omega_kp1*theta_t_hi - Omega_k*theta_t_mid) + temp_rhs_arr(i,j,k ,RhoTheta_comp) ) +
-
440  coeff_Q * ( beta_1 * dzi * (Omega_k*theta_t_mid - Omega_km1*theta_t_lo) + temp_rhs_arr(i,j,k-1,RhoTheta_comp) ) );
-
441 
-
442  // line 1
-
443  RHS_a(i,j,k) = dJ_old_kface * prev_zmom(i,j,k) - dJ_stg_kface * stg_zmom(i,j,k)
-
444  + dtau *(slow_rhs_rho_w(i,j,k) + R0_tmp + dtau*beta_2*R1_tmp );
-
445 
-
446  // We cannot use omega_arr here since that was built with old_rho_u and old_rho_v ...
-
447  Real UppVpp = dJ_new_kface * OmegaFromW(i,j,k,0.,cur_xmom,cur_ymom,z_nd_new,dxInv)
-
448  -dJ_stg_kface * OmegaFromW(i,j,k,0.,stg_xmom,stg_ymom,z_nd_stg,dxInv);
-
449  RHS_a(i,j,k) += UppVpp;
-
450  });
-
451  } // end profile
-
452 
-
453  Box b2d = tbz; // Copy constructor
-
454  b2d.setRange(2,0);
+
404  Real coeff_P = coeffP_a(i,j,k);
+
405  Real coeff_Q = coeffQ_a(i,j,k);
+
406 
+
407  if (l_use_moisture) {
+
408  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i,j,k-1,PrimQ1_comp)
+
409  +prim(i,j,k,PrimQ2_comp) + prim(i,j,k-1,PrimQ2_comp) );
+
410  coeff_P /= (1.0 + q);
+
411  coeff_Q /= (1.0 + q);
+
412  }
+
413 
+
414  Real theta_t_lo = 0.5 * ( prim(i,j,k-2,PrimTheta_comp) + prim(i,j,k-1,PrimTheta_comp) );
+
415  Real theta_t_mid = 0.5 * ( prim(i,j,k-1,PrimTheta_comp) + prim(i,j,k ,PrimTheta_comp) );
+
416  Real theta_t_hi = 0.5 * ( prim(i,j,k ,PrimTheta_comp) + prim(i,j,k+1,PrimTheta_comp) );
+
417 
+
418  // line 2 last two terms (order dtau)
+
419  Real R0_tmp = coeff_P * cur_cons(i,j,k ,RhoTheta_comp) * dJ_old_kface
+
420  + coeff_Q * cur_cons(i,j,k-1,RhoTheta_comp) * dJ_old_kface
+
421  - coeff_P * stg_cons(i,j,k ,RhoTheta_comp) * dJ_stg_kface
+
422  - coeff_Q * stg_cons(i,j,k-1,RhoTheta_comp) * dJ_stg_kface
+
423  - halfg * ( cur_cons(i,j,k,Rho_comp) + cur_cons(i,j,k-1,Rho_comp) ) * dJ_old_kface
+
424  + halfg * ( stg_cons(i,j,k,Rho_comp) + stg_cons(i,j,k-1,Rho_comp) ) * dJ_stg_kface;
+
425 
+
426  // line 3 residuals (order dtau^2) 1.0 <-> beta_2
+
427  Real R1_tmp = - halfg * ( slow_rhs_cons(i,j,k ,Rho_comp) +
+
428  slow_rhs_cons(i,j,k-1,Rho_comp) )
+
429  + ( coeff_P * slow_rhs_cons(i,j,k ,RhoTheta_comp) +
+
430  coeff_Q * slow_rhs_cons(i,j,k-1,RhoTheta_comp) );
+
431 
+
432  Real Omega_kp1 = omega_arr(i,j,k+1);
+
433  Real Omega_k = omega_arr(i,j,k );
+
434  Real Omega_km1 = omega_arr(i,j,k-1);
+
435 
+
436  // consolidate lines 4&5 (order dtau^2)
+
437  R1_tmp += ( halfg ) *
+
438  ( beta_1 * dzi * (Omega_kp1 - Omega_km1) + temp_rhs_arr(i,j,k,Rho_comp) + temp_rhs_arr(i,j,k-1,Rho_comp));
+
439 
+
440  // consolidate lines 6&7 (order dtau^2)
+
441  R1_tmp += -(
+
442  coeff_P * ( beta_1 * dzi * (Omega_kp1*theta_t_hi - Omega_k*theta_t_mid) + temp_rhs_arr(i,j,k ,RhoTheta_comp) ) +
+
443  coeff_Q * ( beta_1 * dzi * (Omega_k*theta_t_mid - Omega_km1*theta_t_lo) + temp_rhs_arr(i,j,k-1,RhoTheta_comp) ) );
+
444 
+
445  // line 1
+
446  RHS_a(i,j,k) = dJ_old_kface * prev_zmom(i,j,k) - dJ_stg_kface * stg_zmom(i,j,k)
+
447  + dtau *(slow_rhs_rho_w(i,j,k) + R0_tmp + dtau*beta_2*R1_tmp );
+
448 
+
449  // We cannot use omega_arr here since that was built with old_rho_u and old_rho_v ...
+
450  Real UppVpp = dJ_new_kface * OmegaFromW(i,j,k,0.,cur_xmom,cur_ymom,z_nd_new,dxInv)
+
451  -dJ_stg_kface * OmegaFromW(i,j,k,0.,stg_xmom,stg_ymom,z_nd_stg,dxInv);
+
452  RHS_a(i,j,k) += UppVpp;
+
453  });
+
454  } // end profile
455 
-
456  auto const lo = lbound(bx);
-
457  auto const hi = ubound(bx);
+
456  Box b2d = tbz; // Copy constructor
+
457  b2d.setRange(2,0);
458 
-
459  {
-
460  BL_PROFILE("fast_rhs_b2d_loop_t");
+
459  auto const lo = lbound(bx);
+
460  auto const hi = ubound(bx);
461 
-
462 #ifdef AMREX_USE_GPU
-
463  ParallelFor(b2d, [=] AMREX_GPU_DEVICE (int i, int j, int)
-
464  {
-
465  // Moving terrain
-
466  Real rho_on_bdy = 0.5 * ( prev_cons(i,j,lo.z) + prev_cons(i,j,lo.z-1) );
-
467  RHS_a(i,j,lo.z) = rho_on_bdy * zp_t_arr(i,j,0);
-
468 
-
469  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
-
470 
-
471  // w_khi = 0
-
472  RHS_a(i,j,hi.z+1) = 0.0;
+
462  {
+
463  BL_PROFILE("fast_rhs_b2d_loop_t");
+
464 
+
465 #ifdef AMREX_USE_GPU
+
466  ParallelFor(b2d, [=] AMREX_GPU_DEVICE (int i, int j, int)
+
467  {
+
468  // Moving terrain
+
469  Real rho_on_bdy = 0.5 * ( prev_cons(i,j,lo.z) + prev_cons(i,j,lo.z-1) );
+
470  RHS_a(i,j,lo.z) = rho_on_bdy * zp_t_arr(i,j,0);
+
471 
+
472  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
473 
-
474  for (int k = lo.z+1; k <= hi.z+1; k++) {
-
475  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
-
476  }
-
477 
-
478  for (int k = hi.z; k >= lo.z; k--) {
-
479  soln_a(i,j,k) -= ( coeffC_a(i,j,k) * inv_coeffB_a(i,j,k) ) * soln_a(i,j,k+1);
-
480  }
-
481 
-
482  // We assume that Omega == w at the top boundary and that changes in J there are irrelevant
-
483  cur_zmom(i,j,hi.z+1) = stg_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
-
484  });
-
485 #else
-
486  for (int j = lo.y; j <= hi.y; ++j) {
-
487  AMREX_PRAGMA_SIMD
-
488  for (int i = lo.x; i <= hi.x; ++i) {
-
489 
-
490  Real rho_on_bdy = 0.5 * ( prev_cons(i,j,lo.z) + prev_cons(i,j,lo.z-1) );
-
491  RHS_a(i,j,lo.z) = rho_on_bdy * zp_t_arr(i,j,lo.z);
+
474  // w_khi = 0
+
475  RHS_a(i,j,hi.z+1) = 0.0;
+
476 
+
477  for (int k = lo.z+1; k <= hi.z+1; k++) {
+
478  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
+
479  }
+
480 
+
481  for (int k = hi.z; k >= lo.z; k--) {
+
482  soln_a(i,j,k) -= ( coeffC_a(i,j,k) * inv_coeffB_a(i,j,k) ) * soln_a(i,j,k+1);
+
483  }
+
484 
+
485  // We assume that Omega == w at the top boundary and that changes in J there are irrelevant
+
486  cur_zmom(i,j,hi.z+1) = stg_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
+
487  });
+
488 #else
+
489  for (int j = lo.y; j <= hi.y; ++j) {
+
490  AMREX_PRAGMA_SIMD
+
491  for (int i = lo.x; i <= hi.x; ++i) {
492 
-
493  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
-
494  }
-
495  }
-
496 
-
497  for (int j = lo.y; j <= hi.y; ++j) {
-
498  AMREX_PRAGMA_SIMD
-
499  for (int i = lo.x; i <= hi.x; ++i) {
-
500  RHS_a (i,j,hi.z+1) = 0.0;
-
501  }
-
502  }
-
503  for (int k = lo.z+1; k <= hi.z+1; ++k) {
-
504  for (int j = lo.y; j <= hi.y; ++j) {
-
505  AMREX_PRAGMA_SIMD
-
506  for (int i = lo.x; i <= hi.x; ++i) {
-
507  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
-
508  }
-
509  }
-
510  }
-
511  for (int k = hi.z; k >= lo.z; --k) {
-
512  for (int j = lo.y; j <= hi.y; ++j) {
-
513  AMREX_PRAGMA_SIMD
-
514  for (int i = lo.x; i <= hi.x; ++i) {
-
515  soln_a(i,j,k) -= ( coeffC_a(i,j,k) * inv_coeffB_a(i,j,k) ) * soln_a(i,j,k+1);
-
516  }
-
517  }
-
518  }
-
519 
-
520  // We assume that Omega == w at the top boundary and that changes in J there are irrelevant
-
521  for (int j = lo.y; j <= hi.y; ++j) {
-
522  AMREX_PRAGMA_SIMD
-
523  for (int i = lo.x; i <= hi.x; ++i) {
-
524  cur_zmom(i,j,hi.z+1) = stg_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
-
525  }
-
526  }
-
527 #endif
-
528  } // end profile
-
529 
-
530  {
-
531  BL_PROFILE("fast_rhs_new_drhow");
-
532  tbz.setBig(2,hi.z);
-
533  ParallelFor(tbz, [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
534  {
-
535  Real rho_on_face = 0.5 * (cur_cons(i,j,k,Rho_comp) + cur_cons(i,j,k-1,Rho_comp));
-
536 
-
537  if (k == lo.z) {
-
538  cur_zmom(i,j,k) = WFromOmega(i,j,k,rho_on_face*(z_t_arr(i,j,k)+zp_t_arr(i,j,k)),
-
539  cur_xmom,cur_ymom,z_nd_new,dxInv);
-
540 
-
541  // We need to set this here because it is used to define zflux_lo below
-
542  soln_a(i,j,k) = 0.;
+
493  Real rho_on_bdy = 0.5 * ( prev_cons(i,j,lo.z) + prev_cons(i,j,lo.z-1) );
+
494  RHS_a(i,j,lo.z) = rho_on_bdy * zp_t_arr(i,j,lo.z);
+
495 
+
496  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
+
497  }
+
498  }
+
499 
+
500  for (int j = lo.y; j <= hi.y; ++j) {
+
501  AMREX_PRAGMA_SIMD
+
502  for (int i = lo.x; i <= hi.x; ++i) {
+
503  RHS_a (i,j,hi.z+1) = 0.0;
+
504  }
+
505  }
+
506  for (int k = lo.z+1; k <= hi.z+1; ++k) {
+
507  for (int j = lo.y; j <= hi.y; ++j) {
+
508  AMREX_PRAGMA_SIMD
+
509  for (int i = lo.x; i <= hi.x; ++i) {
+
510  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
+
511  }
+
512  }
+
513  }
+
514  for (int k = hi.z; k >= lo.z; --k) {
+
515  for (int j = lo.y; j <= hi.y; ++j) {
+
516  AMREX_PRAGMA_SIMD
+
517  for (int i = lo.x; i <= hi.x; ++i) {
+
518  soln_a(i,j,k) -= ( coeffC_a(i,j,k) * inv_coeffB_a(i,j,k) ) * soln_a(i,j,k+1);
+
519  }
+
520  }
+
521  }
+
522 
+
523  // We assume that Omega == w at the top boundary and that changes in J there are irrelevant
+
524  for (int j = lo.y; j <= hi.y; ++j) {
+
525  AMREX_PRAGMA_SIMD
+
526  for (int i = lo.x; i <= hi.x; ++i) {
+
527  cur_zmom(i,j,hi.z+1) = stg_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
+
528  }
+
529  }
+
530 #endif
+
531  } // end profile
+
532 
+
533  {
+
534  BL_PROFILE("fast_rhs_new_drhow");
+
535  tbz.setBig(2,hi.z);
+
536  ParallelFor(tbz, [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
537  {
+
538  Real rho_on_face = 0.5 * (cur_cons(i,j,k,Rho_comp) + cur_cons(i,j,k-1,Rho_comp));
+
539 
+
540  if (k == lo.z) {
+
541  cur_zmom(i,j,k) = WFromOmega(i,j,k,rho_on_face*(z_t_arr(i,j,k)+zp_t_arr(i,j,k)),
+
542  cur_xmom,cur_ymom,z_nd_new,dxInv);
543 
-
544  } else {
-
545 
-
546  Real UppVpp = WFromOmega(i,j,k,0.0,cur_xmom,cur_ymom,z_nd_new,dxInv)
-
547  -WFromOmega(i,j,k,0.0,stg_xmom,stg_ymom,z_nd_stg,dxInv);
-
548  Real wpp = soln_a(i,j,k) + UppVpp;
-
549  Real dJ_old_kface = 0.5 * (detJ_old(i,j,k) + detJ_old(i,j,k-1));
-
550  Real dJ_new_kface = 0.5 * (detJ_new(i,j,k) + detJ_new(i,j,k-1));
-
551 
-
552  cur_zmom(i,j,k) = dJ_old_kface * (stg_zmom(i,j,k) + wpp);
-
553  cur_zmom(i,j,k) /= dJ_new_kface;
+
544  // We need to set this here because it is used to define zflux_lo below
+
545  soln_a(i,j,k) = 0.;
+
546 
+
547  } else {
+
548 
+
549  Real UppVpp = WFromOmega(i,j,k,0.0,cur_xmom,cur_ymom,z_nd_new,dxInv)
+
550  -WFromOmega(i,j,k,0.0,stg_xmom,stg_ymom,z_nd_stg,dxInv);
+
551  Real wpp = soln_a(i,j,k) + UppVpp;
+
552  Real dJ_old_kface = 0.5 * (detJ_old(i,j,k) + detJ_old(i,j,k-1));
+
553  Real dJ_new_kface = 0.5 * (detJ_new(i,j,k) + detJ_new(i,j,k-1));
554 
-
555  soln_a(i,j,k) = OmegaFromW(i,j,k,cur_zmom(i,j,k),cur_xmom,cur_ymom,z_nd_new,dxInv)
-
556  - OmegaFromW(i,j,k,stg_zmom(i,j,k),stg_xmom,stg_ymom,z_nd_stg,dxInv);
-
557  soln_a(i,j,k) -= rho_on_face * zp_t_arr(i,j,k);
-
558  }
-
559  });
-
560  } // end profile
-
561 
-
562  // **************************************************************************
-
563  // Define updates in the RHS of rho and (rho theta)
-
564  // **************************************************************************
-
565  {
-
566  BL_PROFILE("fast_rho_final_update");
-
567  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
+
555  cur_zmom(i,j,k) = dJ_old_kface * (stg_zmom(i,j,k) + wpp);
+
556  cur_zmom(i,j,k) /= dJ_new_kface;
+
557 
+
558  soln_a(i,j,k) = OmegaFromW(i,j,k,cur_zmom(i,j,k),cur_xmom,cur_ymom,z_nd_new,dxInv)
+
559  - OmegaFromW(i,j,k,stg_zmom(i,j,k),stg_xmom,stg_ymom,z_nd_stg,dxInv);
+
560  soln_a(i,j,k) -= rho_on_face * zp_t_arr(i,j,k);
+
561  }
+
562  });
+
563  } // end profile
+
564 
+
565  // **************************************************************************
+
566  // Define updates in the RHS of rho and (rho theta)
+
567  // **************************************************************************
568  {
-
569  Real zflux_lo = beta_2 * soln_a(i,j,k ) + beta_1 * omega_arr(i,j,k);
-
570  Real zflux_hi = beta_2 * soln_a(i,j,k+1) + beta_1 * omega_arr(i,j,k+1);
-
571 
-
572  // Note that in the solve we effectively impose new_drho_w(i,j,vbx_hi.z+1)=0
-
573  // so we don't update avg_zmom at k=vbx_hi.z+1
-
574  avg_zmom(i,j,k) += facinv*zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
-
575  (flx_arr[2])(i,j,k,0) = zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
-
576 
-
577  // Note that the factor of (1/J) in the fast source term is canceled
-
578  // when we multiply old and new by detJ_old and detJ_new , respectively
-
579  // We have already scaled the slow source term to have the extra factor of dJ
-
580  Real fast_rhs_rho = -(temp_rhs_arr(i,j,k,0) + ( zflux_hi - zflux_lo ) * dzi);
-
581  Real temp_rho = detJ_old(i,j,k) * cur_cons(i,j,k,0) +
-
582  dtau * ( slow_rhs_cons(i,j,k,0) + fast_rhs_rho );
-
583  cur_cons(i,j,k,0) = temp_rho / detJ_new(i,j,k);
-
584 
-
585  // Note that the factor of (1/J) in the fast source term is canceled
-
586  // when we multiply old and new by detJ_old and detJ_new , respectively
-
587  // We have already scaled the slow source term to have the extra factor of dJ
-
588  Real fast_rhs_rhotheta = -( temp_rhs_arr(i,j,k,1) + 0.5 *
-
589  ( zflux_hi * (prim(i,j,k) + prim(i,j,k+1))
-
590  - zflux_lo * (prim(i,j,k) + prim(i,j,k-1)) ) * dzi );
-
591  Real temp_rth = detJ_old(i,j,k) * cur_cons(i,j,k,1) +
-
592  dtau * ( slow_rhs_cons(i,j,k,1) + fast_rhs_rhotheta );
-
593  cur_cons(i,j,k,1) = temp_rth / detJ_new(i,j,k);
-
594  (flx_arr[2])(i,j,k,1) = (flx_arr[2])(i,j,k,0) * 0.5 * (prim(i,j,k) + prim(i,j,k-1));
-
595 
-
596  if (k == vbx_hi.z) {
-
597  avg_zmom(i,j,k+1) += facinv * zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
-
598  (flx_arr[2])(i,j,k+1,0) = zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
-
599  (flx_arr[2])(i,j,k+1,1) = (flx_arr[2])(i,j,k+1,0) * 0.5 * (prim(i,j,k) + prim(i,j,k+1));
-
600  }
-
601  });
-
602  } // end profile
-
603 
-
604  // We only add to the flux registers in the final RK step
-
605  if (l_reflux && nrk == 2) {
-
606  int strt_comp_reflux = 0;
-
607  int num_comp_reflux = 2;
-
608  if (level < finest_level) {
-
609  fr_as_crse->CrseAdd(mfi,
-
610  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
-
611  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
-
612  }
-
613  if (level > 0) {
-
614  fr_as_fine->FineAdd(mfi,
-
615  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
-
616  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
-
617  }
-
618 
-
619  // This is necessary here so we don't go on to the next FArrayBox without
-
620  // having finished copying the fluxes into the FluxRegisters (since the fluxes
-
621  // are stored in temporary FArrayBox's)
-
622  Gpu::streamSynchronize();
-
623 
-
624  } // two-way coupling
-
625 
-
626  } // mfi
-
627  } // OMP
-
628 }
+
569  BL_PROFILE("fast_rho_final_update");
+
570  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
+
571  {
+
572  Real zflux_lo = beta_2 * soln_a(i,j,k ) + beta_1 * omega_arr(i,j,k);
+
573  Real zflux_hi = beta_2 * soln_a(i,j,k+1) + beta_1 * omega_arr(i,j,k+1);
+
574 
+
575  // Note that in the solve we effectively impose new_drho_w(i,j,vbx_hi.z+1)=0
+
576  // so we don't update avg_zmom at k=vbx_hi.z+1
+
577  avg_zmom(i,j,k) += facinv*zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
+
578  (flx_arr[2])(i,j,k,0) = zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
+
579 
+
580  // Note that the factor of (1/J) in the fast source term is canceled
+
581  // when we multiply old and new by detJ_old and detJ_new , respectively
+
582  // We have already scaled the slow source term to have the extra factor of dJ
+
583  Real fast_rhs_rho = -(temp_rhs_arr(i,j,k,0) + ( zflux_hi - zflux_lo ) * dzi);
+
584  Real temp_rho = detJ_old(i,j,k) * cur_cons(i,j,k,0) +
+
585  dtau * ( slow_rhs_cons(i,j,k,0) + fast_rhs_rho );
+
586  cur_cons(i,j,k,0) = temp_rho / detJ_new(i,j,k);
+
587 
+
588  // Note that the factor of (1/J) in the fast source term is canceled
+
589  // when we multiply old and new by detJ_old and detJ_new , respectively
+
590  // We have already scaled the slow source term to have the extra factor of dJ
+
591  Real fast_rhs_rhotheta = -( temp_rhs_arr(i,j,k,1) + 0.5 *
+
592  ( zflux_hi * (prim(i,j,k) + prim(i,j,k+1))
+
593  - zflux_lo * (prim(i,j,k) + prim(i,j,k-1)) ) * dzi );
+
594  Real temp_rth = detJ_old(i,j,k) * cur_cons(i,j,k,1) +
+
595  dtau * ( slow_rhs_cons(i,j,k,1) + fast_rhs_rhotheta );
+
596  cur_cons(i,j,k,1) = temp_rth / detJ_new(i,j,k);
+
597  (flx_arr[2])(i,j,k,1) = (flx_arr[2])(i,j,k,0) * 0.5 * (prim(i,j,k) + prim(i,j,k-1));
+
598 
+
599  if (k == vbx_hi.z) {
+
600  avg_zmom(i,j,k+1) += facinv * zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
+
601  (flx_arr[2])(i,j,k+1,0) = zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
+
602  (flx_arr[2])(i,j,k+1,1) = (flx_arr[2])(i,j,k+1,0) * 0.5 * (prim(i,j,k) + prim(i,j,k+1));
+
603  }
+
604  });
+
605  } // end profile
+
606 
+
607  // We only add to the flux registers in the final RK step
+
608  if (l_reflux && nrk == 2) {
+
609  int strt_comp_reflux = 0;
+
610  int num_comp_reflux = 2;
+
611  if (level < finest_level) {
+
612  fr_as_crse->CrseAdd(mfi,
+
613  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
+
614  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
+
615  }
+
616  if (level > 0) {
+
617  fr_as_fine->FineAdd(mfi,
+
618  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
+
619  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
+
620  }
+
621 
+
622  // This is necessary here so we don't go on to the next FArrayBox without
+
623  // having finished copying the fluxes into the FluxRegisters (since the fluxes
+
624  // are stored in temporary FArrayBox's)
+
625  Gpu::streamSynchronize();
+
626 
+
627  } // two-way coupling
+
628 
+
629  } // mfi
+
630  } // OMP
+
631 }
constexpr amrex::Real R_d
Definition: ERF_Constants.H:10
constexpr amrex::Real Gamma
Definition: ERF_Constants.H:19
#define PrimQ1_comp
Definition: ERF_IndexDefines.H:55
@@ -967,8 +975,8 @@

Here is the call graph for this function:

-
- +
+ diff --git a/ERF__fast__rhs__MT_8cpp.js b/ERF__fast__rhs__MT_8cpp.js index f2f8e27ed2..e685d38bef 100644 --- a/ERF__fast__rhs__MT_8cpp.js +++ b/ERF__fast__rhs__MT_8cpp.js @@ -1,4 +1,4 @@ var ERF__fast__rhs__MT_8cpp = [ - [ "erf_fast_rhs_MT", "ERF__fast__rhs__MT_8cpp.html#ab4d94ede74fb532475b186ed1cbbbfed", null ] + [ "erf_fast_rhs_MT", "ERF__fast__rhs__MT_8cpp.html#a526d3733938e64ccdcb7e99b2944b456", null ] ]; \ No newline at end of file diff --git a/ERF__fast__rhs__MT_8cpp_ab4d94ede74fb532475b186ed1cbbbfed_cgraph.map b/ERF__fast__rhs__MT_8cpp_a526d3733938e64ccdcb7e99b2944b456_cgraph.map similarity index 100% rename from ERF__fast__rhs__MT_8cpp_ab4d94ede74fb532475b186ed1cbbbfed_cgraph.map rename to ERF__fast__rhs__MT_8cpp_a526d3733938e64ccdcb7e99b2944b456_cgraph.map diff --git a/ERF__fast__rhs__MT_8cpp_ab4d94ede74fb532475b186ed1cbbbfed_cgraph.md5 b/ERF__fast__rhs__MT_8cpp_a526d3733938e64ccdcb7e99b2944b456_cgraph.md5 similarity index 100% rename from ERF__fast__rhs__MT_8cpp_ab4d94ede74fb532475b186ed1cbbbfed_cgraph.md5 rename to ERF__fast__rhs__MT_8cpp_a526d3733938e64ccdcb7e99b2944b456_cgraph.md5 diff --git a/ERF__fast__rhs__MT_8cpp_ab4d94ede74fb532475b186ed1cbbbfed_cgraph.png b/ERF__fast__rhs__MT_8cpp_a526d3733938e64ccdcb7e99b2944b456_cgraph.png similarity index 100% rename from ERF__fast__rhs__MT_8cpp_ab4d94ede74fb532475b186ed1cbbbfed_cgraph.png rename to ERF__fast__rhs__MT_8cpp_a526d3733938e64ccdcb7e99b2944b456_cgraph.png diff --git a/ERF__fast__rhs__N_8cpp.html b/ERF__fast__rhs__N_8cpp.html index 41d3352203..cb9fad3e09 100644 --- a/ERF__fast__rhs__N_8cpp.html +++ b/ERF__fast__rhs__N_8cpp.html @@ -133,12 +133,12 @@
- - + +

Functions

void erf_fast_rhs_N (int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
 
void erf_fast_rhs_N (int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
 

Function Documentation

-
-

◆ erf_fast_rhs_N()

+ +

◆ erf_fast_rhs_N()

@@ -285,7 +285,13 @@

bool  - l_reflux  + l_reflux, + + + + + bool  + l_implicit_substepping  @@ -302,7 +308,7 @@

[in]levellevel of resolution [in]finest_levelfinest level of resolution [in]S_slow_rhsslow RHS computed in erf_slow_rhs_pre - [in]S_prevprevious solution + [in]S_previf step == 0, this is S_old, else the previous fast solution [in]S_stage_datasolution at previous RK stage [in]S_stage_primprimitive variables at previous RK stage [in]pi_stageExner function at previous RK stage @@ -319,328 +325,327 @@

[in]mapfac_vmap factor at y-faces [in,out]fr_as_crseYAFluxRegister at level l at level l / l+1 interface [in,out]fr_as_fineYAFluxRegister at level l at level l-1 / l interface + [in]l_use_moisture [in]l_refluxshould we add fluxes to the FluxRegisters? + [in]l_implicit_substepping -
55 {
-
56  BL_PROFILE_REGION("erf_fast_rhs_N()");
-
57 
-
58  Real beta_1 = 0.5 * (1.0 - beta_s); // multiplies explicit terms
-
59  Real beta_2 = 0.5 * (1.0 + beta_s); // multiplies implicit terms
-
60 
-
61  // How much do we project forward the (rho theta) that is used in the horizontal momentum equations
-
62  Real beta_d = 0.1;
-
63 
-
64  const Real* dx = geom.CellSize();
-
65  const GpuArray<Real, AMREX_SPACEDIM> dxInv = geom.InvCellSizeArray();
-
66 
-
67  Real dxi = dxInv[0];
-
68  Real dyi = dxInv[1];
-
69  Real dzi = dxInv[2];
+
58 {
+
59  //
+
60  // NOTE: for step > 0, S_data and S_prev point to the same MultiFab data!!
+
61  //
+
62 
+
63  BL_PROFILE_REGION("erf_fast_rhs_N()");
+
64 
+
65  Real beta_1 = 0.5 * (1.0 - beta_s); // multiplies explicit terms
+
66  Real beta_2 = 0.5 * (1.0 + beta_s); // multiplies implicit terms
+
67 
+
68  // How much do we project forward the (rho theta) that is used in the horizontal momentum equations
+
69  Real beta_d = 0.1;
70 
-
71  const auto& ba = S_stage_data[IntVars::cons].boxArray();
-
72  const auto& dm = S_stage_data[IntVars::cons].DistributionMap();
+
71  const Real* dx = geom.CellSize();
+
72  const GpuArray<Real, AMREX_SPACEDIM> dxInv = geom.InvCellSizeArray();
73 
-
74  MultiFab Delta_rho_w( convert(ba,IntVect(0,0,1)), dm, 1, IntVect(1,1,0));
-
75  MultiFab Delta_rho ( ba , dm, 1, 1);
-
76  MultiFab Delta_rho_theta( ba , dm, 1, 1);
+
74  Real dxi = dxInv[0];
+
75  Real dyi = dxInv[1];
+
76  Real dzi = dxInv[2];
77 
-
78  MultiFab coeff_A_mf(fast_coeffs, make_alias, 0, 1);
-
79  MultiFab inv_coeff_B_mf(fast_coeffs, make_alias, 1, 1);
-
80  MultiFab coeff_C_mf(fast_coeffs, make_alias, 2, 1);
-
81  MultiFab coeff_P_mf(fast_coeffs, make_alias, 3, 1);
-
82  MultiFab coeff_Q_mf(fast_coeffs, make_alias, 4, 1);
+
78  const auto& ba = S_stage_data[IntVars::cons].boxArray();
+
79  const auto& dm = S_stage_data[IntVars::cons].DistributionMap();
+
80 
+
81  MultiFab Delta_rho_theta( ba , dm, 1, 1);
+
82  MultiFab Delta_rho_w (convert(ba,IntVect(0,0,1)), dm, 1, IntVect(1,1,0));
83 
-
84  // *************************************************************************
-
85  // Set gravity as a vector
-
86  const Array<Real,AMREX_SPACEDIM> grav{0.0, 0.0, -gravity};
-
87  const GpuArray<Real,AMREX_SPACEDIM> grav_gpu{grav[0], grav[1], grav[2]};
-
88 
-
89  // This will hold theta extrapolated forward in time
-
90  MultiFab extrap(S_data[IntVars::cons].boxArray(),S_data[IntVars::cons].DistributionMap(),1,1);
-
91 
-
92  // This will hold the update for (rho) and (rho theta)
-
93  MultiFab temp_rhs(S_stage_data[IntVars::zmom].boxArray(),S_stage_data[IntVars::zmom].DistributionMap(),2,0);
+
84  MultiFab coeff_A_mf(fast_coeffs, make_alias, 0, 1);
+
85  MultiFab inv_coeff_B_mf(fast_coeffs, make_alias, 1, 1);
+
86  MultiFab coeff_C_mf(fast_coeffs, make_alias, 2, 1);
+
87  MultiFab coeff_P_mf(fast_coeffs, make_alias, 3, 1);
+
88  MultiFab coeff_Q_mf(fast_coeffs, make_alias, 4, 1);
+
89 
+
90  // *************************************************************************
+
91  // Set gravity as a vector
+
92  const Array<Real,AMREX_SPACEDIM> grav{0.0, 0.0, -gravity};
+
93  const GpuArray<Real,AMREX_SPACEDIM> grav_gpu{grav[0], grav[1], grav[2]};
94 
-
95  // This will hold the new x- and y-momenta temporarily (so that we don't overwrite values we need when tiling)
-
96  MultiFab temp_cur_xmom(S_stage_data[IntVars::xmom].boxArray(),S_stage_data[IntVars::xmom].DistributionMap(),1,0);
-
97  MultiFab temp_cur_ymom(S_stage_data[IntVars::ymom].boxArray(),S_stage_data[IntVars::ymom].DistributionMap(),1,0);
-
98 
-
99  // *************************************************************************
-
100  // First set up some arrays we'll need
-
101  // *************************************************************************
-
102 
-
103 #ifdef _OPENMP
-
104 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
105 #endif
-
106  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
-
107  {
-
108  const Array4<Real> & cur_cons = S_data[IntVars::cons].array(mfi);
-
109  const Array4<const Real>& prev_cons = S_prev[IntVars::cons].const_array(mfi);
-
110  const Array4<const Real>& stage_cons = S_stage_data[IntVars::cons].const_array(mfi);
-
111  const Array4<Real>& lagged_delta_rt = S_scratch[IntVars::cons].array(mfi);
-
112 
-
113  const Array4<Real>& old_drho = Delta_rho.array(mfi);
-
114  const Array4<Real>& old_drho_w = Delta_rho_w.array(mfi);
-
115  const Array4<Real>& old_drho_theta = Delta_rho_theta.array(mfi);
-
116 
-
117  const Array4<const Real>& prev_zmom = S_prev[IntVars::zmom].const_array(mfi);
-
118  const Array4<const Real>& stage_zmom = S_stage_data[IntVars::zmom].const_array(mfi);
+
95  // This will hold theta extrapolated forward in time
+
96  MultiFab extrap(S_data[IntVars::cons].boxArray(),S_data[IntVars::cons].DistributionMap(),1,1);
+
97 
+
98  // This will hold the update for (rho) and (rho theta)
+
99  MultiFab temp_rhs(S_stage_data[IntVars::zmom].boxArray(),S_stage_data[IntVars::zmom].DistributionMap(),2,0);
+
100 
+
101  // This will hold the new x- and y-momenta temporarily (so that we don't overwrite values we need when tiling)
+
102  MultiFab temp_cur_xmom(S_stage_data[IntVars::xmom].boxArray(),S_stage_data[IntVars::xmom].DistributionMap(),1,0);
+
103  MultiFab temp_cur_ymom(S_stage_data[IntVars::ymom].boxArray(),S_stage_data[IntVars::ymom].DistributionMap(),1,0);
+
104 
+
105  // We assume that in the first step (nrk == 0) we are only doing one substep.
+
106  AMREX_ALWAYS_ASSERT(nrk > 0 || step == 0);
+
107 
+
108  // *************************************************************************
+
109  // First set up some arrays we'll need
+
110  // *************************************************************************
+
111 
+
112 #ifdef _OPENMP
+
113 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
114 #endif
+
115  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
+
116  {
+
117  const Array4<const Real>& prev_cons = S_prev[IntVars::cons].const_array(mfi);
+
118  const Array4<const Real>& prev_zmom = S_prev[IntVars::zmom].const_array(mfi);
119 
-
120  Box gbx = mfi.tilebox(); gbx.grow(1);
-
121 
-
122  if (step == 0) {
-
123  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
-
124  {
-
125  cur_cons(i,j,k,Rho_comp) = prev_cons(i,j,k,Rho_comp);
-
126  cur_cons(i,j,k,RhoTheta_comp) = prev_cons(i,j,k,RhoTheta_comp);
-
127  });
-
128  } // step = 0
-
129 
-
130  Box gtbz = mfi.nodaltilebox(2);
-
131  gtbz.grow(IntVect(1,1,0));
-
132  ParallelFor(gtbz, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
133  old_drho_w(i,j,k) = prev_zmom(i,j,k) - stage_zmom(i,j,k);
-
134  });
-
135 
-
136  const Array4<Real>& theta_extrap = extrap.array(mfi);
-
137  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
138  old_drho(i,j,k) = cur_cons(i,j,k,Rho_comp) - stage_cons(i,j,k,Rho_comp);
-
139  old_drho_theta(i,j,k) = cur_cons(i,j,k,RhoTheta_comp) - stage_cons(i,j,k,RhoTheta_comp);
-
140 
-
141  if (step == 0) {
-
142  theta_extrap(i,j,k) = old_drho_theta(i,j,k);
-
143  } else {
-
144  theta_extrap(i,j,k) = old_drho_theta(i,j,k) + beta_d *
-
145  ( old_drho_theta(i,j,k) - lagged_delta_rt(i,j,k,RhoTheta_comp) );
-
146  }
-
147  });
-
148  } // mfi
-
149 
-
150 #ifdef _OPENMP
-
151 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
152 #endif
-
153  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
-
154  {
-
155  // We define lagged_delta_rt for our next step as the current delta_rt
-
156  Box gbx = mfi.tilebox(); gbx.grow(1);
+
120  const Array4<const Real>& stage_cons = S_stage_data[IntVars::cons].const_array(mfi);
+
121  const Array4<const Real>& stage_zmom = S_stage_data[IntVars::zmom].const_array(mfi);
+
122 
+
123  const Array4<Real>& prev_drho_w = Delta_rho_w.array(mfi);
+
124  const Array4<Real>& prev_drho_theta = Delta_rho_theta.array(mfi);
+
125  const Array4<Real>& lagged_delta_rt = S_scratch[IntVars::cons].array(mfi);
+
126  const Array4<Real>& theta_extrap = extrap.array(mfi);
+
127 
+
128  Box gbx = mfi.growntilebox(1);
+
129  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
+
130  {
+
131  prev_drho_theta(i,j,k) = prev_cons(i,j,k,RhoTheta_comp) - stage_cons(i,j,k,RhoTheta_comp);
+
132 
+
133  if (step == 0) {
+
134  theta_extrap(i,j,k) = prev_drho_theta(i,j,k);
+
135  } else {
+
136  theta_extrap(i,j,k) = prev_drho_theta(i,j,k) + beta_d *
+
137  ( prev_drho_theta(i,j,k) - lagged_delta_rt(i,j,k,RhoTheta_comp) );
+
138  }
+
139 
+
140  // We define lagged_delta_rt for our next step as the current delta_rt
+
141  // (after using it above to extrapolate theta for this step)
+
142  lagged_delta_rt(i,j,k,RhoTheta_comp) = prev_drho_theta(i,j,k);
+
143  });
+
144 
+
145  // NOTE: We must do this here because for step > 0, prev_zmom and cur_zmom both point to the same data,
+
146  // so by the time we would use prev_zmom to define zflux, it would have already been over-written.
+
147  Box gtbz = mfi.nodaltilebox(2);
+
148  gtbz.grow(IntVect(1,1,0));
+
149  ParallelFor(gtbz, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
150  prev_drho_w(i,j,k) = prev_zmom(i,j,k) - stage_zmom(i,j,k);
+
151  });
+
152  } // mfi
+
153 
+
154  // *************************************************************************
+
155  // Define updates in the current RK stage
+
156  // *************************************************************************
157 
-
158  const Array4<Real>& lagged_delta_rt = S_scratch[IntVars::cons].array(mfi);
-
159  const Array4<Real>& old_drho_theta = Delta_rho_theta.array(mfi);
-
160 
-
161  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
162  lagged_delta_rt(i,j,k,RhoTheta_comp) = old_drho_theta(i,j,k);
-
163  });
-
164  } // mfi
+
158 #ifdef _OPENMP
+
159 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
160 #endif
+
161  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
+
162  {
+
163  Box tbx = mfi.nodaltilebox(0);
+
164  Box tby = mfi.nodaltilebox(1);
165 
-
166  // *************************************************************************
-
167  // Define updates in the current RK stage
-
168  // *************************************************************************
+
166  const Array4<const Real> & stage_xmom = S_stage_data[IntVars::xmom].const_array(mfi);
+
167  const Array4<const Real> & stage_ymom = S_stage_data[IntVars::ymom].const_array(mfi);
+
168  const Array4<const Real> & prim = S_stage_prim.const_array(mfi);
169 
-
170 #ifdef _OPENMP
-
171 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
172 #endif
-
173  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
-
174  {
-
175  Box tbx = mfi.nodaltilebox(0);
-
176  Box tby = mfi.nodaltilebox(1);
-
177 
-
178  const Array4<const Real> & stage_xmom = S_stage_data[IntVars::xmom].const_array(mfi);
-
179  const Array4<const Real> & stage_ymom = S_stage_data[IntVars::ymom].const_array(mfi);
-
180  const Array4<const Real> & prim = S_stage_prim.const_array(mfi);
-
181 
-
182  const Array4<const Real>& slow_rhs_rho_u = S_slow_rhs[IntVars::xmom].const_array(mfi);
-
183  const Array4<const Real>& slow_rhs_rho_v = S_slow_rhs[IntVars::ymom].const_array(mfi);
+
170  const Array4<const Real>& slow_rhs_rho_u = S_slow_rhs[IntVars::xmom].const_array(mfi);
+
171  const Array4<const Real>& slow_rhs_rho_v = S_slow_rhs[IntVars::ymom].const_array(mfi);
+
172 
+
173  const Array4<Real>& temp_cur_xmom_arr = temp_cur_xmom.array(mfi);
+
174  const Array4<Real>& temp_cur_ymom_arr = temp_cur_ymom.array(mfi);
+
175 
+
176  const Array4<const Real>& prev_xmom = S_prev[IntVars::xmom].const_array(mfi);
+
177  const Array4<const Real>& prev_ymom = S_prev[IntVars::ymom].const_array(mfi);
+
178 
+
179  // These store the advection momenta which we will use to update the slow variables
+
180  const Array4< Real>& avg_xmom = S_scratch[IntVars::xmom].array(mfi);
+
181  const Array4< Real>& avg_ymom = S_scratch[IntVars::ymom].array(mfi);
+
182 
+
183  const Array4<const Real>& pi_stage_ca = pi_stage.const_array(mfi);
184 
-
185  const Array4<Real>& temp_cur_xmom_arr = temp_cur_xmom.array(mfi);
-
186  const Array4<Real>& temp_cur_ymom_arr = temp_cur_ymom.array(mfi);
-
187 
-
188  const Array4<const Real>& prev_xmom = S_prev[IntVars::xmom].const_array(mfi);
-
189  const Array4<const Real>& prev_ymom = S_prev[IntVars::ymom].const_array(mfi);
+
185  const Array4<Real>& theta_extrap = extrap.array(mfi);
+
186 
+
187  // Map factors
+
188  const Array4<const Real>& mf_u = mapfac_u->const_array(mfi);
+
189  const Array4<const Real>& mf_v = mapfac_v->const_array(mfi);
190 
-
191  // These store the advection momenta which we will use to update the slow variables
-
192  const Array4< Real>& avg_xmom = S_scratch[IntVars::xmom].array(mfi);
-
193  const Array4< Real>& avg_ymom = S_scratch[IntVars::ymom].array(mfi);
-
194 
-
195  const Array4<const Real>& pi_stage_ca = pi_stage.const_array(mfi);
-
196 
-
197  const Array4<Real>& theta_extrap = extrap.array(mfi);
-
198 
-
199  // Map factors
-
200  const Array4<const Real>& mf_u = mapfac_u->const_array(mfi);
-
201  const Array4<const Real>& mf_v = mapfac_v->const_array(mfi);
-
202 
-
203  // *********************************************************************
-
204  // Define updates in the RHS of {x, y, z}-momentum equations
-
205  // *********************************************************************
-
206  {
-
207  BL_PROFILE("fast_rhs_xymom");
-
208  ParallelFor(tbx, tby,
-
209  [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
210  {
-
211  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
-
212  Real gpx = (theta_extrap(i,j,k) - theta_extrap(i-1,j,k))*dxi;
-
213  gpx *= mf_u(i,j,0);
-
214 
-
215  if (l_use_moisture) {
-
216  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i-1,j,k,PrimQ1_comp)
-
217  +prim(i,j,k,PrimQ2_comp) + prim(i-1,j,k,PrimQ2_comp) );
-
218  gpx /= (1.0 + q);
-
219  }
-
220 
-
221  Real pi_c = 0.5 * (pi_stage_ca(i-1,j,k,0) + pi_stage_ca(i,j,k,0));
-
222 
-
223  Real fast_rhs_rho_u = -Gamma * R_d * pi_c * gpx;
-
224 
-
225  Real new_drho_u = prev_xmom(i,j,k) - stage_xmom(i,j,k)
-
226  + dtau * fast_rhs_rho_u + dtau * slow_rhs_rho_u(i,j,k);
-
227 
-
228  avg_xmom(i,j,k) += facinv*new_drho_u;
-
229 
-
230  temp_cur_xmom_arr(i,j,k) = stage_xmom(i,j,k) + new_drho_u;
-
231  },
-
232  [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
233  {
-
234  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
-
235  Real gpy = (theta_extrap(i,j,k) - theta_extrap(i,j-1,k))*dyi;
-
236  gpy *= mf_v(i,j,0);
-
237 
-
238  if (l_use_moisture) {
-
239  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i,j-1,k,PrimQ1_comp)
-
240  +prim(i,j,k,PrimQ2_comp) + prim(i,j-1,k,PrimQ2_comp) );
-
241  gpy /= (1.0 + q);
-
242  }
-
243 
-
244  Real pi_c = 0.5 * (pi_stage_ca(i,j-1,k,0) + pi_stage_ca(i,j,k,0));
-
245 
-
246  Real fast_rhs_rho_v = -Gamma * R_d * pi_c * gpy;
-
247 
-
248  Real new_drho_v = prev_ymom(i,j,k) - stage_ymom(i,j,k)
-
249  + dtau * fast_rhs_rho_v + dtau * slow_rhs_rho_v(i,j,k);
-
250 
-
251  avg_ymom(i,j,k) += facinv*new_drho_v;
-
252 
-
253  temp_cur_ymom_arr(i,j,k) = stage_ymom(i,j,k) + new_drho_v;
-
254  });
-
255  } //profile
-
256  } //mfi
-
257 
-
258 #ifdef _OPENMP
-
259 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
260 #endif
-
261  {
-
262  std::array<FArrayBox,AMREX_SPACEDIM> flux;
-
263  for ( MFIter mfi(S_stage_data[IntVars::cons],TileNoZ()); mfi.isValid(); ++mfi)
-
264  {
-
265  Box bx = mfi.tilebox();
-
266  Box tbz = surroundingNodes(bx,2);
-
267 
-
268  Box vbx = mfi.validbox();
-
269  const auto& vbx_hi = ubound(vbx);
-
270 
-
271  const Array4<const Real> & stage_xmom = S_stage_data[IntVars::xmom].const_array(mfi);
-
272  const Array4<const Real> & stage_ymom = S_stage_data[IntVars::ymom].const_array(mfi);
-
273  const Array4<const Real> & stage_zmom = S_stage_data[IntVars::zmom].const_array(mfi);
-
274  const Array4<const Real> & prim = S_stage_prim.const_array(mfi);
-
275 
-
276  const Array4<Real>& old_drho_w = Delta_rho_w.array(mfi);
-
277  const Array4<Real>& old_drho = Delta_rho.array(mfi);
-
278  const Array4<Real>& old_drho_theta = Delta_rho_theta.array(mfi);
-
279 
-
280  const Array4<const Real>& slow_rhs_cons = S_slow_rhs[IntVars::cons].const_array(mfi);
-
281  const Array4<const Real>& slow_rhs_rho_w = S_slow_rhs[IntVars::zmom].const_array(mfi);
-
282 
-
283  const Array4<Real>& cur_zmom = S_data[IntVars::zmom].array(mfi);
+
191  // *********************************************************************
+
192  // Define updates in the RHS of {x, y, z}-momentum equations
+
193  // *********************************************************************
+
194  if (nrk == 0 and step == 0) {
+
195  ParallelFor(tbx, tby,
+
196  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
197  {
+
198  Real new_drho_u = prev_xmom(i,j,k) - stage_xmom(i,j,k) + dtau * slow_rhs_rho_u(i,j,k);
+
199  avg_xmom(i,j,k) += facinv*new_drho_u;
+
200  temp_cur_xmom_arr(i,j,k) = stage_xmom(i,j,k) + new_drho_u;
+
201  },
+
202  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
203  {
+
204  Real new_drho_v = prev_ymom(i,j,k) - stage_ymom(i,j,k) + dtau * slow_rhs_rho_v(i,j,k);
+
205  avg_ymom(i,j,k) += facinv*new_drho_v;
+
206  temp_cur_ymom_arr(i,j,k) = stage_ymom(i,j,k) + new_drho_v;
+
207  });
+
208  } else {
+
209  ParallelFor(tbx, tby,
+
210  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
211  {
+
212  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
+
213  Real gpx = (theta_extrap(i,j,k) - theta_extrap(i-1,j,k))*dxi;
+
214  gpx *= mf_u(i,j,0);
+
215 
+
216  if (l_use_moisture) {
+
217  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i-1,j,k,PrimQ1_comp)
+
218  +prim(i,j,k,PrimQ2_comp) + prim(i-1,j,k,PrimQ2_comp) );
+
219  gpx /= (1.0 + q);
+
220  }
+
221 
+
222  Real pi_c = 0.5 * (pi_stage_ca(i-1,j,k,0) + pi_stage_ca(i,j,k,0));
+
223 
+
224  Real fast_rhs_rho_u = -Gamma * R_d * pi_c * gpx;
+
225 
+
226  Real new_drho_u = prev_xmom(i,j,k) - stage_xmom(i,j,k)
+
227  + dtau * fast_rhs_rho_u + dtau * slow_rhs_rho_u(i,j,k);
+
228 
+
229  avg_xmom(i,j,k) += facinv*new_drho_u;
+
230 
+
231  temp_cur_xmom_arr(i,j,k) = stage_xmom(i,j,k) + new_drho_u;
+
232  },
+
233  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
234  {
+
235  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
+
236  Real gpy = (theta_extrap(i,j,k) - theta_extrap(i,j-1,k))*dyi;
+
237  gpy *= mf_v(i,j,0);
+
238 
+
239  if (l_use_moisture) {
+
240  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i,j-1,k,PrimQ1_comp)
+
241  +prim(i,j,k,PrimQ2_comp) + prim(i,j-1,k,PrimQ2_comp) );
+
242  gpy /= (1.0 + q);
+
243  }
+
244 
+
245  Real pi_c = 0.5 * (pi_stage_ca(i,j-1,k,0) + pi_stage_ca(i,j,k,0));
+
246 
+
247  Real fast_rhs_rho_v = -Gamma * R_d * pi_c * gpy;
+
248 
+
249  Real new_drho_v = prev_ymom(i,j,k) - stage_ymom(i,j,k)
+
250  + dtau * fast_rhs_rho_v + dtau * slow_rhs_rho_v(i,j,k);
+
251 
+
252  avg_ymom(i,j,k) += facinv*new_drho_v;
+
253 
+
254  temp_cur_ymom_arr(i,j,k) = stage_ymom(i,j,k) + new_drho_v;
+
255  });
+
256  } // nrk > 0 and/or step > 0
+
257  } //mfi
+
258 
+
259 #ifdef _OPENMP
+
260 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
261 #endif
+
262  {
+
263  std::array<FArrayBox,AMREX_SPACEDIM> flux;
+
264  for ( MFIter mfi(S_stage_data[IntVars::cons],TileNoZ()); mfi.isValid(); ++mfi)
+
265  {
+
266  Box bx = mfi.tilebox();
+
267  Box tbz = surroundingNodes(bx,2);
+
268 
+
269  Box vbx = mfi.validbox();
+
270  const auto& vbx_hi = ubound(vbx);
+
271 
+
272  const Array4<const Real>& stage_xmom = S_stage_data[IntVars::xmom].const_array(mfi);
+
273  const Array4<const Real>& stage_ymom = S_stage_data[IntVars::ymom].const_array(mfi);
+
274  const Array4<const Real>& stage_zmom = S_stage_data[IntVars::zmom].const_array(mfi);
+
275  const Array4<const Real> & prim = S_stage_prim.const_array(mfi);
+
276 
+
277  const Array4<const Real>& prev_drho_theta = Delta_rho_theta.array(mfi);
+
278 
+
279  const Array4<const Real>& prev_cons = S_prev[IntVars::cons].const_array(mfi);
+
280  const Array4<const Real>& stage_cons = S_stage_data[IntVars::cons].const_array(mfi);
+
281 
+
282  const Array4<const Real>& slow_rhs_cons = S_slow_rhs[IntVars::cons].const_array(mfi);
+
283  const Array4<const Real>& slow_rhs_rho_w = S_slow_rhs[IntVars::zmom].const_array(mfi);
284 
-
285  const Array4<Real>& temp_cur_xmom_arr = temp_cur_xmom.array(mfi);
-
286  const Array4<Real>& temp_cur_ymom_arr = temp_cur_ymom.array(mfi);
+
285  const Array4<const Real>& prev_zmom = S_prev[IntVars::zmom].const_array(mfi);
+
286  const Array4< Real>& cur_zmom = S_data[IntVars::zmom].array(mfi);
287 
-
288  const Array4<const Real>& prev_zmom = S_prev[IntVars::zmom].const_array(mfi);
-
289 
-
290  // These store the advection momenta which we will use to update the slow variables
-
291  const Array4< Real>& avg_zmom = S_scratch[IntVars::zmom].array(mfi);
-
292 
-
293  // Map factors
-
294  const Array4<const Real>& mf_m = mapfac_m->const_array(mfi);
-
295  const Array4<const Real>& mf_u = mapfac_u->const_array(mfi);
-
296  const Array4<const Real>& mf_v = mapfac_v->const_array(mfi);
-
297 
-
298  FArrayBox RHS_fab;
-
299  RHS_fab.resize(tbz,1, The_Async_Arena());
-
300 
-
301  FArrayBox soln_fab;
-
302  soln_fab.resize(tbz,1, The_Async_Arena());
-
303 
-
304  auto const& RHS_a = RHS_fab.array();
-
305  auto const& soln_a = soln_fab.array();
-
306 
-
307  auto const& temp_rhs_arr = temp_rhs.array(mfi);
+
288  const Array4<Real>& temp_cur_xmom_arr = temp_cur_xmom.array(mfi);
+
289  const Array4<Real>& temp_cur_ymom_arr = temp_cur_ymom.array(mfi);
+
290 
+
291 
+
292  // These store the advection momenta which we will use to update the slow variables
+
293  const Array4< Real>& avg_zmom = S_scratch[IntVars::zmom].array(mfi);
+
294 
+
295  // Map factors
+
296  const Array4<const Real>& mf_m = mapfac_m->const_array(mfi);
+
297  const Array4<const Real>& mf_u = mapfac_u->const_array(mfi);
+
298  const Array4<const Real>& mf_v = mapfac_v->const_array(mfi);
+
299 
+
300  FArrayBox RHS_fab;
+
301  RHS_fab.resize(tbz,1, The_Async_Arena());
+
302 
+
303  FArrayBox soln_fab;
+
304  soln_fab.resize(tbz,1, The_Async_Arena());
+
305 
+
306  auto const& RHS_a = RHS_fab.array();
+
307  auto const& soln_a = soln_fab.array();
308 
-
309  auto const& coeffA_a = coeff_A_mf.array(mfi);
-
310  auto const& inv_coeffB_a = inv_coeff_B_mf.array(mfi);
-
311  auto const& coeffC_a = coeff_C_mf.array(mfi);
-
312  auto const& coeffP_a = coeff_P_mf.array(mfi);
-
313  auto const& coeffQ_a = coeff_Q_mf.array(mfi);
-
314 
-
315  // *************************************************************************
-
316  // Define flux arrays for use in advection
+
309  auto const& temp_rhs_arr = temp_rhs.array(mfi);
+
310 
+
311  auto const& coeffA_a = coeff_A_mf.array(mfi);
+
312  auto const& inv_coeffB_a = inv_coeff_B_mf.array(mfi);
+
313  auto const& coeffC_a = coeff_C_mf.array(mfi);
+
314  auto const& coeffP_a = coeff_P_mf.array(mfi);
+
315  auto const& coeffQ_a = coeff_Q_mf.array(mfi);
+
316 
317  // *************************************************************************
-
318  for (int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
-
319  flux[dir].resize(surroundingNodes(bx,dir),2);
-
320  flux[dir].setVal<RunOn::Device>(0.);
-
321  }
-
322  const GpuArray<const Array4<Real>, AMREX_SPACEDIM>
-
323  flx_arr{{AMREX_D_DECL(flux[0].array(), flux[1].array(), flux[2].array())}};
-
324 
-
325  // *********************************************************************
-
326  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
327  Real xflux_lo = (temp_cur_xmom_arr(i ,j,k) - stage_xmom(i ,j,k)) / mf_u(i ,j,0);
-
328  Real xflux_hi = (temp_cur_xmom_arr(i+1,j,k) - stage_xmom(i+1,j,k)) / mf_u(i+1,j,0);
-
329  Real yflux_lo = (temp_cur_ymom_arr(i,j ,k) - stage_ymom(i,j ,k)) / mf_v(i,j ,0);
-
330  Real yflux_hi = (temp_cur_ymom_arr(i,j+1,k) - stage_ymom(i,j+1,k)) / mf_v(i,j+1,0);
-
331 
-
332  Real mfsq = mf_m(i,j,0) * mf_m(i,j,0);
+
318  // Define flux arrays for use in advection
+
319  // *************************************************************************
+
320  for (int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
+
321  flux[dir].resize(surroundingNodes(bx,dir),2);
+
322  flux[dir].setVal<RunOn::Device>(0.);
+
323  }
+
324  const GpuArray<const Array4<Real>, AMREX_SPACEDIM>
+
325  flx_arr{{AMREX_D_DECL(flux[0].array(), flux[1].array(), flux[2].array())}};
+
326 
+
327  // *********************************************************************
+
328  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
329  Real xflux_lo = (temp_cur_xmom_arr(i ,j,k) - stage_xmom(i ,j,k)) / mf_u(i ,j,0);
+
330  Real xflux_hi = (temp_cur_xmom_arr(i+1,j,k) - stage_xmom(i+1,j,k)) / mf_u(i+1,j,0);
+
331  Real yflux_lo = (temp_cur_ymom_arr(i,j ,k) - stage_ymom(i,j ,k)) / mf_v(i,j ,0);
+
332  Real yflux_hi = (temp_cur_ymom_arr(i,j+1,k) - stage_ymom(i,j+1,k)) / mf_v(i,j+1,0);
333 
-
334  temp_rhs_arr(i,j,k,Rho_comp ) = ( xflux_hi - xflux_lo ) * dxi * mfsq
-
335  + ( yflux_hi - yflux_lo ) * dyi * mfsq;
-
336  temp_rhs_arr(i,j,k,RhoTheta_comp) = (( xflux_hi * (prim(i,j,k,0) + prim(i+1,j,k,0)) -
-
337  xflux_lo * (prim(i,j,k,0) + prim(i-1,j,k,0)) ) * dxi * mfsq +
-
338  ( yflux_hi * (prim(i,j,k,0) + prim(i,j+1,k,0)) -
-
339  yflux_lo * (prim(i,j,k,0) + prim(i,j-1,k,0)) ) * dyi * mfsq) * 0.5;
-
340 
-
341  (flx_arr[0])(i,j,k,0) = xflux_lo;
-
342  (flx_arr[0])(i,j,k,1) = (flx_arr[0])(i ,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i-1,j,k,0));
-
343 
-
344  (flx_arr[1])(i,j,k,0) = yflux_lo;
-
345  (flx_arr[1])(i,j,k,1) = (flx_arr[0])(i,j ,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j-1,k,0));
-
346 
-
347  if (i == vbx_hi.x) {
-
348  (flx_arr[0])(i+1,j,k,0) = xflux_hi;
-
349  (flx_arr[0])(i+1,j,k,1) = (flx_arr[0])(i+1,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i+1,j,k,0));
-
350  }
-
351  if (j == vbx_hi.y) {
-
352  (flx_arr[1])(i,j+1,k,0) = yflux_hi;
-
353  (flx_arr[1])(i,j+1,k,1) = (flx_arr[1])(i,j+1,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j+1,k,0));
-
354  }
-
355  });
-
356 
-
357  Box bx_shrunk_in_k = bx;
-
358  int klo = tbz.smallEnd(2);
-
359  int khi = tbz.bigEnd(2);
-
360  bx_shrunk_in_k.setSmall(2,klo+1);
-
361  bx_shrunk_in_k.setBig(2,khi-1);
-
362 
-
363  // Note that the notes use "g" to mean the magnitude of gravity, so it is positive
-
364  // We set grav_gpu[2] to be the vector component which is negative
-
365  // We define halfg to match the notes (which is why we take the absolute value)
-
366  Real halfg = std::abs(0.5 * grav_gpu[2]);
-
367 
-
368  // *********************************************************************
-
369  // fast_loop_on_shrunk
+
334  Real mfsq = mf_m(i,j,0) * mf_m(i,j,0);
+
335 
+
336  temp_rhs_arr(i,j,k,Rho_comp ) = ( xflux_hi - xflux_lo ) * dxi * mfsq
+
337  + ( yflux_hi - yflux_lo ) * dyi * mfsq;
+
338  temp_rhs_arr(i,j,k,RhoTheta_comp) = (( xflux_hi * (prim(i,j,k,0) + prim(i+1,j,k,0)) -
+
339  xflux_lo * (prim(i,j,k,0) + prim(i-1,j,k,0)) ) * dxi * mfsq +
+
340  ( yflux_hi * (prim(i,j,k,0) + prim(i,j+1,k,0)) -
+
341  yflux_lo * (prim(i,j,k,0) + prim(i,j-1,k,0)) ) * dyi * mfsq) * 0.5;
+
342 
+
343  (flx_arr[0])(i,j,k,0) = xflux_lo;
+
344  (flx_arr[0])(i,j,k,1) = (flx_arr[0])(i ,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i-1,j,k,0));
+
345 
+
346  (flx_arr[1])(i,j,k,0) = yflux_lo;
+
347  (flx_arr[1])(i,j,k,1) = (flx_arr[0])(i,j ,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j-1,k,0));
+
348 
+
349  if (i == vbx_hi.x) {
+
350  (flx_arr[0])(i+1,j,k,0) = xflux_hi;
+
351  (flx_arr[0])(i+1,j,k,1) = (flx_arr[0])(i+1,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i+1,j,k,0));
+
352  }
+
353  if (j == vbx_hi.y) {
+
354  (flx_arr[1])(i,j+1,k,0) = yflux_hi;
+
355  (flx_arr[1])(i,j+1,k,1) = (flx_arr[1])(i,j+1,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j+1,k,0));
+
356  }
+
357  });
+
358 
+
359  Box bx_shrunk_in_k = bx;
+
360  int klo = tbz.smallEnd(2);
+
361  int khi = tbz.bigEnd(2);
+
362  bx_shrunk_in_k.setSmall(2,klo+1);
+
363  bx_shrunk_in_k.setBig(2,khi-1);
+
364 
+
365  // Note that the notes use "g" to mean the magnitude of gravity, so it is positive
+
366  // We set grav_gpu[2] to be the vector component which is negative
+
367  // We define halfg to match the notes (which is why we take the absolute value)
+
368  Real halfg = std::abs(0.5 * grav_gpu[2]);
+
369 
370  // *********************************************************************
-
371  {
-
372  BL_PROFILE("fast_loop_on_shrunk");
+
371  // fast_loop_on_shrunk
+
372  // *********************************************************************
373  //Note we don't act on the bottom or top boundaries of the domain
374  ParallelFor(bx_shrunk_in_k, [=] AMREX_GPU_DEVICE (int i, int j, int k)
375  {
@@ -663,191 +668,226 @@

392  Real Omega_km1 = prev_zmom(i,j,k-1) - stage_zmom(i,j,k-1);

393 
394  // line 2 last two terms (order dtau)
-
395  Real R0_tmp = coeff_P * old_drho_theta(i,j,k) + coeff_Q * old_drho_theta(i,j,k-1)
-
396  - halfg * ( old_drho(i,j,k) + old_drho(i,j,k-1) );
-
397 
-
398  // lines 3-5 residuals (order dtau^2) 1.0 <-> beta_2
-
399  Real R1_tmp = halfg * (-slow_rhs_cons(i,j,k ,Rho_comp)
-
400  -slow_rhs_cons(i,j,k-1,Rho_comp)
-
401  +temp_rhs_arr(i,j,k,0) + temp_rhs_arr(i,j,k-1) )
-
402  + ( coeff_P * (slow_rhs_cons(i,j,k ,RhoTheta_comp) - temp_rhs_arr(i,j,k ,RhoTheta_comp)) +
-
403  coeff_Q * (slow_rhs_cons(i,j,k-1,RhoTheta_comp) - temp_rhs_arr(i,j,k-1,RhoTheta_comp)) );
-
404 
-
405  // lines 6&7 consolidated (reuse Omega & metrics) (order dtau^2)
-
406  R1_tmp += beta_1 * dzi * ( (Omega_kp1 - Omega_km1) * halfg
-
407  -(Omega_kp1*theta_t_hi - Omega_k *theta_t_mid) * coeff_P
-
408  -(Omega_k *theta_t_mid - Omega_km1*theta_t_lo ) * coeff_Q );
-
409 
-
410  // line 1
-
411  RHS_a(i,j,k) = Omega_k + dtau * (slow_rhs_rho_w(i,j,k) + R0_tmp + dtau * beta_2 * R1_tmp);
-
412  });
-
413  } // end profile
+
395  Real old_drho_k = prev_cons(i,j,k ,Rho_comp) - stage_cons(i,j,k ,Rho_comp);
+
396  Real old_drho_km1 = prev_cons(i,j,k-1,Rho_comp) - stage_cons(i,j,k-1,Rho_comp);
+
397  Real R0_tmp = coeff_P * prev_drho_theta(i,j,k) + coeff_Q * prev_drho_theta(i,j,k-1)
+
398  - halfg * ( old_drho_k + old_drho_km1 );
+
399 
+
400  // lines 3-5 residuals (order dtau^2) 1.0 <-> beta_2
+
401  Real R1_tmp = halfg * (-slow_rhs_cons(i,j,k ,Rho_comp)
+
402  -slow_rhs_cons(i,j,k-1,Rho_comp)
+
403  +temp_rhs_arr(i,j,k,0) + temp_rhs_arr(i,j,k-1) )
+
404  + ( coeff_P * (slow_rhs_cons(i,j,k ,RhoTheta_comp) - temp_rhs_arr(i,j,k ,RhoTheta_comp)) +
+
405  coeff_Q * (slow_rhs_cons(i,j,k-1,RhoTheta_comp) - temp_rhs_arr(i,j,k-1,RhoTheta_comp)) );
+
406 
+
407  // lines 6&7 consolidated (reuse Omega & metrics) (order dtau^2)
+
408  R1_tmp += beta_1 * dzi * ( (Omega_kp1 - Omega_km1) * halfg
+
409  -(Omega_kp1*theta_t_hi - Omega_k *theta_t_mid) * coeff_P
+
410  -(Omega_k *theta_t_mid - Omega_km1*theta_t_lo ) * coeff_Q );
+
411 
+
412  // line 1
+
413  RHS_a(i,j,k) = Omega_k + dtau * (slow_rhs_rho_w(i,j,k) + R0_tmp + dtau * beta_2 * R1_tmp);
414 
-
415  Box b2d = tbz; // Copy constructor
-
416  b2d.setRange(2,0);
-
417 
-
418  {
-
419  BL_PROFILE("fast_rhs_b2d_loop");
-
420 #ifdef AMREX_USE_GPU
-
421  auto const lo = lbound(bx);
-
422  auto const hi = ubound(bx);
+
415  }); // bx_shrunk_in_k
+
416 
+
417  Box b2d = tbz; // Copy constructor
+
418  b2d.setRange(2,0);
+
419 
+
420  auto const lo = lbound(bx);
+
421  auto const hi = ubound(bx);
+
422 
423  ParallelFor(b2d, [=] AMREX_GPU_DEVICE (int i, int j, int)
424  {
425  // w at bottom boundary of grid is 0 if at domain boundary, otherwise w = w_old + dtau * slow_rhs
-
426  RHS_a(i,j,lo.z) = dtau * slow_rhs_rho_w(i,j,lo.z);
-
427 
-
428  // w at top boundary of grid is 0 if at domain boundary, otherwise w = w_old + dtau * slow_rhs
-
429  // TODO TODO: Note that if we ever change this, we will need to include it in avg_zmom at the top
-
430  RHS_a(i,j,hi.z+1) = dtau * slow_rhs_rho_w(i,j,hi.z+1);
-
431 
-
432  // w = specified Dirichlet value at k = lo.z
-
433  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
-
434  cur_zmom(i,j,lo.z) = stage_zmom(i,j,lo.z) + soln_a(i,j,lo.z);
-
435 
-
436  for (int k = lo.z+1; k <= hi.z+1; k++) {
-
437  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
-
438  }
-
439 
-
440  cur_zmom(i,j,hi.z+1) = stage_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
-
441 
-
442  for (int k = hi.z; k >= lo.z; k--) {
-
443  soln_a(i,j,k) -= ( coeffC_a(i,j,k) * inv_coeffB_a(i,j,k) ) *soln_a(i,j,k+1);
-
444  cur_zmom(i,j,k) = stage_zmom(i,j,k) + soln_a(i,j,k);
-
445  }
-
446  }); // b2d
-
447 #else
-
448  auto const lo = lbound(bx);
-
449  auto const hi = ubound(bx);
-
450  for (int j = lo.y; j <= hi.y; ++j) {
-
451  AMREX_PRAGMA_SIMD
-
452  for (int i = lo.x; i <= hi.x; ++i) {
-
453  // w at bottom boundary of grid is 0 if at domain boundary, otherwise w_old + dtau * slow_rhs
-
454  RHS_a (i,j,lo.z) = dtau * slow_rhs_rho_w(i,j,lo.z);
-
455  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
-
456  }
-
457  }
-
458  // Note that if we ever change this, we will need to include it in avg_zmom at the top
-
459  for (int j = lo.y; j <= hi.y; ++j) {
-
460  AMREX_PRAGMA_SIMD
-
461  for (int i = lo.x; i <= hi.x; ++i) {
-
462  RHS_a (i,j,hi.z+1) = dtau * slow_rhs_rho_w(i,j,hi.z+1);
-
463  }
-
464  }
-
465  for (int k = lo.z+1; k <= hi.z+1; ++k) {
-
466  for (int j = lo.y; j <= hi.y; ++j) {
-
467  AMREX_PRAGMA_SIMD
-
468  for (int i = lo.x; i <= hi.x; ++i) {
-
469  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
-
470  }
-
471  }
-
472  }
-
473  for (int j = lo.y; j <= hi.y; ++j) {
-
474  AMREX_PRAGMA_SIMD
-
475  for (int i = lo.x; i <= hi.x; ++i) {
-
476  cur_zmom(i,j,hi.z+1) = stage_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
-
477  }
-
478  }
-
479  for (int k = hi.z; k >= lo.z; --k) {
-
480  for (int j = lo.y; j <= hi.y; ++j) {
-
481  AMREX_PRAGMA_SIMD
-
482  for (int i = lo.x; i <= hi.x; ++i) {
-
483  soln_a(i,j,k) -= ( coeffC_a(i,j,k) * inv_coeffB_a(i,j,k) ) * soln_a(i,j,k+1);
-
484  cur_zmom(i,j,k) = stage_zmom(i,j,k) + soln_a(i,j,k);
-
485  }
-
486  }
-
487  }
-
488 #endif
-
489  } // end profile
-
490 
-
491  // **************************************************************************
-
492  // Define updates in the RHS of rho and (rho theta)
-
493  // **************************************************************************
-
494  {
-
495  BL_PROFILE("fast_rho_final_update");
-
496  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
-
497  {
-
498  Real zflux_lo = beta_2 * soln_a(i,j,k ) + beta_1 * old_drho_w(i,j,k );
-
499  Real zflux_hi = beta_2 * soln_a(i,j,k+1) + beta_1 * old_drho_w(i,j,k+1);
-
500 
-
501  avg_zmom(i,j,k) += facinv*zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
-
502  (flx_arr[2])(i,j,k,0) = zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
-
503  (flx_arr[2])(i,j,k,1) = (flx_arr[2])(i,j,k,0) * 0.5 * (prim(i,j,k) + prim(i,j,k-1));
-
504 
-
505  if (k == vbx_hi.z) {
-
506  avg_zmom(i,j,k+1) += facinv * zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
-
507  (flx_arr[2])(i,j,k+1,0) = zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
-
508  (flx_arr[2])(i,j,k+1,1) = (flx_arr[2])(i,j,k+1,0) * 0.5 * (prim(i,j,k) + prim(i,j,k+1));
+
426  RHS_a (i,j,lo.z ) = prev_zmom(i,j,lo.z ) - stage_zmom(i,j,lo.z)
+
427  + dtau * slow_rhs_rho_w(i,j,lo.z);
+
428 
+
429  // w at top boundary of grid is 0 if at domain boundary, otherwise w = w_old + dtau * slow_rhs
+
430  RHS_a (i,j,hi.z+1) = prev_zmom(i,j,hi.z+1) - stage_zmom(i,j,hi.z+1)
+
431  + dtau * slow_rhs_rho_w(i,j,hi.z+1);
+
432  }); // b2d
+
433 
+
434 #ifdef AMREX_USE_GPU
+
435  if (l_implicit_substepping) {
+
436 
+
437  ParallelFor(b2d, [=] AMREX_GPU_DEVICE (int i, int j, int)
+
438  {
+
439  // w = specified Dirichlet value at k = lo.z
+
440  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
+
441  cur_zmom(i,j,lo.z) = stage_zmom(i,j,lo.z) + soln_a(i,j,lo.z);
+
442 
+
443  for (int k = lo.z+1; k <= hi.z+1; k++) {
+
444  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
+
445  }
+
446 
+
447  cur_zmom(i,j,hi.z+1) = stage_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
+
448 
+
449  for (int k = hi.z; k >= lo.z; k--) {
+
450  soln_a(i,j,k) -= ( coeffC_a(i,j,k) * inv_coeffB_a(i,j,k) ) *soln_a(i,j,k+1);
+
451  cur_zmom(i,j,k) = stage_zmom(i,j,k) + soln_a(i,j,k);
+
452  }
+
453  }); // b2d
+
454 
+
455  } else { // explicit substepping (beta_1 = 1; beta_2 = 0)
+
456 
+
457  ParallelFor(b2d, [=] AMREX_GPU_DEVICE (int i, int j, int)
+
458  {
+
459  for (int k = lo.z; k <= hi.z+1; k++) {
+
460  soln_a(i,j,k) = RHS_a(i,j,k);
+
461  cur_zmom(i,j,k) = stage_zmom(i,j,k) + soln_a(i,j,k);
+
462  }
+
463  }); // b2d
+
464  } // end of explicit substepping
+
465 #else
+
466  if (l_implicit_substepping) {
+
467 
+
468  for (int j = lo.y; j <= hi.y; ++j) {
+
469  AMREX_PRAGMA_SIMD
+
470  for (int i = lo.x; i <= hi.x; ++i) {
+
471  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
+
472  }
+
473  }
+
474  for (int k = lo.z+1; k <= hi.z+1; ++k) {
+
475  for (int j = lo.y; j <= hi.y; ++j) {
+
476  AMREX_PRAGMA_SIMD
+
477  for (int i = lo.x; i <= hi.x; ++i) {
+
478  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
+
479  }
+
480  }
+
481  }
+
482  for (int j = lo.y; j <= hi.y; ++j) {
+
483  AMREX_PRAGMA_SIMD
+
484  for (int i = lo.x; i <= hi.x; ++i) {
+
485  cur_zmom(i,j,hi.z+1) = stage_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
+
486  }
+
487  }
+
488  for (int k = hi.z; k >= lo.z; --k) {
+
489  for (int j = lo.y; j <= hi.y; ++j) {
+
490  AMREX_PRAGMA_SIMD
+
491  for (int i = lo.x; i <= hi.x; ++i) {
+
492  soln_a(i,j,k) -= ( coeffC_a(i,j,k) * inv_coeffB_a(i,j,k) ) * soln_a(i,j,k+1);
+
493  cur_zmom(i,j,k) = stage_zmom(i,j,k) + soln_a(i,j,k);
+
494  }
+
495  }
+
496  }
+
497  } else { // explicit substepping (beta_1 = 1; beta_2 = 0)
+
498 
+
499  for (int k = lo.z; k <= hi.z+1; ++k) {
+
500  for (int j = lo.y; j <= hi.y; ++j) {
+
501  AMREX_PRAGMA_SIMD
+
502  for (int i = lo.x; i <= hi.x; ++i) {
+
503 
+
504  soln_a(i,j,k) = RHS_a(i,j,k);
+
505 
+
506  cur_zmom(i,j,k) = stage_zmom(i,j,k) + soln_a(i,j,k);
+
507  }
+
508  }
509  }
510 
-
511  temp_rhs_arr(i,j,k,Rho_comp ) += dzi * ( zflux_hi - zflux_lo );
-
512  temp_rhs_arr(i,j,k,RhoTheta_comp) += 0.5 * dzi * ( zflux_hi * (prim(i,j,k) + prim(i,j,k+1))
-
513  - zflux_lo * (prim(i,j,k) + prim(i,j,k-1)) );
-
514  });
-
515  } // end profile
-
516 
-
517  // We only add to the flux registers in the final RK step
-
518  if (l_reflux && nrk == 2) {
-
519  int strt_comp_reflux = 0;
-
520  // For now we don't reflux (rho theta) because it seems to create issues at c/f boundaries
-
521  int num_comp_reflux = 1;
-
522  if (level < finest_level) {
-
523  fr_as_crse->CrseAdd(mfi,
-
524  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
-
525  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
-
526  }
-
527  if (level > 0) {
-
528  fr_as_fine->FineAdd(mfi,
-
529  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
-
530  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
+
511  } // end of explicit substepping
+
512 #endif
+
513 
+
514  // **************************************************************************
+
515  // Define updates in the RHS of rho and (rho theta)
+
516  // **************************************************************************
+
517  const Array4<Real>& prev_drho_w = Delta_rho_w.array(mfi);
+
518  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
+
519  {
+
520  Real zflux_lo = beta_2 * soln_a(i,j,k ) + beta_1 * prev_drho_w(i,j,k );
+
521  Real zflux_hi = beta_2 * soln_a(i,j,k+1) + beta_1 * prev_drho_w(i,j,k+1);
+
522 
+
523  avg_zmom(i,j,k) += facinv*zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
+
524  (flx_arr[2])(i,j,k,0) = zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
+
525  (flx_arr[2])(i,j,k,1) = (flx_arr[2])(i,j,k,0) * 0.5 * (prim(i,j,k) + prim(i,j,k-1));
+
526 
+
527  if (k == vbx_hi.z) {
+
528  avg_zmom(i,j,k+1) += facinv * zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
+
529  (flx_arr[2])(i,j,k+1,0) = zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
+
530  (flx_arr[2])(i,j,k+1,1) = (flx_arr[2])(i,j,k+1,0) * 0.5 * (prim(i,j,k) + prim(i,j,k+1));
531  }
532 
-
533  // This is necessary here so we don't go on to the next FArrayBox without
-
534  // having finished copying the fluxes into the FluxRegisters (since the fluxes
-
535  // are stored in temporary FArrayBox's)
-
536  Gpu::streamSynchronize();
+
533  temp_rhs_arr(i,j,k,Rho_comp ) += dzi * ( zflux_hi - zflux_lo );
+
534  temp_rhs_arr(i,j,k,RhoTheta_comp) += 0.5 * dzi * ( zflux_hi * (prim(i,j,k) + prim(i,j,k+1))
+
535  - zflux_lo * (prim(i,j,k) + prim(i,j,k-1)) );
+
536  });
537 
-
538  } // two-way coupling
-
539  } // mfi
-
540  } // OMP
-
541 
-
542 #ifdef _OPENMP
-
543 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
544 #endif
-
545  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
-
546  {
-
547  const Box& bx = mfi.tilebox();
-
548 
-
549  int cons_dycore{2};
-
550  const Array4<Real>& cur_cons = S_data[IntVars::cons].array(mfi);
-
551  auto const& temp_rhs_arr = temp_rhs.const_array(mfi);
-
552  auto const& slow_rhs_cons = S_slow_rhs[IntVars::cons].const_array(mfi);
+
538  // We only add to the flux registers in the final RK step
+
539  if (l_reflux && nrk == 2) {
+
540  int strt_comp_reflux = 0;
+
541  // For now we don't reflux (rho theta) because it seems to create issues at c/f boundaries
+
542  int num_comp_reflux = 1;
+
543  if (level < finest_level) {
+
544  fr_as_crse->CrseAdd(mfi,
+
545  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
+
546  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
+
547  }
+
548  if (level > 0) {
+
549  fr_as_fine->FineAdd(mfi,
+
550  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
+
551  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
+
552  }
553 
-
554  ParallelFor(bx, cons_dycore, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
-
555  {
-
556  cur_cons(i,j,k,n) += dtau * (slow_rhs_cons(i,j,k,n) - temp_rhs_arr(i,j,k,n));
-
557  });
+
554  // This is necessary here so we don't go on to the next FArrayBox without
+
555  // having finished copying the fluxes into the FluxRegisters (since the fluxes
+
556  // are stored in temporary FArrayBox's)
+
557  Gpu::streamSynchronize();
558 
-
559  const Array4<Real>& cur_xmom = S_data[IntVars::xmom].array(mfi);
-
560  const Array4<Real>& cur_ymom = S_data[IntVars::ymom].array(mfi);
-
561 
-
562  const Array4<Real const>& temp_cur_xmom_arr = temp_cur_xmom.const_array(mfi);
-
563  const Array4<Real const>& temp_cur_ymom_arr = temp_cur_ymom.const_array(mfi);
-
564 
-
565  Box tbx = surroundingNodes(bx,0);
-
566  Box tby = surroundingNodes(bx,1);
-
567 
-
568  ParallelFor(tbx, tby,
-
569  [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
570  {
-
571  cur_xmom(i,j,k) = temp_cur_xmom_arr(i,j,k);
-
572  },
-
573  [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
574  {
-
575  cur_ymom(i,j,k) = temp_cur_ymom_arr(i,j,k);
-
576  });
-
577 
-
578  } // mfi
-
579 }
+
559  } // two-way coupling
+
560  } // mfi
+
561  } // OMP
+
562 
+
563 #ifdef _OPENMP
+
564 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
565 #endif
+
566  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
+
567  {
+
568  const Box& bx = mfi.tilebox();
+
569 
+
570  const Array4< Real>& cur_cons = S_data[IntVars::cons].array(mfi);
+
571  const Array4<const Real>& prev_cons = S_prev[IntVars::cons].const_array(mfi);
+
572  auto const& temp_rhs_arr = temp_rhs.const_array(mfi);
+
573  auto const& slow_rhs_cons = S_slow_rhs[IntVars::cons].const_array(mfi);
+
574 
+
575  if (step == 0) {
+
576  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
+
577  {
+
578  cur_cons(i,j,k,Rho_comp) = prev_cons(i,j,k,Rho_comp) +
+
579  dtau * (slow_rhs_cons(i,j,k,Rho_comp) - temp_rhs_arr(i,j,k,Rho_comp));
+
580  cur_cons(i,j,k,RhoTheta_comp) = prev_cons(i,j,k,RhoTheta_comp) +
+
581  dtau * (slow_rhs_cons(i,j,k,RhoTheta_comp) - temp_rhs_arr(i,j,k,RhoTheta_comp));
+
582  });
+
583  } else {
+
584  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
+
585  {
+
586  //
+
587  // We didn't need to set cur_cons = prev_cons above because they point to the same data for step > 0
+
588  //
+
589  cur_cons(i,j,k,Rho_comp) += dtau * (slow_rhs_cons(i,j,k,Rho_comp) - temp_rhs_arr(i,j,k,Rho_comp));
+
590  cur_cons(i,j,k,RhoTheta_comp) += dtau * (slow_rhs_cons(i,j,k,RhoTheta_comp) - temp_rhs_arr(i,j,k,RhoTheta_comp));
+
591  });
+
592  } // step = 0
+
593 
+
594  const Array4<Real>& cur_xmom = S_data[IntVars::xmom].array(mfi);
+
595  const Array4<Real>& cur_ymom = S_data[IntVars::ymom].array(mfi);
+
596 
+
597  const Array4<Real const>& temp_cur_xmom_arr = temp_cur_xmom.const_array(mfi);
+
598  const Array4<Real const>& temp_cur_ymom_arr = temp_cur_ymom.const_array(mfi);
+
599 
+
600  Box tbx = surroundingNodes(bx,0);
+
601  Box tby = surroundingNodes(bx,1);
+
602 
+
603  ParallelFor(tbx, tby,
+
604  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
605  {
+
606  cur_xmom(i,j,k) = temp_cur_xmom_arr(i,j,k);
+
607  },
+
608  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
609  {
+
610  cur_ymom(i,j,k) = temp_cur_ymom_arr(i,j,k);
+
611  });
+
612 
+
613  } // mfi
+
614 }
constexpr amrex::Real R_d
Definition: ERF_Constants.H:10
constexpr amrex::Real Gamma
Definition: ERF_Constants.H:19
#define PrimQ1_comp
Definition: ERF_IndexDefines.H:55
@@ -863,8 +903,8 @@

Here is the call graph for this function:

-
- +
+ diff --git a/ERF__fast__rhs__N_8cpp.js b/ERF__fast__rhs__N_8cpp.js index 72922df496..52277a2551 100644 --- a/ERF__fast__rhs__N_8cpp.js +++ b/ERF__fast__rhs__N_8cpp.js @@ -1,4 +1,4 @@ var ERF__fast__rhs__N_8cpp = [ - [ "erf_fast_rhs_N", "ERF__fast__rhs__N_8cpp.html#aec6e78f7c7efa8a0108529be2516cfcc", null ] + [ "erf_fast_rhs_N", "ERF__fast__rhs__N_8cpp.html#a5fbcc0fe33b8e8e42f840ad475a092bd", null ] ]; \ No newline at end of file diff --git a/ERF__fast__rhs__N_8cpp_aec6e78f7c7efa8a0108529be2516cfcc_cgraph.map b/ERF__fast__rhs__N_8cpp_a5fbcc0fe33b8e8e42f840ad475a092bd_cgraph.map similarity index 100% rename from ERF__fast__rhs__N_8cpp_aec6e78f7c7efa8a0108529be2516cfcc_cgraph.map rename to ERF__fast__rhs__N_8cpp_a5fbcc0fe33b8e8e42f840ad475a092bd_cgraph.map diff --git a/ERF__fast__rhs__N_8cpp_aec6e78f7c7efa8a0108529be2516cfcc_cgraph.md5 b/ERF__fast__rhs__N_8cpp_a5fbcc0fe33b8e8e42f840ad475a092bd_cgraph.md5 similarity index 100% rename from ERF__fast__rhs__N_8cpp_aec6e78f7c7efa8a0108529be2516cfcc_cgraph.md5 rename to ERF__fast__rhs__N_8cpp_a5fbcc0fe33b8e8e42f840ad475a092bd_cgraph.md5 diff --git a/ERF__fast__rhs__N_8cpp_aec6e78f7c7efa8a0108529be2516cfcc_cgraph.png b/ERF__fast__rhs__N_8cpp_a5fbcc0fe33b8e8e42f840ad475a092bd_cgraph.png similarity index 100% rename from ERF__fast__rhs__N_8cpp_aec6e78f7c7efa8a0108529be2516cfcc_cgraph.png rename to ERF__fast__rhs__N_8cpp_a5fbcc0fe33b8e8e42f840ad475a092bd_cgraph.png diff --git a/ERF__fast__rhs__T_8cpp.html b/ERF__fast__rhs__T_8cpp.html index 2071d46451..9e1f12e940 100644 --- a/ERF__fast__rhs__T_8cpp.html +++ b/ERF__fast__rhs__T_8cpp.html @@ -133,12 +133,12 @@
- - + +

Functions

void erf_fast_rhs_T (int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, MultiFab &Omega, std::unique_ptr< MultiFab > &z_phys_nd, std::unique_ptr< MultiFab > &detJ_cc, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux)
 
void erf_fast_rhs_T (int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, MultiFab &Omega, std::unique_ptr< MultiFab > &z_phys_nd, std::unique_ptr< MultiFab > &detJ_cc, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool)
 

Function Documentation

-
-

◆ erf_fast_rhs_T()

+ +

◆ erf_fast_rhs_T()

@@ -303,7 +303,13 @@

bool  - l_reflux  + l_reflux, + + + + + bool  +   @@ -340,651 +346,653 @@

[in]mapfac_vmap factor at y-faces [in,out]fr_as_crseYAFluxRegister at level l at level l / l+1 interface [in,out]fr_as_fineYAFluxRegister at level l at level l-1 / l interface + [in]l_use_moisture [in]l_refluxshould we add fluxes to the FluxRegisters? + [in]l_implicit_substepping -
61 {
-
62  BL_PROFILE_REGION("erf_fast_rhs_T()");
-
63 
-
64  const Box& domain = geom.Domain();
-
65  auto const domlo = lbound(domain);
-
66  auto const domhi = ubound(domain);
-
67 
-
68  Real beta_1 = 0.5 * (1.0 - beta_s); // multiplies explicit terms
-
69  Real beta_2 = 0.5 * (1.0 + beta_s); // multiplies implicit terms
+
64 {
+
65  BL_PROFILE_REGION("erf_fast_rhs_T()");
+
66 
+
67  const Box& domain = geom.Domain();
+
68  auto const domlo = lbound(domain);
+
69  auto const domhi = ubound(domain);
70 
-
71  // How much do we project forward the (rho theta) that is used in the horizontal momentum equations
-
72  Real beta_d = 0.1;
+
71  Real beta_1 = 0.5 * (1.0 - beta_s); // multiplies explicit terms
+
72  Real beta_2 = 0.5 * (1.0 + beta_s); // multiplies implicit terms
73 
-
74  const Real* dx = geom.CellSize();
-
75  const GpuArray<Real, AMREX_SPACEDIM> dxInv = geom.InvCellSizeArray();
+
74  // How much do we project forward the (rho theta) that is used in the horizontal momentum equations
+
75  Real beta_d = 0.1;
76 
-
77  Real dxi = dxInv[0];
-
78  Real dyi = dxInv[1];
-
79  Real dzi = dxInv[2];
-
80  const auto& ba = S_stage_data[IntVars::cons].boxArray();
-
81  const auto& dm = S_stage_data[IntVars::cons].DistributionMap();
-
82 
-
83  MultiFab Delta_rho_u( convert(ba,IntVect(1,0,0)), dm, 1, 1);
-
84  MultiFab Delta_rho_v( convert(ba,IntVect(0,1,0)), dm, 1, 1);
-
85  MultiFab Delta_rho_w( convert(ba,IntVect(0,0,1)), dm, 1, IntVect(1,1,0));
-
86  MultiFab Delta_rho ( ba , dm, 1, 1);
-
87  MultiFab Delta_rho_theta( ba , dm, 1, 1);
-
88 
-
89  MultiFab New_rho_u(convert(ba,IntVect(1,0,0)), dm, 1, 1);
-
90  MultiFab New_rho_v(convert(ba,IntVect(0,1,0)), dm, 1, 1);
+
77  const Real* dx = geom.CellSize();
+
78  const GpuArray<Real, AMREX_SPACEDIM> dxInv = geom.InvCellSizeArray();
+
79 
+
80  Real dxi = dxInv[0];
+
81  Real dyi = dxInv[1];
+
82  Real dzi = dxInv[2];
+
83  const auto& ba = S_stage_data[IntVars::cons].boxArray();
+
84  const auto& dm = S_stage_data[IntVars::cons].DistributionMap();
+
85 
+
86  MultiFab Delta_rho_u( convert(ba,IntVect(1,0,0)), dm, 1, 1);
+
87  MultiFab Delta_rho_v( convert(ba,IntVect(0,1,0)), dm, 1, 1);
+
88  MultiFab Delta_rho_w( convert(ba,IntVect(0,0,1)), dm, 1, IntVect(1,1,0));
+
89  MultiFab Delta_rho ( ba , dm, 1, 1);
+
90  MultiFab Delta_rho_theta( ba , dm, 1, 1);
91 
-
92  MultiFab coeff_A_mf(fast_coeffs, make_alias, 0, 1);
-
93  MultiFab inv_coeff_B_mf(fast_coeffs, make_alias, 1, 1);
-
94  MultiFab coeff_C_mf(fast_coeffs, make_alias, 2, 1);
-
95  MultiFab coeff_P_mf(fast_coeffs, make_alias, 3, 1);
-
96  MultiFab coeff_Q_mf(fast_coeffs, make_alias, 4, 1);
-
97 
-
98  // *************************************************************************
-
99  // Set gravity as a vector
-
100  const Array<Real,AMREX_SPACEDIM> grav{0.0, 0.0, -gravity};
-
101  const GpuArray<Real,AMREX_SPACEDIM> grav_gpu{grav[0], grav[1], grav[2]};
-
102 
-
103  MultiFab extrap(S_data[IntVars::cons].boxArray(),S_data[IntVars::cons].DistributionMap(),1,1);
-
104 
-
105  // *************************************************************************
-
106  // First set up some arrays we'll need
-
107  // *************************************************************************
-
108 
-
109 #ifdef _OPENMP
-
110 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
111 #endif
-
112  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
-
113  {
-
114  const Array4<Real> & cur_cons = S_data[IntVars::cons].array(mfi);
-
115  const Array4<const Real>& prev_cons = S_prev[IntVars::cons].const_array(mfi);
-
116  const Array4<const Real>& stage_cons = S_stage_data[IntVars::cons].const_array(mfi);
-
117  const Array4<Real>& lagged_delta_rt = S_scratch[IntVars::cons].array(mfi);
-
118 
-
119  const Array4<Real>& old_drho = Delta_rho.array(mfi);
-
120  const Array4<Real>& old_drho_u = Delta_rho_u.array(mfi);
-
121  const Array4<Real>& old_drho_v = Delta_rho_v.array(mfi);
-
122  const Array4<Real>& old_drho_w = Delta_rho_w.array(mfi);
-
123  const Array4<Real>& old_drho_theta = Delta_rho_theta.array(mfi);
-
124 
-
125  const Array4<const Real>& prev_xmom = S_prev[IntVars::xmom].const_array(mfi);
-
126  const Array4<const Real>& prev_ymom = S_prev[IntVars::ymom].const_array(mfi);
-
127  const Array4<const Real>& prev_zmom = S_prev[IntVars::zmom].const_array(mfi);
-
128 
-
129  const Array4<const Real>& stage_xmom = S_stage_data[IntVars::xmom].const_array(mfi);
-
130  const Array4<const Real>& stage_ymom = S_stage_data[IntVars::ymom].const_array(mfi);
-
131  const Array4<const Real>& stage_zmom = S_stage_data[IntVars::zmom].const_array(mfi);
-
132 
-
133  Box bx = mfi.validbox();
-
134  Box gbx = mfi.tilebox(); gbx.grow(1);
+
92  MultiFab New_rho_u(convert(ba,IntVect(1,0,0)), dm, 1, 1);
+
93  MultiFab New_rho_v(convert(ba,IntVect(0,1,0)), dm, 1, 1);
+
94 
+
95  MultiFab coeff_A_mf(fast_coeffs, make_alias, 0, 1);
+
96  MultiFab inv_coeff_B_mf(fast_coeffs, make_alias, 1, 1);
+
97  MultiFab coeff_C_mf(fast_coeffs, make_alias, 2, 1);
+
98  MultiFab coeff_P_mf(fast_coeffs, make_alias, 3, 1);
+
99  MultiFab coeff_Q_mf(fast_coeffs, make_alias, 4, 1);
+
100 
+
101  // *************************************************************************
+
102  // Set gravity as a vector
+
103  const Array<Real,AMREX_SPACEDIM> grav{0.0, 0.0, -gravity};
+
104  const GpuArray<Real,AMREX_SPACEDIM> grav_gpu{grav[0], grav[1], grav[2]};
+
105 
+
106  MultiFab extrap(S_data[IntVars::cons].boxArray(),S_data[IntVars::cons].DistributionMap(),1,1);
+
107 
+
108  // *************************************************************************
+
109  // First set up some arrays we'll need
+
110  // *************************************************************************
+
111 
+
112 #ifdef _OPENMP
+
113 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
114 #endif
+
115  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
+
116  {
+
117  const Array4<Real> & cur_cons = S_data[IntVars::cons].array(mfi);
+
118  const Array4<const Real>& prev_cons = S_prev[IntVars::cons].const_array(mfi);
+
119  const Array4<const Real>& stage_cons = S_stage_data[IntVars::cons].const_array(mfi);
+
120  const Array4<Real>& lagged_delta_rt = S_scratch[IntVars::cons].array(mfi);
+
121 
+
122  const Array4<Real>& old_drho = Delta_rho.array(mfi);
+
123  const Array4<Real>& old_drho_u = Delta_rho_u.array(mfi);
+
124  const Array4<Real>& old_drho_v = Delta_rho_v.array(mfi);
+
125  const Array4<Real>& old_drho_w = Delta_rho_w.array(mfi);
+
126  const Array4<Real>& old_drho_theta = Delta_rho_theta.array(mfi);
+
127 
+
128  const Array4<const Real>& prev_xmom = S_prev[IntVars::xmom].const_array(mfi);
+
129  const Array4<const Real>& prev_ymom = S_prev[IntVars::ymom].const_array(mfi);
+
130  const Array4<const Real>& prev_zmom = S_prev[IntVars::zmom].const_array(mfi);
+
131 
+
132  const Array4<const Real>& stage_xmom = S_stage_data[IntVars::xmom].const_array(mfi);
+
133  const Array4<const Real>& stage_ymom = S_stage_data[IntVars::ymom].const_array(mfi);
+
134  const Array4<const Real>& stage_zmom = S_stage_data[IntVars::zmom].const_array(mfi);
135 
-
136  if (step == 0) {
-
137  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
138  cur_cons(i,j,k,Rho_comp) = prev_cons(i,j,k,Rho_comp);
-
139  cur_cons(i,j,k,RhoTheta_comp) = prev_cons(i,j,k,RhoTheta_comp);
-
140  });
-
141  } // step = 0
-
142 
-
143  Box gtbx = mfi.nodaltilebox(0); gtbx.grow(IntVect(1,1,0));
-
144  Box gtby = mfi.nodaltilebox(1); gtby.grow(IntVect(1,1,0));
-
145  Box gtbz = mfi.nodaltilebox(2); gtbz.grow(IntVect(1,1,0));
-
146 
-
147  const auto& bx_lo = lbound(bx);
-
148  const auto& bx_hi = ubound(bx);
+
136  Box bx = mfi.validbox();
+
137  Box gbx = mfi.tilebox(); gbx.grow(1);
+
138 
+
139  if (step == 0) {
+
140  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
141  cur_cons(i,j,k,Rho_comp) = prev_cons(i,j,k,Rho_comp);
+
142  cur_cons(i,j,k,RhoTheta_comp) = prev_cons(i,j,k,RhoTheta_comp);
+
143  });
+
144  } // step = 0
+
145 
+
146  Box gtbx = mfi.nodaltilebox(0); gtbx.grow(IntVect(1,1,0));
+
147  Box gtby = mfi.nodaltilebox(1); gtby.grow(IntVect(1,1,0));
+
148  Box gtbz = mfi.nodaltilebox(2); gtbz.grow(IntVect(1,1,0));
149 
-
150  ParallelFor(gtbx, gtby, gtbz,
-
151  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
152  old_drho_u(i,j,k) = prev_xmom(i,j,k) - stage_xmom(i,j,k);
-
153  if (k == bx_lo.z && k != domlo.z) {
-
154  old_drho_u(i,j,k-1) = old_drho_u(i,j,k);
-
155  } else if (k == bx_hi.z) {
-
156  old_drho_u(i,j,k+1) = old_drho_u(i,j,k);
-
157  }
-
158  },
-
159  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
160  old_drho_v(i,j,k) = prev_ymom(i,j,k) - stage_ymom(i,j,k);
-
161  if (k == bx_lo.z && k != domlo.z) {
-
162  old_drho_v(i,j,k-1) = old_drho_v(i,j,k);
-
163  } else if (k == bx_hi.z) {
-
164  old_drho_v(i,j,k+1) = old_drho_v(i,j,k);
-
165  }
-
166  },
-
167  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
168  old_drho_w(i,j,k) = prev_zmom(i,j,k) - stage_zmom(i,j,k);
-
169  });
-
170 
-
171  const Array4<Real>& theta_extrap = extrap.array(mfi);
-
172 
-
173  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
174  old_drho(i,j,k) = cur_cons(i,j,k,Rho_comp) - stage_cons(i,j,k,Rho_comp);
-
175  old_drho_theta(i,j,k) = cur_cons(i,j,k,RhoTheta_comp) - stage_cons(i,j,k,RhoTheta_comp);
-
176  if (step == 0) {
-
177  theta_extrap(i,j,k) = old_drho_theta(i,j,k);
-
178  } else {
-
179  theta_extrap(i,j,k) = old_drho_theta(i,j,k) + beta_d *
-
180  ( old_drho_theta(i,j,k) - lagged_delta_rt(i,j,k,RhoTheta_comp) );
-
181  }
-
182  });
-
183  } // mfi
-
184 
-
185 #ifdef _OPENMP
-
186 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
187 #endif
-
188  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
-
189  {
-
190  // We define lagged_delta_rt for our next step as the current delta_rt
-
191  Box gbx = mfi.tilebox(); gbx.grow(1);
-
192  const Array4<Real>& old_drho_theta = Delta_rho_theta.array(mfi);
-
193  const Array4<Real>& lagged_delta_rt = S_scratch[IntVars::cons].array(mfi);
-
194  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
195  lagged_delta_rt(i,j,k,RhoTheta_comp) = old_drho_theta(i,j,k);
-
196  });
-
197  } // mfi
-
198 
-
199  // *************************************************************************
-
200  // Define updates in the current RK stage
-
201  // *************************************************************************
-
202 
-
203 #ifdef _OPENMP
-
204 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
205 #endif
-
206  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
-
207  {
-
208  Box bx = mfi.validbox();
-
209  Box tbx = mfi.nodaltilebox(0);
-
210  Box tby = mfi.nodaltilebox(1);
-
211 
-
212  const Array4<const Real> & stage_xmom = S_stage_data[IntVars::xmom].const_array(mfi);
-
213  const Array4<const Real> & stage_ymom = S_stage_data[IntVars::ymom].const_array(mfi);
-
214  const Array4<const Real> & prim = S_stage_prim.const_array(mfi);
-
215 
-
216  const Array4<Real>& old_drho_u = Delta_rho_u.array(mfi);
-
217  const Array4<Real>& old_drho_v = Delta_rho_v.array(mfi);
+
150  const auto& bx_lo = lbound(bx);
+
151  const auto& bx_hi = ubound(bx);
+
152 
+
153  ParallelFor(gtbx, gtby, gtbz,
+
154  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
155  old_drho_u(i,j,k) = prev_xmom(i,j,k) - stage_xmom(i,j,k);
+
156  if (k == bx_lo.z && k != domlo.z) {
+
157  old_drho_u(i,j,k-1) = old_drho_u(i,j,k);
+
158  } else if (k == bx_hi.z) {
+
159  old_drho_u(i,j,k+1) = old_drho_u(i,j,k);
+
160  }
+
161  },
+
162  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
163  old_drho_v(i,j,k) = prev_ymom(i,j,k) - stage_ymom(i,j,k);
+
164  if (k == bx_lo.z && k != domlo.z) {
+
165  old_drho_v(i,j,k-1) = old_drho_v(i,j,k);
+
166  } else if (k == bx_hi.z) {
+
167  old_drho_v(i,j,k+1) = old_drho_v(i,j,k);
+
168  }
+
169  },
+
170  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
171  old_drho_w(i,j,k) = prev_zmom(i,j,k) - stage_zmom(i,j,k);
+
172  });
+
173 
+
174  const Array4<Real>& theta_extrap = extrap.array(mfi);
+
175 
+
176  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
177  old_drho(i,j,k) = cur_cons(i,j,k,Rho_comp) - stage_cons(i,j,k,Rho_comp);
+
178  old_drho_theta(i,j,k) = cur_cons(i,j,k,RhoTheta_comp) - stage_cons(i,j,k,RhoTheta_comp);
+
179  if (step == 0) {
+
180  theta_extrap(i,j,k) = old_drho_theta(i,j,k);
+
181  } else {
+
182  theta_extrap(i,j,k) = old_drho_theta(i,j,k) + beta_d *
+
183  ( old_drho_theta(i,j,k) - lagged_delta_rt(i,j,k,RhoTheta_comp) );
+
184  }
+
185  });
+
186  } // mfi
+
187 
+
188 #ifdef _OPENMP
+
189 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
190 #endif
+
191  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
+
192  {
+
193  // We define lagged_delta_rt for our next step as the current delta_rt
+
194  Box gbx = mfi.tilebox(); gbx.grow(1);
+
195  const Array4<Real>& old_drho_theta = Delta_rho_theta.array(mfi);
+
196  const Array4<Real>& lagged_delta_rt = S_scratch[IntVars::cons].array(mfi);
+
197  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
198  lagged_delta_rt(i,j,k,RhoTheta_comp) = old_drho_theta(i,j,k);
+
199  });
+
200  } // mfi
+
201 
+
202  // *************************************************************************
+
203  // Define updates in the current RK stage
+
204  // *************************************************************************
+
205 
+
206 #ifdef _OPENMP
+
207 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
208 #endif
+
209  for ( MFIter mfi(S_stage_data[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
+
210  {
+
211  Box bx = mfi.validbox();
+
212  Box tbx = mfi.nodaltilebox(0);
+
213  Box tby = mfi.nodaltilebox(1);
+
214 
+
215  const Array4<const Real> & stage_xmom = S_stage_data[IntVars::xmom].const_array(mfi);
+
216  const Array4<const Real> & stage_ymom = S_stage_data[IntVars::ymom].const_array(mfi);
+
217  const Array4<const Real> & prim = S_stage_prim.const_array(mfi);
218 
-
219  const Array4<const Real>& slow_rhs_rho_u = S_slow_rhs[IntVars::xmom].const_array(mfi);
-
220  const Array4<const Real>& slow_rhs_rho_v = S_slow_rhs[IntVars::ymom].const_array(mfi);
+
219  const Array4<Real>& old_drho_u = Delta_rho_u.array(mfi);
+
220  const Array4<Real>& old_drho_v = Delta_rho_v.array(mfi);
221 
-
222  const Array4<Real>& new_drho_u = New_rho_u.array(mfi);
-
223  const Array4<Real>& new_drho_v = New_rho_v.array(mfi);
+
222  const Array4<const Real>& slow_rhs_rho_u = S_slow_rhs[IntVars::xmom].const_array(mfi);
+
223  const Array4<const Real>& slow_rhs_rho_v = S_slow_rhs[IntVars::ymom].const_array(mfi);
224 
-
225  const Array4<Real>& cur_xmom = S_data[IntVars::xmom].array(mfi);
-
226  const Array4<Real>& cur_ymom = S_data[IntVars::ymom].array(mfi);
+
225  const Array4<Real>& new_drho_u = New_rho_u.array(mfi);
+
226  const Array4<Real>& new_drho_v = New_rho_v.array(mfi);
227 
-
228  // These store the advection momenta which we will use to update the slow variables
-
229  const Array4<Real>& avg_xmom = S_scratch[IntVars::xmom].array(mfi);
-
230  const Array4<Real>& avg_ymom = S_scratch[IntVars::ymom].array(mfi);
-
231 
-
232  const Array4<const Real>& z_nd = z_phys_nd->const_array(mfi);
-
233 
-
234  const Array4<const Real>& pi_stage_ca = pi_stage.const_array(mfi);
-
235 
-
236  const Array4<Real>& theta_extrap = extrap.array(mfi);
-
237 
-
238  // Map factors
-
239  const Array4<const Real>& mf_u = mapfac_u->const_array(mfi);
-
240  const Array4<const Real>& mf_v = mapfac_v->const_array(mfi);
-
241 
-
242  // Create old_drho_u/v/w/theta = U'', V'', W'', Theta'' in the docs
-
243  // Note that we do the Copy and Subtract including one ghost cell
-
244  // so that we don't have to fill ghost cells of the new MultiFabs
-
245  // Initialize New_rho_u/v/w to Delta_rho_u/v/w so that
-
246  // the ghost cells in New_rho_u/v/w will match old_drho_u/v/w
-
247 
-
248  // *********************************************************************
-
249  // Define updates in the RHS of {x, y, z}-momentum equations
-
250  // *********************************************************************
-
251  {
-
252  BL_PROFILE("fast_rhs_xymom_T");
-
253 
-
254  const auto& bx_lo = lbound(bx);
-
255  const auto& bx_hi = ubound(bx);
+
228  const Array4<Real>& cur_xmom = S_data[IntVars::xmom].array(mfi);
+
229  const Array4<Real>& cur_ymom = S_data[IntVars::ymom].array(mfi);
+
230 
+
231  // These store the advection momenta which we will use to update the slow variables
+
232  const Array4<Real>& avg_xmom = S_scratch[IntVars::xmom].array(mfi);
+
233  const Array4<Real>& avg_ymom = S_scratch[IntVars::ymom].array(mfi);
+
234 
+
235  const Array4<const Real>& z_nd = z_phys_nd->const_array(mfi);
+
236 
+
237  const Array4<const Real>& pi_stage_ca = pi_stage.const_array(mfi);
+
238 
+
239  const Array4<Real>& theta_extrap = extrap.array(mfi);
+
240 
+
241  // Map factors
+
242  const Array4<const Real>& mf_u = mapfac_u->const_array(mfi);
+
243  const Array4<const Real>& mf_v = mapfac_v->const_array(mfi);
+
244 
+
245  // Create old_drho_u/v/w/theta = U'', V'', W'', Theta'' in the docs
+
246  // Note that we do the Copy and Subtract including one ghost cell
+
247  // so that we don't have to fill ghost cells of the new MultiFabs
+
248  // Initialize New_rho_u/v/w to Delta_rho_u/v/w so that
+
249  // the ghost cells in New_rho_u/v/w will match old_drho_u/v/w
+
250 
+
251  // *********************************************************************
+
252  // Define updates in the RHS of {x, y, z}-momentum equations
+
253  // *********************************************************************
+
254  {
+
255  BL_PROFILE("fast_rhs_xymom_T");
256 
-
257  ParallelFor(tbx, tby,
-
258  [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
259  {
-
260  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
-
261  Real met_h_xi = Compute_h_xi_AtIface (i, j, k, dxInv, z_nd);
-
262  Real met_h_zeta = Compute_h_zeta_AtIface(i, j, k, dxInv, z_nd);
-
263  Real gp_xi = (theta_extrap(i,j,k) - theta_extrap(i-1,j,k)) * dxi;
-
264  Real gp_zeta_on_iface = (k == 0) ?
-
265  0.5 * dzi * ( theta_extrap(i-1,j,k+1) + theta_extrap(i,j,k+1)
-
266  -theta_extrap(i-1,j,k ) - theta_extrap(i,j,k ) ) :
-
267  0.25 * dzi * ( theta_extrap(i-1,j,k+1) + theta_extrap(i,j,k+1)
-
268  -theta_extrap(i-1,j,k-1) - theta_extrap(i,j,k-1) );
-
269  Real gpx = gp_xi - (met_h_xi / met_h_zeta) * gp_zeta_on_iface;
-
270  gpx *= mf_u(i,j,0);
-
271 
-
272  if (l_use_moisture) {
-
273  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i-1,j,k,PrimQ1_comp)
-
274  +prim(i,j,k,PrimQ2_comp) + prim(i-1,j,k,PrimQ2_comp) );
-
275  gpx /= (1.0 + q);
-
276  }
-
277 
-
278  Real pi_c = 0.5 * (pi_stage_ca(i-1,j,k,0) + pi_stage_ca(i ,j,k,0));
-
279  Real fast_rhs_rho_u = -Gamma * R_d * pi_c * gpx;
+
257  const auto& bx_lo = lbound(bx);
+
258  const auto& bx_hi = ubound(bx);
+
259 
+
260  ParallelFor(tbx, tby,
+
261  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
262  {
+
263  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
+
264  Real met_h_xi = Compute_h_xi_AtIface (i, j, k, dxInv, z_nd);
+
265  Real met_h_zeta = Compute_h_zeta_AtIface(i, j, k, dxInv, z_nd);
+
266  Real gp_xi = (theta_extrap(i,j,k) - theta_extrap(i-1,j,k)) * dxi;
+
267  Real gp_zeta_on_iface = (k == 0) ?
+
268  0.5 * dzi * ( theta_extrap(i-1,j,k+1) + theta_extrap(i,j,k+1)
+
269  -theta_extrap(i-1,j,k ) - theta_extrap(i,j,k ) ) :
+
270  0.25 * dzi * ( theta_extrap(i-1,j,k+1) + theta_extrap(i,j,k+1)
+
271  -theta_extrap(i-1,j,k-1) - theta_extrap(i,j,k-1) );
+
272  Real gpx = gp_xi - (met_h_xi / met_h_zeta) * gp_zeta_on_iface;
+
273  gpx *= mf_u(i,j,0);
+
274 
+
275  if (l_use_moisture) {
+
276  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i-1,j,k,PrimQ1_comp)
+
277  +prim(i,j,k,PrimQ2_comp) + prim(i-1,j,k,PrimQ2_comp) );
+
278  gpx /= (1.0 + q);
+
279  }
280 
-
281  new_drho_u(i, j, k) = old_drho_u(i,j,k) + dtau * fast_rhs_rho_u
-
282  + dtau * slow_rhs_rho_u(i,j,k);
-
283  if (k == bx_lo.z && k != domlo.z) {
-
284  new_drho_u(i,j,k-1) = new_drho_u(i,j,k);
-
285  } else if (k == bx_hi.z) {
-
286  new_drho_u(i,j,k+1) = new_drho_u(i,j,k);
-
287  }
-
288 
-
289  avg_xmom(i,j,k) += facinv*new_drho_u(i,j,k);
-
290 
-
291  cur_xmom(i,j,k) = stage_xmom(i,j,k) + new_drho_u(i,j,k);
-
292  },
-
293  [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
294  {
-
295  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
-
296  Real met_h_eta = Compute_h_eta_AtJface(i, j, k, dxInv, z_nd);
-
297  Real met_h_zeta = Compute_h_zeta_AtJface(i, j, k, dxInv, z_nd);
-
298  Real gp_eta = (theta_extrap(i,j,k) -theta_extrap(i,j-1,k)) * dyi;
-
299  Real gp_zeta_on_jface = (k == 0) ?
-
300  0.5 * dzi * ( theta_extrap(i,j,k+1) + theta_extrap(i,j-1,k+1)
-
301  -theta_extrap(i,j,k ) - theta_extrap(i,j-1,k ) ) :
-
302  0.25 * dzi * ( theta_extrap(i,j,k+1) + theta_extrap(i,j-1,k+1)
-
303  -theta_extrap(i,j,k-1) - theta_extrap(i,j-1,k-1) );
-
304  Real gpy = gp_eta - (met_h_eta / met_h_zeta) * gp_zeta_on_jface;
-
305  gpy *= mf_v(i,j,0);
-
306 
-
307  if (l_use_moisture) {
-
308  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i,j-1,k,PrimQ1_comp)
-
309  +prim(i,j,k,PrimQ2_comp) + prim(i,j-1,k,PrimQ2_comp) );
-
310  gpy /= (1.0 + q);
-
311  }
-
312 
-
313  Real pi_c = 0.5 * (pi_stage_ca(i,j-1,k,0) + pi_stage_ca(i,j ,k,0));
-
314  Real fast_rhs_rho_v = -Gamma * R_d * pi_c * gpy;
+
281  Real pi_c = 0.5 * (pi_stage_ca(i-1,j,k,0) + pi_stage_ca(i ,j,k,0));
+
282  Real fast_rhs_rho_u = -Gamma * R_d * pi_c * gpx;
+
283 
+
284  new_drho_u(i, j, k) = old_drho_u(i,j,k) + dtau * fast_rhs_rho_u
+
285  + dtau * slow_rhs_rho_u(i,j,k);
+
286  if (k == bx_lo.z && k != domlo.z) {
+
287  new_drho_u(i,j,k-1) = new_drho_u(i,j,k);
+
288  } else if (k == bx_hi.z) {
+
289  new_drho_u(i,j,k+1) = new_drho_u(i,j,k);
+
290  }
+
291 
+
292  avg_xmom(i,j,k) += facinv*new_drho_u(i,j,k);
+
293 
+
294  cur_xmom(i,j,k) = stage_xmom(i,j,k) + new_drho_u(i,j,k);
+
295  },
+
296  [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
297  {
+
298  // Add (negative) gradient of (rho theta) multiplied by lagged "pi"
+
299  Real met_h_eta = Compute_h_eta_AtJface(i, j, k, dxInv, z_nd);
+
300  Real met_h_zeta = Compute_h_zeta_AtJface(i, j, k, dxInv, z_nd);
+
301  Real gp_eta = (theta_extrap(i,j,k) -theta_extrap(i,j-1,k)) * dyi;
+
302  Real gp_zeta_on_jface = (k == 0) ?
+
303  0.5 * dzi * ( theta_extrap(i,j,k+1) + theta_extrap(i,j-1,k+1)
+
304  -theta_extrap(i,j,k ) - theta_extrap(i,j-1,k ) ) :
+
305  0.25 * dzi * ( theta_extrap(i,j,k+1) + theta_extrap(i,j-1,k+1)
+
306  -theta_extrap(i,j,k-1) - theta_extrap(i,j-1,k-1) );
+
307  Real gpy = gp_eta - (met_h_eta / met_h_zeta) * gp_zeta_on_jface;
+
308  gpy *= mf_v(i,j,0);
+
309 
+
310  if (l_use_moisture) {
+
311  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i,j-1,k,PrimQ1_comp)
+
312  +prim(i,j,k,PrimQ2_comp) + prim(i,j-1,k,PrimQ2_comp) );
+
313  gpy /= (1.0 + q);
+
314  }
315 
-
316  new_drho_v(i, j, k) = old_drho_v(i,j,k) + dtau * fast_rhs_rho_v
-
317  + dtau * slow_rhs_rho_v(i,j,k);
+
316  Real pi_c = 0.5 * (pi_stage_ca(i,j-1,k,0) + pi_stage_ca(i,j ,k,0));
+
317  Real fast_rhs_rho_v = -Gamma * R_d * pi_c * gpy;
318 
-
319  if (k == bx_lo.z && k != domlo.z) {
-
320  new_drho_v(i,j,k-1) = new_drho_v(i,j,k);
-
321  } else if (k == bx_hi.z) {
-
322  new_drho_v(i,j,k+1) = new_drho_v(i,j,k);
-
323  }
-
324 
-
325  avg_ymom(i,j,k) += facinv*new_drho_v(i,j,k);
-
326 
-
327  cur_ymom(i,j,k) = stage_ymom(i,j,k) + new_drho_v(i,j,k);
-
328  });
-
329  } // end profile
-
330  }
-
331 
-
332 #ifdef _OPENMP
-
333 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
334 #endif
-
335  {
-
336  std::array<FArrayBox,AMREX_SPACEDIM> flux;
-
337  for ( MFIter mfi(S_stage_data[IntVars::cons],TileNoZ()); mfi.isValid(); ++mfi)
+
319  new_drho_v(i, j, k) = old_drho_v(i,j,k) + dtau * fast_rhs_rho_v
+
320  + dtau * slow_rhs_rho_v(i,j,k);
+
321 
+
322  if (k == bx_lo.z && k != domlo.z) {
+
323  new_drho_v(i,j,k-1) = new_drho_v(i,j,k);
+
324  } else if (k == bx_hi.z) {
+
325  new_drho_v(i,j,k+1) = new_drho_v(i,j,k);
+
326  }
+
327 
+
328  avg_ymom(i,j,k) += facinv*new_drho_v(i,j,k);
+
329 
+
330  cur_ymom(i,j,k) = stage_ymom(i,j,k) + new_drho_v(i,j,k);
+
331  });
+
332  } // end profile
+
333  }
+
334 
+
335 #ifdef _OPENMP
+
336 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
337 #endif
338  {
-
339  Box bx = mfi.tilebox();
-
340  Box tbz = surroundingNodes(bx,2);
-
341 
-
342  Box vbx = mfi.validbox();
-
343  const auto& vbx_hi = ubound(vbx);
+
339  std::array<FArrayBox,AMREX_SPACEDIM> flux;
+
340  for ( MFIter mfi(S_stage_data[IntVars::cons],TileNoZ()); mfi.isValid(); ++mfi)
+
341  {
+
342  Box bx = mfi.tilebox();
+
343  Box tbz = surroundingNodes(bx,2);
344 
-
345  const Array4<const Real> & stage_zmom = S_stage_data[IntVars::zmom].const_array(mfi);
-
346  const Array4<const Real> & prim = S_stage_prim.const_array(mfi);
+
345  Box vbx = mfi.validbox();
+
346  const auto& vbx_hi = ubound(vbx);
347 
-
348  const Array4<Real>& old_drho_u = Delta_rho_u.array(mfi);
-
349  const Array4<Real>& old_drho_v = Delta_rho_v.array(mfi);
-
350  const Array4<Real>& old_drho_w = Delta_rho_w.array(mfi);
-
351  const Array4<Real>& old_drho = Delta_rho.array(mfi);
-
352  const Array4<Real>& old_drho_theta = Delta_rho_theta.array(mfi);
-
353 
-
354  const Array4<const Real>& slow_rhs_cons = S_slow_rhs[IntVars::cons].const_array(mfi);
-
355  const Array4<const Real>& slow_rhs_rho_w = S_slow_rhs[IntVars::zmom].const_array(mfi);
+
348  const Array4<const Real> & stage_zmom = S_stage_data[IntVars::zmom].const_array(mfi);
+
349  const Array4<const Real> & prim = S_stage_prim.const_array(mfi);
+
350 
+
351  const Array4<Real>& old_drho_u = Delta_rho_u.array(mfi);
+
352  const Array4<Real>& old_drho_v = Delta_rho_v.array(mfi);
+
353  const Array4<Real>& old_drho_w = Delta_rho_w.array(mfi);
+
354  const Array4<Real>& old_drho = Delta_rho.array(mfi);
+
355  const Array4<Real>& old_drho_theta = Delta_rho_theta.array(mfi);
356 
-
357  const Array4<Real>& new_drho_u = New_rho_u.array(mfi);
-
358  const Array4<Real>& new_drho_v = New_rho_v.array(mfi);
+
357  const Array4<const Real>& slow_rhs_cons = S_slow_rhs[IntVars::cons].const_array(mfi);
+
358  const Array4<const Real>& slow_rhs_rho_w = S_slow_rhs[IntVars::zmom].const_array(mfi);
359 
-
360  const Array4<Real>& cur_cons = S_data[IntVars::cons].array(mfi);
-
361  const Array4<Real>& cur_zmom = S_data[IntVars::zmom].array(mfi);
+
360  const Array4<Real>& new_drho_u = New_rho_u.array(mfi);
+
361  const Array4<Real>& new_drho_v = New_rho_v.array(mfi);
362 
-
363  // These store the advection momenta which we will use to update the slow variables
-
364  const Array4<Real>& avg_zmom = S_scratch[IntVars::zmom].array(mfi);
+
363  const Array4<Real>& cur_cons = S_data[IntVars::cons].array(mfi);
+
364  const Array4<Real>& cur_zmom = S_data[IntVars::zmom].array(mfi);
365 
-
366  const Array4<const Real>& z_nd = z_phys_nd->const_array(mfi);
-
367  const Array4<const Real>& detJ = detJ_cc->const_array(mfi);
+
366  // These store the advection momenta which we will use to update the slow variables
+
367  const Array4<Real>& avg_zmom = S_scratch[IntVars::zmom].array(mfi);
368 
-
369  const Array4< Real>& omega_arr = Omega.array(mfi);
-
370 
-
371  // Map factors
-
372  const Array4<const Real>& mf_m = mapfac_m->const_array(mfi);
-
373  const Array4<const Real>& mf_u = mapfac_u->const_array(mfi);
-
374  const Array4<const Real>& mf_v = mapfac_v->const_array(mfi);
-
375 
-
376  // Create old_drho_u/v/w/theta = U'', V'', W'', Theta'' in the docs
-
377  // Note that we do the Copy and Subtract including one ghost cell
-
378  // so that we don't have to fill ghost cells of the new MultiFabs
-
379  // Initialize New_rho_u/v/w to Delta_rho_u/v/w so that
-
380  // the ghost cells in New_rho_u/v/w will match old_drho_u/v/w
-
381 
-
382  FArrayBox temp_rhs_fab;
-
383  FArrayBox RHS_fab;
-
384  FArrayBox soln_fab;
-
385 
-
386  RHS_fab.resize (tbz,1,The_Async_Arena());
-
387  soln_fab.resize (tbz,1,The_Async_Arena());
-
388  temp_rhs_fab.resize(tbz,2,The_Async_Arena());
-
389 
-
390  auto const& RHS_a = RHS_fab.array();
-
391  auto const& soln_a = soln_fab.array();
-
392  auto const& temp_rhs_arr = temp_rhs_fab.array();
-
393 
-
394  auto const& coeffA_a = coeff_A_mf.array(mfi);
-
395  auto const& inv_coeffB_a = inv_coeff_B_mf.array(mfi);
-
396  auto const& coeffC_a = coeff_C_mf.array(mfi);
-
397  auto const& coeffP_a = coeff_P_mf.array(mfi);
-
398  auto const& coeffQ_a = coeff_Q_mf.array(mfi);
-
399 
-
400  // *************************************************************************
-
401  // Define flux arrays for use in advection
-
402  // *************************************************************************
-
403  for (int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
-
404  flux[dir].resize(surroundingNodes(bx,dir),2);
-
405  flux[dir].setVal<RunOn::Device>(0.);
-
406  }
-
407  const GpuArray<const Array4<Real>, AMREX_SPACEDIM>
-
408  flx_arr{{AMREX_D_DECL(flux[0].array(), flux[1].array(), flux[2].array())}};
-
409 
-
410  // *********************************************************************
-
411  {
-
412  BL_PROFILE("fast_T_making_rho_rhs");
-
413  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
414  Real h_zeta_cc_xface_hi = 0.5 * dzi *
-
415  ( z_nd(i+1,j ,k+1) + z_nd(i+1,j+1,k+1)
-
416  -z_nd(i+1,j ,k ) - z_nd(i+1,j+1,k ) );
-
417 
-
418  Real h_zeta_cc_xface_lo = 0.5 * dzi *
-
419  ( z_nd(i ,j ,k+1) + z_nd(i ,j+1,k+1)
-
420  -z_nd(i ,j ,k ) - z_nd(i ,j+1,k ) );
-
421 
-
422  Real h_zeta_cc_yface_hi = 0.5 * dzi *
-
423  ( z_nd(i ,j+1,k+1) + z_nd(i+1,j+1,k+1)
-
424  -z_nd(i ,j+1,k ) - z_nd(i+1,j+1,k ) );
-
425 
-
426  Real h_zeta_cc_yface_lo = 0.5 * dzi *
-
427  ( z_nd(i ,j ,k+1) + z_nd(i+1,j ,k+1)
-
428  -z_nd(i ,j ,k ) - z_nd(i+1,j ,k ) );
-
429 
-
430  Real xflux_lo = new_drho_u(i ,j,k)*h_zeta_cc_xface_lo / mf_u(i ,j,0);
-
431  Real xflux_hi = new_drho_u(i+1,j,k)*h_zeta_cc_xface_hi / mf_u(i+1,j,0);
-
432  Real yflux_lo = new_drho_v(i,j ,k)*h_zeta_cc_yface_lo / mf_v(i,j ,0);
-
433  Real yflux_hi = new_drho_v(i,j+1,k)*h_zeta_cc_yface_hi / mf_v(i,j+1,0);
-
434 
-
435  Real mfsq = mf_m(i,j,0) * mf_m(i,j,0);
-
436 
-
437  // NOTE: we are saving the (1/J) weighting for later when we add this to rho and theta
-
438  temp_rhs_arr(i,j,k,0) = ( xflux_hi - xflux_lo ) * dxi * mfsq +
-
439  ( yflux_hi - yflux_lo ) * dyi * mfsq;
-
440  temp_rhs_arr(i,j,k,1) = (( xflux_hi * (prim(i,j,k,0) + prim(i+1,j,k,0)) -
-
441  xflux_lo * (prim(i,j,k,0) + prim(i-1,j,k,0)) ) * dxi * mfsq+
-
442  ( yflux_hi * (prim(i,j,k,0) + prim(i,j+1,k,0)) -
-
443  yflux_lo * (prim(i,j,k,0) + prim(i,j-1,k,0)) ) * dyi * mfsq) * 0.5;
-
444 
-
445  (flx_arr[0])(i,j,k,0) = xflux_lo;
-
446  (flx_arr[0])(i,j,k,1) = (flx_arr[0])(i ,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i-1,j,k,0));
+
369  const Array4<const Real>& z_nd = z_phys_nd->const_array(mfi);
+
370  const Array4<const Real>& detJ = detJ_cc->const_array(mfi);
+
371 
+
372  const Array4< Real>& omega_arr = Omega.array(mfi);
+
373 
+
374  // Map factors
+
375  const Array4<const Real>& mf_m = mapfac_m->const_array(mfi);
+
376  const Array4<const Real>& mf_u = mapfac_u->const_array(mfi);
+
377  const Array4<const Real>& mf_v = mapfac_v->const_array(mfi);
+
378 
+
379  // Create old_drho_u/v/w/theta = U'', V'', W'', Theta'' in the docs
+
380  // Note that we do the Copy and Subtract including one ghost cell
+
381  // so that we don't have to fill ghost cells of the new MultiFabs
+
382  // Initialize New_rho_u/v/w to Delta_rho_u/v/w so that
+
383  // the ghost cells in New_rho_u/v/w will match old_drho_u/v/w
+
384 
+
385  FArrayBox temp_rhs_fab;
+
386  FArrayBox RHS_fab;
+
387  FArrayBox soln_fab;
+
388 
+
389  RHS_fab.resize (tbz,1,The_Async_Arena());
+
390  soln_fab.resize (tbz,1,The_Async_Arena());
+
391  temp_rhs_fab.resize(tbz,2,The_Async_Arena());
+
392 
+
393  auto const& RHS_a = RHS_fab.array();
+
394  auto const& soln_a = soln_fab.array();
+
395  auto const& temp_rhs_arr = temp_rhs_fab.array();
+
396 
+
397  auto const& coeffA_a = coeff_A_mf.array(mfi);
+
398  auto const& inv_coeffB_a = inv_coeff_B_mf.array(mfi);
+
399  auto const& coeffC_a = coeff_C_mf.array(mfi);
+
400  auto const& coeffP_a = coeff_P_mf.array(mfi);
+
401  auto const& coeffQ_a = coeff_Q_mf.array(mfi);
+
402 
+
403  // *************************************************************************
+
404  // Define flux arrays for use in advection
+
405  // *************************************************************************
+
406  for (int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
+
407  flux[dir].resize(surroundingNodes(bx,dir),2);
+
408  flux[dir].setVal<RunOn::Device>(0.);
+
409  }
+
410  const GpuArray<const Array4<Real>, AMREX_SPACEDIM>
+
411  flx_arr{{AMREX_D_DECL(flux[0].array(), flux[1].array(), flux[2].array())}};
+
412 
+
413  // *********************************************************************
+
414  {
+
415  BL_PROFILE("fast_T_making_rho_rhs");
+
416  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
417  Real h_zeta_cc_xface_hi = 0.5 * dzi *
+
418  ( z_nd(i+1,j ,k+1) + z_nd(i+1,j+1,k+1)
+
419  -z_nd(i+1,j ,k ) - z_nd(i+1,j+1,k ) );
+
420 
+
421  Real h_zeta_cc_xface_lo = 0.5 * dzi *
+
422  ( z_nd(i ,j ,k+1) + z_nd(i ,j+1,k+1)
+
423  -z_nd(i ,j ,k ) - z_nd(i ,j+1,k ) );
+
424 
+
425  Real h_zeta_cc_yface_hi = 0.5 * dzi *
+
426  ( z_nd(i ,j+1,k+1) + z_nd(i+1,j+1,k+1)
+
427  -z_nd(i ,j+1,k ) - z_nd(i+1,j+1,k ) );
+
428 
+
429  Real h_zeta_cc_yface_lo = 0.5 * dzi *
+
430  ( z_nd(i ,j ,k+1) + z_nd(i+1,j ,k+1)
+
431  -z_nd(i ,j ,k ) - z_nd(i+1,j ,k ) );
+
432 
+
433  Real xflux_lo = new_drho_u(i ,j,k)*h_zeta_cc_xface_lo / mf_u(i ,j,0);
+
434  Real xflux_hi = new_drho_u(i+1,j,k)*h_zeta_cc_xface_hi / mf_u(i+1,j,0);
+
435  Real yflux_lo = new_drho_v(i,j ,k)*h_zeta_cc_yface_lo / mf_v(i,j ,0);
+
436  Real yflux_hi = new_drho_v(i,j+1,k)*h_zeta_cc_yface_hi / mf_v(i,j+1,0);
+
437 
+
438  Real mfsq = mf_m(i,j,0) * mf_m(i,j,0);
+
439 
+
440  // NOTE: we are saving the (1/J) weighting for later when we add this to rho and theta
+
441  temp_rhs_arr(i,j,k,0) = ( xflux_hi - xflux_lo ) * dxi * mfsq +
+
442  ( yflux_hi - yflux_lo ) * dyi * mfsq;
+
443  temp_rhs_arr(i,j,k,1) = (( xflux_hi * (prim(i,j,k,0) + prim(i+1,j,k,0)) -
+
444  xflux_lo * (prim(i,j,k,0) + prim(i-1,j,k,0)) ) * dxi * mfsq+
+
445  ( yflux_hi * (prim(i,j,k,0) + prim(i,j+1,k,0)) -
+
446  yflux_lo * (prim(i,j,k,0) + prim(i,j-1,k,0)) ) * dyi * mfsq) * 0.5;
447 
-
448  (flx_arr[1])(i,j,k,0) = yflux_lo;
-
449  (flx_arr[1])(i,j,k,1) = (flx_arr[0])(i,j ,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j-1,k,0));
+
448  (flx_arr[0])(i,j,k,0) = xflux_lo;
+
449  (flx_arr[0])(i,j,k,1) = (flx_arr[0])(i ,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i-1,j,k,0));
450 
-
451  if (i == vbx_hi.x) {
-
452  (flx_arr[0])(i+1,j,k,0) = xflux_hi;
-
453  (flx_arr[0])(i+1,j,k,1) = (flx_arr[0])(i+1,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i+1,j,k,0));
-
454  }
-
455  if (j == vbx_hi.y) {
-
456  (flx_arr[1])(i,j+1,k,0) = yflux_hi;
-
457  (flx_arr[1])(i,j+1,k,1) = (flx_arr[1])(i,j+1,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j+1,k,0));
-
458  }
-
459 
-
460  });
-
461  } // end profile
+
451  (flx_arr[1])(i,j,k,0) = yflux_lo;
+
452  (flx_arr[1])(i,j,k,1) = (flx_arr[0])(i,j ,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j-1,k,0));
+
453 
+
454  if (i == vbx_hi.x) {
+
455  (flx_arr[0])(i+1,j,k,0) = xflux_hi;
+
456  (flx_arr[0])(i+1,j,k,1) = (flx_arr[0])(i+1,j,k,0) * 0.5 * (prim(i,j,k,0) + prim(i+1,j,k,0));
+
457  }
+
458  if (j == vbx_hi.y) {
+
459  (flx_arr[1])(i,j+1,k,0) = yflux_hi;
+
460  (flx_arr[1])(i,j+1,k,1) = (flx_arr[1])(i,j+1,k,0) * 0.5 * (prim(i,j,k,0) + prim(i,j+1,k,0));
+
461  }
462 
-
463  // *********************************************************************
-
464  {
-
465  Box gbxo = mfi.nodaltilebox(2);
-
466  Box gbxo_mid = gbxo;
-
467 
-
468  if (gbxo.smallEnd(2) == domlo.z) {
-
469  Box gbxo_lo = gbxo; gbxo_lo.setBig(2,gbxo.smallEnd(2));
-
470  gbxo_mid.setSmall(2,gbxo.smallEnd(2)+1);
-
471  ParallelFor(gbxo_lo, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
472  omega_arr(i,j,k) = 0.;
-
473  });
-
474  }
-
475  if (gbxo.bigEnd(2) == domhi.z+1) {
-
476  Box gbxo_hi = gbxo; gbxo_hi.setSmall(2,gbxo.bigEnd(2));
-
477  gbxo_mid.setBig(2,gbxo.bigEnd(2)-1);
-
478  ParallelFor(gbxo_hi, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
479  omega_arr(i,j,k) = old_drho_w(i,j,k);
-
480  });
-
481  }
-
482  ParallelFor(gbxo_mid, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
483  omega_arr(i,j,k) = OmegaFromW(i,j,k,old_drho_w(i,j,k),old_drho_u,old_drho_v,z_nd,dxInv);
-
484  });
-
485  } // end profile
-
486  // *********************************************************************
-
487 
-
488  Box bx_shrunk_in_k = bx;
-
489  int klo = tbz.smallEnd(2);
-
490  int khi = tbz.bigEnd(2);
-
491  bx_shrunk_in_k.setSmall(2,klo+1);
-
492  bx_shrunk_in_k.setBig(2,khi-1);
-
493 
-
494  // Note that the notes use "g" to mean the magnitude of gravity, so it is positive
-
495  // We set grav_gpu[2] to be the vector component which is negative
-
496  // We define halfg to match the notes (which is why we take the absolute value)
-
497  Real halfg = std::abs(0.5 * grav_gpu[2]);
-
498 
-
499  {
-
500  BL_PROFILE("fast_loop_on_shrunk_t");
-
501  //Note we don't act on the bottom or top boundaries of the domain
-
502  ParallelFor(bx_shrunk_in_k, [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
503  {
-
504  Real detJ_on_kface = 0.5 * (detJ(i,j,k) + detJ(i,j,k-1));
-
505 
-
506  Real coeff_P = coeffP_a(i,j,k);
-
507  Real coeff_Q = coeffQ_a(i,j,k);
+
463  });
+
464  } // end profile
+
465 
+
466  // *********************************************************************
+
467  {
+
468  Box gbxo = mfi.nodaltilebox(2);
+
469  Box gbxo_mid = gbxo;
+
470 
+
471  if (gbxo.smallEnd(2) == domlo.z) {
+
472  Box gbxo_lo = gbxo; gbxo_lo.setBig(2,gbxo.smallEnd(2));
+
473  gbxo_mid.setSmall(2,gbxo.smallEnd(2)+1);
+
474  ParallelFor(gbxo_lo, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
475  omega_arr(i,j,k) = 0.;
+
476  });
+
477  }
+
478  if (gbxo.bigEnd(2) == domhi.z+1) {
+
479  Box gbxo_hi = gbxo; gbxo_hi.setSmall(2,gbxo.bigEnd(2));
+
480  gbxo_mid.setBig(2,gbxo.bigEnd(2)-1);
+
481  ParallelFor(gbxo_hi, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
482  omega_arr(i,j,k) = old_drho_w(i,j,k);
+
483  });
+
484  }
+
485  ParallelFor(gbxo_mid, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
486  omega_arr(i,j,k) = OmegaFromW(i,j,k,old_drho_w(i,j,k),old_drho_u,old_drho_v,z_nd,dxInv);
+
487  });
+
488  } // end profile
+
489  // *********************************************************************
+
490 
+
491  Box bx_shrunk_in_k = bx;
+
492  int klo = tbz.smallEnd(2);
+
493  int khi = tbz.bigEnd(2);
+
494  bx_shrunk_in_k.setSmall(2,klo+1);
+
495  bx_shrunk_in_k.setBig(2,khi-1);
+
496 
+
497  // Note that the notes use "g" to mean the magnitude of gravity, so it is positive
+
498  // We set grav_gpu[2] to be the vector component which is negative
+
499  // We define halfg to match the notes (which is why we take the absolute value)
+
500  Real halfg = std::abs(0.5 * grav_gpu[2]);
+
501 
+
502  {
+
503  BL_PROFILE("fast_loop_on_shrunk_t");
+
504  //Note we don't act on the bottom or top boundaries of the domain
+
505  ParallelFor(bx_shrunk_in_k, [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
506  {
+
507  Real detJ_on_kface = 0.5 * (detJ(i,j,k) + detJ(i,j,k-1));
508 
-
509  if (l_use_moisture) {
-
510  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i,j,k-1,PrimQ1_comp)
-
511  +prim(i,j,k,PrimQ2_comp) + prim(i,j,k-1,PrimQ2_comp) );
-
512  coeff_P /= (1.0 + q);
-
513  coeff_Q /= (1.0 + q);
-
514  }
-
515 
-
516  Real theta_t_lo = 0.5 * ( prim(i,j,k-2,PrimTheta_comp) + prim(i,j,k-1,PrimTheta_comp) );
-
517  Real theta_t_mid = 0.5 * ( prim(i,j,k-1,PrimTheta_comp) + prim(i,j,k ,PrimTheta_comp) );
-
518  Real theta_t_hi = 0.5 * ( prim(i,j,k ,PrimTheta_comp) + prim(i,j,k+1,PrimTheta_comp) );
-
519 
-
520  // line 2 last two terms (order dtau)
-
521  Real R0_tmp = (-halfg * old_drho(i,j,k ) + coeff_P * old_drho_theta(i,j,k )) * detJ(i,j,k )
-
522  + (-halfg * old_drho(i,j,k-1) + coeff_Q * old_drho_theta(i,j,k-1)) * detJ(i,j,k-1);
-
523 
-
524  // line 3 residuals (order dtau^2) 1.0 <-> beta_2
-
525  Real R1_tmp = - halfg * ( slow_rhs_cons(i,j,k ,Rho_comp ) * detJ(i,j,k ) +
-
526  slow_rhs_cons(i,j,k-1,Rho_comp ) * detJ(i,j,k-1) )
-
527  + ( coeff_P * slow_rhs_cons(i,j,k ,RhoTheta_comp) * detJ(i,j,k ) +
-
528  coeff_Q * slow_rhs_cons(i,j,k-1,RhoTheta_comp) * detJ(i,j,k-1) );
-
529 
-
530  Real Omega_kp1 = omega_arr(i,j,k+1);
-
531  Real Omega_k = omega_arr(i,j,k );
-
532  Real Omega_km1 = omega_arr(i,j,k-1);
-
533 
-
534  // consolidate lines 4&5 (order dtau^2)
-
535  R1_tmp += ( halfg ) *
-
536  ( beta_1 * dzi * (Omega_kp1 - Omega_km1) + temp_rhs_arr(i,j,k,Rho_comp) + temp_rhs_arr(i,j,k-1,Rho_comp));
-
537 
-
538  // consolidate lines 6&7 (order dtau^2)
-
539  R1_tmp += -(
-
540  coeff_P * ( beta_1 * dzi * (Omega_kp1*theta_t_hi - Omega_k*theta_t_mid) + temp_rhs_arr(i,j,k ,RhoTheta_comp) ) +
-
541  coeff_Q * ( beta_1 * dzi * (Omega_k*theta_t_mid - Omega_km1*theta_t_lo) + temp_rhs_arr(i,j,k-1,RhoTheta_comp) ) );
-
542 
-
543  // line 1
-
544  RHS_a(i,j,k) = detJ_on_kface * old_drho_w(i,j,k) + dtau * (
-
545  detJ_on_kface * slow_rhs_rho_w(i,j,k) + R0_tmp + dtau*beta_2*R1_tmp);
-
546 
-
547  // We cannot use omega_arr here since that was built with old_rho_u and old_rho_v ...
-
548  RHS_a(i,j,k) += detJ_on_kface * OmegaFromW(i,j,k,0.,new_drho_u,new_drho_v,z_nd,dxInv);
-
549  });
-
550  } // end profile
-
551 
-
552  Box b2d = tbz; // Copy constructor
-
553  b2d.setRange(2,0);
+
509  Real coeff_P = coeffP_a(i,j,k);
+
510  Real coeff_Q = coeffQ_a(i,j,k);
+
511 
+
512  if (l_use_moisture) {
+
513  Real q = 0.5 * ( prim(i,j,k,PrimQ1_comp) + prim(i,j,k-1,PrimQ1_comp)
+
514  +prim(i,j,k,PrimQ2_comp) + prim(i,j,k-1,PrimQ2_comp) );
+
515  coeff_P /= (1.0 + q);
+
516  coeff_Q /= (1.0 + q);
+
517  }
+
518 
+
519  Real theta_t_lo = 0.5 * ( prim(i,j,k-2,PrimTheta_comp) + prim(i,j,k-1,PrimTheta_comp) );
+
520  Real theta_t_mid = 0.5 * ( prim(i,j,k-1,PrimTheta_comp) + prim(i,j,k ,PrimTheta_comp) );
+
521  Real theta_t_hi = 0.5 * ( prim(i,j,k ,PrimTheta_comp) + prim(i,j,k+1,PrimTheta_comp) );
+
522 
+
523  // line 2 last two terms (order dtau)
+
524  Real R0_tmp = (-halfg * old_drho(i,j,k ) + coeff_P * old_drho_theta(i,j,k )) * detJ(i,j,k )
+
525  + (-halfg * old_drho(i,j,k-1) + coeff_Q * old_drho_theta(i,j,k-1)) * detJ(i,j,k-1);
+
526 
+
527  // line 3 residuals (order dtau^2) 1.0 <-> beta_2
+
528  Real R1_tmp = - halfg * ( slow_rhs_cons(i,j,k ,Rho_comp ) * detJ(i,j,k ) +
+
529  slow_rhs_cons(i,j,k-1,Rho_comp ) * detJ(i,j,k-1) )
+
530  + ( coeff_P * slow_rhs_cons(i,j,k ,RhoTheta_comp) * detJ(i,j,k ) +
+
531  coeff_Q * slow_rhs_cons(i,j,k-1,RhoTheta_comp) * detJ(i,j,k-1) );
+
532 
+
533  Real Omega_kp1 = omega_arr(i,j,k+1);
+
534  Real Omega_k = omega_arr(i,j,k );
+
535  Real Omega_km1 = omega_arr(i,j,k-1);
+
536 
+
537  // consolidate lines 4&5 (order dtau^2)
+
538  R1_tmp += ( halfg ) *
+
539  ( beta_1 * dzi * (Omega_kp1 - Omega_km1) + temp_rhs_arr(i,j,k,Rho_comp) + temp_rhs_arr(i,j,k-1,Rho_comp));
+
540 
+
541  // consolidate lines 6&7 (order dtau^2)
+
542  R1_tmp += -(
+
543  coeff_P * ( beta_1 * dzi * (Omega_kp1*theta_t_hi - Omega_k*theta_t_mid) + temp_rhs_arr(i,j,k ,RhoTheta_comp) ) +
+
544  coeff_Q * ( beta_1 * dzi * (Omega_k*theta_t_mid - Omega_km1*theta_t_lo) + temp_rhs_arr(i,j,k-1,RhoTheta_comp) ) );
+
545 
+
546  // line 1
+
547  RHS_a(i,j,k) = detJ_on_kface * old_drho_w(i,j,k) + dtau * (
+
548  detJ_on_kface * slow_rhs_rho_w(i,j,k) + R0_tmp + dtau*beta_2*R1_tmp);
+
549 
+
550  // We cannot use omega_arr here since that was built with old_rho_u and old_rho_v ...
+
551  RHS_a(i,j,k) += detJ_on_kface * OmegaFromW(i,j,k,0.,new_drho_u,new_drho_v,z_nd,dxInv);
+
552  });
+
553  } // end profile
554 
-
555  auto const lo = lbound(bx);
-
556  auto const hi = ubound(bx);
+
555  Box b2d = tbz; // Copy constructor
+
556  b2d.setRange(2,0);
557 
-
558  {
-
559  BL_PROFILE("fast_rhs_b2d_loop_t");
-
560 #ifdef AMREX_USE_GPU
-
561  ParallelFor(b2d, [=] AMREX_GPU_DEVICE (int i, int j, int)
-
562  {
-
563  // w_klo, w_khi given by specified Dirichlet values
-
564  RHS_a(i,j,lo.z ) = dtau * slow_rhs_rho_w(i,j,lo.z);
-
565  RHS_a(i,j,hi.z+1) = dtau * slow_rhs_rho_w(i,j,hi.z+1);
-
566 
-
567  // w = specified Dirichlet value at k = lo.z
-
568  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
+
558  auto const lo = lbound(bx);
+
559  auto const hi = ubound(bx);
+
560 
+
561  {
+
562  BL_PROFILE("fast_rhs_b2d_loop_t");
+
563 #ifdef AMREX_USE_GPU
+
564  ParallelFor(b2d, [=] AMREX_GPU_DEVICE (int i, int j, int)
+
565  {
+
566  // w_klo, w_khi given by specified Dirichlet values
+
567  RHS_a(i,j,lo.z ) = dtau * slow_rhs_rho_w(i,j,lo.z);
+
568  RHS_a(i,j,hi.z+1) = dtau * slow_rhs_rho_w(i,j,hi.z+1);
569 
-
570  for (int k = lo.z+1; k <= hi.z+1; k++) {
-
571  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
-
572  }
-
573 
-
574  cur_zmom(i,j,lo.z ) = stage_zmom(i,j,lo.z ) + soln_a(i,j,lo.z );
-
575  cur_zmom(i,j,hi.z+1) = stage_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
+
570  // w = specified Dirichlet value at k = lo.z
+
571  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
+
572 
+
573  for (int k = lo.z+1; k <= hi.z+1; k++) {
+
574  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
+
575  }
576 
-
577  for (int k = hi.z; k >= lo.z; k--) {
-
578  soln_a(i,j,k) -= ( coeffC_a(i,j,k) * inv_coeffB_a(i,j,k) ) *soln_a(i,j,k+1);
-
579  }
-
580  });
-
581 #else
-
582  for (int j = lo.y; j <= hi.y; ++j) {
-
583  AMREX_PRAGMA_SIMD
-
584  for (int i = lo.x; i <= hi.x; ++i)
-
585  {
-
586  RHS_a(i,j,lo.z) = dtau * slow_rhs_rho_w(i,j,lo.z);
-
587  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
-
588  }
-
589 
-
590  AMREX_PRAGMA_SIMD
-
591  for (int i = lo.x; i <= hi.x; ++i)
-
592  {
-
593  RHS_a(i,j,hi.z+1) = dtau * slow_rhs_rho_w(i,j,hi.z+1);
-
594  soln_a(i,j,hi.z+1) = RHS_a(i,j,hi.z+1) * inv_coeffB_a(i,j,hi.z+1);
-
595  }
-
596  }
-
597 
-
598  for (int k = lo.z+1; k <= hi.z; ++k) {
-
599  for (int j = lo.y; j <= hi.y; ++j) {
-
600  AMREX_PRAGMA_SIMD
-
601  for (int i = lo.x; i <= hi.x; ++i) {
-
602  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
-
603  }
-
604  }
-
605  }
-
606  for (int k = hi.z; k > lo.z; --k) {
-
607  for (int j = lo.y; j <= hi.y; ++j) {
-
608  AMREX_PRAGMA_SIMD
-
609  for (int i = lo.x; i <= hi.x; ++i) {
-
610  soln_a(i,j,k) -= (coeffC_a(i,j,k) * inv_coeffB_a(i,j,k)) * soln_a(i,j,k+1);
-
611  }
-
612  }
-
613  }
-
614  if (hi.z == domhi.z) {
-
615  for (int j = lo.y; j <= hi.y; ++j) {
-
616  AMREX_PRAGMA_SIMD
-
617  for (int i = lo.x; i <= hi.x; ++i) {
-
618  cur_zmom(i,j,hi.z+1) = stage_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
-
619  }
-
620  }
-
621  }
-
622 #endif
-
623  } // end profile
-
624 
-
625  ParallelFor(tbz, [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
626  {
-
627  cur_zmom(i,j,k) = stage_zmom(i,j,k);
-
628  });
-
629 
-
630  if (lo.z == domlo.z) {
-
631  tbz.setSmall(2,domlo.z+1);
-
632  }
-
633  if (hi.z == domhi.z) {
-
634  tbz.setBig(2,domhi.z);
+
577  cur_zmom(i,j,lo.z ) = stage_zmom(i,j,lo.z ) + soln_a(i,j,lo.z );
+
578  cur_zmom(i,j,hi.z+1) = stage_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
+
579 
+
580  for (int k = hi.z; k >= lo.z; k--) {
+
581  soln_a(i,j,k) -= ( coeffC_a(i,j,k) * inv_coeffB_a(i,j,k) ) *soln_a(i,j,k+1);
+
582  }
+
583  });
+
584 #else
+
585  for (int j = lo.y; j <= hi.y; ++j) {
+
586  AMREX_PRAGMA_SIMD
+
587  for (int i = lo.x; i <= hi.x; ++i)
+
588  {
+
589  RHS_a(i,j,lo.z) = dtau * slow_rhs_rho_w(i,j,lo.z);
+
590  soln_a(i,j,lo.z) = RHS_a(i,j,lo.z) * inv_coeffB_a(i,j,lo.z);
+
591  }
+
592 
+
593  AMREX_PRAGMA_SIMD
+
594  for (int i = lo.x; i <= hi.x; ++i)
+
595  {
+
596  RHS_a(i,j,hi.z+1) = dtau * slow_rhs_rho_w(i,j,hi.z+1);
+
597  soln_a(i,j,hi.z+1) = RHS_a(i,j,hi.z+1) * inv_coeffB_a(i,j,hi.z+1);
+
598  }
+
599  }
+
600 
+
601  for (int k = lo.z+1; k <= hi.z; ++k) {
+
602  for (int j = lo.y; j <= hi.y; ++j) {
+
603  AMREX_PRAGMA_SIMD
+
604  for (int i = lo.x; i <= hi.x; ++i) {
+
605  soln_a(i,j,k) = (RHS_a(i,j,k)-coeffA_a(i,j,k)*soln_a(i,j,k-1)) * inv_coeffB_a(i,j,k);
+
606  }
+
607  }
+
608  }
+
609  for (int k = hi.z; k > lo.z; --k) {
+
610  for (int j = lo.y; j <= hi.y; ++j) {
+
611  AMREX_PRAGMA_SIMD
+
612  for (int i = lo.x; i <= hi.x; ++i) {
+
613  soln_a(i,j,k) -= (coeffC_a(i,j,k) * inv_coeffB_a(i,j,k)) * soln_a(i,j,k+1);
+
614  }
+
615  }
+
616  }
+
617  if (hi.z == domhi.z) {
+
618  for (int j = lo.y; j <= hi.y; ++j) {
+
619  AMREX_PRAGMA_SIMD
+
620  for (int i = lo.x; i <= hi.x; ++i) {
+
621  cur_zmom(i,j,hi.z+1) = stage_zmom(i,j,hi.z+1) + soln_a(i,j,hi.z+1);
+
622  }
+
623  }
+
624  }
+
625 #endif
+
626  } // end profile
+
627 
+
628  ParallelFor(tbz, [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
629  {
+
630  cur_zmom(i,j,k) = stage_zmom(i,j,k);
+
631  });
+
632 
+
633  if (lo.z == domlo.z) {
+
634  tbz.setSmall(2,domlo.z+1);
635  }
-
636  ParallelFor(tbz, [=] AMREX_GPU_DEVICE (int i, int j, int k)
-
637  {
-
638  Real wpp = WFromOmega(i,j,k,soln_a(i,j,k),new_drho_u,new_drho_v,z_nd,dxInv);
-
639  cur_zmom(i,j,k) += wpp;
-
640  });
-
641 
-
642  // **************************************************************************
-
643  // Define updates in the RHS of rho and (rho theta)
-
644  // **************************************************************************
-
645 
-
646  {
-
647  BL_PROFILE("fast_rho_final_update");
-
648  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
+
636  if (hi.z == domhi.z) {
+
637  tbz.setBig(2,domhi.z);
+
638  }
+
639  ParallelFor(tbz, [=] AMREX_GPU_DEVICE (int i, int j, int k)
+
640  {
+
641  Real wpp = WFromOmega(i,j,k,soln_a(i,j,k),new_drho_u,new_drho_v,z_nd,dxInv);
+
642  cur_zmom(i,j,k) += wpp;
+
643  });
+
644 
+
645  // **************************************************************************
+
646  // Define updates in the RHS of rho and (rho theta)
+
647  // **************************************************************************
+
648 
649  {
-
650  Real zflux_lo = beta_2 * soln_a(i,j,k ) + beta_1 * omega_arr(i,j,k);
-
651  Real zflux_hi = beta_2 * soln_a(i,j,k+1) + beta_1 * omega_arr(i,j,k+1);
-
652 
-
653  // Note that in the solve we effectively impose new_drho_w(i,j,vbx_hi.z+1)=0
-
654  // so we don't update avg_zmom at k=vbx_hi.z+1
-
655  avg_zmom(i,j,k) += facinv*zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
-
656  (flx_arr[2])(i,j,k,0) = zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
-
657 
-
658  if (k == vbx_hi.z) {
-
659  avg_zmom(i,j,k+1) += facinv * zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
-
660  (flx_arr[2])(i,j,k+1,0) = zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
-
661  (flx_arr[2])(i,j,k+1,1) = (flx_arr[2])(i,j,k+1,0) * 0.5 * (prim(i,j,k) + prim(i,j,k+1));
-
662  }
-
663 
-
664  Real fast_rhs_rho = -(temp_rhs_arr(i,j,k,0) + ( zflux_hi - zflux_lo ) * dzi) / detJ(i,j,k);
-
665  cur_cons(i,j,k,0) += dtau * (slow_rhs_cons(i,j,k,0) + fast_rhs_rho);
+
650  BL_PROFILE("fast_rho_final_update");
+
651  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
+
652  {
+
653  Real zflux_lo = beta_2 * soln_a(i,j,k ) + beta_1 * omega_arr(i,j,k);
+
654  Real zflux_hi = beta_2 * soln_a(i,j,k+1) + beta_1 * omega_arr(i,j,k+1);
+
655 
+
656  // Note that in the solve we effectively impose new_drho_w(i,j,vbx_hi.z+1)=0
+
657  // so we don't update avg_zmom at k=vbx_hi.z+1
+
658  avg_zmom(i,j,k) += facinv*zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
+
659  (flx_arr[2])(i,j,k,0) = zflux_lo / (mf_m(i,j,0) * mf_m(i,j,0));
+
660 
+
661  if (k == vbx_hi.z) {
+
662  avg_zmom(i,j,k+1) += facinv * zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
+
663  (flx_arr[2])(i,j,k+1,0) = zflux_hi / (mf_m(i,j,0) * mf_m(i,j,0));
+
664  (flx_arr[2])(i,j,k+1,1) = (flx_arr[2])(i,j,k+1,0) * 0.5 * (prim(i,j,k) + prim(i,j,k+1));
+
665  }
666 
-
667  Real fast_rhs_rhotheta = -( temp_rhs_arr(i,j,k,1) + 0.5 *
-
668  ( zflux_hi * (prim(i,j,k) + prim(i,j,k+1)) -
-
669  zflux_lo * (prim(i,j,k) + prim(i,j,k-1)) ) * dzi ) / detJ(i,j,k);
-
670 
-
671  cur_cons(i,j,k,1) += dtau * (slow_rhs_cons(i,j,k,1) + fast_rhs_rhotheta);
-
672 
-
673  (flx_arr[2])(i,j,k,1) = (flx_arr[2])(i,j,k,0) * 0.5 * (prim(i,j,k) + prim(i,j,k-1));
-
674  });
-
675  } // end profile
-
676 
-
677  // We only add to the flux registers in the final RK step
-
678  if (l_reflux && nrk == 2) {
-
679  int strt_comp_reflux = 0;
-
680  // For now we don't reflux (rho theta) because it seems to create issues at c/f boundaries
-
681  int num_comp_reflux = 1;
-
682  if (level < finest_level) {
-
683  fr_as_crse->CrseAdd(mfi,
-
684  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
-
685  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
-
686  }
-
687  if (level > 0) {
-
688  fr_as_fine->FineAdd(mfi,
-
689  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
-
690  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
-
691  }
-
692 
-
693  // This is necessary here so we don't go on to the next FArrayBox without
-
694  // having finished copying the fluxes into the FluxRegisters (since the fluxes
-
695  // are stored in temporary FArrayBox's)
-
696  Gpu::streamSynchronize();
-
697 
-
698  } // two-way coupling
-
699  } // mfi
-
700  } // OMP
-
701 }
+
667  Real fast_rhs_rho = -(temp_rhs_arr(i,j,k,0) + ( zflux_hi - zflux_lo ) * dzi) / detJ(i,j,k);
+
668  cur_cons(i,j,k,0) += dtau * (slow_rhs_cons(i,j,k,0) + fast_rhs_rho);
+
669 
+
670  Real fast_rhs_rhotheta = -( temp_rhs_arr(i,j,k,1) + 0.5 *
+
671  ( zflux_hi * (prim(i,j,k) + prim(i,j,k+1)) -
+
672  zflux_lo * (prim(i,j,k) + prim(i,j,k-1)) ) * dzi ) / detJ(i,j,k);
+
673 
+
674  cur_cons(i,j,k,1) += dtau * (slow_rhs_cons(i,j,k,1) + fast_rhs_rhotheta);
+
675 
+
676  (flx_arr[2])(i,j,k,1) = (flx_arr[2])(i,j,k,0) * 0.5 * (prim(i,j,k) + prim(i,j,k-1));
+
677  });
+
678  } // end profile
+
679 
+
680  // We only add to the flux registers in the final RK step
+
681  if (l_reflux && nrk == 2) {
+
682  int strt_comp_reflux = 0;
+
683  // For now we don't reflux (rho theta) because it seems to create issues at c/f boundaries
+
684  int num_comp_reflux = 1;
+
685  if (level < finest_level) {
+
686  fr_as_crse->CrseAdd(mfi,
+
687  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
+
688  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
+
689  }
+
690  if (level > 0) {
+
691  fr_as_fine->FineAdd(mfi,
+
692  {{AMREX_D_DECL(&(flux[0]), &(flux[1]), &(flux[2]))}},
+
693  dx, dtau, strt_comp_reflux, strt_comp_reflux, num_comp_reflux, RunOn::Device);
+
694  }
+
695 
+
696  // This is necessary here so we don't go on to the next FArrayBox without
+
697  // having finished copying the fluxes into the FluxRegisters (since the fluxes
+
698  // are stored in temporary FArrayBox's)
+
699  Gpu::streamSynchronize();
+
700 
+
701  } // two-way coupling
+
702  } // mfi
+
703  } // OMP
+
704 }
constexpr amrex::Real R_d
Definition: ERF_Constants.H:10
constexpr amrex::Real Gamma
Definition: ERF_Constants.H:19
#define PrimQ1_comp
Definition: ERF_IndexDefines.H:55
@@ -1006,8 +1014,8 @@

Here is the call graph for this function:

-
- +
+ diff --git a/ERF__fast__rhs__T_8cpp.js b/ERF__fast__rhs__T_8cpp.js index 296596e299..d10ecd136e 100644 --- a/ERF__fast__rhs__T_8cpp.js +++ b/ERF__fast__rhs__T_8cpp.js @@ -1,4 +1,4 @@ var ERF__fast__rhs__T_8cpp = [ - [ "erf_fast_rhs_T", "ERF__fast__rhs__T_8cpp.html#ae4a7d29a6d504859aace287598d99eb1", null ] + [ "erf_fast_rhs_T", "ERF__fast__rhs__T_8cpp.html#a7f6548841f1ba09e67dbcdf782788659", null ] ]; \ No newline at end of file diff --git a/ERF__fast__rhs__T_8cpp_ae4a7d29a6d504859aace287598d99eb1_cgraph.map b/ERF__fast__rhs__T_8cpp_a7f6548841f1ba09e67dbcdf782788659_cgraph.map similarity index 100% rename from ERF__fast__rhs__T_8cpp_ae4a7d29a6d504859aace287598d99eb1_cgraph.map rename to ERF__fast__rhs__T_8cpp_a7f6548841f1ba09e67dbcdf782788659_cgraph.map diff --git a/ERF__fast__rhs__T_8cpp_ae4a7d29a6d504859aace287598d99eb1_cgraph.md5 b/ERF__fast__rhs__T_8cpp_a7f6548841f1ba09e67dbcdf782788659_cgraph.md5 similarity index 100% rename from ERF__fast__rhs__T_8cpp_ae4a7d29a6d504859aace287598d99eb1_cgraph.md5 rename to ERF__fast__rhs__T_8cpp_a7f6548841f1ba09e67dbcdf782788659_cgraph.md5 diff --git a/ERF__fast__rhs__T_8cpp_ae4a7d29a6d504859aace287598d99eb1_cgraph.png b/ERF__fast__rhs__T_8cpp_a7f6548841f1ba09e67dbcdf782788659_cgraph.png similarity index 100% rename from ERF__fast__rhs__T_8cpp_ae4a7d29a6d504859aace287598d99eb1_cgraph.png rename to ERF__fast__rhs__T_8cpp_a7f6548841f1ba09e67dbcdf782788659_cgraph.png diff --git a/classERF.html b/classERF.html index 77fc046e2b..46b6b4bbf3 100644 --- a/classERF.html +++ b/classERF.html @@ -1501,218 +1501,219 @@

90  bool l_use_kturb = ( (tc.les_type != LESType::None) ||

91  (tc.pbl_type != PBLType::None) );
92  bool l_use_moisture = ( solverChoice.moisture_type != MoistureType::None );
-
93 
-
94  const bool use_most = (m_most != nullptr);
-
95  const bool exp_most = (solverChoice.use_explicit_most);
-
96  amrex::ignore_unused(use_most);
-
97 
-
98  const BoxArray& ba = state_old[IntVars::cons].boxArray();
-
99  const BoxArray& ba_z = zvel_old.boxArray();
-
100  const DistributionMapping& dm = state_old[IntVars::cons].DistributionMap();
-
101 
-
102  int num_prim = state_old[IntVars::cons].nComp() - 1;
-
103 
-
104  MultiFab S_prim (ba , dm, num_prim, state_old[IntVars::cons].nGrowVect());
-
105  MultiFab pi_stage (ba , dm, 1, state_old[IntVars::cons].nGrowVect());
-
106  MultiFab fast_coeffs(ba_z, dm, 5, 0);
-
107  MultiFab* eddyDiffs = eddyDiffs_lev[level].get();
-
108  MultiFab* SmnSmn = SmnSmn_lev[level].get();
-
109 
-
110  // **************************************************************************************
-
111  // Compute strain for use in slow RHS, Smagorinsky model, and MOST
-
112  // **************************************************************************************
-
113  {
-
114  BL_PROFILE("erf_advance_strain");
-
115  if (l_use_diff) {
-
116 
-
117  const BCRec* bc_ptr_h = domain_bcs_type.data();
-
118  const GpuArray<Real, AMREX_SPACEDIM> dxInv = fine_geom.InvCellSizeArray();
-
119 
-
120 #ifdef _OPENMP
-
121 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
122 #endif
-
123  for ( MFIter mfi(state_new[IntVars::cons],TileNoZ()); mfi.isValid(); ++mfi)
-
124  {
-
125  Box bxcc = mfi.growntilebox(IntVect(1,1,0));
-
126  Box tbxxy = mfi.tilebox(IntVect(1,1,0),IntVect(1,1,0));
-
127  Box tbxxz = mfi.tilebox(IntVect(1,0,1),IntVect(1,1,0));
-
128  Box tbxyz = mfi.tilebox(IntVect(0,1,1),IntVect(1,1,0));
-
129 
-
130  if (bxcc.smallEnd(2) != domain.smallEnd(2)) {
-
131  bxcc.growLo(2,1);
-
132  tbxxy.growLo(2,1);
-
133  tbxxz.growLo(2,1);
-
134  tbxyz.growLo(2,1);
-
135  }
-
136 
-
137  if (bxcc.bigEnd(2) != domain.bigEnd(2)) {
-
138  bxcc.growHi(2,1);
-
139  tbxxy.growHi(2,1);
-
140  tbxxz.growHi(2,1);
-
141  tbxyz.growHi(2,1);
-
142  }
-
143 
-
144  const Array4<const Real> & u = xvel_old.array(mfi);
-
145  const Array4<const Real> & v = yvel_old.array(mfi);
-
146  const Array4<const Real> & w = zvel_old.array(mfi);
-
147 
-
148  Array4<Real> tau11 = Tau11_lev[level].get()->array(mfi);
-
149  Array4<Real> tau22 = Tau22_lev[level].get()->array(mfi);
-
150  Array4<Real> tau33 = Tau33_lev[level].get()->array(mfi);
-
151  Array4<Real> tau12 = Tau12_lev[level].get()->array(mfi);
-
152  Array4<Real> tau13 = Tau13_lev[level].get()->array(mfi);
-
153  Array4<Real> tau23 = Tau23_lev[level].get()->array(mfi);
-
154 
-
155  Array4<Real> tau21 = l_use_terrain ? Tau21_lev[level].get()->array(mfi) : Array4<Real>{};
-
156  Array4<Real> tau31 = l_use_terrain ? Tau31_lev[level].get()->array(mfi) : Array4<Real>{};
-
157  Array4<Real> tau32 = l_use_terrain ? Tau32_lev[level].get()->array(mfi) : Array4<Real>{};
-
158  const Array4<const Real>& z_nd = l_use_terrain ? z_phys_nd[level]->const_array(mfi) : Array4<const Real>{};
-
159 
-
160  const Array4<const Real> mf_m = mapfac_m[level]->array(mfi);
-
161  const Array4<const Real> mf_u = mapfac_u[level]->array(mfi);
-
162  const Array4<const Real> mf_v = mapfac_v[level]->array(mfi);
-
163 
-
164  if (l_use_terrain) {
-
165  ComputeStrain_T(bxcc, tbxxy, tbxxz, tbxyz, domain,
-
166  u, v, w,
-
167  tau11, tau22, tau33,
-
168  tau12, tau13,
-
169  tau21, tau23,
-
170  tau31, tau32,
-
171  z_nd, detJ_cc[level]->const_array(mfi), bc_ptr_h, dxInv,
-
172  mf_m, mf_u, mf_v);
-
173  } else {
-
174  ComputeStrain_N(bxcc, tbxxy, tbxxz, tbxyz, domain,
-
175  u, v, w,
-
176  tau11, tau22, tau33,
-
177  tau12, tau13, tau23,
-
178  bc_ptr_h, dxInv,
-
179  mf_m, mf_u, mf_v);
-
180  }
-
181  } // mfi
-
182  } // l_use_diff
-
183  } // profile
-
184 
-
185  MultiFab Omega (state_old[IntVars::zmom].boxArray(),dm,1,1);
-
186 
-
187 #include "ERF_TI_utils.H"
-
188 
-
189  // Additional SFS quantities, calculated once per timestep
-
190  MultiFab* Hfx1 = SFS_hfx1_lev[level].get();
-
191  MultiFab* Hfx2 = SFS_hfx2_lev[level].get();
-
192  MultiFab* Hfx3 = SFS_hfx3_lev[level].get();
-
193  MultiFab* Q1fx1 = SFS_q1fx1_lev[level].get();
-
194  MultiFab* Q1fx2 = SFS_q1fx2_lev[level].get();
-
195  MultiFab* Q1fx3 = SFS_q1fx3_lev[level].get();
-
196  MultiFab* Q2fx3 = SFS_q2fx3_lev[level].get();
-
197  MultiFab* Diss = SFS_diss_lev[level].get();
-
198 
-
199  // *************************************************************************
-
200  // Calculate cell-centered eddy viscosity & diffusivities
-
201  //
-
202  // Notes -- we fill all the data in ghost cells before calling this so
-
203  // that we can fill the eddy viscosity in the ghost regions and
-
204  // not have to call a boundary filler on this data itself
-
205  //
-
206  // LES - updates both horizontal and vertical eddy viscosity components
-
207  // PBL - only updates vertical eddy viscosity components so horizontal
-
208  // components come from the LES model or are left as zero.
-
209  // *************************************************************************
-
210  if (l_use_kturb)
-
211  {
-
212  // NOTE: state_new transfers to state_old for PBL (due to ptr swap in advance)
-
213  const BCRec* bc_ptr_h = domain_bcs_type.data();
-
214  ComputeTurbulentViscosity(xvel_old, yvel_old,
-
215  *Tau11_lev[level].get(), *Tau22_lev[level].get(), *Tau33_lev[level].get(),
-
216  *Tau12_lev[level].get(), *Tau13_lev[level].get(), *Tau23_lev[level].get(),
-
217  state_old[IntVars::cons],
-
218  *eddyDiffs, *Hfx1, *Hfx2, *Hfx3, *Diss, // to be updated
-
219  fine_geom, *mapfac_u[level], *mapfac_v[level],
-
220  z_phys_nd[level], solverChoice,
-
221  m_most, exp_most, l_use_moisture, level, bc_ptr_h);
-
222  }
-
223 
-
224  // ***********************************************************************************************
-
225  // Update user-defined source terms -- these are defined once per time step (not per RK stage)
-
226  // ***********************************************************************************************
- -
228  prob->update_rhotheta_sources(old_time,
-
229  h_rhotheta_src[level], d_rhotheta_src[level],
-
230  fine_geom, z_phys_cc[level]);
-
231  }
-
232 
- -
234  prob->update_rhoqt_sources(old_time,
-
235  h_rhoqt_src[level], d_rhoqt_src[level],
-
236  fine_geom, z_phys_cc[level]);
-
237  }
-
238 
- -
240  prob->update_geostrophic_profile(old_time,
-
241  h_u_geos[level], d_u_geos[level],
-
242  h_v_geos[level], d_v_geos[level],
-
243  fine_geom, z_phys_cc[level]);
-
244  }
-
245 
-
246  // ***********************************************************************************************
-
247  // Convert old velocity available on faces to old momentum on faces to be used in time integration
-
248  // ***********************************************************************************************
-
249  MultiFab density(state_old[IntVars::cons], make_alias, Rho_comp, 1);
-
250 
-
251  //
-
252  // This is an optimization since we won't need more than one ghost
-
253  // cell of momentum in the integrator if not using NumDiff
-
254  //
-
255  IntVect ngu = (!solverChoice.use_NumDiff) ? IntVect(1,1,1) : xvel_old.nGrowVect();
-
256  IntVect ngv = (!solverChoice.use_NumDiff) ? IntVect(1,1,1) : yvel_old.nGrowVect();
-
257  IntVect ngw = (!solverChoice.use_NumDiff) ? IntVect(1,1,0) : zvel_old.nGrowVect();
-
258 
-
259  VelocityToMomentum(xvel_old, ngu, yvel_old, ngv, zvel_old, ngw, density,
-
260  state_old[IntVars::xmom],
-
261  state_old[IntVars::ymom],
-
262  state_old[IntVars::zmom],
-
263  domain, domain_bcs_type);
-
264 
-
265  MultiFab::Copy(xvel_new,xvel_old,0,0,1,xvel_old.nGrowVect());
-
266  MultiFab::Copy(yvel_new,yvel_old,0,0,1,yvel_old.nGrowVect());
-
267  MultiFab::Copy(zvel_new,zvel_old,0,0,1,zvel_old.nGrowVect());
-
268 
-
269  bool fast_only = false;
-
270  bool vel_and_mom_synced = true;
-
271 
-
272  apply_bcs(state_old, old_time,
-
273  state_old[IntVars::cons].nGrow(), state_old[IntVars::xmom].nGrow(),
-
274  fast_only, vel_and_mom_synced);
-
275  cons_to_prim(state_old[IntVars::cons], state_old[IntVars::cons].nGrow());
-
276 
-
277 #include "ERF_TI_no_substep_fun.H"
-
278 #include "ERF_TI_slow_rhs_fun.H"
-
279 #include "ERF_TI_fast_rhs_fun.H"
-
280 
-
281  // ***************************************************************************************
-
282  // Setup the integrator and integrate for a single timestep
-
283  // **************************************************************************************
-
284  MRISplitIntegrator<Vector<MultiFab> >& mri_integrator = *mri_integrator_mem[level];
-
285 
-
286  // Define rhs and 'post update' utility function that is called after calculating
-
287  // any state data (e.g. at RK stages or at the end of a timestep)
-
288  mri_integrator.set_slow_rhs_pre(slow_rhs_fun_pre);
-
289  mri_integrator.set_slow_rhs_post(slow_rhs_fun_post);
-
290  mri_integrator.set_pre_update (pre_update_fun);
-
291  mri_integrator.set_post_update(post_update_fun);
-
292 
-
293  if (solverChoice.anelastic[level]) {
-
294  mri_integrator.set_slow_rhs_inc(slow_rhs_fun_inc);
-
295  }
-
296 
-
297  mri_integrator.set_fast_rhs(fast_rhs_fun);
- -
299  mri_integrator.set_no_substep(no_substep_fun);
-
300 
-
301  mri_integrator.advance(state_old, state_new, old_time, dt_advance);
-
302 
-
303  if (verbose) Print() << "Done with advance_dycore at level " << level << std::endl;
-
304 }
+
93  bool l_implicit_substepping = ( solverChoice.substepping_type[level] == SubsteppingType::Implicit );
+
94 
+
95  const bool use_most = (m_most != nullptr);
+
96  const bool exp_most = (solverChoice.use_explicit_most);
+
97  amrex::ignore_unused(use_most);
+
98 
+
99  const BoxArray& ba = state_old[IntVars::cons].boxArray();
+
100  const BoxArray& ba_z = zvel_old.boxArray();
+
101  const DistributionMapping& dm = state_old[IntVars::cons].DistributionMap();
+
102 
+
103  int num_prim = state_old[IntVars::cons].nComp() - 1;
+
104 
+
105  MultiFab S_prim (ba , dm, num_prim, state_old[IntVars::cons].nGrowVect());
+
106  MultiFab pi_stage (ba , dm, 1, state_old[IntVars::cons].nGrowVect());
+
107  MultiFab fast_coeffs(ba_z, dm, 5, 0);
+
108  MultiFab* eddyDiffs = eddyDiffs_lev[level].get();
+
109  MultiFab* SmnSmn = SmnSmn_lev[level].get();
+
110 
+
111  // **************************************************************************************
+
112  // Compute strain for use in slow RHS, Smagorinsky model, and MOST
+
113  // **************************************************************************************
+
114  {
+
115  BL_PROFILE("erf_advance_strain");
+
116  if (l_use_diff) {
+
117 
+
118  const BCRec* bc_ptr_h = domain_bcs_type.data();
+
119  const GpuArray<Real, AMREX_SPACEDIM> dxInv = fine_geom.InvCellSizeArray();
+
120 
+
121 #ifdef _OPENMP
+
122 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
123 #endif
+
124  for ( MFIter mfi(state_new[IntVars::cons],TileNoZ()); mfi.isValid(); ++mfi)
+
125  {
+
126  Box bxcc = mfi.growntilebox(IntVect(1,1,0));
+
127  Box tbxxy = mfi.tilebox(IntVect(1,1,0),IntVect(1,1,0));
+
128  Box tbxxz = mfi.tilebox(IntVect(1,0,1),IntVect(1,1,0));
+
129  Box tbxyz = mfi.tilebox(IntVect(0,1,1),IntVect(1,1,0));
+
130 
+
131  if (bxcc.smallEnd(2) != domain.smallEnd(2)) {
+
132  bxcc.growLo(2,1);
+
133  tbxxy.growLo(2,1);
+
134  tbxxz.growLo(2,1);
+
135  tbxyz.growLo(2,1);
+
136  }
+
137 
+
138  if (bxcc.bigEnd(2) != domain.bigEnd(2)) {
+
139  bxcc.growHi(2,1);
+
140  tbxxy.growHi(2,1);
+
141  tbxxz.growHi(2,1);
+
142  tbxyz.growHi(2,1);
+
143  }
+
144 
+
145  const Array4<const Real> & u = xvel_old.array(mfi);
+
146  const Array4<const Real> & v = yvel_old.array(mfi);
+
147  const Array4<const Real> & w = zvel_old.array(mfi);
+
148 
+
149  Array4<Real> tau11 = Tau11_lev[level].get()->array(mfi);
+
150  Array4<Real> tau22 = Tau22_lev[level].get()->array(mfi);
+
151  Array4<Real> tau33 = Tau33_lev[level].get()->array(mfi);
+
152  Array4<Real> tau12 = Tau12_lev[level].get()->array(mfi);
+
153  Array4<Real> tau13 = Tau13_lev[level].get()->array(mfi);
+
154  Array4<Real> tau23 = Tau23_lev[level].get()->array(mfi);
+
155 
+
156  Array4<Real> tau21 = l_use_terrain ? Tau21_lev[level].get()->array(mfi) : Array4<Real>{};
+
157  Array4<Real> tau31 = l_use_terrain ? Tau31_lev[level].get()->array(mfi) : Array4<Real>{};
+
158  Array4<Real> tau32 = l_use_terrain ? Tau32_lev[level].get()->array(mfi) : Array4<Real>{};
+
159  const Array4<const Real>& z_nd = l_use_terrain ? z_phys_nd[level]->const_array(mfi) : Array4<const Real>{};
+
160 
+
161  const Array4<const Real> mf_m = mapfac_m[level]->array(mfi);
+
162  const Array4<const Real> mf_u = mapfac_u[level]->array(mfi);
+
163  const Array4<const Real> mf_v = mapfac_v[level]->array(mfi);
+
164 
+
165  if (l_use_terrain) {
+
166  ComputeStrain_T(bxcc, tbxxy, tbxxz, tbxyz, domain,
+
167  u, v, w,
+
168  tau11, tau22, tau33,
+
169  tau12, tau13,
+
170  tau21, tau23,
+
171  tau31, tau32,
+
172  z_nd, detJ_cc[level]->const_array(mfi), bc_ptr_h, dxInv,
+
173  mf_m, mf_u, mf_v);
+
174  } else {
+
175  ComputeStrain_N(bxcc, tbxxy, tbxxz, tbxyz, domain,
+
176  u, v, w,
+
177  tau11, tau22, tau33,
+
178  tau12, tau13, tau23,
+
179  bc_ptr_h, dxInv,
+
180  mf_m, mf_u, mf_v);
+
181  }
+
182  } // mfi
+
183  } // l_use_diff
+
184  } // profile
+
185 
+
186  MultiFab Omega (state_old[IntVars::zmom].boxArray(),dm,1,1);
+
187 
+
188 #include "ERF_TI_utils.H"
+
189 
+
190  // Additional SFS quantities, calculated once per timestep
+
191  MultiFab* Hfx1 = SFS_hfx1_lev[level].get();
+
192  MultiFab* Hfx2 = SFS_hfx2_lev[level].get();
+
193  MultiFab* Hfx3 = SFS_hfx3_lev[level].get();
+
194  MultiFab* Q1fx1 = SFS_q1fx1_lev[level].get();
+
195  MultiFab* Q1fx2 = SFS_q1fx2_lev[level].get();
+
196  MultiFab* Q1fx3 = SFS_q1fx3_lev[level].get();
+
197  MultiFab* Q2fx3 = SFS_q2fx3_lev[level].get();
+
198  MultiFab* Diss = SFS_diss_lev[level].get();
+
199 
+
200  // *************************************************************************
+
201  // Calculate cell-centered eddy viscosity & diffusivities
+
202  //
+
203  // Notes -- we fill all the data in ghost cells before calling this so
+
204  // that we can fill the eddy viscosity in the ghost regions and
+
205  // not have to call a boundary filler on this data itself
+
206  //
+
207  // LES - updates both horizontal and vertical eddy viscosity components
+
208  // PBL - only updates vertical eddy viscosity components so horizontal
+
209  // components come from the LES model or are left as zero.
+
210  // *************************************************************************
+
211  if (l_use_kturb)
+
212  {
+
213  // NOTE: state_new transfers to state_old for PBL (due to ptr swap in advance)
+
214  const BCRec* bc_ptr_h = domain_bcs_type.data();
+
215  ComputeTurbulentViscosity(xvel_old, yvel_old,
+
216  *Tau11_lev[level].get(), *Tau22_lev[level].get(), *Tau33_lev[level].get(),
+
217  *Tau12_lev[level].get(), *Tau13_lev[level].get(), *Tau23_lev[level].get(),
+
218  state_old[IntVars::cons],
+
219  *eddyDiffs, *Hfx1, *Hfx2, *Hfx3, *Diss, // to be updated
+
220  fine_geom, *mapfac_u[level], *mapfac_v[level],
+
221  z_phys_nd[level], solverChoice,
+
222  m_most, exp_most, l_use_moisture, level, bc_ptr_h);
+
223  }
+
224 
+
225  // ***********************************************************************************************
+
226  // Update user-defined source terms -- these are defined once per time step (not per RK stage)
+
227  // ***********************************************************************************************
+ +
229  prob->update_rhotheta_sources(old_time,
+
230  h_rhotheta_src[level], d_rhotheta_src[level],
+
231  fine_geom, z_phys_cc[level]);
+
232  }
+
233 
+ +
235  prob->update_rhoqt_sources(old_time,
+
236  h_rhoqt_src[level], d_rhoqt_src[level],
+
237  fine_geom, z_phys_cc[level]);
+
238  }
+
239 
+ +
241  prob->update_geostrophic_profile(old_time,
+
242  h_u_geos[level], d_u_geos[level],
+
243  h_v_geos[level], d_v_geos[level],
+
244  fine_geom, z_phys_cc[level]);
+
245  }
+
246 
+
247  // ***********************************************************************************************
+
248  // Convert old velocity available on faces to old momentum on faces to be used in time integration
+
249  // ***********************************************************************************************
+
250  MultiFab density(state_old[IntVars::cons], make_alias, Rho_comp, 1);
+
251 
+
252  //
+
253  // This is an optimization since we won't need more than one ghost
+
254  // cell of momentum in the integrator if not using NumDiff
+
255  //
+
256  IntVect ngu = (!solverChoice.use_NumDiff) ? IntVect(1,1,1) : xvel_old.nGrowVect();
+
257  IntVect ngv = (!solverChoice.use_NumDiff) ? IntVect(1,1,1) : yvel_old.nGrowVect();
+
258  IntVect ngw = (!solverChoice.use_NumDiff) ? IntVect(1,1,0) : zvel_old.nGrowVect();
+
259 
+
260  VelocityToMomentum(xvel_old, ngu, yvel_old, ngv, zvel_old, ngw, density,
+
261  state_old[IntVars::xmom],
+
262  state_old[IntVars::ymom],
+
263  state_old[IntVars::zmom],
+
264  domain, domain_bcs_type);
+
265 
+
266  MultiFab::Copy(xvel_new,xvel_old,0,0,1,xvel_old.nGrowVect());
+
267  MultiFab::Copy(yvel_new,yvel_old,0,0,1,yvel_old.nGrowVect());
+
268  MultiFab::Copy(zvel_new,zvel_old,0,0,1,zvel_old.nGrowVect());
+
269 
+
270  bool fast_only = false;
+
271  bool vel_and_mom_synced = true;
+
272 
+
273  apply_bcs(state_old, old_time,
+
274  state_old[IntVars::cons].nGrow(), state_old[IntVars::xmom].nGrow(),
+
275  fast_only, vel_and_mom_synced);
+
276  cons_to_prim(state_old[IntVars::cons], state_old[IntVars::cons].nGrow());
+
277 
+
278 #include "ERF_TI_no_substep_fun.H"
+
279 #include "ERF_TI_slow_rhs_fun.H"
+
280 #include "ERF_TI_fast_rhs_fun.H"
+
281 
+
282  // ***************************************************************************************
+
283  // Setup the integrator and integrate for a single timestep
+
284  // **************************************************************************************
+
285  MRISplitIntegrator<Vector<MultiFab> >& mri_integrator = *mri_integrator_mem[level];
+
286 
+
287  // Define rhs and 'post update' utility function that is called after calculating
+
288  // any state data (e.g. at RK stages or at the end of a timestep)
+
289  mri_integrator.set_slow_rhs_pre(slow_rhs_fun_pre);
+
290  mri_integrator.set_slow_rhs_post(slow_rhs_fun_post);
+
291  mri_integrator.set_pre_update (pre_update_fun);
+
292  mri_integrator.set_post_update(post_update_fun);
+
293 
+
294  if (solverChoice.anelastic[level]) {
+
295  mri_integrator.set_slow_rhs_inc(slow_rhs_fun_inc);
+
296  }
+
297 
+
298  mri_integrator.set_fast_rhs(fast_rhs_fun);
+ +
300  mri_integrator.set_no_substep(no_substep_fun);
+
301 
+
302  mri_integrator.advance(state_old, state_new, old_time, dt_advance);
+
303 
+
304  if (verbose) Print() << "Done with advance_dycore at level " << level << std::endl;
+
305 }
void ComputeStrain_N(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Box domain, const Array4< const Real > &u, const Array4< const Real > &v, const Array4< const Real > &w, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau13, Array4< Real > &tau23, const BCRec *bc_ptr, const GpuArray< Real, AMREX_SPACEDIM > &dxInv, const Array4< const Real > &mf_m, const Array4< const Real > &mf_u, const Array4< const Real > &mf_v)
Definition: ERF_ComputeStrain_N.cpp:28
void ComputeStrain_T(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Box domain, const Array4< const Real > &u, const Array4< const Real > &v, const Array4< const Real > &w, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau13, Array4< Real > &tau21, Array4< Real > &tau23, Array4< Real > &tau31, Array4< Real > &tau32, const Array4< const Real > &z_nd, const Array4< const Real > &detJ, const BCRec *bc_ptr, const GpuArray< Real, AMREX_SPACEDIM > &dxInv, const Array4< const Real > &mf_m, const Array4< const Real > &mf_u, const Array4< const Real > &mf_v)
Definition: ERF_ComputeStrain_T.cpp:33
void ComputeTurbulentViscosity(const MultiFab &xvel, const MultiFab &yvel, const MultiFab &Tau11, const MultiFab &Tau22, const MultiFab &Tau33, const MultiFab &Tau12, const MultiFab &Tau13, const MultiFab &Tau23, const MultiFab &cons_in, MultiFab &eddyViscosity, MultiFab &Hfx1, MultiFab &Hfx2, MultiFab &Hfx3, MultiFab &Diss, const Geometry &geom, const MultiFab &mapfac_u, const MultiFab &mapfac_v, const std::unique_ptr< MultiFab > &z_phys_nd, const SolverChoice &solverChoice, std::unique_ptr< ABLMost > &most, const bool &exp_most, const bool &use_moisture, int level, const BCRec *bc_ptr, bool vert_only)
Definition: ERF_ComputeTurbulentViscosity.cpp:459
@@ -1798,6 +1799,7 @@

bool custom_w_subsidence
Definition: ERF_DataStruct.H:598

bool rayleigh_damp_U
Definition: ERF_DataStruct.H:567
bool custom_geostrophic_profile
Definition: ERF_DataStruct.H:599
+
amrex::Vector< SubsteppingType > substepping_type
Definition: ERF_DataStruct.H:547
bool use_NumDiff
Definition: ERF_DataStruct.H:619
bool custom_moisture_forcing
Definition: ERF_DataStruct.H:597
amrex::Vector< TurbChoice > turbChoice
Definition: ERF_DataStruct.H:540
@@ -5112,7 +5114,6 @@

static amrex::Real cfl
Definition: ERF.H:850

@ rho
Definition: ERF_Kessler.H:30
int force_stage1_single_substep
Definition: ERF_DataStruct.H:545
-
amrex::Vector< SubsteppingType > substepping_type
Definition: ERF_DataStruct.H:547
Here is the call graph for this function:
diff --git a/classMRISplitIntegrator.html b/classMRISplitIntegrator.html index 5ebd514111..c0ba69730a 100644 --- a/classMRISplitIntegrator.html +++ b/classMRISplitIntegrator.html @@ -504,96 +504,100 @@

273  nsubsteps = 1; dtau = timestep;

274  } else {
275  nsubsteps = substep_ratio; dtau = sub_timestep;
-
276  }
-
277  time_stage = time + timestep;
-
278  }
-
279 
-
280  // step 1 starts with S_stage = S^n and we always start substepping at the old time
-
281  // step 2 starts with S_stage = S^* and we always start substepping at the old time
-
282  // step 3 starts with S_stage = S^** and we always start substepping at the old time
+
276 
+
277  // STRT HACK -- this hack can be used to approximate the no-substepping algorithm
+
278  // nsubsteps = 1; dtau = timestep;
+
279  // END HACK
+
280  }
+
281  time_stage = time + timestep;
+
282  }
283 
-
284  // All pre_update does is call cons_to_prim, and we have done this with the old
-
285  // data already before starting the RK steps
-
286  if (nrk > 0) {
-
287  pre_update(S_new, S_new[IntVars::cons].nGrow());
-
288  }
-
289 
-
290  // S_scratch also holds the average momenta over the fast iterations --
-
291  // to be used to update the slow variables -- we will initialize with
-
292  // the momenta used in the first call to the slow_rhs, then update
-
293  // inside fast_rhs, then use these values in the later call to slow_rhs
-
294 
-
295  slow_rhs_pre(*F_slow, S_old, S_new, *S_scratch, time, old_time_stage, time_stage, nrk);
-
296 
-
297  amrex::Real inv_fac = 1.0 / static_cast<amrex::Real>(nsubsteps);
+
284  // step 1 starts with S_stage = S^n and we always start substepping at the old time
+
285  // step 2 starts with S_stage = S^* and we always start substepping at the old time
+
286  // step 3 starts with S_stage = S^** and we always start substepping at the old time
+
287 
+
288  // All pre_update does is call cons_to_prim, and we have done this with the old
+
289  // data already before starting the RK steps
+
290  if (nrk > 0) {
+
291  pre_update(S_new, S_new[IntVars::cons].nGrow());
+
292  }
+
293 
+
294  // S_scratch also holds the average momenta over the fast iterations --
+
295  // to be used to update the slow variables -- we will initialize with
+
296  // the momenta used in the first call to the slow_rhs, then update
+
297  // inside fast_rhs, then use these values in the later call to slow_rhs
298 
-
299  // ****************************************************
-
300  // Acoustic substepping
-
301  // ****************************************************
-
302  if (!no_substepping)
-
303  {
-
304  // *******************************************************************************
-
305  // Update the fast variables
-
306  // *******************************************************************************
-
307  for (int ks = 0; ks < nsubsteps; ++ks)
-
308  {
-
309  fast_rhs(ks, nsubsteps, nrk, *F_slow, S_old, S_new, *S_sum, *S_scratch, dtau, inv_fac,
-
310  time + ks*dtau, time + (ks+1) * dtau);
-
311 
-
312  } // ks
-
313 
-
314  } else {
-
315  no_substep(*S_sum, S_old, *F_slow, time + nsubsteps*dtau, nsubsteps*dtau, nrk);
-
316  }
+
299  slow_rhs_pre(*F_slow, S_old, S_new, *S_scratch, time, old_time_stage, time_stage, nrk);
+
300 
+
301  amrex::Real inv_fac = 1.0 / static_cast<amrex::Real>(nsubsteps);
+
302 
+
303  // ****************************************************
+
304  // Acoustic substepping
+
305  // ****************************************************
+
306  if (!no_substepping)
+
307  {
+
308  // *******************************************************************************
+
309  // Update the fast variables
+
310  // *******************************************************************************
+
311  for (int ks = 0; ks < nsubsteps; ++ks)
+
312  {
+
313  fast_rhs(ks, nsubsteps, nrk, *F_slow, S_old, S_new, *S_sum, *S_scratch, dtau, inv_fac,
+
314  time + ks*dtau, time + (ks+1) * dtau);
+
315 
+
316  } // ks
317 
-
318  // ****************************************************
-
319  // Evaluate F_slow(S_stage) only for the slow variables
-
320  // Note that we are using the current stage versions (in S_new) of the slow variables
-
321  // (because we didn't update the slow variables in the substepping)
-
322  // but we are using the "new" versions (in S_sum) of the velocities
-
323  // (because we did update the fast variables in the substepping)
-
324  // ****************************************************
-
325  slow_rhs_post(*F_slow, S_old, S_new, *S_sum, *S_scratch, time, old_time_stage, time_stage, nrk);
-
326 
-
327  // Call the post-update hook for S_new after all the fast steps completed
-
328  // This will update S_prim that is used in the slow RHS
-
329  post_update(S_new, time + nsubsteps*dtau, S_new[IntVars::cons].nGrow(), S_new[IntVars::xmom].nGrow());
-
330  } // nrk
-
331 
-
332  } else {
-
333  // RK2 for anelastic integrator
-
334  for (int nrk = 0; nrk < 2; nrk++)
-
335  {
-
336  // Capture the time we got to in the previous RK step
-
337  old_time_stage = time_stage;
-
338 
-
339  if (nrk == 0) { nsubsteps = 1; dtau = timestep; time_stage = time + timestep; }
-
340  if (nrk == 1) { nsubsteps = 1; dtau = timestep; time_stage = time + timestep; }
-
341 
-
342  // All pre_update does is call cons_to_prim, and we have done this with the old
-
343  // data already before starting the RK steps
-
344  if (nrk > 0) {
-
345  pre_update(S_new, S_new[IntVars::cons].nGrow());
-
346  }
-
347 
-
348  // S_scratch also holds the average momenta over the fast iterations --
-
349  // to be used to update the slow variables -- we will initialize with
-
350  // the momenta used in the first call to the slow_rhs, then update
-
351  // inside fast_rhs, then use these values in the later call to slow_rhs
-
352 
-
353  slow_rhs_inc(*F_slow, S_old, S_new, *S_scratch, time, old_time_stage, time_stage, nrk);
-
354 
-
355  no_substep(*S_sum, S_old, *F_slow, time + nsubsteps*dtau, nsubsteps*dtau, nrk);
+
318  } else {
+
319  no_substep(*S_sum, S_old, *F_slow, time + nsubsteps*dtau, nsubsteps*dtau, nrk);
+
320  }
+
321 
+
322  // ****************************************************
+
323  // Evaluate F_slow(S_stage) only for the slow variables
+
324  // Note that we are using the current stage versions (in S_new) of the slow variables
+
325  // (because we didn't update the slow variables in the substepping)
+
326  // but we are using the "new" versions (in S_sum) of the velocities
+
327  // (because we did update the fast variables in the substepping)
+
328  // ****************************************************
+
329  slow_rhs_post(*F_slow, S_old, S_new, *S_sum, *S_scratch, time, old_time_stage, time_stage, nrk);
+
330 
+
331  // Call the post-update hook for S_new after all the fast steps completed
+
332  // This will update S_prim that is used in the slow RHS
+
333  post_update(S_new, time + nsubsteps*dtau, S_new[IntVars::cons].nGrow(), S_new[IntVars::xmom].nGrow());
+
334  } // nrk
+
335 
+
336  } else {
+
337  // RK2 for anelastic integrator
+
338  for (int nrk = 0; nrk < 2; nrk++)
+
339  {
+
340  // Capture the time we got to in the previous RK step
+
341  old_time_stage = time_stage;
+
342 
+
343  if (nrk == 0) { nsubsteps = 1; dtau = timestep; time_stage = time + timestep; }
+
344  if (nrk == 1) { nsubsteps = 1; dtau = timestep; time_stage = time + timestep; }
+
345 
+
346  // All pre_update does is call cons_to_prim, and we have done this with the old
+
347  // data already before starting the RK steps
+
348  if (nrk > 0) {
+
349  pre_update(S_new, S_new[IntVars::cons].nGrow());
+
350  }
+
351 
+
352  // S_scratch also holds the average momenta over the fast iterations --
+
353  // to be used to update the slow variables -- we will initialize with
+
354  // the momenta used in the first call to the slow_rhs, then update
+
355  // inside fast_rhs, then use these values in the later call to slow_rhs
356 
-
357  slow_rhs_post(*F_slow, S_old, S_new, *S_sum, *S_scratch, time, old_time_stage, time_stage, nrk);
+
357  slow_rhs_inc(*F_slow, S_old, S_new, *S_scratch, time, old_time_stage, time_stage, nrk);
358 
-
359  post_update(S_new, time + nsubsteps*dtau, S_new[IntVars::cons].nGrow(), S_new[IntVars::xmom].nGrow());
-
360  } // nrk
-
361  }
+
359  no_substep(*S_sum, S_old, *F_slow, time + nsubsteps*dtau, nsubsteps*dtau, nrk);
+
360 
+
361  slow_rhs_post(*F_slow, S_old, S_new, *S_sum, *S_scratch, time, old_time_stage, time_stage, nrk);
362 
-
363  // Return timestep
-
364  return timestep;
-
365  }
+
363  post_update(S_new, time + nsubsteps*dtau, S_new[IntVars::cons].nGrow(), S_new[IntVars::xmom].nGrow());
+
364  } // nrk
+
365  }
+
366 
+
367  // Return timestep
+
368  return timestep;
+
369  }
std::function< void(T &, amrex::Real, int, int)> post_update
Definition: ERF_MRI.H:63
T * F_slow
Definition: ERF_MRI.H:70
std::function< void(T &, T &, T &, T &, T &, const amrex::Real, const amrex::Real, const amrex::Real, const int)> slow_rhs_post
Definition: ERF_MRI.H:24
@@ -828,11 +832,11 @@

-
368  {
-
369  for (auto& F : T_store) {
-
370  Map(*F);
-
371  }
-
372  }
+
372  {
+
373  for (auto& F : T_store) {
+
374  Map(*F);
+
375  }
+
376  }
diff --git a/globals_e.html b/globals_e.html index 4db9914e19..e9f73a71f1 100644 --- a/globals_e.html +++ b/globals_e.html @@ -122,16 +122,16 @@

- e -

    : ERF_Microphysics_Utils.H
  • erf_fast_rhs_MT() -: ERF_fast_rhs_MT.cpp -, ERF_TI_fast_headers.H +: ERF_fast_rhs_MT.cpp +, ERF_TI_fast_headers.H
  • erf_fast_rhs_N() -: ERF_fast_rhs_N.cpp -, ERF_TI_fast_headers.H +: ERF_fast_rhs_N.cpp +, ERF_TI_fast_headers.H
  • erf_fast_rhs_T() -: ERF_fast_rhs_T.cpp -, ERF_TI_fast_headers.H +: ERF_fast_rhs_T.cpp +, ERF_TI_fast_headers.H
  • erf_gammafff() : ERF_Microphysics_Utils.H diff --git a/globals_func_e.html b/globals_func_e.html index 425103c425..f5fd26b75d 100644 --- a/globals_func_e.html +++ b/globals_func_e.html @@ -107,16 +107,16 @@

    - e -

      : ERF_Microphysics_Utils.H
    • erf_fast_rhs_MT() -: ERF_fast_rhs_MT.cpp -, ERF_TI_fast_headers.H +: ERF_fast_rhs_MT.cpp +, ERF_TI_fast_headers.H
    • erf_fast_rhs_N() -: ERF_fast_rhs_N.cpp -, ERF_TI_fast_headers.H +: ERF_fast_rhs_N.cpp +, ERF_TI_fast_headers.H
    • erf_fast_rhs_T() -: ERF_fast_rhs_T.cpp -, ERF_TI_fast_headers.H +: ERF_fast_rhs_T.cpp +, ERF_TI_fast_headers.H
    • erf_gammafff() : ERF_Microphysics_Utils.H diff --git a/navtreeindex2.js b/navtreeindex2.js index 87e48daf0a..cef8c7545b 100644 --- a/navtreeindex2.js +++ b/navtreeindex2.js @@ -111,10 +111,10 @@ var NAVTREEINDEX2 = "ERF__Src__headers_8H.html#ae22ef4440a73ae73f46775e3b8f635ac":[3,0,1,14,9,3], "ERF__Src__headers_8H_source.html":[3,0,1,14,9], "ERF__TI__fast__headers_8H.html":[3,0,1,15,14], -"ERF__TI__fast__headers_8H.html#a5f53a08aa97926523055fe74b41141ce":[3,0,1,15,14,1], -"ERF__TI__fast__headers_8H.html#abdacd58e8e0a4cb99d45bf970cfadfea":[3,0,1,15,14,0], +"ERF__TI__fast__headers_8H.html#a25b4f2c626cbe895f44d04b262cd0938":[3,0,1,15,14,1], +"ERF__TI__fast__headers_8H.html#a600146ca54f6fbeecc08fe9c93e5031c":[3,0,1,15,14,2], +"ERF__TI__fast__headers_8H.html#aa794768e78c35584724f923852dc5b79":[3,0,1,15,14,0], "ERF__TI__fast__headers_8H.html#adfda58e818c53254b1fa053669e911e8":[3,0,1,15,14,3], -"ERF__TI__fast__headers_8H.html#af993ea724f392520e7240055ecbe58bb":[3,0,1,15,14,2], "ERF__TI__fast__headers_8H_source.html":[3,0,1,15,14], "ERF__TI__fast__rhs__fun_8H.html":[3,0,1,15,15], "ERF__TI__fast__rhs__fun_8H.html#ac6afbd55bf5b7264098d44d9b8928f57":[3,0,1,15,15,0], diff --git a/navtreeindex3.js b/navtreeindex3.js index aa93197fa8..33d1c11681 100644 --- a/navtreeindex3.js +++ b/navtreeindex3.js @@ -3,11 +3,11 @@ var NAVTREEINDEX3 = "ERF__eb__if_8H_source.html":[3,0,1,4,2], "ERF__eb__regular_8cpp.html":[3,0,1,4,3], "ERF__fast__rhs__MT_8cpp.html":[3,0,1,15,6], -"ERF__fast__rhs__MT_8cpp.html#ab4d94ede74fb532475b186ed1cbbbfed":[3,0,1,15,6,0], +"ERF__fast__rhs__MT_8cpp.html#a526d3733938e64ccdcb7e99b2944b456":[3,0,1,15,6,0], "ERF__fast__rhs__N_8cpp.html":[3,0,1,15,7], -"ERF__fast__rhs__N_8cpp.html#aec6e78f7c7efa8a0108529be2516cfcc":[3,0,1,15,7,0], +"ERF__fast__rhs__N_8cpp.html#a5fbcc0fe33b8e8e42f840ad475a092bd":[3,0,1,15,7,0], "ERF__fast__rhs__T_8cpp.html":[3,0,1,15,8], -"ERF__fast__rhs__T_8cpp.html#ae4a7d29a6d504859aace287598d99eb1":[3,0,1,15,8,0], +"ERF__fast__rhs__T_8cpp.html#a7f6548841f1ba09e67dbcdf782788659":[3,0,1,15,8,0], "ERF__init1d_8cpp.html":[3,0,1,5,0], "ERF__initEB_8cpp.html":[3,0,1,4,5], "ERF__init__TurbPert_8cpp.html":[3,0,1,5,10], diff --git a/search/all_4.js b/search/all_4.js index 5ae91de31c..8714d073bb 100644 --- a/search/all_4.js +++ b/search/all_4.js @@ -108,11 +108,11 @@ var searchData= ['erf_5fesatw_580',['erf_esatw',['../ERF__Microphysics__Utils_8H.html#a16a390366e7e68ca35fdac4cad824428',1,'ERF_Microphysics_Utils.H']]], ['erf_5feulerianmicrophysics_2eh_581',['ERF_EulerianMicrophysics.H',['../ERF__EulerianMicrophysics_8H.html',1,'']]], ['erf_5fewp_2eh_582',['ERF_EWP.H',['../ERF__EWP_8H.html',1,'']]], - ['erf_5ffast_5frhs_5fmt_583',['erf_fast_rhs_MT',['../ERF__TI__fast__headers_8H.html#abdacd58e8e0a4cb99d45bf970cfadfea',1,'erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stg_data, const amrex::MultiFab &S_stg_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const bool use_lagged_delta_rt, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_t_rk, const amrex::MultiFab *z_t_pert, std::unique_ptr< amrex::MultiFab > &z_phys_nd_old, std::unique_ptr< amrex::MultiFab > &z_phys_nd_new, std::unique_ptr< amrex::MultiFab > &z_phys_nd_stg, std::unique_ptr< amrex::MultiFab > &detJ_cc_old, std::unique_ptr< amrex::MultiFab > &detJ_cc_new, std::unique_ptr< amrex::MultiFab > &detJ_cc_stg, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_TI_fast_headers.H'],['../ERF__fast__rhs__MT_8cpp.html#ab4d94ede74fb532475b186ed1cbbbfed',1,'erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stg_data, const MultiFab &S_stg_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const bool use_lagged_delta_rt, MultiFab &Omega, std::unique_ptr< MultiFab > &z_t_rk, const MultiFab *z_t_pert, std::unique_ptr< MultiFab > &z_phys_nd_old, std::unique_ptr< MultiFab > &z_phys_nd_new, std::unique_ptr< MultiFab > &z_phys_nd_stg, std::unique_ptr< MultiFab > &detJ_cc_old, std::unique_ptr< MultiFab > &detJ_cc_new, std::unique_ptr< MultiFab > &detJ_cc_stg, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_fast_rhs_MT.cpp']]], + ['erf_5ffast_5frhs_5fmt_583',['erf_fast_rhs_MT',['../ERF__TI__fast__headers_8H.html#aa794768e78c35584724f923852dc5b79',1,'erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stg_data, const amrex::MultiFab &S_stg_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const bool use_lagged_delta_rt, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_t_rk, const amrex::MultiFab *z_t_pert, std::unique_ptr< amrex::MultiFab > &z_phys_nd_old, std::unique_ptr< amrex::MultiFab > &z_phys_nd_new, std::unique_ptr< amrex::MultiFab > &z_phys_nd_stg, std::unique_ptr< amrex::MultiFab > &detJ_cc_old, std::unique_ptr< amrex::MultiFab > &detJ_cc_new, std::unique_ptr< amrex::MultiFab > &detJ_cc_stg, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping): ERF_TI_fast_headers.H'],['../ERF__fast__rhs__MT_8cpp.html#a526d3733938e64ccdcb7e99b2944b456',1,'erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stg_data, const MultiFab &S_stg_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const bool use_lagged_delta_rt, MultiFab &Omega, std::unique_ptr< MultiFab > &z_t_rk, const MultiFab *z_t_pert, std::unique_ptr< MultiFab > &z_phys_nd_old, std::unique_ptr< MultiFab > &z_phys_nd_new, std::unique_ptr< MultiFab > &z_phys_nd_stg, std::unique_ptr< MultiFab > &detJ_cc_old, std::unique_ptr< MultiFab > &detJ_cc_new, std::unique_ptr< MultiFab > &detJ_cc_stg, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool): ERF_fast_rhs_MT.cpp']]], ['erf_5ffast_5frhs_5fmt_2ecpp_584',['ERF_fast_rhs_MT.cpp',['../ERF__fast__rhs__MT_8cpp.html',1,'']]], - ['erf_5ffast_5frhs_5fn_585',['erf_fast_rhs_N',['../ERF__fast__rhs__N_8cpp.html#aec6e78f7c7efa8a0108529be2516cfcc',1,'erf_fast_rhs_N(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_fast_rhs_N.cpp'],['../ERF__TI__fast__headers_8H.html#a5f53a08aa97926523055fe74b41141ce',1,'erf_fast_rhs_N(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_TI_fast_headers.H']]], + ['erf_5ffast_5frhs_5fn_585',['erf_fast_rhs_N',['../ERF__fast__rhs__N_8cpp.html#a5fbcc0fe33b8e8e42f840ad475a092bd',1,'erf_fast_rhs_N(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping): ERF_fast_rhs_N.cpp'],['../ERF__TI__fast__headers_8H.html#a25b4f2c626cbe895f44d04b262cd0938',1,'erf_fast_rhs_N(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping): ERF_TI_fast_headers.H']]], ['erf_5ffast_5frhs_5fn_2ecpp_586',['ERF_fast_rhs_N.cpp',['../ERF__fast__rhs__N_8cpp.html',1,'']]], - ['erf_5ffast_5frhs_5ft_587',['erf_fast_rhs_T',['../ERF__fast__rhs__T_8cpp.html#ae4a7d29a6d504859aace287598d99eb1',1,'erf_fast_rhs_T(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, MultiFab &Omega, std::unique_ptr< MultiFab > &z_phys_nd, std::unique_ptr< MultiFab > &detJ_cc, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_fast_rhs_T.cpp'],['../ERF__TI__fast__headers_8H.html#af993ea724f392520e7240055ecbe58bb',1,'erf_fast_rhs_T(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_TI_fast_headers.H']]], + ['erf_5ffast_5frhs_5ft_587',['erf_fast_rhs_T',['../ERF__fast__rhs__T_8cpp.html#a7f6548841f1ba09e67dbcdf782788659',1,'erf_fast_rhs_T(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, MultiFab &Omega, std::unique_ptr< MultiFab > &z_phys_nd, std::unique_ptr< MultiFab > &detJ_cc, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool): ERF_fast_rhs_T.cpp'],['../ERF__TI__fast__headers_8H.html#a600146ca54f6fbeecc08fe9c93e5031c',1,'erf_fast_rhs_T(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping): ERF_TI_fast_headers.H']]], ['erf_5ffast_5frhs_5ft_2ecpp_588',['ERF_fast_rhs_T.cpp',['../ERF__fast__rhs__T_8cpp.html',1,'']]], ['erf_5ffillpatch_2ecpp_589',['ERF_FillPatch.cpp',['../ERF__FillPatch_8cpp.html',1,'']]], ['erf_5ffillpatcher_2ecpp_590',['ERF_FillPatcher.cpp',['../ERF__FillPatcher_8cpp.html',1,'']]], diff --git a/search/functions_4.js b/search/functions_4.js index b1395e36f7..c5c94e6458 100644 --- a/search/functions_4.js +++ b/search/functions_4.js @@ -25,9 +25,9 @@ var searchData= ['erf_5fenforce_5fhse_3133',['erf_enforce_hse',['../classERF.html#add029fcf0244ea86d2e0b419a2c6ef52',1,'ERF']]], ['erf_5fesati_3134',['erf_esati',['../ERF__Microphysics__Utils_8H.html#a4ea516e89f4e87b4ffc305504e8f0bf1',1,'ERF_Microphysics_Utils.H']]], ['erf_5fesatw_3135',['erf_esatw',['../ERF__Microphysics__Utils_8H.html#a16a390366e7e68ca35fdac4cad824428',1,'ERF_Microphysics_Utils.H']]], - ['erf_5ffast_5frhs_5fmt_3136',['erf_fast_rhs_MT',['../ERF__TI__fast__headers_8H.html#abdacd58e8e0a4cb99d45bf970cfadfea',1,'erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stg_data, const amrex::MultiFab &S_stg_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const bool use_lagged_delta_rt, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_t_rk, const amrex::MultiFab *z_t_pert, std::unique_ptr< amrex::MultiFab > &z_phys_nd_old, std::unique_ptr< amrex::MultiFab > &z_phys_nd_new, std::unique_ptr< amrex::MultiFab > &z_phys_nd_stg, std::unique_ptr< amrex::MultiFab > &detJ_cc_old, std::unique_ptr< amrex::MultiFab > &detJ_cc_new, std::unique_ptr< amrex::MultiFab > &detJ_cc_stg, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_TI_fast_headers.H'],['../ERF__fast__rhs__MT_8cpp.html#ab4d94ede74fb532475b186ed1cbbbfed',1,'erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stg_data, const MultiFab &S_stg_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const bool use_lagged_delta_rt, MultiFab &Omega, std::unique_ptr< MultiFab > &z_t_rk, const MultiFab *z_t_pert, std::unique_ptr< MultiFab > &z_phys_nd_old, std::unique_ptr< MultiFab > &z_phys_nd_new, std::unique_ptr< MultiFab > &z_phys_nd_stg, std::unique_ptr< MultiFab > &detJ_cc_old, std::unique_ptr< MultiFab > &detJ_cc_new, std::unique_ptr< MultiFab > &detJ_cc_stg, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_fast_rhs_MT.cpp']]], - ['erf_5ffast_5frhs_5fn_3137',['erf_fast_rhs_N',['../ERF__fast__rhs__N_8cpp.html#aec6e78f7c7efa8a0108529be2516cfcc',1,'erf_fast_rhs_N(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_fast_rhs_N.cpp'],['../ERF__TI__fast__headers_8H.html#a5f53a08aa97926523055fe74b41141ce',1,'erf_fast_rhs_N(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_TI_fast_headers.H']]], - ['erf_5ffast_5frhs_5ft_3138',['erf_fast_rhs_T',['../ERF__fast__rhs__T_8cpp.html#ae4a7d29a6d504859aace287598d99eb1',1,'erf_fast_rhs_T(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, MultiFab &Omega, std::unique_ptr< MultiFab > &z_phys_nd, std::unique_ptr< MultiFab > &detJ_cc, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_fast_rhs_T.cpp'],['../ERF__TI__fast__headers_8H.html#af993ea724f392520e7240055ecbe58bb',1,'erf_fast_rhs_T(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux): ERF_TI_fast_headers.H']]], + ['erf_5ffast_5frhs_5fmt_3136',['erf_fast_rhs_MT',['../ERF__TI__fast__headers_8H.html#aa794768e78c35584724f923852dc5b79',1,'erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stg_data, const amrex::MultiFab &S_stg_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const bool use_lagged_delta_rt, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_t_rk, const amrex::MultiFab *z_t_pert, std::unique_ptr< amrex::MultiFab > &z_phys_nd_old, std::unique_ptr< amrex::MultiFab > &z_phys_nd_new, std::unique_ptr< amrex::MultiFab > &z_phys_nd_stg, std::unique_ptr< amrex::MultiFab > &detJ_cc_old, std::unique_ptr< amrex::MultiFab > &detJ_cc_new, std::unique_ptr< amrex::MultiFab > &detJ_cc_stg, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping): ERF_TI_fast_headers.H'],['../ERF__fast__rhs__MT_8cpp.html#a526d3733938e64ccdcb7e99b2944b456',1,'erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stg_data, const MultiFab &S_stg_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const bool use_lagged_delta_rt, MultiFab &Omega, std::unique_ptr< MultiFab > &z_t_rk, const MultiFab *z_t_pert, std::unique_ptr< MultiFab > &z_phys_nd_old, std::unique_ptr< MultiFab > &z_phys_nd_new, std::unique_ptr< MultiFab > &z_phys_nd_stg, std::unique_ptr< MultiFab > &detJ_cc_old, std::unique_ptr< MultiFab > &detJ_cc_new, std::unique_ptr< MultiFab > &detJ_cc_stg, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool): ERF_fast_rhs_MT.cpp']]], + ['erf_5ffast_5frhs_5fn_3137',['erf_fast_rhs_N',['../ERF__fast__rhs__N_8cpp.html#a5fbcc0fe33b8e8e42f840ad475a092bd',1,'erf_fast_rhs_N(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping): ERF_fast_rhs_N.cpp'],['../ERF__TI__fast__headers_8H.html#a25b4f2c626cbe895f44d04b262cd0938',1,'erf_fast_rhs_N(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping): ERF_TI_fast_headers.H']]], + ['erf_5ffast_5frhs_5ft_3138',['erf_fast_rhs_T',['../ERF__fast__rhs__T_8cpp.html#a7f6548841f1ba09e67dbcdf782788659',1,'erf_fast_rhs_T(int step, int nrk, int level, int finest_level, Vector< MultiFab > &S_slow_rhs, const Vector< MultiFab > &S_prev, Vector< MultiFab > &S_stage_data, const MultiFab &S_stage_prim, const MultiFab &pi_stage, const MultiFab &fast_coeffs, Vector< MultiFab > &S_data, Vector< MultiFab > &S_scratch, const Geometry geom, const Real gravity, MultiFab &Omega, std::unique_ptr< MultiFab > &z_phys_nd, std::unique_ptr< MultiFab > &detJ_cc, const Real dtau, const Real beta_s, const Real facinv, std::unique_ptr< MultiFab > &mapfac_m, std::unique_ptr< MultiFab > &mapfac_u, std::unique_ptr< MultiFab > &mapfac_v, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool): ERF_fast_rhs_T.cpp'],['../ERF__TI__fast__headers_8H.html#a600146ca54f6fbeecc08fe9c93e5031c',1,'erf_fast_rhs_T(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping): ERF_TI_fast_headers.H']]], ['erf_5fgammafff_3139',['erf_gammafff',['../ERF__Microphysics__Utils_8H.html#abd125e107924437493cbcbac9a97c017',1,'ERF_Microphysics_Utils.H']]], ['erf_5finit_5fdens_5fhse_3140',['erf_init_dens_hse',['../classProblemBase.html#aef7d3d9788867d83e6ec8b2c9499de56',1,'ProblemBase::erf_init_dens_hse()'],['../ERF__init__constant__density__hse_8H.html#aa310c5ff8cdad11f3adfeeff0f5ad046',1,'erf_init_dens_hse(amrex::MultiFab &rho_hse, std::unique_ptr< amrex::MultiFab > &, std::unique_ptr< amrex::MultiFab > &, amrex::Geometry const &) override: ERF_init_constant_density_hse.H'],['../ERF__init__density__hse__dry_8H.html#a2e1d042f9d82e4b78d00e99ab25e9311',1,'erf_init_dens_hse(amrex::MultiFab &rho_hse, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &z_phys_cc, amrex::Geometry const &geom) override: ERF_init_density_hse_dry.H']]], ['erf_5finit_5fdens_5fhse_5fmoist_3141',['erf_init_dens_hse_moist',['../classProblemBase.html#ad1a7277d332001542789e488458096b9',1,'ProblemBase']]],