Skip to content

Commit

Permalink
Merge pull request #8118 from NREL/8111_DST_Southern_Crash
Browse files Browse the repository at this point in the history
Fix #8111 - E+ Crash w/ RunPeriodControl:DaylightSavingTime that wraps around year
  • Loading branch information
Myoldmopar authored Jul 6, 2020
2 parents 969c86b + 0bd3544 commit 4ad2038
Show file tree
Hide file tree
Showing 2 changed files with 446 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/EnergyPlus/ScheduleManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
#include <EnergyPlus/OutputProcessor.hh>
#include <EnergyPlus/ScheduleManager.hh>
#include <EnergyPlus/UtilityRoutines.hh>
#include <EnergyPlus/WeatherManager.hh>

namespace EnergyPlus {

Expand Down Expand Up @@ -2777,7 +2778,7 @@ namespace ScheduleManager {
// na

// Using/Aliasing

// Locals
// SUBROUTINE ARGUMENT DEFINITIONS:
// na
Expand Down Expand Up @@ -2877,6 +2878,12 @@ namespace ScheduleManager {
thisHolidayIndex = DataEnvironment::HolidayIndexTomorrow;
}

// In the case where DST is applied on 12/31 at 24:00, which is the case for a Southern Hemisphere location for eg
// (DayOfYear_Schedule is a bit weird, ScheduleManager always assumes LeapYear)
if (thisDayOfYear == 367) {
thisDayOfYear = 1;
}

int WeekSchedulePointer = Schedule(ScheduleIndex).WeekSchedulePointer(thisDayOfYear);
int DaySchedulePointer;

Expand Down
Loading

6 comments on commit 4ad2038

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2198 of 2198 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (13 of 13 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1467 of 1467 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (714 of 714 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (2154 of 2154 tests passed, 0 test warnings)

Build Badge Test Badge

Please # to comment.