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
26 {
27  // Noah-MP uses approximately -9999 for unprocessed cells. ERF also
28  // rejects nonfinite values before storing provider data.
29  return amrex::Math::isfinite(value) && value > amrex::Real(-9990.0) &&
30  value < amrex::Real(0.5) * lsm_undefined;
31 }
constexpr amrex::Real lsm_undefined
Definition: ERF_Constants.H:26
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
35 {
36  if (!result_is_valid(value)) {
37  return false;
38  }
39  if (output_comp == NoahmpOutputComp::o_noahmp_q2m_veg ||
40  output_comp == NoahmpOutputComp::o_noahmp_q2m_bare) {
41  return value >= amrex::Real(0.0);
42  }
43  if (output_comp == NoahmpOutputComp::o_noahmp_fveg) {
44  return value >= amrex::Real(0.0) && value <= amrex::Real(1.0);
45  }
46  return true;
47 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool result_is_valid(amrex::Real value) noexcept
Definition: ERF_NOAHMP_ResultPolicy.H:25

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
54 {
55  return cell_processed && result_is_valid_for_output(value, output_comp)
56  ? value : undefined_value;
57 }
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:34

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

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