Skip to content

Commit

Permalink
Fix index issues and plotfile index divide by rho.
Browse files Browse the repository at this point in the history
  • Loading branch information
AMLattanzi committed Dec 20, 2023
1 parent d38cf68 commit d1b0edf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/IO/Plotfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ ERF::WritePlotFile (int which, Vector<std::string> plot_var_names)

ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
{
Real qv_for_p = (use_moisture) ? S_arr(i,j,k,RhoQ1_comp) : 0;
Real qv_for_p = (use_moisture) ? S_arr(i,j,k,RhoQ1_comp)/S_arr(i,j,k,Rho_comp) : 0;
const Real rhotheta = S_arr(i,j,k,RhoTheta_comp);
derdat(i, j, k, mf_comp) = getPgivenRTh(rhotheta,qv_for_p);
});
Expand All @@ -243,7 +243,7 @@ ERF::WritePlotFile (int which, Vector<std::string> plot_var_names)

ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
{
Real qv_for_p = (use_moisture) ? S_arr(i,j,k,RhoQ1_comp) : 0;
Real qv_for_p = (use_moisture) ? S_arr(i,j,k,RhoQ1_comp)/S_arr(i,j,k,Rho_comp) : 0;
const Real rhotheta = S_arr(i,j,k,RhoTheta_comp);
derdat(i, j, k, mf_comp) = getPgivenRTh(rhotheta,qv_for_p) - p0_arr(i,j,k);
});
Expand Down
2 changes: 1 addition & 1 deletion Source/TimeIntegration/ERF_make_buoyancy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void make_buoyancy (Vector<MultiFab>& S_data,
amrex::ParallelFor(tbz, [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
Real rhop_hi = cell_data(i,j,k ,Rho_comp) + cell_data(i,j,k ,RhoQ1_comp) + cell_data(i,j,k ,RhoQ2_comp) - r0_arr(i,j,k );
Real rhop_lo = cell_data(i,j,k-1,Rho_comp) + cell_data(i,j,k-1,RhoQ2_comp) + cell_data(i,j,k-1,RhoQ2_comp) - r0_arr(i,j,k-1);
Real rhop_lo = cell_data(i,j,k-1,Rho_comp) + cell_data(i,j,k-1,RhoQ1_comp) + cell_data(i,j,k-1,RhoQ2_comp) - r0_arr(i,j,k-1);
buoyancy_fab(i, j, k) = grav_gpu[2] * 0.5 * ( rhop_hi + rhop_lo );
});
} // mfi
Expand Down

0 comments on commit d1b0edf

Please sign in to comment.