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, amrex::Real 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, amrex::Real 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, amrex::Real dt) const
 
void print_debug_summary (amrex::Real 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
305  : m_lev(lev),
306  m_moisture_type(solver_choice.moisture_type),
307  m_moisture_indices(solver_choice.moisture_indices)
308 {
311  warn_if_shoc_debug_overrides_active_once(m_opts);
312 
313  std::string error_message;
315  amrex::Abort(error_message.c_str());
316  }
317 }
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:1389
MoistureComponentIndices moisture_indices
Definition: ERF_DataStruct.H:1406
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
843 {
844  AMREX_ALWAYS_ASSERT(m_cons_ptr != nullptr);
845 
846  amrex::ignore_unused(S_rhs);
847 }
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
853 {
854  AMREX_ALWAYS_ASSERT(m_cons_ptr != nullptr);
855  amrex::ignore_unused(mfi, tbx, cell_rhs);
856 }
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,
amrex::Real  dt 
)
473 {
474  BL_PROFILE("SHOC::advance");
475 
476  require_full_height_shoc_boxes(cons.boxArray(), geom.Domain());
477 
478  m_cons_ptr = &cons;
479  m_hfx3_ptr = hfx3;
480  m_qfx3_ptr = qfx3;
481  m_tau13_ptr = tau13;
482  m_tau23_ptr = tau23;
483  m_eddy_diffs_ptr = eddy_diffs;
484 
485  sync_face_multifab_impl(xvel, geom);
486  sync_face_multifab_impl(yvel, geom);
487  if (m_tau13_ptr) {
488  sync_face_multifab_impl(*m_tau13_ptr, geom);
489  }
490  if (m_tau23_ptr) {
491  sync_face_multifab_impl(*m_tau23_ptr, geom);
492  }
493 
494  {
495  BL_PROFILE("SHOC::advance::ensure_storage");
496  ensure_storage(cons, xvel, yvel, *eddy_diffs);
497  }
498 
499  std::string error_message;
501  error_message)) {
502  amrex::Abort(error_message.c_str());
503  }
504 
505  // Keep one SHOC column workspace per local box so GPU writeback kernels
506  // can finish reading a box's scratch before it is reused.
507  const amrex::Long n_local = cons.local_size();
508  AMREX_ALWAYS_ASSERT(n_local >= amrex::Long{0});
509  const amrex::Long current_size = static_cast<amrex::Long>(m_column_workspaces.size());
510  if (current_size < n_local) {
511  const amrex::Long old_size = current_size;
512  m_column_workspaces.resize(static_cast<std::size_t>(n_local));
513  for (amrex::Long n = old_size; n < n_local; ++n) {
514  m_column_workspaces[static_cast<std::size_t>(n)] =
515  std::make_unique<ShocColumnWorkspace>();
516  }
517  }
518 
519  amrex::Long local_index = 0;
520  for (MFIter mfi(cons, false); mfi.isValid(); ++mfi, ++local_index) {
522  local_index < static_cast<amrex::Long>(m_column_workspaces.size()));
523  ShocColumnWorkspace& workspace =
524  *m_column_workspaces[static_cast<std::size_t>(local_index)];
525  const Box& vbx = mfi.validbox();
526  const ShocColumnLayout active_layout = make_shoc_layout(vbx, geom);
527  {
528  BL_PROFILE("SHOC::advance::define_column_data");
529  workspace.ensure_capacity(active_layout, amrex::The_Async_Arena(),
531  }
532  ShocColumnData& col = workspace.col;
533  {
534  BL_PROFILE("SHOC::advance::preprocess");
536  hfx3, qfx3, tau13, tau23, z_phys_nd, geom,
538  }
539  {
540  BL_PROFILE("SHOC::advance::seed_carried_buoyancy_flux");
541  seed_carried_buoyancy_flux(col, mfi);
542  }
543  {
544  BL_PROFILE("SHOC::advance::seed_carried_turbulence");
545  seed_carried_turbulence(col, mfi, cons, *eddy_diffs);
546  }
547  const auto dx = geom.CellSizeArray();
548  if (uses_state_update()) {
549  BL_PROFILE("SHOC::advance::cache_baseline_state");
551  }
553  if (uses_state_update()) {
554  BL_PROFILE("SHOC::advance::implicit");
556  }
558  if (uses_state_update()) {
559  BL_PROFILE("SHOC::advance::finalize");
561  BL_PROFILE("SHOC::advance::debug_bad_column");
562  debug_check_bad_column(col, mfi, z_phys_nd, hfx3, qfx3, tau13, tau23, geom, dt);
563  }
564  {
565  BL_PROFILE("SHOC::advance::store_carried_buoyancy_flux");
566  store_carried_buoyancy_flux(col, mfi);
567  }
568  {
569  BL_PROFILE("SHOC::advance::store_carried_turbulence");
570  store_carried_turbulence(col, mfi);
571  }
572 
573  auto tk_arr = m_eddy_coeffs_cc.array(mfi);
574  auto th_tend = m_theta_tend_cc.array(mfi);
575  auto qv_tend = m_qv_tend_cc.array(mfi);
576  auto qc_tend = m_qc_tend_cc.array(mfi);
577  auto qi_tend = m_qi_tend_cc.array(mfi);
578  auto tke_tend = m_tke_tend_cc.array(mfi);
579  auto u_tend_cc = m_u_tend_cc.array(mfi);
580  auto v_tend_cc = m_v_tend_cc.array(mfi);
581  auto pblh_arr = m_pblh_cc.array(mfi);
582  auto consumed_sens_flux_arr = m_consumed_sens_flux_cc.array(mfi);
583  auto consumed_laten_flux_arr = m_consumed_laten_flux_cc.array(mfi);
584  auto shoc_ustar_arr = m_shoc_ustar_cc.array(mfi);
585  auto shoc_olen_arr = m_shoc_olen_cc.array(mfi);
586  auto shoc_cldfrac_arr = m_shoc_cldfrac_cc.array(mfi);
587  auto shoc_ql_arr = m_shoc_ql_cc.array(mfi);
588  auto shoc_ql2_arr = m_shoc_ql2_cc.array(mfi);
589  auto shoc_cond_arr = m_shoc_cond_cc.array(mfi);
590  auto w_sec_arr = m_w_sec_cc.array(mfi);
591  auto wqls_sec_arr = m_wqls_sec_cc.array(mfi);
592  auto wthv_sec_arr = m_wthv_sec_cc.array(mfi);
593  auto thl_sec_arr = m_thl_sec_cc.array(mfi);
594  auto qw_sec_arr = m_qw_sec_cc.array(mfi);
595  auto qwthl_sec_arr = m_qwthl_sec_cc.array(mfi);
596  auto wthl_sec_arr = m_wthl_sec_cc.array(mfi);
597  auto wqw_sec_arr = m_wqw_sec_cc.array(mfi);
598  auto w3_arr = m_w3_cc.array(mfi);
599  auto brunt_arr = m_brunt_cc.array(mfi);
600  auto isotropy_arr = m_isotropy_cc.array(mfi);
601  auto shear_prod_arr = m_shear_prod_cc.array(mfi);
602  auto buoy_prod_arr = m_buoy_prod_cc.array(mfi);
603  auto diss_tke_arr = m_diss_tke_cc.array(mfi);
604 
605  const auto shoc_mix = col.shoc_mix.const_array();
606  const auto pblh = col.pblh.const_array();
607  const auto surf_sens_flux = col.surf_sens_flux.const_array();
608  const auto surf_lat_flux = col.surf_lat_flux.const_array();
609  const auto ustar = col.ustar.const_array();
610  const auto obklen = col.obklen.const_array();
611  const auto shoc_cldfrac = col.shoc_cldfrac.const_array();
612  const auto shoc_ql = col.shoc_ql.const_array();
613  const auto shoc_ql2 = col.shoc_ql2.const_array();
614  const auto shoc_cond = col.shoc_cond.const_array();
615  const auto w_sec = col.w_sec.const_array();
616  const auto wqls_sec = col.wqls_sec.const_array();
617  const auto wthv_sec = col.wthv_sec.const_array();
618  const auto thl_sec = col.thl_sec.const_array();
619  const auto qw_sec = col.qw_sec.const_array();
620  const auto qwthl_sec = col.qwthl_sec.const_array();
621  const auto wthl_sec = col.wthl_sec.const_array();
622  const auto wqw_sec = col.wqw_sec.const_array();
623  const auto w3 = col.w3.const_array();
624  const auto brunt = col.brunt.const_array();
625  const auto isotropy = col.isotropy.const_array();
626  const auto shear_prod = col.shear_prod.const_array();
627  const auto buoy_prod = col.buoy_prod.const_array();
628  const auto diss_tke = col.diss_tke.const_array();
629  const auto tk = col.tk.const_array();
630  const auto tkh = col.tkh.const_array();
631  const auto rho = col.rho.const_array();
632  const auto zt = col.zt.const_array();
633  const auto zi = col.zi.const_array();
634  const auto col_theta_tend = col.theta_tend.const_array();
635  const auto col_qv_tend = col.qv_tend.const_array();
636  const auto col_qc_tend = col.qc_tend.const_array();
637  const auto col_qi_tend = col.qi_tend.const_array();
638  const auto col_tke_tend = col.tke_tend.const_array();
639  const auto col_u_tend = col.u_tend.const_array();
640  const auto col_v_tend = col.v_tend.const_array();
641  const auto layout = col.layout;
642  const Box xy_box = amrex::makeSlab(vbx, 2, layout.kmin);
643  {
644  BL_PROFILE("SHOC::advance::writeback");
645  ParallelFor(xy_box, [=] AMREX_GPU_DEVICE (int i, int j, int) noexcept
646  {
647  const int ic = shoc_column_index(layout, i, j);
648  const int k0 = layout.kmin;
649  const Real rho_sfc = rho(ic,0,0);
650  for (int kk = 0; kk < layout.nlev; ++kk) {
651  const int k = layout.kmin + kk;
652  const Real l = shoc_mix(ic,kk,0);
653  const Real km = tk(ic,kk,0);
654  const Real kh = tkh(ic,kk,0);
655 
656  tk_arr(i,j,k,EddyDiff::Mom_v) = rho(ic,kk,0) * km;
657  tk_arr(i,j,k,EddyDiff::Theta_v) = rho(ic,kk,0) * kh;
658  tk_arr(i,j,k,EddyDiff::KE_v) = rho(ic,kk,0) * kh;
659  tk_arr(i,j,k,EddyDiff::Scalar_v) = rho(ic,kk,0) * kh;
660  tk_arr(i,j,k,EddyDiff::Q_v) = rho(ic,kk,0) * kh;
661  tk_arr(i,j,k,EddyDiff::Turb_lengthscale) = l;
662 
663  th_tend(i,j,k) = col_theta_tend(ic,kk,0);
664  qv_tend(i,j,k) = col_qv_tend(ic,kk,0);
665  qc_tend(i,j,k) = col_qc_tend(ic,kk,0);
666  qi_tend(i,j,k) = col_qi_tend(ic,kk,0);
667  tke_tend(i,j,k) = col_tke_tend(ic,kk,0);
668  u_tend_cc(i,j,k) = col_u_tend(ic,kk,0);
669  v_tend_cc(i,j,k) = col_v_tend(ic,kk,0);
670  // Native SHOC pblh is diagnosed as meters AGL and is
671  // copied directly into the plotfile diagnostic field.
672  pblh_arr(i,j,k) = pblh(ic,0,0);
673  shoc_cldfrac_arr(i,j,k) = shoc_cldfrac(ic,kk,0);
674  shoc_ql_arr(i,j,k) = shoc_ql(ic,kk,0);
675  shoc_ql2_arr(i,j,k) = shoc_ql2(ic,kk,0);
676  shoc_cond_arr(i,j,k) = shoc_cond(ic,kk,0);
677  w_sec_arr(i,j,k) = w_sec(ic,kk,0);
678  wqls_sec_arr(i,j,k) = wqls_sec(ic,kk,0);
679  wthv_sec_arr(i,j,k) = wthv_sec(ic,kk,0);
680  brunt_arr(i,j,k) = brunt(ic,kk,0);
681  isotropy_arr(i,j,k) = isotropy(ic,kk,0);
682  thl_sec_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
683  thl_sec(ic,kk,0), thl_sec(ic,kk+1,0),
684  zt(ic,kk,0));
685  qw_sec_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
686  qw_sec(ic,kk,0), qw_sec(ic,kk+1,0),
687  zt(ic,kk,0));
688  qwthl_sec_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
689  qwthl_sec(ic,kk,0), qwthl_sec(ic,kk+1,0),
690  zt(ic,kk,0));
691  wthl_sec_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
692  wthl_sec(ic,kk,0), wthl_sec(ic,kk+1,0),
693  zt(ic,kk,0));
694  wqw_sec_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
695  wqw_sec(ic,kk,0), wqw_sec(ic,kk+1,0),
696  zt(ic,kk,0));
697  w3_arr(i,j,k) = weighted_linear_interp(zi(ic,kk,0), zi(ic,kk+1,0),
698  w3(ic,kk,0), w3(ic,kk+1,0),
699  zt(ic,kk,0));
700  shear_prod_arr(i,j,k) = shear_prod(ic,kk,0);
701  buoy_prod_arr(i,j,k) = buoy_prod(ic,kk,0);
702  diss_tke_arr(i,j,k) = diss_tke(ic,kk,0);
703  }
704  // Motivation: Native SHOC state_update consumes SurfaceLayer
705  // fluxes before the host diffusion path clears the overlapping
706  // SFS arrays. Preserve the consumed conservative fluxes here
707  // so 2D diagnostics report the surface forcing SHOC actually
708  // used, not the cleared host arrays.
709  consumed_sens_flux_arr(i,j,k0) = rho_sfc * surf_sens_flux(ic,0,0);
710  consumed_laten_flux_arr(i,j,k0) = rho_sfc * surf_lat_flux(ic,0,0);
711  shoc_ustar_arr(i,j,k0) = ustar(ic,0,0);
712  shoc_olen_arr(i,j,k0) = obklen(ic,0,0);
713  });
714  }
715 
716  }
717 
718  {
719  BL_PROFILE("SHOC::advance::tendency_interpolation");
720  m_u_tend_cc.FillBoundary(geom.periodicity());
721  m_v_tend_cc.FillBoundary(geom.periodicity());
722 
723  const auto dom = geom.Domain();
724  const int ilo = dom.smallEnd(0);
725  const int ihi = dom.bigEnd(0);
726  const int jlo = dom.smallEnd(1);
727  const int jhi = dom.bigEnd(1);
728  const bool xper = geom.isPeriodic(0);
729  const bool yper = geom.isPeriodic(1);
730 
731  for (MFIter mfi(m_u_tend_cc, false); mfi.isValid(); ++mfi) {
732  const Box& cc_bx = mfi.validbox();
733  const Box xface_bx = amrex::surroundingNodes(cc_bx, 0);
734  const Box yface_bx = amrex::surroundingNodes(cc_bx, 1);
735  const auto u_cc = m_u_tend_cc.const_array(mfi);
736  const auto v_cc = m_v_tend_cc.const_array(mfi);
737  auto u_fc = m_u_tend_fc.array(mfi);
738  auto v_fc = m_v_tend_fc.array(mfi);
739 
740  ParallelFor(xface_bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
741  {
742  const int il = face_neighbor_cell(i - 1, ilo, ihi, xper);
743  const int ir = face_neighbor_cell(i, ilo, ihi, xper);
744  u_fc(i,j,k) = 0.5_rt * (u_cc(il,j,k) + u_cc(ir,j,k));
745  });
746 
747  ParallelFor(yface_bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
748  {
749  const int jb = face_neighbor_cell(j - 1, jlo, jhi, yper);
750  const int jt = face_neighbor_cell(j, jlo, jhi, yper);
751  v_fc(i,j,k) = 0.5_rt * (v_cc(i,jb,k) + v_cc(i,jt,k));
752  });
753  }
754  }
755 
756  if (uses_state_update()) {
757  sync_face_multifab_impl(m_u_tend_fc, geom);
758  sync_face_multifab_impl(m_v_tend_fc, geom);
759  }
760 
761  if (uses_state_update()) {
762  BL_PROFILE("SHOC::advance::state_update");
764  }
765 
767  sync_face_multifab_impl(xvel, geom);
768  sync_face_multifab_impl(yvel, geom);
769  }
770 
771  m_prev_turb_valid = true;
772  ++m_advance_calls;
773  if (m_opts.debug_summary) {
774  BL_PROFILE("SHOC::advance::debug_summary");
776  }
777 }
@ 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:106
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_post_implicit(ShocColumnData &col, const ShocRuntimeOptions &opts, amrex::Real dt)
Definition: ERF_ShocDiagnostics.cpp:25
static void diagnose_pre_implicit(ShocColumnData &col, const ShocRuntimeOptions &opts, amrex::Real dx, amrex::Real dy, amrex::Real dt)
Definition: ERF_ShocDiagnostics.cpp:6
void apply_state_update(amrex::MultiFab &cons, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::Real dt) const
Definition: ERF_ShocDriver.cpp:913
amrex::MultiFab m_shoc_ql_cc
Definition: ERF_ShocDriver.H:150
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, amrex::Real dt) const
Definition: ERF_ShocDriver.cpp:939
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
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:433
amrex::MultiFab m_w3_cc
Definition: ERF_ShocDriver.H:161
void print_debug_summary(amrex::Real dt) const
Definition: ERF_ShocDriver.cpp:1470
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:401
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:449
void store_carried_turbulence(const ShocColumnData &col, const amrex::MFIter &mfi)
Definition: ERF_ShocDriver.cpp:420
bool uses_state_update() const
Definition: ERF_ShocDriver.cpp:865
void ensure_storage(const amrex::MultiFab &cons, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &eddy_diffs)
Definition: ERF_ShocDriver.cpp:320
bool uses_momentum_state_update() const
Definition: ERF_ShocDriver.cpp:871
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, amrex::Real 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, amrex::Real dt)
Definition: ERF_ShocImplicit.cpp:319
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:210
@ Turb_lengthscale
Definition: ERF_IndexDefines.H:214
@ Scalar_v
Definition: ERF_IndexDefines.H:212
@ Q_v
Definition: ERF_IndexDefines.H:213
@ Mom_v
Definition: ERF_IndexDefines.H:209
@ KE_v
Definition: ERF_IndexDefines.H:211
@ xvel
Definition: ERF_IndexDefines.H:175
@ cons
Definition: ERF_IndexDefines.H:174
@ zvel
Definition: ERF_IndexDefines.H:177
@ yvel
Definition: ERF_IndexDefines.H:176
@ 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,
amrex::Real  dt 
) const
private
917 {
918  AMREX_ALWAYS_ASSERT(dt > 0.0);
919 
920  apply_state_update_cons_impl(cons,
922  m_qv_tend_cc,
923  m_qc_tend_cc,
924  m_qi_tend_cc,
929  m_opts,
930  dt);
931 
933  apply_state_update_face_velocity_impl(xvel, m_u_tend_fc, dt);
934  apply_state_update_face_velocity_impl(yvel, m_v_tend_fc, dt);
935  }
936 }
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,
amrex::Real  dt 
) const
private
948 {
949  amrex::ignore_unused(geom, dt);
950 
951  if (!m_opts.debug_bad_column) {
952  return;
953  }
954 
955  AMREX_ALWAYS_ASSERT(m_cons_ptr != nullptr);
956  print_shoc_debug_settings_once(m_opts);
957 
958  const auto cons_host = copy_fab_to_host((*m_cons_ptr)[mfi]);
959  const auto z_host = copy_fab_to_host(z_phys_nd[mfi]);
960  const auto theta_tend_host = copy_fab_to_host(col.theta_tend);
961  const auto qv_tend_host = copy_fab_to_host(col.qv_tend);
962  const auto qc_tend_host = copy_fab_to_host(col.qc_tend);
963  const auto qi_tend_host = copy_fab_to_host(col.qi_tend);
964  const auto tke_tend_host = copy_fab_to_host(col.tke_tend);
965  const auto u_tend_host = copy_fab_to_host(col.u_tend);
966  const auto v_tend_host = copy_fab_to_host(col.v_tend);
967  const auto p_mid_host = copy_fab_to_host(col.p_mid);
968  const auto p_int_host = copy_fab_to_host(col.p_int);
969  const auto zt_host = copy_fab_to_host(col.zt);
970  const auto zi_host = copy_fab_to_host(col.zi);
971  const auto dz_host = copy_fab_to_host(col.dz);
972  const auto rho_host = copy_fab_to_host(col.rho);
973  const auto theta_host = copy_fab_to_host(col.theta);
974  const auto thetal_host = copy_fab_to_host(col.thetal);
975  const auto theta_base_host = copy_fab_to_host(col.theta_base);
976  const auto thetal_base_host = copy_fab_to_host(col.thetal_base);
977  const auto qv_base_host = copy_fab_to_host(col.qv_base);
978  const auto qc_base_host = copy_fab_to_host(col.qc_base);
979  const auto qi_base_host = copy_fab_to_host(col.qi_base);
980  const auto tke_base_host = copy_fab_to_host(col.tke_base_state);
981  const auto theta_v_host = copy_fab_to_host(col.theta_v);
982  const auto qv_host = copy_fab_to_host(col.qv);
983  const auto qc_host = copy_fab_to_host(col.qc);
984  const auto qi_host = copy_fab_to_host(col.qi);
985  const auto qw_host = copy_fab_to_host(col.qw);
986  const auto tabs_host = copy_fab_to_host(col.tabs);
987  const auto exner_host = copy_fab_to_host(col.exner);
988  const auto host_dse_host = copy_fab_to_host(col.host_dse);
989  const auto pblh_host = copy_fab_to_host(col.pblh);
990  const auto obklen_host = copy_fab_to_host(col.obklen);
991  const auto ustar_host = copy_fab_to_host(col.ustar);
992  const auto shoc_mix_host = copy_fab_to_host(col.shoc_mix);
993  const auto brunt_host = copy_fab_to_host(col.brunt);
994  const auto isotropy_host = copy_fab_to_host(col.isotropy);
995  const auto tk_host = copy_fab_to_host(col.tk);
996  const auto tkh_host = copy_fab_to_host(col.tkh);
997  const auto shear_prod_host = copy_fab_to_host(col.shear_prod);
998  const auto buoy_prod_host = copy_fab_to_host(col.buoy_prod);
999  const auto diss_tke_host = copy_fab_to_host(col.diss_tke);
1000  const auto tke_host = copy_fab_to_host(col.tke);
1001  const auto w_sec_host = copy_fab_to_host(col.w_sec);
1002  const auto wthv_sec_host = copy_fab_to_host(col.wthv_sec);
1003  const auto shoc_cldfrac_host = copy_fab_to_host(col.shoc_cldfrac);
1004  const auto shoc_ql_host = copy_fab_to_host(col.shoc_ql);
1005  const auto shoc_ql2_host = copy_fab_to_host(col.shoc_ql2);
1006  const auto shoc_cond_host = copy_fab_to_host(col.shoc_cond);
1007  const auto shoc_evap_host = copy_fab_to_host(col.shoc_evap);
1008  const auto wqls_sec_host = copy_fab_to_host(col.wqls_sec);
1009  const auto thl_sec_host = copy_fab_to_host(col.thl_sec);
1010  const auto qw_sec_host = copy_fab_to_host(col.qw_sec);
1011  const auto qwthl_sec_host = copy_fab_to_host(col.qwthl_sec);
1012  const auto wthl_sec_host = copy_fab_to_host(col.wthl_sec);
1013  const auto wqw_sec_host = copy_fab_to_host(col.wqw_sec);
1014  const auto uw_sec_host = copy_fab_to_host(col.uw_sec);
1015  const auto vw_sec_host = copy_fab_to_host(col.vw_sec);
1016  const auto wtke_sec_host = copy_fab_to_host(col.wtke_sec);
1017  const auto w3_host = copy_fab_to_host(col.w3);
1018  const auto surf_sens_flux_host = copy_fab_to_host(col.surf_sens_flux);
1019  const auto surf_lat_flux_host = copy_fab_to_host(col.surf_lat_flux);
1020  const auto surf_tau_u_host = copy_fab_to_host(col.surf_tau_u);
1021  const auto surf_tau_v_host = copy_fab_to_host(col.surf_tau_v);
1022  const auto hfx3_host = hfx3 ? copy_fab_to_host((*hfx3)[mfi]) : FArrayBox();
1023  const auto qfx3_host = qfx3 ? copy_fab_to_host((*qfx3)[mfi]) : FArrayBox();
1024  const auto tau13_host = tau13 ? copy_fab_to_host((*tau13)[mfi]) : FArrayBox();
1025  const auto tau23_host = tau23 ? copy_fab_to_host((*tau23)[mfi]) : FArrayBox();
1026 
1027  const auto z_arr = z_host.const_array();
1028  const auto cons_arr = cons_host.const_array();
1029  const auto theta_tend_arr = theta_tend_host.const_array();
1030  const auto qv_tend_arr = qv_tend_host.const_array();
1031  const auto qc_tend_arr = qc_tend_host.const_array();
1032  const auto qi_tend_arr = qi_tend_host.const_array();
1033  const auto tke_tend_arr = tke_tend_host.const_array();
1034  const auto u_tend_arr = u_tend_host.const_array();
1035  const auto v_tend_arr = v_tend_host.const_array();
1036  const auto dz_arr = dz_host.const_array();
1037 
1038  std::vector<ShocBadColumnReport> reports;
1039  reports.reserve(static_cast<std::size_t>(col.layout.ncell * col.layout.nlev));
1040 
1041  auto maybe_add = [&] (int i, int j, int k, int kk, int ic,
1042  const char* name, Real value, Real threshold) {
1043  if (!std::isfinite(value)) {
1044  reports.push_back(ShocBadColumnReport{
1045  std::numeric_limits<Real>::infinity(),
1046  std::string(name) + " nonfinite",
1047  mfi.index(), i, j, k, kk, ic
1048  });
1049  return;
1050  }
1051  const Real abs_value = amrex::Math::abs(value);
1052  const Real ratio = abs_value / threshold;
1053  if (ratio > 1.0_rt) {
1054  std::ostringstream oss;
1055  oss << name << " |value|=" << abs_value << " threshold=" << threshold;
1056  reports.push_back(ShocBadColumnReport{ratio, oss.str(), mfi.index(), i, j, k, kk, ic});
1057  }
1058  };
1059 
1060  auto maybe_add_geom = [&] (int i, int j, int k, int kk, int ic, Real dz_val) {
1061  if (!std::isfinite(dz_val)) {
1062  reports.push_back(ShocBadColumnReport{
1063  std::numeric_limits<Real>::infinity(),
1064  "dz nonfinite",
1065  mfi.index(), i, j, k, kk, ic
1066  });
1067  } else if (dz_val <= 0.0_rt) {
1068  reports.push_back(ShocBadColumnReport{
1069  std::numeric_limits<Real>::infinity(),
1070  "dz <= 0",
1071  mfi.index(), i, j, k, kk, ic
1072  });
1073  } else if (dz_val < m_opts.debug_bad_column_min_dz) {
1074  std::ostringstream oss;
1075  oss << "dz below minimum |dz|=" << dz_val
1076  << " min_dz=" << m_opts.debug_bad_column_min_dz;
1077  reports.push_back(ShocBadColumnReport{
1079  oss.str(),
1080  mfi.index(), i, j, k, kk, ic
1081  });
1082  }
1083  };
1084 
1085  for (int j = col.layout.jmin; j < col.layout.jmin + col.layout.ny; ++j) {
1086  for (int i = col.layout.imin; i < col.layout.imin + col.layout.nx; ++i) {
1087  const int ic = shoc_column_index(col.layout, i, j);
1088  for (int kk = 0; kk < col.layout.nlev; ++kk) {
1089  const int k = col.layout.kmin + kk;
1090  const Real dz_val = dz_arr(ic, kk, 0);
1091  maybe_add_geom(i, j, k, kk, ic, dz_val);
1092 
1093  maybe_add(i, j, k, kk, ic, "theta_tend", theta_tend_arr(ic, kk, 0), m_opts.debug_bad_column_theta_tend_threshold);
1094  maybe_add(i, j, k, kk, ic, "qv_tend", qv_tend_arr(ic, kk, 0), m_opts.debug_bad_column_q_tend_threshold);
1095  maybe_add(i, j, k, kk, ic, "qc_tend", qc_tend_arr(ic, kk, 0), m_opts.debug_bad_column_q_tend_threshold);
1096  maybe_add(i, j, k, kk, ic, "qi_tend", qi_tend_arr(ic, kk, 0), m_opts.debug_bad_column_q_tend_threshold);
1097  maybe_add(i, j, k, kk, ic, "brunt", brunt_host.const_array()(ic, kk, 0), m_opts.debug_bad_column_brunt_threshold);
1098  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);
1099  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);
1100  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);
1101  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);
1102  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);
1103 
1104  // Treat NaN/Inf in the key state and diagnostic fields as bad.
1105  const Real key_values[] = {
1106  rho_host.const_array()(ic, kk, 0),
1107  theta_host.const_array()(ic, kk, 0),
1108  thetal_host.const_array()(ic, kk, 0),
1109  theta_v_host.const_array()(ic, kk, 0),
1110  qv_host.const_array()(ic, kk, 0),
1111  qc_host.const_array()(ic, kk, 0),
1112  qi_host.const_array()(ic, kk, 0),
1113  qw_host.const_array()(ic, kk, 0),
1114  tabs_host.const_array()(ic, kk, 0),
1115  exner_host.const_array()(ic, kk, 0),
1116  p_mid_host.const_array()(ic, kk, 0),
1117  host_dse_host.const_array()(ic, kk, 0),
1118  pblh_host.const_array()(ic, 0, 0),
1119  obklen_host.const_array()(ic, 0, 0),
1120  ustar_host.const_array()(ic, 0, 0),
1121  shoc_mix_host.const_array()(ic, kk, 0),
1122  isotropy_host.const_array()(ic, kk, 0),
1123  tk_host.const_array()(ic, kk, 0),
1124  tkh_host.const_array()(ic, kk, 0),
1125  shear_prod_host.const_array()(ic, kk, 0),
1126  buoy_prod_host.const_array()(ic, kk, 0),
1127  diss_tke_host.const_array()(ic, kk, 0),
1128  w_sec_host.const_array()(ic, kk, 0),
1129  wthv_sec_host.const_array()(ic, kk, 0),
1130  shoc_cldfrac_host.const_array()(ic, kk, 0),
1131  shoc_ql_host.const_array()(ic, kk, 0),
1132  shoc_ql2_host.const_array()(ic, kk, 0),
1133  shoc_cond_host.const_array()(ic, kk, 0),
1134  shoc_evap_host.const_array()(ic, kk, 0),
1135  wqls_sec_host.const_array()(ic, kk, 0),
1136  thl_sec_host.const_array()(ic, kk, 0),
1137  qw_sec_host.const_array()(ic, kk, 0),
1138  qwthl_sec_host.const_array()(ic, kk, 0),
1139  wthl_sec_host.const_array()(ic, kk, 0),
1140  wqw_sec_host.const_array()(ic, kk, 0),
1141  uw_sec_host.const_array()(ic, kk, 0),
1142  vw_sec_host.const_array()(ic, kk, 0),
1143  wtke_sec_host.const_array()(ic, kk, 0),
1144  w3_host.const_array()(ic, kk, 0),
1145  theta_tend_arr(ic, kk, 0),
1146  qv_tend_arr(ic, kk, 0),
1147  qc_tend_arr(ic, kk, 0),
1148  qi_tend_arr(ic, kk, 0),
1149  tke_tend_arr(ic, kk, 0),
1150  u_tend_arr(ic, kk, 0),
1151  v_tend_arr(ic, kk, 0)
1152  };
1153  for (Real value : key_values) {
1154  if (!std::isfinite(value)) {
1155  reports.push_back(ShocBadColumnReport{
1156  std::numeric_limits<Real>::infinity(),
1157  "key field nonfinite",
1158  mfi.index(), i, j, k, kk, ic
1159  });
1160  break;
1161  }
1162  }
1163  }
1164  }
1165  }
1166 
1167  if (reports.empty()) {
1168  return;
1169  }
1170 
1171  std::stable_sort(reports.begin(), reports.end(),
1172  [] (const ShocBadColumnReport& a, const ShocBadColumnReport& b) {
1173  return a.score > b.score;
1174  });
1175 
1176  const int max_reports = std::min(m_opts.debug_bad_column_max_reports,
1177  static_cast<int>(reports.size()));
1178 
1179  const auto rho_arr = rho_host.const_array();
1180  const auto theta_arr = theta_host.const_array();
1181  const auto thetal_arr = thetal_host.const_array();
1182  const auto theta_base_arr = theta_base_host.const_array();
1183  const auto thetal_base_arr = thetal_base_host.const_array();
1184  const auto qv_base_arr = qv_base_host.const_array();
1185  const auto qc_base_arr = qc_base_host.const_array();
1186  const auto qi_base_arr = qi_base_host.const_array();
1187  const auto theta_v_arr = theta_v_host.const_array();
1188  const auto qv_arr = qv_host.const_array();
1189  const auto qc_arr = qc_host.const_array();
1190  const auto qi_arr = qi_host.const_array();
1191  const auto qw_arr = qw_host.const_array();
1192  const auto tabs_arr = tabs_host.const_array();
1193  const auto exner_arr = exner_host.const_array();
1194  const auto p_mid_arr = p_mid_host.const_array();
1195  const auto p_int_arr = p_int_host.const_array();
1196  const auto host_dse_arr = host_dse_host.const_array();
1197  const auto pblh_arr = pblh_host.const_array();
1198  const auto obklen_arr = obklen_host.const_array();
1199  const auto ustar_arr = ustar_host.const_array();
1200  const auto shoc_mix_arr = shoc_mix_host.const_array();
1201  const auto brunt_arr = brunt_host.const_array();
1202  const auto isotropy_arr = isotropy_host.const_array();
1203  const auto tk_arr = tk_host.const_array();
1204  const auto tkh_arr = tkh_host.const_array();
1205  const auto shear_prod_arr = shear_prod_host.const_array();
1206  const auto buoy_prod_arr = buoy_prod_host.const_array();
1207  const auto diss_tke_arr = diss_tke_host.const_array();
1208  const auto tke_state_arr = tke_host.const_array();
1209  const auto tke_base_arr = tke_base_host.const_array();
1210  const auto w_sec_arr = w_sec_host.const_array();
1211  const auto wthv_sec_arr = wthv_sec_host.const_array();
1212  const auto shoc_cldfrac_arr = shoc_cldfrac_host.const_array();
1213  const auto shoc_ql_arr = shoc_ql_host.const_array();
1214  const auto shoc_ql2_arr = shoc_ql2_host.const_array();
1215  const auto shoc_cond_arr = shoc_cond_host.const_array();
1216  const auto shoc_evap_arr = shoc_evap_host.const_array();
1217  const auto wqls_sec_arr = wqls_sec_host.const_array();
1218  const auto thl_sec_arr = thl_sec_host.const_array();
1219  const auto qw_sec_arr = qw_sec_host.const_array();
1220  const auto qwthl_sec_arr = qwthl_sec_host.const_array();
1221  const auto wthl_sec_arr = wthl_sec_host.const_array();
1222  const auto wqw_sec_arr = wqw_sec_host.const_array();
1223  const auto uw_sec_arr = uw_sec_host.const_array();
1224  const auto vw_sec_arr = vw_sec_host.const_array();
1225  const auto wtke_sec_arr = wtke_sec_host.const_array();
1226  const auto w3_arr = w3_host.const_array();
1227  const auto surf_sens_flux_arr = surf_sens_flux_host.const_array();
1228  const auto surf_lat_flux_arr = surf_lat_flux_host.const_array();
1229  const auto surf_tau_u_arr = surf_tau_u_host.const_array();
1230  const auto surf_tau_v_arr = surf_tau_v_host.const_array();
1231  const bool has_hfx3 = hfx3 && hfx3_host.box().ok();
1232  const bool has_qfx3 = qfx3 && qfx3_host.box().ok();
1233  const bool has_tau13 = tau13 && tau13_host.box().ok();
1234  const bool has_tau23 = tau23 && tau23_host.box().ok();
1235 
1236  for (int n = 0; n < max_reports; ++n) {
1237  const auto& rep = reports[static_cast<std::size_t>(n)];
1238  const int i = rep.i;
1239  const int j = rep.j;
1240  const int k = rep.k;
1241  const int kk = rep.kk;
1242  const int ic = rep.ic;
1243 
1244  const auto node_value = [&] (int ii, int jj, int kk) -> Real {
1245  const IntVect iv(ii, jj, kk);
1246  return z_host.box().contains(iv) ? z_arr(ii, jj, kk) : std::numeric_limits<Real>::quiet_NaN();
1247  };
1248 
1249  const Real z_nd_ijk = node_value(i, j, k);
1250  const Real z_nd_ip1jk = node_value(i + 1, j, k);
1251  const Real z_nd_ijp1k = node_value(i, j + 1, k);
1252  const Real z_nd_ip1jp1k = node_value(i + 1, j + 1, k);
1253  const Real z_nd_ijkp1 = node_value(i, j, k + 1);
1254  const Real z_nd_ip1jkp1 = node_value(i + 1, j, k + 1);
1255  const Real z_nd_ijp1kp1 = node_value(i, j + 1, k + 1);
1256  const Real z_nd_ip1jp1kp1 = node_value(i + 1, j + 1, k + 1);
1257  const Real four_node_zlo = 0.25_rt * (z_nd_ijk + z_nd_ip1jk + z_nd_ijp1k + z_nd_ip1jp1k);
1258  const Real four_node_zhi = 0.25_rt * (z_nd_ijkp1 + z_nd_ip1jkp1 + z_nd_ijp1kp1 + z_nd_ip1jp1kp1);
1259  const Real four_node_dz = four_node_zhi - four_node_zlo;
1260  const Real corner_dz = z_nd_ijkp1 - z_nd_ijk;
1261  const Real theta_base_val = theta_base_arr(ic, kk, 0);
1262  const Real theta_new_val = theta_arr(ic, kk, 0);
1263  const Real thetal_base_val = thetal_base_arr(ic, kk, 0);
1264  const Real thetal_new_val = thetal_arr(ic, kk, 0);
1265  const Real qv_base_val = qv_base_arr(ic, kk, 0);
1266  const Real qc_base_val = qc_base_arr(ic, kk, 0);
1267  const Real qi_base_val = qi_base_arr(ic, kk, 0);
1268  const Real qv_new_val = qv_arr(ic, kk, 0);
1269  const Real qc_new_val = qc_arr(ic, kk, 0);
1270  const Real qi_new_val = qi_arr(ic, kk, 0);
1271  const Real ql_base = qc_base_val + qi_base_val;
1272  const Real ql_new = qc_new_val + qi_new_val;
1273  const Real qw_base = qv_base_val + qc_base_val + qi_base_val;
1274  const Real qw_new = qv_new_val + qc_new_val + qi_new_val;
1275  const Real delta_theta = theta_new_val - theta_base_val;
1276  const Real delta_qv = qv_new_val - qv_base_val;
1277  const Real delta_qc = qc_new_val - qc_base_val;
1278  const Real delta_qi = qi_new_val - qi_base_val;
1279  const Real delta_ql = ql_new - ql_base;
1280  const Real delta_qw = qw_new - qw_base;
1281  const Real dt_theta_tend = theta_tend_arr(ic, kk, 0) * dt;
1282  const Real dt_qv_tend = qv_tend_arr(ic, kk, 0) * dt;
1283  const Real dt_qc_tend = qc_tend_arr(ic, kk, 0) * dt;
1284  const Real dt_qi_tend = qi_tend_arr(ic, kk, 0) * dt;
1285  const Real dt_tke_tend = tke_tend_arr(ic, kk, 0) * dt;
1286  const Real cond_dt = shoc_cond_arr(ic, kk, 0) * dt;
1287  const Real evap_dt = shoc_evap_arr(ic, kk, 0) * dt;
1288  const Real tke_base_val = tke_base_arr(ic, kk, 0);
1289  std::ostringstream msg;
1290  msg << "NATIVE_SHOC_BAD_COLUMN_BEGIN\n"
1291  << " rank=" << ParallelDescriptor::MyProc()
1292  << " level=" << m_lev
1293  << " shoc_call=" << (m_advance_calls + 1)
1294  << " mfi_index=" << rep.mfi_index
1295  << " box_valid_lo=(" << mfi.validbox().smallEnd(0) << ","
1296  << mfi.validbox().smallEnd(1) << ","
1297  << mfi.validbox().smallEnd(2) << ")"
1298  << " box_valid_hi=(" << mfi.validbox().bigEnd(0) << ","
1299  << mfi.validbox().bigEnd(1) << ","
1300  << mfi.validbox().bigEnd(2) << ")"
1301  << " layout.nx=" << col.layout.nx
1302  << " layout.ny=" << col.layout.ny
1303  << " layout.ncell=" << col.layout.ncell
1304  << " layout.nlev=" << col.layout.nlev
1305  << " layout.imin=" << col.layout.imin
1306  << " layout.jmin=" << col.layout.jmin
1307  << " layout.kmin=" << col.layout.kmin
1308  << " layout.kmax=" << col.layout.kmax
1309  << "\n"
1310  << " i=" << i << " j=" << j << " k=" << k
1311  << " kk=" << kk << " ic=" << ic
1312  << " score=" << rep.score
1313  << " reason=" << rep.reason
1314  << "\n"
1315  << " geometry z_nd(i,j,k)=" << z_nd_ijk
1316  << " z_nd(i+1,j,k)=" << z_nd_ip1jk
1317  << " z_nd(i,j+1,k)=" << z_nd_ijp1k
1318  << " z_nd(i+1,j+1,k)=" << z_nd_ip1jp1k
1319  << " z_nd(i,j,k+1)=" << z_nd_ijkp1
1320  << " z_nd(i+1,j,k+1)=" << z_nd_ip1jkp1
1321  << " z_nd(i,j+1,k+1)=" << z_nd_ijp1kp1
1322  << " z_nd(i+1,j+1,k+1)=" << z_nd_ip1jp1kp1
1323  << "\n"
1324  << " four_node_zlo=" << four_node_zlo
1325  << " four_node_zhi=" << four_node_zhi
1326  << " four_node_dz=" << four_node_dz
1327  << " corner_dz=" << corner_dz
1328  << " dz=" << dz_arr(ic, kk, 0)
1329  << "\n"
1330  << " rho=" << rho_arr(ic, kk, 0)
1331  << " theta=" << theta_arr(ic, kk, 0)
1332  << " thetal=" << thetal_arr(ic, kk, 0)
1333  << " theta_v=" << theta_v_arr(ic, kk, 0)
1334  << " qv=" << qv_arr(ic, kk, 0)
1335  << " qc=" << qc_arr(ic, kk, 0)
1336  << " qi=" << qi_arr(ic, kk, 0)
1337  << " qw=" << qw_arr(ic, kk, 0)
1338  << " tabs=" << tabs_arr(ic, kk, 0)
1339  << " exner=" << exner_arr(ic, kk, 0)
1340  << " p_mid=" << p_mid_arr(ic, kk, 0)
1341  << " p_int_lower=" << p_int_arr(ic, kk, 0)
1342  << " p_int_upper=" << p_int_arr(ic, kk + 1, 0)
1343  << " host_dse=" << host_dse_arr(ic, kk, 0)
1344  << "\n"
1345  << " pblh=" << pblh_arr(ic, 0, 0)
1346  << " obklen=" << obklen_arr(ic, 0, 0)
1347  << " ustar=" << ustar_arr(ic, 0, 0)
1348  << " shoc_mix=" << shoc_mix_arr(ic, kk, 0)
1349  << " Lturb=" << shoc_mix_arr(ic, kk, 0)
1350  << " brunt=" << brunt_arr(ic, kk, 0)
1351  << " isotropy=" << isotropy_arr(ic, kk, 0)
1352  << " tk=" << tk_arr(ic, kk, 0)
1353  << " tkh=" << tkh_arr(ic, kk, 0)
1354  << " shear_prod=" << shear_prod_arr(ic, kk, 0)
1355  << " buoy_prod=" << buoy_prod_arr(ic, kk, 0)
1356  << " diss_tke=" << diss_tke_arr(ic, kk, 0)
1357  << " tke=" << tke_state_arr(ic, kk, 0)
1358  << "\n"
1359  << " w_sec=" << w_sec_arr(ic, kk, 0)
1360  << " wthv_sec=" << wthv_sec_arr(ic, kk, 0)
1361  << " shoc_cldfrac=" << shoc_cldfrac_arr(ic, kk, 0)
1362  << " shoc_ql=" << shoc_ql_arr(ic, kk, 0)
1363  << " shoc_ql2=" << shoc_ql2_arr(ic, kk, 0)
1364  << " shoc_cond=" << shoc_cond_arr(ic, kk, 0)
1365  << " shoc_evap=" << shoc_evap_arr(ic, kk, 0)
1366  << " wqls_sec=" << wqls_sec_arr(ic, kk, 0)
1367  << "\n"
1368  << " thl_sec_lower=" << thl_sec_arr(ic, kk, 0)
1369  << " thl_sec_upper=" << thl_sec_arr(ic, kk + 1, 0)
1370  << " qw_sec_lower=" << qw_sec_arr(ic, kk, 0)
1371  << " qw_sec_upper=" << qw_sec_arr(ic, kk + 1, 0)
1372  << " qwthl_sec_lower=" << qwthl_sec_arr(ic, kk, 0)
1373  << " qwthl_sec_upper=" << qwthl_sec_arr(ic, kk + 1, 0)
1374  << " wthl_sec_lower=" << wthl_sec_arr(ic, kk, 0)
1375  << " wthl_sec_upper=" << wthl_sec_arr(ic, kk + 1, 0)
1376  << " wqw_sec_lower=" << wqw_sec_arr(ic, kk, 0)
1377  << " wqw_sec_upper=" << wqw_sec_arr(ic, kk + 1, 0)
1378  << " w3_lower=" << w3_arr(ic, kk, 0)
1379  << " w3_upper=" << w3_arr(ic, kk + 1, 0)
1380  << " uw_sec_lower=" << uw_sec_arr(ic, kk, 0)
1381  << " uw_sec_upper=" << uw_sec_arr(ic, kk + 1, 0)
1382  << " vw_sec_lower=" << vw_sec_arr(ic, kk, 0)
1383  << " vw_sec_upper=" << vw_sec_arr(ic, kk + 1, 0)
1384  << " wtke_sec_lower=" << wtke_sec_arr(ic, kk, 0)
1385  << " wtke_sec_upper=" << wtke_sec_arr(ic, kk + 1, 0)
1386  << "\n"
1387  << " theta_tend=" << theta_tend_arr(ic, kk, 0)
1388  << " qv_tend=" << qv_tend_arr(ic, kk, 0)
1389  << " qc_tend=" << qc_tend_arr(ic, kk, 0)
1390  << " qi_tend=" << qi_tend_arr(ic, kk, 0)
1391  << " tke_tend=" << tke_tend_arr(ic, kk, 0)
1392  << " u_tend=" << u_tend_arr(ic, kk, 0)
1393  << " v_tend=" << v_tend_arr(ic, kk, 0)
1394  << "\n"
1395  << " baseline theta=" << theta_base_val
1396  << " thetal=" << thetal_base_val
1397  << " qv=" << qv_base_val
1398  << " qc=" << qc_base_val
1399  << " qi=" << qi_base_val
1400  << " ql=" << ql_base
1401  << " qw=" << qw_base
1402  << " tke=" << tke_base_val
1403  << "\n"
1404  << " updated theta=" << theta_new_val
1405  << " thetal=" << thetal_new_val
1406  << " qv=" << qv_new_val
1407  << " qc=" << qc_new_val
1408  << " qi=" << qi_new_val
1409  << " ql=" << ql_new
1410  << " qw=" << qw_new
1411  << " tke=" << tke_state_arr(ic, kk, 0)
1412  << "\n"
1413  << " deltas dtheta=" << delta_theta
1414  << " dqv=" << delta_qv
1415  << " dqc=" << delta_qc
1416  << " dqi=" << delta_qi
1417  << " dql=" << delta_ql
1418  << " dqw=" << delta_qw
1419  << "\n"
1420  << " tend_dt theta=" << dt_theta_tend
1421  << " qv=" << dt_qv_tend
1422  << " qc=" << dt_qc_tend
1423  << " qi=" << dt_qi_tend
1424  << " tke=" << dt_tke_tend
1425  << "\n"
1426  << " consistency dtheta_minus_tenddt=" << (delta_theta - dt_theta_tend)
1427  << " dqv_minus_tenddt=" << (delta_qv - dt_qv_tend)
1428  << " dqc_minus_tenddt=" << (delta_qc - dt_qc_tend)
1429  << " dqi_minus_tenddt=" << (delta_qi - dt_qi_tend)
1430  << "\n"
1431  << " pdf_cloud shoc_ql=" << shoc_ql_arr(ic, kk, 0)
1432  << " shoc_cond_dt=" << cond_dt
1433  << " shoc_evap_dt=" << evap_dt
1434  << " delta_ql=" << delta_ql
1435  << " delta_ql_minus_cond_minus_evap=" << (delta_ql - (cond_dt - evap_dt))
1436  << "\n"
1437  << " surf_sens_flux=" << surf_sens_flux_arr(ic, 0, 0)
1438  << " surf_lat_flux=" << surf_lat_flux_arr(ic, 0, 0)
1439  << " surf_tau_u=" << surf_tau_u_arr(ic, 0, 0)
1440  << " surf_tau_v=" << surf_tau_v_arr(ic, 0, 0)
1441  << " rho_sfc=" << cons_arr(i, j, k, Rho_comp)
1442  << "\n";
1443 
1444  if (has_hfx3) {
1445  msg << " raw hfx3(i,j,klo)=" << hfx3_host.const_array()(rep.i, rep.j, rep.k) << "\n";
1446  }
1447  if (has_qfx3) {
1448  msg << " raw qfx3(i,j,klo)=" << qfx3_host.const_array()(rep.i, rep.j, rep.k) << "\n";
1449  }
1450  if (has_tau13) {
1451  msg << " raw tau13(i,j,klo)=" << tau13_host.const_array()(rep.i, rep.j, rep.k)
1452  << " raw tau13(i+1,j,klo)=" << tau13_host.const_array()(rep.i + 1, rep.j, rep.k)
1453  << "\n";
1454  }
1455  if (has_tau23) {
1456  msg << " raw tau23(i,j,klo)=" << tau23_host.const_array()(rep.i, rep.j, rep.k)
1457  << " raw tau23(i,j+1,klo)=" << tau23_host.const_array()(rep.i, rep.j + 1, rep.k)
1458  << "\n";
1459  }
1460  msg << "NATIVE_SHOC_BAD_COLUMN_END\n";
1461  amrex::AllPrint() << msg.str() << std::flush;
1462  }
1463 
1465  amrex::Abort("Native SHOC debug_bad_column abort: bad SHOC column detected before state update");
1466  }
1467 }
amrex::Real value
Definition: ERF_HurricaneDiagnostics.H:20
#define Rho_comp
Definition: ERF_IndexDefines.H:36
auto qv_arr
Definition: ERF_InitCustomPert_MultiSpeciesBubble.H:210
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
884 {
886 }
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
324 {
325  if (!m_theta_tend_cc.isDefined()) {
326  m_theta_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
327  m_qv_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
328  m_qc_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
329  m_qi_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
330  m_tke_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
331  m_u_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 1);
332  m_v_tend_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 1);
333  m_u_tend_fc.define(xvel.boxArray(), xvel.DistributionMap(), 1, 0);
334  m_v_tend_fc.define(yvel.boxArray(), yvel.DistributionMap(), 1, 0);
335  m_eddy_coeffs_cc.define(eddy_diffs.boxArray(), eddy_diffs.DistributionMap(),
336  EddyDiff::NumDiffs, 0);
337  m_prev_turb_cc.define(cons.boxArray(), cons.DistributionMap(), 2, 0);
338  m_prev_wthv_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
339  m_consumed_sens_flux_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
340  m_consumed_laten_flux_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
341  m_pblh_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
342  m_shoc_ustar_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
343  m_shoc_olen_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
344  m_shoc_cldfrac_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
345  m_shoc_ql_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
346  m_shoc_ql2_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
347  m_shoc_cond_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
348  m_w_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
349  m_wqls_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
350  m_wthv_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
351  m_thl_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
352  m_qw_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
353  m_qwthl_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
354  m_wthl_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
355  m_wqw_sec_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
356  m_w3_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
357  m_brunt_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
358  m_isotropy_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
359  m_shear_prod_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
360  m_buoy_prod_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
361  m_diss_tke_cc.define(cons.boxArray(), cons.DistributionMap(), 1, 0);
362  m_prev_turb_cc.setVal(0.0);
363  m_prev_wthv_sec_cc.setVal(0.0);
364  }
365  m_theta_tend_cc.setVal(0.0);
366  m_qv_tend_cc.setVal(0.0);
367  m_qc_tend_cc.setVal(0.0);
368  m_qi_tend_cc.setVal(0.0);
369  m_tke_tend_cc.setVal(0.0);
370  m_u_tend_cc.setVal(0.0);
371  m_v_tend_cc.setVal(0.0);
372  m_u_tend_fc.setVal(0.0);
373  m_v_tend_fc.setVal(0.0);
374  m_eddy_coeffs_cc.setVal(0.0);
375  m_consumed_sens_flux_cc.setVal(0.0);
376  m_consumed_laten_flux_cc.setVal(0.0);
377  m_pblh_cc.setVal(0.0);
378  m_shoc_ustar_cc.setVal(0.0);
379  m_shoc_olen_cc.setVal(0.0);
380  m_shoc_cldfrac_cc.setVal(0.0);
381  m_shoc_ql_cc.setVal(0.0);
382  m_shoc_ql2_cc.setVal(0.0);
383  m_shoc_cond_cc.setVal(0.0);
384  m_w_sec_cc.setVal(0.0);
385  m_wqls_sec_cc.setVal(0.0);
386  m_wthv_sec_cc.setVal(0.0);
387  m_thl_sec_cc.setVal(0.0);
388  m_qw_sec_cc.setVal(0.0);
389  m_qwthl_sec_cc.setVal(0.0);
390  m_wthl_sec_cc.setVal(0.0);
391  m_wqw_sec_cc.setVal(0.0);
392  m_w3_cc.setVal(0.0);
393  m_brunt_cc.setVal(0.0);
394  m_isotropy_cc.setVal(0.0);
395  m_shear_prod_cc.setVal(0.0);
396  m_buoy_prod_cc.setVal(0.0);
397  m_diss_tke_cc.setVal(0.0);
398 }
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:215

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
902 {
904 }
bool uses_momentum_host_diffusion() const
Definition: ERF_ShocDriver.cpp:877
Here is the call graph for this function:

