ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Plotfile2DSampledLevel.H
Go to the documentation of this file.
1 /**
2  * \file ERF_Plotfile2DSampledLevel.H
3  */
4 #ifndef ERF_PLOTFILE2DSAMPLED_LEVEL_H_
5 #define ERF_PLOTFILE2DSAMPLED_LEVEL_H_
6 
7 #include <optional>
8 #include <string>
9 
10 #include <AMReX_ParmParse.H>
11 #include <AMReX_REAL.H>
12 #include <AMReX_Vector.H>
13 
14 #include "ERF_Plotfile2DCatalog.H"
16 
17 // User-facing sampled-level definitions for ERF 2D plotfiles. A level set
18 // names a vertical coordinate, target values, and fields to sample. This module
19 // parses and validates those definitions. It does not interpolate fields.
20 
21 namespace plotfile2d
22 {
23 
25 {
26  ModelIndex,
27  HeightMSL,
28  HeightAGL,
29  Pressure
30 };
31 
33 {
34  None,
35  Linear
36 };
37 
39 {
40  std::string type;
42  std::string units;
44  std::string canonical_units;
45  std::string interpolation;
46 };
47 
49 {
50  std::string level_set_name;
51  std::string source_field;
53 };
54 
56 {
57  std::string name;
58  std::string long_name;
59  std::string units;
64  std::optional<SampledLevelMetadata> sampled_level;
65 };
66 
68 {
69  std::string name;
71  std::string units;
72  amrex::Vector<amrex::Real> values;
73  amrex::Vector<std::string> fields;
76 };
77 
78 const char* sampled_coordinate_to_string (SampledCoordinate coordinate) noexcept;
79 const char* sampled_coordinate_tag (SampledCoordinate coordinate) noexcept;
80 const char* sampled_coordinate_default_units (SampledCoordinate coordinate) noexcept;
81 const char* sampled_coordinate_default_interpolation (SampledCoordinate coordinate) noexcept;
82 
83 const char* sampled_interpolation_to_string (SampledInterpolation interpolation) noexcept;
86 std::string validate_sampled_coordinate_string (const std::string& level_set_name,
87  const std::string& value);
88 
89 std::string sampled_level_error_prefix (const std::string& level_set_name,
90  const std::string& parameter_name);
91 
92 std::string sampled_level_value_tag (amrex::Real value, const std::string& units);
93 std::string sampled_output_name (const std::string& field_name,
94  SampledCoordinate coordinate,
96  const std::string& units);
97 
98 std::string validate_sampled_level_definition (const SampledLevelDefinition& level_set);
99 
100 SampledLevelDefinition parse_sampled_level_definition (const std::string& level_set_name,
101  const std::string& pp_prefix);
102 
103 amrex::Vector<std::string> parse_requested_sampled_level_sets (const std::string& pp_prefix,
104  int which);
105 
106 amrex::Vector<Plotfile2DOutputDescriptor> build_sampled_level_output_descriptors_from_definitions (
107  const amrex::Vector<SampledLevelDefinition>& level_sets,
108  const amrex::Vector<std::string>& static_plot_vars,
109  const SolverChoice& solver_choice);
110 
111 amrex::Vector<Plotfile2DOutputDescriptor> build_sampled_level_output_descriptors (
112  const std::string& pp_prefix,
113  int which,
114  const amrex::Vector<std::string>& static_plot_vars,
115  const SolverChoice& solver_choice);
116 
117 } // namespace plotfile2d
118 
119 #endif
Real value
Definition: ERF_HurricaneDiagnostics.cpp:30
std::string units
Definition: ERF_Plotfile2DCatalog.cpp:103
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_Plotfile2DCatalog.cpp:10
std::string validate_sampled_coordinate_string(const std::string &level_set_name, const std::string &value)
Definition: ERF_Plotfile2DSampledLevel.cpp:199
SampledCoordinate sampled_coordinate_from_string(const std::string &value)
Definition: ERF_Plotfile2DSampledLevel.cpp:165
SampledInterpolation
Definition: ERF_Plotfile2DSampledLevel.H:33
SampledCoordinate
Definition: ERF_Plotfile2DSampledLevel.H:25
SampledLevelDefinition parse_sampled_level_definition(const std::string &level_set_name, const std::string &pp_prefix)
Definition: ERF_Plotfile2DSampledLevel.cpp:311
const char * sampled_coordinate_tag(SampledCoordinate coordinate) noexcept
Definition: ERF_Plotfile2DSampledLevel.cpp:131
std::string validate_sampled_level_definition(const SampledLevelDefinition &level_set)
Definition: ERF_Plotfile2DSampledLevel.cpp:250
DiagnosticCategory
Definition: ERF_Plotfile2DCatalog.H:85
amrex::Vector< std::string > parse_requested_sampled_level_sets(const std::string &pp_prefix, int which)
Definition: ERF_Plotfile2DSampledLevel.cpp:370
SampledInterpolation sampled_interpolation_from_string(const std::string &value)
Definition: ERF_Plotfile2DSampledLevel.cpp:185
const char * sampled_coordinate_to_string(SampledCoordinate coordinate) noexcept
Definition: ERF_Plotfile2DSampledLevel.cpp:119
amrex::Vector< Plotfile2DOutputDescriptor > build_sampled_level_output_descriptors(const std::string &pp_prefix, int which, const amrex::Vector< std::string > &static_plot_vars, const SolverChoice &solver_choice)
Definition: ERF_Plotfile2DSampledLevel.cpp:491
MissingPolicy
Definition: ERF_Plotfile2DCatalog.H:99
const char * sampled_interpolation_to_string(SampledInterpolation interpolation) noexcept
Definition: ERF_Plotfile2DSampledLevel.cpp:155
const char * sampled_coordinate_default_units(SampledCoordinate coordinate) noexcept
Definition: ERF_Plotfile2DSampledLevel.cpp:143
std::string sampled_level_value_tag(amrex::Real value, const std::string &units)
Definition: ERF_Plotfile2DSampledLevel.cpp:228
amrex::Vector< Plotfile2DOutputDescriptor > build_sampled_level_output_descriptors_from_definitions(const amrex::Vector< SampledLevelDefinition > &level_sets, const amrex::Vector< std::string > &static_plot_vars, const SolverChoice &solver_choice)
Definition: ERF_Plotfile2DSampledLevel.cpp:388
const char * sampled_coordinate_default_interpolation(SampledCoordinate coordinate) noexcept
Definition: ERF_Plotfile2DSampledLevel.cpp:149
std::string sampled_output_name(const std::string &field_name, SampledCoordinate coordinate, amrex::Real value, const std::string &units)
Definition: ERF_Plotfile2DSampledLevel.cpp:238
std::string sampled_level_error_prefix(const std::string &level_set_name, const std::string &parameter_name)
Definition: ERF_Plotfile2DSampledLevel.cpp:218
Definition: ERF_DataStruct.H:241
Definition: ERF_Plotfile2DCatalog.H:106
Definition: ERF_Plotfile2DSampledLevel.H:56
std::string units
Definition: ERF_Plotfile2DSampledLevel.H:59
DiagnosticCategory category
Definition: ERF_Plotfile2DSampledLevel.H:60
std::optional< SampledLevelMetadata > sampled_level
Definition: ERF_Plotfile2DSampledLevel.H:64
amrex::Real missing_value
Definition: ERF_Plotfile2DSampledLevel.H:62
MissingPolicy missing_policy
Definition: ERF_Plotfile2DSampledLevel.H:61
std::string name
Definition: ERF_Plotfile2DSampledLevel.H:57
const DiagnosticDescriptor * static_diagnostic
Definition: ERF_Plotfile2DSampledLevel.H:63
std::string long_name
Definition: ERF_Plotfile2DSampledLevel.H:58
Definition: ERF_Plotfile2DSampledLevel.H:68
amrex::Vector< std::string > fields
Definition: ERF_Plotfile2DSampledLevel.H:73
SampledCoordinate coordinate
Definition: ERF_Plotfile2DSampledLevel.H:70
SampledInterpolation interpolation
Definition: ERF_Plotfile2DSampledLevel.H:74
std::string name
Definition: ERF_Plotfile2DSampledLevel.H:69
amrex::Real missing_value
Definition: ERF_Plotfile2DSampledLevel.H:75
amrex::Vector< amrex::Real > values
Definition: ERF_Plotfile2DSampledLevel.H:72
std::string units
Definition: ERF_Plotfile2DSampledLevel.H:71
Definition: ERF_Plotfile2DSampledLevel.H:49
std::string source_field
Definition: ERF_Plotfile2DSampledLevel.H:51
std::string level_set_name
Definition: ERF_Plotfile2DSampledLevel.H:50
SampledVerticalCoordinateMetadata vertical_coordinate
Definition: ERF_Plotfile2DSampledLevel.H:52
Definition: ERF_Plotfile2DSampledLevel.H:39
amrex::Real canonical_value
Definition: ERF_Plotfile2DSampledLevel.H:43
std::string units
Definition: ERF_Plotfile2DSampledLevel.H:42
std::string interpolation
Definition: ERF_Plotfile2DSampledLevel.H:45
std::string canonical_units
Definition: ERF_Plotfile2DSampledLevel.H:44
std::string type
Definition: ERF_Plotfile2DSampledLevel.H:40
amrex::Real value
Definition: ERF_Plotfile2DSampledLevel.H:41