ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_ShocTypes.H File Reference
#include "ERF_DataStruct.H"
#include <AMReX_FArrayBox.H>
#include <AMReX_Geometry.H>
#include <AMReX_GpuQualifiers.H>
#include <AMReX_ParmParse.H>
#include <AMReX_Vector.H>
#include <algorithm>
#include <cctype>
#include <string>
Include dependency graph for ERF_ShocTypes.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ShocRuntimeOptions
 
struct  ShocColumnLayout
 
struct  ShocColumnData
 

Functions

void read_shoc_runtime_options (ShocRuntimeOptions &opts)
 
void validate_shoc_runtime_options (const ShocRuntimeOptions &opts)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool shoc_valid_comp (int comp, int ncomp)
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T shoc_clamp (T value, T lo, T hi)
 

Function Documentation

◆ read_shoc_runtime_options()

void read_shoc_runtime_options ( ShocRuntimeOptions &  opts)
inline
154 {
155  amrex::ParmParse pp("erf.shoc");
156 
157  pp.query("lambda_low", opts.lambda_low);
158  pp.query("lambda_high", opts.lambda_high);
159  pp.query("lambda_slope", opts.lambda_slope);
160  pp.query("lambda_thresh", opts.lambda_thresh);
161  pp.query("thl2tune", opts.thl2tune);
162  pp.query("qw2tune", opts.qw2tune);
163  pp.query("qwthl2tune", opts.qwthl2tune);
164  pp.query("w2tune", opts.w2tune);
165  pp.query("length_fac", opts.length_fac);
166  pp.query("c_diag_3rd_mom", opts.c_diag_3rd_mom);
167  pp.query("coeff_kh", opts.coeff_kh);
168  pp.query("coeff_km", opts.coeff_km);
169  pp.query("top_taper_depth", opts.top_taper_depth);
170  pp.query("top_taper_min_factor", opts.top_taper_min_factor);
171  pp.query("shoc_1p5tke", opts.shoc_1p5tke);
172  pp.query("extra_shoc_diags", opts.extra_shoc_diags);
173  // apply_tms and check_flux_state were options of the EAMxx SHOC, which has been removed;
174  // native SHOC never used them, so a deck that still sets them stops here
175  for (const char* key : {"apply_tms", "check_flux_state"}) {
176  if (pp.contains(key)) {
177  amrex::Abort(std::string("erf.shoc.") + key + " is no longer accepted: it was an option "
178  "of the EAMxx SHOC, which has been removed, and native SHOC does not use it");
179  }
180  }
181  pp.query("column_conservation_check", opts.column_conservation_check);
182  pp.query("debug_summary", opts.debug_summary);
183  pp.query("allow_tendency_microphysics_overlap", opts.allow_tendency_microphysics_overlap);
184  pp.query("signed_tke_production", opts.signed_tke_production);
185  pp.query("debug_bad_column", opts.debug_bad_column);
186  pp.query("debug_bad_column_abort", opts.debug_bad_column_abort);
187  pp.query("debug_bad_column_max_reports", opts.debug_bad_column_max_reports);
188  pp.query("debug_bad_column_theta_tend_threshold", opts.debug_bad_column_theta_tend_threshold);
189  pp.query("debug_bad_column_q_tend_threshold", opts.debug_bad_column_q_tend_threshold);
190  pp.query("debug_bad_column_brunt_threshold", opts.debug_bad_column_brunt_threshold);
191  pp.query("debug_bad_column_min_dz", opts.debug_bad_column_min_dz);
192  pp.query("debug_bad_column_scalar_moment_threshold", opts.debug_bad_column_scalar_moment_threshold);
193  pp.query("debug_disable_pdf_cloud_increment", opts.debug_disable_pdf_cloud_increment);
194  pp.query("debug_disable_theta_state_update", opts.debug_disable_theta_state_update);
195  pp.query("debug_disable_moisture_state_update", opts.debug_disable_moisture_state_update);
196  pp.query("debug_disable_tke_state_update", opts.debug_disable_tke_state_update);
197 
198  // SolverChoice parses these too, since the dycore must know which component
199  // owns vertical diffusion before any SHOC driver exists. Both go through the
200  // same reader so the two views of the inputs cannot diverge.
202 }
ParmParse pp("prob")
void read_shoc_transport_modes(ShocTransportMode &transport_mode, ShocMomentumTransport &momentum_transport)
Read the native SHOC transport modes from the erf.shoc input namespace.
Definition: ERF_ShocTransportStruct.H:118
int debug_bad_column_max_reports
Definition: ERF_ShocTypes.H:45
ShocTransportMode transport_mode
Definition: ERF_ShocTypes.H:41
bool debug_disable_moisture_state_update
Definition: ERF_ShocTypes.H:53
bool shoc_1p5tke
Definition: ERF_ShocTypes.H:35
amrex::Real debug_bad_column_q_tend_threshold
Definition: ERF_ShocTypes.H:47
amrex::Real coeff_kh
Definition: ERF_ShocTypes.H:30
amrex::Real top_taper_depth
Definition: ERF_ShocTypes.H:32
amrex::Real debug_bad_column_scalar_moment_threshold
Definition: ERF_ShocTypes.H:50
amrex::Real lambda_high
Definition: ERF_ShocTypes.H:19
amrex::Real w2tune
Definition: ERF_ShocTypes.H:26
amrex::Real debug_bad_column_min_dz
Definition: ERF_ShocTypes.H:49
amrex::Real qwthl2tune
Definition: ERF_ShocTypes.H:25
bool debug_disable_pdf_cloud_increment
Definition: ERF_ShocTypes.H:51
amrex::Real c_diag_3rd_mom
Definition: ERF_ShocTypes.H:29
ShocMomentumTransport momentum_transport
Definition: ERF_ShocTypes.H:42
bool column_conservation_check
Definition: ERF_ShocTypes.H:37
amrex::Real lambda_thresh
Definition: ERF_ShocTypes.H:21
bool extra_shoc_diags
Definition: ERF_ShocTypes.H:36
amrex::Real coeff_km
Definition: ERF_ShocTypes.H:31
bool debug_disable_theta_state_update
Definition: ERF_ShocTypes.H:52
amrex::Real debug_bad_column_theta_tend_threshold
Definition: ERF_ShocTypes.H:46
amrex::Real lambda_slope
Definition: ERF_ShocTypes.H:20
amrex::Real lambda_low
Definition: ERF_ShocTypes.H:18
bool debug_bad_column
Definition: ERF_ShocTypes.H:43
bool signed_tke_production
Definition: ERF_ShocTypes.H:40
amrex::Real debug_bad_column_brunt_threshold
Definition: ERF_ShocTypes.H:48
bool debug_disable_tke_state_update
Definition: ERF_ShocTypes.H:54
bool debug_bad_column_abort
Definition: ERF_ShocTypes.H:44
bool allow_tendency_microphysics_overlap
Definition: ERF_ShocTypes.H:39
amrex::Real length_fac
Definition: ERF_ShocTypes.H:28
amrex::Real top_taper_min_factor
Definition: ERF_ShocTypes.H:33
amrex::Real thl2tune
Definition: ERF_ShocTypes.H:23
amrex::Real qw2tune
Definition: ERF_ShocTypes.H:24
bool debug_summary
Definition: ERF_ShocTypes.H:38