◆ owns_momentum_surface_stresses()

bool ShocDriver::owns_momentum_surface_stresses ( ) const
896 {
898 }

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
890 {
891  return uses_state_update();
892 }

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
908 {
910 }
bool owns_scalar_surface_fluxes() const
Definition: ERF_ShocDriver.cpp:889
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 ( amrex::Real  dt) const
private
1471 {
1472  BL_PROFILE("SHOC::print_debug_summary");
1473 
1474  auto print_minmax = [] (const char* name, const MultiFab& mf, int comp) {
1475  amrex::Print() << " " << std::setw(12) << std::left << name
1476  << " min=" << mf.min(comp)
1477  << " max=" << mf.max(comp) << "\n";
1478  };
1479 
1480  amrex::Print() << "SHOC debug summary:"
1481  << " level=" << m_lev
1482  << " call=" << m_advance_calls
1483  << " dt=" << dt
1484  << " transport_mode=" << shoc_transport_mode_name(m_opts.transport_mode)
1485  << " momentum_transport=" << shoc_momentum_transport_name(m_opts.momentum_transport)
1486  << " state_update=" << (uses_state_update() ? "on" : "off")
1487  << "\n";
1488  print_shoc_debug_settings_once(m_opts);
1489 
1490  print_minmax("Kmv", m_eddy_coeffs_cc, EddyDiff::Mom_v);
1491  print_minmax("Khv", m_eddy_coeffs_cc, EddyDiff::Theta_v);
1492  print_minmax("KE_v", m_eddy_coeffs_cc, EddyDiff::KE_v);
1493  print_minmax("Q_v", m_eddy_coeffs_cc, EddyDiff::Q_v);
1494  print_minmax("l_turb", m_eddy_coeffs_cc, EddyDiff::Turb_lengthscale);
1495  print_minmax("pblh", m_pblh_cc, 0);
1496 
1497  print_minmax("th_tend", m_theta_tend_cc, 0);
1498  print_minmax("qv_tend", m_qv_tend_cc, 0);
1499  print_minmax("qc_tend", m_qc_tend_cc, 0);
1500  print_minmax("qi_tend", m_qi_tend_cc, 0);
1501  print_minmax("tke_tend", m_tke_tend_cc, 0);
1502  print_minmax("u_tend", m_u_tend_fc, 0);
1503  print_minmax("v_tend", m_v_tend_fc, 0);
1504  print_minmax("w_sec", m_w_sec_cc, 0);
1505  print_minmax("thl_sec", m_thl_sec_cc, 0);
1506  print_minmax("qw_sec", m_qw_sec_cc, 0);
1507  print_minmax("qwthl_sec", m_qwthl_sec_cc, 0);
1508  print_minmax("wthl_sec", m_wthl_sec_cc, 0);
1509  print_minmax("wqw_sec", m_wqw_sec_cc, 0);
1510  print_minmax("w3", m_w3_cc, 0);
1511  print_minmax("brunt", m_brunt_cc, 0);
1512  print_minmax("isotropy", m_isotropy_cc, 0);
1513  print_minmax("shear_prod", m_shear_prod_cc, 0);
1514  print_minmax("buoy_prod", m_buoy_prod_cc, 0);
1515  print_minmax("diss_tke", m_diss_tke_cc, 0);
1516  print_minmax("cldfrac", m_shoc_cldfrac_cc, 0);
1517  print_minmax("shoc_ql", m_shoc_ql_cc, 0);
1518  print_minmax("shoc_ql2", m_shoc_ql2_cc, 0);
1519  print_minmax("shoc_cond", m_shoc_cond_cc, 0);
1520  print_minmax("wqls_sec", m_wqls_sec_cc, 0);
1521  print_minmax("wthv_sec", m_wthv_sec_cc, 0);
1522 
1523  if (m_hfx3_ptr) print_minmax("hfx3_in", *m_hfx3_ptr, 0);
1524  if (m_qfx3_ptr) print_minmax("qfx3_in", *m_qfx3_ptr, 0);
1525  if (m_tau13_ptr) print_minmax("tau13_in", *m_tau13_ptr, 0);
1526  if (m_tau23_ptr) print_minmax("tau23_in", *m_tau23_ptr, 0);
1527 }
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
435 {
436  if (!m_prev_turb_valid) {
437  return;
438  }
439 
440  const auto carried = m_prev_wthv_sec_cc.const_array(mfi);
441  auto wthv_sec = col.wthv_sec.array();
442  const auto layout = col.layout;
443  const Box xy_box = amrex::makeSlab(mfi.validbox(), 2, layout.kmin);
444 
445  seed_carried_buoyancy_flux_impl(xy_box, layout, carried, wthv_sec);
446 }

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
405 {
406  const auto rho_host = cons.const_array(mfi);
407  const auto carried = m_prev_turb_cc.const_array(mfi);
408  const auto host_diff = eddy_diffs.const_array(mfi);
409  auto tk = col.tk.array();
410  auto tkh = col.tkh.array();
411  const bool prev_turb_valid = m_prev_turb_valid;
412  const auto layout = col.layout;
413  const Box xy_box = amrex::makeSlab(mfi.validbox(), 2, layout.kmin);
414 
415  seed_carried_turbulence_impl(xy_box, layout, rho_host, carried, host_diff,
416  tk, tkh, prev_turb_valid);
417 }

