diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index 0a96f44ad0..ae544d9c7b 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -232,7 +232,7 @@ int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, step_mem->istage = 0; /* Zero yerr for compensated summation */ - N_VConst(ZERO, step_mem->yerr); + if (ark_mem->use_compensated_sums) { N_VConst(ZERO, step_mem->yerr); } return (ARK_SUCCESS); } @@ -309,7 +309,10 @@ int sprkStep_Reset(ARKodeMem ark_mem, SUNDIALS_MAYBE_UNUSED sunrealtype tR, retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - N_VConst(SUN_RCONST(0.0), step_mem->yerr); + if (ark_mem->use_compensated_sums) + { + N_VConst(SUN_RCONST(0.0), step_mem->yerr); + } return (ARK_SUCCESS); }