Referenced by ShocDriver::ShocDriver().

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

◆ shoc_clamp()

◆ shoc_valid_comp()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool shoc_valid_comp ( int  comp,
int  ncomp 
)
235 {
236  return comp >= 0 && comp < ncomp;
237 }

Referenced by erf_detail_ShocDriver::apply_state_update_cons_impl(), and shoc_layout_requires_number_closure().

Here is the caller graph for this function:

◆ validate_shoc_runtime_options()

void validate_shoc_runtime_options ( const ShocRuntimeOptions &  opts)
inline
206 {
207  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(opts.lambda_low > 0.0, "erf.shoc.lambda_low must be positive");
209  "erf.shoc.lambda_high must be >= lambda_low");
210  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(opts.length_fac > 0.0, "erf.shoc.length_fac must be positive");
211  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(opts.coeff_kh >= 0.0, "erf.shoc.coeff_kh must be non-negative");
212  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(opts.coeff_km >= 0.0, "erf.shoc.coeff_km must be non-negative");
214  "erf.shoc.top_taper_depth must be non-negative");
216  opts.top_taper_min_factor <= 1.0,
217  "erf.shoc.top_taper_min_factor must be in [0, 1]");
219  "erf.shoc.debug_bad_column_max_reports must be positive");
221  "erf.shoc.debug_bad_column_theta_tend_threshold must be positive");
223  "erf.shoc.debug_bad_column_q_tend_threshold must be positive");
225  "erf.shoc.debug_bad_column_brunt_threshold must be positive");
227  "erf.shoc.debug_bad_column_min_dz must be positive");
229  "erf.shoc.debug_bad_column_scalar_moment_threshold must be positive");
230 }
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")

Referenced by ShocDriver::ShocDriver().

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