Skip to content

Commit

Permalink
Fix pert pres output with moisture. (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
AMLattanzi authored Dec 1, 2023
1 parent f460464 commit 0e94b16
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Source/IO/Plotfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,21 @@ ERF::WritePlotFile (int which, Vector<std::string> plot_var_names)
const Array4<Real>& derdat = mf[lev].array(mfi);
const Array4<Real const>& p0_arr = p_hse.const_array(mfi);
const Array4<Real const>& S_arr = vars_new[lev][Vars::cons].const_array(mfi);
#if defined(ERF_USE_MOISTURE)
const Array4<Real const> & qv_arr = qmoist[0].const_array(mfi);
#endif

ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {

ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
{
#if defined(ERF_USE_MOISTURE)
Real qv_for_p = qv_arr(i,j,k);
#elif defined(ERF_USE_WARM_NO_PRECIP)
Real qv_for_p = S_arr(i,j,k,RhoQv_comp) / S_arr(i,j,k,Rho_comp);
#else
Real qv_for_p = 0.;
#endif
const Real rhotheta = S_arr(i,j,k,RhoTheta_comp);
derdat(i, j, k, mf_comp) = getPgivenRTh(rhotheta) - p0_arr(i,j,k);
derdat(i, j, k, mf_comp) = getPgivenRTh(rhotheta,qv_for_p) - p0_arr(i,j,k);
});
}
mf_comp += 1;
Expand Down

0 comments on commit 0e94b16

Please sign in to comment.