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 scheme-aware condensed
21 // water-path diagnostics, need separate helpers because they reduce over k
22 // rather than copying one k level. Future pressure-surface diagnostics need
23 // interpolation-specific helpers.
24 
25 namespace plotfile2d
26 {
27 
28 // Fill one destination component with a scalar value. Used for documented
29 // missing values and zero fills.
30 void fill_component_with_value (amrex::MultiFab& dst,
31  int dst_comp,
33 
34 // Copy one source component at one source k level into one 2D destination
35 // component. The caller owns source selection and chooses src_k.
36 void fill_component_from_klevel (amrex::MultiFab& dst,
37  int dst_comp,
38  const amrex::MultiFab& src,
39  int src_k,
40  int src_comp = 0);
41 
42 // Copy from src when present; otherwise fill the destination component with the
43 // documented missing value. This keeps optional diagnostics branch-local in the
44 // writer.
45 void fill_component_from_klevel_or_value (amrex::MultiFab& dst,
46  int dst_comp,
47  const amrex::MultiFab* src,
48  int src_k,
49  amrex::Real missing_value,
50  int src_comp = 0);
51 
52 // Noah-MP and other land-surface providers use internal sentinels that must
53 // not enter a public plotfile. Valid zero and negative physical values pass
54 // through unchanged.
56  int dst_comp,
57  const amrex::MultiFab* src,
58  int src_k,
59  amrex::Real missing_value);
60 
61 // Convert the selected conservative sensible-flux source to W m^-2 for the
62 // public sensible_heat_flux diagnostic. Unit semantics remain in
63 // surface_flux_diagnostics.
65  int dst_comp,
66  const amrex::MultiFab* src,
67  int src_k,
68  amrex::Real missing_value);
69 
70 // Convert the selected conservative moisture-flux source to W m^-2 for the
71 // public latent_heat_flux diagnostic. Unit semantics remain in
72 // surface_flux_diagnostics.
74  int dst_comp,
75  const amrex::MultiFab* src,
76  int src_k,
77  amrex::Real missing_value);
78 
79 } // namespace plotfile2d
80 
81 #endif
Real value
Definition: ERF_HurricaneDiagnostics.cpp:30
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_Plotfile2DCatalog.cpp:7
void fill_component_from_klevel(MultiFab &dst, int dst_comp, const MultiFab &src, int src_k, int src_comp)
Definition: ERF_Plotfile2DFill.cpp:35
void fill_component_with_value(MultiFab &dst, int dst_comp, Real value)
Definition: ERF_Plotfile2DFill.cpp:29
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:103
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:75
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:60
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:134