ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Plotfile2DWaterPath.H
Go to the documentation of this file.
1 /**
2  * \file ERF_Plotfile2DWaterPath.H
3  */
4 #ifndef ERF_PLOTFILE2DWATERPATH_H_
5 #define ERF_PLOTFILE2DWATERPATH_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"
15 
16 // Scheme-aware helpers for 2D column water-path diagnostics. This module maps
17 // active moisture species to conserved ERF state components and reduces those
18 // components over k. It does not define microphysics species. It uses
19 // solverChoice.moisture_indices as the source of truth.
20 
21 namespace plotfile2d
22 {
23 
24 static constexpr int MaxCondensedWaterPathComponents = 5;
25 
27 {
29  const char* name;
31 };
32 
34 {
35  int n = 0;
36  amrex::GpuArray<int, MaxCondensedWaterPathComponents> dst_comp{};
37  amrex::GpuArray<int, MaxCondensedWaterPathComponents> src_comp{};
38 };
39 
40 // A species is available when the active moisture model exposes a conserved
41 // mass component for it. Number concentrations are not water paths.
42 amrex::Vector<WaterPathDescriptor>
44 
45 bool is_condensed_water_path (DiagnosticID id) noexcept;
46 
47 bool is_condensed_water_path_name (const std::string& name);
48 
49 amrex::Vector<std::string>
50 available_diagnostic_names (const SolverChoice& solver_choice);
51 
52 // Include the fields supplied by the active land-surface provider and the
53 // unified near-surface fields that have a possible source in this run.
54 amrex::Vector<std::string>
55 available_diagnostic_names (const SolverChoice& solver_choice,
56  bool has_surface_layer);
57 
58 amrex::Vector<std::string>
59 available_diagnostic_names (const SolverChoice& solver_choice,
60  bool has_surface_layer,
61  const amrex::Vector<std::string>& active_lsm_names);
62 
63 SelectedWaterPathComponents
64 selected_condensed_water_path_components (const amrex::Vector<std::string>& plot_var_names,
65  const SolverChoice& solver_choice);
66 
67 // This mirrors volWgtColumnSum() for several selected condensed species in one
68 // pass. The source components are already rho*q, so the reduction gives kg/m^2
69 // after multiplication by dz.
70 void fill_condensed_water_paths (amrex::MultiFab& dst,
71  const amrex::MultiFab& cons,
72  const SelectedWaterPathComponents& selected,
73  const amrex::Geometry& geom,
74  const amrex::MultiFab& detJ);
75 
76 } // namespace plotfile2d
77 
78 #endif
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:101
@ cons
Definition: ERF_IndexDefines.H:176
Definition: ERF_Plotfile2DCatalog.cpp:10
amrex::Vector< WaterPathDescriptor > active_condensed_water_path_descriptors(const SolverChoice &solver_choice)
Definition: ERF_Plotfile2DWaterPath.cpp:68
DiagnosticID
Definition: ERF_Plotfile2DCatalog.H:15
bool is_condensed_water_path(DiagnosticID id) noexcept
Definition: ERF_Plotfile2DWaterPath.cpp:53
static constexpr int MaxCondensedWaterPathComponents
Definition: ERF_Plotfile2DWaterPath.H:24
void fill_condensed_water_paths(MultiFab &dst, const MultiFab &cons, const SelectedWaterPathComponents &selected, const Geometry &geom, const MultiFab &detJ)
Definition: ERF_Plotfile2DWaterPath.cpp:239
bool is_condensed_water_path_name(const std::string &name)
Definition: ERF_Plotfile2DWaterPath.cpp:84
amrex::Vector< std::string > available_diagnostic_names(const SolverChoice &solver_choice)
Definition: ERF_Plotfile2DWaterPath.cpp:142
SelectedWaterPathComponents selected_condensed_water_path_components(const amrex::Vector< std::string > &plot_var_names, const SolverChoice &solver_choice)
Definition: ERF_Plotfile2DWaterPath.cpp:214
Definition: ERF_DataStruct.H:241
Definition: ERF_Plotfile2DWaterPath.H:34
amrex::GpuArray< int, MaxCondensedWaterPathComponents > dst_comp
Definition: ERF_Plotfile2DWaterPath.H:36
int n
Definition: ERF_Plotfile2DWaterPath.H:35
amrex::GpuArray< int, MaxCondensedWaterPathComponents > src_comp
Definition: ERF_Plotfile2DWaterPath.H:37
Definition: ERF_Plotfile2DWaterPath.H:27
DiagnosticID id
Definition: ERF_Plotfile2DWaterPath.H:28
int source_component
Definition: ERF_Plotfile2DWaterPath.H:30
const char * name
Definition: ERF_Plotfile2DWaterPath.H:29