ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Plotfile2DMetadata.H
Go to the documentation of this file.
1 #ifndef ERF_PLOTFILE2DMETADATA_H_
2 #define ERF_PLOTFILE2DMETADATA_H_
3 
4 #include <string>
5 
6 #include <AMReX_Vector.H>
7 
10 
11 // Utilities for writing machine-readable metadata for native AMReX 2D
12 // plotfiles. This layer formats the existing 2D diagnostic catalog. It must not
13 // compute diagnostics or duplicate diagnostic metadata strings.
14 
15 namespace plotfile2d
16 {
17 
18 const char* diagnostic_category_to_string (DiagnosticCategory category) noexcept;
19 const char* missing_policy_to_string (MissingPolicy policy) noexcept;
20 
21 std::string missing_value_json (MissingPolicy policy);
22 
23 std::string escape_json_string (const std::string& value);
24 
25 std::string format_2d_metadata_json (const amrex::Vector<Plotfile2DOutputDescriptor>& descriptors);
26 std::string format_2d_metadata_json (const amrex::Vector<std::string>& varnames);
27 
28 std::string metadata_json_filename (const std::string& plotfilename);
29 
30 void write_2d_metadata_json (const std::string& plotfilename,
31  const amrex::Vector<Plotfile2DOutputDescriptor>& descriptors);
32 
33 void write_2d_metadata_json (const std::string& plotfilename,
34  const amrex::Vector<std::string>& varnames);
35 
36 } // namespace plotfile2d
37 
38 #endif
Real value
Definition: ERF_HurricaneDiagnostics.cpp:30
Definition: ERF_Plotfile2DCatalog.cpp:7
const char * diagnostic_category_to_string(DiagnosticCategory category) noexcept
Definition: ERF_Plotfile2DMetadata.cpp:97
std::string escape_json_string(const std::string &value)
Definition: ERF_Plotfile2DMetadata.cpp:143
void write_2d_metadata_json(const std::string &plotfilename, const amrex::Vector< std::string > &varnames)
Definition: ERF_Plotfile2DMetadata.cpp:229
DiagnosticCategory
Definition: ERF_Plotfile2DCatalog.H:81
const char * missing_policy_to_string(MissingPolicy policy) noexcept
Definition: ERF_Plotfile2DMetadata.cpp:117
std::string missing_value_json(MissingPolicy policy)
Definition: ERF_Plotfile2DMetadata.cpp:130
MissingPolicy
Definition: ERF_Plotfile2DCatalog.H:95
std::string format_2d_metadata_json(const amrex::Vector< std::string > &varnames)
Definition: ERF_Plotfile2DMetadata.cpp:175
std::string metadata_json_filename(const std::string &plotfilename)
Definition: ERF_Plotfile2DMetadata.cpp:169