Referenced by advance().

Here is the caller graph for this function:

◆ set_diff_stresses()

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

◆ set_eddy_diffs()

void ShocDriver::set_eddy_diffs ( ) const
781 {
782  BL_PROFILE("SHOC::set_eddy_diffs");
783 
785  m_eddy_diffs_ptr->setVal(0.0, k_shoc_vertical_diff_comp, k_shoc_vertical_diff_count,
786  m_eddy_diffs_ptr->nGrow());
787  MultiFab::Copy(*m_eddy_diffs_ptr, m_eddy_coeffs_cc,
789 
790  if (uses_host_diffusion()) {
791  MultiFab::Copy(*m_eddy_diffs_ptr, m_eddy_coeffs_cc,
792  k_shoc_vertical_diff_comp, k_shoc_vertical_diff_comp,
793  k_shoc_vertical_diff_count, 0);
794  } else if (uses_momentum_host_diffusion()) {
795  MultiFab::Copy(*m_eddy_diffs_ptr, m_eddy_coeffs_cc,
797  }
798 }
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
451 {
452  auto carried = m_prev_wthv_sec_cc.array(mfi);
453  const auto wthv_sec = col.wthv_sec.const_array();
454  const auto layout = col.layout;
455  const Box xy_box = amrex::makeSlab(mfi.validbox(), 2, layout.kmin);
456 
457  store_carried_buoyancy_flux_impl(xy_box, layout, carried, wthv_sec);
458 }

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
422 {
423  auto carried = m_prev_turb_cc.array(mfi);
424  const auto tk = col.tk.const_array();
425  const auto tkh = col.tkh.const_array();
426  const auto layout = col.layout;
427  const Box xy_box = amrex::makeSlab(mfi.validbox(), 2, layout.kmin);
428 
429  store_carried_turbulence_impl(xy_box, layout, carried, tk, tkh);
430 }

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
860 {
862 }
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
878 {
880 }
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
872 {
874 }
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
866 {
868 }
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: