Skip to content

Commit 917807e

Browse files
authored
Merge 6521e3d into c94e83c
2 parents c94e83c + 6521e3d commit 917807e

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.decent_ci-Linux.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ compilers:
1010
- name: "gcc"
1111
version: "13.3"
1212
build_type: RelWithDebInfo
13-
cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DPYTHON_CLI:BOOL=OFF -DPython_REQUIRED_VERSION:STRING=3.12.2 -DPython_ROOT_DIR:PATH=~/.pyenv/versions/3.12.2/ -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF
13+
cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DPYTHON_CLI:BOOL=OFF -DPython_REQUIRED_VERSION:STRING=3.12.2 -DPython_ROOT_DIR:PATH=~/.pyenv/versions/3.12.2/ -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF -DFORCE_CONTAINER_CHECKS_GCC_OR_CLANG:BOOL=ON
1414
coverage_enabled: true
1515
coverage_base_dir: src/EnergyPlus
1616
coverage_pass_limit: 41.0
@@ -25,7 +25,7 @@ compilers:
2525
- name: "gcc"
2626
version: "13.3"
2727
build_type: RelWithDebInfo
28-
cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DPYTHON_CLI:BOOL=OFF -DPython_REQUIRED_VERSION:STRING=3.12.2 -DPython_ROOT_DIR:PATH=~/.pyenv/versions/3.12.2/ -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF
28+
cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DPYTHON_CLI:BOOL=OFF -DPython_REQUIRED_VERSION:STRING=3.12.2 -DPython_ROOT_DIR:PATH=~/.pyenv/versions/3.12.2/ -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF -DFORCE_CONTAINER_CHECKS_GCC_OR_CLANG:BOOL=ON
2929
coverage_enabled: true
3030
coverage_base_dir: src/EnergyPlus
3131
coverage_pass_limit: 66.0

cmake/CompilerFlags.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ if(MSVC AND NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")) # Visual C++ (VS
8888

8989
elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") # g++/Clang
9090

91+
option(FORCE_CONTAINER_CHECKS_GCC_OR_CLANG "Enable trapping for container issues in non-debug builds" OFF)
9192
option(FORCE_DEBUG_ARITHM_GCC_OR_CLANG "Enable trapping floating point exceptions in non Debug mode" OFF)
93+
94+
mark_as_advanced(FORCE_CONTAINER_CHECKS_GCC_OR_CLANG)
9295
mark_as_advanced(FORCE_DEBUG_ARITHM_GCC_OR_CLANG)
9396

9497
# COMPILER FLAGS
@@ -132,6 +135,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" O
132135
endif()
133136

134137
set(need_arithm_debug_genex "$<OR:$<BOOL:${FORCE_DEBUG_ARITHM_GCC_OR_CLANG}>,$<CONFIG:Debug>>")
138+
set(need_container_debug_genex "$<OR:$<BOOL:${FORCE_CONTAINER_CHECKS_GCC_OR_CLANG}>,$<CONFIG:Debug>>")
135139

136140
# in main.cc for E+ (actual: api/EnergyPlusPgm.cc) and gtest: feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW)
137141
target_compile_definitions(project_fp_options INTERFACE $<${need_arithm_debug_genex}:DEBUG_ARITHM_GCC_OR_CLANG>)
@@ -146,7 +150,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" O
146150
if(CMAKE_COMPILER_IS_GNUCXX) # g++
147151
target_compile_options(project_options INTERFACE $<${need_arithm_debug_genex}:-ffloat-store>) # Improve debug run solution stability
148152
target_compile_options(project_options INTERFACE $<${need_arithm_debug_genex}:-fsignaling-nans>) # Disable optimizations that may have concealed NaN behavior
149-
target_compile_definitions(project_options INTERFACE $<${need_arithm_debug_genex}:_GLIBCXX_DEBUG>) # Standard container debug mode (bounds checking, ...>)
153+
target_compile_definitions(project_options INTERFACE $<${need_container_debug_genex}:_GLIBCXX_DEBUG>) # Standard container debug mode (bounds checking, ...>)
150154
# ADD_CXX_RELEASE_DEFINITIONS("-finline-limit=2000") # More aggressive inlining This is causing unit test failures on Ubuntu 14.04
151155
else()
152156
#check_cxx_compiler_flag(<flag> <var>)

src/EnergyPlus/EconomicTariff.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3664,16 +3664,16 @@ void setNativeVariables(EnergyPlusData &state)
36643664
monthVal = 0.0;
36653665
for (int kMonth = 1; kMonth <= NumMonths; ++kMonth) {
36663666
for (int jPeriod = 1; jPeriod <= (int)Period::Num; ++jPeriod) {
3667-
monthVal(kMonth) += tariff.gatherEnergy(kMonth)[jPeriod];
3667+
monthVal(kMonth) += tariff.gatherEnergy(kMonth)[jPeriod - 1];
36683668
}
36693669
}
36703670
s_econ->econVar(tariff.natives[(int)Native::TotalEnergy]).values = monthVal;
36713671
// nativeTotalDemand
36723672
monthVal = -bigNumber;
36733673
for (int kMonth = 1; kMonth <= NumMonths; ++kMonth) {
36743674
for (int jPeriod = 1; jPeriod <= (int)Period::Num; ++jPeriod) {
3675-
if (tariff.gatherDemand(kMonth)[jPeriod] > monthVal(kMonth)) {
3676-
monthVal(kMonth) = tariff.gatherDemand(kMonth)[jPeriod];
3675+
if (tariff.gatherDemand(kMonth)[jPeriod - 1] > monthVal(kMonth)) {
3676+
monthVal(kMonth) = tariff.gatherDemand(kMonth)[jPeriod - 1];
36773677
}
36783678
}
36793679
}

0 commit comments

Comments
 (0)