Skip to content

Commit

Permalink
Fixes for Intel "Erroneous arithmetic operation" with compiler optimi…
Browse files Browse the repository at this point in the history
…zation (#1976)

* Fix for arithmetic error with intel when using compiler opt

This allows a canonical dry abl test case to run with -O1

Tested with Intel(R) oneAPI DPC++/C++ Compiler 2023.2.0 (2023.2.0.20230622)

* Fix for erroneous arithmetic operation with intel -O2
  • Loading branch information
ewquon authored Nov 22, 2024
1 parent a701d04 commit de9b804
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Diffusion/ERF_ComputeTurbulentViscosity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void ComputeTurbulentViscosityLES (const MultiFab& Tau11, const MultiFab& Tau22,
- cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp) )*dzInv;
}
Real E = amrex::max(cell_data(i,j,k,RhoKE_comp)/cell_data(i,j,k,Rho_comp),Real(0.0));
Real stratification = l_abs_g * dtheta_dz * l_inv_theta0; // stratification
volatile Real stratification = l_abs_g * dtheta_dz * l_inv_theta0;
Real length;
if (stratification <= eps) {
length = DeltaMsf;
Expand Down
14 changes: 14 additions & 0 deletions Source/SourceTerms/ERF_ApplySpongeZoneBCs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ ApplySpongeZoneBCsForCC (
const int use_yhi_sponge_damping = spongeChoice.use_yhi_sponge_damping;
const int use_zlo_sponge_damping = spongeChoice.use_zlo_sponge_damping;
const int use_zhi_sponge_damping = spongeChoice.use_zhi_sponge_damping;
if (!use_xlo_sponge_damping &&
!use_xhi_sponge_damping &&
!use_ylo_sponge_damping &&
!use_yhi_sponge_damping &&
!use_zlo_sponge_damping &&
!use_zhi_sponge_damping)
return;

const Real xlo_sponge_end = spongeChoice.xlo_sponge_end;
const Real xhi_sponge_start = spongeChoice.xhi_sponge_start;
Expand Down Expand Up @@ -136,6 +143,13 @@ ApplySpongeZoneBCsForMom (
const int use_yhi_sponge_damping = spongeChoice.use_yhi_sponge_damping;
const int use_zlo_sponge_damping = spongeChoice.use_zlo_sponge_damping;
const int use_zhi_sponge_damping = spongeChoice.use_zhi_sponge_damping;
if (!use_xlo_sponge_damping &&
!use_xhi_sponge_damping &&
!use_ylo_sponge_damping &&
!use_yhi_sponge_damping &&
!use_zlo_sponge_damping &&
!use_zhi_sponge_damping)
return;

const Real xlo_sponge_end = spongeChoice.xlo_sponge_end;
const Real xhi_sponge_start = spongeChoice.xhi_sponge_start;
Expand Down

0 comments on commit de9b804

Please sign in to comment.