From fb48acc89f673a07be777772eeb6484fc97e217d Mon Sep 17 00:00:00 2001 From: Mahesh Natarajan Date: Wed, 15 Nov 2023 16:09:37 -0800 Subject: [PATCH] Avoiding extra divide --- Source/TimeIntegration/ERF_make_buoyancy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/TimeIntegration/ERF_make_buoyancy.cpp b/Source/TimeIntegration/ERF_make_buoyancy.cpp index b3c461a14..6e3b7f39e 100644 --- a/Source/TimeIntegration/ERF_make_buoyancy.cpp +++ b/Source/TimeIntegration/ERF_make_buoyancy.cpp @@ -173,9 +173,9 @@ void make_buoyancy (Vector& S_data, amrex::ParallelFor(tbz, [=] AMREX_GPU_DEVICE (int i, int j, int k) { Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (1.0 + qv_data(i,j,k ) + qc_data(i,j,k ) - + qi_data(i,j,k ) + cell_data(i,j,k,RhoQp_comp)/cell_data(i,j,k,Rho_comp)) - r0_arr(i,j,k ); + + qi_data(i,j,k )) + cell_data(i,j,k,RhoQp_comp) - r0_arr(i,j,k ); Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (1.0 + qv_data(i,j,k-1) + qc_data(i,j,k-1) - + qi_data(i,j,k-1) + + cell_data(i,j,k-1,RhoQp_comp)/cell_data(i,j,k-1,Rho_comp)) - r0_arr(i,j,k-1); + + qi_data(i,j,k-1)) + cell_data(i,j,k-1,RhoQp_comp) - r0_arr(i,j,k-1); buoyancy_fab(i, j, k) = grav_gpu[2] * 0.5 * ( rhop_hi + rhop_lo ); }); } // mfi