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