ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_SurfaceFluxDiagnostics.H
Go to the documentation of this file.
1 #ifndef ERF_SURFACE_FLUX_DIAGNOSTICS_H_
2 #define ERF_SURFACE_FLUX_DIAGNOSTICS_H_
3 
4 #include <AMReX_GpuQualifiers.H>
5 #include <AMReX_REAL.H>
6 
7 #include "ERF_Constants.H"
8 
10 {
11 
12 /**
13  * Convert applied conservative surface fluxes to W m^-2 for 2D plotfile output.
14  *
15  * `SFS_hfx3` and `SFS_q1fx3` are already conservative applied fluxes. Noah-MP
16  * LSM kinematic fluxes are converted to conservative fluxes in
17  * `SurfaceLayer::compute_SurfaceLayer_bcs`, so this layer must not multiply by
18  * density. The output sign convention follows ERF's lower-boundary flux
19  * convention. These helpers exist so the 2D writer does not duplicate unit
20  * semantics.
21  *
22  * Maintenance note:
23  * Do not add source-specific Noah-MP/MOST branches here. If this helper ever
24  * appears to need a density factor, the applied SurfaceLayer flux contract has
25  * likely been broken upstream.
26  */
27 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
30 {
31  return Cp_d * rhotheta_flux;
32 }
33 
34 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
37 {
38  return L_v * rhoqv_flux;
39 }
40 
41 } // namespace surface_flux_diagnostics
42 
43 #endif
constexpr amrex::Real Cp_d
Definition: ERF_Constants.H:44
constexpr amrex::Real L_v
Definition: ERF_Constants.H:48
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_SurfaceFluxDiagnostics.H:10
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real sensible_heat_flux_wm2_from_rhotheta_flux(amrex::Real rhotheta_flux) noexcept
Definition: ERF_SurfaceFluxDiagnostics.H:29
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real latent_heat_flux_wm2_from_rhoqv_flux(amrex::Real rhoqv_flux) noexcept
Definition: ERF_SurfaceFluxDiagnostics.H:36