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

Classes

struct  FluxSelection
 
struct  CellPolicy
 

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool result_is_valid (amrex::Real value) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool result_is_valid_for_output (amrex::Real value, int output_comp) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real select_result (bool cell_processed, amrex::Real value, amrex::Real undefined_value, int output_comp) noexcept
 

Function Documentation

◆ result_is_valid()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool noahmp_result_policy::result_is_valid ( amrex::Real  value)
noexcept
25 {
26  // Noah-MP uses approximately -9999 for unprocessed cells. ERF also
27  // rejects nonfinite values before storing provider data.
28  return std::isfinite(value) && value > amrex::Real(-9990.0) &&
30 }
constexpr amrex::Real lsm_undefined
Definition: ERF_Constants.H:35
Real value
Definition: ERF_HurricaneDiagnostics.cpp:30
amrex::Real Real
Definition: ERF_ShocInterface.H:19

Referenced by result_is_valid_for_output().

Here is the caller graph for this function:

◆ result_is_valid_for_output()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool noahmp_result_policy::result_is_valid_for_output ( amrex::Real  value,
int  output_comp 
)
noexcept
34 {
35  if (!result_is_valid(value)) {
36  return false;
37  }
38  if (output_comp == NoahmpOutputComp::o_noahmp_q2m_veg ||
39  output_comp == NoahmpOutputComp::o_noahmp_q2m_bare) {
40  return value >= amrex::Real(0.0);
41  }
42  if (output_comp == NoahmpOutputComp::o_noahmp_fveg) {
43  return value >= amrex::Real(0.0) && value <= amrex::Real(1.0);
44  }
45  return true;
46 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool result_is_valid(amrex::Real value) noexcept
Definition: ERF_NOAHMP_ResultPolicy.H:24

Referenced by select_result().

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

◆ select_result()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real noahmp_result_policy::select_result ( bool  cell_processed,
amrex::Real  value,
amrex::Real  undefined_value,
int  output_comp 
)
noexcept
53 {
54  return cell_processed && result_is_valid_for_output(value, output_comp)
55  ? value : undefined_value;
56 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool result_is_valid_for_output(amrex::Real value, int output_comp) noexcept
Definition: ERF_NOAHMP_ResultPolicy.H:33

Referenced by noahmp_result_policy::CellPolicy::select().

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