ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
surface_diagnostics Namespace Reference

Enumerations

enum class  SurfaceDiagnosticSource : int {
  Missing = 0 , SurfaceLayerLand = 1 , LSMLand = 2 , SurfaceLayerFallback = 3 ,
  SurfaceLayerSea = 4 , Custom = 5 , RICO = 6
}
 

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int to_int (SurfaceDiagnosticSource source) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real to_plot_value (SurfaceDiagnosticSource source) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE SurfaceDiagnosticSource classify_scalar_source (bool is_custom, bool is_rico, bool is_land, bool has_lsm_flux, bool lsm_flux_is_valid) noexcept
 
const char * source_name (SurfaceDiagnosticSource source) noexcept
 

Enumeration Type Documentation

◆ SurfaceDiagnosticSource

Function Documentation

◆ classify_scalar_source()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE SurfaceDiagnosticSource surface_diagnostics::classify_scalar_source ( bool  is_custom,
bool  is_rico,
bool  is_land,
bool  has_lsm_flux,
bool  lsm_flux_is_valid 
)
noexcept

Classify the provenance of a scalar surface flux.

Parameters
[in]is_customwhether the custom flux mode is active
[in]is_ricowhether the RICO flux mode is active
[in]is_landwhether the cell is classified as land
[in]has_lsm_fluxwhether an LSM flux array is available
[in]lsm_flux_is_validwhether the LSM flux value is valid
66 {
67  if (is_land && has_lsm_flux && lsm_flux_is_valid) {
68  return SurfaceDiagnosticSource::LSMLand;
69  }
70  if (is_custom) {
71  return SurfaceDiagnosticSource::Custom;
72  }
73  if (is_rico) {
74  return SurfaceDiagnosticSource::RICO;
75  }
76  if (is_land && has_lsm_flux && !lsm_flux_is_valid) {
77  return SurfaceDiagnosticSource::SurfaceLayerFallback;
78  }
79  if (is_land) {
80  return SurfaceDiagnosticSource::SurfaceLayerLand;
81  }
82  return SurfaceDiagnosticSource::SurfaceLayerSea;
83 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool lsm_flux_is_valid(bool has_flux, bool is_land, amrex::Real flux, amrex::Real undefined)
Definition: ERF_SurfaceLayerStress.H:35

Referenced by SurfaceLayer::compute_SurfaceLayer_bcs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ source_name()

const char* surface_diagnostics::source_name ( SurfaceDiagnosticSource  source)
inlinenoexcept

Return the string name for a diagnostic source enum value.

Parameters
[in]sourcediagnostic source enum value
92 {
93  switch (source) {
94  case SurfaceDiagnosticSource::Missing: return "missing";
95  case SurfaceDiagnosticSource::SurfaceLayerLand: return "surface_layer_land";
96  case SurfaceDiagnosticSource::LSMLand: return "lsm_land";
97  case SurfaceDiagnosticSource::SurfaceLayerFallback: return "surface_layer_fallback";
98  case SurfaceDiagnosticSource::SurfaceLayerSea: return "surface_layer_sea";
99  case SurfaceDiagnosticSource::Custom: return "custom";
100  case SurfaceDiagnosticSource::RICO: return "rico";
101  }
102  return "unknown";
103 }

◆ to_int()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int surface_diagnostics::to_int ( SurfaceDiagnosticSource  source)
noexcept

Convert a diagnostic source enum to its integer code.

Parameters
[in]sourcediagnostic source enum value
34 {
35  return static_cast<int>(source);
36 }

Referenced by near_surface_diagnostics::fill(), and to_plot_value().

Here is the caller graph for this function:

◆ to_plot_value()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real surface_diagnostics::to_plot_value ( SurfaceDiagnosticSource  source)
noexcept

Convert a diagnostic source enum to the Real value written to plotfiles.

Parameters
[in]sourcediagnostic source enum value
46 {
47  return static_cast<amrex::Real>(to_int(source));
48 }
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int to_int(SurfaceDiagnosticSource source) noexcept
Definition: ERF_SurfaceDiagnosticSource.H:33

Referenced by SurfaceLayer::compute_SurfaceLayer_bcs(), SurfaceLayer::compute_SurfaceLayer_bcs_EB(), near_surface_diagnostics::fill(), and SurfaceLayer::make_SurfaceLayer_at_level().

Here is the call graph for this function:
Here is the caller graph for this function: