ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Plotfile2DFill.H
Go to the documentation of this file.
1 #ifndef ERF_PLOTFILE2DFILL_H_
2 #define ERF_PLOTFILE2DFILL_H_
3 
4 #include <AMReX_MultiFab.H>
5 #include <AMReX_REAL.H>
6 
7 // Mechanical fill helpers for ERF 2D plotfile assembly. These helpers copy,
8 // fill, and convert existing diagnostic sources into output components.
9 //
10 // Preconditions:
11 // - dst is the already-allocated 2D plotfile MultiFab for one AMR level.
12 // - source MultiFabs use a compatible BoxArray/DistributionMapping layout.
13 // - src_k is interpreted in the source MultiFab's vertical index space.
14 //
15 // Non-goals:
16 // - Do not add diagnostic science here.
17 // - Do not encode runtime source selection here.
18 // - Do not use this layer as a registry for all future diagnostics.
19 //
20 // Column reductions, such as integrated_qv and future LWP/IWP diagnostics, need
21 // separate helpers because they reduce over k rather than copying one k level.
22 // Future pressure-surface diagnostics need interpolation-specific helpers.
23 
24 namespace plotfile2d
25 {
26 
27 // Fill one destination component with a scalar value. Used for documented
28 // missing values and zero fills.
29 void fill_component_with_value (amrex::MultiFab& dst,
30  int dst_comp,
32 
33 // Copy one source component at one source k level into one 2D destination
34 // component. The caller owns source selection and chooses src_k.
35 void fill_component_from_klevel (amrex::MultiFab& dst,
36  int dst_comp,
37  const amrex::MultiFab& src,
38  int src_k,
39  int src_comp = 0);
40 
41 // Copy from src when present; otherwise fill the destination component with the
42 // documented missing value. This keeps optional diagnostics branch-local in the
43 // writer.
44 void fill_component_from_klevel_or_value (amrex::MultiFab& dst,
45  int dst_comp,
46  const amrex::MultiFab* src,
47  int src_k,
48  amrex::Real missing_value,
49  int src_comp = 0);
50 
51 // Convert the selected conservative sensible-flux source to W m^-2 for the
52 // public sensible_heat_flux diagnostic. Unit semantics remain in
53 // surface_flux_diagnostics.
55  int dst_comp,
56  const amrex::MultiFab* src,
57  int src_k,
58  amrex::Real missing_value);
59 
60 // Convert the selected conservative moisture-flux source to W m^-2 for the
61 // public latent_heat_flux diagnostic. Unit semantics remain in
62 // surface_flux_diagnostics.
64  int dst_comp,
65  const amrex::MultiFab* src,
66  int src_k,
67  amrex::Real missing_value);
68 
69 } // namespace plotfile2d
70 
71 #endif
amrex::Real value
Definition: ERF_HurricaneDiagnostics.H:20
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_Plotfile2DCatalog.cpp:4
void fill_component_from_klevel(MultiFab &dst, int dst_comp, const MultiFab &src, int src_k, int src_comp)
Definition: ERF_Plotfile2DFill.cpp:19
void fill_component_with_value(MultiFab &dst, int dst_comp, Real value)
Definition: ERF_Plotfile2DFill.cpp:13
void fill_sensible_heat_flux_from_klevel_or_missing(MultiFab &dst, int dst_comp, const MultiFab *src, int src_k, Real missing_value)
Definition: ERF_Plotfile2DFill.cpp:59
void fill_component_from_klevel_or_value(MultiFab &dst, int dst_comp, const MultiFab *src, int src_k, Real missing_value, int src_comp)
Definition: ERF_Plotfile2DFill.cpp:44
void fill_latent_heat_flux_from_klevel_or_missing(MultiFab &dst, int dst_comp, const MultiFab *src, int src_k, Real missing_value)
Definition: ERF_Plotfile2DFill.cpp:90