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