ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ShocDriver Class Reference

#include <ERF_ShocDriver.H>

Collaboration diagram for ShocDriver:

Public Member Functions

 ShocDriver (int lev, const SolverChoice &solver_choice)
 
void advance (amrex::MultiFab &cons, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::MultiFab &zvel, amrex::MultiFab *tau13, amrex::MultiFab *tau23, amrex::MultiFab *hfx3, amrex::MultiFab *qfx3, amrex::MultiFab *eddy_diffs, amrex::MultiFab &z_phys_nd, const amrex::Geometry &geom, double dt)
 
void set_eddy_diffs () const
 
void set_diff_stresses () const
 
void add_fast_tend (amrex::Vector< amrex::MultiFab > &S_rhs) const
 
void add_slow_tend (const amrex::MFIter &mfi, const amrex::Box &tbx, const amrex::Array4< amrex::Real > &cell_rhs) const
 
bool uses_state_update () const
 
bool uses_host_diffusion () const
 
bool uses_momentum_state_update () const
 
bool uses_momentum_host_diffusion () const
 
bool disables_momentum_transport () const
 
bool owns_scalar_surface_fluxes () const
 
bool owns_momentum_surface_stresses () const
 
bool needs_host_surface_momentum_stresses () const
 
bool owns_surface_fluxes () const
 
bool debug_summary_enabled () const
 
bool has_native_diagnostics () const
 
bool has_consumed_surface_flux_diagnostics () const
 
const amrex::MultiFab & native_diagnostics () const
 
const amrex::MultiFab & pblh_diagnostics () const
 
const amrex::MultiFab & consumed_sens_flux_diagnostics () const
 
const amrex::MultiFab & consumed_laten_flux_diagnostics () const
 
const amrex::MultiFab & shoc_ustar_diagnostics () const
 
const amrex::MultiFab & shoc_olen_diagnostics () const
 
const amrex::MultiFab & shoc_cldfrac_diagnostics () const
 
const amrex::MultiFab & shoc_ql_diagnostics () const
 
const amrex::MultiFab & shoc_ql2_diagnostics () const
 
const amrex::MultiFab & shoc_cond_diagnostics () const
 
const amrex::MultiFab & w_sec_diagnostics () const
 
const amrex::MultiFab & wqls_sec_diagnostics () const
 
const amrex::MultiFab & wthv_sec_diagnostics () const
 
const amrex::MultiFab & thl_sec_diagnostics () const
 
const amrex::MultiFab & qw_sec_diagnostics () const
 
const amrex::MultiFab & qwthl_sec_diagnostics () const
 
const amrex::MultiFab & wthl_sec_diagnostics () const
 
const amrex::MultiFab & wqw_sec_diagnostics () const
 
const amrex::MultiFab & w3_diagnostics () const
 
const amrex::MultiFab & brunt_diagnostics () const
 
const amrex::MultiFab & isotropy_diagnostics () const
 
const amrex::MultiFab & shear_prod_diagnostics () const
 
const amrex::MultiFab & buoy_prod_diagnostics () const
 
const amrex::MultiFab & diss_tke_diagnostics () const
 

Private Member Functions

void ensure_storage (const amrex::MultiFab &cons, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &eddy_diffs)
 
void seed_carried_turbulence (ShocColumnData &col, const amrex::MFIter &mfi, const amrex::MultiFab &cons, const amrex::MultiFab &eddy_diffs) const
 
void store_carried_turbulence (const ShocColumnData &col, const amrex::MFIter &mfi)
 
void seed_carried_buoyancy_flux (ShocColumnData &col, const amrex::MFIter &mfi) const
 
void store_carried_buoyancy_flux (const ShocColumnData &col, const amrex::MFIter &mfi)
 
void apply_state_update (amrex::MultiFab &cons, amrex::MultiFab &xvel, amrex::MultiFab &yvel, double dt) const
 
void debug_check_bad_column (const ShocColumnData &col, const amrex::MFIter &mfi, const amrex::MultiFab &z_phys_nd, const amrex::MultiFab *hfx3, const amrex::MultiFab *qfx3, const amrex::MultiFab *tau13, const amrex::MultiFab *tau23, const amrex::Geometry &geom, double dt) const
 
void print_debug_summary (double dt) const
 

Private Attributes

int m_lev
 
ShocRuntimeOptions m_opts
 
MoistureType m_moisture_type
 
MoistureComponentIndices m_moisture_indices
 
amrex::MultiFab m_theta_tend_cc
 
amrex::MultiFab m_qv_tend_cc
 
amrex::MultiFab m_qc_tend_cc
 
amrex::MultiFab m_qi_tend_cc
 
amrex::MultiFab m_tke_tend_cc
 
amrex::MultiFab m_u_tend_cc
 
amrex::MultiFab m_v_tend_cc
 
amrex::MultiFab m_u_tend_fc
 
amrex::MultiFab m_v_tend_fc
 
amrex::MultiFab m_eddy_coeffs_cc
 
amrex::MultiFab m_prev_turb_cc
 
amrex::MultiFab m_prev_wthv_sec_cc
 
amrex::MultiFab m_consumed_sens_flux_cc
 
amrex::MultiFab m_consumed_laten_flux_cc
 
amrex::MultiFab m_pblh_cc
 
amrex::MultiFab m_shoc_ustar_cc
 
amrex::MultiFab m_shoc_olen_cc
 
amrex::MultiFab m_shoc_cldfrac_cc
 
amrex::MultiFab m_shoc_ql_cc
 
amrex::MultiFab m_shoc_ql2_cc
 
amrex::MultiFab m_shoc_cond_cc
 
amrex::MultiFab m_w_sec_cc
 
amrex::MultiFab m_wqls_sec_cc
 
amrex::MultiFab m_wthv_sec_cc
 
amrex::MultiFab m_thl_sec_cc
 
amrex::MultiFab m_qw_sec_cc
 
amrex::MultiFab m_qwthl_sec_cc
 
amrex::MultiFab m_wthl_sec_cc
 
amrex::MultiFab m_wqw_sec_cc
 
amrex::MultiFab m_w3_cc
 
amrex::MultiFab m_brunt_cc
 
amrex::MultiFab m_isotropy_cc
 
amrex::MultiFab m_shear_prod_cc
 
amrex::MultiFab m_buoy_prod_cc
 
amrex::MultiFab m_diss_tke_cc
 
amrex::MultiFab * m_cons_ptr = nullptr
 
amrex::MultiFab * m_hfx3_ptr = nullptr
 
amrex::MultiFab * m_qfx3_ptr = nullptr
 
amrex::MultiFab * m_tau13_ptr = nullptr
 
amrex::MultiFab * m_tau23_ptr = nullptr
 
amrex::MultiFab * m_eddy_diffs_ptr = nullptr
 
amrex::Vector< std::unique_ptr< ShocColumnWorkspace > > m_column_workspaces
 
int m_advance_calls = 0
 
bool m_prev_turb_valid = false
 

Constructor & Destructor Documentation

◆ ShocDriver()

ShocDriver::ShocDriver ( int  lev,
const SolverChoice solver_choice 
)
explicit
309  : m_lev(lev),
310  m_moisture_type(solver_choice.moisture_type),
311  m_moisture_indices(solver_choice.moisture_indices)
312 {
315  warn_if_shoc_debug_overrides_active_once(m_opts);
316 
317  std::string error_message;
319  amrex::Abort(error_message.c_str());
320  }
321 }
bool shoc_driver_host_diffusion_moisture_supported(const ShocRuntimeOptions &opts, MoistureType moisture_type, std::string &error_message)
Definition: ERF_ShocDriver.H:25
void validate_shoc_runtime_options(const ShocRuntimeOptions &opts)
Definition: ERF_ShocTypes.H:342
void read_shoc_runtime_options(ShocRuntimeOptions &opts)
Definition: ERF_ShocTypes.H:283
ShocRuntimeOptions m_opts
Definition: ERF_ShocDriver.H:128
MoistureComponentIndices m_moisture_indices
Definition: ERF_ShocDriver.H:130
int m_lev
Definition: ERF_ShocDriver.H:127
MoistureType m_moisture_type
Definition: ERF_ShocDriver.H:129
MoistureType moisture_type
Definition: ERF_DataStruct.H:1424
MoistureComponentIndices moisture_indices
Definition: ERF_DataStruct.H:1441
Here is the call graph for this function:

Member Function Documentation

◆ add_fast_tend()

void ShocDriver::add_fast_tend ( amrex::Vector< amrex::MultiFab > &  S_rhs) const
847 {
848  AMREX_ALWAYS_ASSERT(m_cons_ptr != nullptr);
849 
850  amrex::ignore_unused(S_rhs);
851 }
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
amrex::MultiFab * m_cons_ptr
Definition: ERF_ShocDriver.H:167
Here is the call graph for this function:

◆ add_slow_tend()

void ShocDriver::add_slow_tend ( const amrex::MFIter &  mfi,
const amrex::Box &  tbx,
const amrex::Array4< amrex::Real > &  cell_rhs 
) const
857 {
858  AMREX_ALWAYS_ASSERT(m_cons_ptr != nullptr);
859  amrex::ignore_unused(mfi, tbx, cell_rhs);
860 }
Here is the call graph for this function:

◆ advance()

