17 for ( MFIter mfi(*
tabs,TilingIfNotGPU()); mfi.isValid(); ++mfi) {
19 const auto& tbx = mfi.tilebox();
27 ParallelFor(tbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
29 qc_array(i,j,k) = std::max(0.0, qc_array(i,j,k));
33 erf_qsatw(tabs_array(i,j,k), pres_array(i,j,k), qsat);
36 if ((qv_array(i,j,k)+qc_array(i,j,k)) > qsat) {
40 d_fac_cond, tabs_array, pres_array,
41 qv_array , qc_array );
44 theta_array(i,j,k) =
getThgivenPandT(tabs_array(i,j,k), 100.0*pres_array(i,j,k), rdOcp);
55 Real delta_qc = qc_array(i,j,k);
58 qv_array(i,j,k) += qc_array(i,j,k);
59 qc_array(i,j,k) = 0.0;
62 tabs_array(i,j,k) -= d_fac_cond * delta_qc;
65 theta_array(i,j,k) =
getThgivenPandT(tabs_array(i,j,k), 100.0*pres_array(i,j,k), rdOcp);
68 erf_qsatw(tabs_array(i,j,k), pres_array(i,j,k), qsat);
69 if (qv_array(i,j,k) > qsat) {
73 d_fac_cond , tabs_array, pres_array,
74 qv_array , qc_array );
77 theta_array(i,j,k) =
getThgivenPandT(tabs_array(i,j,k), 100.0*pres_array(i,j,k), rdOcp);
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getThgivenPandT(const amrex::Real T, const amrex::Real P, const amrex::Real rdOcp)
Definition: ERF_EOS.H:18
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void erf_qsatw(amrex::Real t, amrex::Real p, amrex::Real &qsatw)
Definition: ERF_MicrophysicsUtils.H:158
amrex::Real m_fac_cond
Definition: ERF_SatAdj.H:208
amrex::Array< FabPtr, MicVar_SatAdj::NumVars > mic_fab_vars
Definition: ERF_SatAdj.H:212
amrex::Real m_rdOcp
Definition: ERF_SatAdj.H:209
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real NewtonIterSat(int &i, int &j, int &k, const amrex::Real &fac_cond, const amrex::Array4< amrex::Real > &tabs_array, const amrex::Array4< amrex::Real > &pres_array, const amrex::Array4< amrex::Real > &qv_array, const amrex::Array4< amrex::Real > &qc_array)
Definition: ERF_SatAdj.H:129
@ tabs
Definition: ERF_Kessler.H:32
@ theta
Definition: ERF_SatAdj.H:31
@ pres
Definition: ERF_SatAdj.H:33
@ qv
Definition: ERF_SatAdj.H:35
@ tabs
Definition: ERF_SatAdj.H:32
@ qc
Definition: ERF_SatAdj.H:36