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

#include <ERF_ShocEnergyFixer.H>

Static Public Member Functions

static int diagnose_active_top (const amrex::Vector< amrex::Real > &tke)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE int diagnose_active_top (const amrex::Array4< const amrex::Real > &tke, int ic, int nlev) noexcept
 
static void apply_column (const ShocColumnData &col, int ic, amrex::Real dt, const amrex::Vector< amrex::Real > &thl_old, const amrex::Vector< amrex::Real > &qv_old, const amrex::Vector< amrex::Real > &qc_old, const amrex::Vector< amrex::Real > &qi_old, const amrex::Vector< amrex::Real > &u_old, const amrex::Vector< amrex::Real > &v_old, const amrex::Vector< amrex::Real > &tke_old, amrex::Vector< amrex::Real > &thl_new, const amrex::Vector< amrex::Real > &qv_new, const amrex::Vector< amrex::Real > &qc_new, const amrex::Vector< amrex::Real > &qi_new, const amrex::Vector< amrex::Real > &u_new, const amrex::Vector< amrex::Real > &v_new, const amrex::Vector< amrex::Real > &tke_new)
 

Member Function Documentation

◆ apply_column()

void ShocEnergyFixer::apply_column ( const ShocColumnData col,
int  ic,
amrex::Real  dt,
const amrex::Vector< amrex::Real > &  thl_old,
const amrex::Vector< amrex::Real > &  qv_old,
const amrex::Vector< amrex::Real > &  qc_old,
const amrex::Vector< amrex::Real > &  qi_old,
const amrex::Vector< amrex::Real > &  u_old,
const amrex::Vector< amrex::Real > &  v_old,
const amrex::Vector< amrex::Real > &  tke_old,
amrex::Vector< amrex::Real > &  thl_new,
const amrex::Vector< amrex::Real > &  qv_new,
const amrex::Vector< amrex::Real > &  qc_new,
const amrex::Vector< amrex::Real > &  qi_new,
const amrex::Vector< amrex::Real > &  u_new,
const amrex::Vector< amrex::Real > &  v_new,
const amrex::Vector< amrex::Real > &  tke_new 
)
static
36 {
38  define_shoc_column_data(tmp, col.layout, amrex::The_Arena(), shoc::InitRunOn::Host);
39 
40  auto rho = tmp.rho.array();
41  auto dz = tmp.dz.array();
42  auto zt = tmp.zt.array();
43  auto exner = tmp.exner.array();
44  auto surf_sens_flux = tmp.surf_sens_flux.array();
45  auto surf_lat_flux = tmp.surf_lat_flux.array();
46  auto thetal_base = tmp.thetal_base.array();
47  auto qv_base = tmp.qv_base.array();
48  auto qc_base = tmp.qc_base.array();
49  auto qi_base = tmp.qi_base.array();
50  auto u_base = tmp.u_base.array();
51  auto v_base = tmp.v_base.array();
52  auto tke_base = tmp.tke_base_state.array();
53  auto thetal = tmp.thetal.array();
54  auto qw = tmp.qw.array();
55  auto u = tmp.u.array();
56  auto v = tmp.v.array();
57  auto tke = tmp.tke.array();
58  auto shoc_ql = tmp.shoc_ql.array();
59 
60  const auto rho_in = col.rho.const_array();
61  const auto dz_in = col.dz.const_array();
62  const auto zt_in = col.zt.const_array();
63  const auto exner_in = col.exner.const_array();
64  const auto surf_sens_flux_in = col.surf_sens_flux.const_array();
65  const auto surf_lat_flux_in = col.surf_lat_flux.const_array();
66 
67  for (int k = 0; k < col.layout.nlev; ++k) {
68  rho(ic,k,0) = rho_in(ic,k,0);
69  dz(ic,k,0) = dz_in(ic,k,0);
70  zt(ic,k,0) = zt_in(ic,k,0);
71  exner(ic,k,0) = exner_in(ic,k,0);
72  thetal_base(ic,k,0) = thl_old[k];
73  qv_base(ic,k,0) = qv_old[k];
74  qc_base(ic,k,0) = qc_old[k];
75  qi_base(ic,k,0) = qi_old[k];
76  u_base(ic,k,0) = u_old[k];
77  v_base(ic,k,0) = v_old[k];
78  tke_base(ic,k,0) = tke_old[k];
79  thetal(ic,k,0) = thl_new[k];
80  qw(ic,k,0) = qv_new[k] + qc_new[k] + qi_new[k];
81  u(ic,k,0) = u_new[k];
82  v(ic,k,0) = v_new[k];
83  tke(ic,k,0) = tke_new[k];
84  shoc_ql(ic,k,0) = qc_new[k] + qi_new[k];
85  }
86 
87  surf_sens_flux(ic,0,0) = surf_sens_flux_in(ic,0,0);
88  surf_lat_flux(ic,0,0) = surf_lat_flux_in(ic,0,0);
89 
91 
92  const auto thetal_out = tmp.thetal.const_array();
93  for (int k = 0; k < col.layout.nlev; ++k) {
94  thl_new[k] = thetal_out(ic,k,0);
95  }
96 }
rho
Definition: ERF_InitCustomPert_Bubble.H:106
void define_shoc_column_data(ShocColumnData &col, const ShocColumnLayout &layout, amrex::Arena *arena=amrex::The_Async_Arena(), shoc::InitRunOn init_run_on=shoc::default_init_run_on())
Definition: ERF_ShocColumnData.H:54
@ tmp
Definition: ERF_AdvanceWSM6.cpp:114
@ dz
Definition: ERF_AdvanceWSM6.cpp:104
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void apply_energy_fix_column(const ShocEnergyFixerView &v, int ic, amrex::Real dt) noexcept
Definition: ERF_ShocEnergyFixer.H:84
ShocEnergyFixerView make_energy_fixer_view(ShocColumnData &col)
Definition: ERF_ShocEnergyFixer.H:40
Definition: ERF_ShocTypes.H:204
amrex::FArrayBox dz
Definition: ERF_ShocTypes.H:210
amrex::FArrayBox surf_lat_flux
Definition: ERF_ShocTypes.H:277
amrex::FArrayBox rho
Definition: ERF_ShocTypes.H:213
amrex::FArrayBox exner
Definition: ERF_ShocTypes.H:215
ShocColumnLayout layout
Definition: ERF_ShocTypes.H:205
amrex::FArrayBox surf_sens_flux
Definition: ERF_ShocTypes.H:276
amrex::FArrayBox zt
Definition: ERF_ShocTypes.H:208
int nlev
Definition: ERF_ShocTypes.H:196
Here is the call graph for this function:

◆ diagnose_active_top() [1/2]

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE int ShocEnergyFixer::diagnose_active_top ( const amrex::Array4< const amrex::Real > &  tke,
int  ic,
int  nlev 
)
inlinestaticnoexcept
148  {
149  return shoc::diagnose_active_top(tke, ic, nlev);
150  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int diagnose_active_top(const amrex::Array4< const amrex::Real > &tke, int ic, int nlev) noexcept
Definition: ERF_ShocEnergyFixer.H:68
Here is the call graph for this function:

◆ diagnose_active_top() [2/2]

static int ShocEnergyFixer::diagnose_active_top ( const amrex::Vector< amrex::Real > &  tke)
static

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