void ShocDriver::advance ( amrex::MultiFab &  cons,
amrex::MultiFab &  xvel,
amrex::MultiFab &  yvel,
amrex::MultiFab &  zvel,
amrex::MultiFab *  tau13,
amrex::MultiFab *  tau23,
amrex::MultiFab *  hfx3,
amrex::MultiFab *  qfx3,
amrex::MultiFab *  eddy_diffs,
amrex::MultiFab &  z_phys_nd,
const amrex::Geometry &  geom,
double  dt 
)
477 {
478  BL_PROFILE("SHOC::advance");
479 
480  require_full_height_shoc_boxes(cons.boxArray(), geom.Domain());
481 
482  m_cons_ptr = &cons;
483  m_hfx3_ptr = hfx3;
484  m_qfx3_ptr = qfx3;
485  m_tau13_ptr = tau13;
486  m_tau23_ptr = tau23;
487  m_eddy_diffs_ptr = eddy_diffs;
488 
489  sync_face_multifab_impl(xvel, geom);
490  sync_face_multifab_impl(yvel, geom);
491  if (m_tau13_ptr) {
492  sync_face_multifab_impl(*m_tau13_ptr, geom);
493  }
494  if (m_tau23_ptr) {
495  sync_face_multifab_impl(*m_tau23_ptr, geom);
496  }
497 
498  {
499  BL_PROFILE("SHOC::advance::ensure_storage");
500  ensure_storage(cons, xvel, yvel, *eddy_diffs);
501  }
502 
503  std::string error_message;
505  error_message)) {
506  amrex::Abort(error_message.c_str());
507  }
508 
509  // Keep one SHOC column workspace per local box so GPU writeback kernels
510  // can finish reading a box's scratch before it is reused.
511  const amrex::Long n_local = cons.local_size();
512  AMREX_ALWAYS_ASSERT(n_local >= amrex::Long{0});
513  const amrex::Long current_size = static_cast<amrex::Long>(m_column_workspaces.size());
514  if (current_size < n_local) {
515  const amrex::Long old_size = current_size;
516  m_column_workspaces.resize(static_cast<std::size_t>(n_local));
517  for (amrex::Long n = old_size; n < n_local; ++n) {
518  m_column_workspaces[static_cast<std::size_t>(n)] =
519  std::make_unique<ShocColumnWorkspace>();
520  }
521  }
522 
523  amrex::Long local_index = 0;
524  for (MFIter mfi(cons, false); mfi.isValid(); ++mfi, ++local_index) {
526  local_index < static_cast<amrex::Long>(m_column_workspaces.size()));
527  ShocColumnWorkspace& workspace =
528  *m_column_workspaces[static_cast<std::size_t>(local_index)];
529  const Box& vbx = mfi.validbox();
530  const ShocColumnLayout active_layout = make_shoc_layout(vbx, geom);
531  {
532  BL_PROFILE("SHOC::advance::define_column_data");
533  workspace.ensure_capacity(active_layout, amrex::The_Async_Arena(),
535  }
536  ShocColumnData& col = workspace.col;
537  {
538  BL_PROFILE("SHOC::advance::preprocess");
540  hfx3, qfx3, tau13, tau23, z_phys_nd, geom,
542  }
543  {
544  BL_PROFILE("SHOC::advance::seed_carried_buoyancy_flux");
545  seed_carried_buoyancy_flux(col, mfi);
546  }
547  {
548  BL_PROFILE("SHOC::advance::seed_carried_turbulence");
549  seed_carried_turbulence(col, mfi, cons, *eddy_diffs);
550  }
551  const auto dx = geom.CellSizeArray();
552  if (uses_state_update()) {
553  BL_PROFILE("SHOC::advance::cache_baseline_state");
555  }
557  if (uses_state_update()) {
558  BL_PROFILE("SHOC::advance::implicit");
560  }
562  if (uses_state_update()) {
563  BL_PROFILE("SHOC::advance::finalize");
565  BL_PROFILE("SHOC::advance::debug_bad_column");
566  debug_check_bad_column(col, mfi, z_phys_nd, hfx3, qfx3, tau13, tau23, geom, dt);
567  }
568  {
569  BL_PROFILE("SHOC::advance::store_carried_buoyancy_flux");
570  store_carried_buoyancy_flux(col, mfi);
571  }
572  {
573  BL_PROFILE("SHOC::advance::store_carried_turbulence");
574  store_carried_turbulence(col, mfi);
575  }
576 
577  auto tk_arr = m_eddy_coeffs_cc.array(mfi);
578  auto th_tend = m_theta_tend_cc.array(mfi);
579  auto qv_tend = m_qv_tend_cc.array(mfi);
580  auto qc_tend = m_qc_tend_cc.array(mfi);
581  auto qi_tend = m_qi_tend_cc.array(mfi);
582  auto tke_tend = m_tke_tend_cc.array(mfi);
583  auto u_tend_cc = m_u_tend_cc.array(mfi);
584  auto v_tend_cc = m_v_tend_cc.array(mfi);
585  auto pblh_arr = m_pblh_cc.array(mfi);
586  auto consumed_sens_flux_arr = m_consumed_sens_flux_cc.array(mfi);
587  auto consumed_laten_flux_arr = m_consumed_laten_flux_cc.array(mfi);
588  auto shoc_ustar_arr = m_shoc_ustar_cc.array(mfi);
589  auto shoc_olen_arr = m_shoc_olen_cc.array(mfi);
590  auto shoc_cldfrac_arr = m_shoc_cldfrac_cc.array(mfi);
591  auto shoc_ql_arr = m_shoc_ql_cc.array(mfi);
592  auto shoc_ql2_arr = m_shoc_ql2_cc.array(mfi);
593  auto shoc_cond_arr = m_shoc_cond_cc.array(mfi);
594  auto w_sec_arr = m_w_sec_cc.array(mfi);
595  auto wqls_sec_arr = m_wqls_sec_cc.array(mfi);
596  auto wthv_sec_arr = m_wthv_sec_cc.array(mfi);
597  auto thl_sec_arr = m_thl_sec_cc.array(mfi);
598  auto qw_sec_arr = m_qw_sec_cc.array(mfi);
599  auto qwthl_sec_arr = m_qwthl_sec_cc.array(mfi);
600  auto wthl_sec_arr = m_wthl_sec_cc.array(mfi);
601  auto wqw_sec_arr = m_wqw_sec_cc.array(mfi);
602  auto w3_arr = m_w3_cc.array(mfi);
603  auto brunt_arr = m_brunt_cc.array(mfi);
604  auto isotropy_arr = m_isotropy_cc.array(mfi);
605  auto shear_prod_arr = m_shear_prod_cc.array(mfi);
606  auto buoy_prod_arr = m_buoy_prod_cc.array(mfi);
607  auto diss_tke_arr = m_diss_tke_cc.array(mfi);
608 
609  const auto shoc_mix = col.shoc_mix.const_array();
610  const auto pblh = col.pblh.const_array();
611  const auto surf_sens_flux = col.surf_sens_flux.const_array();
612  const auto surf_lat_flux = col.surf_lat_flux.const_array();
613  const auto ustar = col.ustar.const_array();
614  const auto obklen = col.obklen.const_array();
615  const auto shoc_cldfrac = col.shoc_cldfrac.const_array();
616  const auto shoc_ql = col.shoc_ql.const_array();
617  const auto shoc_ql2 = col.shoc_ql2.const_array();
618  const auto shoc_cond = col.shoc_cond.const_array();
619  const auto w_sec = col.w_sec.const_array();
620  const auto wqls_sec = col.wqls_sec.const_array();
621  const auto wthv_sec = col.wthv_sec.const_array();
622  const auto thl_sec = col.thl_sec.const_array();
623  const auto qw_sec = col.qw_sec.const_array();
624  const auto qwthl_sec = col.qwthl_sec.const_array();
625  const auto wthl_sec = col.wthl_sec.const_array();
626  const auto wqw_sec = col.wqw_sec.const_array();
627  const auto w3 = col.w3.const_array();
628  const auto brunt = col.brunt.const_array();
629  const auto isotropy = col.isotropy.const_array();
630  const auto shear_prod = col.shear_prod.const_array();
631  const auto buoy_prod = col.buoy_prod.const_array();
632  const auto diss_tke = col.diss_tke.const_array();
633  const auto tk = col.tk.const_array();
634  const auto tkh = col.tkh.const_array();
635  const auto rho = col.rho.const_array();
636  const auto zt = col.zt.const_array();
637  const auto zi = col.zi.const_array();
638  const auto col_theta_tend = col.theta_tend.const_array();
639  const auto col_qv_tend = col.qv_tend.const_array();
640  const auto col_qc_tend = col.qc_tend.const_array();
641  const auto col_qi_tend = col.qi_tend.const_array();
642  const auto col_tke_tend = col.tke_tend.const_array();
643  const auto col_u_tend = col.u_tend.const_array();
644  const auto col_v_tend = col.v_tend.const_array();
645  const auto layout = col.layout;
646  const Box xy_box = amrex::makeSlab(vbx, 2, layout.kmin);
647  {
648  BL_PROFILE("SHOC::advance::writeback");
649  ParallelFor(xy_box, [=] AMREX_GPU_DEVICE (int i, int j, int) noexcept
650  {
651  const int ic = shoc_column_index(layout, i, j);
652  const int k0 = layout.kmin;
653  const Real rho_sfc = rho(ic,0,0);
654  for (int kk = 0; kk < layout.nlev; ++kk) {
655  const int k = layout.kmin + kk;
656  const Real l = shoc_mix(ic,kk,0);
657  const Real km = tk(ic,kk,0);
658  const Real kh = tkh(ic,kk,0);
659 
660  tk_arr(i,j,k,EddyDiff::Mom_v) = rho(ic,kk,0) * km;
661  tk_arr(i,j,k,EddyDiff::Theta_v) = rho(ic,kk,0) * kh;
662  tk_arr(i,j,k,EddyDiff::KE_v) = rho(ic,kk,0) * kh;
663  tk_arr(i,j,k,EddyDiff::Scalar_v) = rho(ic,kk,0) * kh;
664  tk_arr(i,j,k,EddyDiff::Q_v) = rho(ic,kk,0) * kh;
665  tk_arr(i,j,k,EddyDiff::Turb_lengthscale) = l;
666 
667  th_tend(i,j,k) = col_theta_tend(ic,kk,0);
668  qv_tend(i,j,k) = col_qv_tend(ic,kk,0);
669  qc_tend(i,j,k) = col_qc_tend(ic,kk,0);
670  qi_tend(i,j,k) = col_qi_tend(ic,kk,0);
671  tke_tend(i,j,k) = col_tke_tend(ic,kk,0);
672  u_tend_cc(i,j,k) = col_u_tend(ic,kk,0);
673  v_tend_cc(i,j,k) = col_v_tend(ic,kk,0);
674  // Native SHOC pblh is diagnosed as meters AGL and is
675  // copied directly into the plotfile diagnostic field.
676  pblh_arr(i,j,k) = pblh(ic,0,0);
677  shoc_cldfrac_arr(i,j,k) = shoc_cldfrac(ic,kk,0);
678  shoc_ql_arr(i,j,k) = shoc_ql(ic,kk,0);
679  shoc_ql2_arr(i,j,k) = shoc_ql2(ic,kk,0);
680  shoc_cond_arr(i,j,k) = shoc_cond(ic,kk,0);
681  w_sec_arr(i,j,k) = w_sec(ic,kk,0);
682  wqls_sec_arr(i,j,k) = wqls_sec(ic,kk,0);
683  wthv_sec_arr(i,j,k) = wthv_sec(ic,kk,0);
684  brunt_arr(i,j,k) = brunt(ic,kk,0);
685  isotropy_arr(i,j,k) = isotropy(ic,kk,0);
686  thl_sec_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
687  thl_sec(ic,kk,0), thl_sec(ic,kk+1,0),
688  zt(ic,kk,0));
689  qw_sec_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
690  qw_sec(ic,kk,0), qw_sec(ic,kk+1,0),
691  zt(ic,kk,0));
692  qwthl_sec_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
693  qwthl_sec(ic,kk,0), qwthl_sec(ic,kk+1,0),
694  zt(ic,kk,0));
695  wthl_sec_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
696  wthl_sec(ic,kk,0), wthl_sec(ic,kk+1,0),
697  zt(ic,kk,0));
698  wqw_sec_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
699  wqw_sec(ic,kk,0), wqw_sec(ic,kk+1,0),
700  zt(ic,kk,0));
701  w3_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
702  w3(ic,kk,0), w3(ic,kk+1,0),
703  zt(ic,kk,0));
704  shear_prod_arr(i,j,k) = shear_prod(ic,kk,0);
705  buoy_prod_arr(i,j,k) = buoy_prod(ic,kk,0);
706  diss_tke_arr(i,j,k) = diss_tke(ic,kk,0);
707  }
708  // Motivation: Native SHOC state_update consumes SurfaceLayer
709  // fluxes before the host diffusion path clears the overlapping
710  // SFS arrays. Preserve the consumed conservative fluxes here
711  // so 2D diagnostics report the surface forcing SHOC actually
712  // used, not the cleared host arrays.
713  consumed_sens_flux_arr(i,j,k0) = rho_sfc * surf_sens_flux(ic,0,0);
714  consumed_laten_flux_arr(i,j,k0) = rho_sfc * surf_lat_flux(ic,0,0);
715  shoc_ustar_arr(i,j,k0) = ustar(ic,0,0);
716  shoc_olen_arr(i,j,k0) = obklen(ic,0,0);
717  });
718  }
719 
720  }
721 
722  {
723  BL_PROFILE("SHOC::advance::tendency_interpolation");
724  m_u_tend_cc.FillBoundary(geom.periodicity());
725  m_v_tend_cc.FillBoundary(geom.periodicity());
726 
727  const auto dom = geom.Domain();
728  const int ilo = dom.smallEnd(0);
729  const int ihi = dom.bigEnd(0);
730  const int jlo = dom.smallEnd(1);
731  const int jhi = dom.bigEnd(1);
732  const bool xper = geom.isPeriodic(0);
733  const bool yper = geom.isPeriodic(1);
734 
735  for (MFIter mfi(m_u_tend_cc, false); mfi.isValid(); ++mfi) {
736  const Box& cc_bx = mfi.validbox();
737  const Box xface_bx = amrex::surroundingNodes(cc_bx, 0);
738  const Box yface_bx = amrex::surroundingNodes(cc_bx, 1);
739  const auto u_cc = m_u_tend_cc.const_array(mfi);
740  const auto v_cc = m_v_tend_cc.const_array(mfi);
741  auto u_fc = m_u_tend_fc.array(mfi);
742  auto v_fc = m_v_tend_fc.array(mfi);
743 
744  ParallelFor(xface_bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
745  {
746  const int il = face_neighbor_cell(i - 1, ilo, ihi, xper);
747  const int ir = face_neighbor_cell(i, ilo, ihi, xper);
748  u_fc(i,j,k) = 0.5_rt * (u_cc(il,j,k) + u_cc(ir,j,k));
749  });
750 
751  ParallelFor(yface_bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
752  {
753  const int jb = face_neighbor_cell(j - 1, jlo, jhi, yper);
754  const int jt = face_neighbor_cell(j, jlo, jhi, yper);
755  v_fc(i,j,k) = 0.5_rt * (v_cc(i,jb,k) + v_cc(i,jt,k));
756  });
757  }
758  }
759 
760  if (uses_state_update()) {
761  sync_face_multifab_impl(m_u_tend_fc, geom);
762  sync_face_multifab_impl(m_v_tend_fc, geom);
763  }
764 
765  if (uses_state_update()) {
766  BL_PROFILE("SHOC::advance::state_update");
768  }
769 
771  sync_face_multifab_impl(xvel, geom);
772  sync_face_multifab_impl(yvel, geom);
773  }
774 
775  m_prev_turb_valid = true;
776  ++m_advance_calls;
777  if (m_opts.debug_summary) {
778  BL_PROFILE("SHOC::advance::debug_summary");
780  }
781 }
@ tau23
Definition: ERF_DataStruct.H:32
@ tau13
Definition: ERF_DataStruct.H:32
const Real dx
Definition: ERF_InitCustomPert_ABL.H:23
rho
Definition: ERF_InitCustomPert_Bubble.H:107
ParallelFor(grown_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int shoc_column_index(const ShocColumnLayout &layout, int i, int j)
Definition: ERF_ShocColumnData.H:130
ShocColumnLayout make_shoc_layout(const amrex::Box &bx, const amrex::Geometry &geom)
Definition: ERF_ShocColumnData.H:11
bool shoc_driver_state_update_layout_supported(const ShocRuntimeOptions &opts, const MoistureComponentIndices &indices, int ncomp, std::string &error_message)
Definition: ERF_ShocDriver.H:39
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_ShocColumnData.H:103
ShocColumnData col
Definition: ERF_ShocColumnData.H:105
void ensure_capacity(const ShocColumnLayout &layout, amrex::Arena *arena=amrex::The_Async_Arena(), shoc::InitRunOn init_run_on=shoc::default_init_run_on())
Definition: ERF_ShocColumnData.H:107
static void diagnose_pre_implicit(ShocColumnData &col, const ShocRuntimeOptions &opts, amrex::Real dx, amrex::Real dy, double dt)
Definition: ERF_ShocDiagnostics.cpp:6
static void diagnose_post_implicit(ShocColumnData &col, const ShocRuntimeOptions &opts, double dt)
Definition: ERF_ShocDiagnostics.cpp:25
amrex::MultiFab m_shoc_ql_cc
Definition: ERF_ShocDriver.H:150
void print_debug_summary(double dt) const
Definition: ERF_ShocDriver.cpp:1477
bool m_prev_turb_valid
Definition: ERF_ShocDriver.H:175
void debug_check_bad_column(const ShocColumnData &col, const amrex::MFIter &mfi, const amrex::MultiFab &z_phys_nd, const amrex::MultiFab *hfx3, const amrex::MultiFab *qfx3, const amrex::MultiFab *tau13, const amrex::MultiFab *tau23, const amrex::Geometry &geom, double dt) const
Definition: ERF_ShocDriver.cpp:943
amrex::MultiFab m_qw_sec_cc
Definition: ERF_ShocDriver.H:157
amrex::MultiFab m_diss_tke_cc
Definition: ERF_ShocDriver.H:166
amrex::MultiFab m_qwthl_sec_cc
Definition: ERF_ShocDriver.H:158
amrex::MultiFab * m_qfx3_ptr
Definition: ERF_ShocDriver.H:169
int m_advance_calls
Definition: ERF_ShocDriver.H:174
void apply_state_update(amrex::MultiFab &cons, amrex::MultiFab &xvel, amrex::MultiFab &yvel, double dt) const
Definition: ERF_ShocDriver.cpp:917
amrex::MultiFab m_pblh_cc
Definition: ERF_ShocDriver.H:146
amrex::MultiFab m_eddy_coeffs_cc
Definition: ERF_ShocDriver.H:141
amrex::MultiFab m_buoy_prod_cc
Definition: ERF_ShocDriver.H:165
amrex::MultiFab m_wthl_sec_cc
Definition: ERF_ShocDriver.H:159
amrex::MultiFab m_u_tend_fc
Definition: ERF_ShocDriver.H:139
amrex::MultiFab m_wqls_sec_cc
Definition: ERF_ShocDriver.H:154
amrex::MultiFab * m_tau13_ptr
Definition: ERF_ShocDriver.H:170
amrex::MultiFab m_v_tend_fc
Definition: ERF_ShocDriver.H:140
void seed_carried_buoyancy_flux(ShocColumnData &col, const amrex::MFIter &mfi) const
Definition: ERF_ShocDriver.cpp:437
amrex::MultiFab m_w3_cc
Definition: ERF_ShocDriver.H:161
amrex::MultiFab m_shoc_ustar_cc
Definition: ERF_ShocDriver.H:147
void seed_carried_turbulence(ShocColumnData &col, const amrex::MFIter &mfi, const amrex::MultiFab &cons, const amrex::MultiFab &eddy_diffs) const
Definition: ERF_ShocDriver.cpp:405
amrex::MultiFab m_theta_tend_cc
Definition: ERF_ShocDriver.H:132
amrex::MultiFab m_qc_tend_cc
Definition: ERF_ShocDriver.H:134
amrex::MultiFab m_wqw_sec_cc
Definition: ERF_ShocDriver.H:160
amrex::MultiFab m_shoc_olen_cc
Definition: ERF_ShocDriver.H:148
amrex::MultiFab m_consumed_laten_flux_cc
Definition: ERF_ShocDriver.H:145
amrex::MultiFab m_brunt_cc
Definition: ERF_ShocDriver.H:162
amrex::MultiFab m_wthv_sec_cc
Definition: ERF_ShocDriver.H:155
amrex::MultiFab m_shear_prod_cc
Definition: ERF_ShocDriver.H:164
amrex::MultiFab m_w_sec_cc
Definition: ERF_ShocDriver.H:153
void store_carried_buoyancy_flux(const ShocColumnData &col, const amrex::MFIter &mfi)
Definition: ERF_ShocDriver.cpp:453
void store_carried_turbulence(const ShocColumnData &col, const amrex::MFIter &mfi)
Definition: ERF_ShocDriver.cpp:424
bool uses_state_update() const
Definition: ERF_ShocDriver.cpp:869
void ensure_storage(const amrex::MultiFab &cons, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &eddy_diffs)
Definition: ERF_ShocDriver.cpp:324
bool uses_momentum_state_update() const
Definition: ERF_ShocDriver.cpp:875
amrex::MultiFab m_shoc_cldfrac_cc
Definition: ERF_ShocDriver.H:149
amrex::MultiFab m_tke_tend_cc
Definition: ERF_ShocDriver.H:136
amrex::MultiFab m_qi_tend_cc
Definition: ERF_ShocDriver.H:135
amrex::MultiFab m_thl_sec_cc
Definition: ERF_ShocDriver.H:156
amrex::MultiFab * m_tau23_ptr
Definition: ERF_ShocDriver.H:171
amrex::MultiFab * m_eddy_diffs_ptr
Definition: ERF_ShocDriver.H:172
amrex::MultiFab m_consumed_sens_flux_cc
Definition: ERF_ShocDriver.H:144
amrex::MultiFab m_isotropy_cc
Definition: ERF_ShocDriver.H:163
amrex::MultiFab m_u_tend_cc
Definition: ERF_ShocDriver.H:137
amrex::MultiFab m_v_tend_cc
Definition: ERF_ShocDriver.H:138
amrex::MultiFab m_shoc_ql2_cc
Definition: ERF_ShocDriver.H:151
amrex::MultiFab m_shoc_cond_cc
Definition: ERF_ShocDriver.H:152
amrex::MultiFab m_qv_tend_cc
Definition: ERF_ShocDriver.H:133
amrex::MultiFab * m_hfx3_ptr
Definition: ERF_ShocDriver.H:168
amrex::Vector< std::unique_ptr< ShocColumnWorkspace > > m_column_workspaces
Definition: ERF_ShocDriver.H:173
static void advance_implicit_state(ShocColumnData &col, const ShocRuntimeOptions &opts, double dt)
Definition: ERF_ShocImplicit.cpp:166
static void cache_baseline_state(ShocColumnData &col)
Definition: ERF_ShocImplicit.cpp:84
static void finalize_from_pdf(ShocColumnData &col, const ShocRuntimeOptions &opts, double dt)
Definition: ERF_ShocImplicit.cpp:322
static void fill_columns(ShocColumnData &col, const amrex::MFIter &mfi, const amrex::MultiFab &cons, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &zvel, const amrex::MultiFab *hfx3, const amrex::MultiFab *qfx3, const amrex::MultiFab *tau13, const amrex::MultiFab *tau23, const amrex::MultiFab &z_phys_nd, const amrex::Geometry &geom, const MoistureComponentIndices &moisture_indices)
Definition: ERF_ShocPreprocess.cpp:31
@ Theta_v
Definition: ERF_IndexDefines.H:211
@ Turb_lengthscale
Definition: ERF_IndexDefines.H:215
@ Scalar_v
Definition: ERF_IndexDefines.H:213
@ Q_v
Definition: ERF_IndexDefines.H:214
@ Mom_v
Definition: ERF_IndexDefines.H:210
@ KE_v
Definition: ERF_IndexDefines.H:212
@ xvel
Definition: ERF_IndexDefines.H:176
@ cons
Definition: ERF_IndexDefines.H:175
@ zvel
Definition: ERF_IndexDefines.H:178
@ yvel
Definition: ERF_IndexDefines.H:177
@ tk
Definition: ERF_AdvanceWSM6.cpp:111
@ zi
Definition: ERF_AdvanceWSM6.cpp:133
InitRunOn default_init_run_on()
Definition: ERF_ShocGpuUtils.H:27
Definition: ERF_ShocTypes.H:204
amrex::FArrayBox qc_tend
Definition: ERF_ShocTypes.H:271
amrex::FArrayBox v_tend
Definition: ERF_ShocTypes.H:274
amrex::FArrayBox shoc_cond
Definition: ERF_ShocTypes.H:246
amrex::FArrayBox buoy_prod
Definition: ERF_ShocTypes.H:239
amrex::FArrayBox diss_tke
Definition: ERF_ShocTypes.H:240
amrex::FArrayBox w_sec
Definition: ERF_ShocTypes.H:258
amrex::FArrayBox tk
Definition: ERF_ShocTypes.H:236
amrex::FArrayBox w3
Definition: ERF_ShocTypes.H:257
amrex::FArrayBox surf_lat_flux
Definition: ERF_ShocTypes.H:277
amrex::FArrayBox ustar
Definition: ERF_ShocTypes.H:232
amrex::FArrayBox shoc_mix
Definition: ERF_ShocTypes.H:233
amrex::FArrayBox wthv_sec
Definition: ERF_ShocTypes.H:241
amrex::FArrayBox shear_prod
Definition: ERF_ShocTypes.H:238
amrex::FArrayBox rho
Definition: ERF_ShocTypes.H:213
amrex::FArrayBox wqw_sec
Definition: ERF_ShocTypes.H:253
amrex::FArrayBox shoc_ql
Definition: ERF_ShocTypes.H:243
amrex::FArrayBox pblh
Definition: ERF_ShocTypes.H:230
amrex::FArrayBox isotropy
Definition: ERF_ShocTypes.H:235
amrex::FArrayBox qw_sec
Definition: ERF_ShocTypes.H:250
amrex::FArrayBox tkh
Definition: ERF_ShocTypes.H:237
amrex::FArrayBox tke_tend
Definition: ERF_ShocTypes.H:275
amrex::FArrayBox qi_tend
Definition: ERF_ShocTypes.H:272
amrex::FArrayBox u_tend
Definition: ERF_ShocTypes.H:273
ShocColumnLayout layout
Definition: ERF_ShocTypes.H:205
amrex::FArrayBox zi
Definition: ERF_ShocTypes.H:209
amrex::FArrayBox surf_sens_flux
Definition: ERF_ShocTypes.H:276
amrex::FArrayBox zt
Definition: ERF_ShocTypes.H:208
amrex::FArrayBox theta_tend
Definition: ERF_ShocTypes.H:269
amrex::FArrayBox obklen
Definition: ERF_ShocTypes.H:231
amrex::FArrayBox wqls_sec
Definition: ERF_ShocTypes.H:245
amrex::FArrayBox qv_tend
Definition: ERF_ShocTypes.H:270
amrex::FArrayBox wthl_sec
Definition: ERF_ShocTypes.H:252
amrex::FArrayBox thl_sec
Definition: ERF_ShocTypes.H:249
amrex::FArrayBox shoc_ql2
Definition: ERF_ShocTypes.H:244
amrex::FArrayBox qwthl_sec
Definition: ERF_ShocTypes.H:251
amrex::FArrayBox brunt
Definition: ERF_ShocTypes.H:234
amrex::FArrayBox shoc_cldfrac
Definition: ERF_ShocTypes.H:242
Definition: ERF_ShocTypes.H:192
bool debug_summary
Definition: ERF_ShocTypes.H:104
Here is the call graph for this function:

◆ apply_state_update()

void ShocDriver::apply_state_update ( amrex::MultiFab &  cons,
amrex::MultiFab &  xvel,
amrex::MultiFab &  yvel,
double  dt 
) const
private
921 {
922  AMREX_ALWAYS_ASSERT(dt > 0.0);
923 
924  apply_state_update_cons_impl(cons,
926  m_qv_tend_cc,
927  m_qc_tend_cc,
928  m_qi_tend_cc,
933  m_opts,
934  dt);
935 
937  apply_state_update_face_velocity_impl(xvel, m_u_tend_fc, dt);
938  apply_state_update_face_velocity_impl(yvel, m_v_tend_fc, dt);
939  }
940 }
int qi
Definition: ERF_DataStruct.H:109
int qv
Definition: ERF_DataStruct.H:107
int qc
Definition: ERF_DataStruct.H:108

Referenced by advance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ brunt_diagnostics()

const amrex::MultiFab& ShocDriver::brunt_diagnostics ( ) const
inline
120 { return m_brunt_cc; }

◆ buoy_prod_diagnostics()

const amrex::MultiFab& ShocDriver::buoy_prod_diagnostics ( ) const
inline
123 { return m_buoy_prod_cc; }

◆ consumed_laten_flux_diagnostics()

const amrex::MultiFab& ShocDriver::consumed_laten_flux_diagnostics ( ) const
inline
102  {
104  }

Referenced by ERF::Write2DPlotFile().

Here is the caller graph for this function:

◆ consumed_sens_flux_diagnostics()

const amrex::MultiFab& ShocDriver::consumed_sens_flux_diagnostics ( ) const
inline
98  {
100  }

Referenced by ERF::Write2DPlotFile().

Here is the caller graph for this function:

◆ debug_check_bad_column()

void ShocDriver::debug_check_bad_column ( const ShocColumnData col,
const amrex::MFIter &  mfi,
const amrex::MultiFab &  z_phys_nd,
const amrex::MultiFab *  hfx3,
const amrex::MultiFab *  qfx3,
const amrex::MultiFab *  tau13,
const amrex::MultiFab *  tau23,
const amrex::Geometry &  geom,
double  dt 
) const
private
952 {
953  amrex::ignore_unused(geom, dt_d);
954 
955  if (!m_opts.debug_bad_column) {
956  return;
957  }
958 
959  AMREX_ALWAYS_ASSERT(m_cons_ptr != nullptr);
960  print_shoc_debug_settings_once(m_opts);
961 
962  const auto cons_host = copy_fab_to_host((*m_cons_ptr)[mfi]);
963  const auto z_host = copy_fab_to_host(z_phys_nd[mfi]);
964  const auto theta_tend_host = copy_fab_to_host(col.theta_tend);
965  const auto qv_tend_host = copy_fab_to_host(col.qv_tend);
966  const auto qc_tend_host = copy_fab_to_host(col.qc_tend);
967  const auto qi_tend_host = copy_fab_to_host(col.qi_tend);
968  const auto tke_tend_host = copy_fab_to_host(col.tke_tend);
969  const auto u_tend_host = copy_fab_to_host(col.u_tend);
970  const auto v_tend_host = copy_fab_to_host(col.v_tend);
971  const auto p_mid_host = copy_fab_to_host(col.p_mid);
972  const auto p_int_host = copy_fab_to_host(col.p_int);
973  const auto zt_host = copy_fab_to_host(col.zt);
974  const auto zi_host = copy_fab_to_host(col.zi);
975  const auto dz_host = copy_fab_to_host(col.dz);
976  const auto rho_host = copy_fab_to_host(col.rho);
977  const auto theta_host = copy_fab_to_host(col.theta);
978  const auto thetal_host = copy_fab_to_host(col.thetal);
979  const auto theta_base_host = copy_fab_to_host(col.theta_base);
980  const auto thetal_base_host = copy_fab_to_host(col.thetal_base);
981  const auto qv_base_host = copy_fab_to_host(col.qv_base);
982  const auto qc_base_host = copy_fab_to_host(col.qc_base);
983  const auto qi_base_host = copy_fab_to_host(col.qi_base);
984  const auto tke_base_host = copy_fab_to_host(col.tke_base_state);
985  const auto theta_v_host = copy_fab_to_host(col.theta_v);
986  const auto qv_host = copy_fab_to_host(col.qv);
987  const auto qc_host = copy_fab_to_host(col.qc);
988  const auto qi_host = copy_fab_to_host(col.qi);
989  const auto qw_host = copy_fab_to_host(col.qw);
990  const auto tabs_host = copy_fab_to_host(col.tabs);
991  const auto exner_host = copy_fab_to_host(col.exner);
992  const auto host_dse_host = copy_fab_to_host(col.host_dse);
993  const auto pblh_host = copy_fab_to_host(col.pblh);
994  const auto obklen_host = copy_fab_to_host(col.obklen);
995  const auto ustar_host = copy_fab_to_host(col.ustar);
996  const auto shoc_mix_host = copy_fab_to_host(col.shoc_mix);
997  const auto brunt_host = copy_fab_to_host(col.brunt);
998  const auto isotropy_host = copy_fab_to_host(col.isotropy);
999  const auto tk_host = copy_fab_to_host(col.tk);
1000  const auto tkh_host = copy_fab_to_host(col.tkh);
1001  const auto shear_prod_host = copy_fab_to_host(col.shear_prod);
1002  const auto buoy_prod_host = copy_fab_to_host(col.buoy_prod);
1003  const auto diss_tke_host = copy_fab_to_host(col.diss_tke);
1004  const auto tke_host = copy_fab_to_host(col.tke);
1005  const auto w_sec_host = copy_fab_to_host(col.w_sec);
1006  const auto wthv_sec_host = copy_fab_to_host(col.wthv_sec);
1007  const auto shoc_cldfrac_host = copy_fab_to_host(col.shoc_cldfrac);
1008  const auto shoc_ql_host = copy_fab_to_host(col.shoc_ql);
1009  const auto shoc_ql2_host = copy_fab_to_host(col.shoc_ql2);
1010  const auto shoc_cond_host = copy_fab_to_host(col.shoc_cond);
1011  const auto shoc_evap_host = copy_fab_to_host(col.shoc_evap);
1012  const auto wqls_sec_host = copy_fab_to_host(col.wqls_sec);
1013  const auto thl_sec_host = copy_fab_to_host(col.thl_sec);
1014  const auto qw_sec_host = copy_fab_to_host(col.qw_sec);
1015  const auto qwthl_sec_host = copy_fab_to_host(col.qwthl_sec);
1016  const auto wthl_sec_host = copy_fab_to_host(col.wthl_sec);
1017  const auto wqw_sec_host = copy_fab_to_host(col.wqw_sec);
1018  const auto uw_sec_host = copy_fab_to_host(col.uw_sec);
1019  const auto vw_sec_host = copy_fab_to_host(col.vw_sec);
1020  const auto wtke_sec_host = copy_fab_to_host(col.wtke_sec);
1021  const auto w3_host = copy_fab_to_host(col.w3);
1022  const auto surf_sens_flux_host = copy_fab_to_host(col.surf_sens_flux);
1023  const auto surf_lat_flux_host = copy_fab_to_host(col.surf_lat_flux);
1024  const auto surf_tau_u_host = copy_fab_to_host(col.surf_tau_u);
1025  const auto surf_tau_v_host = copy_fab_to_host(col.surf_tau_v);
1026  const auto hfx3_host = hfx3 ? copy_fab_to_host((*hfx3)[mfi]) : FArrayBox();
1027  const auto qfx3_host = qfx3 ? copy_fab_to_host((*qfx3)[mfi]) : FArrayBox();
1028  const auto tau13_host = tau13 ? copy_fab_to_host((*tau13)[mfi]) : FArrayBox();
1029  const auto tau23_host = tau23 ? copy_fab_to_host((*tau23)[mfi]) : FArrayBox();
1030 
1031  const auto z_arr = z_host.const_array();
1032  const auto cons_arr = cons_host.const_array();
1033  const auto theta_tend_arr = theta_tend_host.const_array();
1034  const auto qv_tend_arr = qv_tend_host.const_array();
1035  const auto qc_tend_arr = qc_tend_host.const_array();
1036  const auto qi_tend_arr = qi_tend_host.const_array();
1037  const auto tke_tend_arr = tke_tend_host.const_array();
1038  const auto u_tend_arr = u_tend_host.const_array();
1039  const auto v_tend_arr = v_tend_host.const_array();
1040  const auto dz_arr = dz_host.const_array();
1041 
1042  std::vector<ShocBadColumnReport> reports;
1043  reports.reserve(static_cast<std::size_t>(col.layout.ncell * col.layout.nlev));
1044 
1045  auto maybe_add = [&] (int i, int j, int k, int kk, int ic,
1046  const char* name, Real value, Real threshold) {
1047  if (!std::isfinite(value)) {
1048  reports.push_back(ShocBadColumnReport{
1049  std::numeric_limits<Real>::infinity(),
1050  std::string(name) + " nonfinite",
1051  mfi.index(), i, j, k, kk, ic
1052  });
1053  return;
1054  }
1055  const Real abs_value = amrex::Math::abs(value);
1056  const Real ratio = abs_value / threshold;
1057  if (ratio > 1.0_rt) {
1058  std::ostringstream oss;
1059  oss << name << " |value|=" << abs_value << " threshold=" << threshold;
1060  reports.push_back(ShocBadColumnReport{ratio, oss.str(), mfi.index(), i, j, k, kk, ic});
1061  }
1062  };
1063 
1064  auto maybe_add_geom = [&] (int i, int j, int k, int kk, int ic, Real dz_val) {
1065  if (!std::isfinite(dz_val)) {
1066  reports.push_back(ShocBadColumnReport{
1067  std::numeric_limits<Real>::infinity(),
1068  "dz nonfinite",
1069  mfi.index(), i, j, k, kk, ic
1070  });
1071  } else if (dz_val <= 0.0_rt) {
1072  reports.push_back(ShocBadColumnReport{
1073  std::numeric_limits<Real>::infinity(),
1074  "dz <= 0",
1075  mfi.index(), i, j, k, kk, ic
1076  });
1077  } else if (dz_val < m_opts.debug_bad_column_min_dz) {
1078  std::ostringstream oss;
1079  oss << "dz below minimum |dz|=" << dz_val
1080  << " min_dz=" << m_opts.debug_bad_column_min_dz;
1081  reports.push_back(ShocBadColumnReport{
1083  oss.str(),
1084  mfi.index(), i, j, k, kk, ic
1085  });
1086  }
1087  };
1088 
1089  for (int j = col.layout.jmin; j < col.layout.jmin + col.layout.ny; ++j) {
1090  for (int i = col.layout.imin; i < col.layout.imin + col.layout.nx; ++i) {
1091  const int ic = shoc_column_index(col.layout, i, j);
1092  for (int kk = 0; kk < col.layout.nlev; ++kk) {
1093  const int k = col.layout.kmin + kk;
1094  const Real dz_val = dz_arr(ic, kk, 0);
1095  maybe_add_geom(i, j, k, kk, ic, dz_val);
1096 
1097  maybe_add(i, j, k, kk, ic, "theta_tend", theta_tend_arr(ic, kk, 0), m_opts.debug_bad_column_theta_tend_threshold);
1098  maybe_add(i, j, k, kk, ic, "qv_tend", qv_tend_arr(ic, kk, 0), m_opts.debug_bad_column_q_tend_threshold);
1099  maybe_add(i, j, k, kk, ic, "qc_tend", qc_tend_arr(ic, kk, 0), m_opts.debug_bad_column_q_tend_threshold);
1100  maybe_add(i, j, k, kk, ic, "qi_tend", qi_tend_arr(ic, kk, 0), m_opts.debug_bad_column_q_tend_threshold);
1101  maybe_add(i, j, k, kk, ic, "brunt", brunt_host.const_array()(ic, kk, 0), m_opts.debug_bad_column_brunt_threshold);
1102  maybe_add(i, j, k, kk, ic, "thl_sec", thl_sec_host.const_array()(ic, kk, 0), m_opts.debug_bad_column_scalar_moment_threshold);
1103  maybe_add(i, j, k, kk, ic, "qw_sec", qw_sec_host.const_array()(ic, kk, 0), m_opts.debug_bad_column_scalar_moment_threshold);
1104  maybe_add(i, j, k, kk, ic, "qwthl_sec", qwthl_sec_host.const_array()(ic, kk, 0), m_opts.debug_bad_column_scalar_moment_threshold);
1105  maybe_add(i, j, k, kk, ic, "wthl_sec", wthl_sec_host.const_array()(ic, kk, 0), m_opts.debug_bad_column_scalar_moment_threshold);
1106  maybe_add(i, j, k, kk, ic, "wqw_sec", wqw_sec_host.const_array()(ic, kk, 0), m_opts.debug_bad_column_scalar_moment_threshold);
1107 
1108  // Treat NaN/Inf in the key state and diagnostic fields as bad.
1109  const Real key_values[] = {
1110  rho_host.const_array()(ic, kk, 0),
1111  theta_host.const_array()(ic, kk, 0),
1112  thetal_host.const_array()(ic, kk, 0),
1113  theta_v_host.const_array()(ic, kk, 0),
1114  qv_host.const_array()(ic, kk, 0),
1115  qc_host.const_array()(ic, kk, 0),
1116  qi_host.const_array()(ic, kk, 0),
1117  qw_host.const_array()(ic, kk, 0),
1118  tabs_host.const_array()(ic, kk, 0),
1119  exner_host.const_array()(ic, kk, 0),
1120  p_mid_host.const_array()(ic, kk, 0),
1121  host_dse_host.const_array()(ic, kk, 0),
1122  pblh_host.const_array()(ic, 0, 0),
1123  obklen_host.const_array()(ic, 0, 0),
1124  ustar_host.const_array()(ic, 0, 0),
1125  shoc_mix_host.const_array()(ic, kk, 0),
1126  isotropy_host.const_array()(ic, kk, 0),
1127  tk_host.const_array()(ic, kk, 0),
1128  tkh_host.const_array()(ic, kk, 0),
1129  shear_prod_host.const_array()(ic, kk, 0),
1130  buoy_prod_host.const_array()(ic, kk, 0),
1131  diss_tke_host.const_array()(ic, kk, 0),
1132  w_sec_host.const_array()(ic, kk, 0),
1133  wthv_sec_host.const_array()(ic, kk, 0),
1134  shoc_cldfrac_host.const_array()(ic, kk, 0),
1135  shoc_ql_host.const_array()(ic, kk, 0),
1136  shoc_ql2_host.const_array()(ic, kk, 0),
1137  shoc_cond_host.const_array()(ic, kk, 0),
1138  shoc_evap_host.const_array()(ic, kk, 0),
1139  wqls_sec_host.const_array()(ic, kk, 0),
1140  thl_sec_host.const_array()(ic, kk, 0),
1141  qw_sec_host.const_array()(ic, kk, 0),
1142  qwthl_sec_host.const_array()(ic, kk, 0),
1143  wthl_sec_host.const_array()(ic, kk, 0),
1144  wqw_sec_host.const_array()(ic, kk, 0),
1145  uw_sec_host.const_array()(ic, kk, 0),
1146  vw_sec_host.const_array()(ic, kk, 0),
1147  wtke_sec_host.const_array()(ic, kk, 0),
1148  w3_host.const_array()(ic, kk, 0),
1149  theta_tend_arr(ic, kk, 0),
1150  qv_tend_arr(ic, kk, 0),
1151  qc_tend_arr(ic, kk, 0),
1152  qi_tend_arr(ic, kk, 0),
1153  tke_tend_arr(ic, kk, 0),
1154  u_tend_arr(ic, kk, 0),
1155  v_tend_arr(ic, kk, 0)
1156  };
1157  for (Real value : key_values) {
1158  if (!std::isfinite(value)) {
1159  reports.push_back(ShocBadColumnReport{
1160  std::numeric_limits<Real>::infinity(),
1161  "key field nonfinite",
1162  mfi.index(), i, j, k, kk, ic
1163  });
1164  break;
1165  }
1166  }
1167  }
1168  }
1169  }
1170 
1171  if (reports.empty()) {
1172  return;
1173  }
1174 
1175  std::stable_sort(reports.begin(), reports.end(),
1176  [] (const ShocBadColumnReport& a, const ShocBadColumnReport& b) {
1177  return a.score > b.score;
1178  });
1179 
1180  const int max_reports = std::min(m_opts.debug_bad_column_max_reports,
1181  static_cast<int>(reports.size()));
1182 
1183  const auto rho_arr = rho_host.const_array();
1184  const auto theta_arr = theta_host.const_array();
1185  const auto thetal_arr = thetal_host.const_array();
1186  const auto theta_base_arr = theta_base_host.const_array();
1187  const auto thetal_base_arr = thetal_base_host.const_array();
1188  const auto qv_base_arr = qv_base_host.const_array();
1189  const auto qc_base_arr = qc_base_host.const_array();
1190  const auto qi_base_arr = qi_base_host.const_array();
1191  const auto theta_v_arr = theta_v_host.const_array();
1192  const auto qv_arr = qv_host.const_array();
1193  const auto qc_arr = qc_host.const_array();
1194  const auto qi_arr = qi_host.const_array();
1195  const auto qw_arr = qw_host.const_array();
1196  const auto tabs_arr = tabs_host.const_array();
1197  const auto exner_arr = exner_host.const_array();
1198  const auto p_mid_arr = p_mid_host.const_array();
1199  const auto p_int_arr = p_int_host.const_array();
1200  const auto host_dse_arr = host_dse_host.const_array();
1201  const auto pblh_arr = pblh_host.const_array();
1202  const auto obklen_arr = obklen_host.const_array();
1203  const auto ustar_arr = ustar_host.const_array();
1204  const auto shoc_mix_arr = shoc_mix_host.const_array();
1205  const auto brunt_arr = brunt_host.const_array();
1206  const auto isotropy_arr = isotropy_host.const_array();
1207  const auto tk_arr = tk_host.const_array();
1208  const auto tkh_arr = tkh_host.const_array();
1209  const auto shear_prod_arr = shear_prod_host.const_array();
1210  const auto buoy_prod_arr = buoy_prod_host.const_array();
1211  const auto diss_tke_arr = diss_tke_host.const_array();
1212  const auto tke_state_arr = tke_host.const_array();
1213  const auto tke_base_arr = tke_base_host.const_array();
1214  const auto w_sec_arr = w_sec_host.const_array();
1215  const auto wthv_sec_arr = wthv_sec_host.const_array();
1216  const auto shoc_cldfrac_arr = shoc_cldfrac_host.const_array();
1217  const auto shoc_ql_arr = shoc_ql_host.const_array();
1218  const auto shoc_ql2_arr = shoc_ql2_host.const_array();
1219  const auto shoc_cond_arr = shoc_cond_host.const_array();
1220  const auto shoc_evap_arr = shoc_evap_host.const_array();
1221  const auto wqls_sec_arr = wqls_sec_host.const_array();
1222  const auto thl_sec_arr = thl_sec_host.const_array();
1223  const auto qw_sec_arr = qw_sec_host.const_array();
1224  const auto qwthl_sec_arr = qwthl_sec_host.const_array();
1225  const auto wthl_sec_arr = wthl_sec_host.const_array();
1226  const auto wqw_sec_arr = wqw_sec_host.const_array();
1227  const auto uw_sec_arr = uw_sec_host.const_array();
1228  const auto vw_sec_arr = vw_sec_host.const_array();
1229  const auto wtke_sec_arr = wtke_sec_host.const_array();
1230  const auto w3_arr = w3_host.const_array();
1231  const auto surf_sens_flux_arr = surf_sens_flux_host.const_array();
1232  const auto surf_lat_flux_arr = surf_lat_flux_host.const_array();
1233  const auto surf_tau_u_arr = surf_tau_u_host.const_array();
1234  const auto surf_tau_v_arr = surf_tau_v_host.const_array();
1235  const bool has_hfx3 = hfx3 && hfx3_host.box().ok();
1236  const bool has_qfx3 = qfx3 && qfx3_host.box().ok();
1237  const bool has_tau13 = tau13 && tau13_host.box().ok();
1238  const bool has_tau23 = tau23 && tau23_host.box().ok();
1239 
1240  for (int n = 0; n < max_reports; ++n) {
1241  const auto& rep = reports[static_cast<std::size_t>(n)];
1242  const int i = rep.i;
1243  const int j = rep.j;
1244  const int k = rep.k;
1245  const int kk = rep.kk;
1246  const int ic = rep.ic;
1247 
1248  const auto node_value = [&] (int iii, int jjj, int kkk) -> Real {
1249  const IntVect iv(iii, jjj, kkk);
1250  return z_host.box().contains(iv) ? z_arr(iii, jjj, kkk) : std::numeric_limits<Real>::quiet_NaN();
1251  };
1252 
1253  const Real z_nd_ijk = node_value(i, j, k);
1254  const Real z_nd_ip1jk = node_value(i + 1, j, k);
1255  const Real z_nd_ijp1k = node_value(i, j + 1, k);
1256  const Real z_nd_ip1jp1k = node_value(i + 1, j + 1, k);
1257  const Real z_nd_ijkp1 = node_value(i, j, k + 1);
1258  const Real z_nd_ip1jkp1 = node_value(i + 1, j, k + 1);
1259  const Real z_nd_ijp1kp1 = node_value(i, j + 1, k + 1);
1260  const Real z_nd_ip1jp1kp1 = node_value(i + 1, j + 1, k + 1);
1261  const Real four_node_zlo = 0.25_rt * (z_nd_ijk + z_nd_ip1jk + z_nd_ijp1k + z_nd_ip1jp1k);
1262  const Real four_node_zhi = 0.25_rt * (z_nd_ijkp1 + z_nd_ip1jkp1 + z_nd_ijp1kp1 + z_nd_ip1jp1kp1);
1263  const Real four_node_dz = four_node_zhi - four_node_zlo;
1264  const Real corner_dz = z_nd_ijkp1 - z_nd_ijk;
1265  const Real theta_base_val = theta_base_arr(ic, kk, 0);
1266  const Real theta_new_val = theta_arr(ic, kk, 0);
1267  const Real thetal_base_val = thetal_base_arr(ic, kk, 0);
1268  const Real thetal_new_val = thetal_arr(ic, kk, 0);
1269  const Real qv_base_val = qv_base_arr(ic, kk, 0);
1270  const Real qc_base_val = qc_base_arr(ic, kk, 0);
1271  const Real qi_base_val = qi_base_arr(ic, kk, 0);
1272  const Real qv_new_val = qv_arr(ic, kk, 0);
1273  const Real qc_new_val = qc_arr(ic, kk, 0);
1274  const Real qi_new_val = qi_arr(ic, kk, 0);
1275  const Real ql_base = qc_base_val + qi_base_val;
1276  const Real ql_new = qc_new_val + qi_new_val;
1277  const Real qw_base = qv_base_val + qc_base_val + qi_base_val;
1278  const Real qw_new = qv_new_val + qc_new_val + qi_new_val;
1279  const Real delta_theta = theta_new_val - theta_base_val;
1280  const Real delta_qv = qv_new_val - qv_base_val;
1281  const Real delta_qc = qc_new_val - qc_base_val;
1282  const Real delta_qi = qi_new_val - qi_base_val;
1283  const Real delta_ql = ql_new - ql_base;
1284  const Real delta_qw = qw_new - qw_base;
1285 
1286  const Real dt = static_cast<Real>(dt_d);
1287 
1288  const Real dt_theta_tend = theta_tend_arr(ic, kk, 0) * dt;
1289  const Real dt_qv_tend = qv_tend_arr(ic, kk, 0) * dt;
1290  const Real dt_qc_tend = qc_tend_arr(ic, kk, 0) * dt;
1291  const Real dt_qi_tend = qi_tend_arr(ic, kk, 0) * dt;
1292  const Real dt_tke_tend = tke_tend_arr(ic, kk, 0) * dt;
1293  const Real cond_dt = shoc_cond_arr(ic, kk, 0) * dt;
1294  const Real evap_dt = shoc_evap_arr(ic, kk, 0) * dt;
1295  const Real tke_base_val = tke_base_arr(ic, kk, 0);
1296  std::ostringstream msg;
1297  msg << "NATIVE_SHOC_BAD_COLUMN_BEGIN\n"
1298  << " rank=" << ParallelDescriptor::MyProc()
1299  << " level=" << m_lev
1300  << " shoc_call=" << (m_advance_calls + 1)
1301  << " mfi_index=" << rep.mfi_index
1302  << " box_valid_lo=(" << mfi.validbox().smallEnd(0) << ","
1303  << mfi.validbox().smallEnd(1) << ","
1304  << mfi.validbox().smallEnd(2) << ")"
1305  << " box_valid_hi=(" << mfi.validbox().bigEnd(0) << ","
1306  << mfi.validbox().bigEnd(1) << ","
1307  << mfi.validbox().bigEnd(2) << ")"
1308  << " layout.nx=" << col.layout.nx
1309  << " layout.ny=" << col.layout.ny
1310  << " layout.ncell=" << col.layout.ncell
1311  << " layout.nlev=" << col.layout.nlev
1312  << " layout.imin=" << col.layout.imin
1313  << " layout.jmin=" << col.layout.jmin
1314  << " layout.kmin=" << col.layout.kmin
1315  << " layout.kmax=" << col.layout.kmax
1316  << "\n"
1317  << " i=" << i << " j=" << j << " k=" << k
1318  << " kk=" << kk << " ic=" << ic
1319  << " score=" << rep.score
1320  << " reason=" << rep.reason
1321  << "\n"
1322  << " geometry z_nd(i,j,k)=" << z_nd_ijk
1323  << " z_nd(i+1,j,k)=" << z_nd_ip1jk
1324  << " z_nd(i,j+1,k)=" << z_nd_ijp1k
1325  << " z_nd(i+1,j+1,k)=" << z_nd_ip1jp1k
1326  << " z_nd(i,j,k+1)=" << z_nd_ijkp1
1327  << " z_nd(i+1,j,k+1)=" << z_nd_ip1jkp1
1328  << " z_nd(i,j+1,k+1)=" << z_nd_ijp1kp1
1329  << " z_nd(i+1,j+1,k+1)=" << z_nd_ip1jp1kp1
1330  << "\n"
1331  << " four_node_zlo=" << four_node_zlo
1332  << " four_node_zhi=" << four_node_zhi
1333  << " four_node_dz=" << four_node_dz
1334  << " corner_dz=" << corner_dz
1335  << " dz=" << dz_arr(ic, kk, 0)
1336  << "\n"
1337  << " rho=" << rho_arr(ic, kk, 0)
1338  << " theta=" << theta_arr(ic, kk, 0)
1339  << " thetal=" << thetal_arr(ic, kk, 0)
1340  << " theta_v=" << theta_v_arr(ic, kk, 0)
1341  << " qv=" << qv_arr(ic, kk, 0)
1342  << " qc=" << qc_arr(ic, kk, 0)
1343  << " qi=" << qi_arr(ic, kk, 0)
1344  << " qw=" << qw_arr(ic, kk, 0)
1345  << " tabs=" << tabs_arr(ic, kk, 0)
1346  << " exner=" << exner_arr(ic, kk, 0)
1347  << " p_mid=" << p_mid_arr(ic, kk, 0)
1348  << " p_int_lower=" << p_int_arr(ic, kk, 0)
1349  << " p_int_upper=" << p_int_arr(ic, kk + 1, 0)
1350  << " host_dse=" << host_dse_arr(ic, kk, 0)
1351  << "\n"
1352  << " pblh=" << pblh_arr(ic, 0, 0)
1353  << " obklen=" << obklen_arr(ic, 0, 0)
1354  << " ustar=" << ustar_arr(ic, 0, 0)
1355  << " shoc_mix=" << shoc_mix_arr(ic, kk, 0)
1356  << " Lturb=" << shoc_mix_arr(ic, kk, 0)
1357  << " brunt=" << brunt_arr(ic, kk, 0)
1358  << " isotropy=" << isotropy_arr(ic, kk, 0)
1359  << " tk=" << tk_arr(ic, kk, 0)
1360  << " tkh=" << tkh_arr(ic, kk, 0)
1361  << " shear_prod=" << shear_prod_arr(ic, kk, 0)
1362  << " buoy_prod=" << buoy_prod_arr(ic, kk, 0)
1363  << " diss_tke=" << diss_tke_arr(ic, kk, 0)
1364  << " tke=" << tke_state_arr(ic, kk, 0)
1365  << "\n"
1366  << " w_sec=" << w_sec_arr(ic, kk, 0)
1367  << " wthv_sec=" << wthv_sec_arr(ic, kk, 0)
1368  << " shoc_cldfrac=" << shoc_cldfrac_arr(ic, kk, 0)
1369  << " shoc_ql=" << shoc_ql_arr(ic, kk, 0)
1370  << " shoc_ql2=" << shoc_ql2_arr(ic, kk, 0)
1371  << " shoc_cond=" << shoc_cond_arr(ic, kk, 0)
1372  << " shoc_evap=" << shoc_evap_arr(ic, kk, 0)
1373  << " wqls_sec=" << wqls_sec_arr(ic, kk, 0)
1374  << "\n"
1375  << " thl_sec_lower=" << thl_sec_arr(ic, kk, 0)
1376  << " thl_sec_upper=" << thl_sec_arr(ic, kk + 1, 0)
1377  << " qw_sec_lower=" << qw_sec_arr(ic, kk, 0)
1378  << " qw_sec_upper=" << qw_sec_arr(ic, kk + 1, 0)
1379  << " qwthl_sec_lower=" << qwthl_sec_arr(ic, kk, 0)
1380  << " qwthl_sec_upper=" << qwthl_sec_arr(ic, kk + 1, 0)
1381  << " wthl_sec_lower=" << wthl_sec_arr(ic, kk, 0)
1382  << " wthl_sec_upper=" << wthl_sec_arr(ic, kk + 1, 0)
1383  << " wqw_sec_lower=" << wqw_sec_arr(ic, kk, 0)
1384  << " wqw_sec_upper=" << wqw_sec_arr(ic, kk + 1, 0)
1385  << " w3_lower=" << w3_arr(ic, kk, 0)
1386  << " w3_upper=" << w3_arr(ic, kk + 1, 0)
1387  << " uw_sec_lower=" << uw_sec_arr(ic, kk, 0)
1388  << " uw_sec_upper=" << uw_sec_arr(ic, kk + 1, 0)
1389  << " vw_sec_lower=" << vw_sec_arr(ic, kk, 0)
1390  << " vw_sec_upper=" << vw_sec_arr(ic, kk + 1, 0)
1391  << " wtke_sec_lower=" << wtke_sec_arr(ic, kk, 0)
1392  << " wtke_sec_upper=" << wtke_sec_arr(ic, kk + 1, 0)
1393  << "\n"
1394  << " theta_tend=" << theta_tend_arr(ic, kk, 0)
1395  << " qv_tend=" << qv_tend_arr(ic, kk, 0)
1396  << " qc_tend=" << qc_tend_arr(ic, kk, 0)
1397  << " qi_tend=" << qi_tend_arr(ic, kk, 0)
1398  << " tke_tend=" << tke_tend_arr(ic, kk, 0)
1399  << " u_tend=" << u_tend_arr(ic, kk, 0)
1400  << " v_tend=" << v_tend_arr(ic, kk, 0)
1401  << "\n"
1402  << " baseline theta=" << theta_base_val
1403  << " thetal=" << thetal_base_val
1404  << " qv=" << qv_base_val
1405  << " qc=" << qc_base_val
1406  << " qi=" << qi_base_val
1407  << " ql=" << ql_base
1408  << " qw=" << qw_base
1409  << " tke=" << tke_base_val
1410  << "\n"
1411  << " updated theta=" << theta_new_val
1412  << " thetal=" << thetal_new_val
1413  << " qv=" << qv_new_val
1414  << " qc=" << qc_new_val
1415  << " qi=" << qi_new_val
1416  << " ql=" << ql_new
1417  << " qw=" << qw_new
1418  << " tke=" << tke_state_arr(ic, kk, 0)
1419  << "\n"
1420  << " deltas dtheta=" << delta_theta
1421  << " dqv=" << delta_qv
1422  << " dqc=" << delta_qc
1423  << " dqi=" << delta_qi
1424  << " dql=" << delta_ql
1425  << " dqw=" << delta_qw
1426  << "\n"
1427  << " tend_dt theta=" << dt_theta_tend
1428  << " qv=" << dt_qv_tend
1429  << " qc=" << dt_qc_tend
1430  << " qi=" << dt_qi_tend
1431  << " tke=" << dt_tke_tend
1432  << "\n"
1433  << " consistency dtheta_minus_tenddt=" << (delta_theta - dt_theta_tend)
1434  << " dqv_minus_tenddt=" << (delta_qv - dt_qv_tend)
1435  << " dqc_minus_tenddt=" << (delta_qc - dt_qc_tend)
1436  << " dqi_minus_tenddt=" << (delta_qi - dt_qi_tend)
1437  << "\n"
1438  << " pdf_cloud shoc_ql=" << shoc_ql_arr(ic, kk, 0)
1439  << " shoc_cond_dt=" << cond_dt
1440  << " shoc_evap_dt=" << evap_dt
1441  << " delta_ql=" << delta_ql
1442  << " delta_ql_minus_cond_minus_evap=" << (delta_ql - (cond_dt - evap_dt))
1443  << "\n"
1444  << " surf_sens_flux=" << surf_sens_flux_arr(ic, 0, 0)
1445  << " surf_lat_flux=" << surf_lat_flux_arr(ic, 0, 0)
1446  << " surf_tau_u=" << surf_tau_u_arr(ic, 0, 0)
1447  << " surf_tau_v=" << surf_tau_v_arr(ic, 0, 0)
1448  << " rho_sfc=" << cons_arr(i, j, k, Rho_comp)
1449  << "\n";
1450 
1451  if (has_hfx3) {
1452  msg << " raw hfx3(i,j,klo)=" << hfx3_host.const_array()(rep.i, rep.j, rep.k) << "\n";
1453  }
1454  if (has_qfx3) {
1455  msg << " raw qfx3(i,j,klo)=" << qfx3_host.const_array()(rep.i, rep.j, rep.k) << "\n";
1456  }
1457  if (has_tau13) {
1458  msg << " raw tau13(i,j,klo)=" << tau13_host.const_array()(rep.i, rep.j, rep.k)
1459  << " raw tau13(i+1,j,klo)=" << tau13_host.const_array()(rep.i + 1, rep.j, rep.k)
1460  << "\n";
1461  }
1462  if (has_tau23) {
1463  msg << " raw tau23(i,j,klo)=" << tau23_host.const_array()(rep.i, rep.j, rep.k)
1464  << " raw tau23(i,j+1,klo)=" << tau23_host.const_array()(rep.i, rep.j + 1, rep.k)
1465  << "\n";
1466  }
1467  msg << "NATIVE_SHOC_BAD_COLUMN_END\n";
1468  amrex::AllPrint() << msg.str() << std::flush;
1469  }
1470 
1472  amrex::Abort("Native SHOC debug_bad_column abort: bad SHOC column detected before state update");
1473  }
1474 }
Real value
Definition: ERF_HurricaneDiagnostics.cpp:30
#define Rho_comp
Definition: ERF_IndexDefines.H:36
auto qv_arr
Definition: ERF_InitCustomPert_MultiSpeciesBubble.H:210
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:97
auto rho_arr
Definition: ERF_UpdateWSubsidence_SineMassFlux.H:3
amrex::FArrayBox theta_v
Definition: ERF_ShocTypes.H:216
amrex::FArrayBox theta
Definition: ERF_ShocTypes.H:214
amrex::FArrayBox theta_base
Definition: ERF_ShocTypes.H:261
amrex::FArrayBox qi
Definition: ERF_ShocTypes.H:220
amrex::FArrayBox dz
Definition: ERF_ShocTypes.H:210
amrex::FArrayBox vw_sec
Definition: ERF_ShocTypes.H:255
amrex::FArrayBox shoc_evap
Definition: ERF_ShocTypes.H:247
amrex::FArrayBox tke_base_state
Definition: ERF_ShocTypes.H:267
amrex::FArrayBox qv_base
Definition: ERF_ShocTypes.H:262
amrex::FArrayBox uw_sec
Definition: ERF_ShocTypes.H:254
amrex::FArrayBox host_dse
Definition: ERF_ShocTypes.H:227
amrex::FArrayBox qc
Definition: ERF_ShocTypes.H:219
amrex::FArrayBox surf_tau_v
Definition: ERF_ShocTypes.H:279
amrex::FArrayBox tke
Definition: ERF_ShocTypes.H:223
amrex::FArrayBox p_int
Definition: ERF_ShocTypes.H:212
amrex::FArrayBox qi_base
Definition: ERF_ShocTypes.H:264
amrex::FArrayBox exner
Definition: ERF_ShocTypes.H:215
amrex::FArrayBox qc_base
Definition: ERF_ShocTypes.H:263
amrex::FArrayBox tabs
Definition: ERF_ShocTypes.H:222
amrex::FArrayBox qw
Definition: ERF_ShocTypes.H:221
amrex::FArrayBox qv
Definition: ERF_ShocTypes.H:218
amrex::FArrayBox p_mid
Definition: ERF_ShocTypes.H:211
amrex::FArrayBox wtke_sec
Definition: ERF_ShocTypes.H:256
amrex::FArrayBox surf_tau_u
Definition: ERF_ShocTypes.H:278
amrex::FArrayBox thetal_base
Definition: ERF_ShocTypes.H:260
amrex::FArrayBox thetal
Definition: ERF_ShocTypes.H:217
int imin
Definition: ERF_ShocTypes.H:197
int nlev
Definition: ERF_ShocTypes.H:196
int kmax
Definition: ERF_ShocTypes.H:200
int ncell
Definition: ERF_ShocTypes.H:195
int jmin
Definition: ERF_ShocTypes.H:198
int ny
Definition: ERF_ShocTypes.H:194
int nx
Definition: ERF_ShocTypes.H:193
int kmin
Definition: ERF_ShocTypes.H:199
int debug_bad_column_max_reports
Definition: ERF_ShocTypes.H:111
amrex::Real debug_bad_column_q_tend_threshold
Definition: ERF_ShocTypes.H:113
amrex::Real debug_bad_column_scalar_moment_threshold
Definition: ERF_ShocTypes.H:116
amrex::Real debug_bad_column_min_dz
Definition: ERF_ShocTypes.H:115
amrex::Real debug_bad_column_theta_tend_threshold
Definition: ERF_ShocTypes.H:112
bool debug_bad_column
Definition: ERF_ShocTypes.H:109
amrex::Real debug_bad_column_brunt_threshold
Definition: ERF_ShocTypes.H:114
bool debug_bad_column_abort
Definition: ERF_ShocTypes.H:110

