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