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