Referenced by advance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ debug_summary_enabled()

bool ShocDriver::debug_summary_enabled ( ) const
inline
87 { return m_opts.debug_summary; }

◆ disables_momentum_transport()

bool ShocDriver::disables_momentum_transport ( ) const
888 {
890 }
bool shoc_disables_momentum_transport(ShocMomentumTransport mode)
Definition: ERF_ShocTypes.H:75
ShocMomentumTransport momentum_transport
Definition: ERF_ShocTypes.H:108

Referenced by set_diff_stresses().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ diss_tke_diagnostics()

const amrex::MultiFab& ShocDriver::diss_tke_diagnostics ( ) const
inline
124 { return m_diss_tke_cc; }

◆ ensure_storage()

void ShocDriver::ensure_storage ( const amrex::MultiFab &  cons,
const amrex::MultiFab &  xvel,
const amrex::MultiFab &  yvel,
const amrex::MultiFab &  eddy_diffs 
)
private
328 {
329  if (!m_theta_tend_cc.isDefined()) {
330  m_theta_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
331  m_qv_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
332  m_qc_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
333  m_qi_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
334  m_tke_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
335  m_u_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 1);
336  m_v_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 1);
337  m_u_tend_fc.define(xvel.boxArray(), xvel.DistributionMap(), 1, 0);
338  m_v_tend_fc.define(yvel.boxArray(), yvel.DistributionMap(), 1, 0);
339  m_eddy_coeffs_cc.define(eddy_diffs.boxArray(), eddy_diffs.DistributionMap(),
340  EddyDiff::NumDiffs, 0);
341  m_prev_turb_cc.define(cons.boxArray(), cons.DistributionMap(), 2, 0);
342  m_prev_wthv_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
343  m_consumed_sens_flux_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
344  m_consumed_laten_flux_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
345  m_pblh_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
346  m_shoc_ustar_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
347  m_shoc_olen_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
348  m_shoc_cldfrac_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
349  m_shoc_ql_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
350  m_shoc_ql2_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
351  m_shoc_cond_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
352  m_w_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
353  m_wqls_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
354  m_wthv_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
355  m_thl_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
356  m_qw_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
357  m_qwthl_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
358  m_wthl_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
359  m_wqw_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
360  m_w3_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
361  m_brunt_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
362  m_isotropy_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
363  m_shear_prod_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
364  m_buoy_prod_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
365  m_diss_tke_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
366  m_prev_turb_cc.setVal(0.0);
367  m_prev_wthv_sec_cc.setVal(0.0);
368  }
369  m_theta_tend_cc.setVal(0.0);
370  m_qv_tend_cc.setVal(0.0);
371  m_qc_tend_cc.setVal(0.0);
372  m_qi_tend_cc.setVal(0.0);
373  m_tke_tend_cc.setVal(0.0);
374  m_u_tend_cc.setVal(0.0);
375  m_v_tend_cc.setVal(0.0);
376  m_u_tend_fc.setVal(0.0);
377  m_v_tend_fc.setVal(0.0);
378  m_eddy_coeffs_cc.setVal(0.0);
379  m_consumed_sens_flux_cc.setVal(0.0);
380  m_consumed_laten_flux_cc.setVal(0.0);
381  m_pblh_cc.setVal(0.0);
382  m_shoc_ustar_cc.setVal(0.0);
383  m_shoc_olen_cc.setVal(0.0);
384  m_shoc_cldfrac_cc.setVal(0.0);
385  m_shoc_ql_cc.setVal(0.0);
386  m_shoc_ql2_cc.setVal(0.0);
387  m_shoc_cond_cc.setVal(0.0);
388  m_w_sec_cc.setVal(0.0);
389  m_wqls_sec_cc.setVal(0.0);
390  m_wthv_sec_cc.setVal(0.0);
391  m_thl_sec_cc.setVal(0.0);
392  m_qw_sec_cc.setVal(0.0);
393  m_qwthl_sec_cc.setVal(0.0);
394  m_wthl_sec_cc.setVal(0.0);
395  m_wqw_sec_cc.setVal(0.0);
396  m_w3_cc.setVal(0.0);
397  m_brunt_cc.setVal(0.0);
398  m_isotropy_cc.setVal(0.0);
399  m_shear_prod_cc.setVal(0.0);
400  m_buoy_prod_cc.setVal(0.0);
401  m_diss_tke_cc.setVal(0.0);
402 }
amrex::MultiFab m_prev_wthv_sec_cc
Definition: ERF_ShocDriver.H:143
amrex::MultiFab m_prev_turb_cc
Definition: ERF_ShocDriver.H:142
@ NumDiffs
Definition: ERF_IndexDefines.H:220

