ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Plotfile2DUtils.H
Go to the documentation of this file.
1 /**
2  * \file ERF_Plotfile2DUtils.H
3  */
4 #ifndef ERF_PLOTFILE2DUTILS_H_
5 #define ERF_PLOTFILE2DUTILS_H_
6 
7 #include <string>
8 
9 #include <AMReX_GpuQualifiers.H>
10 #include <AMReX_Vector.H>
11 
12 // Narrow helper utilities for 2D plotfile request handling and message
13 // formatting. Keep this layer small: it should support validation and tests,
14 // not become the long-term home for diagnostic science.
15 
16 namespace plotfile2d
17 {
18 
19 // Native SHOC state_update preserves consumed surface fluxes for diagnostics,
20 // but each flux component remains available only if the corresponding host SFS
21 // field existed before SHOC consumed and cleared it.
22 AMREX_FORCE_INLINE
23 bool use_native_shoc_consumed_flux_source (bool native_shoc_owns_scalar_fluxes,
24  bool native_shoc_has_consumed_flux_diagnostics,
25  bool host_flux_field_available) noexcept
26 {
27  return native_shoc_owns_scalar_fluxes &&
28  native_shoc_has_consumed_flux_diagnostics &&
29  host_flux_field_available;
30 }
31 
33 {
34  amrex::Vector<std::string> accepted;
35  amrex::Vector<std::string> unavailable;
36 };
37 
38 PlotVariableSelection select_requested_plot_variables (const amrex::Vector<std::string>& requested,
39  const amrex::Vector<std::string>& available);
40 
41 std::string format_unavailable_2d_plot_var_warning (const std::string& parameter_name,
42  const std::string& unavailable_name,
43  const amrex::Vector<std::string>& available_names);
44 
45 std::string format_plot2d_parameter_name (const std::string& pp_prefix,
46  const std::string& parameter_name);
47 
48 std::string format_2d_component_count_error (int lev, int filled, int expected);
49 
50 std::string format_invalid_2d_stream_error (int which);
51 
52 } // namespace plotfile2d
53 
54 #endif
Definition: ERF_Plotfile2DCatalog.cpp:10
std::string format_plot2d_parameter_name(const std::string &pp_prefix, const std::string &parameter_name)
Definition: ERF_Plotfile2DUtils.cpp:78
std::string format_invalid_2d_stream_error(int which)
Definition: ERF_Plotfile2DUtils.cpp:100
PlotVariableSelection select_requested_plot_variables(const amrex::Vector< std::string > &requested, const amrex::Vector< std::string > &available)
Definition: ERF_Plotfile2DUtils.cpp:34
std::string format_unavailable_2d_plot_var_warning(const std::string &parameter_name, const std::string &unavailable_name, const amrex::Vector< std::string > &available_names)
Definition: ERF_Plotfile2DUtils.cpp:65
std::string format_2d_component_count_error(int lev, int filled, int expected)
Definition: ERF_Plotfile2DUtils.cpp:89
AMREX_FORCE_INLINE bool use_native_shoc_consumed_flux_source(bool native_shoc_owns_scalar_fluxes, bool native_shoc_has_consumed_flux_diagnostics, bool host_flux_field_available) noexcept
Definition: ERF_Plotfile2DUtils.H:23
Definition: ERF_Plotfile2DUtils.H:33
amrex::Vector< std::string > accepted
Definition: ERF_Plotfile2DUtils.H:34
amrex::Vector< std::string > unavailable
Definition: ERF_Plotfile2DUtils.H:35