ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Plotfile2DPrecip.H
Go to the documentation of this file.
1 #ifndef ERF_PLOTFILE2DPRECIP_H_
2 #define ERF_PLOTFILE2DPRECIP_H_
3 
4 #include <string>
5 
6 #include <AMReX_GpuQualifiers.H>
7 #include <AMReX_MultiFab.H>
8 #include <AMReX_Vector.H>
9 
10 #include "ERF_DataStruct.H"
11 #include "ERF_Plotfile2DCatalog.H"
13 
14 // Scheme-aware helpers for 2D surface precipitation accumulation diagnostics.
15 // The output layer normalizes scheme-native precipitation accumulators to the
16 // public liquid-water-equivalent kg/m^2 basis before writing plotfile slabs.
17 // Some schemes provide explicit rain/snow/graupel sources, while others
18 // provide a total source plus frozen subsets. The helper layer preserves both
19 // contracts and derives the public fields without double-counting.
20 
21 namespace plotfile2d
22 {
23 
24 static constexpr int MaxSurfacePrecipAccumulationComponents = 6;
25 
27 {
28  int n = 0;
29  amrex::GpuArray<int, MaxSurfacePrecipAccumulationComponents> dst_comp{};
30  amrex::GpuArray<DiagnosticID, MaxSurfacePrecipAccumulationComponents> id{};
31 };
32 
34 
35 bool is_precipitation_accumulation_name (const std::string& name);
36 
38  const MoistureComponentIndices& moisture_indices) noexcept;
39 
40 SelectedSurfacePrecipAccumulationComponents
41 selected_precipitation_accumulation_components (const amrex::Vector<std::string>& plot_var_names,
42  const SurfacePrecipAccumulationSources& sources);
43 
44 void fill_precipitation_accumulations (amrex::MultiFab& dst,
45  const SurfacePrecipAccumulationSources& sources,
47  const int klo);
48 
49 } // namespace plotfile2d
50 
51 #endif
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:97
Definition: ERF_Plotfile2DCatalog.cpp:7
bool is_precipitation_accumulation(DiagnosticID id) noexcept
Definition: ERF_Plotfile2DPrecip.cpp:49
DiagnosticID
Definition: ERF_Plotfile2DCatalog.H:12
static constexpr int MaxSurfacePrecipAccumulationComponents
Definition: ERF_Plotfile2DPrecip.H:24
bool is_precipitation_accumulation_name(const std::string &name)
Definition: ERF_Plotfile2DPrecip.cpp:65
bool precipitation_diagnostic_available(DiagnosticID id, const MoistureComponentIndices &moisture_indices) noexcept
Definition: ERF_Plotfile2DPrecip.cpp:72
SelectedSurfacePrecipAccumulationComponents selected_precipitation_accumulation_components(const amrex::Vector< std::string > &plot_var_names, const SurfacePrecipAccumulationSources &sources)
Definition: ERF_Plotfile2DPrecip.cpp:95
void fill_precipitation_accumulations(MultiFab &dst, const SurfacePrecipAccumulationSources &sources, const SelectedSurfacePrecipAccumulationComponents &selected, const int klo)
Definition: ERF_Plotfile2DPrecip.cpp:137
Definition: ERF_DataStruct.H:106
Definition: ERF_SurfacePrecipitation.H:21
Definition: ERF_Plotfile2DPrecip.H:27
amrex::GpuArray< int, MaxSurfacePrecipAccumulationComponents > dst_comp
Definition: ERF_Plotfile2DPrecip.H:29
int n
Definition: ERF_Plotfile2DPrecip.H:28