Referenced by advance().

Here is the caller graph for this function:

◆ has_consumed_surface_flux_diagnostics()

bool ShocDriver::has_consumed_surface_flux_diagnostics ( ) const
inline
90  {
91  return m_consumed_sens_flux_cc.isDefined() && m_consumed_laten_flux_cc.isDefined();
92  }

Referenced by ERF::Write2DPlotFile().

Here is the caller graph for this function:

◆ has_native_diagnostics()

bool ShocDriver::has_native_diagnostics ( ) const
inline
88 { return m_eddy_coeffs_cc.isDefined(); }

Referenced by ERF::Write2DPlotFile().

Here is the caller graph for this function:

◆ isotropy_diagnostics()

const amrex::MultiFab& ShocDriver::isotropy_diagnostics ( ) const
inline
121 { return m_isotropy_cc; }

◆ native_diagnostics()

const amrex::MultiFab& ShocDriver::native_diagnostics ( ) const
inline
93 { return m_eddy_coeffs_cc; }

◆ needs_host_surface_momentum_stresses()

bool ShocDriver::needs_host_surface_momentum_stresses ( ) const
906 {
908 }
bool uses_momentum_host_diffusion() const
Definition: ERF_ShocDriver.cpp:881
Here is the call graph for this function:

◆ owns_momentum_surface_stresses()

