diff --git a/src/Infrastructure/TimeMgr/src/ESMCI_Clock.C b/src/Infrastructure/TimeMgr/src/ESMCI_Clock.C index 720e37c001..0a58298da9 100644 --- a/src/Infrastructure/TimeMgr/src/ESMCI_Clock.C +++ b/src/Infrastructure/TimeMgr/src/ESMCI_Clock.C @@ -566,6 +566,7 @@ int Clock::count=0; #define ESMC_METHOD "ESMCI::Clock::advance()" int rc = ESMF_SUCCESS; + bool userChangedDirLocal; if (this == ESMC_NULL_POINTER) { ESMC_LogDefault.MsgFoundError(ESMC_RC_PTR_NULL, @@ -638,11 +639,21 @@ int Clock::count=0; ringingAlarmList1stElementPtr); } + // Each alarm sets userChangedDirection to false in checkRingTime, + // so only the first alarm knows if the user changed direction. + // To remedy this, we'll save userChangedDirection and reset + // the clock's userChangedDirection before each alarm. After + // the last alarm::checkRingTime, this->userChangedDirection + // will be false. This is not the most efficient fix, but + // requires the least code changing to achieve it. + userChangedDirLocal = this->userChangedDirection; + // traverse alarm list (i) for ringing alarms (j) for(int i=0, j=0; iuserChangedDirection = userChangedDirLocal; // check each alarm to see if it's time to ring ringing = alarmList[i]->Alarm::checkRingTime(&rc);