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