bool ShocDriver::owns_momentum_surface_stresses ( ) const
900 {
902 }

Referenced by set_diff_stresses().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ owns_scalar_surface_fluxes()

bool ShocDriver::owns_scalar_surface_fluxes ( ) const
894 {
895  return uses_state_update();
896 }

Referenced by owns_surface_fluxes(), and ERF::Write2DPlotFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ owns_surface_fluxes()

bool ShocDriver::owns_surface_fluxes ( ) const
912 {
914 }
bool owns_scalar_surface_fluxes() const
Definition: ERF_ShocDriver.cpp:893
Here is the call graph for this function:

◆ pblh_diagnostics()

const amrex::MultiFab& ShocDriver::pblh_diagnostics ( ) const
inline
95 { return m_pblh_cc; }

Referenced by ERF::Write2DPlotFile().

Here is the caller graph for this function:

◆ print_debug_summary()

void ShocDriver::print_debug_summary ( double  dt) const
private
1478 {
1479  BL_PROFILE("SHOC::print_debug_summary");
1480 
1481  auto print_minmax = [] (const char* name, const MultiFab& mf, int comp) {
1482  amrex::Print() << " " << std::setw(12) << std::left << name
1483  << " min=" << mf.min(comp)
1484  << " max=" << mf.max(comp) << "\n";
1485  };
1486 
1487  amrex::Print() << "SHOC debug summary:"
1488  << " level=" << m_lev
1489  << " call=" << m_advance_calls
1490  << " dt=" << dt
1491  << " transport_mode=" << shoc_transport_mode_name(m_opts.transport_mode)
1492  << " momentum_transport=" << shoc_momentum_transport_name(m_opts.momentum_transport)
1493  << " state_update=" << (uses_state_update() ? "on" : "off")
1494  << "\n";
1495  print_shoc_debug_settings_once(m_opts);
1496 
1497  print_minmax("Kmv", m_eddy_coeffs_cc, EddyDiff::Mom_v);
1498  print_minmax("Khv", m_eddy_coeffs_cc, EddyDiff::Theta_v);
1499  print_minmax("KE_v", m_eddy_coeffs_cc, EddyDiff::KE_v);
1500  print_minmax("Q_v", m_eddy_coeffs_cc, EddyDiff::Q_v);
1501  print_minmax("l_turb", m_eddy_coeffs_cc, EddyDiff::Turb_lengthscale);
1502  print_minmax("pblh", m_pblh_cc, 0);
1503 
1504  print_minmax("th_tend", m_theta_tend_cc, 0);
1505  print_minmax("qv_tend", m_qv_tend_cc, 0);
1506  print_minmax("qc_tend", m_qc_tend_cc, 0);
1507  print_minmax("qi_tend", m_qi_tend_cc, 0);
1508  print_minmax("tke_tend", m_tke_tend_cc, 0);
1509  print_minmax("u_tend", m_u_tend_fc, 0);
1510  print_minmax("v_tend", m_v_tend_fc, 0);
1511  print_minmax("w_sec", m_w_sec_cc, 0);
1512  print_minmax("thl_sec", m_thl_sec_cc, 0);
1513  print_minmax("qw_sec", m_qw_sec_cc, 0);
1514  print_minmax("qwthl_sec", m_qwthl_sec_cc, 0);
1515  print_minmax("wthl_sec", m_wthl_sec_cc, 0);
1516  print_minmax("wqw_sec", m_wqw_sec_cc, 0);
1517  print_minmax("w3", m_w3_cc, 0);
1518  print_minmax("brunt", m_brunt_cc, 0);
1519  print_minmax("isotropy", m_isotropy_cc, 0);
1520  print_minmax("shear_prod", m_shear_prod_cc, 0);
1521  print_minmax("buoy_prod", m_buoy_prod_cc, 0);
1522  print_minmax("diss_tke", m_diss_tke_cc, 0);
1523  print_minmax("cldfrac", m_shoc_cldfrac_cc, 0);
1524  print_minmax("shoc_ql", m_shoc_ql_cc, 0);
1525  print_minmax("shoc_ql2", m_shoc_ql2_cc, 0);
1526  print_minmax("shoc_cond", m_shoc_cond_cc, 0);
1527  print_minmax("wqls_sec", m_wqls_sec_cc, 0);
1528  print_minmax("wthv_sec", m_wthv_sec_cc, 0);
1529 
1530  if (m_hfx3_ptr) print_minmax("hfx3_in", *m_hfx3_ptr, 0);
1531  if (m_qfx3_ptr) print_minmax("qfx3_in", *m_qfx3_ptr, 0);
1532  if (m_tau13_ptr) print_minmax("tau13_in", *m_tau13_ptr, 0);
1533  if (m_tau23_ptr) print_minmax("tau23_in", *m_tau23_ptr, 0);
1534 }
const char * shoc_transport_mode_name(ShocTransportMode mode)
Definition: ERF_ShocTypes.H:30
const char * shoc_momentum_transport_name(ShocMomentumTransport mode)
Definition: ERF_ShocTypes.H:40
ShocTransportMode transport_mode
Definition: ERF_ShocTypes.H:107

