ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_SBMStageOwnership.H
Go to the documentation of this file.
1 #ifndef ERF_SBM_STAGE_OWNERSHIP_H_
2 #define ERF_SBM_STAGE_OWNERSHIP_H_
3 
4 #include <AMReX_Array4.H>
5 #include <AMReX_GpuQualifiers.H>
6 
7 namespace erf_sbm {
8 
9 /** Perform ERF's predictor-to-current copy for one slow state component. */
10 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void
11 copy_host_slow_component (const amrex::Array4<amrex::Real>& current,
12  const amrex::Array4<const amrex::Real>& predictor,
13  const int i,
14  const int j,
15  const int k,
16  const int component,
17  const bool sbm_active,
18  const int qc_component,
19  const int qr_component) noexcept
20 {
21  const bool sbm_projected_liquid =
22  sbm_active &&
23  (component == qc_component || component == qr_component);
24  if (!sbm_projected_liquid) {
25  current(i, j, k, component) = predictor(i, j, k, component);
26  }
27 }
28 
29 } // namespace erf_sbm
30 
31 #endif
Definition: ERF.H:108
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void copy_host_slow_component(const amrex::Array4< amrex::Real > &current, const amrex::Array4< const amrex::Real > &predictor, const int i, const int j, const int k, const int component, const bool sbm_active, const int qc_component, const int qr_component) noexcept
Definition: ERF_SBMStageOwnership.H:11