Referenced by advance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ qw_sec_diagnostics()

const amrex::MultiFab& ShocDriver::qw_sec_diagnostics ( ) const
inline
115 { return m_qw_sec_cc; }

◆ qwthl_sec_diagnostics()

const amrex::MultiFab& ShocDriver::qwthl_sec_diagnostics ( ) const
inline
116 { return m_qwthl_sec_cc; }

◆ seed_carried_buoyancy_flux()

void ShocDriver::seed_carried_buoyancy_flux ( ShocColumnData col,
const amrex::MFIter &  mfi 
) const
private
439 {
440  if (!m_prev_turb_valid) {
441  return;
442  }
443 
444  const auto carried = m_prev_wthv_sec_cc.const_array(mfi);
445  auto wthv_sec = col.wthv_sec.array();
446  const auto layout = col.layout;
447  const Box xy_box = amrex::makeSlab(mfi.validbox(), 2, layout.kmin);
448 
449  seed_carried_buoyancy_flux_impl(xy_box, layout, carried, wthv_sec);
450 }

Referenced by advance().

Here is the caller graph for this function:

◆ seed_carried_turbulence()

void ShocDriver::seed_carried_turbulence ( ShocColumnData col,
const amrex::MFIter &  mfi,
const amrex::MultiFab &  cons,
const amrex::MultiFab &  eddy_diffs 
) const
private
409 {
410  const auto rho_host = cons.const_array(mfi);
411  const auto carried = m_prev_turb_cc.const_array(mfi);
412  const auto host_diff = eddy_diffs.const_array(mfi);
413  auto tk = col.tk.array();
414  auto tkh = col.tkh.array();
415  const bool prev_turb_valid = m_prev_turb_valid;
416  const auto layout = col.layout;
417  const Box xy_box = amrex::makeSlab(mfi.validbox(), 2, layout.kmin);
418 
419  seed_carried_turbulence_impl(xy_box, layout, rho_host, carried, host_diff,
420  tk, tkh, prev_turb_valid);
421 }

Referenced by advance().

Here is the caller graph for this function:

◆ set_diff_stresses()

void ShocDriver::set_diff_stresses ( ) const
806 {
807  BL_PROFILE("SHOC::set_diff_stresses");
808 
809  if (uses_host_diffusion()) {
810  // Full host-diffusion mode preserves the existing host-owned lower
811  // boundary fluxes and stresses.
812  return;
813  }
814 
815  if (!m_hfx3_ptr || !m_qfx3_ptr) {
816  return;
817  }
818 
819  for (MFIter mfi(*m_hfx3_ptr, false); mfi.isValid(); ++mfi) {
820  const Box& vbx_cc = mfi.validbox();
821  const Box& vbx_xz = convert(vbx_cc, IntVect(1,0,1));
822  const Box& vbx_yz = convert(vbx_cc, IntVect(0,1,1));
823  auto hfx = m_hfx3_ptr->array(mfi);
824  auto qfx = m_qfx3_ptr->array(mfi);
825 
826  ParallelFor(vbx_cc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
827  hfx(i,j,k) = 0.0;
828  qfx(i,j,k) = 0.0;
829  });
830 
833  auto tau13 = m_tau13_ptr->array(mfi);
834  auto tau23 = m_tau23_ptr->array(mfi);
835  ParallelFor(vbx_xz, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
836  tau13(i,j,k) = 0.0;
837  });
838  ParallelFor(vbx_yz, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
839  tau23(i,j,k) = 0.0;
840  });
841  }
842  }
843 }
bool uses_host_diffusion() const
Definition: ERF_ShocDriver.cpp:863
bool disables_momentum_transport() const
Definition: ERF_ShocDriver.cpp:887
bool owns_momentum_surface_stresses() const
Definition: ERF_ShocDriver.cpp:899
Here is the call graph for this function:

◆ set_eddy_diffs()

void ShocDriver::set_eddy_diffs ( ) const
785 {
786  BL_PROFILE("SHOC::set_eddy_diffs");
787 
789  m_eddy_diffs_ptr->setVal(0.0, k_shoc_vertical_diff_comp, k_shoc_vertical_diff_count,
790  m_eddy_diffs_ptr->nGrow());
791  MultiFab::Copy(*m_eddy_diffs_ptr, m_eddy_coeffs_cc,
793 
794  if (uses_host_diffusion()) {
795  MultiFab::Copy(*m_eddy_diffs_ptr, m_eddy_coeffs_cc,
796  k_shoc_vertical_diff_comp, k_shoc_vertical_diff_comp,
797  k_shoc_vertical_diff_count, 0);
798  } else if (uses_momentum_host_diffusion()) {
799  MultiFab::Copy(*m_eddy_diffs_ptr, m_eddy_coeffs_cc,
801  }
802 }
Here is the call graph for this function:

◆ shear_prod_diagnostics()

const amrex::MultiFab& ShocDriver::shear_prod_diagnostics ( ) const
inline
122 { return m_shear_prod_cc; }

◆ shoc_cldfrac_diagnostics()

const amrex::MultiFab& ShocDriver::shoc_cldfrac_diagnostics ( ) const
inline
107 { return m_shoc_cldfrac_cc; }

◆ shoc_cond_diagnostics()

const amrex::MultiFab& ShocDriver::shoc_cond_diagnostics ( ) const
inline
110 { return m_shoc_cond_cc; }

◆ shoc_olen_diagnostics()

const amrex::MultiFab& ShocDriver::shoc_olen_diagnostics ( ) const
inline
106 { return m_shoc_olen_cc; }

Referenced by ERF::Write2DPlotFile().

Here is the caller graph for this function:

◆ shoc_ql2_diagnostics()

const amrex::MultiFab& ShocDriver::shoc_ql2_diagnostics ( ) const
inline
109 { return m_shoc_ql2_cc; }

◆ shoc_ql_diagnostics()

const amrex::MultiFab& ShocDriver::shoc_ql_diagnostics ( ) const
inline
108 { return m_shoc_ql_cc; }

◆ shoc_ustar_diagnostics()

const amrex::MultiFab& ShocDriver::shoc_ustar_diagnostics ( ) const
inline
105 { return m_shoc_ustar_cc; }

Referenced by ERF::Write2DPlotFile().

Here is the caller graph for this function:

◆ store_carried_buoyancy_flux()

void ShocDriver::store_carried_buoyancy_flux ( const ShocColumnData col,
const amrex::MFIter &  mfi 
)
private
455 {
456  auto carried = m_prev_wthv_sec_cc.array(mfi);
457  const auto wthv_sec = col.wthv_sec.const_array();
458  const auto layout = col.layout;
459  const Box xy_box = amrex::makeSlab(mfi.validbox(), 2, layout.kmin);
460 
461  store_carried_buoyancy_flux_impl(xy_box, layout, carried, wthv_sec);
462 }

Referenced by advance().

Here is the caller graph for this function:

◆ store_carried_turbulence()

void ShocDriver::store_carried_turbulence ( const ShocColumnData col,
const amrex::MFIter &  mfi 
)
private
426 {
427  auto carried = m_prev_turb_cc.array(mfi);
428  const auto tk = col.tk.const_array();
429  const auto tkh = col.tkh.const_array();
430  const auto layout = col.layout;
431  const Box xy_box = amrex::makeSlab(mfi.validbox(), 2, layout.kmin);
432 
433  store_carried_turbulence_impl(xy_box, layout, carried, tk, tkh);
434 }

Referenced by advance().

Here is the caller graph for this function:

◆ thl_sec_diagnostics()

const amrex::MultiFab& ShocDriver::thl_sec_diagnostics ( ) const
inline
114 { return m_thl_sec_cc; }

◆ uses_host_diffusion()

bool ShocDriver::uses_host_diffusion ( ) const
864 {
866 }
bool shoc_uses_host_diffusion(ShocTransportMode mode)
Definition: ERF_ShocTypes.H:57

Referenced by set_diff_stresses(), and set_eddy_diffs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uses_momentum_host_diffusion()

bool ShocDriver::uses_momentum_host_diffusion ( ) const
882 {
884 }
bool shoc_uses_momentum_host_diffusion(ShocMomentumTransport mode)
Definition: ERF_ShocTypes.H:69

Referenced by needs_host_surface_momentum_stresses(), and set_eddy_diffs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uses_momentum_state_update()

bool ShocDriver::uses_momentum_state_update ( ) const
876 {
878 }
bool shoc_uses_momentum_state_update(ShocMomentumTransport mode)
Definition: ERF_ShocTypes.H:63

Referenced by advance(), apply_state_update(), and owns_momentum_surface_stresses().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uses_state_update()

bool ShocDriver::uses_state_update ( ) const
870 {
872 }
bool shoc_uses_state_update(ShocTransportMode mode)
Definition: ERF_ShocTypes.H:51

Referenced by advance(), owns_scalar_surface_fluxes(), and print_debug_summary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ w3_diagnostics()

const amrex::MultiFab& ShocDriver::w3_diagnostics ( ) const
inline
119 { return m_w3_cc; }

◆ w_sec_diagnostics()

const amrex::MultiFab& ShocDriver::w_sec_diagnostics ( ) const
inline
111 { return m_w_sec_cc; }

◆ wqls_sec_diagnostics()

const amrex::MultiFab& ShocDriver::wqls_sec_diagnostics ( ) const
inline
112 { return m_wqls_sec_cc; }

◆ wqw_sec_diagnostics()

const amrex::MultiFab& ShocDriver::wqw_sec_diagnostics ( ) const
inline
118 { return m_wqw_sec_cc; }

◆ wthl_sec_diagnostics()

const amrex::MultiFab& ShocDriver::wthl_sec_diagnostics ( ) const
inline
117 { return m_wthl_sec_cc; }

◆ wthv_sec_diagnostics()

const amrex::MultiFab& ShocDriver::wthv_sec_diagnostics ( ) const
inline
113 { return m_wthv_sec_cc; }

Referenced by ERF::Write2DPlotFile().

Here is the caller graph for this function:

Member Data Documentation

◆ m_advance_calls

int ShocDriver::m_advance_calls = 0
private

◆ m_brunt_cc

amrex::MultiFab ShocDriver::m_brunt_cc
private

◆ m_buoy_prod_cc

amrex::MultiFab ShocDriver::m_buoy_prod_cc
private

◆ m_column_workspaces

amrex::Vector<std::unique_ptr<ShocColumnWorkspace> > ShocDriver::m_column_workspaces
private

Referenced by advance().

◆ m_cons_ptr

amrex::MultiFab* ShocDriver::m_cons_ptr = nullptr
private

◆ m_consumed_laten_flux_cc

amrex::MultiFab ShocDriver::m_consumed_laten_flux_cc
private

◆ m_consumed_sens_flux_cc

amrex::MultiFab ShocDriver::m_consumed_sens_flux_cc
private

◆ m_diss_tke_cc

amrex::MultiFab ShocDriver::m_diss_tke_cc
private

◆ m_eddy_coeffs_cc

amrex::MultiFab ShocDriver::m_eddy_coeffs_cc
private

◆ m_eddy_diffs_ptr

amrex::MultiFab* ShocDriver::m_eddy_diffs_ptr = nullptr
private

Referenced by advance(), and set_eddy_diffs().

◆ m_hfx3_ptr

amrex::MultiFab* ShocDriver::m_hfx3_ptr = nullptr
private

◆ m_isotropy_cc

amrex::MultiFab ShocDriver::m_isotropy_cc
private

◆ m_lev

int ShocDriver::m_lev
private

◆ m_moisture_indices

MoistureComponentIndices ShocDriver::m_moisture_indices
private

Referenced by advance(), and apply_state_update().

◆ m_moisture_type

MoistureType ShocDriver::m_moisture_type
private

Referenced by ShocDriver().

◆ m_opts

◆ m_pblh_cc

amrex::MultiFab ShocDriver::m_pblh_cc
private

◆ m_prev_turb_cc

amrex::MultiFab ShocDriver::m_prev_turb_cc
private

◆ m_prev_turb_valid

bool ShocDriver::m_prev_turb_valid = false
private

◆ m_prev_wthv_sec_cc

amrex::MultiFab ShocDriver::m_prev_wthv_sec_cc
private

◆ m_qc_tend_cc

amrex::MultiFab ShocDriver::m_qc_tend_cc
private

◆ m_qfx3_ptr

amrex::MultiFab* ShocDriver::m_qfx3_ptr = nullptr
private

◆ m_qi_tend_cc

amrex::MultiFab ShocDriver::m_qi_tend_cc
private

◆ m_qv_tend_cc

amrex::MultiFab ShocDriver::m_qv_tend_cc
private

◆ m_qw_sec_cc

amrex::MultiFab ShocDriver::m_qw_sec_cc
private

◆ m_qwthl_sec_cc

amrex::MultiFab ShocDriver::m_qwthl_sec_cc
private

◆ m_shear_prod_cc

amrex::MultiFab ShocDriver::m_shear_prod_cc
private

◆ m_shoc_cldfrac_cc

amrex::MultiFab ShocDriver::m_shoc_cldfrac_cc
private

◆ m_shoc_cond_cc

amrex::MultiFab ShocDriver::m_shoc_cond_cc
private

◆ m_shoc_olen_cc

amrex::MultiFab ShocDriver::m_shoc_olen_cc
private

◆ m_shoc_ql2_cc

amrex::MultiFab ShocDriver::m_shoc_ql2_cc
private

◆ m_shoc_ql_cc

amrex::MultiFab ShocDriver::m_shoc_ql_cc
private

◆ m_shoc_ustar_cc

amrex::MultiFab ShocDriver::m_shoc_ustar_cc
private

◆ m_tau13_ptr

amrex::MultiFab* ShocDriver::m_tau13_ptr = nullptr
private

◆ m_tau23_ptr

amrex::MultiFab* ShocDriver::m_tau23_ptr = nullptr
private

◆ m_theta_tend_cc

amrex::MultiFab ShocDriver::m_theta_tend_cc
private

◆ m_thl_sec_cc

amrex::MultiFab ShocDriver::m_thl_sec_cc
private

◆ m_tke_tend_cc

amrex::MultiFab ShocDriver::m_tke_tend_cc
private

◆ m_u_tend_cc

amrex::MultiFab ShocDriver::m_u_tend_cc
private

Referenced by advance(), and ensure_storage().

◆ m_u_tend_fc

amrex::MultiFab ShocDriver::m_u_tend_fc
private

◆ m_v_tend_cc

amrex::MultiFab ShocDriver::m_v_tend_cc
private

Referenced by advance(), and ensure_storage().

◆ m_v_tend_fc

amrex::MultiFab ShocDriver::m_v_tend_fc
private

◆ m_w3_cc

amrex::MultiFab ShocDriver::m_w3_cc
private

◆ m_w_sec_cc

amrex::MultiFab ShocDriver::m_w_sec_cc
private

◆ m_wqls_sec_cc

amrex::MultiFab ShocDriver::m_wqls_sec_cc
private

◆ m_wqw_sec_cc

amrex::MultiFab ShocDriver::m_wqw_sec_cc
private

◆ m_wthl_sec_cc

amrex::MultiFab ShocDriver::m_wthl_sec_cc
private

◆ m_wthv_sec_cc

amrex::MultiFab ShocDriver::m_wthv_sec_cc
private

The documentation for this class was generated from the following files: