From cb2ce85b8f53f8bd450efb0caa37675567db2210 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 17 Dec 2020 19:18:35 -0700 Subject: [PATCH 01/14] moving OutputReportTabular to state --- src/EnergyPlus/OutputReportTabular.cc | 16 ---------------- src/EnergyPlus/OutputReportTabular.hh | 13 ++++++------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index a103c13a6ec..9f0f9eb902a 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -176,9 +176,6 @@ namespace OutputReportTabular { // Data // MODULE PARAMETER DEFINITIONS: - int const MaxHeaderLength(50); - int const MaxNoteLength(200); - int const aggTypeSumOrAvg(1); int const aggTypeMaximum(2); int const aggTypeMinimum(3); @@ -206,13 +203,6 @@ namespace OutputReportTabular { int const unitsStyleInchPound(4); int const unitsStyleNotFound(5); - // BEPS Report Related Variables - // From Report:Table:Predefined - BEPS - int const numResourceTypes(14); - int const numSourceTypes(12); - - static std::string const validChars("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_:."); - // MODULE VARIABLE DECLARATIONS: // The Binned table type is different and only references one variable and its structure is very @@ -224,9 +214,6 @@ namespace OutputReportTabular { int BinResultsTableCount(0); int BinResultsIntervalCount(0); - int const numNamedMonthly(63); - // These reports are detailed/named in routine InitializePredefinedMonthlyTitles - int MonthlyInputCount(0); int sizeMonthlyInput(0); int MonthlyFieldSetInputCount(0); @@ -244,9 +231,6 @@ namespace OutputReportTabular { bool GetInput(true); bool firstTimeGatherHGReport(true); - // Allow up to five output files to be created - int const maxNumStyles(5); - // From Report:Table:Style int unitsStyle(0); // see list of parameters int numStyles(0); diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 60bd8da4278..4b124b236f0 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -78,9 +78,6 @@ namespace OutputReportTabular { // Data // MODULE PARAMETER DEFINITIONS: - extern int const MaxHeaderLength; - extern int const MaxNoteLength; - extern int const aggTypeSumOrAvg; extern int const aggTypeMaximum; extern int const aggTypeMinimum; @@ -149,8 +146,10 @@ namespace OutputReportTabular { // BEPS Report Related Variables // From Report:Table:Predefined - BEPS - extern int const numResourceTypes; - extern int const numSourceTypes; + constexpr int numResourceTypes(14); + constexpr int numSourceTypes(12); + + constexpr const char *validChars("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_:."); // MODULE VARIABLE DECLARATIONS: @@ -163,7 +162,7 @@ namespace OutputReportTabular { extern int BinResultsTableCount; extern int BinResultsIntervalCount; - extern int const numNamedMonthly; + constexpr int numNamedMonthly(63); // These reports are detailed/named in routine InitializePredefinedMonthlyTitles extern int MonthlyInputCount; @@ -182,7 +181,7 @@ namespace OutputReportTabular { extern bool WriteTabularFiles; // Allow up to five output files to be created - extern int const maxNumStyles; + constexpr int maxNumStyles(5); // From Report:Table:Style extern int unitsStyle; // see list of parameters From d0ef2f4deb90b9b31449b4d149d9533e2c8b5514 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 18 Dec 2020 11:21:07 -0700 Subject: [PATCH 02/14] move OutputReportTabular::UnitStyle const ints to enum --- src/EnergyPlus/Data/EnergyPlusData.cc | 4 +- src/EnergyPlus/Data/EnergyPlusData.hh | 2 +- src/EnergyPlus/EconomicTariff.cc | 4 +- src/EnergyPlus/OutputReportTabular.cc | 299 +++++++++--------- src/EnergyPlus/OutputReportTabular.hh | 38 ++- src/EnergyPlus/OutputReportTabularAnnual.cc | 24 +- src/EnergyPlus/OutputReportTabularAnnual.hh | 8 +- .../unit/OutputReportTabular.unit.cc | 26 +- .../unit/OutputReportTabularAnnual.unit.cc | 4 +- 9 files changed, 201 insertions(+), 208 deletions(-) diff --git a/src/EnergyPlus/Data/EnergyPlusData.cc b/src/EnergyPlus/Data/EnergyPlusData.cc index be030d83ac6..289874abdbe 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.cc +++ b/src/EnergyPlus/Data/EnergyPlusData.cc @@ -193,7 +193,7 @@ namespace EnergyPlus { this->dataOutdoorAirUnit = std::make_unique(); this->dataOutput = std::make_unique(); this->dataOutputProcessor = std::make_unique(); - this->dataOutputReportTabular = std::make_unique(); + this->dataOutRptTab = std::make_unique(); this->dataOutputReportTabularAnnual = std::make_unique(); this->dataOutsideEnergySrcs = std::make_unique(); this->dataPTHP = std::make_unique(); @@ -437,7 +437,7 @@ namespace EnergyPlus { this->dataOutdoorAirUnit->clear_state(); this->dataOutput->clear_state(); this->dataOutputProcessor->clear_state(); - this->dataOutputReportTabular->clear_state(); + this->dataOutRptTab->clear_state(); this->dataOutputReportTabularAnnual->clear_state(); this->dataOutsideEnergySrcs->clear_state(); this->dataPTHP->clear_state(); diff --git a/src/EnergyPlus/Data/EnergyPlusData.hh b/src/EnergyPlus/Data/EnergyPlusData.hh index b9104046415..f186561b38f 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.hh +++ b/src/EnergyPlus/Data/EnergyPlusData.hh @@ -453,7 +453,7 @@ struct EnergyPlusData : BaseGlobalStruct { std::unique_ptr dataOutputProcessor; std::unique_ptr dataOutRptPredefined; std::unique_ptr dataOutputReportTabularAnnual; - std::unique_ptr dataOutputReportTabular; + std::unique_ptr dataOutRptTab; std::unique_ptr dataOutput; std::unique_ptr dataOutsideEnergySrcs; std::unique_ptr dataPVWatts; diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index 4f272469f23..6c645344b16 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -4031,8 +4031,6 @@ namespace EnergyPlus::EconomicTariff { using OutputReportTabular::displayTariffReport; using OutputReportTabular::LookupSItoIP; using OutputReportTabular::RealToStr; - using OutputReportTabular::unitsStyle; - using OutputReportTabular::unitsStyleInchPound; using OutputReportTabular::WriteReportHeaders; using OutputReportTabular::WriteSubtitle; using OutputReportTabular::WriteTable; @@ -4073,7 +4071,7 @@ namespace EnergyPlus::EconomicTariff { } // do unit conversions if necessary - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == OutputReportTabular::iUnitsStyle::InchPound) { SIunit = "[~~$~~/m2]"; LookupSItoIP(state, SIunit, unitConvIndex, perAreaUnitName); perAreaUnitConv = ConvertIP(unitConvIndex, 1.0); diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 9f0f9eb902a..39803ac87a5 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -190,19 +190,6 @@ namespace OutputReportTabular { int const aggTypeMaximumDuringHoursShown(12); int const aggTypeMinimumDuringHoursShown(13); - int const tableStyleComma(1); - int const tableStyleTab(2); - int const tableStyleFixed(3); - int const tableStyleHTML(4); - int const tableStyleXML(5); - - int const unitsStyleNone(0); // no change to any units - int const unitsStyleJtoKWH(1); - int const unitsStyleJtoMJ(2); - int const unitsStyleJtoGJ(3); - int const unitsStyleInchPound(4); - int const unitsStyleNotFound(5); - // MODULE VARIABLE DECLARATIONS: // The Binned table type is different and only references one variable and its structure is very @@ -232,7 +219,6 @@ namespace OutputReportTabular { bool firstTimeGatherHGReport(true); // From Report:Table:Style - int unitsStyle(0); // see list of parameters int numStyles(0); std::ofstream csv_stream; // CSV table stream std::ofstream tab_stream; // Tab table stream @@ -241,7 +227,7 @@ namespace OutputReportTabular { std::ofstream xml_stream; // XML table stream Array1D TabularOutputFile(maxNumStyles, {&csv_stream, &tab_stream, &fix_stream, &htm_stream, &xml_stream}); // Table stream array Array1D_string del(maxNumStyles); // the delimiter to use - Array1D_int TableStyle(maxNumStyles, 0); // see list of parameters + Array1D TableStyle(maxNumStyles, iTableStyle::Unassigned); // see list of parameters Real64 timeInYear(0.0); @@ -536,11 +522,10 @@ namespace OutputReportTabular { TOCEntriesSize = 0; UnitConvSize = 0; WriteTabularFiles = false; - unitsStyle = 0; numStyles = 0; TabularOutputFile = Array1D(maxNumStyles, {&csv_stream, &tab_stream, &fix_stream, &htm_stream, &xml_stream}); del = Array1D_string(maxNumStyles); - TableStyle = Array1D_int(maxNumStyles, 0); + TableStyle = Array1D(maxNumStyles, iTableStyle::Unassigned); timeInYear = 0.0; displayTabularBEPS = false; displayLEEDSummary = false; @@ -1775,9 +1760,9 @@ namespace OutputReportTabular { if (NumTabularStyle == 0) { AlphArray(1) = "COMMA"; numStyles = 1; - TableStyle(1) = tableStyleComma; + TableStyle(1) = iTableStyle::Comma; del(1) = CharComma; // comma - unitsStyle = unitsStyleNone; + state.dataOutRptTab->unitsStyle = iUnitsStyle::None; } else if (NumTabularStyle == 1) { inputProcessor->getObjectItem(state, CurrentModuleObject, @@ -1794,84 +1779,84 @@ namespace OutputReportTabular { // ColumnSeparator if (UtilityRoutines::SameString(AlphArray(1), "Comma")) { numStyles = 1; - TableStyle(1) = tableStyleComma; + TableStyle(1) = iTableStyle::Comma; del(1) = CharComma; // comma } else if (UtilityRoutines::SameString(AlphArray(1), "Tab")) { numStyles = 1; - TableStyle(1) = tableStyleTab; + TableStyle(1) = iTableStyle::Tab; del(1) = CharTab; // tab } else if (UtilityRoutines::SameString(AlphArray(1), "Fixed")) { numStyles = 1; - TableStyle(1) = tableStyleFixed; + TableStyle(1) = iTableStyle::Fixed; del(1) = CharSpace; // space } else if (UtilityRoutines::SameString(AlphArray(1), "HTML")) { numStyles = 1; - TableStyle(1) = tableStyleHTML; + TableStyle(1) = iTableStyle::HTML; del(1) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "XML")) { numStyles = 1; - TableStyle(1) = tableStyleXML; + TableStyle(1) = iTableStyle::XML; del(1) = CharSpace; // space - this is not used much for XML output } else if (UtilityRoutines::SameString(AlphArray(1), "CommaAndHTML")) { numStyles = 2; - TableStyle(1) = tableStyleComma; + TableStyle(1) = iTableStyle::Comma; del(1) = CharComma; // comma - TableStyle(2) = tableStyleHTML; + TableStyle(2) = iTableStyle::HTML; del(2) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "CommaAndXML")) { numStyles = 2; - TableStyle(1) = tableStyleComma; + TableStyle(1) = iTableStyle::Comma; del(1) = CharComma; // comma - TableStyle(2) = tableStyleXML; + TableStyle(2) = iTableStyle::XML; del(2) = CharSpace; // space - this is not used much for XML output } else if (UtilityRoutines::SameString(AlphArray(1), "TabAndHTML")) { numStyles = 2; - TableStyle(1) = tableStyleTab; + TableStyle(1) = iTableStyle::Tab; del(1) = CharTab; // tab - TableStyle(2) = tableStyleHTML; + TableStyle(2) = iTableStyle::HTML; del(2) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "XMLandHTML")) { numStyles = 2; - TableStyle(1) = tableStyleXML; + TableStyle(1) = iTableStyle::XML; del(1) = CharSpace; // space - this is not used much for XML output - TableStyle(2) = tableStyleHTML; + TableStyle(2) = iTableStyle::HTML; del(2) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "All")) { numStyles = 5; - TableStyle(1) = tableStyleComma; + TableStyle(1) = iTableStyle::Comma; del(1) = CharComma; // comma - TableStyle(2) = tableStyleTab; + TableStyle(2) = iTableStyle::Tab; del(2) = CharTab; // tab - TableStyle(3) = tableStyleFixed; + TableStyle(3) = iTableStyle::Fixed; del(3) = CharSpace; // space - TableStyle(4) = tableStyleHTML; + TableStyle(4) = iTableStyle::HTML; del(4) = CharSpace; // space - this is not used much for HTML output - TableStyle(5) = tableStyleXML; + TableStyle(5) = iTableStyle::XML; del(5) = CharSpace; // space - this is not used much for XML output } else { ShowWarningError(state, CurrentModuleObject + ": Invalid " + cAlphaFieldNames(1) + "=\"" + AlphArray(1) + "\". Commas will be used."); numStyles = 1; - TableStyle(1) = tableStyleComma; + TableStyle(1) = iTableStyle::Comma; del(1) = CharComma; // comma AlphArray(1) = "COMMA"; } // MonthlyUnitConversion if (NumAlphas >= 2) { - unitsStyle = SetUnitsStyleFromString(AlphArray(2)); - if (unitsStyle == unitsStyleNotFound) { + state.dataOutRptTab->unitsStyle = SetUnitsStyleFromString(AlphArray(2)); + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::NotFound) { ShowWarningError(state, CurrentModuleObject + ": Invalid " + cAlphaFieldNames(2) + "=\"" + AlphArray(2) + "\". No unit conversion will be performed. Normal SI units will be shown."); } } else { - unitsStyle = unitsStyleNone; + state.dataOutRptTab->unitsStyle = iUnitsStyle::None; AlphArray(2) = "None"; } } else if (NumTabularStyle > 1) { ShowWarningError(state, CurrentModuleObject + ": Only one instance of this object is allowed. Commas will be used."); - TableStyle = tableStyleComma; + TableStyle = iTableStyle::Comma; del = std::string(1, CharComma); // comma AlphArray(1) = "COMMA"; - unitsStyle = unitsStyleNone; + state.dataOutRptTab->unitsStyle = iUnitsStyle::None; AlphArray(2) = "None"; } @@ -1886,21 +1871,21 @@ namespace OutputReportTabular { } } - int SetUnitsStyleFromString(std::string const &unitStringIn) + iUnitsStyle SetUnitsStyleFromString(std::string const &unitStringIn) { - int unitsStyleReturn; + iUnitsStyle unitsStyleReturn; if (UtilityRoutines::SameString(unitStringIn, "None")) { - unitsStyleReturn = unitsStyleNone; + unitsStyleReturn = iUnitsStyle::None; } else if (UtilityRoutines::SameString(unitStringIn, "JTOKWH")) { - unitsStyleReturn = unitsStyleJtoKWH; + unitsStyleReturn = iUnitsStyle::JtoKWH; } else if (UtilityRoutines::SameString(unitStringIn, "JTOMJ")) { - unitsStyleReturn = unitsStyleJtoMJ; + unitsStyleReturn = iUnitsStyle::JtoMJ; } else if (UtilityRoutines::SameString(unitStringIn, "JTOGJ")) { - unitsStyleReturn = unitsStyleJtoGJ; + unitsStyleReturn = iUnitsStyle::JtoGJ; } else if (UtilityRoutines::SameString(unitStringIn, "INCHPOUND")) { - unitsStyleReturn = unitsStyleInchPound; + unitsStyleReturn = iUnitsStyle::InchPound; } else { - unitsStyleReturn = unitsStyleNotFound; + unitsStyleReturn = iUnitsStyle::NotFound; } return unitsStyleReturn; } @@ -3534,7 +3519,7 @@ namespace OutputReportTabular { if (WriteTabularFiles && state.files.outputControl.tabular) { for (iStyle = 1; iStyle <= numStyles; ++iStyle) { curDel = del(iStyle); - if (TableStyle(iStyle) == tableStyleComma) { + if (TableStyle(iStyle) == iTableStyle::Comma) { DisplayString(state, "Writing tabular output file results using comma format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblCsvFileName, state.files.outputControl.tabular); tbl_stream << "Program Version:" << curDel << VerString << '\n'; @@ -3547,7 +3532,7 @@ namespace OutputReportTabular { tbl_stream << "Environment:" << curDel << state.dataEnvrn->EnvironmentName << " ** " << state.dataEnvrn->WeatherFileLocationTitle << '\n'; } tbl_stream << '\n'; - } else if (TableStyle(iStyle) == tableStyleTab) { + } else if (TableStyle(iStyle) == iTableStyle::Tab) { DisplayString(state, "Writing tabular output file results using tab format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblTabFileName, state.files.outputControl.tabular); tbl_stream << "Program Version" << curDel << VerString << '\n'; @@ -3560,7 +3545,7 @@ namespace OutputReportTabular { tbl_stream << "Environment:" << curDel << state.dataEnvrn->EnvironmentName << " ** " << state.dataEnvrn->WeatherFileLocationTitle << '\n'; } tbl_stream << '\n'; - } else if (TableStyle(iStyle) == tableStyleHTML) { + } else if (TableStyle(iStyle) == iTableStyle::HTML) { DisplayString(state, "Writing tabular output file results using HTML format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblHtmFileName, state.files.outputControl.tabular); tbl_stream << "\n"; @@ -3593,7 +3578,7 @@ namespace OutputReportTabular { << std::setw(2) << td(3) << '\n'; tbl_stream << " " << std::setw(2) << td(5) << ':' << std::setw(2) << td(6) << ':' << std::setw(2) << td(7) << std::setfill(' ') << "

\n"; - } else if (TableStyle(iStyle) == tableStyleXML) { + } else if (TableStyle(iStyle) == iTableStyle::XML) { DisplayString(state, "Writing tabular output file results using XML format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblXmlFileName, state.files.outputControl.tabular); tbl_stream << "\n"; @@ -3671,10 +3656,10 @@ namespace OutputReportTabular { if (WriteTabularFiles) { for (iStyle = 1; iStyle <= numStyles; ++iStyle) { std::ofstream &tbl_stream(*TabularOutputFile(iStyle)); - if (TableStyle(iStyle) == tableStyleHTML) { // if HTML file put ending info + if (TableStyle(iStyle) == iTableStyle::HTML) { // if HTML file put ending info tbl_stream << "\n"; tbl_stream << "\n"; - } else if (TableStyle(iStyle) == tableStyleXML) { + } else if (TableStyle(iStyle) == iTableStyle::XML) { if (!prevReportName.empty()) { tbl_stream << "\n"; // close the last element if it was used. } @@ -3750,7 +3735,7 @@ namespace OutputReportTabular { } for (iStyle = 1; iStyle <= numStyles; ++iStyle) { - if (TableStyle(iStyle) == tableStyleHTML) { + if (TableStyle(iStyle) == iTableStyle::HTML) { std::ostream &tbl_stream(*TabularOutputFile(iStyle)); tbl_stream << "
\n"; tbl_stream << "\n"; @@ -3835,7 +3820,7 @@ namespace OutputReportTabular { for (jTable = 1; jTable <= OutputTableBinned(iInput).numTables; ++jTable) { curTable = OutputTableBinned(iInput).resIndex + (jTable - 1); curName = ""; - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { origName = OutputTableBinned(iInput).varOrMeter + unitEnumToStringBrackets(OutputTableBinned(iInput).units); LookupSItoIP(state, origName, indexUnitConv, curName); } else { @@ -5858,7 +5843,7 @@ namespace OutputReportTabular { lnPtr = index(lineIn.substr(12), 'm'); if (lnPtr != std::string::npos) { curNameWithSIUnits = "Elevation (m) " + lineIn.substr(12 + lnPtr + 2); - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIP(indexUnitConv, StrToReal(lineIn.substr(12, lnPtr))), 1)); @@ -5898,7 +5883,7 @@ namespace OutputReportTabular { if (iscalc) { if (isASHRAE) { if (ashDesYear == "2001") { - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Heating Design Temperature 99.6% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5913,7 +5898,7 @@ namespace OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Heating Design Temperature 99% (C)", GetColumnUsingTabs(lineIn, 3) + degChar); } } else { // 2005 and 2009 are the same - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Heating Design Temperature 99.6% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5936,7 +5921,7 @@ namespace OutputReportTabular { col1 = 4; col2 = 5; } - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Heating Design Temperature 99.6% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5955,7 +5940,7 @@ namespace OutputReportTabular { if (iscalc) { if (isASHRAE) { if (ashDesYear == "2001") { - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Cooling Design Temperature 0.4% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5973,7 +5958,7 @@ namespace OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 2% (C)", GetColumnUsingTabs(lineIn, 6) + degChar); } } else { // 2005 and 2009 are the same - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Cooling Design Temperature 0.4% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -6001,7 +5986,7 @@ namespace OutputReportTabular { col2 = 5; col3 = 6; } - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Cooling Design Temperature 0.4% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -6035,7 +6020,7 @@ namespace OutputReportTabular { eposlt -= 2; } if (sposlt != std::string::npos && eposlt != std::string::npos) { - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Maximum Dry Bulb Temperature (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -6067,7 +6052,7 @@ namespace OutputReportTabular { eposlt -= 2; } if (sposlt != std::string::npos && eposlt != std::string::npos) { - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Minimum Dry Bulb Temperature (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -6099,7 +6084,7 @@ namespace OutputReportTabular { eposlt -= 2; } if (sposlt != std::string::npos && eposlt != std::string::npos) { - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Maximum Dew Point Temperature (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -6131,7 +6116,7 @@ namespace OutputReportTabular { eposlt -= 2; } if (sposlt != std::string::npos && eposlt != std::string::npos) { - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Minimum Dew Point Temperature (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -6154,7 +6139,7 @@ namespace OutputReportTabular { } } else if (SELECT_CASE_var == StatLineType::wthHDDLine) { // - 1745 (wthr file) annual heating degree-days (10°C baseline) if (storeASHRAEHDD != "") { - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "ASHRAE Handbook 2009 Heating Degree-Days - base 65°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, @@ -6163,13 +6148,13 @@ namespace OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Heating Degree-Days (base 18.3°C)", storeASHRAEHDD); } } else { - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Heating Degree-Days (base 65°F)", "not found"); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Heating Degree-Days (base 18.3°C)", "not found"); } } - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Weather File Heating Degree-Days - base 65°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, @@ -6183,7 +6168,7 @@ namespace OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "HDD and CDD data source", "Weather File Stat"); } else if (SELECT_CASE_var == StatLineType::wthCDDLine) { // - 464 (wthr file) annual cooling degree-days (18°C baseline) if (storeASHRAECDD != "") { - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "ASHRAE Handbook 2009 Cooling Degree-Days - base 50°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, @@ -6192,13 +6177,13 @@ namespace OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Cooling Degree-Days (base 10°C)", storeASHRAECDD); } } else { - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Cooling Degree-Days (base 50°F)", "not found"); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Cooling Degree-Days (base 10°C)", "not found"); } } - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Weather File Cooling Degree-Days - base 50°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, @@ -6723,7 +6708,7 @@ namespace OutputReportTabular { // CALL PreDefTableEntry(state, pdchLeedGenData,'Climate Zone','-') // CALL PreDefTableEntry(state, pdchLeedGenData,'Heating Degree Days','-') // CALL PreDefTableEntry(state, pdchLeedGenData,'Cooling Degree Days','-') - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "Total gross floor area [ft2]", "-"); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "Total gross floor area [m2]", "-"); @@ -6829,16 +6814,16 @@ namespace OutputReportTabular { verySmall = -1.0E280; // set the unit conversion - if (unitsStyle == unitsStyleNone) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::None) { energyUnitsString = "J"; energyUnitsConversionFactor = 1.0; - } else if (unitsStyle == unitsStyleJtoKWH) { + } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { energyUnitsString = "kWh"; energyUnitsConversionFactor = 1.0 / 3600000.0; - } else if (unitsStyle == unitsStyleJtoMJ) { + } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoMJ) { energyUnitsString = "MJ"; energyUnitsConversionFactor = 1.0 / 1000000.0; - } else if (unitsStyle == unitsStyleJtoGJ) { + } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoGJ) { energyUnitsString = "GJ"; energyUnitsConversionFactor = 1.0 / 1000000000.0; } else { // Should never happen but assures compilers of initialization @@ -6884,7 +6869,7 @@ namespace OutputReportTabular { curAggString = " {" + stripped(curAggString) + '}'; } // do the unit conversions - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { varNameWithUnits = MonthlyColumns(curCol).varName + unitEnumToStringBrackets(MonthlyColumns(curCol).units); LookupSItoIP(state, varNameWithUnits, indexUnitConv, curUnits); GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); @@ -7224,7 +7209,7 @@ namespace OutputReportTabular { for (iInObj = 1; iInObj <= OutputTableBinnedCount; ++iInObj) { firstReport = OutputTableBinned(iInObj).resIndex; curNameWithSIUnits = OutputTableBinned(iInObj).varOrMeter + unitEnumToStringBrackets(OutputTableBinned(iInObj).units); - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); curIntervalStart = ConvertIP(indexUnitConv, OutputTableBinned(iInObj).intervalStart); curIntervalSize = ConvertIPdelta(indexUnitConv, OutputTableBinned(iInObj).intervalSize); @@ -7348,7 +7333,7 @@ namespace OutputReportTabular { repStDev = 0.0; repMean = 0.0; } - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { tableBodyStat(1, 1) = RealToStr(ConvertIP(indexUnitConv, BinStatistics(repIndex).minimum), 2); tableBodyStat(1, 2) = RealToStr(ConvertIP(indexUnitConv, repMean - 2 * repStDev), 2); tableBodyStat(1, 3) = RealToStr(ConvertIP(indexUnitConv, repMean), 2); @@ -7578,13 +7563,13 @@ namespace OutputReportTabular { // unit conversion - all values are used as divisors { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { largeConversionFactor = 3600000.0; kConversionFactor = 1.0; waterConversionFactor = 1.0; areaConversionFactor = 1.0; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { largeConversionFactor = getSpecificUnitDivider(state, "J", "kBtu"); // 1054351.84 J to kBtu kConversionFactor = 1.0; waterConversionFactor = getSpecificUnitDivider(state, "m3", "gal"); // 0.003785413 m3 to gal @@ -7659,12 +7644,12 @@ namespace OutputReportTabular { tableBody.allocate(3, 4); { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Total Energy [kWh]"; columnHead(2) = "Energy Per Total Building Area [kWh/m2]"; columnHead(3) = "Energy Per Conditioned Building Area [kWh/m2]"; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { columnHead(1) = "Total Energy [kBtu]"; columnHead(2) = "Energy Per Total Building Area [kBtu/ft2]"; columnHead(3) = "Energy Per Conditioned Building Area [kBtu/ft2]"; @@ -8044,10 +8029,10 @@ namespace OutputReportTabular { tableBody.allocate(1, 3); { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Area [m2]"; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { columnHead(1) = "Area [ft2]"; } else { columnHead(1) = "Area [m2]"; @@ -8060,7 +8045,7 @@ namespace OutputReportTabular { tableBody = ""; tableBody(1, 1) = RealToStr(convBldgGrossFloorArea, 2); - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "Total gross floor area [ft2]", RealToStr(convBldgGrossFloorArea, 2)); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "Total gross floor area [m2]", RealToStr(convBldgGrossFloorArea, 2)); @@ -8126,8 +8111,8 @@ namespace OutputReportTabular { rowHead(16) = "Total End Uses"; { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Electricity [kWh]"; columnHead(2) = "Natural Gas [kWh]"; columnHead(3) = "Gasoline [kWh]"; @@ -8141,7 +8126,7 @@ namespace OutputReportTabular { columnHead(11) = "District Cooling [kWh]"; columnHead(12) = "District Heating [kWh]"; columnHead(13) = "Water [m3]"; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { columnHead(1) = "Electricity [kBtu]"; columnHead(2) = "Natural Gas [kBtu]"; columnHead(3) = "Gasoline [kBtu]"; @@ -8411,8 +8396,8 @@ namespace OutputReportTabular { columnHead(1) = "Subcategory"; { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(2) = "Electricity [kWh]"; columnHead(3) = "Natural Gas [kWh]"; columnHead(4) = "Gasoline [kWh]"; @@ -8426,7 +8411,7 @@ namespace OutputReportTabular { columnHead(12) = "District Cooling [kWh]"; columnHead(13) = "District Heating [kWh]"; columnHead(14) = "Water [m3]"; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { columnHead(2) = "Electricity [kBtu]"; columnHead(3) = "Natural Gas [kBtu]"; columnHead(4) = "Gasoline [kBtu]"; @@ -8599,8 +8584,8 @@ namespace OutputReportTabular { rowHead(4) = "Total"; { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Electricity Intensity [kWh/m2]"; columnHead(2) = "Natural Gas Intensity [kWh/m2]"; columnHead(3) = "Gasoline Intensity [kWh/m2]"; @@ -8614,7 +8599,7 @@ namespace OutputReportTabular { columnHead(11) = "District Cooling Intensity [kWh/m2]"; columnHead(12) = "District Heating Intensity [kWh/m2]"; columnHead(13) = "Water Intensity [m3/m2]"; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { columnHead(1) = "Electricity Intensity [kBtu/ft2]"; columnHead(2) = "Natural Gas Intensity [kBtu/ft2]"; columnHead(3) = "Gasoline Intensity [kBtu/ft2]"; @@ -8716,10 +8701,10 @@ namespace OutputReportTabular { tableBody.allocate(2, 14); { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Electricity [kWh]"; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { columnHead(1) = "Electricity [kBtu]"; } else { columnHead(1) = "Electricity [GJ]"; @@ -8800,10 +8785,10 @@ namespace OutputReportTabular { tableBody.allocate(2, 7); { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Heat [kWh]"; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { columnHead(1) = "Heat [kBtu]"; } else { columnHead(1) = "Heat [GJ]"; @@ -8882,10 +8867,10 @@ namespace OutputReportTabular { columnWidth = 14; // array assignment - same for all columns tableBody.allocate(2, 13); { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Water [m3]"; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { columnHead(1) = "Water [gal]"; } else { columnHead(1) = "Water [m3]"; @@ -8975,7 +8960,7 @@ namespace OutputReportTabular { curNameWithSIUnits = "Degrees [deltaC]"; curNameAndUnits = curNameWithSIUnits; - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); } columnHead(1) = curNameAndUnits; @@ -8983,7 +8968,7 @@ namespace OutputReportTabular { rowHead(1) = "Tolerance for Zone Heating Setpoint Not Met Time"; rowHead(2) = "Tolerance for Zone Cooling Setpoint Not Met Time"; - if (unitsStyle != unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle != iUnitsStyle::InchPound) { tableBody(1, 1) = RealToStr(std::abs(deviationFromSetPtThresholdHtg), 2); tableBody(1, 2) = RealToStr(deviationFromSetPtThresholdClg, 2); } else { @@ -9146,11 +9131,11 @@ namespace OutputReportTabular { // unit conversion - all values are used as divisors { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { largeConversionFactor = 3600000.0; areaConversionFactor = 1.0; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { largeConversionFactor = getSpecificUnitDivider(state, "J", "kBtu"); // 1054351.84 J to kBtu areaConversionFactor = getSpecificUnitDivider(state, "m2", "ft2"); // 0.092893973 m2 to ft2 } else { @@ -9211,8 +9196,8 @@ namespace OutputReportTabular { largeConversionFactor = 1.0; { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Source Electricity [kWh]"; columnHead(2) = "Source Natural Gas [kWh]"; columnHead(3) = "Source Gasoline [kWh]"; @@ -9225,7 +9210,7 @@ namespace OutputReportTabular { columnHead(10) = "Source Other Fuel 2 [kWh]"; columnHead(11) = "Source District Cooling [kWh]"; columnHead(12) = "Source District Heating [kWh]"; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { columnHead(1) = "Source Electricity [kBtu]"; columnHead(2) = "Source Natural Gas [kBtu]"; columnHead(3) = "Source Gasoline [kBtu]"; @@ -9288,8 +9273,8 @@ namespace OutputReportTabular { // Normalized by Area tables { - auto const SELECT_CASE_var(unitsStyle); - if (SELECT_CASE_var == unitsStyleJtoKWH) { + auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Source Electricity [kWh/m2]"; columnHead(2) = "Source Natural Gas [kWh/m2]"; columnHead(3) = "Source Gasoline [kWh/m2]"; @@ -9302,7 +9287,7 @@ namespace OutputReportTabular { columnHead(10) = "Source Other Fuel 2 [kWh/m2]"; columnHead(11) = "Source District Cooling [kWh/m2]"; columnHead(12) = "Source District Heating [kWh/m2]"; - } else if (SELECT_CASE_var == unitsStyleInchPound) { + } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { columnHead(1) = "Source Electricity [kBtu/ft2]"; columnHead(2) = "Source Natural Gas [kBtu/ft2]"; columnHead(3) = "Source Gasoline [kBtu/ft2]"; @@ -9502,7 +9487,7 @@ namespace OutputReportTabular { collapsedTotal(12) = gatherDemandTotal(distrHeatSelected); // establish unit conversion factors - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { powerConversion = getSpecificUnitMultiplier(state, "W", "kBtuh"); flowConversion = getSpecificUnitMultiplier(state, "m3/s", "gal/min"); } else { @@ -9639,7 +9624,7 @@ namespace OutputReportTabular { rowHead(16) = ""; rowHead(17) = "Total End Uses"; - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { columnHead(1) = "Electricity [kBtuh]"; columnHead(2) = "Natural Gas [kBtuh]"; columnHead(3) = "Gasoline [kBtuh]"; @@ -9742,7 +9727,7 @@ namespace OutputReportTabular { } } - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { columnHead(1) = "Subcategory"; columnHead(2) = "Electricity [kBtuh]"; columnHead(3) = "Natural Gas [kBtuh]"; @@ -9978,7 +9963,7 @@ namespace OutputReportTabular { rowHead(7) = "Permits, Bonds, Insurance (~~$~~)"; rowHead(8) = "Commissioning (~~$~~)"; rowHead(9) = "Cost Estimate Total (~~$~~)"; - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { SIunit = "[m2]"; LookupSItoIP(state, SIunit, unitConvIndex, m2_unitName); m2_unitConv = ConvertIP(unitConvIndex, 1.0); @@ -10102,7 +10087,7 @@ namespace OutputReportTabular { for (item = 1; item <= state.dataCostEstimateManager->NumLineItems; ++item) { tableBody(1, item) = fmt::to_string(state.dataCostEstimateManager->CostLineItem(item).LineNumber); tableBody(2, item) = state.dataCostEstimateManager->CostLineItem(item).LineName; - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, state.dataCostEstimateManager->CostLineItem(item).Units, unitConvIndex, IPunitName); if (unitConvIndex != 0) { IPqty = ConvertIP(unitConvIndex, state.dataCostEstimateManager->CostLineItem(item).Qty); @@ -10328,7 +10313,7 @@ namespace OutputReportTabular { WriteReportHeaders("Input Verification and Results Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // do unit conversions if necessary - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { SIunit = "[m]"; LookupSItoIP(state, SIunit, unitConvIndex, m_unitName); m_unitConv = ConvertIP(unitConvIndex, 1.0); @@ -11459,10 +11444,10 @@ namespace OutputReportTabular { ++countColumn; // do the unit conversions colTagWithSI = state.dataOutRptPredefined->columnTag(kColumnTag).heading; - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, colTagWithSI, indexUnitConv, curColTag); colUnitConv(countColumn) = indexUnitConv; - } else if (unitsStyle == unitsStyleJtoKWH) { + } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { LookupJtokWH(colTagWithSI, indexUnitConv, curColTag); colUnitConv(countColumn) = indexUnitConv; } else { @@ -11494,10 +11479,10 @@ namespace OutputReportTabular { } } // finally assign the entry to the place in the table body - if (unitsStyle == unitsStyleInchPound || unitsStyle == unitsStyleJtoKWH) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound || state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { columnUnitConv = colUnitConv(colCurrent); if (UtilityRoutines::SameString(state.dataOutRptPredefined->subTable(jSubTable).name, "SizingPeriod:DesignDay") && - unitsStyle == unitsStyleInchPound) { + state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { if (UtilityRoutines::SameString(columnHead(colCurrent), "Humidity Value")) { LookupSItoIP(state, state.dataOutRptPredefined->tableEntry(lTableEntry + 1).charEntry, columnUnitConv, repTableTag); state.dataOutRptPredefined->tableEntry(lTableEntry + 1).charEntry = repTableTag; @@ -11669,7 +11654,7 @@ namespace OutputReportTabular { for (jUnique = 1; jUnique <= numUniqueDesc; ++jUnique) { // do the unit conversions curColHeadWithSI = uniqueDesc(jUnique); - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, curColHeadWithSI, indexUnitConv, curColHead); colUnitConv(jUnique) = indexUnitConv; } else { @@ -11703,7 +11688,7 @@ namespace OutputReportTabular { } if ((foundDesc >= 1) && (foundObj >= 1)) { curValueSI = state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).valField; - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { if (colUnitConv(foundDesc) != 0) { curValue = ConvertIP(colUnitConv(foundDesc), curValueSI); } else { @@ -11997,7 +11982,7 @@ namespace OutputReportTabular { std::vector dataFields = splitCommaString(bodyLine); rowHead(rowNum) = fmt::to_string(rowNum); for (int iCol = 1; iCol <= numCols && iCol < int(dataFields.size()); ++iCol) { - if (unitsStyle == unitsStyleInchPound || unitsStyle == unitsStyleJtoKWH) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound || state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { if (isNumber(dataFields[iCol]) && colUnitConv(iCol) > 0) { // if it is a number that has a conversion int numDecimalDigits = digitsAferDecimal(dataFields[iCol]); Real64 convertedVal = ConvertIP(colUnitConv(iCol), StrToReal(dataFields[iCol])); @@ -12039,9 +12024,9 @@ namespace OutputReportTabular { { std::string curHeading = ""; int unitConv = 0; - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, heading, unitConv, curHeading); - } else if (unitsStyle == unitsStyleJtoKWH) { + } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { LookupJtokWH(heading, unitConv, curHeading); } else { curHeading = heading; @@ -13931,7 +13916,7 @@ namespace OutputReportTabular { // apply unit conversions to the load components summary tables void LoadSummaryUnitConversion(EnergyPlusData &state, CompLoadTablesType &compLoadTotal) { - if (unitsStyle == unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { Real64 powerConversion = getSpecificUnitMultiplier(state, "W", "Btu/h"); Real64 areaConversion = getSpecificUnitMultiplier(state, "m2", "ft2"); Real64 powerPerAreaConversion = getSpecificUnitMultiplier(state, "W/m2", "Btu/h-ft2"); @@ -14091,7 +14076,7 @@ namespace OutputReportTabular { rowHead(rGrdTot) = "Grand Total"; columnHead.allocate(cPerArea); - if (unitsStyle != unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle != iUnitsStyle::InchPound) { columnHead(cSensInst) = "Sensible - Instant [W]"; columnHead(cSensDelay) = "Sensible - Delayed [W]"; columnHead(cSensRA) = "Sensible - Return Air [W]"; @@ -14134,7 +14119,7 @@ namespace OutputReportTabular { tableBody = ""; columnHead(1) = "Value"; - if (unitsStyle != unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle != iUnitsStyle::InchPound) { rowHead(1) = "Time of Peak Load"; rowHead(2) = "Outside Dry Bulb Temperature [C]"; rowHead(3) = "Outside Wet Bulb Temperature [C]"; @@ -14216,7 +14201,7 @@ namespace OutputReportTabular { tableBody = ""; columnHead(1) = "Value"; - if (unitsStyle != unitsStyleInchPound) { + if (state.dataOutRptTab->unitsStyle != iUnitsStyle::InchPound) { rowHead(1) = "Outside Air Fraction [fraction]"; rowHead(2) = "Airflow per Floor Area [m3/s-m2]"; rowHead(3) = "Airflow per Total Capacity [m3/s-W]"; @@ -14326,15 +14311,15 @@ namespace OutputReportTabular { std::ostream &tbl_stream(*TabularOutputFile(iStyle)); std::string const &curDel(del(iStyle)); auto const style(TableStyle(iStyle)); - if ((style == tableStyleComma) || (style == tableStyleTab)) { + if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab)) { tbl_stream << "----------------------------------------------------------------------------------------------------\n"; tbl_stream << "REPORT:" << curDel << modifiedReportName << '\n'; tbl_stream << "FOR:" << curDel << objectName << '\n'; - } else if (style == tableStyleFixed) { + } else if (style == iTableStyle::Fixed) { tbl_stream << "----------------------------------------------------------------------------------------------------\n"; tbl_stream << "REPORT: " << curDel << modifiedReportName << '\n'; tbl_stream << "FOR: " << curDel << objectName << '\n'; - } else if (style == tableStyleHTML) { + } else if (style == iTableStyle::HTML) { tbl_stream << "
\n"; tbl_stream << "

Table of Contents

\n"; tbl_stream << "\n"; @@ -14344,7 +14329,7 @@ namespace OutputReportTabular { << td(3) << '\n'; tbl_stream << " " << std::setw(2) << td(5) << ':' << std::setw(2) << td(6) << ':' << std::setw(2) << td(7) << std::setfill(' ') << "

\n"; - } else if (style == tableStyleXML) { + } else if (style == iTableStyle::XML) { if (len(prevReportName) != 0) { tbl_stream << "\n"; // close the last element if it was used. } @@ -14388,14 +14373,14 @@ namespace OutputReportTabular { for (iStyle = 1; iStyle <= numStyles; ++iStyle) { auto const style(TableStyle(iStyle)); - if ((style == tableStyleComma) || (style == tableStyleTab) || (style == tableStyleFixed)) { + if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab) || (style == iTableStyle::Fixed)) { std::ostream &tbl_stream(*TabularOutputFile(iStyle)); tbl_stream << subtitle << "\n\n"; - } else if (style == tableStyleHTML) { + } else if (style == iTableStyle::HTML) { std::ostream &tbl_stream(*TabularOutputFile(iStyle)); tbl_stream << "" << subtitle << "

\n"; tbl_stream << "\n"; - } else if (style == tableStyleXML) { + } else if (style == iTableStyle::XML) { // save the active subtable name for the XML reporting activeSubTableName = subtitle; // no other output is needed since WriteTable uses the subtable name for each record. @@ -14437,17 +14422,17 @@ namespace OutputReportTabular { for (iStyle = 1; iStyle <= numStyles; ++iStyle) { auto const style(TableStyle(iStyle)); - if ((style == tableStyleComma) || (style == tableStyleTab) || (style == tableStyleFixed)) { + if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab) || (style == iTableStyle::Fixed)) { std::ostream &tbl_stream(*TabularOutputFile(iStyle)); tbl_stream << lineOfText << '\n'; - } else if (style == tableStyleHTML) { + } else if (style == iTableStyle::HTML) { std::ostream &tbl_stream(*TabularOutputFile(iStyle)); if (useBold) { tbl_stream << "" << lineOfText << "

\n"; } else { tbl_stream << lineOfText << "
\n"; } - } else if (style == tableStyleXML) { + } else if (style == iTableStyle::XML) { std::ostream &tbl_stream(*TabularOutputFile(iStyle)); if (!lineOfText.empty()) { tbl_stream << "" << lineOfText << "\n"; @@ -14597,7 +14582,7 @@ namespace OutputReportTabular { } } // extra preprocessing for fixed style reports - if (TableStyle(iStyle) == tableStyleFixed) { + if (TableStyle(iStyle) == iTableStyle::Fixed) { // break column headings into multiple rows if long (for fixed) or contain two spaces in a row. for (iCol = 1; iCol <= colsColumnLabels; ++iCol) { colWidthLimit = widthColumn(iCol); @@ -14616,7 +14601,7 @@ namespace OutputReportTabular { // output depending on style of format auto const style(TableStyle(iStyle)); - if ((style == tableStyleComma) || (style == tableStyleTab)) { + if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab)) { // column headers for (jRow = 1; jRow <= maxNumColLabelRows; ++jRow) { outputLine = curDel; // one leading delimiters on column header lines @@ -14640,7 +14625,7 @@ namespace OutputReportTabular { } tbl_stream << "\n\n"; - } else if (style == tableStyleFixed) { + } else if (style == iTableStyle::Fixed) { // column headers for (jRow = 1; jRow <= maxNumColLabelRows; ++jRow) { outputLine = blank; // spaces(:maxWidthRowLabel+2) // two extra spaces and leave blank area for row labels @@ -14674,7 +14659,7 @@ namespace OutputReportTabular { } tbl_stream << "\n\n"; - } else if (style == tableStyleHTML) { + } else if (style == iTableStyle::HTML) { // set up it being a table tbl_stream << "\n"; // column headers @@ -14715,7 +14700,7 @@ namespace OutputReportTabular { } } tbl_stream << "

\n"; - } else if (style == tableStyleXML) { + } else if (style == iTableStyle::XML) { // check if entire table is blank and it if is skip generating anything isTableBlank = true; for (jRow = 1; jRow <= rowsBody; ++jRow) { diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 4b124b236f0..f8df0b13798 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -92,18 +92,23 @@ namespace OutputReportTabular { extern int const aggTypeMaximumDuringHoursShown; extern int const aggTypeMinimumDuringHoursShown; - extern int const tableStyleComma; - extern int const tableStyleTab; - extern int const tableStyleFixed; - extern int const tableStyleHTML; - extern int const tableStyleXML; - - extern int const unitsStyleNone; // no change to any units - extern int const unitsStyleJtoKWH; - extern int const unitsStyleJtoMJ; - extern int const unitsStyleJtoGJ; - extern int const unitsStyleInchPound; - extern int const unitsStyleNotFound; + enum class iTableStyle { + Unassigned, + Comma, + Tab, + Fixed, + HTML, + XML, + }; + + enum class iUnitsStyle { + None, + JtoKWH, + JtoMJ, + JtoGJ, + InchPound, + NotFound, + }; extern int const stepTypeZone; extern int const stepTypeHVAC; @@ -184,7 +189,6 @@ namespace OutputReportTabular { constexpr int maxNumStyles(5); // From Report:Table:Style - extern int unitsStyle; // see list of parameters extern int numStyles; extern std::ofstream csv_stream; // CSV table stream extern std::ofstream tab_stream; // Tab table stream @@ -193,7 +197,7 @@ namespace OutputReportTabular { extern std::ofstream xml_stream; // XML table stream extern Array1D TabularOutputFile; // Table stream array extern Array1D_string del; // the delimiter to use - extern Array1D_int TableStyle; // see list of parameters + extern Array1D TableStyle; // see list of parameters extern Real64 timeInYear; @@ -732,7 +736,7 @@ namespace OutputReportTabular { void GetInputTabularStyle(EnergyPlusData &state); - int SetUnitsStyleFromString(std::string const &unitStringIn); + iUnitsStyle SetUnitsStyleFromString(std::string const &unitStringIn); void GetInputOutputTableSummaryReports(EnergyPlusData &state); @@ -1048,9 +1052,11 @@ namespace OutputReportTabular { struct OutputReportTabularData : BaseGlobalStruct { + OutputReportTabular::iUnitsStyle unitsStyle = OutputReportTabular::iUnitsStyle::None; + void clear_state() override { - + this->unitsStyle = OutputReportTabular::iUnitsStyle::None; } }; diff --git a/src/EnergyPlus/OutputReportTabularAnnual.cc b/src/EnergyPlus/OutputReportTabularAnnual.cc index 781cdcb1a7a..dad89426610 100644 --- a/src/EnergyPlus/OutputReportTabularAnnual.cc +++ b/src/EnergyPlus/OutputReportTabularAnnual.cc @@ -629,11 +629,11 @@ namespace OutputReportTabularAnnual { // invoking the writeTable member function for each of the AnnualTable objects std::vector::iterator annualTableIt; for (annualTableIt = annualTables.begin(); annualTableIt != annualTables.end(); ++annualTableIt) { - annualTableIt->writeTable(state, OutputReportTabular::unitsStyle); + annualTableIt->writeTable(state, state.dataOutRptTab->unitsStyle); } } - void AnnualTable::writeTable(EnergyPlusData &state, int unitsStyle) + void AnnualTable::writeTable(EnergyPlusData &state, OutputReportTabular::iUnitsStyle unitsStyle) { Array1D_string columnHead; Array1D_int columnWidth; @@ -700,7 +700,7 @@ namespace OutputReportTabularAnnual { curAggString = " {" + trim(curAggString) + '}'; } // do the unit conversions - if (unitsStyle == OutputReportTabular::unitsStyleInchPound) { + if (unitsStyle == OutputReportTabular::iUnitsStyle::InchPound) { varNameWithUnits = fldStIt->m_variMeter + unitEnumToStringBrackets(fldStIt->m_varUnits); OutputReportTabular::LookupSItoIP(state, varNameWithUnits, indexUnitConv, curUnits); OutputReportTabular::GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); @@ -1007,20 +1007,20 @@ namespace OutputReportTabularAnnual { return retStringVec; } - Real64 AnnualTable::setEnergyUnitStringAndFactor(int const unitsStyle, std::string &unitString) + Real64 AnnualTable::setEnergyUnitStringAndFactor(OutputReportTabular::iUnitsStyle const unitsStyle, std::string &unitString) { Real64 convFactor; // set the unit conversion - if (unitsStyle == OutputReportTabular::unitsStyleNone) { + if (unitsStyle == OutputReportTabular::iUnitsStyle::None) { unitString = "J"; convFactor = 1.0; - } else if (unitsStyle == OutputReportTabular::unitsStyleJtoKWH) { + } else if (unitsStyle == OutputReportTabular::iUnitsStyle::JtoKWH) { unitString = "kWh"; convFactor = 1.0 / 3600000.0; - } else if (unitsStyle == OutputReportTabular::unitsStyleJtoMJ) { + } else if (unitsStyle == OutputReportTabular::iUnitsStyle::JtoMJ) { unitString = "MJ"; convFactor = 1.0 / 1000000.0; - } else if (unitsStyle == OutputReportTabular::unitsStyleJtoGJ) { + } else if (unitsStyle == OutputReportTabular::iUnitsStyle::JtoGJ) { unitString = "GJ"; convFactor = 1.0 / 1000000000.0; } else { // Should never happen but assures compilers of initialization @@ -1182,7 +1182,7 @@ namespace OutputReportTabularAnnual { curAgg == AnnualFieldSet::AggregationKind::hoursInTenBinsPlusMinusThreeStdDev) { // the size the deferred vectors should be same for all rows if (allRowsSameSizeDefferedVectors(fldStIt)) { - convertUnitForDeferredResults(state, fldStIt, OutputReportTabular::unitsStyle); + convertUnitForDeferredResults(state, fldStIt, state.dataOutRptTab->unitsStyle); std::vector deferredTotalForColumn; Real64 minVal = veryLarge; Real64 maxVal = verySmall; @@ -1257,7 +1257,9 @@ namespace OutputReportTabularAnnual { return returnFlag; } - void AnnualTable::convertUnitForDeferredResults(EnergyPlusData &state, std::vector::iterator fldStIt, int const unitsStyle) + void AnnualTable::convertUnitForDeferredResults(EnergyPlusData &state, + std::vector::iterator fldStIt, + OutputReportTabular::iUnitsStyle const unitsStyle) { Real64 curConversionFactor; Real64 curConversionOffset; @@ -1269,7 +1271,7 @@ namespace OutputReportTabularAnnual { Real64 curIP; Real64 energyUnitsConversionFactor = AnnualTable::setEnergyUnitStringAndFactor(unitsStyle, energyUnitsString); // do the unit conversions - if (unitsStyle == OutputReportTabular::unitsStyleInchPound) { + if (unitsStyle == OutputReportTabular::iUnitsStyle::InchPound) { varNameWithUnits = fldStIt->m_variMeter + '[' + unitEnumToString(fldStIt->m_varUnits) + ']'; OutputReportTabular::LookupSItoIP(state, varNameWithUnits, indexUnitConv, curUnits); OutputReportTabular::GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); diff --git a/src/EnergyPlus/OutputReportTabularAnnual.hh b/src/EnergyPlus/OutputReportTabularAnnual.hh index 99cd5f5f0f1..bfca957e520 100644 --- a/src/EnergyPlus/OutputReportTabularAnnual.hh +++ b/src/EnergyPlus/OutputReportTabularAnnual.hh @@ -122,7 +122,7 @@ namespace OutputReportTabularAnnual { void resetGathering(); - void writeTable(EnergyPlusData &state, int unitsStyle); + void writeTable(EnergyPlusData &state, OutputReportTabular::iUnitsStyle unitsStyle); void addTableOfContents(std::ostream &); @@ -153,7 +153,7 @@ namespace OutputReportTabularAnnual { std::vector setupAggString(); - Real64 setEnergyUnitStringAndFactor(int const unitsStyle, std::string &unitString); + Real64 setEnergyUnitStringAndFactor(OutputReportTabular::iUnitsStyle const unitsStyle, std::string &unitString); int columnCountForAggregation(AnnualFieldSet::AggregationKind curAgg); @@ -163,7 +163,9 @@ namespace OutputReportTabularAnnual { bool allRowsSameSizeDefferedVectors(std::vector::iterator fldStIt); - void convertUnitForDeferredResults(EnergyPlusData &state, std::vector::iterator fldStIt, int const unitsStyle); + void convertUnitForDeferredResults(EnergyPlusData &state, + std::vector::iterator fldStIt, + OutputReportTabular::iUnitsStyle const unitsStyle); std::vector calculateBins(int const numberOfBins, std::vector const valuesToBin, diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index c7ea4766bec..82462cb9827 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -103,12 +103,12 @@ using namespace SimulationManager; TEST_F(EnergyPlusFixture, OutputReportTabularTest_ConfirmSetUnitsStyleFromString) { - EXPECT_EQ(unitsStyleNone, SetUnitsStyleFromString("None")); - EXPECT_EQ(unitsStyleJtoKWH, SetUnitsStyleFromString("JTOKWH")); - EXPECT_EQ(unitsStyleJtoMJ, SetUnitsStyleFromString("JTOMJ")); - EXPECT_EQ(unitsStyleJtoGJ, SetUnitsStyleFromString("JTOGJ")); - EXPECT_EQ(unitsStyleInchPound, SetUnitsStyleFromString("INCHPOUND")); - EXPECT_EQ(unitsStyleNotFound, SetUnitsStyleFromString("qqq")); + EXPECT_EQ(OutputReportTabular::iUnitsStyle::None, SetUnitsStyleFromString("None")); + EXPECT_EQ(OutputReportTabular::iUnitsStyle::JtoKWH, SetUnitsStyleFromString("JTOKWH")); + EXPECT_EQ(OutputReportTabular::iUnitsStyle::JtoMJ, SetUnitsStyleFromString("JTOMJ")); + EXPECT_EQ(OutputReportTabular::iUnitsStyle::JtoGJ, SetUnitsStyleFromString("JTOGJ")); + EXPECT_EQ(OutputReportTabular::iUnitsStyle::InchPound, SetUnitsStyleFromString("INCHPOUND")); + EXPECT_EQ(OutputReportTabular::iUnitsStyle::NotFound, SetUnitsStyleFromString("qqq")); } TEST_F(EnergyPlusFixture, OutputReportTabularTest_Basic) @@ -202,7 +202,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_unitsFromHeading) Real64 curConversionOffset; SetupUnitConversions(); - unitsStyle = unitsStyleInchPound; + state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::InchPound; unitString = ""; EXPECT_EQ(97, unitsFromHeading(*state, unitString)); @@ -6708,7 +6708,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_LoadSummaryUnitConversion_test compLoad.airflowPerTotCap = 0.2; compLoad.totCapPerArea = 0.15; - unitsStyle = unitsStyleInchPound; + state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::InchPound; Real64 powerConversion = getSpecificUnitMultiplier(*state, "W", "Btu/h"); Real64 areaConversion = getSpecificUnitMultiplier(*state, "m2", "ft2"); Real64 airFlowConversion = getSpecificUnitMultiplier(*state, "m3/s", "ft3/min"); @@ -6919,7 +6919,7 @@ TEST_F(SQLiteFixture, OutputReportTabular_WriteLoadComponentSummaryTables_AirLoo EnergyPlus::sqlite->createSQLiteSimulationsRecord(1, "EnergyPlus Version", "Current Time"); OutputReportTabular::SetupUnitConversions(); - OutputReportTabular::unitsStyle = OutputReportTabular::unitsStyleInchPound; + state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::InchPound; // We ask for the air loop component load summary since that's the one we test // We also ask for the zone component load summary because that's necessary to "copy" the load and trigger a potential double conversion @@ -7245,7 +7245,7 @@ TEST_F(SQLiteFixture, OutputReportTabularTest_PredefinedTableDXConversion) WriteTabularFiles = true; SetupUnitConversions(); - OutputReportTabular::unitsStyle = OutputReportTabular::unitsStyleInchPound; + state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::InchPound; SetPredefinedTables(*state); std::string CompName = "My DX Coil with 10000W cooling"; @@ -7303,7 +7303,7 @@ TEST_F(SQLiteFixture, OutputReportTabularTest_PredefinedTableCoilHumRat) WriteTabularFiles = true; SetupUnitConversions(); - OutputReportTabular::unitsStyle = OutputReportTabular::unitsStyleInchPound; + state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::InchPound; SetPredefinedTables(*state); std::string CompName = "My DX Coil"; @@ -7752,7 +7752,7 @@ TEST_F(SQLiteFixture, WriteSourceEnergyEndUseSummary_TestPerArea) { OutputReportTabular::gatherTotalsBySourceBEPS(1) = 3.6e10; Real64 eleckWh = 1e4; - OutputReportTabular::unitsStyle = OutputReportTabular::unitsStyleJtoKWH; + state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::JtoKWH; // Now we're ready to call the actual function of interest OutputReportTabular::WriteSourceEnergyEndUseSummary(*state); @@ -7812,7 +7812,7 @@ TEST_F(SQLiteFixture, OutputReportTabular_EndUseBySubcategorySQL) OutputReportTabular::WriteTabularFiles = true; SetupUnitConversions(); - OutputReportTabular::unitsStyle = OutputReportTabular::unitsStyleJtoKWH; + state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::JtoKWH; // Needed to avoid crash (from ElectricPowerServiceManager.hh) createFacilityElectricPowerServiceObject(); diff --git a/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc b/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc index a714a17e20d..88919cbaf4c 100644 --- a/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc @@ -49,11 +49,11 @@ // Google Test Headers #include -// ObjexxFCL Headers -#include + // EnergyPlus Headers #include #include +#include #include #include #include From 23b0ec9ad0aafbe2f2caa6e8088202f6a456f3b8 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 18 Dec 2020 12:51:59 -0700 Subject: [PATCH 03/14] move OutputReportTabular::AggType const ints to enum --- src/EnergyPlus/OutputReportTabular.cc | 1087 ++++++++++++------------- src/EnergyPlus/OutputReportTabular.hh | 43 +- 2 files changed, 556 insertions(+), 574 deletions(-) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 39803ac87a5..584e083e92e 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -77,9 +78,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -128,9 +127,7 @@ #include #include -namespace EnergyPlus { - -namespace OutputReportTabular { +namespace EnergyPlus::OutputReportTabular { // MODULE INFORMATION: // AUTHOR Jason Glazer of GARD Analytics, Inc. @@ -173,23 +170,6 @@ namespace OutputReportTabular { using namespace DataHeatBalance; using namespace HybridModel; - // Data - // MODULE PARAMETER DEFINITIONS: - - int const aggTypeSumOrAvg(1); - int const aggTypeMaximum(2); - int const aggTypeMinimum(3); - int const aggTypeValueWhenMaxMin(4); - int const aggTypeHoursZero(5); - int const aggTypeHoursNonZero(6); - int const aggTypeHoursPositive(7); - int const aggTypeHoursNonPositive(8); - int const aggTypeHoursNegative(9); - int const aggTypeHoursNonNegative(10); - int const aggTypeSumOrAverageHoursShown(11); - int const aggTypeMaximumDuringHoursShown(12); - int const aggTypeMinimumDuringHoursShown(13); - // MODULE VARIABLE DECLARATIONS: // The Binned table type is different and only references one variable and its structure is very @@ -799,7 +779,7 @@ namespace OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int curTable; // index of the current table being processed in MonthlyInput - int curAggType; // kind of aggregation identified (see AggType parameters) + iAggType curAggType; // kind of aggregation identified (see AggType parameters) std::string curAggString; // Current aggregation sting int jField; int NumParams; // Number of elements combined @@ -846,33 +826,33 @@ namespace OutputReportTabular { curAggString = AlphArray(jField + 1); // set accumulator values to default as appropriate for aggregation type if (UtilityRoutines::SameString(curAggString, "SumOrAverage")) { - curAggType = aggTypeSumOrAvg; + curAggType = iAggType::SumOrAvg; } else if (UtilityRoutines::SameString(curAggString, "Maximum")) { - curAggType = aggTypeMaximum; + curAggType = iAggType::Maximum; } else if (UtilityRoutines::SameString(curAggString, "Minimum")) { - curAggType = aggTypeMinimum; + curAggType = iAggType::Minimum; } else if (UtilityRoutines::SameString(curAggString, "ValueWhenMaximumOrMinimum")) { - curAggType = aggTypeValueWhenMaxMin; + curAggType = iAggType::ValueWhenMaxMin; } else if (UtilityRoutines::SameString(curAggString, "HoursZero")) { - curAggType = aggTypeHoursZero; + curAggType = iAggType::HoursZero; } else if (UtilityRoutines::SameString(curAggString, "HoursNonzero")) { - curAggType = aggTypeHoursNonZero; + curAggType = iAggType::HoursNonZero; } else if (UtilityRoutines::SameString(curAggString, "HoursPositive")) { - curAggType = aggTypeHoursPositive; + curAggType = iAggType::HoursPositive; } else if (UtilityRoutines::SameString(curAggString, "HoursNonpositive")) { - curAggType = aggTypeHoursNonPositive; + curAggType = iAggType::HoursNonPositive; } else if (UtilityRoutines::SameString(curAggString, "HoursNegative")) { - curAggType = aggTypeHoursNegative; + curAggType = iAggType::HoursNegative; } else if (UtilityRoutines::SameString(curAggString, "HoursNonnegative")) { - curAggType = aggTypeHoursNonNegative; + curAggType = iAggType::HoursNonNegative; } else if (UtilityRoutines::SameString(curAggString, "SumOrAverageDuringHoursShown")) { - curAggType = aggTypeSumOrAverageHoursShown; + curAggType = iAggType::SumOrAverageHoursShown; } else if (UtilityRoutines::SameString(curAggString, "MaximumDuringHoursShown")) { - curAggType = aggTypeMaximumDuringHoursShown; + curAggType = iAggType::MaximumDuringHoursShown; } else if (UtilityRoutines::SameString(curAggString, "MinimumDuringHoursShown")) { - curAggType = aggTypeMinimumDuringHoursShown; + curAggType = iAggType::MinimumDuringHoursShown; } else { - curAggType = aggTypeSumOrAvg; + curAggType = iAggType::SumOrAvg; ShowWarningError(state, CurrentModuleObject + '=' + MonthlyInput(TabNum).name + ", Variable name=" + AlphArray(jField)); ShowContinueError(state, "Invalid aggregation type=\"" + curAggString + "\" Defaulting to SumOrAverage."); } @@ -934,7 +914,7 @@ namespace OutputReportTabular { return MonthlyInputCount; } - void AddMonthlyFieldSetInput(int const inMonthReport, std::string const &inVariMeter, std::string const &inColHead, int const inAggregate) + void AddMonthlyFieldSetInput(int const inMonthReport, std::string const &inVariMeter, std::string const &inColHead, iAggType const inAggregate) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -1197,7 +1177,7 @@ namespace OutputReportTabular { e.avgSum = OutputProcessor::StoreType::Averaged; e.stepType = OutputProcessor::TimeStepType::TimeStepZone; e.units = OutputProcessor::Unit::None; - e.aggType = 0; + e.aggType = iAggType::Unassigned; } for (colNum = 1; colNum <= MonthlyColumnsCount; ++colNum) { MonthlyColumns(colNum).reslt = 0.0; @@ -1359,36 +1339,36 @@ namespace OutputReportTabular { // set accumulator values to default as appropriate for aggregation type { auto const SELECT_CASE_var(MonthlyColumns(mColumn).aggType); - if (SELECT_CASE_var == aggTypeSumOrAvg) { + if (SELECT_CASE_var == iAggType::SumOrAvg) { MonthlyColumns(mColumn).reslt = 0.0; MonthlyColumns(mColumn).duration = 0.0; - } else if (SELECT_CASE_var == aggTypeMaximum) { + } else if (SELECT_CASE_var == iAggType::Maximum) { MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); MonthlyColumns(mColumn).timeStamp = 0; - } else if (SELECT_CASE_var == aggTypeMinimum) { + } else if (SELECT_CASE_var == iAggType::Minimum) { MonthlyColumns(mColumn).reslt = HUGE_(BigNum); MonthlyColumns(mColumn).timeStamp = 0; - } else if (SELECT_CASE_var == aggTypeValueWhenMaxMin) { + } else if (SELECT_CASE_var == iAggType::ValueWhenMaxMin) { MonthlyColumns(mColumn).reslt = 0.0; - } else if (SELECT_CASE_var == aggTypeHoursZero) { + } else if (SELECT_CASE_var == iAggType::HoursZero) { MonthlyColumns(mColumn).reslt = 0.0; - } else if (SELECT_CASE_var == aggTypeHoursNonZero) { + } else if (SELECT_CASE_var == iAggType::HoursNonZero) { MonthlyColumns(mColumn).reslt = 0.0; - } else if (SELECT_CASE_var == aggTypeHoursPositive) { + } else if (SELECT_CASE_var == iAggType::HoursPositive) { MonthlyColumns(mColumn).reslt = 0.0; - } else if (SELECT_CASE_var == aggTypeHoursNonPositive) { + } else if (SELECT_CASE_var == iAggType::HoursNonPositive) { MonthlyColumns(mColumn).reslt = 0.0; - } else if (SELECT_CASE_var == aggTypeHoursNegative) { + } else if (SELECT_CASE_var == iAggType::HoursNegative) { MonthlyColumns(mColumn).reslt = 0.0; - } else if (SELECT_CASE_var == aggTypeHoursNonNegative) { + } else if (SELECT_CASE_var == iAggType::HoursNonNegative) { MonthlyColumns(mColumn).reslt = 0.0; - } else if (SELECT_CASE_var == aggTypeSumOrAverageHoursShown) { + } else if (SELECT_CASE_var == iAggType::SumOrAverageHoursShown) { MonthlyColumns(mColumn).reslt = 0.0; MonthlyColumns(mColumn).duration = 0.0; - } else if (SELECT_CASE_var == aggTypeMaximumDuringHoursShown) { + } else if (SELECT_CASE_var == iAggType::MaximumDuringHoursShown) { MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); MonthlyColumns(mColumn).timeStamp = 0; - } else if (SELECT_CASE_var == aggTypeMinimumDuringHoursShown) { + } else if (SELECT_CASE_var == iAggType::MinimumDuringHoursShown) { MonthlyColumns(mColumn).reslt = HUGE_(BigNum); MonthlyColumns(mColumn).timeStamp = 0; } @@ -1412,7 +1392,7 @@ namespace OutputReportTabular { MonthlyColumns(mColumn).avgSum = OutputProcessor::StoreType::Averaged; MonthlyColumns(mColumn).stepType = OutputProcessor::TimeStepType::TimeStepZone; MonthlyColumns(mColumn).units = OutputProcessor::Unit::None; - MonthlyColumns(mColumn).aggType = aggTypeSumOrAvg; + MonthlyColumns(mColumn).aggType = iAggType::SumOrAvg; } //#ifdef ITM_KEYCACHE //#else @@ -1446,19 +1426,19 @@ namespace OutputReportTabular { for (int kColumn = 1; kColumn <= MonthlyTables(curTable).numColumns; ++kColumn) { int curCol = kColumn + MonthlyTables(curTable).firstColumn - 1; if (MonthlyColumns(curCol).varNum == 0) break; // if no variable was ever found than stop checking - int curAggType = MonthlyColumns(curCol).aggType; - if ((curAggType == aggTypeMaximum) || (curAggType == aggTypeMinimum)) { + iAggType curAggType = MonthlyColumns(curCol).aggType; + if ((curAggType == iAggType::Maximum) || (curAggType == iAggType::Minimum)) { foundMinOrMax = true; - } else if ((curAggType == aggTypeHoursNonZero) || (curAggType == aggTypeHoursZero) || (curAggType == aggTypeHoursPositive) || - (curAggType == aggTypeHoursNonPositive) || (curAggType == aggTypeHoursNegative) || - (curAggType == aggTypeHoursNonNegative)) { + } else if ((curAggType == iAggType::HoursNonZero) || (curAggType == iAggType::HoursZero) || (curAggType == iAggType::HoursPositive) || + (curAggType == iAggType::HoursNonPositive) || (curAggType == iAggType::HoursNegative) || + (curAggType == iAggType::HoursNonNegative)) { foundHourAgg = true; - } else if (curAggType == aggTypeValueWhenMaxMin) { + } else if (curAggType == iAggType::ValueWhenMaxMin) { if (!foundMinOrMax) { missingMaxOrMinError = true; } - } else if ((curAggType == aggTypeSumOrAverageHoursShown) || (curAggType == aggTypeMaximumDuringHoursShown) || - (curAggType == aggTypeMinimumDuringHoursShown)) { + } else if ((curAggType == iAggType::SumOrAverageHoursShown) || (curAggType == iAggType::MaximumDuringHoursShown) || + (curAggType == iAggType::MinimumDuringHoursShown)) { if (!foundHourAgg) { missingHourAggError = true; } @@ -2599,634 +2579,634 @@ namespace OutputReportTabular { if (namedMonthly(1).show) { curReport = AddMonthlyReport("ZoneCoolingSummaryMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Cooling Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Total Internal Latent Gain Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Total Internal Latent Gain Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", aggTypeValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Total Internal Latent Gain Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Total Internal Latent Gain Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(2).show) { curReport = AddMonthlyReport("ZoneHeatingSummaryMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Heating Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", aggTypeValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Heating Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(3).show) { curReport = AddMonthlyReport("ZoneElectricSummaryMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Lights Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Lights Electricity Energy", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Electricity Energy", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "Zone Lights Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Lights Electricity Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Electricity Energy", "", iAggType::Maximum); } if (namedMonthly(4).show) { curReport = AddMonthlyReport("SpaceGainsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone People Total Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Lights Total Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Total Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Gas Equipment Total Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Hot Water Equipment Total Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Steam Equipment Total Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Other Equipment Total Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Gain Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Loss Energy", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone People Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Lights Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Gas Equipment Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Hot Water Equipment Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Steam Equipment Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Other Equipment Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::SumOrAvg); } if (namedMonthly(5).show) { curReport = AddMonthlyReport("PeakSpaceGainsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone People Total Heating Energy", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Zone Lights Total Heating Energy", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Total Heating Energy", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Zone Gas Equipment Total Heating Energy", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Zone Hot Water Equipment Total Heating Energy", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Zone Steam Equipment Total Heating Energy", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Zone Other Equipment Total Heating Energy", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Gain Energy", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Loss Energy", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "Zone People Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Zone Lights Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Zone Gas Equipment Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Zone Hot Water Equipment Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Zone Steam Equipment Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Zone Other Equipment Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::Maximum); } if (namedMonthly(6).show) { curReport = AddMonthlyReport("SpaceGainComponentsAtCoolingPeakMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Cooling Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Zone People Total Heating Energy", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Lights Total Heating Energy", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Total Heating Energy", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Gas Equipment Total Heating Energy", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Hot Water Equipment Total Heating Energy", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Steam Equipment Total Heating Energy", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Other Equipment Total Heating Energy", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Gain Energy", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Loss Energy", "", aggTypeValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Zone People Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Lights Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Gas Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Hot Water Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Steam Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Other Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(7).show) { curReport = AddMonthlyReport("EnergyConsumptionElectricityNaturalGasMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Electricity:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Electricity:Facility", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "NaturalGas:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "NaturalGas:Facility", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "Electricity:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Electricity:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "NaturalGas:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "NaturalGas:Facility", "", iAggType::Maximum); } if (namedMonthly(8).show) { curReport = AddMonthlyReport("EnergyConsumptionElectricityGeneratedPropaneMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ElectricityProduced:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "ElectricityProduced:Facility", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Propane:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Propane:Facility", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "ElectricityProduced:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "ElectricityProduced:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Propane:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Propane:Facility", "", iAggType::Maximum); } if (namedMonthly(9).show) { curReport = AddMonthlyReport("EnergyConsumptionDieselFuelOilMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Diesel:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Diesel:Facility", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "FuelOilNo1:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "FuelOilNo1:Facility", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "FuelOilNo2:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "FuelOilNo2:Facility", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "Diesel:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Diesel:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "FuelOilNo1:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "FuelOilNo1:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "FuelOilNo2:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "FuelOilNo2:Facility", "", iAggType::Maximum); } if (namedMonthly(10).show) { curReport = AddMonthlyReport("EnergyConsumptionDistrictHeatingCoolingMonthly", 2); - AddMonthlyFieldSetInput(curReport, "DistrictCooling:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "DistrictCooling:Facility", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "DistrictHeating:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "DistrictHeating:Facility", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "DistrictCooling:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "DistrictCooling:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "DistrictHeating:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "DistrictHeating:Facility", "", iAggType::Maximum); } if (namedMonthly(11).show) { curReport = AddMonthlyReport("EnergyConsumptionCoalGasolineMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Coal:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Coal:Facility", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Gasoline:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Gasoline:Facility", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "Coal:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Coal:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Gasoline:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Gasoline:Facility", "", iAggType::Maximum); } if (namedMonthly(12).show) { curReport = AddMonthlyReport("EnergyConsumptionOtherFuelsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "OtherFuel1:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "OtherFuel1:Facility", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "OtherFuel2:Facility", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "OtherFuel2:Facility", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "OtherFuel1:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "OtherFuel1:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "OtherFuel2:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "OtherFuel2:Facility", "", iAggType::Maximum); } if (namedMonthly(13).show) { curReport = AddMonthlyReport("EndUseEnergyConsumptionElectricityMonthly", 2); - AddMonthlyFieldSetInput(curReport, "InteriorLights:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "ExteriorLights:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "InteriorEquipment:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Fans:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Pumps:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "HeatRejection:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Humidifier:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "HeatRecovery:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Electricity", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Electricity", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "InteriorLights:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "ExteriorLights:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "InteriorEquipment:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Fans:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Pumps:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "HeatRejection:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Humidifier:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "HeatRecovery:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "WaterSystems:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cogeneration:Electricity", "", iAggType::SumOrAvg); } if (namedMonthly(14).show) { curReport = AddMonthlyReport("EndUseEnergyConsumptionNaturalGasMonthly", 2); - AddMonthlyFieldSetInput(curReport, "InteriorEquipment:NaturalGas", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:NaturalGas", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:NaturalGas", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:NaturalGas", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:NaturalGas", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:NaturalGas", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Humidifier:NaturalGas", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "InteriorEquipment:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "WaterSystems:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cogeneration:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Humidifier:NaturalGas", "", iAggType::SumOrAvg); } if (namedMonthly(15).show) { curReport = AddMonthlyReport("EndUseEnergyConsumptionDieselMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Diesel", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:Diesel", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:Diesel", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Diesel", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Diesel", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Diesel", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling:Diesel", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating:Diesel", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "WaterSystems:Diesel", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cogeneration:Diesel", "", iAggType::SumOrAvg); } if (namedMonthly(16).show) { curReport = AddMonthlyReport("EndUseEnergyConsumptionFuelOilMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo1", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo1", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo1", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo1", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo1", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo2", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo2", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo2", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo2", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo2", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo2", "", iAggType::SumOrAvg); } if (namedMonthly(17).show) { curReport = AddMonthlyReport("EndUseEnergyConsumptionCoalMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Coal", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:Coal", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Coal", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Coal", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating:Coal", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "WaterSystems:Coal", "", iAggType::SumOrAvg); } if (namedMonthly(18).show) { curReport = AddMonthlyReport("EndUseEnergyConsumptionPropaneMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Propane", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:Propane", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:Propane", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Propane", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Propane", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Humidifier:Propane", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Propane", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling:Propane", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating:Propane", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "WaterSystems:Propane", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cogeneration:Propane", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Humidifier:Propane", "", iAggType::SumOrAvg); } if (namedMonthly(19).show) { curReport = AddMonthlyReport("EndUseEnergyConsumptionGasolineMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Gasoline", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:Gasoline", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:Gasoline", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Gasoline", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Gasoline", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Gasoline", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling:Gasoline", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating:Gasoline", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "WaterSystems:Gasoline", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cogeneration:Gasoline", "", iAggType::SumOrAvg); } if (namedMonthly(20).show) { curReport = AddMonthlyReport("EndUseEnergyConsumptionOtherFuelsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel1", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel1", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel1", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel1", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel1", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel2", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel2", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel2", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel2", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel2", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel2", "", iAggType::SumOrAvg); } if (namedMonthly(21).show) { curReport = AddMonthlyReport("PeakEnergyEndUseElectricityPart1Monthly", 2); - AddMonthlyFieldSetInput(curReport, "InteriorLights:Electricity", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "ExteriorLights:Electricity", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "InteriorEquipment:Electricity", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Electricity", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Fans:Electricity", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Pumps:Electricity", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Heating:Electricity", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "InteriorLights:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "ExteriorLights:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "InteriorEquipment:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Fans:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Pumps:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Heating:Electricity", "", iAggType::Maximum); } if (namedMonthly(22).show) { curReport = AddMonthlyReport("PeakEnergyEndUseElectricityPart2Monthly", 2); - AddMonthlyFieldSetInput(curReport, "Cooling:Electricity", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "HeatRejection:Electricity", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Humidifier:Electricity", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "HeatRecovery:Electricity", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Electricity", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Electricity", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "Cooling:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "HeatRejection:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Humidifier:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "HeatRecovery:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "WaterSystems:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cogeneration:Electricity", "", iAggType::Maximum); } if (namedMonthly(23).show) { curReport = AddMonthlyReport("ElectricComponentsOfPeakDemandMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Electricity:Facility", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "InteriorLights:Electricity", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "InteriorEquipment:Electricity", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "ExteriorLights:Electricity", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Electricity", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Fans:Electricity", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Pumps:Electricity", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Heating:Electricity", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Cooling:Electricity", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "HeatRejection:Electricity", "", aggTypeValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Electricity:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "InteriorLights:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "InteriorEquipment:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "ExteriorLights:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Fans:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Pumps:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Heating:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Cooling:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "HeatRejection:Electricity", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(24).show) { curReport = AddMonthlyReport("PeakEnergyEndUseNaturalGasMonthly", 2); - AddMonthlyFieldSetInput(curReport, "InteriorEquipment:NaturalGas", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:NaturalGas", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Heating:NaturalGas", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling:NaturalGas", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:NaturalGas", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:NaturalGas", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "InteriorEquipment:NaturalGas", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:NaturalGas", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Heating:NaturalGas", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling:NaturalGas", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "WaterSystems:NaturalGas", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cogeneration:NaturalGas", "", iAggType::Maximum); } if (namedMonthly(25).show) { curReport = AddMonthlyReport("PeakEnergyEndUseDieselMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Diesel", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling:Diesel", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Heating:Diesel", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Diesel", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Diesel", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Diesel", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling:Diesel", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Heating:Diesel", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "WaterSystems:Diesel", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cogeneration:Diesel", "", iAggType::Maximum); } if (namedMonthly(26).show) { curReport = AddMonthlyReport("PeakEnergyEndUseFuelOilMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo1", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo1", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo1", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo1", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo1", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo2", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo2", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo2", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo2", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo2", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo2", "", iAggType::Maximum); } if (namedMonthly(27).show) { curReport = AddMonthlyReport("PeakEnergyEndUseCoalMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Coal", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Heating:Coal", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Coal", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Coal", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Heating:Coal", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "WaterSystems:Coal", "", iAggType::Maximum); } if (namedMonthly(28).show) { curReport = AddMonthlyReport("PeakEnergyEndUsePropaneMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Propane", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling:Propane", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Heating:Propane", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Propane", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Propane", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Propane", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling:Propane", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Heating:Propane", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "WaterSystems:Propane", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cogeneration:Propane", "", iAggType::Maximum); } if (namedMonthly(29).show) { curReport = AddMonthlyReport("PeakEnergyEndUseGasolineMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Gasoline", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling:Gasoline", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Heating:Gasoline", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Gasoline", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Gasoline", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Gasoline", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling:Gasoline", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Heating:Gasoline", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "WaterSystems:Gasoline", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cogeneration:Gasoline", "", iAggType::Maximum); } if (namedMonthly(30).show) { curReport = AddMonthlyReport("PeakEnergyEndUseOtherFuelsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel1", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel1", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel1", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel1", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel1", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel2", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel2", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel2", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel2", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel2", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel2", "", iAggType::Maximum); } if (namedMonthly(31).show) { curReport = AddMonthlyReport("SetpointsNotMetWithTemperaturesMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Heating Setpoint Not Met Time", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Zone Heating Setpoint Not Met While Occupied Time", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Zone Cooling Setpoint Not Met Time", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Zone Cooling Setpoint Not Met While Occupied Time", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", aggTypeSumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Zone Heating Setpoint Not Met Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Zone Heating Setpoint Not Met While Occupied Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Zone Cooling Setpoint Not Met Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Zone Cooling Setpoint Not Met While Occupied Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); } if (namedMonthly(32).show) { curReport = AddMonthlyReport("ComfortReportSimple55Monthly", 2); AddMonthlyFieldSetInput( - curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Summer Clothes Not Comfortable Time", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", aggTypeSumOrAverageHoursShown); + curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Summer Clothes Not Comfortable Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); AddMonthlyFieldSetInput( - curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Winter Clothes Not Comfortable Time", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", aggTypeSumOrAverageHoursShown); + curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Winter Clothes Not Comfortable Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); AddMonthlyFieldSetInput( - curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Summer or Winter Clothes Not Comfortable Time", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", aggTypeSumOrAverageHoursShown); + curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Summer or Winter Clothes Not Comfortable Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); } if (namedMonthly(33).show) { curReport = AddMonthlyReport("UnglazedTranspiredSolarCollectorSummaryMonthly", 5); - AddMonthlyFieldSetInput(curReport, "Solar Collector System Efficiency", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Solar Collector System Efficiency", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Solar Collector Outside Face Suction Velocity", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Solar Collector Sensible Heating Rate", "", aggTypeSumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Solar Collector System Efficiency", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Solar Collector System Efficiency", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Solar Collector Outside Face Suction Velocity", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Solar Collector Sensible Heating Rate", "", iAggType::SumOrAverageHoursShown); } if (namedMonthly(34).show) { curReport = AddMonthlyReport("OccupantComfortDataSummaryMonthly", 5); - AddMonthlyFieldSetInput(curReport, "People Occupant Count", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "People Air Temperature", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "People Air Relative Humidity", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Zone Thermal Comfort Fanger Model PMV", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Zone Thermal Comfort Fanger Model PPD", "", aggTypeSumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "People Occupant Count", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "People Air Temperature", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "People Air Relative Humidity", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Zone Thermal Comfort Fanger Model PMV", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Zone Thermal Comfort Fanger Model PPD", "", iAggType::SumOrAverageHoursShown); } if (namedMonthly(35).show) { curReport = AddMonthlyReport("ChillerReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Chiller Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Chiller Electricity Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Chiller Electricity Energy", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Chiller Evaporator Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Chiller Evaporator Cooling Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Chiller Condenser Heat Transfer Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Chiller COP", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Chiller COP", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Chiller Part Load Ratio", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Chiller Part Load Ratio", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "Chiller Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Chiller Electricity Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Chiller Electricity Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Chiller Evaporator Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Chiller Evaporator Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Chiller Condenser Heat Transfer Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Chiller COP", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Chiller COP", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Chiller Part Load Ratio", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Chiller Part Load Ratio", "", iAggType::Maximum); } if (namedMonthly(36).show) { curReport = AddMonthlyReport("TowerReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Fan Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Fan Electricity Energy", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Fan Electricity Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Heat Transfer Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Inlet Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Outlet Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Mass Flow Rate", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling Tower Fan Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling Tower Fan Electricity Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Cooling Tower Fan Electricity Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling Tower Heat Transfer Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling Tower Inlet Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling Tower Outlet Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling Tower Mass Flow Rate", "", iAggType::SumOrAvg); } if (namedMonthly(37).show) { curReport = AddMonthlyReport("BoilerReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Boiler Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Gas Consumption", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Heating Energy", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Boiler Heating Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Boiler Gas Consumption Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Boiler Inlet Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Outlet Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Mass Flow Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Ancillary Electricity Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Part Load Ratio", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Part Load Ratio", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "Boiler Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Boiler Gas Consumption", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Boiler Heating Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Boiler Heating Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Boiler Gas Consumption Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Boiler Inlet Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Boiler Outlet Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Boiler Mass Flow Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Boiler Ancillary Electricity Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Boiler Part Load Ratio", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Boiler Part Load Ratio", "", iAggType::Maximum); } if (namedMonthly(38).show) { curReport = AddMonthlyReport("DXReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Energy", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Latent Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Crankcase Heater Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Runtime Fraction", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Runtime Fraction", "", aggTypeMinimum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Latent Cooling Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Electricity Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Crankcase Heater Electricity Rate", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Latent Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Crankcase Heater Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Runtime Fraction", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Runtime Fraction", "", iAggType::Minimum); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Latent Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Electricity Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Crankcase Heater Electricity Rate", "", iAggType::Maximum); } if (namedMonthly(39).show) { curReport = AddMonthlyReport("WindowReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Solar Radiation Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Beam Solar Radiation Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Diffuse Solar Radiation Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Heat Gain Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Heat Loss Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Inside Face Glazing Condensation Status", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Surface Shading Device Is On Time Fraction", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Surface Storm Window On Off Status", "", aggTypeHoursNonZero); + AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Diffuse Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Surface Window Heat Gain Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Surface Window Heat Loss Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Surface Window Inside Face Glazing Condensation Status", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Surface Shading Device Is On Time Fraction", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Surface Storm Window On Off Status", "", iAggType::HoursNonZero); } if (namedMonthly(40).show) { curReport = AddMonthlyReport("WindowEnergyReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Solar Radiation Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Beam Solar Radiation Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Diffuse Solar Radiation Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Heat Gain Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Heat Loss Energy", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Diffuse Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Surface Window Heat Gain Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Surface Window Heat Loss Energy", "", iAggType::SumOrAvg); } if (namedMonthly(41).show) { curReport = AddMonthlyReport("WindowZoneSummaryMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Gain Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Loss Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Transmitted Solar Radiation Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Beam Solar Radiation Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Diffuse Solar Radiation Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Rate", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Gain Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Loss Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Windows Total Transmitted Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Diffuse Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); } if (namedMonthly(42).show) { curReport = AddMonthlyReport("WindowEnergyZoneSummaryMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Gain Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Loss Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Transmitted Solar Radiation Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Beam Solar Radiation Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Diffuse Solar Radiation Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Energy", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Gain Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Loss Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Windows Total Transmitted Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Diffuse Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); } if (namedMonthly(43).show) { curReport = AddMonthlyReport("AverageOutdoorConditionsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Rain Status", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Rain Status", "", iAggType::SumOrAvg); } if (namedMonthly(44).show) { curReport = AddMonthlyReport("OutdoorConditionsMaximumDryBulbMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", aggTypeValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(45).show) { curReport = AddMonthlyReport("OutdoorConditionsMinimumDryBulbMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", aggTypeMinimum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", aggTypeValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::Minimum); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(46).show) { curReport = AddMonthlyReport("OutdoorConditionsMaximumWetBulbMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", aggTypeValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(47).show) { curReport = AddMonthlyReport("OutdoorConditionsMaximumDewPointMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", aggTypeValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(48).show) { curReport = AddMonthlyReport("OutdoorGroundConditionsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Ground Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Surface Ground Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Deep Ground Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Mains Water Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Ground Reflected Solar Radiation Rate per Area", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Snow on Ground Status", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Ground Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Surface Ground Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Deep Ground Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Mains Water Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Ground Reflected Solar Radiation Rate per Area", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Snow on Ground Status", "", iAggType::SumOrAvg); } if (namedMonthly(49).show) { curReport = AddMonthlyReport("WindowACReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Total Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Total Cooling Energy", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Sensible Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Latent Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Total Cooling Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Sensible Cooling Rate", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Latent Cooling Rate", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Electricity Rate", "", aggTypeValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Total Cooling Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Sensible Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Latent Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Total Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Sensible Cooling Rate", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Latent Cooling Rate", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Electricity Rate", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(50).show) { curReport = AddMonthlyReport("WaterHeaterReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Water Heater Total Demand Heat Transfer Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Use Side Heat Transfer Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Burner Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Gas Consumption", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Total Demand Heat Transfer Energy", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Water Heater Loss Demand Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Heat Loss Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Tank Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Heat Recovery Supply Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Source Energy", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Water Heater Total Demand Heat Transfer Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Water Heater Use Side Heat Transfer Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Water Heater Burner Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Water Heater Gas Consumption", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Water Heater Total Demand Heat Transfer Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Water Heater Loss Demand Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Water Heater Heat Loss Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Water Heater Tank Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Water Heater Heat Recovery Supply Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Water Heater Source Energy", "", iAggType::SumOrAvg); } if (namedMonthly(51).show) { curReport = AddMonthlyReport("GeneratorReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Generator Produced AC Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Diesel Consumption", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Gas Consumption", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Produced AC Electricity Energy", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Generator Total Heat Recovery", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Jacket Heat Recovery Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Lube Heat Recovery", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Exhaust Heat Recovery Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Exhaust Air Temperature", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Generator Produced AC Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Generator Diesel Consumption", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Generator Gas Consumption", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Generator Produced AC Electricity Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Generator Total Heat Recovery", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Generator Jacket Heat Recovery Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Generator Lube Heat Recovery", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Generator Exhaust Heat Recovery Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Generator Exhaust Air Temperature", "", iAggType::SumOrAvg); } if (namedMonthly(52).show) { curReport = AddMonthlyReport("DaylightingReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Exterior Beam Normal Illuminance", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Daylighting Lighting Power Multiplier", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Lighting Power Multiplier", "", aggTypeMinimumDuringHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Illuminance", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Glare Index", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Glare Index Setpoint Exceeded Time", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Daylight Illuminance Setpoint Exceeded Time", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Illuminance", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Glare Index", "", aggTypeSumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Glare Index Setpoint Exceeded Time", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Daylight Illuminance Setpoint Exceeded Time", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Exterior Beam Normal Illuminance", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Daylighting Lighting Power Multiplier", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Daylighting Lighting Power Multiplier", "", iAggType::MinimumDuringHoursShown); + AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Illuminance", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Glare Index", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Glare Index Setpoint Exceeded Time", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Daylight Illuminance Setpoint Exceeded Time", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Illuminance", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Glare Index", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Glare Index Setpoint Exceeded Time", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Daylight Illuminance Setpoint Exceeded Time", "", iAggType::SumOrAvg); } if (namedMonthly(53).show) { curReport = AddMonthlyReport("CoilReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Heating Coil Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating Coil Heating Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Rate", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Wetted Area Fraction", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating Coil Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Heating Coil Heating Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Rate", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Cooling Coil Wetted Area Fraction", "", iAggType::SumOrAvg); } if (namedMonthly(54).show) { curReport = AddMonthlyReport("PlantLoopDemandReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::Maximum); } if (namedMonthly(55).show) { curReport = AddMonthlyReport("FanReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Fan Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Fan Rise in Air Temperature", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Fan Electricity Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Fan Rise in Air Temperature", "", aggTypeValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Fan Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Fan Rise in Air Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Fan Electricity Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Fan Rise in Air Temperature", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(56).show) { curReport = AddMonthlyReport("PumpReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Pump Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Pump Fluid Heat Gain Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Pump Electricity Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Pump Shaft Power", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Pump Fluid Heat Gain Rate", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Pump Outlet Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Pump Mass Flow Rate", "", aggTypeValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Pump Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Pump Fluid Heat Gain Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Pump Electricity Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Pump Shaft Power", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Pump Fluid Heat Gain Rate", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Pump Outlet Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Pump Mass Flow Rate", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(57).show) { curReport = AddMonthlyReport("CondLoopDemandReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", aggTypeMaximum); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Inlet Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Outlet Temperature", "", aggTypeValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", aggTypeMaximum); + AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(curReport, "Plant Supply Side Inlet Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Plant Supply Side Outlet Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::Maximum); } if (namedMonthly(58).show) { curReport = AddMonthlyReport("ZoneTemperatureOscillationReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Oscillating Temperatures Time", "", aggTypeHoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone People Occupant Count", "", aggTypeSumOrAverageHoursShown); + AddMonthlyFieldSetInput(curReport, "Zone Oscillating Temperatures Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(curReport, "Zone People Occupant Count", "", iAggType::SumOrAverageHoursShown); } if (namedMonthly(59).show) { curReport = AddMonthlyReport("AirLoopSystemEnergyAndWaterUseMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Air System Hot Water Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Steam Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Chilled Water Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Natural Gas Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Water Volume", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Hot Water Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Steam Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Chilled Water Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Natural Gas Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Water Volume", "", iAggType::SumOrAvg); } if (namedMonthly(60).show) { curReport = AddMonthlyReport("AirLoopSystemComponentLoadsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Air System Fan Air Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Cooling Coil Total Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Total Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heat Exchanger Total Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heat Exchanger Total Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Humidifier Total Heating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Evaporative Cooler Total Cooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Desiccant Dehumidifier Total Cooling Energy", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Fan Air Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Heat Exchanger Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Heat Exchanger Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Humidifier Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Evaporative Cooler Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Desiccant Dehumidifier Total Cooling Energy", "", iAggType::SumOrAvg); } if (namedMonthly(61).show) { curReport = AddMonthlyReport("AirLoopSystemComponentEnergyUseMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Air System Fan Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Hot Water Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Cooling Coil Chilled Water Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System DX Heating Coil Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System DX Cooling Coil Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Natural Gas Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Steam Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Humidifier Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Humidifier Natural Gas Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Evaporative Cooler Electricity Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Desiccant Dehumidifier Electricity Energy", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Fan Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Hot Water Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Cooling Coil Chilled Water Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System DX Heating Coil Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System DX Cooling Coil Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Natural Gas Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Steam Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Humidifier Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Humidifier Natural Gas Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Evaporative Cooler Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Desiccant Dehumidifier Electricity Energy", "", iAggType::SumOrAvg); } if (namedMonthly(62).show) { curReport = AddMonthlyReport("MechanicalVentilationLoadsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation No Load Heat Removal Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Cooling Load Increase Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Cooling Load Increase Due to Overheating Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Cooling Load Decrease Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation No Load Heat Addition Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Heating Load Increase Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Heating Load Increase Due to Overcooling Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Heating Load Decrease Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Air Changes per Hour", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation No Load Heat Removal Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Cooling Load Increase Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Cooling Load Increase Due to Overheating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Cooling Load Decrease Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation No Load Heat Addition Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Heating Load Increase Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Heating Load Increase Due to Overcooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Heating Load Decrease Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Air Changes per Hour", "", iAggType::SumOrAvg); } if (namedMonthly(63).show) { curReport = AddMonthlyReport("HeatEmissionsReportMonthly", 2); // Place holder - AddMonthlyFieldSetInput(curReport, "Site Total Surface Heat Emission to Air", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Total Zone Exfiltration Heat Loss", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Total Zone Exhaust Air Heat Loss", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Relief Air Total Heat Loss Energy", "", aggTypeSumOrAvg); - AddMonthlyFieldSetInput(curReport, "HVAC System Total Heat Rejection Energy", "", aggTypeSumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Total Surface Heat Emission to Air", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Total Zone Exfiltration Heat Loss", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Site Total Zone Exhaust Air Heat Loss", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "Air System Relief Air Total Heat Loss Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(curReport, "HVAC System Total Heat Rejection Energy", "", iAggType::SumOrAvg); } } @@ -4057,7 +4037,7 @@ namespace OutputReportTabular { static Array1D_int MonthlyColumnsTypeOfVar; static Array1D MonthlyColumnsStepType; - static Array1D_int MonthlyColumnsAggType; + static Array1D MonthlyColumnsAggType; static Array1D_int MonthlyColumnsVarNum; static Array1D_int MonthlyTablesNumColumns; static int curFirstColumn(0); @@ -4110,7 +4090,7 @@ namespace OutputReportTabular { ((curStepType == OutputProcessor::TimeStepType::TimeStepSystem) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem))) { // the above condition used to include the following prior to new scan method - // (MonthlyColumns(curCol)%aggType .EQ. aggTypeValueWhenMaxMin) + // (MonthlyColumns(curCol)%aggType .EQ. iAggType::ValueWhenMaxMin) curVarNum = MonthlyColumnsVarNum(curCol); curValue = GetInternalVariableValue(state, curTypeOfVar, curVarNum); // Get the value from the result array @@ -4132,7 +4112,7 @@ namespace OutputReportTabular { // use next lines since it is faster was: SELECT CASE (MonthlyColumns(curCol)%aggType) { auto const SELECT_CASE_var(MonthlyColumnsAggType(curCol)); - if (SELECT_CASE_var == aggTypeSumOrAvg) { + if (SELECT_CASE_var == iAggType::SumOrAvg) { if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable newResultValue = oldResultValue + curValue; } else { @@ -4140,7 +4120,7 @@ namespace OutputReportTabular { } newDuration = oldDuration + elapsedTime; activeNewValue = true; - } else if (SELECT_CASE_var == aggTypeMaximum) { + } else if (SELECT_CASE_var == iAggType::Maximum) { // per MJW when a summed variable is used divide it by the length of the time step if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { @@ -4157,7 +4137,7 @@ namespace OutputReportTabular { } else { activeMinMax = false; // reset this } - } else if (SELECT_CASE_var == aggTypeMinimum) { + } else if (SELECT_CASE_var == iAggType::Minimum) { // per MJW when a summed variable is used divide it by the length of the time step if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { @@ -4174,7 +4154,7 @@ namespace OutputReportTabular { } else { activeMinMax = false; // reset this } - } else if (SELECT_CASE_var == aggTypeHoursZero) { + } else if (SELECT_CASE_var == iAggType::HoursZero) { if (curValue == 0) { newResultValue = oldResultValue + elapsedTime; activeHoursShown = true; @@ -4182,7 +4162,7 @@ namespace OutputReportTabular { } else { activeHoursShown = false; } - } else if (SELECT_CASE_var == aggTypeHoursNonZero) { + } else if (SELECT_CASE_var == iAggType::HoursNonZero) { if (curValue != 0) { newResultValue = oldResultValue + elapsedTime; activeHoursShown = true; @@ -4190,7 +4170,7 @@ namespace OutputReportTabular { } else { activeHoursShown = false; } - } else if (SELECT_CASE_var == aggTypeHoursPositive) { + } else if (SELECT_CASE_var == iAggType::HoursPositive) { if (curValue > 0) { newResultValue = oldResultValue + elapsedTime; activeHoursShown = true; @@ -4198,7 +4178,7 @@ namespace OutputReportTabular { } else { activeHoursShown = false; } - } else if (SELECT_CASE_var == aggTypeHoursNonPositive) { + } else if (SELECT_CASE_var == iAggType::HoursNonPositive) { if (curValue <= 0) { newResultValue = oldResultValue + elapsedTime; activeHoursShown = true; @@ -4206,7 +4186,7 @@ namespace OutputReportTabular { } else { activeHoursShown = false; } - } else if (SELECT_CASE_var == aggTypeHoursNegative) { + } else if (SELECT_CASE_var == iAggType::HoursNegative) { if (curValue < 0) { newResultValue = oldResultValue + elapsedTime; activeHoursShown = true; @@ -4214,7 +4194,7 @@ namespace OutputReportTabular { } else { activeHoursShown = false; } - } else if (SELECT_CASE_var == aggTypeHoursNonNegative) { + } else if (SELECT_CASE_var == iAggType::HoursNonNegative) { if (curValue >= 0) { newResultValue = oldResultValue + elapsedTime; activeHoursShown = true; @@ -4223,10 +4203,10 @@ namespace OutputReportTabular { activeHoursShown = false; } // The valueWhenMaxMin is picked up now during the activeMinMax if block below. - // CASE (aggTypeValueWhenMaxMin) - // CASE (aggTypeSumOrAverageHoursShown) - // CASE (aggTypeMaximumDuringHoursShown) - // CASE (aggTypeMinimumDuringHoursShown) + // CASE (iAggType::ValueWhenMaxMin) + // CASE (iAggType::SumOrAverageHoursShown) + // CASE (iAggType::MaximumDuringHoursShown) + // CASE (iAggType::MinimumDuringHoursShown) } } // if the new value has been set then set the monthly values to the @@ -4247,10 +4227,10 @@ namespace OutputReportTabular { scanColumn = kOtherColumn + MonthlyTables(iTable).firstColumn - 1; { auto const SELECT_CASE_var(MonthlyColumns(scanColumn).aggType); - if ((SELECT_CASE_var == aggTypeMaximum) || (SELECT_CASE_var == aggTypeMinimum)) { + if ((SELECT_CASE_var == iAggType::Maximum) || (SELECT_CASE_var == iAggType::Minimum)) { // end scanning since these might reset break; // do - } else if (SELECT_CASE_var == aggTypeValueWhenMaxMin) { + } else if (SELECT_CASE_var == iAggType::ValueWhenMaxMin) { // this case is when the value should be set scanTypeOfVar = MonthlyColumns(scanColumn).typeOfVar; scanVarNum = MonthlyColumns(scanColumn).varNum; @@ -4281,16 +4261,16 @@ namespace OutputReportTabular { oldScanValue = MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month); { auto const SELECT_CASE_var(MonthlyColumns(scanColumn).aggType); - if ((SELECT_CASE_var == aggTypeHoursZero) || (SELECT_CASE_var == aggTypeHoursNonZero)) { + if ((SELECT_CASE_var == iAggType::HoursZero) || (SELECT_CASE_var == iAggType::HoursNonZero)) { // end scanning since these might reset break; // do - } else if ((SELECT_CASE_var == aggTypeHoursPositive) || (SELECT_CASE_var == aggTypeHoursNonPositive)) { + } else if ((SELECT_CASE_var == iAggType::HoursPositive) || (SELECT_CASE_var == iAggType::HoursNonPositive)) { // end scanning since these might reset break; // do - } else if ((SELECT_CASE_var == aggTypeHoursNegative) || (SELECT_CASE_var == aggTypeHoursNonNegative)) { + } else if ((SELECT_CASE_var == iAggType::HoursNegative) || (SELECT_CASE_var == iAggType::HoursNonNegative)) { // end scanning since these might reset break; // do - } else if (SELECT_CASE_var == aggTypeSumOrAverageHoursShown) { + } else if (SELECT_CASE_var == iAggType::SumOrAverageHoursShown) { // this case is when the value should be set if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = oldScanValue + scanValue; @@ -4299,7 +4279,7 @@ namespace OutputReportTabular { MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = oldScanValue + scanValue * elapsedTime; } MonthlyColumns(scanColumn).duration(state.dataEnvrn->Month) += elapsedTime; - } else if (SELECT_CASE_var == aggTypeMaximumDuringHoursShown) { + } else if (SELECT_CASE_var == iAggType::MaximumDuringHoursShown) { if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { scanValue /= (TimeStepSys * DataGlobalConstants::SecInHour); @@ -4311,7 +4291,7 @@ namespace OutputReportTabular { MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; MonthlyColumns(scanColumn).timeStamp(state.dataEnvrn->Month) = timestepTimeStamp; } - } else if (SELECT_CASE_var == aggTypeMinimumDuringHoursShown) { + } else if (SELECT_CASE_var == iAggType::MinimumDuringHoursShown) { if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { scanValue /= (TimeStepSys * DataGlobalConstants::SecInHour); @@ -6750,7 +6730,6 @@ namespace OutputReportTabular { Array1D_int columnWidth; Array1D_string rowHead(16); Array2D_string tableBody; - Array1D_string aggString(13); std::string curAggString; int iInput; int jTable; @@ -6796,19 +6775,21 @@ namespace OutputReportTabular { rowHead(15) = "Minimum of Months"; rowHead(16) = "Maximum of Months"; - aggString(aggTypeSumOrAvg) = ""; - aggString(aggTypeMaximum) = " Maximum "; - aggString(aggTypeMinimum) = " MINIMUM "; - aggString(aggTypeValueWhenMaxMin) = " AT MAX/MIN "; - aggString(aggTypeHoursZero) = " HOURS ZERO "; - aggString(aggTypeHoursNonZero) = " HOURS NON-ZERO "; - aggString(aggTypeHoursPositive) = " HOURS POSITIVE "; - aggString(aggTypeHoursNonPositive) = " HOURS NON-POSITIVE "; - aggString(aggTypeHoursNegative) = " HOURS NEGATIVE "; - aggString(aggTypeHoursNonNegative) = " HOURS NON-NEGATIVE "; - aggString(aggTypeSumOrAverageHoursShown) = " FOR HOURS SHOWN "; - aggString(aggTypeMaximumDuringHoursShown) = " MAX FOR HOURS SHOWN "; - aggString(aggTypeMinimumDuringHoursShown) = " MIN FOR HOURS SHOWN "; + std::unordered_map aggString = { + {iAggType::SumOrAvg, ""}, + {iAggType::Maximum, " Maximum "}, + {iAggType::Minimum, " MINIMUM "}, + {iAggType::ValueWhenMaxMin, " AT MAX/MIN "}, + {iAggType::HoursZero, " HOURS ZERO "}, + {iAggType::HoursNonZero, " HOURS NON-ZERO "}, + {iAggType::HoursPositive, " HOURS POSITIVE "}, + {iAggType::HoursNonPositive, " HOURS NON-POSITIVE "}, + {iAggType::HoursNegative, " HOURS NEGATIVE "}, + {iAggType::HoursNonNegative, " HOURS NON-NEGATIVE "}, + {iAggType::SumOrAverageHoursShown, " FOR HOURS SHOWN "}, + {iAggType::MaximumDuringHoursShown, " MAX FOR HOURS SHOWN "}, + {iAggType::MinimumDuringHoursShown, " MIN FOR HOURS SHOWN "}, + }; veryLarge = 1.0E280; verySmall = -1.0E280; @@ -6845,14 +6826,14 @@ namespace OutputReportTabular { curCol = kColumn + MonthlyTables(curTable).firstColumn - 1; { auto const SELECT_CASE_var(MonthlyColumns(curCol).aggType); - if ((SELECT_CASE_var == aggTypeSumOrAvg) || (SELECT_CASE_var == aggTypeValueWhenMaxMin) || - (SELECT_CASE_var == aggTypeHoursZero) || (SELECT_CASE_var == aggTypeHoursNonZero) || - (SELECT_CASE_var == aggTypeHoursPositive) || (SELECT_CASE_var == aggTypeHoursNonPositive) || - (SELECT_CASE_var == aggTypeHoursNegative) || (SELECT_CASE_var == aggTypeHoursNonNegative) || - (SELECT_CASE_var == aggTypeSumOrAverageHoursShown)) { + if ((SELECT_CASE_var == iAggType::SumOrAvg) || (SELECT_CASE_var == iAggType::ValueWhenMaxMin) || + (SELECT_CASE_var == iAggType::HoursZero) || (SELECT_CASE_var == iAggType::HoursNonZero) || + (SELECT_CASE_var == iAggType::HoursPositive) || (SELECT_CASE_var == iAggType::HoursNonPositive) || + (SELECT_CASE_var == iAggType::HoursNegative) || (SELECT_CASE_var == iAggType::HoursNonNegative) || + (SELECT_CASE_var == iAggType::SumOrAverageHoursShown)) { ++columnUsedCount; - } else if ((SELECT_CASE_var == aggTypeMaximum) || (SELECT_CASE_var == aggTypeMinimum) || - (SELECT_CASE_var == aggTypeMaximumDuringHoursShown) || (SELECT_CASE_var == aggTypeMinimumDuringHoursShown)) { + } else if ((SELECT_CASE_var == iAggType::Maximum) || (SELECT_CASE_var == iAggType::Minimum) || + (SELECT_CASE_var == iAggType::MaximumDuringHoursShown) || (SELECT_CASE_var == iAggType::MinimumDuringHoursShown)) { columnUsedCount += 2; } } @@ -6864,7 +6845,7 @@ namespace OutputReportTabular { columnRecount = 0; for (kColumn = 1; kColumn <= MonthlyTables(curTable).numColumns; ++kColumn) { curCol = kColumn + MonthlyTables(curTable).firstColumn - 1; - curAggString = aggString(MonthlyColumns(curCol).aggType); + curAggString = aggString.at(MonthlyColumns(curCol).aggType); if (len(curAggString) > 0) { curAggString = " {" + stripped(curAggString) + '}'; } @@ -6887,7 +6868,7 @@ namespace OutputReportTabular { } { auto const SELECT_CASE_var(MonthlyColumns(curCol).aggType); - if ((SELECT_CASE_var == aggTypeSumOrAvg) || (SELECT_CASE_var == aggTypeSumOrAverageHoursShown)) { + if ((SELECT_CASE_var == iAggType::SumOrAvg) || (SELECT_CASE_var == iAggType::SumOrAverageHoursShown)) { ++columnRecount; // put in the name of the variable for the column columnHead(columnRecount) = MonthlyColumns(curCol).varName + curAggString + " [" + curUnits + ']'; @@ -6936,9 +6917,9 @@ namespace OutputReportTabular { if (maxVal != storedMinVal) { tableBody(columnRecount, 16) = RealToStr(maxVal, digitsShown); } - } else if ((SELECT_CASE_var == aggTypeHoursZero) || (SELECT_CASE_var == aggTypeHoursNonZero) || - (SELECT_CASE_var == aggTypeHoursPositive) || (SELECT_CASE_var == aggTypeHoursNonPositive) || - (SELECT_CASE_var == aggTypeHoursNegative) || (SELECT_CASE_var == aggTypeHoursNonNegative)) { + } else if ((SELECT_CASE_var == iAggType::HoursZero) || (SELECT_CASE_var == iAggType::HoursNonZero) || + (SELECT_CASE_var == iAggType::HoursPositive) || (SELECT_CASE_var == iAggType::HoursNonPositive) || + (SELECT_CASE_var == iAggType::HoursNegative) || (SELECT_CASE_var == iAggType::HoursNonNegative)) { ++columnRecount; // put in the name of the variable for the column @@ -6965,7 +6946,7 @@ namespace OutputReportTabular { if (maxVal != storedMinVal) { tableBody(columnRecount, 16) = RealToStr(maxVal, digitsShown); } - } else if (SELECT_CASE_var == aggTypeValueWhenMaxMin) { + } else if (SELECT_CASE_var == iAggType::ValueWhenMaxMin) { ++columnRecount; if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { curUnits += "/s"; @@ -7018,8 +6999,8 @@ namespace OutputReportTabular { if (maxVal != storedMinVal) { tableBody(columnRecount, 16) = RealToStr(maxVal, digitsShown); } - } else if ((SELECT_CASE_var == aggTypeMaximum) || (SELECT_CASE_var == aggTypeMinimum) || - (SELECT_CASE_var == aggTypeMaximumDuringHoursShown) || (SELECT_CASE_var == aggTypeMinimumDuringHoursShown)) { + } else if ((SELECT_CASE_var == iAggType::Maximum) || (SELECT_CASE_var == iAggType::Minimum) || + (SELECT_CASE_var == iAggType::MaximumDuringHoursShown) || (SELECT_CASE_var == iAggType::MinimumDuringHoursShown)) { columnRecount += 2; // put in the name of the variable for the column if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable @@ -15233,9 +15214,9 @@ namespace OutputReportTabular { curCol = kColumn + MonthlyTables(curTable).firstColumn - 1; MonthlyColumns(curCol).timeStamp = 0; MonthlyColumns(curCol).duration = 0.0; - if (MonthlyColumns(curCol).aggType == aggTypeMaximum || MonthlyColumns(curCol).aggType == aggTypeMaximumDuringHoursShown) { + if (MonthlyColumns(curCol).aggType == iAggType::Maximum || MonthlyColumns(curCol).aggType == iAggType::MaximumDuringHoursShown) { MonthlyColumns(curCol).reslt = -HUGE_(BigNum); - } else if (MonthlyColumns(curCol).aggType == aggTypeMinimum || MonthlyColumns(curCol).aggType == aggTypeMinimumDuringHoursShown) { + } else if (MonthlyColumns(curCol).aggType == iAggType::Minimum || MonthlyColumns(curCol).aggType == iAggType::MinimumDuringHoursShown) { MonthlyColumns(curCol).reslt = HUGE_(BigNum); } else { MonthlyColumns(curCol).reslt = 0.0; @@ -16828,6 +16809,4 @@ namespace OutputReportTabular { return getSpecificUnitIndex; } -} // namespace OutputReportTabular - } // namespace EnergyPlus diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index f8df0b13798..a0982a0e226 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -78,19 +78,22 @@ namespace OutputReportTabular { // Data // MODULE PARAMETER DEFINITIONS: - extern int const aggTypeSumOrAvg; - extern int const aggTypeMaximum; - extern int const aggTypeMinimum; - extern int const aggTypeValueWhenMaxMin; - extern int const aggTypeHoursZero; - extern int const aggTypeHoursNonZero; - extern int const aggTypeHoursPositive; - extern int const aggTypeHoursNonPositive; - extern int const aggTypeHoursNegative; - extern int const aggTypeHoursNonNegative; - extern int const aggTypeSumOrAverageHoursShown; - extern int const aggTypeMaximumDuringHoursShown; - extern int const aggTypeMinimumDuringHoursShown; + enum class iAggType { + Unassigned, + SumOrAvg, + Maximum, + Minimum, + ValueWhenMaxMin, + HoursZero, + HoursNonZero, + HoursPositive, + HoursNonPositive, + HoursNegative, + HoursNonNegative, + SumOrAverageHoursShown, + MaximumDuringHoursShown, + MinimumDuringHoursShown, + }; enum class iTableStyle { Unassigned, @@ -533,7 +536,7 @@ namespace OutputReportTabular { // Members std::string variMeter; // the name of the variable or meter std::string colHead; // the column header to use instead of the variable name (only for predefined) - int aggregate; // the type of aggregation for the variable (see aggType parameters) + iAggType aggregate; // the type of aggregation for the variable (see aggType parameters) OutputProcessor::Unit varUnits; // Units enumeration std::string variMeterUpper; // the name of the variable or meter uppercased int typeOfVar; // 0=not found, 1=integer, 2=real, 3=meter @@ -545,8 +548,8 @@ namespace OutputReportTabular { // Default Constructor MonthlyFieldSetInputType() - : aggregate(0), varUnits(OutputProcessor::Unit::None), typeOfVar(0), keyCount(0), varAvgSum(OutputProcessor::StoreType::Averaged), - varStepType(OutputProcessor::TimeStepType::TimeStepZone) + : aggregate(iAggType::Unassigned), varUnits(OutputProcessor::Unit::None), typeOfVar(0), keyCount(0), + varAvgSum(OutputProcessor::StoreType::Averaged), varStepType(OutputProcessor::TimeStepType::TimeStepZone) { } }; @@ -574,7 +577,7 @@ namespace OutputReportTabular { OutputProcessor::StoreType avgSum; // Variable is Averaged=1 or Summed=2 OutputProcessor::TimeStepType stepType; // Variable time step is Zone=1 or HVAC=2 OutputProcessor::Unit units; // the units string, may be blank - int aggType; // index to the type of aggregation (see list of parameters) + iAggType aggType; // index to the type of aggregation (see list of parameters) Array1D reslt; // monthly results Array1D duration; // the time during which results are summed for use in averages Array1D_int timeStamp; // encoded timestamp of max or min @@ -583,8 +586,8 @@ namespace OutputReportTabular { // Default Constructor MonthlyColumnsType() - : varNum(0), typeOfVar(0), avgSum(OutputProcessor::StoreType::Averaged), stepType(OutputProcessor::TimeStepType::TimeStepZone), units(OutputProcessor::Unit::None), aggType(0), - reslt(12, 0.0), duration(12, 0.0), timeStamp(12, 0), aggForStep(0.0) + : varNum(0), typeOfVar(0), avgSum(OutputProcessor::StoreType::Averaged), stepType(OutputProcessor::TimeStepType::TimeStepZone), + units(OutputProcessor::Unit::None), aggType(iAggType::Unassigned), reslt(12, 0.0), duration(12, 0.0), timeStamp(12, 0), aggForStep(0.0) { } }; @@ -724,7 +727,7 @@ namespace OutputReportTabular { int AddMonthlyReport(std::string const &inReportName, int const inNumDigitsShown); - void AddMonthlyFieldSetInput(int const inMonthReport, std::string const &inVariMeter, std::string const &inColHead, int const inAggregate); + void AddMonthlyFieldSetInput(int const inMonthReport, std::string const &inVariMeter, std::string const &inColHead, iAggType const inAggregate); void InitializeTabularMonthly(EnergyPlusData &state); From 429b7d20cd1299ea69cb3d65e4dead074beeaf38 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 18 Dec 2020 13:24:40 -0700 Subject: [PATCH 04/14] move OutputReportTabular::OutputType const ints to enum, other constexpr int moves --- src/EnergyPlus/OutputReportTabular.cc | 64 +++----------------- src/EnergyPlus/OutputReportTabular.hh | 84 +++++++++++++++------------ 2 files changed, 57 insertions(+), 91 deletions(-) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 584e083e92e..208f4af3a93 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -398,52 +398,6 @@ namespace EnergyPlus::OutputReportTabular { // REAL(r64), DIMENSION(:,:,:),ALLOCATABLE,PUBLIC :: feneSolarInstantSeq Array3D feneSolarRadSeq; - // These correspond to the columns in the load component table - int const cSensInst(1); - int const cSensDelay(2); - int const cSensRA(3); - int const cLatent(4); - int const cTotal(5); - int const cPerc(6); - int const cArea(7); - int const cPerArea(8); - - // internal gains - int const rPeople(1); - int const rLights(2); - int const rEquip(3); - int const rRefrig(4); - int const rWaterUse(5); - int const rHvacLoss(6); - int const rPowerGen(7); - // misc - int const rDOAS(8); - int const rInfil(9); - int const rZoneVent(10); - int const rIntZonMix(11); - // opaque surfaces - int const rRoof(12); - int const rIntZonCeil(13); - int const rOtherRoof(14); - int const rExtWall(15); - int const rIntZonWall(16); - int const rGrdWall(17); - int const rOtherWall(18); - int const rExtFlr(19); - int const rIntZonFlr(20); - int const rGrdFlr(21); - int const rOtherFlr(22); - // subsurfaces - int const rFeneCond(23); - int const rFeneSolr(24); - int const rOpqDoor(25); - // total - int const rGrdTot(26); - - int const zoneOuput = 1; - int const airLoopOutput = 2; - int const facilityOutput = 3; - int maxUniqueKeyCount(0); // for the XML report must keep track fo the active sub-table name and report set by other routines @@ -13023,7 +12977,7 @@ namespace EnergyPlus::OutputReportTabular { LoadSummaryUnitConversion(state, AirLoopCoolCompLoadTables(iAirLoop)); LoadSummaryUnitConversion(state, AirLoopHeatCompLoadTables(iAirLoop)); - OutputCompLoadSummary(state, airLoopOutput, AirLoopCoolCompLoadTables(iAirLoop), AirLoopHeatCompLoadTables(iAirLoop), iAirLoop); + OutputCompLoadSummary(state, iOutputType::airLoopOutput, AirLoopCoolCompLoadTables(iAirLoop), AirLoopHeatCompLoadTables(iAirLoop), iAirLoop); } } @@ -13128,7 +13082,7 @@ namespace EnergyPlus::OutputReportTabular { LoadSummaryUnitConversion(state, FacilityCoolCompLoadTables); LoadSummaryUnitConversion(state, FacilityHeatCompLoadTables); - OutputCompLoadSummary(state, facilityOutput, FacilityCoolCompLoadTables, FacilityHeatCompLoadTables, 0); + OutputCompLoadSummary(state, iOutputType::facilityOutput, FacilityCoolCompLoadTables, FacilityHeatCompLoadTables, 0); } // ZoneComponentLoadSummary: Now we convert and Display @@ -13139,7 +13093,7 @@ namespace EnergyPlus::OutputReportTabular { LoadSummaryUnitConversion(state, ZoneCoolCompLoadTables(iZone)); LoadSummaryUnitConversion(state, ZoneHeatCompLoadTables(iZone)); - OutputCompLoadSummary(state, zoneOuput, ZoneCoolCompLoadTables(iZone), ZoneHeatCompLoadTables(iZone), iZone); + OutputCompLoadSummary(state, iOutputType::zoneOutput, ZoneCoolCompLoadTables(iZone), ZoneHeatCompLoadTables(iZone), iZone); } } } @@ -13963,7 +13917,7 @@ namespace EnergyPlus::OutputReportTabular { // provide output from the load component summary tables void OutputCompLoadSummary(EnergyPlusData &state, - int const &kind, // zone=1, airloop=2, facility=3 + iOutputType const &kind, CompLoadTablesType const &compLoadCool, CompLoadTablesType const &compLoadHeat, int const &zoneOrAirLoopIndex) @@ -13978,15 +13932,15 @@ namespace EnergyPlus::OutputReportTabular { std::string reportName; std::string zoneAirLoopFacilityName; - if (kind == zoneOuput && displayZoneComponentLoadSummary) { + if (kind == iOutputType::zoneOutput && displayZoneComponentLoadSummary) { reportName = "Zone Component Load Summary"; zoneAirLoopFacilityName = Zone(zoneOrAirLoopIndex).Name; writeOutput = true; - } else if (kind == airLoopOutput && displayAirLoopComponentLoadSummary) { + } else if (kind == iOutputType::airLoopOutput && displayAirLoopComponentLoadSummary) { reportName = "AirLoop Component Load Summary"; zoneAirLoopFacilityName = DataSizing::FinalSysSizing(zoneOrAirLoopIndex).AirPriLoopName; writeOutput = true; - } else if (kind == facilityOutput && displayFacilityComponentLoadSummary) { + } else if (kind == iOutputType::facilityOutput && displayFacilityComponentLoadSummary) { reportName = "Facility Component Load Summary"; zoneAirLoopFacilityName = "Facility"; writeOutput = true; @@ -14150,7 +14104,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 7) = RealToStr(curCompLoad.zoneHumRatio, 5); // Zone Humidity Ratio at Peak } tableBody(1, 8) = RealToStr(curCompLoad.supAirTemp, 2); // supply air temperature - if (kind == airLoopOutput) { + if (kind == iOutputType::airLoopOutput) { tableBody(1, 9) = RealToStr(curCompLoad.mixAirTemp, 2); // mixed air temperature - not for zone or facility } tableBody(1, 10) = RealToStr(curCompLoad.mainFanAirFlow, 2); // main fan air flow @@ -14220,7 +14174,7 @@ namespace EnergyPlus::OutputReportTabular { } // write the list of zone for the AirLoop level report - if (kind == airLoopOutput && curCompLoad.zoneIndices.allocated()) { + if (kind == iOutputType::airLoopOutput && curCompLoad.zoneIndices.allocated()) { int maxRow = 0; for (size_t zi = 1; zi <= curCompLoad.zoneIndices.size(); ++zi) { if (curCompLoad.zoneIndices(zi) > 0) { diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index a0982a0e226..92403eb630e 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -116,41 +116,47 @@ namespace OutputReportTabular { extern int const stepTypeZone; extern int const stepTypeHVAC; - extern int const cSensInst; - extern int const cSensDelay; - extern int const cSensRA; - extern int const cLatent; - extern int const cTotal; - extern int const cPerc; - extern int const cArea; - extern int const cPerArea; - - extern int const rPeople; - extern int const rLights; - extern int const rEquip; - extern int const rRefrig; - extern int const rWaterUse; - extern int const rHvacLoss; - extern int const rPowerGen; - extern int const rDOAS; - extern int const rInfil; - extern int const rZoneVent; - extern int const rIntZonMix; - extern int const rRoof; - extern int const rIntZonCeil; - extern int const rOtherRoof; - extern int const rExtWall; - extern int const rIntZonWall; - extern int const rGrdWall; - extern int const rOtherWall; - extern int const rExtFlr; - extern int const rIntZonFlr; - extern int const rGrdFlr; - extern int const rOtherFlr; - extern int const rFeneCond; - extern int const rFeneSolr; - extern int const rOpqDoor; - extern int const rGrdTot; + // These correspond to the columns in the load component table + constexpr int cSensInst(1); + constexpr int cSensDelay(2); + constexpr int cSensRA(3); + constexpr int cLatent(4); + constexpr int cTotal(5); + constexpr int cPerc(6); + constexpr int cArea(7); + constexpr int cPerArea(8); + + // internal gains + constexpr int rPeople(1); + constexpr int rLights(2); + constexpr int rEquip(3); + constexpr int rRefrig(4); + constexpr int rWaterUse(5); + constexpr int rHvacLoss(6); + constexpr int rPowerGen(7); + // misc + constexpr int rDOAS(8); + constexpr int rInfil(9); + constexpr int rZoneVent(10); + constexpr int rIntZonMix(11); + // opaque surfaces + constexpr int rRoof(12); + constexpr int rIntZonCeil(13); + constexpr int rOtherRoof(14); + constexpr int rExtWall(15); + constexpr int rIntZonWall(16); + constexpr int rGrdWall(17); + constexpr int rOtherWall(18); + constexpr int rExtFlr(19); + constexpr int rIntZonFlr(20); + constexpr int rGrdFlr(21); + constexpr int rOtherFlr(22); + // subsurfaces + constexpr int rFeneCond(23); + constexpr int rFeneSolr(24); + constexpr int rOpqDoor(25); + // total + constexpr int rGrdTot(26); // BEPS Report Related Variables // From Report:Table:Predefined - BEPS @@ -159,6 +165,12 @@ namespace OutputReportTabular { constexpr const char *validChars("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_:."); + enum class iOutputType { + zoneOutput, + airLoopOutput, + facilityOutput, + }; + // MODULE VARIABLE DECLARATIONS: // The Binned table type is different and only references one variable and its structure is very @@ -925,7 +937,7 @@ namespace OutputReportTabular { void CreateListOfZonesForAirLoop(EnergyPlusData &state, CompLoadTablesType &compLoad, Array1D_int const &zoneToAirLoop, int const &curAirLoop); void OutputCompLoadSummary(EnergyPlusData &state, - int const &kind, // zone=1, airloop=2, facility=3 + iOutputType const &kind, CompLoadTablesType const &compLoadCool, CompLoadTablesType const &compLoadHeat, int const &zoneOrAirLoopIndex); From 90a314664ebbcd45d23e8a754a9e474f08e1cc6d Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 18 Dec 2020 15:33:28 -0700 Subject: [PATCH 05/14] moving OutputReportTabular to state --- src/EnergyPlus/OutputReportTabular.cc | 1175 ++++++++--------- src/EnergyPlus/OutputReportTabular.hh | 42 +- src/EnergyPlus/SimulationManager.cc | 3 +- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 4 +- .../unit/OutputReportTabular.unit.cc | 8 +- 5 files changed, 607 insertions(+), 625 deletions(-) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 208f4af3a93..8b48776b43d 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -177,18 +177,6 @@ namespace EnergyPlus::OutputReportTabular { // arrays for time binned results - int OutputTableBinnedCount(0); - int BinResultsTableCount(0); - int BinResultsIntervalCount(0); - - int MonthlyInputCount(0); - int sizeMonthlyInput(0); - int MonthlyFieldSetInputCount(0); - int sizeMonthlyFieldSetInput(0); - int MonthlyTablesCount(0); - int MonthlyColumnsCount(0); - Array1D_bool IsMonthGathered(12, false); // shown as true for any month used - int TOCEntriesCount(0); int TOCEntriesSize(0); @@ -196,7 +184,6 @@ namespace EnergyPlus::OutputReportTabular { bool WriteTabularFiles(false); bool GetInput(true); - bool firstTimeGatherHGReport(true); // From Report:Table:Style int numStyles(0); @@ -214,8 +201,8 @@ namespace EnergyPlus::OutputReportTabular { // Flags for predefined tabular reports bool displayTabularBEPS(false); bool displayLEEDSummary(false); - bool displayTabularCompCosts(false); // added BTG 5/6/04 for component cost summary - bool displayTabularVeriSum(false); // added JG 2006-06-28 for input verification and summary report + bool displayTabularCompCosts(false); + bool displayTabularVeriSum(false); bool displayComponentSizing(false); bool displaySurfaceShadowing(false); bool displayDemandEndUse(false); @@ -442,16 +429,6 @@ namespace EnergyPlus::OutputReportTabular { GatherHeatGainReportfirstTime = true; AllocateLoadComponentArraysDoAllocate = true; initAdjFenDone = false; - OutputTableBinnedCount = 0; - BinResultsTableCount = 0; - BinResultsIntervalCount = 0; - MonthlyInputCount = 0; - sizeMonthlyInput = 0; - MonthlyFieldSetInputCount = 0; - sizeMonthlyFieldSetInput = 0; - MonthlyTablesCount = 0; - MonthlyColumnsCount = 0; - IsMonthGathered = Array1D_bool(12, false); TOCEntriesCount = 0; TOCEntriesSize = 0; UnitConvSize = 0; @@ -749,8 +726,8 @@ namespace EnergyPlus::OutputReportTabular { return; } - MonthlyInputCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - if (MonthlyInputCount > 0) { + state.dataOutRptTab->MonthlyInputCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + if (state.dataOutRptTab->MonthlyInputCount > 0) { WriteTabularFiles = true; // if not a run period using weather do not create reports if (!state.dataGlobal->DoWeathSim) { @@ -762,7 +739,7 @@ namespace EnergyPlus::OutputReportTabular { inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, NumParams, NumAlphas, NumNums); AlphArray.allocate(NumAlphas); NumArray.dimension(NumNums, 0.0); - for (int TabNum = 1, TabNum_end = MonthlyInputCount; TabNum <= TabNum_end; ++TabNum) { // MonthlyInputCount is modified in the loop + for (int TabNum = 1, TabNum_end = state.dataOutRptTab->MonthlyInputCount; TabNum <= TabNum_end; ++TabNum) { // MonthlyInputCount is modified in the loop inputProcessor->getObjectItem(state, CurrentModuleObject, TabNum, AlphArray, NumAlphas, NumArray, NumNums, IOStat); if (TabNum - 1 > 0) { @@ -772,7 +749,7 @@ namespace EnergyPlus::OutputReportTabular { ShowSevereError(state, CurrentModuleObject + ": No fields specified."); } // add to the data structure - curTable = AddMonthlyReport(AlphArray(1), int(NumArray(1))); + curTable = AddMonthlyReport(state, AlphArray(1), int(NumArray(1))); for (jField = 2; jField <= NumAlphas; jField += 2) { if (AlphArray(jField).empty()) { ShowFatalError(state, "Blank report name in Output:Table:Monthly"); @@ -810,12 +787,12 @@ namespace EnergyPlus::OutputReportTabular { ShowWarningError(state, CurrentModuleObject + '=' + MonthlyInput(TabNum).name + ", Variable name=" + AlphArray(jField)); ShowContinueError(state, "Invalid aggregation type=\"" + curAggString + "\" Defaulting to SumOrAverage."); } - AddMonthlyFieldSetInput(curTable, AlphArray(jField), "", curAggType); + AddMonthlyFieldSetInput(state, curTable, AlphArray(jField), "", curAggType); } } } - int AddMonthlyReport(std::string const &inReportName, int const inNumDigitsShown) + int AddMonthlyReport(EnergyPlusData &state, std::string const &inReportName, int const inNumDigitsShown) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -853,22 +830,22 @@ namespace EnergyPlus::OutputReportTabular { if (!allocated(MonthlyInput)) { MonthlyInput.allocate(SizeAdder); - sizeMonthlyInput = SizeAdder; - MonthlyInputCount = 1; + state.dataOutRptTab->sizeMonthlyInput = SizeAdder; + state.dataOutRptTab->MonthlyInputCount = 1; } else { - ++MonthlyInputCount; + ++state.dataOutRptTab->MonthlyInputCount; // if larger than current size grow the array - if (MonthlyInputCount > sizeMonthlyInput) { - MonthlyInput.redimension(sizeMonthlyInput += SizeAdder); + if (state.dataOutRptTab->MonthlyInputCount > state.dataOutRptTab->sizeMonthlyInput) { + MonthlyInput.redimension(state.dataOutRptTab->sizeMonthlyInput += SizeAdder); } } // initialize new record - MonthlyInput(MonthlyInputCount).name = inReportName; - MonthlyInput(MonthlyInputCount).showDigits = inNumDigitsShown; - return MonthlyInputCount; + MonthlyInput(state.dataOutRptTab->MonthlyInputCount).name = inReportName; + MonthlyInput(state.dataOutRptTab->MonthlyInputCount).showDigits = inNumDigitsShown; + return state.dataOutRptTab->MonthlyInputCount; } - void AddMonthlyFieldSetInput(int const inMonthReport, std::string const &inVariMeter, std::string const &inColHead, iAggType const inAggregate) + void AddMonthlyFieldSetInput(EnergyPlusData &state, int const inMonthReport, std::string const &inVariMeter, std::string const &inColHead, iAggType const inAggregate) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -905,24 +882,24 @@ namespace EnergyPlus::OutputReportTabular { if (!allocated(MonthlyFieldSetInput)) { MonthlyFieldSetInput.allocate(sizeIncrement); - sizeMonthlyFieldSetInput = sizeIncrement; - MonthlyFieldSetInputCount = 1; + state.dataOutRptTab->sizeMonthlyFieldSetInput = sizeIncrement; + state.dataOutRptTab->MonthlyFieldSetInputCount = 1; } else { - ++MonthlyFieldSetInputCount; + ++state.dataOutRptTab->MonthlyFieldSetInputCount; // if larger than current size grow the array - if (MonthlyFieldSetInputCount > sizeMonthlyFieldSetInput) { - MonthlyFieldSetInput.redimension(sizeMonthlyFieldSetInput *= + if (state.dataOutRptTab->MonthlyFieldSetInputCount > state.dataOutRptTab->sizeMonthlyFieldSetInput) { + MonthlyFieldSetInput.redimension(state.dataOutRptTab->sizeMonthlyFieldSetInput *= 2); // Tuned Changed += sizeIncrement to *= 2 for reduced heap allocations (at some space cost) } } // initialize new record) - MonthlyFieldSetInput(MonthlyFieldSetInputCount).variMeter = inVariMeter; - MonthlyFieldSetInput(MonthlyFieldSetInputCount).colHead = inColHead; - MonthlyFieldSetInput(MonthlyFieldSetInputCount).aggregate = inAggregate; + MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).variMeter = inVariMeter; + MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).colHead = inColHead; + MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).aggregate = inAggregate; // update the references from the MonthlyInput array - if ((inMonthReport > 0) && (inMonthReport <= MonthlyInputCount)) { + if ((inMonthReport > 0) && (inMonthReport <= state.dataOutRptTab->MonthlyInputCount)) { if (MonthlyInput(inMonthReport).firstFieldSet == 0) { - MonthlyInput(inMonthReport).firstFieldSet = MonthlyFieldSetInputCount; + MonthlyInput(inMonthReport).firstFieldSet = state.dataOutRptTab->MonthlyFieldSetInputCount; MonthlyInput(inMonthReport).numFieldSet = 1; } else { ++MonthlyInput(inMonthReport).numFieldSet; @@ -1021,9 +998,9 @@ namespace EnergyPlus::OutputReportTabular { // ALLOCATE(IndexesForKeyVar(maxKeyCount)) //#endif - MonthlyColumnsCount = 0; - MonthlyTablesCount = 0; - for (TabNum = 1; TabNum <= MonthlyInputCount; ++TabNum) { + state.dataOutRptTab->MonthlyColumnsCount = 0; + state.dataOutRptTab->MonthlyTablesCount = 0; + for (TabNum = 1; TabNum <= state.dataOutRptTab->MonthlyInputCount; ++TabNum) { // the number of columns based on number of alpha fields NumColumns = MonthlyInput(TabNum).numFieldSet; FirstColumn = MonthlyInput(TabNum).firstFieldSet; @@ -1109,14 +1086,14 @@ namespace EnergyPlus::OutputReportTabular { UniqueKeyCount = 1; } // increment the number of tables based on the number of unique keys - MonthlyTablesCount += UniqueKeyCount; - MonthlyColumnsCount += UniqueKeyCount * NumColumns; + state.dataOutRptTab->MonthlyTablesCount += UniqueKeyCount; + state.dataOutRptTab->MonthlyColumnsCount += UniqueKeyCount * NumColumns; } // TabNum the end of the loop through the inputs objects // Now that we have the maximum size of the number of tables (each table is // repeated for the number of keys found) and the number of total columns // of all of the tables, allocate the arrays to store this information. - MonthlyTables.allocate(MonthlyTablesCount); - MonthlyColumns.allocate(MonthlyColumnsCount); + MonthlyTables.allocate(state.dataOutRptTab->MonthlyTablesCount); + MonthlyColumns.allocate(state.dataOutRptTab->MonthlyColumnsCount); // Initialize tables and results for (auto &e : MonthlyTables) { e.keyValue.clear(); @@ -1133,7 +1110,7 @@ namespace EnergyPlus::OutputReportTabular { e.units = OutputProcessor::Unit::None; e.aggType = iAggType::Unassigned; } - for (colNum = 1; colNum <= MonthlyColumnsCount; ++colNum) { + for (colNum = 1; colNum <= state.dataOutRptTab->MonthlyColumnsCount; ++colNum) { MonthlyColumns(colNum).reslt = 0.0; MonthlyColumns(colNum).timeStamp = 0; MonthlyColumns(colNum).duration = 0.0; @@ -1141,7 +1118,7 @@ namespace EnergyPlus::OutputReportTabular { ColumnsRecount = 0; TablesRecount = 0; - for (TabNum = 1; TabNum <= MonthlyInputCount; ++TabNum) { + for (TabNum = 1; TabNum <= state.dataOutRptTab->MonthlyInputCount; ++TabNum) { // the number of columns based on number of alpha fields NumColumns = MonthlyInput(TabNum).numFieldSet; FirstColumn = MonthlyInput(TabNum).firstFieldSet; @@ -1369,7 +1346,7 @@ namespace EnergyPlus::OutputReportTabular { if (!state.dataGlobal->DoWeathSim) { // if no weather simulation than no reading of MonthlyInput array return foundError; } - for (int iInput = 1; iInput <= MonthlyInputCount; ++iInput) { + for (int iInput = 1; iInput <= state.dataOutRptTab->MonthlyInputCount; ++iInput) { bool foundMinOrMax = false; bool foundHourAgg = false; bool missingMaxOrMinError = false; @@ -1479,9 +1456,9 @@ namespace EnergyPlus::OutputReportTabular { timeInYear = 0.0; // intialize the time in year counter // determine size of array that holds the IDF description - OutputTableBinnedCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - OutputTableBinned.allocate(OutputTableBinnedCount); - if (OutputTableBinnedCount > 0) { + state.dataOutRptTab->OutputTableBinnedCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + OutputTableBinned.allocate(state.dataOutRptTab->OutputTableBinnedCount); + if (state.dataOutRptTab->OutputTableBinnedCount > 0) { WriteTabularFiles = true; // if not a run period using weather do not create reports if (!state.dataGlobal->DoWeathSim) { @@ -1491,9 +1468,9 @@ namespace EnergyPlus::OutputReportTabular { } } // looking for maximum number of intervals for sizing - BinResultsIntervalCount = 0; - BinResultsTableCount = 0; - for (iInObj = 1; iInObj <= OutputTableBinnedCount; ++iInObj) { + state.dataOutRptTab->BinResultsIntervalCount = 0; + state.dataOutRptTab->BinResultsTableCount = 0; + for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { inputProcessor->getObjectItem(state, CurrentModuleObject, iInObj, @@ -1539,10 +1516,10 @@ namespace EnergyPlus::OutputReportTabular { if (OutputTableBinned(iInObj).intervalSize < 0) { OutputTableBinned(iInObj).intervalSize = 1000.0; } - OutputTableBinned(iInObj).resIndex = BinResultsTableCount + 1; // the next results report + OutputTableBinned(iInObj).resIndex = state.dataOutRptTab->BinResultsTableCount + 1; // the next results report // find maximum number of intervals - if (OutputTableBinned(iInObj).intervalCount > BinResultsIntervalCount) { - BinResultsIntervalCount = OutputTableBinned(iInObj).intervalCount; + if (OutputTableBinned(iInObj).intervalCount > state.dataOutRptTab->BinResultsIntervalCount) { + state.dataOutRptTab->BinResultsIntervalCount = OutputTableBinned(iInObj).intervalCount; } GetVariableKeyCountandType(state, OutputTableBinned(iInObj).varOrMeter, OutputTableBinned(iInObj).numTables, @@ -1557,20 +1534,20 @@ namespace EnergyPlus::OutputReportTabular { // later will reset the numTables array pointer but for now use it to know // how many items to scan through if (OutputTableBinned(iInObj).keyValue == "*") { - BinResultsTableCount += OutputTableBinned(iInObj).numTables; + state.dataOutRptTab->BinResultsTableCount += OutputTableBinned(iInObj).numTables; } else { - ++BinResultsTableCount; // if a particular key is requested then only one more report + ++state.dataOutRptTab->BinResultsTableCount; // if a particular key is requested then only one more report } } // size the arrays that holds the bin results - BinResults.allocate(BinResultsIntervalCount, BinResultsTableCount); - BinResultsBelow.allocate(BinResultsTableCount); - BinResultsAbove.allocate(BinResultsTableCount); - BinStatistics.allocate(BinResultsTableCount); - BinObjVarID.allocate(BinResultsTableCount); + BinResults.allocate(state.dataOutRptTab->BinResultsIntervalCount, state.dataOutRptTab->BinResultsTableCount); + BinResultsBelow.allocate(state.dataOutRptTab->BinResultsTableCount); + BinResultsAbove.allocate(state.dataOutRptTab->BinResultsTableCount); + BinStatistics.allocate(state.dataOutRptTab->BinResultsTableCount); + BinObjVarID.allocate(state.dataOutRptTab->BinResultsTableCount); // now that the arrays are sized go back and fill in // what ID numbers are used for each table - for (iInObj = 1; iInObj <= OutputTableBinnedCount; ++iInObj) { + for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { firstReport = OutputTableBinned(iInObj).resIndex; // allocate the arrays to the number of objects objNames.allocate(OutputTableBinned(iInObj).numTables); @@ -2127,7 +2104,7 @@ namespace EnergyPlus::OutputReportTabular { // ErrorsFound=.TRUE. } } - CreatePredefinedMonthlyReports(); + CreatePredefinedMonthlyReports(state); } else if (NumTabularPredefined > 1) { ShowSevereError(state, CurrentModuleObject + ": Only one instance of this object is allowed."); ErrorsFound = true; @@ -2492,7 +2469,7 @@ namespace EnergyPlus::OutputReportTabular { } } - void CreatePredefinedMonthlyReports() + void CreatePredefinedMonthlyReports(EnergyPlusData &state) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -2532,635 +2509,635 @@ namespace EnergyPlus::OutputReportTabular { // ---------------------------------------------------------------------------------------- if (namedMonthly(1).show) { - curReport = AddMonthlyReport("ZoneCoolingSummaryMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Cooling Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Total Internal Latent Gain Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Total Internal Latent Gain Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); + curReport = AddMonthlyReport(state, "ZoneCoolingSummaryMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Zone Total Internal Latent Gain Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Total Internal Latent Gain Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(2).show) { - curReport = AddMonthlyReport("ZoneHeatingSummaryMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Heating Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); + curReport = AddMonthlyReport(state, "ZoneHeatingSummaryMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Heating Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(3).show) { - curReport = AddMonthlyReport("ZoneElectricSummaryMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Lights Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Lights Electricity Energy", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Electricity Energy", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "ZoneElectricSummaryMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone Lights Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Lights Electricity Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Zone Electric Equipment Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Electric Equipment Electricity Energy", "", iAggType::Maximum); } if (namedMonthly(4).show) { - curReport = AddMonthlyReport("SpaceGainsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone People Total Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Lights Total Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Total Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Gas Equipment Total Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Hot Water Equipment Total Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Steam Equipment Total Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Other Equipment Total Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "SpaceGainsMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone People Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Lights Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Electric Equipment Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Gas Equipment Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Hot Water Equipment Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Steam Equipment Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Other Equipment Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::SumOrAvg); } if (namedMonthly(5).show) { - curReport = AddMonthlyReport("PeakSpaceGainsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone People Total Heating Energy", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Zone Lights Total Heating Energy", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Total Heating Energy", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Zone Gas Equipment Total Heating Energy", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Zone Hot Water Equipment Total Heating Energy", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Zone Steam Equipment Total Heating Energy", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Zone Other Equipment Total Heating Energy", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "PeakSpaceGainsMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone People Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Zone Lights Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Zone Electric Equipment Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Zone Gas Equipment Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Zone Hot Water Equipment Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Zone Steam Equipment Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Zone Other Equipment Total Heating Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::Maximum); } if (namedMonthly(6).show) { - curReport = AddMonthlyReport("SpaceGainComponentsAtCoolingPeakMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Air System Sensible Cooling Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Zone People Total Heating Energy", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Lights Total Heating Energy", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Electric Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Gas Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Hot Water Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Steam Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Other Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::ValueWhenMaxMin); + curReport = AddMonthlyReport(state, "SpaceGainComponentsAtCoolingPeakMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Zone People Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Zone Lights Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Zone Electric Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Zone Gas Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Zone Hot Water Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Zone Steam Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Zone Other Equipment Total Heating Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(7).show) { - curReport = AddMonthlyReport("EnergyConsumptionElectricityNaturalGasMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Electricity:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Electricity:Facility", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "NaturalGas:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "NaturalGas:Facility", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "EnergyConsumptionElectricityNaturalGasMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Electricity:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Electricity:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "NaturalGas:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "NaturalGas:Facility", "", iAggType::Maximum); } if (namedMonthly(8).show) { - curReport = AddMonthlyReport("EnergyConsumptionElectricityGeneratedPropaneMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ElectricityProduced:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "ElectricityProduced:Facility", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Propane:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Propane:Facility", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "EnergyConsumptionElectricityGeneratedPropaneMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ElectricityProduced:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "ElectricityProduced:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Propane:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Propane:Facility", "", iAggType::Maximum); } if (namedMonthly(9).show) { - curReport = AddMonthlyReport("EnergyConsumptionDieselFuelOilMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Diesel:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Diesel:Facility", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "FuelOilNo1:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "FuelOilNo1:Facility", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "FuelOilNo2:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "FuelOilNo2:Facility", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "EnergyConsumptionDieselFuelOilMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Diesel:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Diesel:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "FuelOilNo1:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "FuelOilNo1:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "FuelOilNo2:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "FuelOilNo2:Facility", "", iAggType::Maximum); } if (namedMonthly(10).show) { - curReport = AddMonthlyReport("EnergyConsumptionDistrictHeatingCoolingMonthly", 2); - AddMonthlyFieldSetInput(curReport, "DistrictCooling:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "DistrictCooling:Facility", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "DistrictHeating:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "DistrictHeating:Facility", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "EnergyConsumptionDistrictHeatingCoolingMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "DistrictCooling:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "DistrictCooling:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "DistrictHeating:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "DistrictHeating:Facility", "", iAggType::Maximum); } if (namedMonthly(11).show) { - curReport = AddMonthlyReport("EnergyConsumptionCoalGasolineMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Coal:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Coal:Facility", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Gasoline:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Gasoline:Facility", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "EnergyConsumptionCoalGasolineMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Coal:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Coal:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Gasoline:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Gasoline:Facility", "", iAggType::Maximum); } if (namedMonthly(12).show) { - curReport = AddMonthlyReport("EnergyConsumptionOtherFuelsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "OtherFuel1:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "OtherFuel1:Facility", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "OtherFuel2:Facility", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "OtherFuel2:Facility", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "EnergyConsumptionOtherFuelsMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "OtherFuel1:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "OtherFuel1:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "OtherFuel2:Facility", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "OtherFuel2:Facility", "", iAggType::Maximum); } if (namedMonthly(13).show) { - curReport = AddMonthlyReport("EndUseEnergyConsumptionElectricityMonthly", 2); - AddMonthlyFieldSetInput(curReport, "InteriorLights:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "ExteriorLights:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "InteriorEquipment:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Fans:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Pumps:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "HeatRejection:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Humidifier:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "HeatRecovery:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Electricity", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Electricity", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionElectricityMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "InteriorLights:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "ExteriorLights:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "InteriorEquipment:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Fans:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Pumps:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Heating:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "HeatRejection:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Humidifier:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "HeatRecovery:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Electricity", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Electricity", "", iAggType::SumOrAvg); } if (namedMonthly(14).show) { - curReport = AddMonthlyReport("EndUseEnergyConsumptionNaturalGasMonthly", 2); - AddMonthlyFieldSetInput(curReport, "InteriorEquipment:NaturalGas", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:NaturalGas", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:NaturalGas", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:NaturalGas", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:NaturalGas", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:NaturalGas", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Humidifier:NaturalGas", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionNaturalGasMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "InteriorEquipment:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Heating:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:NaturalGas", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Humidifier:NaturalGas", "", iAggType::SumOrAvg); } if (namedMonthly(15).show) { - curReport = AddMonthlyReport("EndUseEnergyConsumptionDieselMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Diesel", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:Diesel", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:Diesel", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Diesel", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Diesel", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionDieselMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Diesel", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling:Diesel", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Heating:Diesel", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Diesel", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Diesel", "", iAggType::SumOrAvg); } if (namedMonthly(16).show) { - curReport = AddMonthlyReport("EndUseEnergyConsumptionFuelOilMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo1", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo1", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo1", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo1", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo1", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo2", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo2", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo2", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo2", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo2", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionFuelOilMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:FuelOilNo1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling:FuelOilNo1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Heating:FuelOilNo1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:FuelOilNo1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:FuelOilNo1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:FuelOilNo2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling:FuelOilNo2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Heating:FuelOilNo2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:FuelOilNo2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:FuelOilNo2", "", iAggType::SumOrAvg); } if (namedMonthly(17).show) { - curReport = AddMonthlyReport("EndUseEnergyConsumptionCoalMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Coal", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:Coal", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Coal", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionCoalMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Coal", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Heating:Coal", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Coal", "", iAggType::SumOrAvg); } if (namedMonthly(18).show) { - curReport = AddMonthlyReport("EndUseEnergyConsumptionPropaneMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Propane", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:Propane", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:Propane", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Propane", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Propane", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Humidifier:Propane", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionPropaneMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Propane", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling:Propane", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Heating:Propane", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Propane", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Propane", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Humidifier:Propane", "", iAggType::SumOrAvg); } if (namedMonthly(19).show) { - curReport = AddMonthlyReport("EndUseEnergyConsumptionGasolineMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Gasoline", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:Gasoline", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:Gasoline", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Gasoline", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Gasoline", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionGasolineMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Gasoline", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling:Gasoline", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Heating:Gasoline", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Gasoline", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Gasoline", "", iAggType::SumOrAvg); } if (namedMonthly(20).show) { - curReport = AddMonthlyReport("EndUseEnergyConsumptionOtherFuelsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel1", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel1", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel1", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel1", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel1", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel2", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel2", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel2", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel2", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel2", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionOtherFuelsMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:OtherFuel1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling:OtherFuel1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Heating:OtherFuel1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:OtherFuel1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:OtherFuel1", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:OtherFuel2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling:OtherFuel2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Heating:OtherFuel2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:OtherFuel2", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:OtherFuel2", "", iAggType::SumOrAvg); } if (namedMonthly(21).show) { - curReport = AddMonthlyReport("PeakEnergyEndUseElectricityPart1Monthly", 2); - AddMonthlyFieldSetInput(curReport, "InteriorLights:Electricity", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "ExteriorLights:Electricity", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "InteriorEquipment:Electricity", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Electricity", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Fans:Electricity", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Pumps:Electricity", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Heating:Electricity", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "PeakEnergyEndUseElectricityPart1Monthly", 2); + AddMonthlyFieldSetInput(state, curReport, "InteriorLights:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "ExteriorLights:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "InteriorEquipment:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Fans:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Pumps:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Heating:Electricity", "", iAggType::Maximum); } if (namedMonthly(22).show) { - curReport = AddMonthlyReport("PeakEnergyEndUseElectricityPart2Monthly", 2); - AddMonthlyFieldSetInput(curReport, "Cooling:Electricity", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "HeatRejection:Electricity", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Humidifier:Electricity", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "HeatRecovery:Electricity", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Electricity", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Electricity", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "PeakEnergyEndUseElectricityPart2Monthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Cooling:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "HeatRejection:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Humidifier:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "HeatRecovery:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Electricity", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Electricity", "", iAggType::Maximum); } if (namedMonthly(23).show) { - curReport = AddMonthlyReport("ElectricComponentsOfPeakDemandMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Electricity:Facility", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "InteriorLights:Electricity", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "InteriorEquipment:Electricity", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "ExteriorLights:Electricity", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Electricity", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Fans:Electricity", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Pumps:Electricity", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Heating:Electricity", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Cooling:Electricity", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "HeatRejection:Electricity", "", iAggType::ValueWhenMaxMin); + curReport = AddMonthlyReport(state, "ElectricComponentsOfPeakDemandMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Electricity:Facility", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "InteriorLights:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "InteriorEquipment:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "ExteriorLights:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Fans:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Pumps:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Heating:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Cooling:Electricity", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "HeatRejection:Electricity", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(24).show) { - curReport = AddMonthlyReport("PeakEnergyEndUseNaturalGasMonthly", 2); - AddMonthlyFieldSetInput(curReport, "InteriorEquipment:NaturalGas", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:NaturalGas", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Heating:NaturalGas", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling:NaturalGas", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:NaturalGas", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:NaturalGas", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "PeakEnergyEndUseNaturalGasMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "InteriorEquipment:NaturalGas", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:NaturalGas", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Heating:NaturalGas", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling:NaturalGas", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:NaturalGas", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:NaturalGas", "", iAggType::Maximum); } if (namedMonthly(25).show) { - curReport = AddMonthlyReport("PeakEnergyEndUseDieselMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Diesel", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling:Diesel", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Heating:Diesel", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Diesel", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Diesel", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "PeakEnergyEndUseDieselMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Diesel", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling:Diesel", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Heating:Diesel", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Diesel", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Diesel", "", iAggType::Maximum); } if (namedMonthly(26).show) { - curReport = AddMonthlyReport("PeakEnergyEndUseFuelOilMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo1", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo1", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo1", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo1", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo1", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:FuelOilNo2", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling:FuelOilNo2", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Heating:FuelOilNo2", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:FuelOilNo2", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:FuelOilNo2", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "PeakEnergyEndUseFuelOilMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:FuelOilNo1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling:FuelOilNo1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Heating:FuelOilNo1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:FuelOilNo1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:FuelOilNo1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:FuelOilNo2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling:FuelOilNo2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Heating:FuelOilNo2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:FuelOilNo2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:FuelOilNo2", "", iAggType::Maximum); } if (namedMonthly(27).show) { - curReport = AddMonthlyReport("PeakEnergyEndUseCoalMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Coal", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Heating:Coal", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Coal", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "PeakEnergyEndUseCoalMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Coal", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Heating:Coal", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Coal", "", iAggType::Maximum); } if (namedMonthly(28).show) { - curReport = AddMonthlyReport("PeakEnergyEndUsePropaneMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Propane", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling:Propane", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Heating:Propane", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Propane", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Propane", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "PeakEnergyEndUsePropaneMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Propane", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling:Propane", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Heating:Propane", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Propane", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Propane", "", iAggType::Maximum); } if (namedMonthly(29).show) { - curReport = AddMonthlyReport("PeakEnergyEndUseGasolineMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:Gasoline", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling:Gasoline", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Heating:Gasoline", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:Gasoline", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:Gasoline", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "PeakEnergyEndUseGasolineMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Gasoline", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling:Gasoline", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Heating:Gasoline", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Gasoline", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Gasoline", "", iAggType::Maximum); } if (namedMonthly(30).show) { - curReport = AddMonthlyReport("PeakEnergyEndUseOtherFuelsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel1", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel1", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel1", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel1", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel1", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "ExteriorEquipment:OtherFuel2", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling:OtherFuel2", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Heating:OtherFuel2", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "WaterSystems:OtherFuel2", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cogeneration:OtherFuel2", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "PeakEnergyEndUseOtherFuelsMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:OtherFuel1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling:OtherFuel1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Heating:OtherFuel1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:OtherFuel1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:OtherFuel1", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:OtherFuel2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling:OtherFuel2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Heating:OtherFuel2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "WaterSystems:OtherFuel2", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cogeneration:OtherFuel2", "", iAggType::Maximum); } if (namedMonthly(31).show) { - curReport = AddMonthlyReport("SetpointsNotMetWithTemperaturesMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Heating Setpoint Not Met Time", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Zone Heating Setpoint Not Met While Occupied Time", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Zone Cooling Setpoint Not Met Time", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Zone Cooling Setpoint Not Met While Occupied Time", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); + curReport = AddMonthlyReport(state, "SetpointsNotMetWithTemperaturesMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone Heating Setpoint Not Met Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Zone Heating Setpoint Not Met While Occupied Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Zone Cooling Setpoint Not Met Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Zone Cooling Setpoint Not Met While Occupied Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); } if (namedMonthly(32).show) { - curReport = AddMonthlyReport("ComfortReportSimple55Monthly", 2); - AddMonthlyFieldSetInput( + curReport = AddMonthlyReport(state, "ComfortReportSimple55Monthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Summer Clothes Not Comfortable Time", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput( + AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Winter Clothes Not Comfortable Time", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput( + AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Summer or Winter Clothes Not Comfortable Time", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); } if (namedMonthly(33).show) { - curReport = AddMonthlyReport("UnglazedTranspiredSolarCollectorSummaryMonthly", 5); - AddMonthlyFieldSetInput(curReport, "Solar Collector System Efficiency", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Solar Collector System Efficiency", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Solar Collector Outside Face Suction Velocity", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Solar Collector Sensible Heating Rate", "", iAggType::SumOrAverageHoursShown); + curReport = AddMonthlyReport(state, "UnglazedTranspiredSolarCollectorSummaryMonthly", 5); + AddMonthlyFieldSetInput(state, curReport, "Solar Collector System Efficiency", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Solar Collector System Efficiency", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Solar Collector Outside Face Suction Velocity", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Solar Collector Sensible Heating Rate", "", iAggType::SumOrAverageHoursShown); } if (namedMonthly(34).show) { - curReport = AddMonthlyReport("OccupantComfortDataSummaryMonthly", 5); - AddMonthlyFieldSetInput(curReport, "People Occupant Count", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "People Air Temperature", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "People Air Relative Humidity", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Zone Thermal Comfort Fanger Model PMV", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Zone Thermal Comfort Fanger Model PPD", "", iAggType::SumOrAverageHoursShown); + curReport = AddMonthlyReport(state, "OccupantComfortDataSummaryMonthly", 5); + AddMonthlyFieldSetInput(state, curReport, "People Occupant Count", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "People Air Temperature", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "People Air Relative Humidity", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Zone Thermal Comfort Fanger Model PMV", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Zone Thermal Comfort Fanger Model PPD", "", iAggType::SumOrAverageHoursShown); } if (namedMonthly(35).show) { - curReport = AddMonthlyReport("ChillerReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Chiller Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Chiller Electricity Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Chiller Electricity Energy", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Chiller Evaporator Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Chiller Evaporator Cooling Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Chiller Condenser Heat Transfer Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Chiller COP", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Chiller COP", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Chiller Part Load Ratio", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Chiller Part Load Ratio", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "ChillerReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Chiller Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Chiller Electricity Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Chiller Electricity Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Chiller Evaporator Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Chiller Evaporator Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Chiller Condenser Heat Transfer Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Chiller COP", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Chiller COP", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Chiller Part Load Ratio", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Chiller Part Load Ratio", "", iAggType::Maximum); } if (namedMonthly(36).show) { - curReport = AddMonthlyReport("TowerReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Fan Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Fan Electricity Energy", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Fan Electricity Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Heat Transfer Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Inlet Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Outlet Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Tower Mass Flow Rate", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "TowerReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Fan Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Fan Electricity Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Fan Electricity Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Heat Transfer Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Inlet Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Outlet Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Mass Flow Rate", "", iAggType::SumOrAvg); } if (namedMonthly(37).show) { - curReport = AddMonthlyReport("BoilerReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Boiler Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Gas Consumption", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Heating Energy", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Boiler Heating Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Boiler Gas Consumption Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Boiler Inlet Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Outlet Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Mass Flow Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Ancillary Electricity Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Part Load Ratio", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Boiler Part Load Ratio", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "BoilerReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Boiler Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Boiler Gas Consumption", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Boiler Heating Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Boiler Heating Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Boiler Gas Consumption Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Boiler Inlet Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Boiler Outlet Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Boiler Mass Flow Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Boiler Ancillary Electricity Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Boiler Part Load Ratio", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Boiler Part Load Ratio", "", iAggType::Maximum); } if (namedMonthly(38).show) { - curReport = AddMonthlyReport("DXReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Energy", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Latent Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Crankcase Heater Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Runtime Fraction", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Runtime Fraction", "", iAggType::Minimum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Latent Cooling Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Electricity Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Crankcase Heater Electricity Rate", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "DXReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Total Cooling Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Sensible Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Latent Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Crankcase Heater Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Runtime Fraction", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Runtime Fraction", "", iAggType::Minimum); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Total Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Sensible Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Latent Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Electricity Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Crankcase Heater Electricity Rate", "", iAggType::Maximum); } if (namedMonthly(39).show) { - curReport = AddMonthlyReport("WindowReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Solar Radiation Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Diffuse Solar Radiation Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Heat Gain Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Heat Loss Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Inside Face Glazing Condensation Status", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Surface Shading Device Is On Time Fraction", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Surface Storm Window On Off Status", "", iAggType::HoursNonZero); + curReport = AddMonthlyReport(state, "WindowReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Diffuse Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Surface Window Heat Gain Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Surface Window Heat Loss Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Surface Window Inside Face Glazing Condensation Status", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Surface Shading Device Is On Time Fraction", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Surface Storm Window On Off Status", "", iAggType::HoursNonZero); } if (namedMonthly(40).show) { - curReport = AddMonthlyReport("WindowEnergyReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Solar Radiation Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Transmitted Diffuse Solar Radiation Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Heat Gain Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Surface Window Heat Loss Energy", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "WindowEnergyReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Diffuse Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Surface Window Heat Gain Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Surface Window Heat Loss Energy", "", iAggType::SumOrAvg); } if (namedMonthly(41).show) { - curReport = AddMonthlyReport("WindowZoneSummaryMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Gain Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Loss Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Transmitted Solar Radiation Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Diffuse Solar Radiation Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "WindowZoneSummaryMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Gain Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Loss Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Transmitted Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Exterior Windows Total Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Exterior Windows Total Transmitted Diffuse Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); } if (namedMonthly(42).show) { - curReport = AddMonthlyReport("WindowEnergyZoneSummaryMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Gain Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Heat Loss Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Windows Total Transmitted Solar Radiation Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Exterior Windows Total Transmitted Diffuse Solar Radiation Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "WindowEnergyZoneSummaryMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Gain Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Loss Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Transmitted Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Exterior Windows Total Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Exterior Windows Total Transmitted Diffuse Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); } if (namedMonthly(43).show) { - curReport = AddMonthlyReport("AverageOutdoorConditionsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Rain Status", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "AverageOutdoorConditionsMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Wind Speed", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Sky Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Rain Status", "", iAggType::SumOrAvg); } if (namedMonthly(44).show) { - curReport = AddMonthlyReport("OutdoorConditionsMaximumDryBulbMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + curReport = AddMonthlyReport(state, "OutdoorConditionsMaximumDryBulbMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(45).show) { - curReport = AddMonthlyReport("OutdoorConditionsMinimumDryBulbMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::Minimum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + curReport = AddMonthlyReport(state, "OutdoorConditionsMinimumDryBulbMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::Minimum); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(46).show) { - curReport = AddMonthlyReport("OutdoorConditionsMaximumWetBulbMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + curReport = AddMonthlyReport(state, "OutdoorConditionsMaximumWetBulbMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(47).show) { - curReport = AddMonthlyReport("OutdoorConditionsMaximumDewPointMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + curReport = AddMonthlyReport(state, "OutdoorConditionsMaximumDewPointMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Wind Speed", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Sky Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(48).show) { - curReport = AddMonthlyReport("OutdoorGroundConditionsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Ground Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Surface Ground Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Deep Ground Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Mains Water Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Ground Reflected Solar Radiation Rate per Area", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Snow on Ground Status", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "OutdoorGroundConditionsMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Site Ground Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Surface Ground Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Deep Ground Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Mains Water Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Ground Reflected Solar Radiation Rate per Area", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Snow on Ground Status", "", iAggType::SumOrAvg); } if (namedMonthly(49).show) { - curReport = AddMonthlyReport("WindowACReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Total Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Total Cooling Energy", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Sensible Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Latent Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Total Cooling Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Sensible Cooling Rate", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Latent Cooling Rate", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Zone Window Air Conditioner Electricity Rate", "", iAggType::ValueWhenMaxMin); + curReport = AddMonthlyReport(state, "WindowACReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Total Cooling Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Sensible Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Latent Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Total Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Sensible Cooling Rate", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Latent Cooling Rate", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Electricity Rate", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(50).show) { - curReport = AddMonthlyReport("WaterHeaterReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Water Heater Total Demand Heat Transfer Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Use Side Heat Transfer Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Burner Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Gas Consumption", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Total Demand Heat Transfer Energy", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Water Heater Loss Demand Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Heat Loss Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Tank Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Heat Recovery Supply Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Water Heater Source Energy", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "WaterHeaterReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Water Heater Total Demand Heat Transfer Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Water Heater Use Side Heat Transfer Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Water Heater Burner Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Water Heater Gas Consumption", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Water Heater Total Demand Heat Transfer Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Water Heater Loss Demand Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Water Heater Heat Loss Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Water Heater Tank Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Water Heater Heat Recovery Supply Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Water Heater Source Energy", "", iAggType::SumOrAvg); } if (namedMonthly(51).show) { - curReport = AddMonthlyReport("GeneratorReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Generator Produced AC Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Diesel Consumption", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Gas Consumption", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Produced AC Electricity Energy", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Generator Total Heat Recovery", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Jacket Heat Recovery Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Lube Heat Recovery", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Exhaust Heat Recovery Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Generator Exhaust Air Temperature", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "GeneratorReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Generator Produced AC Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Generator Diesel Consumption", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Generator Gas Consumption", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Generator Produced AC Electricity Energy", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Generator Total Heat Recovery", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Generator Jacket Heat Recovery Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Generator Lube Heat Recovery", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Generator Exhaust Heat Recovery Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Generator Exhaust Air Temperature", "", iAggType::SumOrAvg); } if (namedMonthly(52).show) { - curReport = AddMonthlyReport("DaylightingReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Site Exterior Beam Normal Illuminance", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Daylighting Lighting Power Multiplier", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Lighting Power Multiplier", "", iAggType::MinimumDuringHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Illuminance", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Glare Index", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Glare Index Setpoint Exceeded Time", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 1 Daylight Illuminance Setpoint Exceeded Time", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Illuminance", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Glare Index", "", iAggType::SumOrAverageHoursShown); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Glare Index Setpoint Exceeded Time", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Daylighting Reference Point 2 Daylight Illuminance Setpoint Exceeded Time", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "DaylightingReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Site Exterior Beam Normal Illuminance", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Daylighting Lighting Power Multiplier", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Daylighting Lighting Power Multiplier", "", iAggType::MinimumDuringHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 1 Illuminance", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 1 Glare Index", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 1 Glare Index Setpoint Exceeded Time", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 1 Daylight Illuminance Setpoint Exceeded Time", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 2 Illuminance", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 2 Glare Index", "", iAggType::SumOrAverageHoursShown); + AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 2 Glare Index Setpoint Exceeded Time", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 2 Daylight Illuminance Setpoint Exceeded Time", "", iAggType::SumOrAvg); } if (namedMonthly(53).show) { - curReport = AddMonthlyReport("CoilReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Heating Coil Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Heating Coil Heating Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Total Cooling Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Sensible Cooling Rate", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Cooling Coil Wetted Area Fraction", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "CoilReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Heating Coil Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Heating Coil Heating Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Sensible Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Total Cooling Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Sensible Cooling Rate", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Wetted Area Fraction", "", iAggType::SumOrAvg); } if (namedMonthly(54).show) { - curReport = AddMonthlyReport("PlantLoopDemandReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "PlantLoopDemandReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::Maximum); } if (namedMonthly(55).show) { - curReport = AddMonthlyReport("FanReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Fan Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Fan Rise in Air Temperature", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Fan Electricity Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Fan Rise in Air Temperature", "", iAggType::ValueWhenMaxMin); + curReport = AddMonthlyReport(state, "FanReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Fan Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Fan Rise in Air Temperature", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Fan Electricity Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Fan Rise in Air Temperature", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(56).show) { - curReport = AddMonthlyReport("PumpReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Pump Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Pump Fluid Heat Gain Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Pump Electricity Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Pump Shaft Power", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Pump Fluid Heat Gain Rate", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Pump Outlet Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Pump Mass Flow Rate", "", iAggType::ValueWhenMaxMin); + curReport = AddMonthlyReport(state, "PumpReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Pump Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Pump Fluid Heat Gain Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Pump Electricity Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Pump Shaft Power", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Pump Fluid Heat Gain Rate", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Pump Outlet Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Pump Mass Flow Rate", "", iAggType::ValueWhenMaxMin); } if (namedMonthly(57).show) { - curReport = AddMonthlyReport("CondLoopDemandReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::Maximum); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Inlet Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Outlet Temperature", "", iAggType::ValueWhenMaxMin); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::Maximum); + curReport = AddMonthlyReport(state, "CondLoopDemandReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::Maximum); + AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Inlet Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Outlet Temperature", "", iAggType::ValueWhenMaxMin); + AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::Maximum); } if (namedMonthly(58).show) { - curReport = AddMonthlyReport("ZoneTemperatureOscillationReportMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Oscillating Temperatures Time", "", iAggType::HoursNonZero); - AddMonthlyFieldSetInput(curReport, "Zone People Occupant Count", "", iAggType::SumOrAverageHoursShown); + curReport = AddMonthlyReport(state, "ZoneTemperatureOscillationReportMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone Oscillating Temperatures Time", "", iAggType::HoursNonZero); + AddMonthlyFieldSetInput(state, curReport, "Zone People Occupant Count", "", iAggType::SumOrAverageHoursShown); } if (namedMonthly(59).show) { - curReport = AddMonthlyReport("AirLoopSystemEnergyAndWaterUseMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Air System Hot Water Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Steam Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Chilled Water Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Natural Gas Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Water Volume", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "AirLoopSystemEnergyAndWaterUseMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Air System Hot Water Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Steam Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Chilled Water Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Natural Gas Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Water Volume", "", iAggType::SumOrAvg); } if (namedMonthly(60).show) { - curReport = AddMonthlyReport("AirLoopSystemComponentLoadsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Air System Fan Air Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Total Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heat Exchanger Total Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heat Exchanger Total Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Humidifier Total Heating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Evaporative Cooler Total Cooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Desiccant Dehumidifier Total Cooling Energy", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "AirLoopSystemComponentLoadsMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Air System Fan Air Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Heating Coil Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Heat Exchanger Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Heat Exchanger Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Humidifier Total Heating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Evaporative Cooler Total Cooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Desiccant Dehumidifier Total Cooling Energy", "", iAggType::SumOrAvg); } if (namedMonthly(61).show) { - curReport = AddMonthlyReport("AirLoopSystemComponentEnergyUseMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Air System Fan Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Hot Water Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Cooling Coil Chilled Water Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System DX Heating Coil Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System DX Cooling Coil Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Natural Gas Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Heating Coil Steam Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Humidifier Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Humidifier Natural Gas Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Evaporative Cooler Electricity Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Desiccant Dehumidifier Electricity Energy", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "AirLoopSystemComponentEnergyUseMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Air System Fan Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Heating Coil Hot Water Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Cooling Coil Chilled Water Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System DX Heating Coil Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System DX Cooling Coil Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Heating Coil Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Heating Coil Natural Gas Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Heating Coil Steam Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Humidifier Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Humidifier Natural Gas Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Evaporative Cooler Electricity Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Desiccant Dehumidifier Electricity Energy", "", iAggType::SumOrAvg); } if (namedMonthly(62).show) { - curReport = AddMonthlyReport("MechanicalVentilationLoadsMonthly", 2); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation No Load Heat Removal Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Cooling Load Increase Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Cooling Load Increase Due to Overheating Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Cooling Load Decrease Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation No Load Heat Addition Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Heating Load Increase Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Heating Load Increase Due to Overcooling Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Heating Load Decrease Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Zone Mechanical Ventilation Air Changes per Hour", "", iAggType::SumOrAvg); + curReport = AddMonthlyReport(state, "MechanicalVentilationLoadsMonthly", 2); + AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation No Load Heat Removal Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Cooling Load Increase Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Cooling Load Increase Due to Overheating Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Cooling Load Decrease Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation No Load Heat Addition Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Heating Load Increase Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Heating Load Increase Due to Overcooling Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Heating Load Decrease Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Air Changes per Hour", "", iAggType::SumOrAvg); } if (namedMonthly(63).show) { - curReport = AddMonthlyReport("HeatEmissionsReportMonthly", 2); + curReport = AddMonthlyReport(state, "HeatEmissionsReportMonthly", 2); // Place holder - AddMonthlyFieldSetInput(curReport, "Site Total Surface Heat Emission to Air", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Total Zone Exfiltration Heat Loss", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Site Total Zone Exhaust Air Heat Loss", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "Air System Relief Air Total Heat Loss Energy", "", iAggType::SumOrAvg); - AddMonthlyFieldSetInput(curReport, "HVAC System Total Heat Rejection Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Total Surface Heat Emission to Air", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Total Zone Exfiltration Heat Loss", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Site Total Zone Exhaust Air Heat Loss", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "Air System Relief Air Total Heat Loss Energy", "", iAggType::SumOrAvg); + AddMonthlyFieldSetInput(state, curReport, "HVAC System Total Heat Rejection Energy", "", iAggType::SumOrAvg); } } @@ -3733,7 +3710,7 @@ namespace EnergyPlus::OutputReportTabular { } } if (state.dataGlobal->DoWeathSim) { - for (iInput = 1; iInput <= MonthlyInputCount; ++iInput) { + for (iInput = 1; iInput <= state.dataOutRptTab->MonthlyInputCount; ++iInput) { if (MonthlyInput(iInput).numTables > 0) { tbl_stream << "

" << MonthlyInput(iInput).name << "

|\n"; for (jTable = 1; jTable <= MonthlyInput(iInput).numTables; ++jTable) { @@ -3743,7 +3720,7 @@ namespace EnergyPlus::OutputReportTabular { } } } - for (iInput = 1; iInput <= OutputTableBinnedCount; ++iInput) { + for (iInput = 1; iInput <= state.dataOutRptTab->OutputTableBinnedCount; ++iInput) { if (OutputTableBinned(iInput).numTables > 0) { if (OutputTableBinned(iInput).scheduleIndex == 0) { tbl_stream << "

" << OutputTableBinned(iInput).varOrMeter << "

|\n"; @@ -3853,7 +3830,7 @@ namespace EnergyPlus::OutputReportTabular { if (!state.dataGlobal->DoWeathSim) return; elapsedTime = TimeStepSys; timeInYear += elapsedTime; - for (iInObj = 1; iInObj <= OutputTableBinnedCount; ++iInObj) { + for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { // get values of array for current object being referenced curIntervalStart = OutputTableBinned(iInObj).intervalStart; curIntervalSize = OutputTableBinned(iInObj).intervalSize; @@ -4030,8 +4007,8 @@ namespace EnergyPlus::OutputReportTabular { } else { elapsedTime = state.dataGlobal->TimeStepZone; } - IsMonthGathered(state.dataEnvrn->Month) = true; - for (iTable = 1; iTable <= MonthlyTablesCount; ++iTable) { + state.dataOutRptTab->IsMonthGathered(state.dataEnvrn->Month) = true; + for (iTable = 1; iTable <= state.dataOutRptTab->MonthlyTablesCount; ++iTable) { activeMinMax = false; // at the beginning of the new timestep activeHoursShown = false; // fix by JG addressing CR6482 curFirstColumn = MonthlyTables(iTable).firstColumn; @@ -5585,12 +5562,12 @@ namespace EnergyPlus::OutputReportTabular { constexpr static auto variable_fmt{" {}={:12}\n"}; state.files.audit.ensure_open(state, "WriteTabularReports", state.files.outputControl.audit); - print(state.files.audit, variable_fmt, "MonthlyInputCount", MonthlyInputCount); - print(state.files.audit, variable_fmt, "sizeMonthlyInput", sizeMonthlyInput); - print(state.files.audit, variable_fmt, "MonthlyFieldSetInputCount", MonthlyFieldSetInputCount); - print(state.files.audit, variable_fmt, "sizeMonthlyFieldSetInput", sizeMonthlyFieldSetInput); - print(state.files.audit, variable_fmt, "MonthlyTablesCount", MonthlyTablesCount); - print(state.files.audit, variable_fmt, "MonthlyColumnsCount", MonthlyColumnsCount); + print(state.files.audit, variable_fmt, "MonthlyInputCount", state.dataOutRptTab->MonthlyInputCount); + print(state.files.audit, variable_fmt, "sizeMonthlyInput", state.dataOutRptTab->sizeMonthlyInput); + print(state.files.audit, variable_fmt, "MonthlyFieldSetInputCount", state.dataOutRptTab->MonthlyFieldSetInputCount); + print(state.files.audit, variable_fmt, "sizeMonthlyFieldSetInput", state.dataOutRptTab->sizeMonthlyFieldSetInput); + print(state.files.audit, variable_fmt, "MonthlyTablesCount", state.dataOutRptTab->MonthlyTablesCount); + print(state.files.audit, variable_fmt, "MonthlyColumnsCount", state.dataOutRptTab->MonthlyColumnsCount); print(state.files.audit, variable_fmt, "sizeReportName", state.dataOutRptPredefined->sizeReportName); print(state.files.audit, variable_fmt, "numReportName", state.dataOutRptPredefined->numReportName); print(state.files.audit, variable_fmt, "sizeSubTable", state.dataOutRptPredefined->sizeSubTable); @@ -6767,7 +6744,7 @@ namespace EnergyPlus::OutputReportTabular { } // loop through each input to get the name of the tables - for (iInput = 1; iInput <= MonthlyInputCount; ++iInput) { + for (iInput = 1; iInput <= state.dataOutRptTab->MonthlyInputCount; ++iInput) { // loop through each report and digitsShown = MonthlyInput(iInput).showDigits; for (jTable = 1; jTable <= MonthlyInput(iInput).numTables; ++jTable) { @@ -6846,7 +6823,7 @@ namespace EnergyPlus::OutputReportTabular { curVal = (MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + curConversionOffset; sumVal += curVal; } - if (IsMonthGathered(lMonth)) { + if (state.dataOutRptTab->IsMonthGathered(lMonth)) { tableBody(columnRecount, lMonth) = RealToStr(curVal, digitsShown); if (curVal > maxVal) maxVal = curVal; if (curVal < minVal) minVal = curVal; @@ -6883,7 +6860,7 @@ namespace EnergyPlus::OutputReportTabular { maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { curVal = MonthlyColumns(curCol).reslt(lMonth); - if (IsMonthGathered(lMonth)) { + if (state.dataOutRptTab->IsMonthGathered(lMonth)) { tableBody(columnRecount, lMonth) = RealToStr(curVal, digitsShown); sumVal += curVal; if (curVal > maxVal) maxVal = curVal; @@ -6938,7 +6915,7 @@ namespace EnergyPlus::OutputReportTabular { maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { curVal = MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor + curConversionOffset; - if (IsMonthGathered(lMonth)) { + if (state.dataOutRptTab->IsMonthGathered(lMonth)) { tableBody(columnRecount, lMonth) = RealToStr(curVal, digitsShown); if (curVal > maxVal) maxVal = curVal; if (curVal < minVal) minVal = curVal; @@ -6993,7 +6970,7 @@ namespace EnergyPlus::OutputReportTabular { minVal = storedMaxVal; maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { - if (IsMonthGathered(lMonth)) { + if (state.dataOutRptTab->IsMonthGathered(lMonth)) { curVal = MonthlyColumns(curCol).reslt(lMonth); // CR7788 the conversion factors were causing an overflow for the InchPound case since the // value was very small @@ -7141,7 +7118,7 @@ namespace EnergyPlus::OutputReportTabular { rowHead(37) = "10:01 to 11:00 pm"; rowHead(38) = "11:01 to 12:00 am"; rowHead(39) = "Total"; - for (iInObj = 1; iInObj <= OutputTableBinnedCount; ++iInObj) { + for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { firstReport = OutputTableBinned(iInObj).resIndex; curNameWithSIUnits = OutputTableBinned(iInObj).varOrMeter + unitEnumToStringBrackets(OutputTableBinned(iInObj).units); if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { @@ -15135,7 +15112,7 @@ namespace EnergyPlus::OutputReportTabular { // Reset all gathering arrays to zero for multi-year simulations // so that only last year is reported in tabular reports gatherElapsedTimeBEPS = 0.0; - ResetMonthlyGathering(); + ResetMonthlyGathering(state); OutputReportTabularAnnual::ResetAnnualGathering(); ResetBinGathering(); ResetBEPSGathering(); @@ -15149,7 +15126,7 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutputProcessor->isFinalYear = true; } - void ResetMonthlyGathering() + void ResetMonthlyGathering(EnergyPlusData &state) { // Jason Glazer - October 2015 // Reset all monthly gathering arrays to zero for multi-year simulations @@ -15161,7 +15138,7 @@ namespace EnergyPlus::OutputReportTabular { int curCol; static Real64 BigNum(0.0); - for (iInput = 1; iInput <= MonthlyInputCount; ++iInput) { + for (iInput = 1; iInput <= state.dataOutRptTab->MonthlyInputCount; ++iInput) { for (jTable = 1; jTable <= MonthlyInput(iInput).numTables; ++jTable) { curTable = jTable + MonthlyInput(iInput).firstTable - 1; for (kColumn = 1; kColumn <= MonthlyTables(curTable).numColumns; ++kColumn) { diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 92403eb630e..8687ec95604 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -176,23 +176,9 @@ namespace OutputReportTabular { // The Binned table type is different and only references one variable and its structure is very // different from the others so it is has its own type. - // arrays for time binned results - - extern int OutputTableBinnedCount; - extern int BinResultsTableCount; - extern int BinResultsIntervalCount; - constexpr int numNamedMonthly(63); // These reports are detailed/named in routine InitializePredefinedMonthlyTitles - extern int MonthlyInputCount; - extern int sizeMonthlyInput; - extern int MonthlyFieldSetInputCount; - extern int sizeMonthlyFieldSetInput; - extern int MonthlyTablesCount; - extern int MonthlyColumnsCount; - extern Array1D_bool IsMonthGathered; // shown as true for any month used - extern int TOCEntriesCount; extern int TOCEntriesSize; @@ -737,9 +723,9 @@ namespace OutputReportTabular { void GetInputTabularMonthly(EnergyPlusData &state); - int AddMonthlyReport(std::string const &inReportName, int const inNumDigitsShown); + int AddMonthlyReport(EnergyPlusData &state, std::string const &inReportName, int const inNumDigitsShown); - void AddMonthlyFieldSetInput(int const inMonthReport, std::string const &inVariMeter, std::string const &inColHead, iAggType const inAggregate); + void AddMonthlyFieldSetInput(EnergyPlusData &state, int const inMonthReport, std::string const &inVariMeter, std::string const &inColHead, iAggType const inAggregate); void InitializeTabularMonthly(EnergyPlusData &state); @@ -761,7 +747,7 @@ namespace OutputReportTabular { void InitializePredefinedMonthlyTitles(EnergyPlusData &state); - void CreatePredefinedMonthlyReports(); + void CreatePredefinedMonthlyReports(EnergyPlusData &state); void GetInputFuelAndPollutionFactors(EnergyPlusData &state); @@ -985,7 +971,7 @@ namespace OutputReportTabular { void ResetTabularReports(EnergyPlusData &state); - void ResetMonthlyGathering(); + void ResetMonthlyGathering(EnergyPlusData &state); void ResetBinGathering(); @@ -1068,10 +1054,30 @@ namespace OutputReportTabular { struct OutputReportTabularData : BaseGlobalStruct { OutputReportTabular::iUnitsStyle unitsStyle = OutputReportTabular::iUnitsStyle::None; + int OutputTableBinnedCount = 0; + int BinResultsTableCount = 0; + int BinResultsIntervalCount = 0; + int MonthlyInputCount = 0; + int sizeMonthlyInput = 0; + int MonthlyFieldSetInputCount = 0; + int sizeMonthlyFieldSetInput = 0; + int MonthlyTablesCount = 0; + int MonthlyColumnsCount = 0; + Array1D_bool IsMonthGathered = Array1D_bool(12, false); // shown as true for any month used void clear_state() override { this->unitsStyle = OutputReportTabular::iUnitsStyle::None; + this->OutputTableBinnedCount = 0; + this->BinResultsTableCount = 0; + this->BinResultsIntervalCount = 0; + this->MonthlyInputCount = 0; + this->sizeMonthlyInput = 0; + this->MonthlyFieldSetInputCount = 0; + this->sizeMonthlyFieldSetInput = 0; + this->MonthlyTablesCount = 0; + this->MonthlyColumnsCount = 0; + this->IsMonthGathered = Array1D_bool(12, false); } }; diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index f31fa658899..466f95c73ba 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -1839,7 +1839,6 @@ namespace SimulationManager { // Using/Aliasing using namespace DataOutputs; using OutputReportTabular::maxUniqueKeyCount; - using OutputReportTabular::MonthlyFieldSetInputCount; using namespace DataRuntimeLanguage; using DataHeatBalance::CondFDRelaxFactor; using DataHeatBalance::CondFDRelaxFactorInput; @@ -1896,7 +1895,7 @@ namespace SimulationManager { } else { print(state.files.audit, "{}\n", "ClippingAlgorithm=ConvexWeilerAtherton"); } - print(state.files.audit, variable_fmt, "MonthlyFieldSetInputCount", MonthlyFieldSetInputCount); + print(state.files.audit, variable_fmt, "MonthlyFieldSetInputCount", state.dataOutRptTab->MonthlyFieldSetInputCount); print(state.files.audit, variable_fmt, "NumConsideredOutputVariables", NumConsideredOutputVariables); print(state.files.audit, variable_fmt, "MaxConsideredOutputVariables", MaxConsideredOutputVariables); diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index bf8c9bf8546..ab58e2daf3d 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -3285,7 +3285,7 @@ namespace OutputProcessor { state->dataGlobal->TimeStepZone = 0.25; OutputReportTabular::GetInputTabularMonthly(*state); - EXPECT_EQ(OutputReportTabular::MonthlyInputCount, 1); + EXPECT_EQ(state->dataOutRptTab->MonthlyInputCount, 1); OutputReportTabular::InitializeTabularMonthly(*state); GetReportVariableInput(*state); @@ -3342,7 +3342,7 @@ namespace OutputProcessor { state->dataGlobal->TimeStepZone = 0.25; OutputReportTabular::GetInputTabularMonthly(*state); - EXPECT_EQ(OutputReportTabular::MonthlyInputCount, 1); + EXPECT_EQ(state->dataOutRptTab->MonthlyInputCount, 1); OutputReportTabular::InitializeTabularMonthly(*state); GetReportVariableInput(*state); diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 82462cb9827..27826d3369e 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -3501,7 +3501,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularMonthly_ResetMonthlyGathering) state->dataGlobal->TimeStepZoneSec = state->dataGlobal->TimeStepZone * 60.0; GetInputTabularMonthly(*state); - EXPECT_EQ(MonthlyInputCount, 1); + EXPECT_EQ(state->dataOutRptTab->MonthlyInputCount, 1); InitializeTabularMonthly(*state); extLitUse = 1.01; @@ -3517,7 +3517,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularMonthly_ResetMonthlyGathering) GatherMonthlyResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(extLitUse * 3, MonthlyColumns(1).reslt(12)); - ResetMonthlyGathering(); + ResetMonthlyGathering(*state); EXPECT_EQ(0., MonthlyColumns(1).reslt(12)); @@ -6437,7 +6437,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularMonthly_invalidAggregationOrder) state->dataGlobal->TimeStepZoneSec = state->dataGlobal->TimeStepZone * 60.0; GetInputTabularMonthly(*state); - EXPECT_EQ(MonthlyInputCount, 1); + EXPECT_EQ(state->dataOutRptTab->MonthlyInputCount, 1); InitializeTabularMonthly(*state); EXPECT_TRUE(isInvalidAggregationOrder(*state)); @@ -7230,7 +7230,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularMonthlyPredefined_FindNeededOutputV // Variables aren't going to be output to SQL/ESO anyways EXPECT_EQ(state->dataOutputProcessor->NumOfReqVariables, 0); - EXPECT_EQ(OutputReportTabular::MonthlyInputCount, 1); + EXPECT_EQ(state->dataOutRptTab->MonthlyInputCount, 1); // If everything worked, we should have 2 tables, one for each zone. // Previously, KeyCount was 0 because it couldn't find the variable in the OutputVariablesForSimulation // and so the numTables was zero From 345b104a5588b1fc66582d7142bb69b983e2428c Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 18 Dec 2020 16:36:19 -0700 Subject: [PATCH 06/14] moving OutputReportTabular to state --- src/EnergyPlus/EconomicLifeCycleCost.cc | 32 +- src/EnergyPlus/EconomicTariff.cc | 30 +- src/EnergyPlus/InternalHeatGains.cc | 6 +- src/EnergyPlus/OutputReportTabular.cc | 593 +++++++++--------- src/EnergyPlus/OutputReportTabular.hh | 66 +- src/EnergyPlus/OutputReportTabularAnnual.cc | 10 +- src/EnergyPlus/SimulationManager.cc | 2 +- .../unit/OutputReportTabular.unit.cc | 52 +- tst/EnergyPlus/unit/WeatherManager.unit.cc | 2 +- 9 files changed, 385 insertions(+), 408 deletions(-) diff --git a/src/EnergyPlus/EconomicLifeCycleCost.cc b/src/EnergyPlus/EconomicLifeCycleCost.cc index 702abe5ccf5..f61d17861c8 100644 --- a/src/EnergyPlus/EconomicLifeCycleCost.cc +++ b/src/EnergyPlus/EconomicLifeCycleCost.cc @@ -2130,7 +2130,7 @@ namespace EconomicLifeCycleCost { //--------------------------------- // Life-Cycle Cost Verification and Results Report //--------------------------------- - WriteReportHeaders("Life-Cycle Cost Report", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, "Life-Cycle Cost Report", "Entire Facility", OutputProcessor::StoreType::Averaged); //---- Life-Cycle Cost Parameters rowHead.allocate(11); columnHead.allocate(1); @@ -2209,7 +2209,7 @@ namespace EconomicLifeCycleCost { } } columnWidth = 14; // array assignment - same for all columns - WriteSubtitle("Life-Cycle Cost Parameters"); + WriteSubtitle(state, "Life-Cycle Cost Parameters"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -2248,7 +2248,7 @@ namespace EconomicLifeCycleCost { tableBody(jObj, iYear + 2) = RealToStr(UsePriceEscalation(jObj).Escalation(iYear), 6); } } - WriteSubtitle("Use Price Escalation"); + WriteSubtitle(state, "Use Price Escalation"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -2285,7 +2285,7 @@ namespace EconomicLifeCycleCost { tableBody(jObj, iYear + 1) = RealToStr(UseAdjustment(jObj).Adjustment(iYear), 6); } } - WriteSubtitle("Use Adjustment"); + WriteSubtitle(state, "Use Adjustment"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -2326,7 +2326,7 @@ namespace EconomicLifeCycleCost { tableBody(jObj, iYear + 1) = RealToStr(CashFlow(curCashFlow).yrAmount(iYear), 2); } } - WriteSubtitle("Cash Flow for Recurring and Nonrecurring Costs (Without Escalation)"); + WriteSubtitle(state, "Cash Flow for Recurring and Nonrecurring Costs (Without Escalation)"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -2370,7 +2370,7 @@ namespace EconomicLifeCycleCost { for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { tableBody(jObj, iYear) = RealToStr(CashFlow(costCatTotEnergy).yrAmount(iYear) + CashFlow(costCatWater).yrAmount(iYear), 2); } - WriteSubtitle("Energy and Water Cost Cash Flows (Without Escalation)"); + WriteSubtitle(state, "Energy and Water Cost Cash Flows (Without Escalation)"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -2420,7 +2420,7 @@ namespace EconomicLifeCycleCost { for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { tableBody(jObj, iYear) = RealToStr(EscalatedTotEnergy(iYear) + CashFlow(costCatWater).yrAmount(iYear), 2); } - WriteSubtitle("Energy and Water Cost Cash Flows (With Escalation)"); + WriteSubtitle(state, "Energy and Water Cost Cash Flows (With Escalation)"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -2461,7 +2461,7 @@ namespace EconomicLifeCycleCost { tableBody(3, iYear) = RealToStr(CashFlow(costCatOtherCapital).yrAmount(iYear), 2); tableBody(4, iYear) = RealToStr(CashFlow(costCatTotCaptl).yrAmount(iYear), 2); } - WriteSubtitle("Capital Cash Flow by Category (Without Escalation)"); + WriteSubtitle(state, "Capital Cash Flow by Category (Without Escalation)"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -2514,7 +2514,7 @@ namespace EconomicLifeCycleCost { tableBody(9, iYear) = RealToStr(CashFlow(costCatOtherOperational).yrAmount(iYear), 2); tableBody(10, iYear) = RealToStr(CashFlow(costCatTotOper).yrAmount(iYear), 2); } - WriteSubtitle("Operating Cash Flow by Category (Without Escalation)"); + WriteSubtitle(state, "Operating Cash Flow by Category (Without Escalation)"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -2569,7 +2569,7 @@ namespace EconomicLifeCycleCost { CashFlow(costCatTotOper).yrAmount(iYear) + EscalatedTotEnergy(iYear) - CashFlow(costCatTotEnergy).yrAmount(iYear); tableBody(10, iYear) = RealToStr(yearly_total_cost, 2); } - WriteSubtitle("Operating Cash Flow by Category (With Escalation)"); + WriteSubtitle(state, "Operating Cash Flow by Category (With Escalation)"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -2626,7 +2626,7 @@ namespace EconomicLifeCycleCost { tableBody(jObj, kMonth) = RealToStr(CashFlow(jObj).mnAmount(kMonth), 2); } } - WriteSubtitle("DEBUG ONLY - Monthly Cash Flows"); + WriteSubtitle(state, "DEBUG ONLY - Monthly Cash Flows"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -2659,7 +2659,7 @@ namespace EconomicLifeCycleCost { tableBody(kMonth, iYear) = RealToStr(CashFlow(costCatTotGrand).mnAmount((iYear - 1) * 12 + kMonth), 2); } } - WriteSubtitle("Monthly Total Cash Flow (Without Escalation)"); + WriteSubtitle(state, "Monthly Total Cash Flow (Without Escalation)"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -2747,7 +2747,7 @@ namespace EconomicLifeCycleCost { } } tableBody(4, numRows + 1) = RealToStr(totalPV, 2); - WriteSubtitle("Present Value for Recurring, Nonrecurring and Energy Costs (Before Tax)"); + WriteSubtitle(state, "Present Value for Recurring, Nonrecurring and Energy Costs (Before Tax)"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -2812,7 +2812,7 @@ namespace EconomicLifeCycleCost { tableBody(1, 15) = RealToStr(CashFlow(costCatTotCaptl).presentValue, 2); tableBody(1, 16) = RealToStr(CashFlow(costCatTotGrand).presentValue, 2); - WriteSubtitle("Present Value by Category"); + WriteSubtitle(state, "Present Value by Category"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -2852,7 +2852,7 @@ namespace EconomicLifeCycleCost { rowHead(lengthStudyYears + 1) = "TOTAL"; tableBody(3, lengthStudyYears + 1) = RealToStr(totalPV, 2); - WriteSubtitle("Present Value by Year"); + WriteSubtitle(state, "Present Value by Year"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -2894,7 +2894,7 @@ namespace EconomicLifeCycleCost { rowHead(lengthStudyYears + 1) = "TOTAL"; tableBody(5, lengthStudyYears + 1) = RealToStr(totalPV, 2); - WriteSubtitle("After Tax Estimate"); + WriteSubtitle(state, "After Tax Estimate"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index 6c645344b16..b241f8a10e9 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -101,7 +101,7 @@ namespace EnergyPlus::EconomicTariff { // do rest of GetInput only if at least one tariff is defined. GetInputEconomicsCurrencyType(state, ErrorsFound); if (state.dataEconTariff->numTariff >= 1) { - if (!ErrorsFound && displayEconomicResultSummary) AddTOCEntry("Economics Results Summary Report", "Entire Facility"); + if (!ErrorsFound && displayEconomicResultSummary) AddTOCEntry(state, "Economics Results Summary Report", "Entire Facility"); CreateCategoryNativeVariables(state); GetInputEconomicsQualify(state, ErrorsFound); GetInputEconomicsChargeSimple(state, ErrorsFound); @@ -601,7 +601,7 @@ namespace EnergyPlus::EconomicTariff { tariff(iInObj).totalAnnualCost = 0.0; // now create the Table Of Contents entries for an HTML file if (displayTariffReport) { - AddTOCEntry("Tariff Report", tariff(iInObj).tariffName); + AddTOCEntry(state, "Tariff Report", tariff(iInObj).tariffName); } // associate the resource number with each tariff if (tariff(iInObj).reportMeterIndx >= 1) { @@ -2667,8 +2667,6 @@ namespace EnergyPlus::EconomicTariff { // The list of steps for the tariff computation are in order // for stack based computation (reverse polish notation) - using OutputReportTabular::WriteTabularFiles; - // values used in specific operations Array1D a(MaxNumMonths); int aPt; @@ -2693,7 +2691,7 @@ namespace EnergyPlus::EconomicTariff { auto &computation(state.dataEconTariff->computation); if (!(state.files.outputControl.tabular || state.files.outputControl.sqlite)) { - WriteTabularFiles = false; + state.dataOutRptTab->WriteTabularFiles = false; return; } @@ -2703,7 +2701,7 @@ namespace EnergyPlus::EconomicTariff { econVar(nVar).isEvaluated = false; } if (state.dataEconTariff->numTariff >= 1) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; setNativeVariables(state); for (iTariff = 1; iTariff <= state.dataEconTariff->numTariff; ++iTariff) { for (jStep = computation(iTariff).firstStep; jStep <= computation(iTariff).lastStep; ++jStep) { @@ -4074,7 +4072,7 @@ namespace EnergyPlus::EconomicTariff { if (state.dataOutRptTab->unitsStyle == OutputReportTabular::iUnitsStyle::InchPound) { SIunit = "[~~$~~/m2]"; LookupSItoIP(state, SIunit, unitConvIndex, perAreaUnitName); - perAreaUnitConv = ConvertIP(unitConvIndex, 1.0); + perAreaUnitConv = ConvertIP(state, unitConvIndex, 1.0); } else { perAreaUnitName = "[~~$~~/m2]"; perAreaUnitConv = 1.0; @@ -4090,7 +4088,7 @@ namespace EnergyPlus::EconomicTariff { //--------------------------------- // Economics Results Summary Report //--------------------------------- - WriteReportHeaders("Economics Results Summary Report", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, "Economics Results Summary Report", "Entire Facility", OutputProcessor::StoreType::Averaged); elecFacilMeter = GetMeterIndex(state, "ELECTRICITY:FACILITY"); gasFacilMeter = GetMeterIndex(state, "NATURALGAS:FACILITY"); //---- Annual Summary @@ -4140,7 +4138,7 @@ namespace EnergyPlus::EconomicTariff { tableBody(4, 3) = RealToStr((allTotalCost / buildingConditionedFloorArea) * perAreaUnitConv, 2); } columnWidth = 14; // array assignment - same for all columns - WriteSubtitle("Annual Cost"); + WriteSubtitle(state, "Annual Cost"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -4197,7 +4195,7 @@ namespace EnergyPlus::EconomicTariff { tableBody(6, iTariff) = RealToStr(tariff(iTariff).totalAnnualCost, 2); } columnWidth = 14; // array assignment - same for all columns - WriteSubtitle("Tariff Summary"); + WriteSubtitle(state, "Tariff Summary"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -4217,7 +4215,7 @@ namespace EnergyPlus::EconomicTariff { //--------------------------------- if (displayTariffReport) { for (iTariff = 1; iTariff <= state.dataEconTariff->numTariff; ++iTariff) { - WriteReportHeaders("Tariff Report", tariff(iTariff).tariffName, OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, "Tariff Report", tariff(iTariff).tariffName, OutputProcessor::StoreType::Averaged); rowHead.allocate(7); columnHead.allocate(1); columnWidth.allocate(1); @@ -4278,7 +4276,7 @@ namespace EnergyPlus::EconomicTariff { } } columnWidth = 14; // array assignment - same for all columns - WriteSubtitle("General"); + WriteSubtitle(state, "General"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -4376,9 +4374,9 @@ namespace EnergyPlus::EconomicTariff { ReportEconomicVariable(state, "Other Variables", false, false, tariff(iTariff).tariffName); //---- Computation if (computation(iTariff).isUserDef) { - WriteTextLine("Computation - User Defined", true); + WriteTextLine(state, "Computation - User Defined", true); } else { - WriteTextLine("Computation - Automatic", true); + WriteTextLine(state, "Computation - Automatic", true); } outString = ""; for (lStep = computation(iTariff).firstStep; lStep <= computation(iTariff).lastStep; ++lStep) { @@ -4386,7 +4384,7 @@ namespace EnergyPlus::EconomicTariff { { auto const SELECT_CASE_var(curStep); if (SELECT_CASE_var == 0) { // end of line - WriteTextLine(rstrip(outString)); + WriteTextLine(state, rstrip(outString)); outString = ""; } else if ((SELECT_CASE_var >= 1)) { // all positive values are a reference to an econVar outString = econVar(curStep).name + ' ' + outString; @@ -4669,7 +4667,7 @@ namespace EnergyPlus::EconomicTariff { } } columnWidth = 14; // array assignment - same for all columns - WriteSubtitle(titleString); + WriteSubtitle(state, titleString); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, rowHead, columnHead, "Tariff Report", forString, titleString); diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 4fe552827bd..ac2bc34c164 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -6143,9 +6143,6 @@ namespace InternalHeatGains { // REFERENCES: // OutputDataStructure.doc (EnergyPlus documentation) - // Using/Aliasing - using OutputReportTabular::WriteTabularFiles; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Loop; int ZoneLoop; // Counter for the # of zones (nz) @@ -6176,7 +6173,8 @@ namespace InternalHeatGains { Lights(Loop).RetAirGainEnergy = Lights(Loop).RetAirGainRate * state.dataGlobal->TimeStepZoneSec; Lights(Loop).TotGainEnergy = Lights(Loop).TotGainRate * state.dataGlobal->TimeStepZoneSec; if (!state.dataGlobal->WarmupFlag) { - if (state.dataGlobal->DoOutputReporting && WriteTabularFiles && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { // for weather simulations only + if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles && + (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { // for weather simulations only // for tabular report, accumulate the total electricity used for each Light object Lights(Loop).SumConsumption += Lights(Loop).Consumption; // for tabular report, accumulate the time when each Light has consumption (using a very small threshold instead of zero) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 8b48776b43d..b14b2098c67 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -177,25 +177,6 @@ namespace EnergyPlus::OutputReportTabular { // arrays for time binned results - int TOCEntriesCount(0); - int TOCEntriesSize(0); - - int UnitConvSize(0); - - bool WriteTabularFiles(false); - bool GetInput(true); - - // From Report:Table:Style - int numStyles(0); - std::ofstream csv_stream; // CSV table stream - std::ofstream tab_stream; // Tab table stream - std::ofstream fix_stream; // Fixed table stream - std::ofstream htm_stream; // HTML table stream - std::ofstream xml_stream; // XML table stream - Array1D TabularOutputFile(maxNumStyles, {&csv_stream, &tab_stream, &fix_stream, &htm_stream, &xml_stream}); // Table stream array - Array1D_string del(maxNumStyles); // the delimiter to use - Array1D TableStyle(maxNumStyles, iTableStyle::Unassigned); // see list of parameters - Real64 timeInYear(0.0); // Flags for predefined tabular reports @@ -429,14 +410,6 @@ namespace EnergyPlus::OutputReportTabular { GatherHeatGainReportfirstTime = true; AllocateLoadComponentArraysDoAllocate = true; initAdjFenDone = false; - TOCEntriesCount = 0; - TOCEntriesSize = 0; - UnitConvSize = 0; - WriteTabularFiles = false; - numStyles = 0; - TabularOutputFile = Array1D(maxNumStyles, {&csv_stream, &tab_stream, &fix_stream, &htm_stream, &xml_stream}); - del = Array1D_string(maxNumStyles); - TableStyle = Array1D(maxNumStyles, iTableStyle::Unassigned); timeInYear = 0.0; displayTabularBEPS = false; displayLEEDSummary = false; @@ -596,7 +569,7 @@ namespace EnergyPlus::OutputReportTabular { std::ofstream & open_tbl_stream(EnergyPlusData &state, int const iStyle, std::string const & filename, bool output_to_file) { - std::ofstream &tbl_stream(*TabularOutputFile(iStyle)); + std::ofstream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); if (output_to_file) { tbl_stream.open(filename); if (!tbl_stream) { @@ -639,12 +612,12 @@ namespace EnergyPlus::OutputReportTabular { ShowFatalError(state, "OutputReportTabular: Invalid aggregations detected, no simulation performed."); } GetInputFuelAndPollutionFactors(state); - SetupUnitConversions(); + SetupUnitConversions(state); AddTOCLoadComponentTableSummaries(state); UpdateTabularReportsGetInput = false; date_and_time(_, _, _, td); } - if (state.dataGlobal->DoOutputReporting && WriteTabularFiles && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { + if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { gatherElapsedTimeBEPS += state.dataGlobal->TimeStepZone; } @@ -722,13 +695,13 @@ namespace EnergyPlus::OutputReportTabular { static bool ErrorsFound(false); if (!(state.files.outputControl.tabular || state.files.outputControl.sqlite)) { - WriteTabularFiles = false; + state.dataOutRptTab->WriteTabularFiles = false; return; } state.dataOutRptTab->MonthlyInputCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); if (state.dataOutRptTab->MonthlyInputCount > 0) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; // if not a run period using weather do not create reports if (!state.dataGlobal->DoWeathSim) { ShowWarningError(state, CurrentModuleObject + " requested with SimulationControl Run Simulation for Weather File Run Periods set to No so " + @@ -1446,7 +1419,7 @@ namespace EnergyPlus::OutputReportTabular { Array1D_int objVarIDs; if (!(state.files.outputControl.tabular || state.files.outputControl.sqlite)) { - WriteTabularFiles = false; + state.dataOutRptTab->WriteTabularFiles = false; return; } @@ -1459,7 +1432,7 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptTab->OutputTableBinnedCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); OutputTableBinned.allocate(state.dataOutRptTab->OutputTableBinnedCount); if (state.dataOutRptTab->OutputTableBinnedCount > 0) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; // if not a run period using weather do not create reports if (!state.dataGlobal->DoWeathSim) { ShowWarningError(state, CurrentModuleObject + " requested with SimulationControl Run Simulation for Weather File Run Periods set to No so " + @@ -1670,9 +1643,9 @@ namespace EnergyPlus::OutputReportTabular { if (NumTabularStyle == 0) { AlphArray(1) = "COMMA"; - numStyles = 1; - TableStyle(1) = iTableStyle::Comma; - del(1) = CharComma; // comma + state.dataOutRptTab->numStyles = 1; + state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; + state.dataOutRptTab->del(1) = CharComma; // comma state.dataOutRptTab->unitsStyle = iUnitsStyle::None; } else if (NumTabularStyle == 1) { inputProcessor->getObjectItem(state, @@ -1689,66 +1662,66 @@ namespace EnergyPlus::OutputReportTabular { cNumericFieldNames); // ColumnSeparator if (UtilityRoutines::SameString(AlphArray(1), "Comma")) { - numStyles = 1; - TableStyle(1) = iTableStyle::Comma; - del(1) = CharComma; // comma + state.dataOutRptTab->numStyles = 1; + state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; + state.dataOutRptTab->del(1) = CharComma; // comma } else if (UtilityRoutines::SameString(AlphArray(1), "Tab")) { - numStyles = 1; - TableStyle(1) = iTableStyle::Tab; - del(1) = CharTab; // tab + state.dataOutRptTab->numStyles = 1; + state.dataOutRptTab->TableStyle(1) = iTableStyle::Tab; + state.dataOutRptTab->del(1) = CharTab; // tab } else if (UtilityRoutines::SameString(AlphArray(1), "Fixed")) { - numStyles = 1; - TableStyle(1) = iTableStyle::Fixed; - del(1) = CharSpace; // space + state.dataOutRptTab->numStyles = 1; + state.dataOutRptTab->TableStyle(1) = iTableStyle::Fixed; + state.dataOutRptTab->del(1) = CharSpace; // space } else if (UtilityRoutines::SameString(AlphArray(1), "HTML")) { - numStyles = 1; - TableStyle(1) = iTableStyle::HTML; - del(1) = CharSpace; // space - this is not used much for HTML output + state.dataOutRptTab->numStyles = 1; + state.dataOutRptTab->TableStyle(1) = iTableStyle::HTML; + state.dataOutRptTab->del(1) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "XML")) { - numStyles = 1; - TableStyle(1) = iTableStyle::XML; - del(1) = CharSpace; // space - this is not used much for XML output + state.dataOutRptTab->numStyles = 1; + state.dataOutRptTab->TableStyle(1) = iTableStyle::XML; + state.dataOutRptTab->del(1) = CharSpace; // space - this is not used much for XML output } else if (UtilityRoutines::SameString(AlphArray(1), "CommaAndHTML")) { - numStyles = 2; - TableStyle(1) = iTableStyle::Comma; - del(1) = CharComma; // comma - TableStyle(2) = iTableStyle::HTML; - del(2) = CharSpace; // space - this is not used much for HTML output + state.dataOutRptTab->numStyles = 2; + state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; + state.dataOutRptTab->del(1) = CharComma; // comma + state.dataOutRptTab->TableStyle(2) = iTableStyle::HTML; + state.dataOutRptTab->del(2) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "CommaAndXML")) { - numStyles = 2; - TableStyle(1) = iTableStyle::Comma; - del(1) = CharComma; // comma - TableStyle(2) = iTableStyle::XML; - del(2) = CharSpace; // space - this is not used much for XML output + state.dataOutRptTab->numStyles = 2; + state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; + state.dataOutRptTab->del(1) = CharComma; // comma + state.dataOutRptTab->TableStyle(2) = iTableStyle::XML; + state.dataOutRptTab->del(2) = CharSpace; // space - this is not used much for XML output } else if (UtilityRoutines::SameString(AlphArray(1), "TabAndHTML")) { - numStyles = 2; - TableStyle(1) = iTableStyle::Tab; - del(1) = CharTab; // tab - TableStyle(2) = iTableStyle::HTML; - del(2) = CharSpace; // space - this is not used much for HTML output + state.dataOutRptTab->numStyles = 2; + state.dataOutRptTab->TableStyle(1) = iTableStyle::Tab; + state.dataOutRptTab->del(1) = CharTab; // tab + state.dataOutRptTab->TableStyle(2) = iTableStyle::HTML; + state.dataOutRptTab->del(2) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "XMLandHTML")) { - numStyles = 2; - TableStyle(1) = iTableStyle::XML; - del(1) = CharSpace; // space - this is not used much for XML output - TableStyle(2) = iTableStyle::HTML; - del(2) = CharSpace; // space - this is not used much for HTML output + state.dataOutRptTab->numStyles = 2; + state.dataOutRptTab->TableStyle(1) = iTableStyle::XML; + state.dataOutRptTab->del(1) = CharSpace; // space - this is not used much for XML output + state.dataOutRptTab->TableStyle(2) = iTableStyle::HTML; + state.dataOutRptTab->del(2) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "All")) { - numStyles = 5; - TableStyle(1) = iTableStyle::Comma; - del(1) = CharComma; // comma - TableStyle(2) = iTableStyle::Tab; - del(2) = CharTab; // tab - TableStyle(3) = iTableStyle::Fixed; - del(3) = CharSpace; // space - TableStyle(4) = iTableStyle::HTML; - del(4) = CharSpace; // space - this is not used much for HTML output - TableStyle(5) = iTableStyle::XML; - del(5) = CharSpace; // space - this is not used much for XML output + state.dataOutRptTab->numStyles = 5; + state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; + state.dataOutRptTab->del(1) = CharComma; // comma + state.dataOutRptTab->TableStyle(2) = iTableStyle::Tab; + state.dataOutRptTab->del(2) = CharTab; // tab + state.dataOutRptTab->TableStyle(3) = iTableStyle::Fixed; + state.dataOutRptTab->del(3) = CharSpace; // space + state.dataOutRptTab->TableStyle(4) = iTableStyle::HTML; + state.dataOutRptTab->del(4) = CharSpace; // space - this is not used much for HTML output + state.dataOutRptTab->TableStyle(5) = iTableStyle::XML; + state.dataOutRptTab->del(5) = CharSpace; // space - this is not used much for XML output } else { ShowWarningError(state, CurrentModuleObject + ": Invalid " + cAlphaFieldNames(1) + "=\"" + AlphArray(1) + "\". Commas will be used."); - numStyles = 1; - TableStyle(1) = iTableStyle::Comma; - del(1) = CharComma; // comma + state.dataOutRptTab->numStyles = 1; + state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; + state.dataOutRptTab->del(1) = CharComma; // comma AlphArray(1) = "COMMA"; } // MonthlyUnitConversion @@ -1764,14 +1737,14 @@ namespace EnergyPlus::OutputReportTabular { } } else if (NumTabularStyle > 1) { ShowWarningError(state, CurrentModuleObject + ": Only one instance of this object is allowed. Commas will be used."); - TableStyle = iTableStyle::Comma; - del = std::string(1, CharComma); // comma + state.dataOutRptTab->TableStyle = iTableStyle::Comma; + state.dataOutRptTab->del = std::string(1, CharComma); // comma AlphArray(1) = "COMMA"; state.dataOutRptTab->unitsStyle = iUnitsStyle::None; AlphArray(2) = "None"; } - if (WriteTabularFiles) { + if (state.dataOutRptTab->WriteTabularFiles) { print(state.files.eio, "! ,Style,Unit Conversion\n"); if (AlphArray(1) != "HTML") { ConvertCaseToLower(AlphArray(1), AlphArray(2)); @@ -1852,7 +1825,7 @@ namespace EnergyPlus::OutputReportTabular { bool ErrorsFound; if (!(state.files.outputControl.tabular || state.files.outputControl.sqlite)) { - WriteTabularFiles = false; + state.dataOutRptTab->WriteTabularFiles = false; return; } @@ -1878,92 +1851,92 @@ namespace EnergyPlus::OutputReportTabular { ShowFatalError(state, "Blank report name in Output:Table:SummaryReports"); } else if (UtilityRoutines::SameString(AlphArray(iReport), "AnnualBuildingUtilityPerformanceSummary")) { displayTabularBEPS = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ComponentCostEconomicsSummary")) { displayTabularCompCosts = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "InputVerificationandResultsSummary")) { displayTabularVeriSum = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ComponentSizingSummary")) { displayComponentSizing = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "SurfaceShadowingSummary")) { displaySurfaceShadowing = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "DemandEndUseComponentsSummary")) { displayDemandEndUse = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AdaptiveComfortSummary")) { displayAdaptiveComfort = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "SourceEnergyEndUseComponentsSummary")) { displaySourceEnergyEndUseSummary = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ZoneComponentLoadSummary")) { displayZoneComponentLoadSummary = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AirLoopComponentLoadSummary")) { displayAirLoopComponentLoadSummary = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "FacilityComponentLoadSummary")) { displayFacilityComponentLoadSummary = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "LEEDSummary")) { displayLEEDSummary = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "LifeCycleCostReport")) { displayLifeCycleCostReport = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "TariffReport")) { displayTariffReport = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "EconomicResultSummary")) { displayEconomicResultSummary = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "HeatEmissionsSummary")) { displayHeatEmissionsSummary = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ThermalResilienceSummary")) { displayThermalResilienceSummary = true; displayThermalResilienceSummaryExplicitly = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "CO2ResilienceSummary")) { displayCO2ResilienceSummary = true; displayCO2ResilienceSummaryExplicitly = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "VisualResilienceSummary")) { displayVisualResilienceSummary = true; displayVisualResilienceSummaryExplicitly = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "EnergyMeters")) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "InitializationSummary")) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; displayEioSummary = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummary")) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; displayTabularBEPS = true; displayTabularVeriSum = true; displayTabularCompCosts = true; @@ -1986,7 +1959,7 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptPredefined->reportName(jReport).show = true; } } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryAndSizingPeriod")) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; displayTabularBEPS = true; displayTabularVeriSum = true; displayTabularCompCosts = true; @@ -2013,13 +1986,13 @@ namespace EnergyPlus::OutputReportTabular { displayAirLoopComponentLoadSummary = true; displayFacilityComponentLoadSummary = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllMonthly")) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; for (jReport = 1; jReport <= numNamedMonthly; ++jReport) { namedMonthly(jReport).show = true; } nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryAndMonthly")) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; displayTabularBEPS = true; displayTabularVeriSum = true; displayTabularCompCosts = true; @@ -2045,7 +2018,7 @@ namespace EnergyPlus::OutputReportTabular { namedMonthly(jReport).show = true; } } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryMonthlyAndSizingPeriod")) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; displayTabularBEPS = true; displayTabularVeriSum = true; displayTabularCompCosts = true; @@ -2078,12 +2051,12 @@ namespace EnergyPlus::OutputReportTabular { // check the reports that are predefined and are created by OutputReportPredefined for (jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { if (UtilityRoutines::SameString(AlphArray(iReport), state.dataOutRptPredefined->reportName(jReport).name)) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; state.dataOutRptPredefined->reportName(jReport).show = true; nameFound = true; } if (UtilityRoutines::SameString(AlphArray(iReport), state.dataOutRptPredefined->reportName(jReport).abrev)) { - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; state.dataOutRptPredefined->reportName(jReport).show = true; nameFound = true; } @@ -2092,7 +2065,7 @@ namespace EnergyPlus::OutputReportTabular { for (jReport = 1; jReport <= numNamedMonthly; ++jReport) { if (UtilityRoutines::SameString(AlphArray(iReport), namedMonthly(jReport).title)) { namedMonthly(jReport).show = true; - WriteTabularFiles = true; + state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } } @@ -3427,10 +3400,10 @@ namespace EnergyPlus::OutputReportTabular { // create a file to hold the results // Use a CSV file if comma seperated but otherwise use TXT file // extension. - if (WriteTabularFiles && state.files.outputControl.tabular) { - for (iStyle = 1; iStyle <= numStyles; ++iStyle) { - curDel = del(iStyle); - if (TableStyle(iStyle) == iTableStyle::Comma) { + if (state.dataOutRptTab->WriteTabularFiles && state.files.outputControl.tabular) { + for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { + curDel = state.dataOutRptTab->del(iStyle); + if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::Comma) { DisplayString(state, "Writing tabular output file results using comma format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblCsvFileName, state.files.outputControl.tabular); tbl_stream << "Program Version:" << curDel << VerString << '\n'; @@ -3443,7 +3416,7 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << "Environment:" << curDel << state.dataEnvrn->EnvironmentName << " ** " << state.dataEnvrn->WeatherFileLocationTitle << '\n'; } tbl_stream << '\n'; - } else if (TableStyle(iStyle) == iTableStyle::Tab) { + } else if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::Tab) { DisplayString(state, "Writing tabular output file results using tab format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblTabFileName, state.files.outputControl.tabular); tbl_stream << "Program Version" << curDel << VerString << '\n'; @@ -3456,7 +3429,7 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << "Environment:" << curDel << state.dataEnvrn->EnvironmentName << " ** " << state.dataEnvrn->WeatherFileLocationTitle << '\n'; } tbl_stream << '\n'; - } else if (TableStyle(iStyle) == iTableStyle::HTML) { + } else if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::HTML) { DisplayString(state, "Writing tabular output file results using HTML format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblHtmFileName, state.files.outputControl.tabular); tbl_stream << "\n"; @@ -3489,7 +3462,7 @@ namespace EnergyPlus::OutputReportTabular { << std::setw(2) << td(3) << '\n'; tbl_stream << " " << std::setw(2) << td(5) << ':' << std::setw(2) << td(6) << ':' << std::setw(2) << td(7) << std::setfill(' ') << "

\n"; - } else if (TableStyle(iStyle) == iTableStyle::XML) { + } else if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::XML) { DisplayString(state, "Writing tabular output file results using XML format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblXmlFileName, state.files.outputControl.tabular); tbl_stream << "\n"; @@ -3527,7 +3500,7 @@ namespace EnergyPlus::OutputReportTabular { } } - void CloseOutputTabularFile() + void CloseOutputTabularFile(EnergyPlusData &state) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -3564,13 +3537,13 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int iStyle; - if (WriteTabularFiles) { - for (iStyle = 1; iStyle <= numStyles; ++iStyle) { - std::ofstream &tbl_stream(*TabularOutputFile(iStyle)); - if (TableStyle(iStyle) == iTableStyle::HTML) { // if HTML file put ending info + if (state.dataOutRptTab->WriteTabularFiles) { + for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { + std::ofstream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); + if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::HTML) { // if HTML file put ending info tbl_stream << "\n"; tbl_stream << "\n"; - } else if (TableStyle(iStyle) == iTableStyle::XML) { + } else if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::XML) { if (!prevReportName.empty()) { tbl_stream << "\n"; // close the last element if it was used. } @@ -3642,12 +3615,12 @@ namespace EnergyPlus::OutputReportTabular { // normally do not add to the table of contents here but the order of calls is different for the life-cycle costs if (displayLifeCycleCostReport && LCCparamPresent) { - AddTOCEntry("Life-Cycle Cost Report", "Entire Facility"); + AddTOCEntry(state, "Life-Cycle Cost Report", "Entire Facility"); } - for (iStyle = 1; iStyle <= numStyles; ++iStyle) { - if (TableStyle(iStyle) == iTableStyle::HTML) { - std::ostream &tbl_stream(*TabularOutputFile(iStyle)); + for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { + if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::HTML) { + std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); tbl_stream << "
\n"; tbl_stream << "\n"; tbl_stream << "

Table of Contents

\n"; @@ -3751,11 +3724,11 @@ namespace EnergyPlus::OutputReportTabular { OutputReportTabularAnnual::AddAnnualTableOfContents(tbl_stream); } // add entries specifically added using AddTOCEntry - for (iEntry = 1; iEntry <= TOCEntriesCount; ++iEntry) { + for (iEntry = 1; iEntry <= state.dataOutRptTab->TOCEntriesCount; ++iEntry) { if (!TOCEntries(iEntry).isWritten) { curSection = TOCEntries(iEntry).sectionName; tbl_stream << "

" << curSection << "

|\n"; - for (jEntry = iEntry; jEntry <= TOCEntriesCount; ++jEntry) { + for (jEntry = iEntry; jEntry <= state.dataOutRptTab->TOCEntriesCount; ++jEntry) { if (!TOCEntries(jEntry).isWritten) { if (TOCEntries(jEntry).sectionName == curSection) { tbl_stream << "WriteTabularFiles) { // call each type of report in turn WriteBEPSTable(state); WriteTableOfContents(state); @@ -5757,7 +5730,7 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, - state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIP(indexUnitConv, StrToReal(lineIn.substr(12, lnPtr))), 1)); + state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIP(state, indexUnitConv, StrToReal(lineIn.substr(12, lnPtr))), 1)); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameWithSIUnits, lineIn.substr(12, lnPtr)); } @@ -5799,10 +5772,10 @@ namespace EnergyPlus::OutputReportTabular { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 2))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 2))), 1) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Heating Design Temperature 99% (F)", - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 3))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 3))), 1) + degChar); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Heating Design Temperature 99.6% (C)", GetColumnUsingTabs(lineIn, 2) + degChar); @@ -5814,10 +5787,10 @@ namespace EnergyPlus::OutputReportTabular { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 4))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 4))), 1) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Heating Design Temperature 99% (F)", - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 5))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 5))), 1) + degChar); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Heating Design Temperature 99.6% (C)", GetColumnUsingTabs(lineIn, 4) + degChar); @@ -5837,10 +5810,10 @@ namespace EnergyPlus::OutputReportTabular { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, col1))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, col1))), 1) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Heating Design Temperature 99% (F)", - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, col2))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, col2))), 1) + degChar); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Heating Design Temperature 99.6% (C)", GetColumnUsingTabs(lineIn, col1) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Heating Design Temperature 99% (C)", GetColumnUsingTabs(lineIn, col2) + degChar); @@ -5856,13 +5829,13 @@ namespace EnergyPlus::OutputReportTabular { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 2))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 2))), 1) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 1% (F)", - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 4))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 4))), 1) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 2% (F)", - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 6))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 6))), 1) + degChar); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 0.4% (C)", GetColumnUsingTabs(lineIn, 2) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 1% (C)", GetColumnUsingTabs(lineIn, 4) + degChar); @@ -5874,13 +5847,13 @@ namespace EnergyPlus::OutputReportTabular { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 5))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 5))), 1) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 1% (F)", - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 7))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 7))), 1) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 2% (F)", - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 9))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, 9))), 1) + degChar); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 0.4% (C)", GetColumnUsingTabs(lineIn, 5) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 1% (C)", GetColumnUsingTabs(lineIn, 7) + degChar); @@ -5902,13 +5875,13 @@ namespace EnergyPlus::OutputReportTabular { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, col1))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, col1))), 1) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 1% (F)", - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, col2))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, col2))), 1) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 2% (F)", - RealToStr(ConvertIP(indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, col3))), 1) + degChar); + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(GetColumnUsingTabs(lineIn, col3))), 1) + degChar); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 0.4% (C)", GetColumnUsingTabs(lineIn, col1) + degChar); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 1% (C)", GetColumnUsingTabs(lineIn, col2) + degChar); @@ -5936,7 +5909,7 @@ namespace EnergyPlus::OutputReportTabular { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, - RealToStr(ConvertIP(indexUnitConv, StrToReal(lineIn.substr(sposlt, eposlt - sposlt + 1))), 1) + + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(lineIn.substr(sposlt, eposlt - sposlt + 1))), 1) + degChar); } else { PreDefTableEntry(state, @@ -5968,7 +5941,7 @@ namespace EnergyPlus::OutputReportTabular { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, - RealToStr(ConvertIP(indexUnitConv, StrToReal(lineIn.substr(sposlt, eposlt - sposlt + 1))), 1) + + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(lineIn.substr(sposlt, eposlt - sposlt + 1))), 1) + degChar); } else { PreDefTableEntry(state, @@ -6000,7 +5973,7 @@ namespace EnergyPlus::OutputReportTabular { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, - RealToStr(ConvertIP(indexUnitConv, StrToReal(lineIn.substr(sposlt, eposlt - sposlt + 1))), 1) + + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(lineIn.substr(sposlt, eposlt - sposlt + 1))), 1) + degChar); } else { PreDefTableEntry(state, @@ -6032,7 +6005,7 @@ namespace EnergyPlus::OutputReportTabular { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, - RealToStr(ConvertIP(indexUnitConv, StrToReal(lineIn.substr(sposlt, eposlt - sposlt + 1))), 1) + + RealToStr(ConvertIP(state, indexUnitConv, StrToReal(lineIn.substr(sposlt, eposlt - sposlt + 1))), 1) + degChar); } else { PreDefTableEntry(state, @@ -6054,7 +6027,7 @@ namespace EnergyPlus::OutputReportTabular { curNameWithSIUnits = "ASHRAE Handbook 2009 Heating Degree-Days - base 65°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, - state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIPdelta(indexUnitConv, StrToReal(storeASHRAEHDD)), 1)); + state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIPdelta(state, indexUnitConv, StrToReal(storeASHRAEHDD)), 1)); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Heating Degree-Days (base 18.3°C)", storeASHRAEHDD); } @@ -6069,9 +6042,9 @@ namespace EnergyPlus::OutputReportTabular { curNameWithSIUnits = "Weather File Heating Degree-Days - base 65°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, - state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIPdelta(indexUnitConv, StrToReal(lineIn.substr(2, 4))), 1)); + state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIPdelta(state, indexUnitConv, StrToReal(lineIn.substr(2, 4))), 1)); PreDefTableEntry(state, - state.dataOutRptPredefined->pdchLeedGenData, "Heating Degree Days", RealToStr(ConvertIPdelta(indexUnitConv, StrToReal(lineIn.substr(2, 4))), 1)); + state.dataOutRptPredefined->pdchLeedGenData, "Heating Degree Days", RealToStr(ConvertIPdelta(state, indexUnitConv, StrToReal(lineIn.substr(2, 4))), 1)); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Weather File Heating Degree-Days (base 18°C)", lineIn.substr(2, 4)); PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "Heating Degree Days", lineIn.substr(2, 4)); @@ -6083,7 +6056,7 @@ namespace EnergyPlus::OutputReportTabular { curNameWithSIUnits = "ASHRAE Handbook 2009 Cooling Degree-Days - base 50°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, - state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIPdelta(indexUnitConv, StrToReal(storeASHRAECDD)), 1)); + state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIPdelta(state, indexUnitConv, StrToReal(storeASHRAECDD)), 1)); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Cooling Degree-Days (base 10°C)", storeASHRAECDD); } @@ -6098,9 +6071,9 @@ namespace EnergyPlus::OutputReportTabular { curNameWithSIUnits = "Weather File Cooling Degree-Days - base 50°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, - state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIPdelta(indexUnitConv, StrToReal(lineIn.substr(2, 4))), 1)); + state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIPdelta(state, indexUnitConv, StrToReal(lineIn.substr(2, 4))), 1)); PreDefTableEntry(state, - state.dataOutRptPredefined->pdchLeedGenData, "Cooling Degree Days", RealToStr(ConvertIPdelta(indexUnitConv, StrToReal(lineIn.substr(2, 4))), 1)); + state.dataOutRptPredefined->pdchLeedGenData, "Cooling Degree Days", RealToStr(ConvertIPdelta(state, indexUnitConv, StrToReal(lineIn.substr(2, 4))), 1)); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Weather File Cooling Degree-Days (base 10°C)", lineIn.substr(2, 4)); PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "Cooling Degree Days", lineIn.substr(2, 4)); @@ -6784,7 +6757,7 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { varNameWithUnits = MonthlyColumns(curCol).varName + unitEnumToStringBrackets(MonthlyColumns(curCol).units); LookupSItoIP(state, varNameWithUnits, indexUnitConv, curUnits); - GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + GetUnitConversion(state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); } else { // just do the Joule conversion // if units is in Joules, convert if specified if (UtilityRoutines::SameString(unitEnumToString(MonthlyColumns(curCol).units), "J")) { @@ -7009,8 +6982,8 @@ namespace EnergyPlus::OutputReportTabular { } } } // KColumn - WriteReportHeaders(MonthlyInput(iInput).name, MonthlyTables(curTable).keyValue, OutputProcessor::StoreType::Averaged); - WriteSubtitle("Custom Monthly Report"); + WriteReportHeaders(state, MonthlyInput(iInput).name, MonthlyTables(curTable).keyValue, OutputProcessor::StoreType::Averaged); + WriteSubtitle(state, "Custom Monthly Report"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth, true); // transpose monthly XML tables. if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -7123,8 +7096,8 @@ namespace EnergyPlus::OutputReportTabular { curNameWithSIUnits = OutputTableBinned(iInObj).varOrMeter + unitEnumToStringBrackets(OutputTableBinned(iInObj).units); if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); - curIntervalStart = ConvertIP(indexUnitConv, OutputTableBinned(iInObj).intervalStart); - curIntervalSize = ConvertIPdelta(indexUnitConv, OutputTableBinned(iInObj).intervalSize); + curIntervalStart = ConvertIP(state, indexUnitConv, OutputTableBinned(iInObj).intervalStart); + curIntervalSize = ConvertIPdelta(state, indexUnitConv, OutputTableBinned(iInObj).intervalSize); } else { curNameAndUnits = curNameWithSIUnits; curIntervalStart = OutputTableBinned(iInObj).intervalStart; @@ -7168,7 +7141,7 @@ namespace EnergyPlus::OutputReportTabular { } else { repNameWithUnitsandscheduleName = curNameAndUnits + " [" + OutputTableBinned(iInObj).ScheduleName + ']'; } - WriteReportHeaders(repNameWithUnitsandscheduleName, BinObjVarID(repIndex).namesOfObj, OutputTableBinned(iInObj).avgSum); + WriteReportHeaders(state, repNameWithUnitsandscheduleName, BinObjVarID(repIndex).namesOfObj, OutputTableBinned(iInObj).avgSum); for (kHour = 1; kHour <= 24; ++kHour) { tableBody(1, 14 + kHour) = RealToStr(BinResultsBelow(repIndex).hrly(kHour), 2); tableBody(curIntervalCount + 2, 14 + kHour) = RealToStr(BinResultsAbove(repIndex).hrly(kHour), 2); @@ -7210,9 +7183,9 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 39) = RealToStr(belowTotal, 2); tableBody(curIntervalCount + 2, 39) = RealToStr(aboveTotal, 2); tableBody(curIntervalCount + 3, 39) = RealToStr(tableTotal, 2); - WriteTextLine("Values in table are in hours."); - WriteTextLine(""); - WriteSubtitle("Time Bin Results"); + WriteTextLine(state, "Values in table are in hours."); + WriteTextLine(state, ""); + WriteSubtitle(state, "Time Bin Results"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth, true); // transpose XML tables if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -7246,12 +7219,12 @@ namespace EnergyPlus::OutputReportTabular { repMean = 0.0; } if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { - tableBodyStat(1, 1) = RealToStr(ConvertIP(indexUnitConv, BinStatistics(repIndex).minimum), 2); - tableBodyStat(1, 2) = RealToStr(ConvertIP(indexUnitConv, repMean - 2 * repStDev), 2); - tableBodyStat(1, 3) = RealToStr(ConvertIP(indexUnitConv, repMean), 2); - tableBodyStat(1, 4) = RealToStr(ConvertIP(indexUnitConv, repMean + 2 * repStDev), 2); - tableBodyStat(1, 5) = RealToStr(ConvertIP(indexUnitConv, BinStatistics(repIndex).maximum), 2); - tableBodyStat(1, 6) = RealToStr(ConvertIPdelta(indexUnitConv, repStDev), 2); + tableBodyStat(1, 1) = RealToStr(ConvertIP(state, indexUnitConv, BinStatistics(repIndex).minimum), 2); + tableBodyStat(1, 2) = RealToStr(ConvertIP(state, indexUnitConv, repMean - 2 * repStDev), 2); + tableBodyStat(1, 3) = RealToStr(ConvertIP(state, indexUnitConv, repMean), 2); + tableBodyStat(1, 4) = RealToStr(ConvertIP(state, indexUnitConv, repMean + 2 * repStDev), 2); + tableBodyStat(1, 5) = RealToStr(ConvertIP(state, indexUnitConv, BinStatistics(repIndex).maximum), 2); + tableBodyStat(1, 6) = RealToStr(ConvertIPdelta(state, indexUnitConv, repStDev), 2); } else { tableBodyStat(1, 1) = RealToStr(BinStatistics(repIndex).minimum, 2); tableBodyStat(1, 2) = RealToStr(repMean - 2 * repStDev, 2); @@ -7260,7 +7233,7 @@ namespace EnergyPlus::OutputReportTabular { tableBodyStat(1, 5) = RealToStr(BinStatistics(repIndex).maximum, 2); tableBodyStat(1, 6) = RealToStr(repStDev, 2); } - WriteSubtitle("Statistics"); + WriteSubtitle(state, "Statistics"); WriteTable(state, tableBodyStat, rowHeadStat, columnHeadStat, columnWidthStat, true); // transpose XML table if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -7386,13 +7359,13 @@ namespace EnergyPlus::OutputReportTabular { if (displayTabularBEPS || displayLEEDSummary) { // show the headers of the report if (displayTabularBEPS) { - WriteReportHeaders("Annual Building Utility Performance Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, "Annual Building Utility Performance Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // show the number of hours that the table applies to - WriteTextLine("Values gathered over " + RealToStr(gatherElapsedTimeBEPS, 2) + " hours", true); + WriteTextLine(state, "Values gathered over " + RealToStr(gatherElapsedTimeBEPS, 2) + " hours", true); if (gatherElapsedTimeBEPS < 8759.0) { // might not add up to 8760 exactly but can't be more than 1 hour diff. - WriteTextLine("WARNING: THE REPORT DOES NOT REPRESENT A FULL ANNUAL SIMULATION.", true); + WriteTextLine(state, "WARNING: THE REPORT DOES NOT REPRESENT A FULL ANNUAL SIMULATION.", true); } - WriteTextLine("", true); + WriteTextLine(state, "", true); } // determine building floor areas DetermineBuildingFloorArea(state); @@ -7762,7 +7735,7 @@ namespace EnergyPlus::OutputReportTabular { // heading for the entire sub-table if (displayTabularBEPS) { - WriteSubtitle("Site and Source Energy"); + WriteSubtitle(state, "Site and Source Energy"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -7912,7 +7885,7 @@ namespace EnergyPlus::OutputReportTabular { // heading for the entire sub-table if (displayTabularBEPS) { - WriteSubtitle("Site to Source Energy Conversion Factors"); + WriteSubtitle(state, "Site to Source Energy Conversion Factors"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -7967,7 +7940,7 @@ namespace EnergyPlus::OutputReportTabular { // heading for the entire sub-table if (displayTabularBEPS) { - WriteSubtitle("Building Area"); + WriteSubtitle(state, "Building Area"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -8223,7 +8196,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table if (displayTabularBEPS) { - WriteSubtitle("End Uses"); + WriteSubtitle(state, "End Uses"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth, false, footnote); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -8376,7 +8349,7 @@ namespace EnergyPlus::OutputReportTabular { // heading for the entire sub-table if (displayTabularBEPS) { - WriteSubtitle("End Uses By Subcategory"); + WriteSubtitle(state, "End Uses By Subcategory"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); Array1D_string rowHeadTemp(rowHead); @@ -8542,7 +8515,7 @@ namespace EnergyPlus::OutputReportTabular { } } - WriteTextLine("Normalized Metrics", true); + WriteTextLine(state, "Normalized Metrics", true); // write the conditioned area based table tableBody = ""; @@ -8555,7 +8528,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table if (displayTabularBEPS) { - WriteSubtitle("Utility Use Per Conditioned Floor Area"); + WriteSubtitle(state, "Utility Use Per Conditioned Floor Area"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -8585,7 +8558,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table if (displayTabularBEPS) { - WriteSubtitle("Utility Use Per Total Floor Area"); + WriteSubtitle(state, "Utility Use Per Total Floor Area"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -8677,7 +8650,7 @@ namespace EnergyPlus::OutputReportTabular { // heading for the entire sub-table if (displayTabularBEPS) { - WriteSubtitle("Electric Loads Satisfied"); + WriteSubtitle(state, "Electric Loads Satisfied"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -8753,7 +8726,7 @@ namespace EnergyPlus::OutputReportTabular { // heading for the entire sub-table if (displayTabularBEPS) { - WriteSubtitle("On-Site Thermal Sources"); + WriteSubtitle(state, "On-Site Thermal Sources"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -8848,7 +8821,7 @@ namespace EnergyPlus::OutputReportTabular { // ! heading for the entire sub-table if (displayTabularBEPS) { - WriteSubtitle("Water Source Summary"); + WriteSubtitle(state, "Water Source Summary"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -8868,7 +8841,7 @@ namespace EnergyPlus::OutputReportTabular { columnWidth = 14; // array assignment - same for all columns tableBody.allocate(1, 2); - WriteSubtitle("Setpoint Not Met Criteria"); + WriteSubtitle(state, "Setpoint Not Met Criteria"); curNameWithSIUnits = "Degrees [deltaC]"; curNameAndUnits = curNameWithSIUnits; @@ -8884,8 +8857,8 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 1) = RealToStr(std::abs(deviationFromSetPtThresholdHtg), 2); tableBody(1, 2) = RealToStr(deviationFromSetPtThresholdClg, 2); } else { - tableBody(1, 1) = RealToStr(ConvertIPdelta(indexUnitConv, std::abs(deviationFromSetPtThresholdHtg)), 2); - tableBody(1, 2) = RealToStr(ConvertIPdelta(indexUnitConv, deviationFromSetPtThresholdClg), 2); + tableBody(1, 1) = RealToStr(ConvertIPdelta(state, indexUnitConv, std::abs(deviationFromSetPtThresholdHtg)), 2); + tableBody(1, 2) = RealToStr(ConvertIPdelta(state, indexUnitConv, deviationFromSetPtThresholdClg), 2); } WriteTable(state, tableBody, rowHead, columnHead, columnWidth); @@ -8910,7 +8883,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody.allocate(1, 3); if (displayTabularBEPS) { - WriteSubtitle("Comfort and Setpoint Not Met Summary"); + WriteSubtitle(state, "Comfort and Setpoint Not Met Summary"); } columnHead(1) = "Facility [Hours]"; @@ -8950,7 +8923,7 @@ namespace EnergyPlus::OutputReportTabular { //---- End Notes if (displayTabularBEPS) { - WriteTextLine("Note 1: An asterisk (*) indicates that the feature is not yet implemented."); + WriteTextLine(state, "Note 1: An asterisk (*) indicates that the feature is not yet implemented."); } // CALL WriteTextLine('Note 2: The source energy conversion factors used are: ') // CALL WriteTextLine(' 1.05 for all fuels, 1 for district, and 3 for electricity.') @@ -8999,13 +8972,13 @@ namespace EnergyPlus::OutputReportTabular { if (displaySourceEnergyEndUseSummary) { // show the headers of the report - WriteReportHeaders("Source Energy End Use Components Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, "Source Energy End Use Components Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // show the number of hours that the table applies to - WriteTextLine("Values gathered over " + RealToStr(gatherElapsedTimeBEPS, 2) + " hours", true); + WriteTextLine(state, "Values gathered over " + RealToStr(gatherElapsedTimeBEPS, 2) + " hours", true); if (gatherElapsedTimeBEPS < 8759.0) { // might not add up to 8760 exactly but can't be more than 1 hour diff. - WriteTextLine("WARNING: THE REPORT DOES NOT REPRESENT A FULL ANNUAL SIMULATION.", true); + WriteTextLine(state, "WARNING: THE REPORT DOES NOT REPRESENT A FULL ANNUAL SIMULATION.", true); } - WriteTextLine("", true); + WriteTextLine(state, "", true); // determine building floor areas DetermineBuildingFloorArea(state); // collapse the gatherEndUseBEPS array to the resource groups displayed @@ -9163,7 +9136,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table - WriteSubtitle("Source Energy End Use Components Summary"); + WriteSubtitle(state, "Source Energy End Use Components Summary"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -9242,10 +9215,10 @@ namespace EnergyPlus::OutputReportTabular { } } - WriteTextLine("Normalized Metrics", true); + WriteTextLine(state, "Normalized Metrics", true); // heading for the entire sub-table - WriteSubtitle("Source Energy End Use Components Per Conditioned Floor Area"); + WriteSubtitle(state, "Source Energy End Use Components Per Conditioned Floor Area"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -9281,7 +9254,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table - WriteSubtitle("Source Energy End Use Components Per Total Floor Area"); + WriteSubtitle(state, "Source Energy End Use Components Per Total Floor Area"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -9352,7 +9325,7 @@ namespace EnergyPlus::OutputReportTabular { if (displayDemandEndUse) { // show the headers of the report - WriteReportHeaders("Demand End Use Components Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, "Demand End Use Components Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // totals - select which additional fuel to display and which other district heating collapsedTotal = 0.0; collapsedTotal(1) = gatherDemandTotal(1); // electricity @@ -9592,7 +9565,7 @@ namespace EnergyPlus::OutputReportTabular { // complete the LEED end use table using the same values unconvert = 1 / powerConversion; - WriteSubtitle("End Uses"); + WriteSubtitle(state, "End Uses"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth, false, footnote); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -9701,7 +9674,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table - WriteSubtitle("End Uses By Subcategory"); + WriteSubtitle(state, "End Uses By Subcategory"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth, false, footnote); Array1D_string rowHeadTemp(rowHead); @@ -9848,7 +9821,7 @@ namespace EnergyPlus::OutputReportTabular { if (!state.dataCostEstimateManager->DoCostEstimate) return; - WriteReportHeaders("Component Cost Economics Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, "Component Cost Economics Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // compute floor area if no ABUPS if (buildingConditionedFloorArea == 0.0) { @@ -9878,7 +9851,7 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { SIunit = "[m2]"; LookupSItoIP(state, SIunit, unitConvIndex, m2_unitName); - m2_unitConv = ConvertIP(unitConvIndex, 1.0); + m2_unitConv = ConvertIP(state, unitConvIndex, 1.0); rowHead(10) = "Cost Per Conditioned Building Area (~~$~~/ft2)"; } else { rowHead(10) = "Cost Per Conditioned Building Area (~~$~~/m2)"; @@ -9966,7 +9939,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(3, 9) = RealToStr(TableBodyData(3, 9), 2); tableBody(3, 10) = RealToStr(TableBodyData(3, 10), 2); - WriteSubtitle("Construction Cost Estimate Summary"); + WriteSubtitle(state, "Construction Cost Estimate Summary"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -10002,10 +9975,10 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, state.dataCostEstimateManager->CostLineItem(item).Units, unitConvIndex, IPunitName); if (unitConvIndex != 0) { - IPqty = ConvertIP(unitConvIndex, state.dataCostEstimateManager->CostLineItem(item).Qty); + IPqty = ConvertIP(state, unitConvIndex, state.dataCostEstimateManager->CostLineItem(item).Qty); tableBody(3, item) = RealToStr(IPqty, 2); tableBody(4, item) = IPunitName; - IPsingleValue = ConvertIP(unitConvIndex, 1.0); + IPsingleValue = ConvertIP(state, unitConvIndex, 1.0); if (IPsingleValue != 0.0) { IPvaluePer = state.dataCostEstimateManager->CostLineItem(item).ValuePer / IPsingleValue; tableBody(5, item) = RealToStr(IPvaluePer, 2); @@ -10023,7 +9996,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(6, item) = RealToStr(state.dataCostEstimateManager->CostLineItem(item).LineSubTotal, 2); } tableBody(6, NumRows) = RealToStr(state.dataCostEstimateManager->CurntBldg.LineItemTot, 2); - WriteSubtitle("Cost Line Item Details"); //: '//TRIM(RealToStr(CostEstimateTotal, 2))) + WriteSubtitle(state, "Cost Line Item Details"); //: '//TRIM(RealToStr(CostEstimateTotal, 2))) WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -10222,22 +10195,22 @@ namespace EnergyPlus::OutputReportTabular { // all arrays are in the format: (row, columnm) if (displayTabularVeriSum) { // show the headers of the report - WriteReportHeaders("Input Verification and Results Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, "Input Verification and Results Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // do unit conversions if necessary if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { SIunit = "[m]"; LookupSItoIP(state, SIunit, unitConvIndex, m_unitName); - m_unitConv = ConvertIP(unitConvIndex, 1.0); + m_unitConv = ConvertIP(state, unitConvIndex, 1.0); SIunit = "[m2]"; LookupSItoIP(state, SIunit, unitConvIndex, m2_unitName); - m2_unitConv = ConvertIP(unitConvIndex, 1.0); + m2_unitConv = ConvertIP(state, unitConvIndex, 1.0); SIunit = "[m3]"; LookupSItoIP(state, SIunit, unitConvIndex, m3_unitName); - m3_unitConv = ConvertIP(unitConvIndex, 1.0); + m3_unitConv = ConvertIP(state, unitConvIndex, 1.0); SIunit = "[W/m2]"; LookupSItoIP(state, SIunit, unitConvIndex, Wm2_unitName); - Wm2_unitConv = ConvertIP(unitConvIndex, 1.0); + Wm2_unitConv = ConvertIP(state, unitConvIndex, 1.0); } else { m_unitName = "[m]"; m_unitConv = 1.0; @@ -10285,7 +10258,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 10) = RealToStr(gatherElapsedTimeBEPS, 2); // hours simulated // tableBody(9,1) = TRIM(fmt::to_string(state.dataOutRptPredefined->numTableEntry)) !number of table entries for predefined tables - WriteSubtitle("General"); + WriteSubtitle(state, "General"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -10297,7 +10270,7 @@ namespace EnergyPlus::OutputReportTabular { } //---- Window Wall Ratio Sub-Table - WriteTextLine("ENVELOPE", true); + WriteTextLine(state, "ENVELOPE", true); rowHead.allocate(5); columnHead.allocate(5); @@ -10507,7 +10480,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(wwrcWest, wwrrAbvGndWWR) = RealToStr(100.0 * SafeDivide(windowAreaW, aboveGroundWallAreaW), 2); tableBody(wwrcTotal, wwrrAbvGndWWR) = RealToStr(100.0 * SafeDivide(TotalWindowArea, TotalAboveGroundWallArea), 2); - WriteSubtitle("Window-Wall Ratio"); + WriteSubtitle(state, "Window-Wall Ratio"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -10575,7 +10548,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(wwrcWest, wwrrAbvGndWWR) = RealToStr(100.0 * SafeDivide(windowAreaWcond, aboveGroundWallAreaWcond), 2); tableBody(wwrcTotal, wwrrAbvGndWWR) = RealToStr(100.0 * SafeDivide(TotalWindowArea, TotalAboveGroundWallArea), 2); - WriteSubtitle("Conditioned Window-Wall Ratio"); + WriteSubtitle(state, "Conditioned Window-Wall Ratio"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -10609,7 +10582,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 2) = RealToStr(skylightArea * m2_unitConv, 2); tableBody(1, 3) = RealToStr(100.0 * SafeDivide(skylightArea, roofArea), 2); - WriteSubtitle("Skylight-Roof Ratio"); + WriteSubtitle(state, "Skylight-Roof Ratio"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -10645,7 +10618,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(2, iZone) = RealToStr(Zone(iZone).ZoneVolCapMultpSensHMAverage, 2); } - WriteSubtitle("Hybrid Model: Internal Thermal Mass"); + WriteSubtitle(state, "Hybrid Model: Internal Thermal Mass"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -10684,7 +10657,7 @@ namespace EnergyPlus::OutputReportTabular { } } //---- Space Summary Sub-Table - WriteTextLine("PERFORMANCE", true); + WriteTextLine(state, "PERFORMANCE", true); rowHead.allocate(state.dataGlobal->NumOfZones + 4); NumOfCol = 12; @@ -10864,7 +10837,7 @@ namespace EnergyPlus::OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedSutOcArea, "Totals", zstArea(condTotal), 2); PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedSutUnArea, "Totals", zstArea(uncondTotal), 2); - WriteSubtitle("Zone Summary"); + WriteSubtitle(state, "Zone Summary"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -10936,8 +10909,8 @@ namespace EnergyPlus::OutputReportTabular { rowHead.allocate(numPeopleAdaptive); tableBody.allocate(5, numPeopleAdaptive); - WriteReportHeaders("Adaptive Comfort Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); - WriteSubtitle("Time Not Meeting the Adaptive Comfort Models during Occupied Hours"); + WriteReportHeaders(state, "Adaptive Comfort Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteSubtitle(state, "Time Not Meeting the Adaptive Comfort Models during Occupied Hours"); columnWidth.allocate(5); columnWidth = 10; @@ -11175,8 +11148,8 @@ namespace EnergyPlus::OutputReportTabular { if (displayHeatEmissionsSummary) { - WriteReportHeaders("Annual Heat Emissions Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); - WriteSubtitle("Heat Emission by Components"); + WriteReportHeaders(state, "Annual Heat Emissions Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteSubtitle(state, "Heat Emission by Components"); columnWidth.allocate(6); columnWidth = 10; @@ -11300,7 +11273,7 @@ namespace EnergyPlus::OutputReportTabular { // loop through all reports and include those that have been flagged as 'show' for (iReportName = 1; iReportName <= state.dataOutRptPredefined->numReportName; ++iReportName) { if (state.dataOutRptPredefined->reportName(iReportName).show) { - WriteReportHeaders(state.dataOutRptPredefined->reportName(iReportName).namewithspaces, "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, state.dataOutRptPredefined->reportName(iReportName).namewithspaces, "Entire Facility", OutputProcessor::StoreType::Averaged); // loop through the subtables and include those that are associated with this report for (int jSubTable = 1, jSubTable_end = state.dataOutRptPredefined->numSubTable; jSubTable <= jSubTable_end; ++jSubTable) { if (state.dataOutRptPredefined->subTable(jSubTable).indexReportName == iReportName) { @@ -11360,7 +11333,7 @@ namespace EnergyPlus::OutputReportTabular { LookupSItoIP(state, colTagWithSI, indexUnitConv, curColTag); colUnitConv(countColumn) = indexUnitConv; } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { - LookupJtokWH(colTagWithSI, indexUnitConv, curColTag); + LookupJtokWH(state, colTagWithSI, indexUnitConv, curColTag); colUnitConv(countColumn) = indexUnitConv; } else { curColTag = colTagWithSI; @@ -11401,7 +11374,7 @@ namespace EnergyPlus::OutputReportTabular { } } if (state.dataOutRptPredefined->tableEntry(lTableEntry).origEntryIsReal && (columnUnitConv != 0)) { - IPvalue = ConvertIP(columnUnitConv, state.dataOutRptPredefined->tableEntry(lTableEntry).origRealEntry); + IPvalue = ConvertIP(state, columnUnitConv, state.dataOutRptPredefined->tableEntry(lTableEntry).origRealEntry); tableBody(colCurrent, rowCurrent) = RealToStr(IPvalue, state.dataOutRptPredefined->tableEntry(lTableEntry).significantDigits); } else { tableBody(colCurrent, rowCurrent) = state.dataOutRptPredefined->tableEntry(lTableEntry).charEntry; @@ -11412,7 +11385,7 @@ namespace EnergyPlus::OutputReportTabular { } } // create the actual output table - WriteSubtitle(state.dataOutRptPredefined->subTable(jSubTable).name); + WriteSubtitle(state, state.dataOutRptPredefined->subTable(jSubTable).name); WriteTable(state, tableBody, rowHead, columnHead, columnWidth, false, state.dataOutRptPredefined->subTable(jSubTable).footnote); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -11476,7 +11449,7 @@ namespace EnergyPlus::OutputReportTabular { static Real64 curValue(0.0); if (displayComponentSizing) { - WriteReportHeaders("Component Sizing Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, "Component Sizing Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // The arrays that look for unique headers are dimensioned in the // running program since the size of the number of entries is // not previouslly known. Use the size of all entries since that @@ -11602,7 +11575,7 @@ namespace EnergyPlus::OutputReportTabular { curValueSI = state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).valField; if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { if (colUnitConv(foundDesc) != 0) { - curValue = ConvertIP(colUnitConv(foundDesc), curValueSI); + curValue = ConvertIP(state, colUnitConv(foundDesc), curValueSI); } else { curValue = curValueSI; } @@ -11619,7 +11592,7 @@ namespace EnergyPlus::OutputReportTabular { } } // write the table - WriteSubtitle(state.dataOutRptPredefined->CompSizeTableEntry(foundEntry).typeField); + WriteSubtitle(state, state.dataOutRptPredefined->CompSizeTableEntry(foundEntry).typeField); if (state.dataOutRptPredefined->CompSizeTableEntry(foundEntry).typeField == "AirTerminal:SingleDuct:VAV:Reheat" || state.dataOutRptPredefined->CompSizeTableEntry(foundEntry).typeField == "AirTerminal:SingleDuct:VAV:NoReheat") { WriteTable(state, tableBody, @@ -11735,7 +11708,7 @@ namespace EnergyPlus::OutputReportTabular { } assert(numreceivingfields == state.dataOutRptPredefined->numShadowRelate); - WriteReportHeaders("Surface Shadowing Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, "Surface Shadowing Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); unique.allocate(state.dataOutRptPredefined->numShadowRelate); // do entire process twice, once with surfaces receiving, once with subsurfaces receiving for (iKindRec = recKindSurface; iKindRec <= recKindSubsurface; ++iKindRec) { @@ -11777,7 +11750,7 @@ namespace EnergyPlus::OutputReportTabular { // write the table if (iKindRec == recKindSurface) { - WriteSubtitle("Surfaces (Walls, Roofs, etc) that may be Shadowed by Other Surfaces"); + WriteSubtitle(state, "Surfaces (Walls, Roofs, etc) that may be Shadowed by Other Surfaces"); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, rowHead, @@ -11796,7 +11769,7 @@ namespace EnergyPlus::OutputReportTabular { "Surfaces (Walls, Roofs, etc) that may be Shadowed by Other Surfaces"); } } else if (iKindRec == recKindSubsurface) { - WriteSubtitle("Subsurfaces (Windows and Doors) that may be Shadowed by Surfaces"); + WriteSubtitle(state, "Subsurfaces (Windows and Doors) that may be Shadowed by Surfaces"); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, rowHead, @@ -11833,7 +11806,7 @@ namespace EnergyPlus::OutputReportTabular { Array1D_int colUnitConv; // setting up report header - WriteReportHeaders("Initialization Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, "Initialization Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); std::vector headerLines; // holds the lines that describe each type of records - each starts with ! symbol std::vector bodyLines; // holds the data records only @@ -11897,14 +11870,14 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound || state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { if (isNumber(dataFields[iCol]) && colUnitConv(iCol) > 0) { // if it is a number that has a conversion int numDecimalDigits = digitsAferDecimal(dataFields[iCol]); - Real64 convertedVal = ConvertIP(colUnitConv(iCol), StrToReal(dataFields[iCol])); + Real64 convertedVal = ConvertIP(state, colUnitConv(iCol), StrToReal(dataFields[iCol])); tableBody(iCol, rowNum) = RealToStr(convertedVal, numDecimalDigits); } else if (iCol == numCols && columnHead(iCol) == "Value" && iCol > 1) { // if it is the last column and the // header is Value then treat the // previous column as source of units int indexUnitConv = unitsFromHeading(state, tableBody(iCol - 1, rowNum)); // base units on previous column int numDecimalDigits = digitsAferDecimal(dataFields[iCol]); - Real64 convertedVal = ConvertIP(indexUnitConv, StrToReal(dataFields[iCol])); + Real64 convertedVal = ConvertIP(state, indexUnitConv, StrToReal(dataFields[iCol])); tableBody(iCol, rowNum) = RealToStr(convertedVal, numDecimalDigits); } else { tableBody(iCol, rowNum) = dataFields[iCol]; @@ -11917,7 +11890,7 @@ namespace EnergyPlus::OutputReportTabular { } } - WriteSubtitle(tableName); + WriteSubtitle(state, tableName); WriteTable(state, tableBody, rowHead, columnHead, columnWidth, false, footnote); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -11939,7 +11912,7 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, heading, unitConv, curHeading); } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { - LookupJtokWH(heading, unitConv, curHeading); + LookupJtokWH(state, heading, unitConv, curHeading); } else { curHeading = heading; } @@ -12005,16 +11978,16 @@ namespace EnergyPlus::OutputReportTabular { if (displayZoneComponentLoadSummary) { for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { if (!ZoneEquipConfig(iZone).IsControlled) continue; - AddTOCEntry("Zone Component Load Summary", Zone(iZone).Name); + AddTOCEntry(state, "Zone Component Load Summary", Zone(iZone).Name); } } if (displayAirLoopComponentLoadSummary) { for (int AirLoopNum = 1; AirLoopNum <= DataHVACGlobals::NumPrimaryAirSys; ++AirLoopNum) { - AddTOCEntry("AirLoop Component Load Summary", DataSizing::FinalSysSizing(AirLoopNum).AirPriLoopName); + AddTOCEntry(state, "AirLoop Component Load Summary", DataSizing::FinalSysSizing(AirLoopNum).AirPriLoopName); } } if (displayFacilityComponentLoadSummary) { - AddTOCEntry("Facility Component Load Summary", "Facility"); + AddTOCEntry(state, "Facility Component Load Summary", "Facility"); } } } @@ -13851,14 +13824,14 @@ namespace EnergyPlus::OutputReportTabular { compLoadTotal.cells(cPerArea, row) *= powerPerAreaConversion; } } - int tempConvIndx = getSpecificUnitIndex("C", "F"); - compLoadTotal.outsideDryBulb = ConvertIP(tempConvIndx, compLoadTotal.outsideDryBulb); - compLoadTotal.outsideWetBulb = ConvertIP(tempConvIndx, compLoadTotal.outsideWetBulb); - compLoadTotal.zoneDryBulb = ConvertIP(tempConvIndx, compLoadTotal.zoneDryBulb); + int tempConvIndx = getSpecificUnitIndex(state, "C", "F"); + compLoadTotal.outsideDryBulb = ConvertIP(state, tempConvIndx, compLoadTotal.outsideDryBulb); + compLoadTotal.outsideWetBulb = ConvertIP(state, tempConvIndx, compLoadTotal.outsideWetBulb); + compLoadTotal.zoneDryBulb = ConvertIP(state, tempConvIndx, compLoadTotal.zoneDryBulb); compLoadTotal.peakDesSensLoad *= powerConversion; - compLoadTotal.supAirTemp = ConvertIP(tempConvIndx, compLoadTotal.supAirTemp); - compLoadTotal.mixAirTemp = ConvertIP(tempConvIndx, compLoadTotal.mixAirTemp); + compLoadTotal.supAirTemp = ConvertIP(state, tempConvIndx, compLoadTotal.supAirTemp); + compLoadTotal.mixAirTemp = ConvertIP(state, tempConvIndx, compLoadTotal.mixAirTemp); compLoadTotal.mainFanAirFlow *= airFlowConversion; compLoadTotal.outsideAirFlow *= airFlowConversion; compLoadTotal.designPeakLoad *= powerConversion; @@ -13925,7 +13898,7 @@ namespace EnergyPlus::OutputReportTabular { writeOutput = false; } if (writeOutput) { - WriteReportHeaders(reportName, zoneAirLoopFacilityName, OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, reportName, zoneAirLoopFacilityName, OutputProcessor::StoreType::Averaged); std::string peakLoadCompName; std::string peakCondName; std::string zonesIncludedName; @@ -14010,7 +13983,7 @@ namespace EnergyPlus::OutputReportTabular { } columnWidth.dimension(cPerArea, 14); // array assignment - same for all columns - WriteSubtitle(peakLoadCompName); + WriteSubtitle(state, peakLoadCompName); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, rowHead, columnHead, reportName, zoneAirLoopFacilityName, peakLoadCompName); @@ -14092,7 +14065,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 15) = RealToStr(curCompLoad.estInstDelSensLoad, 2); // Estimated Instant + Delayed Sensible Load tableBody(1, 16) = RealToStr(curCompLoad.diffPeakEst, 2); // Difference - WriteSubtitle(peakCondName); + WriteSubtitle(state, peakCondName); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, rowHead, columnHead, reportName, zoneAirLoopFacilityName, peakCondName); @@ -14140,7 +14113,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 5) = fmt::format("{:0.3E}", curCompLoad.totCapPerArea); // total capacity per area tableBody(1, 6) = fmt::format("{:.{}f}", curCompLoad.numPeople, 1); // number of people - WriteSubtitle(engineeringCheckName); + WriteSubtitle(state, engineeringCheckName); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, rowHead, columnHead, reportName, zoneAirLoopFacilityName, engineeringCheckName); @@ -14174,7 +14147,7 @@ namespace EnergyPlus::OutputReportTabular { } } - WriteSubtitle(zonesIncludedName); + WriteSubtitle(state, zonesIncludedName); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords( @@ -14189,7 +14162,7 @@ namespace EnergyPlus::OutputReportTabular { } } - void WriteReportHeaders(std::string const &reportName, std::string const &objectName, OutputProcessor::StoreType const averageOrSum) + void WriteReportHeaders(EnergyPlusData &state, std::string const &reportName, std::string const &objectName, OutputProcessor::StoreType const averageOrSum) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -14219,10 +14192,10 @@ namespace EnergyPlus::OutputReportTabular { std::string const modifiedReportName(reportName + (averageOrSum == OutputProcessor::StoreType::Summed ? " per second" : "")); - for (int iStyle = 1; iStyle <= numStyles; ++iStyle) { - std::ostream &tbl_stream(*TabularOutputFile(iStyle)); - std::string const &curDel(del(iStyle)); - auto const style(TableStyle(iStyle)); + for (int iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { + std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); + std::string const &curDel(state.dataOutRptTab->del(iStyle)); + auto const style(state.dataOutRptTab->TableStyle(iStyle)); if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab)) { tbl_stream << "----------------------------------------------------------------------------------------------------\n"; tbl_stream << "REPORT:" << curDel << modifiedReportName << '\n'; @@ -14258,7 +14231,7 @@ namespace EnergyPlus::OutputReportTabular { activeForName = objectName; } - void WriteSubtitle(std::string const &subtitle) + void WriteSubtitle(EnergyPlusData &state, std::string const &subtitle) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -14283,13 +14256,13 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int iStyle; - for (iStyle = 1; iStyle <= numStyles; ++iStyle) { - auto const style(TableStyle(iStyle)); + for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { + auto const style(state.dataOutRptTab->TableStyle(iStyle)); if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab) || (style == iTableStyle::Fixed)) { - std::ostream &tbl_stream(*TabularOutputFile(iStyle)); + std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); tbl_stream << subtitle << "\n\n"; } else if (style == iTableStyle::HTML) { - std::ostream &tbl_stream(*TabularOutputFile(iStyle)); + std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); tbl_stream << "" << subtitle << "

\n"; tbl_stream << "\n"; } else if (style == iTableStyle::XML) { @@ -14300,7 +14273,7 @@ namespace EnergyPlus::OutputReportTabular { } } - void WriteTextLine(std::string const &lineOfText, Optional_bool_const isBold) + void WriteTextLine(EnergyPlusData &state, std::string const &lineOfText, Optional_bool_const isBold) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -14332,20 +14305,20 @@ namespace EnergyPlus::OutputReportTabular { useBold = false; } - for (iStyle = 1; iStyle <= numStyles; ++iStyle) { - auto const style(TableStyle(iStyle)); + for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { + auto const style(state.dataOutRptTab->TableStyle(iStyle)); if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab) || (style == iTableStyle::Fixed)) { - std::ostream &tbl_stream(*TabularOutputFile(iStyle)); + std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); tbl_stream << lineOfText << '\n'; } else if (style == iTableStyle::HTML) { - std::ostream &tbl_stream(*TabularOutputFile(iStyle)); + std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); if (useBold) { tbl_stream << "" << lineOfText << "

\n"; } else { tbl_stream << lineOfText << "
\n"; } } else if (style == iTableStyle::XML) { - std::ostream &tbl_stream(*TabularOutputFile(iStyle)); + std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); if (!lineOfText.empty()) { tbl_stream << "" << lineOfText << "\n"; } @@ -14467,9 +14440,9 @@ namespace EnergyPlus::OutputReportTabular { numColLabelRows = 0; // default value maxNumColLabelRows = 0; - for (iStyle = 1; iStyle <= numStyles; ++iStyle) { - std::ostream &tbl_stream(*TabularOutputFile(iStyle)); - curDel = del(iStyle); + for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { + std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); + curDel = state.dataOutRptTab->del(iStyle); // go through the columns and break them into multiple lines // if bar '|' is found in a row then break into two lines // if longer than the column width break into two lines for fixed style only @@ -14494,7 +14467,7 @@ namespace EnergyPlus::OutputReportTabular { } } // extra preprocessing for fixed style reports - if (TableStyle(iStyle) == iTableStyle::Fixed) { + if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::Fixed) { // break column headings into multiple rows if long (for fixed) or contain two spaces in a row. for (iCol = 1; iCol <= colsColumnLabels; ++iCol) { colWidthLimit = widthColumn(iCol); @@ -14512,7 +14485,7 @@ namespace EnergyPlus::OutputReportTabular { } // output depending on style of format - auto const style(TableStyle(iStyle)); + auto const style(state.dataOutRptTab->TableStyle(iStyle)); if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab)) { // column headers for (jRow = 1; jRow <= maxNumColLabelRows; ++jRow) { @@ -15726,7 +15699,7 @@ namespace EnergyPlus::OutputReportTabular { return int(numDigits); } - void AddTOCEntry(std::string const &nameSection, std::string const &nameReport) + void AddTOCEntry(EnergyPlusData &state, std::string const &nameSection, std::string const &nameReport) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer of GARD Analytics, Inc. @@ -15764,21 +15737,21 @@ namespace EnergyPlus::OutputReportTabular { // na if (!allocated(TOCEntries)) { - TOCEntriesSize = 20; - TOCEntries.allocate(TOCEntriesSize); - TOCEntriesCount = 1; + state.dataOutRptTab->TOCEntriesSize = 20; + TOCEntries.allocate(state.dataOutRptTab->TOCEntriesSize); + state.dataOutRptTab->TOCEntriesCount = 1; } else { - ++TOCEntriesCount; + ++state.dataOutRptTab->TOCEntriesCount; // if larger than current size grow the array - if (TOCEntriesCount > TOCEntriesSize) { - TOCEntries.redimension(TOCEntriesSize += 20); + if (state.dataOutRptTab->TOCEntriesCount > state.dataOutRptTab->TOCEntriesSize) { + TOCEntries.redimension(state.dataOutRptTab->TOCEntriesSize += 20); } } - TOCEntries(TOCEntriesCount).reportName = nameReport; - TOCEntries(TOCEntriesCount).sectionName = nameSection; + TOCEntries(state.dataOutRptTab->TOCEntriesCount).reportName = nameReport; + TOCEntries(state.dataOutRptTab->TOCEntriesCount).sectionName = nameSection; } - void SetupUnitConversions() + void SetupUnitConversions(EnergyPlusData &state) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer of GARD Analytics, Inc. @@ -15811,8 +15784,8 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na - UnitConvSize = 115; - UnitConv.allocate(UnitConvSize); + state.dataOutRptTab->UnitConvSize = 115; + UnitConv.allocate(state.dataOutRptTab->UnitConvSize); UnitConv(1).siName = "%"; UnitConv(2).siName = "°C"; UnitConv(3).siName = "0=OFF 1=ON"; @@ -16331,7 +16304,7 @@ namespace EnergyPlus::OutputReportTabular { int defaultConv = 0; int foundConv = 0; int firstOfSeveral = 0; - for (int iUnit = 1; iUnit <= UnitConvSize; ++iUnit) { + for (int iUnit = 1; iUnit <= state.dataOutRptTab->UnitConvSize; ++iUnit) { if (UtilityRoutines::SameString(UnitConv(iUnit).siName, unitSIOnly)) { if (UnitConv(iUnit).several) { if (firstOfSeveral == 0) firstOfSeveral = iUnit; @@ -16395,7 +16368,7 @@ namespace EnergyPlus::OutputReportTabular { } } - void LookupJtokWH(std::string const &stringInWithJ, int &unitConvIndex, std::string &stringOutWithKWH) + void LookupJtokWH(EnergyPlusData &state, std::string const &stringInWithJ, int &unitConvIndex, std::string &stringOutWithKWH) { // AUTHOR Jason Glazer of GARD Analytics, Inc. // DATE WRITTEN April 15, 2016 @@ -16409,16 +16382,16 @@ namespace EnergyPlus::OutputReportTabular { std::string::size_type mjm2Pos = stringOutWithKWH.find("[MJ/m2]"); if (gjPos != std::string::npos) { stringOutWithKWH.replace(gjPos, 4, "[kWh]"); - unitConvIndex = getSpecificUnitIndex("GJ", "kWh"); + unitConvIndex = getSpecificUnitIndex(state, "GJ", "kWh"); } else if (mjm2Pos != std::string::npos) { stringOutWithKWH.replace(mjm2Pos, 7, "[kWh/m2]"); - unitConvIndex = getSpecificUnitIndex("MJ/m2", "kWh/m2"); + unitConvIndex = getSpecificUnitIndex(state, "MJ/m2", "kWh/m2"); } else { unitConvIndex = 0; } } - Real64 ConvertIP(int const unitConvIndex, Real64 const SIvalue) + Real64 ConvertIP(EnergyPlusData &state, int const unitConvIndex, Real64 const SIvalue) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer of GARD Analytics, Inc. @@ -16458,7 +16431,7 @@ namespace EnergyPlus::OutputReportTabular { // na if (unitConvIndex == 0 || SIvalue == -999.0 || SIvalue == -99999.0) { // don't convert unknown data to IP ConvertIP = SIvalue; - } else if ((unitConvIndex > 0) && (unitConvIndex <= UnitConvSize)) { + } else if ((unitConvIndex > 0) && (unitConvIndex <= state.dataOutRptTab->UnitConvSize)) { ConvertIP = (SIvalue * UnitConv(unitConvIndex).mult) + UnitConv(unitConvIndex).offset; } else { ConvertIP = SIvalue; @@ -16466,7 +16439,7 @@ namespace EnergyPlus::OutputReportTabular { return ConvertIP; } - Real64 ConvertIPdelta(int const unitConvIndex, Real64 const SIvalue) + Real64 ConvertIPdelta(EnergyPlusData &state, int const unitConvIndex, Real64 const SIvalue) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer of GARD Analytics, Inc. @@ -16508,7 +16481,7 @@ namespace EnergyPlus::OutputReportTabular { if (unitConvIndex == 0) { ConvertIPdelta = SIvalue; - } else if ((unitConvIndex > 0) && (unitConvIndex <= UnitConvSize)) { + } else if ((unitConvIndex > 0) && (unitConvIndex <= state.dataOutRptTab->UnitConvSize)) { ConvertIPdelta = SIvalue * UnitConv(unitConvIndex).mult; } else { ConvertIPdelta = SIvalue; @@ -16516,7 +16489,7 @@ namespace EnergyPlus::OutputReportTabular { return ConvertIPdelta; } - void GetUnitConversion(int const unitConvIndex, Real64 &multiplier, Real64 &offset, std::string &IPunit) + void GetUnitConversion(EnergyPlusData &state, int const unitConvIndex, Real64 &multiplier, Real64 &offset, std::string &IPunit) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer of GARD Analytics, Inc. @@ -16553,7 +16526,7 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na - if ((unitConvIndex > 0) && (unitConvIndex <= UnitConvSize)) { + if ((unitConvIndex > 0) && (unitConvIndex <= state.dataOutRptTab->UnitConvSize)) { multiplier = UnitConv(unitConvIndex).mult; offset = UnitConv(unitConvIndex).offset; IPunit = UnitConv(unitConvIndex).ipName; @@ -16609,7 +16582,7 @@ namespace EnergyPlus::OutputReportTabular { static int found(0); static int iUnit(0); - for (iUnit = 1; iUnit <= UnitConvSize; ++iUnit) { + for (iUnit = 1; iUnit <= state.dataOutRptTab->UnitConvSize; ++iUnit) { if (UtilityRoutines::SameString(UnitConv(iUnit).siName, SIunit)) { if (UtilityRoutines::SameString(UnitConv(iUnit).ipName, IPunit)) { found = iUnit; @@ -16682,7 +16655,7 @@ namespace EnergyPlus::OutputReportTabular { return getSpecificUnitDivider; } - Real64 getSpecificUnitIndex(std::string const &SIunit, std::string const &IPunit) + Real64 getSpecificUnitIndex(EnergyPlusData &state, std::string const &SIunit, std::string const &IPunit) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer of GARD Analytics, Inc. @@ -16724,7 +16697,7 @@ namespace EnergyPlus::OutputReportTabular { static int found(0); static int iUnit(0); - for (iUnit = 1; iUnit <= UnitConvSize; ++iUnit) { + for (iUnit = 1; iUnit <= state.dataOutRptTab->UnitConvSize; ++iUnit) { if (UtilityRoutines::SameString(UnitConv(iUnit).siName, SIunit)) { if (UtilityRoutines::SameString(UnitConv(iUnit).ipName, IPunit)) { found = iUnit; diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 8687ec95604..8efdcc67796 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -179,27 +179,9 @@ namespace OutputReportTabular { constexpr int numNamedMonthly(63); // These reports are detailed/named in routine InitializePredefinedMonthlyTitles - extern int TOCEntriesCount; - extern int TOCEntriesSize; - - extern int UnitConvSize; - - extern bool WriteTabularFiles; - // Allow up to five output files to be created constexpr int maxNumStyles(5); - // From Report:Table:Style - extern int numStyles; - extern std::ofstream csv_stream; // CSV table stream - extern std::ofstream tab_stream; // Tab table stream - extern std::ofstream fix_stream; // Fixed table stream - extern std::ofstream htm_stream; // HTML table stream - extern std::ofstream xml_stream; // XML table stream - extern Array1D TabularOutputFile; // Table stream array - extern Array1D_string del; // the delimiter to use - extern Array1D TableStyle; // see list of parameters - extern Real64 timeInYear; // Flags for predefined tabular reports @@ -761,7 +743,7 @@ namespace OutputReportTabular { void OpenOutputTabularFile(EnergyPlusData &state); - void CloseOutputTabularFile(); + void CloseOutputTabularFile(EnergyPlusData &state); void WriteTableOfContents(EnergyPlusData &state); @@ -928,11 +910,11 @@ namespace OutputReportTabular { CompLoadTablesType const &compLoadHeat, int const &zoneOrAirLoopIndex); - void WriteReportHeaders(std::string const &reportName, std::string const &objectName, OutputProcessor::StoreType const averageOrSum); + void WriteReportHeaders(EnergyPlusData &state, std::string const &reportName, std::string const &objectName, OutputProcessor::StoreType const averageOrSum); - void WriteSubtitle(std::string const &subtitle); + void WriteSubtitle(EnergyPlusData &state, std::string const &subtitle); - void WriteTextLine(std::string const &lineOfText, Optional_bool_const isBold = _); + void WriteTextLine(EnergyPlusData &state, std::string const &lineOfText, Optional_bool_const isBold = _); void WriteTable(EnergyPlusData &state, Array2S_string const body, // row,column @@ -1027,27 +1009,27 @@ namespace OutputReportTabular { int digitsAferDecimal(std::string s); - void AddTOCEntry(std::string const &nameSection, std::string const &nameReport); + void AddTOCEntry(EnergyPlusData &state, std::string const &nameSection, std::string const &nameReport); - void SetupUnitConversions(); + void SetupUnitConversions(EnergyPlusData &state); std::string GetUnitSubString(std::string const &inString); // Input String void LookupSItoIP(EnergyPlusData &state, std::string const &stringInWithSI, int &unitConvIndex, std::string &stringOutWithIP); - void LookupJtokWH(std::string const &stringInWithJ, int &unitConvIndex, std::string &stringOutWithKWH); + void LookupJtokWH(EnergyPlusData &state, std::string const &stringInWithJ, int &unitConvIndex, std::string &stringOutWithKWH); - Real64 ConvertIP(int const unitConvIndex, Real64 const SIvalue); + Real64 ConvertIP(EnergyPlusData &state, int const unitConvIndex, Real64 const SIvalue); - Real64 ConvertIPdelta(int const unitConvIndex, Real64 const SIvalue); + Real64 ConvertIPdelta(EnergyPlusData &state, int const unitConvIndex, Real64 const SIvalue); - void GetUnitConversion(int const unitConvIndex, Real64 &multiplier, Real64 &offset, std::string &IPunit); + void GetUnitConversion(EnergyPlusData &state, int const unitConvIndex, Real64 &multiplier, Real64 &offset, std::string &IPunit); Real64 getSpecificUnitMultiplier(EnergyPlusData &state, std::string const &SIunit, std::string const &IPunit); Real64 getSpecificUnitDivider(EnergyPlusData &state, std::string const &SIunit, std::string const &IPunit); - Real64 getSpecificUnitIndex(std::string const &SIunit, std::string const &IPunit); + Real64 getSpecificUnitIndex(EnergyPlusData &state, std::string const &SIunit, std::string const &IPunit); } // namespace OutputReportTabular @@ -1064,6 +1046,22 @@ struct OutputReportTabularData : BaseGlobalStruct { int MonthlyTablesCount = 0; int MonthlyColumnsCount = 0; Array1D_bool IsMonthGathered = Array1D_bool(12, false); // shown as true for any month used + int TOCEntriesCount = 0; + int TOCEntriesSize = 0; + int UnitConvSize = 0; + bool WriteTabularFiles = false; + bool GetInput = true; + + // From Report:Table:Style + int numStyles = 0; + std::ofstream csv_stream; // CSV table stream + std::ofstream tab_stream; // Tab table stream + std::ofstream fix_stream; // Fixed table stream + std::ofstream htm_stream; // HTML table stream + std::ofstream xml_stream; // XML table stream + Array1D TabularOutputFile = Array1D(OutputReportTabular::maxNumStyles, {&csv_stream, &tab_stream, &fix_stream, &htm_stream, &xml_stream}); // Table stream array + Array1D_string del = Array1D_string(OutputReportTabular::maxNumStyles); // the delimiter to use + Array1D TableStyle = Array1D(OutputReportTabular::maxNumStyles, OutputReportTabular::iTableStyle::Unassigned); // see list of parameters void clear_state() override { @@ -1078,6 +1076,16 @@ struct OutputReportTabularData : BaseGlobalStruct { this->MonthlyTablesCount = 0; this->MonthlyColumnsCount = 0; this->IsMonthGathered = Array1D_bool(12, false); + this->TOCEntriesCount = 0; + this->TOCEntriesSize = 0; + this->UnitConvSize = 0; + this->WriteTabularFiles = false; + this->GetInput = true; + this->numStyles = 0; + this->TabularOutputFile = Array1D( + OutputReportTabular::maxNumStyles, {&this->csv_stream, &this->tab_stream, &this->fix_stream, &this->htm_stream, &this->xml_stream}); + this->del = Array1D_string(OutputReportTabular::maxNumStyles); + this->TableStyle = Array1D(OutputReportTabular::maxNumStyles, OutputReportTabular::iTableStyle::Unassigned); } }; diff --git a/src/EnergyPlus/OutputReportTabularAnnual.cc b/src/EnergyPlus/OutputReportTabularAnnual.cc index dad89426610..4212b406023 100644 --- a/src/EnergyPlus/OutputReportTabularAnnual.cc +++ b/src/EnergyPlus/OutputReportTabularAnnual.cc @@ -703,7 +703,7 @@ namespace OutputReportTabularAnnual { if (unitsStyle == OutputReportTabular::iUnitsStyle::InchPound) { varNameWithUnits = fldStIt->m_variMeter + unitEnumToStringBrackets(fldStIt->m_varUnits); OutputReportTabular::LookupSItoIP(state, varNameWithUnits, indexUnitConv, curUnits); - OutputReportTabular::GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + OutputReportTabular::GetUnitConversion(state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); } else { // just do the Joule conversion // if units is in Joules, convert if specified if (fldStIt->m_varUnits == OutputProcessor::Unit::J) { @@ -921,8 +921,8 @@ namespace OutputReportTabularAnnual { curAgg == AnnualFieldSet::AggregationKind::hoursInTenBinsPlusMinusThreeStdDev) { } } // fldStIt - OutputReportTabular::WriteReportHeaders(m_name, "Entire Facility", OutputProcessor::StoreType::Averaged); - OutputReportTabular::WriteSubtitle("Custom Annual Report"); + OutputReportTabular::WriteReportHeaders(state, m_name, "Entire Facility", OutputProcessor::StoreType::Averaged); + OutputReportTabular::WriteSubtitle(state, "Custom Annual Report"); OutputReportTabular::WriteTable(state, tableBody, rowHead, columnHead, columnWidth, true); // transpose annual XML tables. if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, rowHead, columnHead, m_name, "Entire Facility", "Custom Annual Report"); @@ -968,7 +968,7 @@ namespace OutputReportTabularAnnual { tableBodyRange(iBin + 1, 2) = OutputReportTabular::RealToStr(binBottom + float(iBin + 1) * intervalSize, fldStIt->m_showDigits); } - OutputReportTabular::WriteSubtitle("Bin Sizes for: " + fldStIt->m_colHead); + OutputReportTabular::WriteSubtitle(state, "Bin Sizes for: " + fldStIt->m_colHead); OutputReportTabular::WriteTable(state, tableBodyRange, rowHeadRange, colHeadRange, colWidthRange, true); // transpose annual XML tables. if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBodyRange, rowHeadRange, colHeadRange, m_name, "Entire Facility", "Bin Sizes"); @@ -1274,7 +1274,7 @@ namespace OutputReportTabularAnnual { if (unitsStyle == OutputReportTabular::iUnitsStyle::InchPound) { varNameWithUnits = fldStIt->m_variMeter + '[' + unitEnumToString(fldStIt->m_varUnits) + ']'; OutputReportTabular::LookupSItoIP(state, varNameWithUnits, indexUnitConv, curUnits); - OutputReportTabular::GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + OutputReportTabular::GetUnitConversion(state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); } else { // just do the Joule conversion // if units is in Joules, convert if specified if (fldStIt->m_varUnits == OutputProcessor::Unit::J) { diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 466f95c73ba..5556e45d083 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -648,7 +648,7 @@ namespace SimulationManager { ComputeLifeCycleCostAndReport(state); // must be after WriteTabularReports and WriteTabularTariffReports - CloseOutputTabularFile(); + CloseOutputTabularFile(state); DumpAirLoopStatistics(state); // Dump runtime statistics for air loop controller simulation to csv file diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 27826d3369e..446caf2d474 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -201,7 +201,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_unitsFromHeading) Real64 curConversionFactor; Real64 curConversionOffset; - SetupUnitConversions(); + SetupUnitConversions(*state); state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::InchPound; unitString = ""; @@ -217,7 +217,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_unitsFromHeading) // Check a few report column headings too unitString = "Standard Rated Net Cooling Capacity [W]"; indexUnitConv = unitsFromHeading(*state, unitString); - GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + GetUnitConversion(*state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); // We expect W to convert to tons because it's cooling EXPECT_EQ(70, indexUnitConv); EXPECT_EQ("ton", curUnits); @@ -226,7 +226,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_unitsFromHeading) unitString = "Rated Net Cooling Capacity Test A [W]"; indexUnitConv = unitsFromHeading(*state, unitString); - GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + GetUnitConversion(*state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); // We expect W to convert to tons because it's cooling EXPECT_EQ(70, indexUnitConv); EXPECT_EQ("ton", curUnits); @@ -274,11 +274,11 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_GetUnitConversion) Real64 curConversionOffset; std::string varNameWithUnits; - SetupUnitConversions(); + SetupUnitConversions(*state); varNameWithUnits = "ZONE AIR SYSTEM SENSIBLE COOLING RATE[W]"; LookupSItoIP(*state, varNameWithUnits, indexUnitConv, curUnits); - GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + GetUnitConversion(*state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); EXPECT_EQ(70, indexUnitConv); EXPECT_EQ("ton", curUnits); EXPECT_EQ(0.0002843333, curConversionFactor); @@ -286,7 +286,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_GetUnitConversion) varNameWithUnits = "SITE OUTDOOR AIR DRYBULB TEMPERATURE[C]"; LookupSItoIP(*state, varNameWithUnits, indexUnitConv, curUnits); - GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + GetUnitConversion(*state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); EXPECT_EQ(11, indexUnitConv); EXPECT_EQ("F", curUnits); EXPECT_EQ(1.8, curConversionFactor); @@ -294,7 +294,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_GetUnitConversion) varNameWithUnits = "ZONE ELECTRIC EQUIPMENT ELECTRICITY ENERGY[J]"; LookupSItoIP(*state, varNameWithUnits, indexUnitConv, curUnits); - GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + GetUnitConversion(*state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); EXPECT_EQ(20, indexUnitConv); EXPECT_EQ("kWh", curUnits); EXPECT_EQ(0.000000277778, curConversionFactor); @@ -302,7 +302,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_GetUnitConversion) varNameWithUnits = "ZONE COOLING SETPOINT NOT MET TIME[hr]"; LookupSItoIP(*state, varNameWithUnits, indexUnitConv, curUnits); - GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + GetUnitConversion(*state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); EXPECT_EQ(17, indexUnitConv); EXPECT_EQ("hr", curUnits); EXPECT_EQ(1.0, curConversionFactor); @@ -310,7 +310,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_GetUnitConversion) varNameWithUnits = "ZONE LIGHTS TOTAL HEATING ENERGY[Invalid/Undefined]"; LookupSItoIP(*state, varNameWithUnits, indexUnitConv, curUnits); - GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + GetUnitConversion(*state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); EXPECT_EQ(96, indexUnitConv); EXPECT_EQ("Invalid/Undefined", curUnits); EXPECT_EQ(1.0, curConversionFactor); @@ -318,7 +318,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_GetUnitConversion) varNameWithUnits = "FICTIONAL VARIABLE[qqq]"; LookupSItoIP(*state, varNameWithUnits, indexUnitConv, curUnits); - GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + GetUnitConversion(*state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); EXPECT_EQ(0, indexUnitConv); EXPECT_EQ("", curUnits); EXPECT_EQ(1.0, curConversionFactor); @@ -326,7 +326,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_GetUnitConversion) varNameWithUnits = "ZONE PEOPLE OCCUPANT COUNT[]"; LookupSItoIP(*state, varNameWithUnits, indexUnitConv, curUnits); - GetUnitConversion(indexUnitConv, curConversionFactor, curConversionOffset, curUnits); + GetUnitConversion(*state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); EXPECT_EQ(97, indexUnitConv); EXPECT_EQ("", curUnits); EXPECT_EQ(1.0, curConversionFactor); @@ -394,22 +394,22 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_LookupJtokWH) std::string curUnits; std::string varNameWithUnits; - SetupUnitConversions(); + SetupUnitConversions(*state); varNameWithUnits = "ZONE AIR SYSTEM SENSIBLE COOLING RATE[W]"; - LookupJtokWH(varNameWithUnits, indexUnitConv, curUnits); + LookupJtokWH(*state, varNameWithUnits, indexUnitConv, curUnits); EXPECT_EQ(0, indexUnitConv); EXPECT_EQ("ZONE AIR SYSTEM SENSIBLE COOLING RATE[W]", curUnits); varNameWithUnits = "Electricity Energy Use [GJ]"; - LookupJtokWH(varNameWithUnits, indexUnitConv, curUnits); + LookupJtokWH(*state, varNameWithUnits, indexUnitConv, curUnits); EXPECT_EQ(86, indexUnitConv); EXPECT_EQ("Electricity Energy Use [kWh]", curUnits); - varNameWithUnits = "Electricty [MJ/m2]"; - LookupJtokWH(varNameWithUnits, indexUnitConv, curUnits); + varNameWithUnits = "Electricity [MJ/m2]"; + LookupJtokWH(*state, varNameWithUnits, indexUnitConv, curUnits); EXPECT_EQ(95, indexUnitConv); - EXPECT_EQ("Electricty [kWh/m2]", curUnits); + EXPECT_EQ("Electricity [kWh/m2]", curUnits); } TEST_F(EnergyPlusFixture, OutputReportTabularTest_GetColumnUsingTabs) @@ -6713,7 +6713,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_LoadSummaryUnitConversion_test Real64 areaConversion = getSpecificUnitMultiplier(*state, "m2", "ft2"); Real64 airFlowConversion = getSpecificUnitMultiplier(*state, "m3/s", "ft3/min"); Real64 airFlowPerAreaConversion = getSpecificUnitMultiplier(*state, "m3/s-m2", "ft3/min-ft2"); - int tempConvIndx = getSpecificUnitIndex("C", "F"); + int tempConvIndx = getSpecificUnitIndex(*state, "C", "F"); LoadSummaryUnitConversion(*state, compLoad); @@ -6722,7 +6722,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_LoadSummaryUnitConversion_test EXPECT_EQ(5. * areaConversion, compLoad.cells(cArea, rLights)); EXPECT_EQ(5. * areaConversion, compLoad.cells(cArea, rLights)); - EXPECT_EQ(ConvertIP(tempConvIndx, 20.), compLoad.outsideDryBulb); + EXPECT_EQ(ConvertIP(*state, tempConvIndx, 20.), compLoad.outsideDryBulb); EXPECT_EQ(0.7 * airFlowConversion, compLoad.mainFanAirFlow); EXPECT_EQ(0.2 * airFlowPerAreaConversion / powerConversion, compLoad.airflowPerTotCap); EXPECT_EQ(0.15 * powerConversion / areaConversion, compLoad.totCapPerArea); @@ -6918,7 +6918,7 @@ TEST_F(SQLiteFixture, OutputReportTabular_WriteLoadComponentSummaryTables_AirLoo EnergyPlus::sqlite->sqliteBegin(); EnergyPlus::sqlite->createSQLiteSimulationsRecord(1, "EnergyPlus Version", "Current Time"); - OutputReportTabular::SetupUnitConversions(); + OutputReportTabular::SetupUnitConversions(*state); state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::InchPound; // We ask for the air loop component load summary since that's the one we test @@ -7242,9 +7242,9 @@ TEST_F(SQLiteFixture, OutputReportTabularTest_PredefinedTableDXConversion) EnergyPlus::sqlite->sqliteBegin(); EnergyPlus::sqlite->createSQLiteSimulationsRecord(1, "EnergyPlus Version", "Current Time"); - WriteTabularFiles = true; + state->dataOutRptTab->WriteTabularFiles = true; - SetupUnitConversions(); + SetupUnitConversions(*state); state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::InchPound; SetPredefinedTables(*state); @@ -7300,9 +7300,9 @@ TEST_F(SQLiteFixture, OutputReportTabularTest_PredefinedTableCoilHumRat) EnergyPlus::sqlite->sqliteBegin(); EnergyPlus::sqlite->createSQLiteSimulationsRecord(1, "EnergyPlus Version", "Current Time"); - WriteTabularFiles = true; + state->dataOutRptTab->WriteTabularFiles = true; - SetupUnitConversions(); + SetupUnitConversions(*state); state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::InchPound; SetPredefinedTables(*state); @@ -7809,9 +7809,9 @@ TEST_F(SQLiteFixture, OutputReportTabular_EndUseBySubcategorySQL) OutputReportTabular::displayDemandEndUse = true; OutputReportTabular::displayLEEDSummary = true; - OutputReportTabular::WriteTabularFiles = true; + state->dataOutRptTab->WriteTabularFiles = true; - SetupUnitConversions(); + SetupUnitConversions(*state); state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::JtoKWH; // Needed to avoid crash (from ElectricPowerServiceManager.hh) diff --git a/tst/EnergyPlus/unit/WeatherManager.unit.cc b/tst/EnergyPlus/unit/WeatherManager.unit.cc index 2190315c2f6..70c06bd1a3e 100644 --- a/tst/EnergyPlus/unit/WeatherManager.unit.cc +++ b/tst/EnergyPlus/unit/WeatherManager.unit.cc @@ -689,7 +689,7 @@ TEST_F(SQLiteFixture, DesignDay_EnthalphyAtMaxDB) EnergyPlus::sqlite->sqliteBegin(); EnergyPlus::sqlite->createSQLiteSimulationsRecord(1, "EnergyPlus Version", "Current Time"); - OutputReportTabular::WriteTabularFiles = true; + state->dataOutRptTab->WriteTabularFiles = true; OutputReportTabular::displayEioSummary = true; std::string const idf_objects = delimited_string({ From 52394b71a216b002475e2a0c3d1f52ef3cc90f1d Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 18 Dec 2020 17:10:24 -0700 Subject: [PATCH 07/14] moving OutputReportTabular to state --- src/EnergyPlus/EconomicLifeCycleCost.cc | 3 +- src/EnergyPlus/EconomicTariff.cc | 12 +- src/EnergyPlus/HVACManager.cc | 2 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 18 +- src/EnergyPlus/OutputReportTabular.cc | 409 ++++++++---------- src/EnergyPlus/OutputReportTabular.hh | 79 ++-- .../unit/HeatBalanceSurfaceManager.unit.cc | 6 +- .../unit/OutputReportTabular.unit.cc | 30 +- tst/EnergyPlus/unit/WeatherManager.unit.cc | 2 +- 9 files changed, 277 insertions(+), 284 deletions(-) diff --git a/src/EnergyPlus/EconomicLifeCycleCost.cc b/src/EnergyPlus/EconomicLifeCycleCost.cc index f61d17861c8..88e855957ab 100644 --- a/src/EnergyPlus/EconomicLifeCycleCost.cc +++ b/src/EnergyPlus/EconomicLifeCycleCost.cc @@ -2094,7 +2094,6 @@ namespace EconomicLifeCycleCost { using OutputReportTabular::WriteReportHeaders; using OutputReportTabular::WriteSubtitle; using OutputReportTabular::WriteTable; - using OutputReportTabular::displayLifeCycleCostReport; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2126,7 +2125,7 @@ namespace EconomicLifeCycleCost { int numYears; Real64 totalPV; - if (LCCparamPresent && displayLifeCycleCostReport) { + if (LCCparamPresent && state.dataOutRptTab->displayLifeCycleCostReport) { //--------------------------------- // Life-Cycle Cost Verification and Results Report //--------------------------------- diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index b241f8a10e9..12d3121f9ba 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -92,7 +92,6 @@ namespace EnergyPlus::EconomicTariff { using OutputReportTabular::AddTOCEntry; - using OutputReportTabular::displayEconomicResultSummary; bool ErrorsFound(false); @@ -101,7 +100,7 @@ namespace EnergyPlus::EconomicTariff { // do rest of GetInput only if at least one tariff is defined. GetInputEconomicsCurrencyType(state, ErrorsFound); if (state.dataEconTariff->numTariff >= 1) { - if (!ErrorsFound && displayEconomicResultSummary) AddTOCEntry(state, "Economics Results Summary Report", "Entire Facility"); + if (!ErrorsFound && state.dataOutRptTab->displayEconomicResultSummary) AddTOCEntry(state, "Economics Results Summary Report", "Entire Facility"); CreateCategoryNativeVariables(state); GetInputEconomicsQualify(state, ErrorsFound); GetInputEconomicsChargeSimple(state, ErrorsFound); @@ -141,7 +140,6 @@ namespace EnergyPlus::EconomicTariff { using DataGlobalConstants::AssignResourceTypeNum; using OutputReportTabular::AddTOCEntry; - using OutputReportTabular::displayTariffReport; using namespace DataIPShortCuts; std::string const RoutineName("GetInputEconomicsTariff: "); @@ -600,7 +598,7 @@ namespace EnergyPlus::EconomicTariff { tariff(iInObj).isSelected = false; tariff(iInObj).totalAnnualCost = 0.0; // now create the Table Of Contents entries for an HTML file - if (displayTariffReport) { + if (state.dataOutRptTab->displayTariffReport) { AddTOCEntry(state, "Tariff Report", tariff(iInObj).tariffName); } // associate the resource number with each tariff @@ -4025,8 +4023,6 @@ namespace EnergyPlus::EconomicTariff { using OutputReportTabular::buildingGrossFloorArea; using OutputReportTabular::ConvertIP; using OutputReportTabular::DetermineBuildingFloorArea; - using OutputReportTabular::displayEconomicResultSummary; - using OutputReportTabular::displayTariffReport; using OutputReportTabular::LookupSItoIP; using OutputReportTabular::RealToStr; using OutputReportTabular::WriteReportHeaders; @@ -4079,7 +4075,7 @@ namespace EnergyPlus::EconomicTariff { } if (state.dataEconTariff->numTariff > 0) { - if (displayEconomicResultSummary) { + if (state.dataOutRptTab->displayEconomicResultSummary) { DisplayString(state, "Writing Tariff Reports"); for (auto &e : econVar) e.isReported = false; @@ -4213,7 +4209,7 @@ namespace EnergyPlus::EconomicTariff { //--------------------------------- // Tariff Report //--------------------------------- - if (displayTariffReport) { + if (state.dataOutRptTab->displayTariffReport) { for (iTariff = 1; iTariff <= state.dataEconTariff->numTariff; ++iTariff) { WriteReportHeaders(state, "Tariff Report", tariff(iTariff).tariffName, OutputProcessor::StoreType::Averaged); rowHead.allocate(7); diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index 45b6ae588d5..304e7f765ff 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -461,7 +461,7 @@ namespace HVACManager { // Update the plant and condenser loop capacitance model temperature history. UpdateNodeThermalHistory(); - if (OutputReportTabular::displayHeatEmissionsSummary) { + if (state.dataOutRptTab->displayHeatEmissionsSummary) { OutputReportTabular::CalcHeatEmissionReport(state); } diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 0120d62377a..e4ddcbd4c99 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -304,15 +304,15 @@ namespace HeatBalanceSurfaceManager { CalcThermalResilience(state); - if (OutputReportTabular::displayThermalResilienceSummary) { + if (state.dataOutRptTab->displayThermalResilienceSummary) { ReportThermalResilience(state); } - if (OutputReportTabular::displayCO2ResilienceSummary) { + if (state.dataOutRptTab->displayCO2ResilienceSummary) { ReportCO2Resilience(state); } - if (OutputReportTabular::displayVisualResilienceSummary) { + if (state.dataOutRptTab->displayVisualResilienceSummary) { ReportVisualResilience(state); } @@ -5046,7 +5046,7 @@ namespace HeatBalanceSurfaceManager { // Calculate Heat Index and Humidex. // The heat index equation set is fit to Fahrenheit units, so the zone air temperature values are first convert to F, // then heat index is calculated and converted back to C. - if (reportVarHeatIndex || OutputReportTabular::displayThermalResilienceSummary) { + if (reportVarHeatIndex || state.dataOutRptTab->displayThermalResilienceSummary) { for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { Real64 ZoneT = ZTAV(ZoneNum); Real64 ZoneW = ZoneAirHumRatAvg(ZoneNum); @@ -5070,7 +5070,7 @@ namespace HeatBalanceSurfaceManager { ZoneHeatIndex(ZoneNum) = HI; } } - if (reportVarHumidex || OutputReportTabular::displayThermalResilienceSummary) { + if (reportVarHumidex || state.dataOutRptTab->displayThermalResilienceSummary) { for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { Real64 ZoneW = ZoneAirHumRatAvg(ZoneNum); Real64 ZoneT = ZTAV(ZoneNum); @@ -5234,12 +5234,12 @@ namespace HeatBalanceSurfaceManager { } reportCO2ResilienceFirstTime = false; if (!state.dataContaminantBalance->Contaminant.CO2Simulation) { - if (OutputReportTabular::displayCO2ResilienceSummaryExplicitly) { + if (state.dataOutRptTab->displayCO2ResilienceSummaryExplicitly) { ShowWarningError(state, "Writing Annual CO2 Resilience Summary - CO2 Level Hours reports: " "Zone Air CO2 Concentration output is required, " "but no ZoneAirContaminantBalance object is defined."); } - OutputReportTabular::displayCO2ResilienceSummary = false; + state.dataOutRptTab->displayCO2ResilienceSummary = false; return; } } @@ -5283,12 +5283,12 @@ namespace HeatBalanceSurfaceManager { } } if (!hasDayLighting) { - if (OutputReportTabular::displayVisualResilienceSummaryExplicitly) { + if (state.dataOutRptTab->displayVisualResilienceSummaryExplicitly) { ShowWarningError(state, "Writing Annual Visual Resilience Summary - Lighting Level Hours reports: " "Zone Average Daylighting Reference Point Illuminance output is required, " "but no Daylighting Control Object is defined."); } - OutputReportTabular::displayVisualResilienceSummary = false; + state.dataOutRptTab->displayVisualResilienceSummary = false; return; } } diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index b14b2098c67..43f2553f0f3 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -177,33 +177,6 @@ namespace EnergyPlus::OutputReportTabular { // arrays for time binned results - Real64 timeInYear(0.0); - - // Flags for predefined tabular reports - bool displayTabularBEPS(false); - bool displayLEEDSummary(false); - bool displayTabularCompCosts(false); - bool displayTabularVeriSum(false); - bool displayComponentSizing(false); - bool displaySurfaceShadowing(false); - bool displayDemandEndUse(false); - bool displayAdaptiveComfort(false); - bool displaySourceEnergyEndUseSummary(false); - bool displayZoneComponentLoadSummary(false); - bool displayAirLoopComponentLoadSummary(false); - bool displayFacilityComponentLoadSummary(false); - bool displayLifeCycleCostReport(false); - bool displayTariffReport(false); - bool displayEconomicResultSummary(false); - bool displayHeatEmissionsSummary(false); - bool displayEioSummary(false); - bool displayThermalResilienceSummary(false); - bool displayCO2ResilienceSummary(false); - bool displayVisualResilienceSummary(false); - bool displayThermalResilienceSummaryExplicitly(false); - bool displayCO2ResilienceSummaryExplicitly(false); - bool displayVisualResilienceSummaryExplicitly(false); - // BEPS Report Related Variables // From Report:Table:Predefined - BEPS // arrays that hold the meter numbers that are initialized at get input @@ -410,30 +383,30 @@ namespace EnergyPlus::OutputReportTabular { GatherHeatGainReportfirstTime = true; AllocateLoadComponentArraysDoAllocate = true; initAdjFenDone = false; - timeInYear = 0.0; - displayTabularBEPS = false; - displayLEEDSummary = false; - displayTabularCompCosts = false; - displayTabularVeriSum = false; - displayComponentSizing = false; - displaySurfaceShadowing = false; - displayDemandEndUse = false; - displayAdaptiveComfort = false; - displaySourceEnergyEndUseSummary = false; - displayZoneComponentLoadSummary = false; - displayAirLoopComponentLoadSummary = false; - displayFacilityComponentLoadSummary = false; - displayLifeCycleCostReport = false; - displayTariffReport = false; - displayEconomicResultSummary = false; - displayHeatEmissionsSummary = false; - displayThermalResilienceSummary = false; - displayCO2ResilienceSummary = false; - displayVisualResilienceSummary = false; - displayThermalResilienceSummaryExplicitly = false; - displayCO2ResilienceSummaryExplicitly = false; - displayVisualResilienceSummaryExplicitly = false; - displayEioSummary = false; + state.dataOutRptTab->timeInYear = 0.0; + state.dataOutRptTab->displayTabularBEPS = false; + state.dataOutRptTab->displayLEEDSummary = false; + state.dataOutRptTab->displayTabularCompCosts = false; + state.dataOutRptTab->displayTabularVeriSum = false; + state.dataOutRptTab->displayComponentSizing = false; + state.dataOutRptTab->displaySurfaceShadowing = false; + state.dataOutRptTab->displayDemandEndUse = false; + state.dataOutRptTab->displayAdaptiveComfort = false; + state.dataOutRptTab->displaySourceEnergyEndUseSummary = false; + state.dataOutRptTab->displayZoneComponentLoadSummary = false; + state.dataOutRptTab->displayAirLoopComponentLoadSummary = false; + state.dataOutRptTab->displayFacilityComponentLoadSummary = false; + state.dataOutRptTab->displayLifeCycleCostReport = false; + state.dataOutRptTab->displayTariffReport = false; + state.dataOutRptTab->displayEconomicResultSummary = false; + state.dataOutRptTab->displayHeatEmissionsSummary = false; + state.dataOutRptTab->displayThermalResilienceSummary = false; + state.dataOutRptTab->displayCO2ResilienceSummary = false; + state.dataOutRptTab->displayVisualResilienceSummary = false; + state.dataOutRptTab->displayThermalResilienceSummaryExplicitly = false; + state.dataOutRptTab->displayCO2ResilienceSummaryExplicitly = false; + state.dataOutRptTab->displayVisualResilienceSummaryExplicitly = false; + state.dataOutRptTab->displayEioSummary = false; meterNumTotalsBEPS = Array1D_int(numResourceTypes, 0); meterNumTotalsSource = Array1D_int(numSourceTypes, 0); fuelfactorsused = Array1D_bool(numSourceTypes, false); @@ -1427,7 +1400,7 @@ namespace EnergyPlus::OutputReportTabular { AlphArray.allocate(NumAlphas); NumArray.dimension(NumNums, 0.0); - timeInYear = 0.0; // intialize the time in year counter + state.dataOutRptTab->timeInYear = 0.0; // intialize the time in year counter // determine size of array that holds the IDF description state.dataOutRptTab->OutputTableBinnedCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); OutputTableBinned.allocate(state.dataOutRptTab->OutputTableBinnedCount); @@ -1841,7 +1814,7 @@ namespace EnergyPlus::OutputReportTabular { // get the object inputProcessor->getObjectItem(state, CurrentModuleObject, 1, AlphArray, NumAlphas, NumArray, NumNums, IOStat); // default all report flags to false (do not get produced) - displayTabularBEPS = false; + state.dataOutRptTab->displayTabularBEPS = false; // initialize the names of the predefined monthly report titles InitializePredefinedMonthlyTitles(state); // loop through the fields looking for matching report titles @@ -1850,82 +1823,82 @@ namespace EnergyPlus::OutputReportTabular { if (AlphArray(iReport).empty()) { ShowFatalError(state, "Blank report name in Output:Table:SummaryReports"); } else if (UtilityRoutines::SameString(AlphArray(iReport), "AnnualBuildingUtilityPerformanceSummary")) { - displayTabularBEPS = true; + state.dataOutRptTab->displayTabularBEPS = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ComponentCostEconomicsSummary")) { - displayTabularCompCosts = true; + state.dataOutRptTab->displayTabularCompCosts = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "InputVerificationandResultsSummary")) { - displayTabularVeriSum = true; + state.dataOutRptTab->displayTabularVeriSum = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ComponentSizingSummary")) { - displayComponentSizing = true; + state.dataOutRptTab->displayComponentSizing = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "SurfaceShadowingSummary")) { - displaySurfaceShadowing = true; + state.dataOutRptTab->displaySurfaceShadowing = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "DemandEndUseComponentsSummary")) { - displayDemandEndUse = true; + state.dataOutRptTab->displayDemandEndUse = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AdaptiveComfortSummary")) { - displayAdaptiveComfort = true; + state.dataOutRptTab->displayAdaptiveComfort = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "SourceEnergyEndUseComponentsSummary")) { - displaySourceEnergyEndUseSummary = true; + state.dataOutRptTab->displaySourceEnergyEndUseSummary = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ZoneComponentLoadSummary")) { - displayZoneComponentLoadSummary = true; + state.dataOutRptTab->displayZoneComponentLoadSummary = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AirLoopComponentLoadSummary")) { - displayAirLoopComponentLoadSummary = true; + state.dataOutRptTab->displayAirLoopComponentLoadSummary = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "FacilityComponentLoadSummary")) { - displayFacilityComponentLoadSummary = true; + state.dataOutRptTab->displayFacilityComponentLoadSummary = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "LEEDSummary")) { - displayLEEDSummary = true; + state.dataOutRptTab->displayLEEDSummary = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "LifeCycleCostReport")) { - displayLifeCycleCostReport = true; + state.dataOutRptTab->displayLifeCycleCostReport = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "TariffReport")) { - displayTariffReport = true; + state.dataOutRptTab->displayTariffReport = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "EconomicResultSummary")) { - displayEconomicResultSummary = true; + state.dataOutRptTab->displayEconomicResultSummary = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "HeatEmissionsSummary")) { - displayHeatEmissionsSummary = true; + state.dataOutRptTab->displayHeatEmissionsSummary = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ThermalResilienceSummary")) { - displayThermalResilienceSummary = true; - displayThermalResilienceSummaryExplicitly = true; + state.dataOutRptTab->displayThermalResilienceSummary = true; + state.dataOutRptTab->displayThermalResilienceSummaryExplicitly = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "CO2ResilienceSummary")) { - displayCO2ResilienceSummary = true; - displayCO2ResilienceSummaryExplicitly = true; + state.dataOutRptTab->displayCO2ResilienceSummary = true; + state.dataOutRptTab->displayCO2ResilienceSummaryExplicitly = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "VisualResilienceSummary")) { - displayVisualResilienceSummary = true; - displayVisualResilienceSummaryExplicitly = true; + state.dataOutRptTab->displayVisualResilienceSummary = true; + state.dataOutRptTab->displayVisualResilienceSummaryExplicitly = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "EnergyMeters")) { @@ -1933,58 +1906,58 @@ namespace EnergyPlus::OutputReportTabular { nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "InitializationSummary")) { state.dataOutRptTab->WriteTabularFiles = true; - displayEioSummary = true; + state.dataOutRptTab->displayEioSummary = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummary")) { state.dataOutRptTab->WriteTabularFiles = true; - displayTabularBEPS = true; - displayTabularVeriSum = true; - displayTabularCompCosts = true; - displaySurfaceShadowing = true; - displayComponentSizing = true; - displayDemandEndUse = true; - displayAdaptiveComfort = true; - displaySourceEnergyEndUseSummary = true; - displayLifeCycleCostReport = true; - displayTariffReport = true; - displayEconomicResultSummary = true; - displayEioSummary = true; - displayLEEDSummary = true; - displayHeatEmissionsSummary = true; - displayThermalResilienceSummary = true; - displayCO2ResilienceSummary = true; - displayVisualResilienceSummary = true; + state.dataOutRptTab->displayTabularBEPS = true; + state.dataOutRptTab->displayTabularVeriSum = true; + state.dataOutRptTab->displayTabularCompCosts = true; + state.dataOutRptTab->displaySurfaceShadowing = true; + state.dataOutRptTab->displayComponentSizing = true; + state.dataOutRptTab->displayDemandEndUse = true; + state.dataOutRptTab->displayAdaptiveComfort = true; + state.dataOutRptTab->displaySourceEnergyEndUseSummary = true; + state.dataOutRptTab->displayLifeCycleCostReport = true; + state.dataOutRptTab->displayTariffReport = true; + state.dataOutRptTab->displayEconomicResultSummary = true; + state.dataOutRptTab->displayEioSummary = true; + state.dataOutRptTab->displayLEEDSummary = true; + state.dataOutRptTab->displayHeatEmissionsSummary = true; + state.dataOutRptTab->displayThermalResilienceSummary = true; + state.dataOutRptTab->displayCO2ResilienceSummary = true; + state.dataOutRptTab->displayVisualResilienceSummary = true; nameFound = true; for (jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { state.dataOutRptPredefined->reportName(jReport).show = true; } } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryAndSizingPeriod")) { state.dataOutRptTab->WriteTabularFiles = true; - displayTabularBEPS = true; - displayTabularVeriSum = true; - displayTabularCompCosts = true; - displaySurfaceShadowing = true; - displayComponentSizing = true; - displayDemandEndUse = true; - displayAdaptiveComfort = true; - displaySourceEnergyEndUseSummary = true; - displayLifeCycleCostReport = true; - displayTariffReport = true; - displayEconomicResultSummary = true; - displayEioSummary = true; - displayLEEDSummary = true; - displayHeatEmissionsSummary = true; - displayThermalResilienceSummary = true; - displayCO2ResilienceSummary = true; - displayVisualResilienceSummary = true; + state.dataOutRptTab->displayTabularBEPS = true; + state.dataOutRptTab->displayTabularVeriSum = true; + state.dataOutRptTab->displayTabularCompCosts = true; + state.dataOutRptTab->displaySurfaceShadowing = true; + state.dataOutRptTab->displayComponentSizing = true; + state.dataOutRptTab->displayDemandEndUse = true; + state.dataOutRptTab->displayAdaptiveComfort = true; + state.dataOutRptTab->displaySourceEnergyEndUseSummary = true; + state.dataOutRptTab->displayLifeCycleCostReport = true; + state.dataOutRptTab->displayTariffReport = true; + state.dataOutRptTab->displayEconomicResultSummary = true; + state.dataOutRptTab->displayEioSummary = true; + state.dataOutRptTab->displayLEEDSummary = true; + state.dataOutRptTab->displayHeatEmissionsSummary = true; + state.dataOutRptTab->displayThermalResilienceSummary = true; + state.dataOutRptTab->displayCO2ResilienceSummary = true; + state.dataOutRptTab->displayVisualResilienceSummary = true; nameFound = true; for (jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { state.dataOutRptPredefined->reportName(jReport).show = true; } // the sizing period reports - displayZoneComponentLoadSummary = true; - displayAirLoopComponentLoadSummary = true; - displayFacilityComponentLoadSummary = true; + state.dataOutRptTab->displayZoneComponentLoadSummary = true; + state.dataOutRptTab->displayAirLoopComponentLoadSummary = true; + state.dataOutRptTab->displayFacilityComponentLoadSummary = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllMonthly")) { state.dataOutRptTab->WriteTabularFiles = true; for (jReport = 1; jReport <= numNamedMonthly; ++jReport) { @@ -1993,23 +1966,23 @@ namespace EnergyPlus::OutputReportTabular { nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryAndMonthly")) { state.dataOutRptTab->WriteTabularFiles = true; - displayTabularBEPS = true; - displayTabularVeriSum = true; - displayTabularCompCosts = true; - displaySurfaceShadowing = true; - displayComponentSizing = true; - displayDemandEndUse = true; - displayAdaptiveComfort = true; - displaySourceEnergyEndUseSummary = true; - displayLifeCycleCostReport = true; - displayTariffReport = true; - displayEconomicResultSummary = true; - displayEioSummary = true; - displayLEEDSummary = true; - displayHeatEmissionsSummary = true; - displayThermalResilienceSummary = true; - displayCO2ResilienceSummary = true; - displayVisualResilienceSummary = true; + state.dataOutRptTab->displayTabularBEPS = true; + state.dataOutRptTab->displayTabularVeriSum = true; + state.dataOutRptTab->displayTabularCompCosts = true; + state.dataOutRptTab->displaySurfaceShadowing = true; + state.dataOutRptTab->displayComponentSizing = true; + state.dataOutRptTab->displayDemandEndUse = true; + state.dataOutRptTab->displayAdaptiveComfort = true; + state.dataOutRptTab->displaySourceEnergyEndUseSummary = true; + state.dataOutRptTab->displayLifeCycleCostReport = true; + state.dataOutRptTab->displayTariffReport = true; + state.dataOutRptTab->displayEconomicResultSummary = true; + state.dataOutRptTab->displayEioSummary = true; + state.dataOutRptTab->displayLEEDSummary = true; + state.dataOutRptTab->displayHeatEmissionsSummary = true; + state.dataOutRptTab->displayThermalResilienceSummary = true; + state.dataOutRptTab->displayCO2ResilienceSummary = true; + state.dataOutRptTab->displayVisualResilienceSummary = true; nameFound = true; for (jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { state.dataOutRptPredefined->reportName(jReport).show = true; @@ -2019,23 +1992,23 @@ namespace EnergyPlus::OutputReportTabular { } } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryMonthlyAndSizingPeriod")) { state.dataOutRptTab->WriteTabularFiles = true; - displayTabularBEPS = true; - displayTabularVeriSum = true; - displayTabularCompCosts = true; - displaySurfaceShadowing = true; - displayComponentSizing = true; - displayDemandEndUse = true; - displayAdaptiveComfort = true; - displaySourceEnergyEndUseSummary = true; - displayLifeCycleCostReport = true; - displayTariffReport = true; - displayEconomicResultSummary = true; - displayEioSummary = true; - displayLEEDSummary = true; - displayHeatEmissionsSummary = true; - displayThermalResilienceSummary = true; - displayCO2ResilienceSummary = true; - displayVisualResilienceSummary = true; + state.dataOutRptTab->displayTabularBEPS = true; + state.dataOutRptTab->displayTabularVeriSum = true; + state.dataOutRptTab->displayTabularCompCosts = true; + state.dataOutRptTab->displaySurfaceShadowing = true; + state.dataOutRptTab->displayComponentSizing = true; + state.dataOutRptTab->displayDemandEndUse = true; + state.dataOutRptTab->displayAdaptiveComfort = true; + state.dataOutRptTab->displaySourceEnergyEndUseSummary = true; + state.dataOutRptTab->displayLifeCycleCostReport = true; + state.dataOutRptTab->displayTariffReport = true; + state.dataOutRptTab->displayEconomicResultSummary = true; + state.dataOutRptTab->displayEioSummary = true; + state.dataOutRptTab->displayLEEDSummary = true; + state.dataOutRptTab->displayHeatEmissionsSummary = true; + state.dataOutRptTab->displayThermalResilienceSummary = true; + state.dataOutRptTab->displayCO2ResilienceSummary = true; + state.dataOutRptTab->displayVisualResilienceSummary = true; nameFound = true; for (jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { state.dataOutRptPredefined->reportName(jReport).show = true; @@ -2044,9 +2017,9 @@ namespace EnergyPlus::OutputReportTabular { namedMonthly(jReport).show = true; } // the sizing period reports - displayZoneComponentLoadSummary = true; - displayAirLoopComponentLoadSummary = true; - displayFacilityComponentLoadSummary = true; + state.dataOutRptTab->displayZoneComponentLoadSummary = true; + state.dataOutRptTab->displayAirLoopComponentLoadSummary = true; + state.dataOutRptTab->displayFacilityComponentLoadSummary = true; } // check the reports that are predefined and are created by OutputReportPredefined for (jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { @@ -2086,7 +2059,7 @@ namespace EnergyPlus::OutputReportTabular { ShowFatalError(state, CurrentModuleObject + ": Preceding errors cause termination."); } // if the BEPS report has been called for than initialize its arrays - if (displayTabularBEPS || displayDemandEndUse || displaySourceEnergyEndUseSummary || displayLEEDSummary) { + if (state.dataOutRptTab->displayTabularBEPS || state.dataOutRptTab->displayDemandEndUse || state.dataOutRptTab->displaySourceEnergyEndUseSummary || state.dataOutRptTab->displayLEEDSummary) { // initialize the resource type names resourceTypeNames(1) = "Electricity"; resourceTypeNames(2) = "NaturalGas"; @@ -3614,7 +3587,7 @@ namespace EnergyPlus::OutputReportTabular { int indexUnitConv; // normally do not add to the table of contents here but the order of calls is different for the life-cycle costs - if (displayLifeCycleCostReport && LCCparamPresent) { + if (state.dataOutRptTab->displayLifeCycleCostReport && LCCparamPresent) { AddTOCEntry(state, "Life-Cycle Cost Report", "Entire Facility"); } @@ -3625,19 +3598,19 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << "
\n"; tbl_stream << "

Table of Contents

\n"; tbl_stream << "Top\n"; - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { tbl_stream << "
Annual Building Utility Performance Summary\n"; } - if (displayTabularVeriSum) { + if (state.dataOutRptTab->displayTabularVeriSum) { tbl_stream << "
Input Verification and Results Summary\n"; } - if (displayDemandEndUse) { + if (state.dataOutRptTab->displayDemandEndUse) { tbl_stream << "
Demand End Use Components Summary\n"; } - if (displaySourceEnergyEndUseSummary) { + if (state.dataOutRptTab->displaySourceEnergyEndUseSummary) { tbl_stream << "
Source Energy End Use Components Summary\n"; } @@ -3645,22 +3618,22 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << "
Component Cost Economics Summary\n"; } - if (displayComponentSizing) { + if (state.dataOutRptTab->displayComponentSizing) { tbl_stream << "
Component Sizing Summary\n"; } - if (displaySurfaceShadowing) { + if (state.dataOutRptTab->displaySurfaceShadowing) { tbl_stream << "
Surface Shadowing Summary\n"; } - if (displayAdaptiveComfort) { + if (state.dataOutRptTab->displayAdaptiveComfort) { tbl_stream << "
Adaptive Comfort Summary\n"; } - if (displayEioSummary) { + if (state.dataOutRptTab->displayEioSummary) { tbl_stream << "
Initialization Summary\n"; } - if (displayHeatEmissionsSummary) { + if (state.dataOutRptTab->displayHeatEmissionsSummary) { tbl_stream << "
Annual Heat Emissions Summary\n"; } @@ -3802,7 +3775,7 @@ namespace EnergyPlus::OutputReportTabular { if (!state.dataGlobal->DoWeathSim) return; elapsedTime = TimeStepSys; - timeInYear += elapsedTime; + state.dataOutRptTab->timeInYear += elapsedTime; for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { // get values of array for current object being referenced curIntervalStart = OutputTableBinned(iInObj).intervalStart; @@ -4297,7 +4270,7 @@ namespace EnergyPlus::OutputReportTabular { // if no beps report is called then skip - if ((displayTabularBEPS || displayLEEDSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { + if ((state.dataOutRptTab->displayTabularBEPS || state.dataOutRptTab->displayLEEDSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // add the current time to the total elapsed time // FOLLOWING LINE MOVED TO UPDATETABULARREPORTS because used even when beps is not called // gatherElapsedTimeBEPS = gatherElapsedTimeBEPS + TimeStepZone @@ -4456,7 +4429,7 @@ namespace EnergyPlus::OutputReportTabular { // if no beps by source report is called then skip - if ((displaySourceEnergyEndUseSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { + if ((state.dataOutRptTab->displaySourceEnergyEndUseSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { @@ -4577,7 +4550,7 @@ namespace EnergyPlus::OutputReportTabular { int timestepTimeStamp; assert(state.dataGlobal->TimeStepZoneSec > 0.0); - if ((displayDemandEndUse) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { + if ((state.dataOutRptTab->displayDemandEndUse) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { curMeterNumber = meterNumTotalsBEPS(iResource); @@ -4613,7 +4586,7 @@ namespace EnergyPlus::OutputReportTabular { } // gather the peak demands of each individual enduse subcategory for the LEED report - if ((displayLEEDSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { + if ((state.dataOutRptTab->displayLEEDSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { @@ -4658,7 +4631,7 @@ namespace EnergyPlus::OutputReportTabular { SysTotalHVACReliefHeatLoss = 0; SysTotalHVACRejectHeatLoss = 0; - if (!displayHeatEmissionsSummary) return; // don't gather data if report isn't requested + if (!state.dataOutRptTab->displayHeatEmissionsSummary) return; // don't gather data if report isn't requested // Only gather zone report at zone time steps if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { @@ -5519,9 +5492,9 @@ namespace EnergyPlus::OutputReportTabular { WriteLoadComponentSummaryTables(state); WriteHeatEmissionTable(state); - if (displayThermalResilienceSummary) WriteThermalResilienceTables(state); - if (displayCO2ResilienceSummary) WriteCO2ResilienceTables(state); - if (displayVisualResilienceSummary) WriteVisualResilienceTables(state); + if (state.dataOutRptTab->displayThermalResilienceSummary) WriteThermalResilienceTables(state); + if (state.dataOutRptTab->displayCO2ResilienceSummary) WriteCO2ResilienceTables(state); + if (state.dataOutRptTab->displayVisualResilienceSummary) WriteVisualResilienceTables(state); coilSelectionReportObj->finishCoilSummaryReportTable(state); // call to write out the coil selection summary table data WritePredefinedTables(state); // moved to come after zone load components is finished @@ -7356,9 +7329,9 @@ namespace EnergyPlus::OutputReportTabular { static Real64 leedSiteTotal(0.0); Real64 unconvert; - if (displayTabularBEPS || displayLEEDSummary) { + if (state.dataOutRptTab->displayTabularBEPS || state.dataOutRptTab->displayLEEDSummary) { // show the headers of the report - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteReportHeaders(state, "Annual Building Utility Performance Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // show the number of hours that the table applies to WriteTextLine(state, "Values gathered over " + RealToStr(gatherElapsedTimeBEPS, 2) + " hours", true); @@ -7734,7 +7707,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteSubtitle(state, "Site and Source Energy"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -7884,7 +7857,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteSubtitle(state, "Site to Source Energy Conversion Factors"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -7939,7 +7912,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 3) = RealToStr(convBldgGrossFloorArea - convBldgCondFloorArea, 2); // heading for the entire sub-table - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteSubtitle(state, "Building Area"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -8195,7 +8168,7 @@ namespace EnergyPlus::OutputReportTabular { } } // heading for the entire sub-table - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteSubtitle(state, "End Uses"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth, false, footnote); if (sqlite) { @@ -8348,7 +8321,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteSubtitle(state, "End Uses By Subcategory"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); @@ -8527,7 +8500,7 @@ namespace EnergyPlus::OutputReportTabular { } } // heading for the entire sub-table - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteSubtitle(state, "Utility Use Per Conditioned Floor Area"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -8557,7 +8530,7 @@ namespace EnergyPlus::OutputReportTabular { } } // heading for the entire sub-table - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteSubtitle(state, "Utility Use Per Total Floor Area"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -8649,7 +8622,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteSubtitle(state, "Electric Loads Satisfied"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -8725,7 +8698,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteSubtitle(state, "On-Site Thermal Sources"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -8820,7 +8793,7 @@ namespace EnergyPlus::OutputReportTabular { } // ! heading for the entire sub-table - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteSubtitle(state, "Water Source Summary"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -8834,7 +8807,7 @@ namespace EnergyPlus::OutputReportTabular { } //---- Comfort and Setpoint Not Met Sub-Table - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { rowHead.allocate(2); columnHead.allocate(1); columnWidth.allocate(1); @@ -8882,7 +8855,7 @@ namespace EnergyPlus::OutputReportTabular { columnWidth = 14; // array assignment - same for all columns tableBody.allocate(1, 3); - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteSubtitle(state, "Comfort and Setpoint Not Met Summary"); } @@ -8899,7 +8872,7 @@ namespace EnergyPlus::OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedAmData, "Number of hours not met", RealToStr(state.dataOutRptPredefined->TotalNotMetOccupiedForABUPS, 2)); tableBody(1, 3) = RealToStr(state.dataOutRptPredefined->TotalTimeNotSimpleASH55EitherForABUPS, 2); - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -8922,7 +8895,7 @@ namespace EnergyPlus::OutputReportTabular { //---- Control Summary Sub-Table //---- End Notes - if (displayTabularBEPS) { + if (state.dataOutRptTab->displayTabularBEPS) { WriteTextLine(state, "Note 1: An asterisk (*) indicates that the feature is not yet implemented."); } // CALL WriteTextLine('Note 2: The source energy conversion factors used are: ') @@ -8970,7 +8943,7 @@ namespace EnergyPlus::OutputReportTabular { Real64 largeConversionFactor; Real64 areaConversionFactor; - if (displaySourceEnergyEndUseSummary) { + if (state.dataOutRptTab->displaySourceEnergyEndUseSummary) { // show the headers of the report WriteReportHeaders(state, "Source Energy End Use Components Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // show the number of hours that the table applies to @@ -9323,7 +9296,7 @@ namespace EnergyPlus::OutputReportTabular { Real64 unconvert; std::string subCatName; - if (displayDemandEndUse) { + if (state.dataOutRptTab->displayDemandEndUse) { // show the headers of the report WriteReportHeaders(state, "Demand End Use Components Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // totals - select which additional fuel to display and which other district heating @@ -10193,7 +10166,7 @@ namespace EnergyPlus::OutputReportTabular { zoneGlassArea = 0.0; // all arrays are in the format: (row, columnm) - if (displayTabularVeriSum) { + if (state.dataOutRptTab->displayTabularVeriSum) { // show the headers of the report WriteReportHeaders(state, "Input Verification and Results Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); @@ -10896,7 +10869,7 @@ namespace EnergyPlus::OutputReportTabular { // Should deallocate after writing table. - LKL - if (displayAdaptiveComfort && TotPeople > 0) { + if (state.dataOutRptTab->displayAdaptiveComfort && TotPeople > 0) { peopleInd.allocate(TotPeople); for (i = 1; i <= TotPeople; ++i) { @@ -11051,7 +11024,7 @@ namespace EnergyPlus::OutputReportTabular { bool hasPierceSET = true; if (TotPeople == 0) { hasPierceSET = false; - if (displayThermalResilienceSummaryExplicitly) { + if (state.dataOutRptTab->displayThermalResilienceSummaryExplicitly) { ShowWarningError(state, "Writing Annual Thermal Resilience Summary - SET Hours reports: " "Zone Thermal Comfort Pierce Model Standard Effective Temperature is required, " "but no People object is defined."); @@ -11060,7 +11033,7 @@ namespace EnergyPlus::OutputReportTabular { for (int iPeople = 1; iPeople <= TotPeople; ++iPeople) { if (!People(iPeople).Pierce) { hasPierceSET = false; - if (displayThermalResilienceSummaryExplicitly) { + if (state.dataOutRptTab->displayThermalResilienceSummaryExplicitly) { ShowWarningError(state, "Writing Annual Thermal Resilience Summary - SET Hours reports: " "Zone Thermal Comfort Pierce Model Standard Effective Temperature is required, " "but no Pierce model is defined in " + People(iPeople).Name + " object."); @@ -11114,7 +11087,7 @@ namespace EnergyPlus::OutputReportTabular { for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { if (state.dataDaylightingData->ZoneDaylight(ZoneNum).DaylightMethod == DataDaylighting::iDaylightingMethod::NoDaylighting) { - if (displayVisualResilienceSummaryExplicitly) { + if (state.dataOutRptTab->displayVisualResilienceSummaryExplicitly) { ShowWarningError(state, "Writing Annual Visual Resilience Summary - Lighting Level Hours reports: " "Zone Average Daylighting Reference Point Illuminance output is required, " "but no Daylight Method is defined in Zone:" + Zone(ZoneNum).Name); @@ -11146,7 +11119,7 @@ namespace EnergyPlus::OutputReportTabular { Array1D_string rowHead; Array2D_string tableBody; - if (displayHeatEmissionsSummary) { + if (state.dataOutRptTab->displayHeatEmissionsSummary) { WriteReportHeaders(state, "Annual Heat Emissions Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); WriteSubtitle(state, "Heat Emission by Components"); @@ -11448,7 +11421,7 @@ namespace EnergyPlus::OutputReportTabular { static Real64 curValueSI(0.0); static Real64 curValue(0.0); - if (displayComponentSizing) { + if (state.dataOutRptTab->displayComponentSizing) { WriteReportHeaders(state, "Component Sizing Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // The arrays that look for unique headers are dimensioned in the // running program since the size of the number of entries is @@ -11683,7 +11656,7 @@ namespace EnergyPlus::OutputReportTabular { int NGSS; // displaySurfaceShadowing = false for debugging - if (displaySurfaceShadowing) { + if (state.dataOutRptTab->displaySurfaceShadowing) { numreceivingfields = 0; for (HTS = 1; HTS <= TotSurfaces; ++HTS) { numreceivingfields += ShadowComb(HTS).NumGenSurf; @@ -11798,7 +11771,7 @@ namespace EnergyPlus::OutputReportTabular { void WriteEioTables(EnergyPlusData &state) { - if (displayEioSummary) { + if (state.dataOutRptTab->displayEioSummary) { Array1D_string columnHead; Array1D_int columnWidth; Array1D_string rowHead; @@ -11975,18 +11948,18 @@ namespace EnergyPlus::OutputReportTabular { int iZone; if (state.dataGlobal->CompLoadReportIsReq) { - if (displayZoneComponentLoadSummary) { + if (state.dataOutRptTab->displayZoneComponentLoadSummary) { for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { if (!ZoneEquipConfig(iZone).IsControlled) continue; AddTOCEntry(state, "Zone Component Load Summary", Zone(iZone).Name); } } - if (displayAirLoopComponentLoadSummary) { + if (state.dataOutRptTab->displayAirLoopComponentLoadSummary) { for (int AirLoopNum = 1; AirLoopNum <= DataHVACGlobals::NumPrimaryAirSys; ++AirLoopNum) { AddTOCEntry(state, "AirLoop Component Load Summary", DataSizing::FinalSysSizing(AirLoopNum).AirPriLoopName); } } - if (displayFacilityComponentLoadSummary) { + if (state.dataOutRptTab->displayFacilityComponentLoadSummary) { AddTOCEntry(state, "Facility Component Load Summary", "Facility"); } } @@ -12511,7 +12484,7 @@ namespace EnergyPlus::OutputReportTabular { using DataSurfaces::TotSurfaces; using DataZoneEquipment::ZoneEquipConfig; - if (!((displayZoneComponentLoadSummary || displayAirLoopComponentLoadSummary || displayFacilityComponentLoadSummary) && state.dataGlobal->CompLoadReportIsReq)) + if (!((state.dataOutRptTab->displayZoneComponentLoadSummary || state.dataOutRptTab->displayAirLoopComponentLoadSummary || state.dataOutRptTab->displayFacilityComponentLoadSummary) && state.dataGlobal->CompLoadReportIsReq)) return; int coolDesSelected; @@ -12582,7 +12555,7 @@ namespace EnergyPlus::OutputReportTabular { CompLoadTablesType curCompLoadTable; // active component load table // initialize arrays - if (displayZoneComponentLoadSummary) { + if (state.dataOutRptTab->displayZoneComponentLoadSummary) { ZoneHeatCompLoadTables.allocate(state.dataGlobal->NumOfZones); for (auto &e : ZoneHeatCompLoadTables) { e.cells.allocate(cPerArea, rGrdTot); @@ -12598,7 +12571,7 @@ namespace EnergyPlus::OutputReportTabular { e.cellUsed = false; } } - if (displayAirLoopComponentLoadSummary) { + if (state.dataOutRptTab->displayAirLoopComponentLoadSummary) { AirLoopHeatCompLoadTables.allocate(NumPrimaryAirSys); for (auto &e : AirLoopHeatCompLoadTables) { e.cells.allocate(cPerArea, rGrdTot); @@ -12632,7 +12605,7 @@ namespace EnergyPlus::OutputReportTabular { e.cellUsed = false; } } - if (displayFacilityComponentLoadSummary) { + if (state.dataOutRptTab->displayFacilityComponentLoadSummary) { FacilityHeatCompLoadTables.cells.allocate(cPerArea, rGrdTot); FacilityHeatCompLoadTables.cells = 0.; FacilityHeatCompLoadTables.cellUsed.allocate(cPerArea, rGrdTot); @@ -12665,7 +12638,7 @@ namespace EnergyPlus::OutputReportTabular { GetZoneComponentAreas(state, ZoneComponentAreas); // ZoneComponentLoadSummary - if (displayZoneComponentLoadSummary) { + if (state.dataOutRptTab->displayZoneComponentLoadSummary) { for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { if (!ZoneEquipConfig(iZone).IsControlled) continue; if (allocated(CalcFinalZoneSizing)) { @@ -12757,7 +12730,7 @@ namespace EnergyPlus::OutputReportTabular { } // AirLoopComponentLoadSummary - if (displayAirLoopComponentLoadSummary && NumPrimaryAirSys > 0) { + if (state.dataOutRptTab->displayAirLoopComponentLoadSummary && NumPrimaryAirSys > 0) { Array1D_int zoneToAirLoopCool; zoneToAirLoopCool.dimension(state.dataGlobal->NumOfZones); Array1D_int zoneToAirLoopHeat; @@ -12822,7 +12795,7 @@ namespace EnergyPlus::OutputReportTabular { for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { if (!ZoneEquipConfig(iZone).IsControlled) continue; // The ZoneCoolCompLoadTables already hasn't gotten a potential IP conversion yet, so we won't convert it twice. - if (displayZoneComponentLoadSummary && + if (state.dataOutRptTab->displayZoneComponentLoadSummary && (AirLoopZonesCoolCompLoadTables(iZone).desDayNum == ZoneCoolCompLoadTables(iZone).desDayNum) && (AirLoopZonesCoolCompLoadTables(iZone).timeStepMax == ZoneCoolCompLoadTables(iZone).timeStepMax)) { AirLoopZonesCoolCompLoadTables(iZone) = ZoneCoolCompLoadTables(iZone); @@ -12859,7 +12832,7 @@ namespace EnergyPlus::OutputReportTabular { CollectPeakZoneConditions(state, AirLoopZonesCoolCompLoadTables(iZone), coolDesSelected, timeCoolMax, iZone, true); AddAreaColumnForZone(iZone, ZoneComponentAreas, AirLoopZonesCoolCompLoadTables(iZone)); } - if (displayZoneComponentLoadSummary && + if (state.dataOutRptTab->displayZoneComponentLoadSummary && (AirLoopZonesHeatCompLoadTables(iZone).desDayNum == ZoneHeatCompLoadTables(iZone).desDayNum) && (AirLoopZonesHeatCompLoadTables(iZone).timeStepMax == ZoneHeatCompLoadTables(iZone).timeStepMax)) { AirLoopZonesHeatCompLoadTables(iZone) = ZoneHeatCompLoadTables(iZone); @@ -12932,7 +12905,7 @@ namespace EnergyPlus::OutputReportTabular { } // FacilityComponentLoadSummary - if (displayFacilityComponentLoadSummary) { + if (state.dataOutRptTab->displayFacilityComponentLoadSummary) { coolDesSelected = CalcFinalFacilitySizing.CoolDDNum; timeCoolMax = CalcFinalFacilitySizing.TimeStepNumAtCoolMax; @@ -12945,7 +12918,7 @@ namespace EnergyPlus::OutputReportTabular { mult = Zone(iZone).Multiplier * Zone(iZone).ListMultiplier; if (mult == 0.0) mult = 1.0; // The ZoneCoolCompLoadTables already hasn't gotten a potential IP conversion yet, so we won't convert it twice. - if (displayZoneComponentLoadSummary && (coolDesSelected == ZoneCoolCompLoadTables(iZone).desDayNum) && + if (state.dataOutRptTab->displayZoneComponentLoadSummary && (coolDesSelected == ZoneCoolCompLoadTables(iZone).desDayNum) && (timeCoolMax == ZoneCoolCompLoadTables(iZone).timeStepMax)) { FacilityZonesCoolCompLoadTables(iZone) = ZoneCoolCompLoadTables(iZone); } else { @@ -12982,7 +12955,7 @@ namespace EnergyPlus::OutputReportTabular { FacilityZonesCoolCompLoadTables(iZone).desDayNum = coolDesSelected; CombineLoadCompResults(FacilityCoolCompLoadTables, FacilityZonesCoolCompLoadTables(iZone), mult); - if (displayZoneComponentLoadSummary && (heatDesSelected == ZoneHeatCompLoadTables(iZone).desDayNum) && + if (state.dataOutRptTab->displayZoneComponentLoadSummary && (heatDesSelected == ZoneHeatCompLoadTables(iZone).desDayNum) && (timeHeatMax == ZoneHeatCompLoadTables(iZone).timeStepMax)) { FacilityZonesHeatCompLoadTables(iZone) = ZoneHeatCompLoadTables(iZone); } else { @@ -13036,7 +13009,7 @@ namespace EnergyPlus::OutputReportTabular { } // ZoneComponentLoadSummary: Now we convert and Display - if (displayZoneComponentLoadSummary) { + if (state.dataOutRptTab->displayZoneComponentLoadSummary) { for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { if (!ZoneEquipConfig(iZone).IsControlled) continue; if (allocated(CalcFinalZoneSizing)) { @@ -13882,15 +13855,15 @@ namespace EnergyPlus::OutputReportTabular { std::string reportName; std::string zoneAirLoopFacilityName; - if (kind == iOutputType::zoneOutput && displayZoneComponentLoadSummary) { + if (kind == iOutputType::zoneOutput && state.dataOutRptTab->displayZoneComponentLoadSummary) { reportName = "Zone Component Load Summary"; zoneAirLoopFacilityName = Zone(zoneOrAirLoopIndex).Name; writeOutput = true; - } else if (kind == iOutputType::airLoopOutput && displayAirLoopComponentLoadSummary) { + } else if (kind == iOutputType::airLoopOutput && state.dataOutRptTab->displayAirLoopComponentLoadSummary) { reportName = "AirLoop Component Load Summary"; zoneAirLoopFacilityName = DataSizing::FinalSysSizing(zoneOrAirLoopIndex).AirPriLoopName; writeOutput = true; - } else if (kind == iOutputType::facilityOutput && displayFacilityComponentLoadSummary) { + } else if (kind == iOutputType::facilityOutput && state.dataOutRptTab->displayFacilityComponentLoadSummary) { reportName = "Facility Component Load Summary"; zoneAirLoopFacilityName = "Facility"; writeOutput = true; @@ -15095,7 +15068,7 @@ namespace EnergyPlus::OutputReportTabular { ResetRemainingPredefinedEntries(state); ThermalComfort::ResetThermalComfortSimpleASH55(state); ThermalComfort::ResetSetPointMet(state); - ResetAdaptiveComfort(); + ResetAdaptiveComfort(state); state.dataOutputProcessor->isFinalYear = true; } @@ -15361,7 +15334,7 @@ namespace EnergyPlus::OutputReportTabular { } } - void ResetAdaptiveComfort() + void ResetAdaptiveComfort(EnergyPlusData &state) { // Jason Glazer - October 2015 // Reset accumulation variable for adaptive comfort report to zero for multi-year simulations @@ -15369,7 +15342,7 @@ namespace EnergyPlus::OutputReportTabular { using DataHeatBalance::People; using DataHeatBalance::TotPeople; int i; - if (displayAdaptiveComfort && TotPeople > 0) { + if (state.dataOutRptTab->displayAdaptiveComfort && TotPeople > 0) { for (i = 1; i <= TotPeople; ++i) { if (People(i).AdaptiveASH55) { People(i).TimeNotMetASH5590 = 0.; diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 8efdcc67796..65e165e9766 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -182,32 +182,6 @@ namespace OutputReportTabular { // Allow up to five output files to be created constexpr int maxNumStyles(5); - extern Real64 timeInYear; - - // Flags for predefined tabular reports - extern bool displayTabularBEPS; - extern bool displayLEEDSummary; - extern bool displayTabularCompCosts; // added BTG 5/6/04 for component cost summary - extern bool displayTabularVeriSum; // added JG 2006-06-28 for input verification and summary report - extern bool displayComponentSizing; - extern bool displaySurfaceShadowing; - extern bool displayDemandEndUse; - extern bool displayAdaptiveComfort; - extern bool displaySourceEnergyEndUseSummary; - extern bool displayZoneComponentLoadSummary; - extern bool displayAirLoopComponentLoadSummary; - extern bool displayFacilityComponentLoadSummary; - extern bool displayLifeCycleCostReport; - extern bool displayTariffReport; - extern bool displayEconomicResultSummary; - extern bool displayHeatEmissionsSummary; - extern bool displayEioSummary; - extern bool displayThermalResilienceSummary; - extern bool displayCO2ResilienceSummary; - extern bool displayVisualResilienceSummary; - extern bool displayThermalResilienceSummaryExplicitly; - extern bool displayCO2ResilienceSummaryExplicitly; - extern bool displayVisualResilienceSummaryExplicitly; // BEPS Report Related Variables // From Report:Table:Predefined - BEPS // arrays that hold the meter numbers that are initialized at get input @@ -967,7 +941,7 @@ namespace OutputReportTabular { void ResetRemainingPredefinedEntries(EnergyPlusData &state); - void ResetAdaptiveComfort(); + void ResetAdaptiveComfort(EnergyPlusData &state); //====================================================================================================================== //====================================================================================================================== @@ -1063,6 +1037,33 @@ struct OutputReportTabularData : BaseGlobalStruct { Array1D_string del = Array1D_string(OutputReportTabular::maxNumStyles); // the delimiter to use Array1D TableStyle = Array1D(OutputReportTabular::maxNumStyles, OutputReportTabular::iTableStyle::Unassigned); // see list of parameters + Real64 timeInYear = 0.0; + + // Flags for predefined tabular reports + bool displayTabularBEPS = false; + bool displayLEEDSummary = false; + bool displayTabularCompCosts = false; + bool displayTabularVeriSum = false; + bool displayComponentSizing = false; + bool displaySurfaceShadowing = false; + bool displayDemandEndUse = false; + bool displayAdaptiveComfort = false; + bool displaySourceEnergyEndUseSummary = false; + bool displayZoneComponentLoadSummary = false; + bool displayAirLoopComponentLoadSummary = false; + bool displayFacilityComponentLoadSummary = false; + bool displayLifeCycleCostReport = false; + bool displayTariffReport = false; + bool displayEconomicResultSummary = false; + bool displayHeatEmissionsSummary = false; + bool displayEioSummary = false; + bool displayThermalResilienceSummary = false; + bool displayCO2ResilienceSummary = false; + bool displayVisualResilienceSummary = false; + bool displayThermalResilienceSummaryExplicitly = false; + bool displayCO2ResilienceSummaryExplicitly = false; + bool displayVisualResilienceSummaryExplicitly = false; + void clear_state() override { this->unitsStyle = OutputReportTabular::iUnitsStyle::None; @@ -1086,6 +1087,30 @@ struct OutputReportTabularData : BaseGlobalStruct { OutputReportTabular::maxNumStyles, {&this->csv_stream, &this->tab_stream, &this->fix_stream, &this->htm_stream, &this->xml_stream}); this->del = Array1D_string(OutputReportTabular::maxNumStyles); this->TableStyle = Array1D(OutputReportTabular::maxNumStyles, OutputReportTabular::iTableStyle::Unassigned); + this->timeInYear = 0.0; + this->displayTabularBEPS = false; + this->displayLEEDSummary = false; + this->displayTabularCompCosts = false; + this->displayTabularVeriSum = false; + this->displayComponentSizing = false; + this->displaySurfaceShadowing = false; + this->displayDemandEndUse = false; + this->displayAdaptiveComfort = false; + this->displaySourceEnergyEndUseSummary = false; + this->displayZoneComponentLoadSummary = false; + this->displayAirLoopComponentLoadSummary = false; + this->displayFacilityComponentLoadSummary = false; + this->displayLifeCycleCostReport = false; + this->displayTariffReport = false; + this->displayEconomicResultSummary = false; + this->displayHeatEmissionsSummary = false; + this->displayEioSummary = false; + this->displayThermalResilienceSummary = false; + this->displayCO2ResilienceSummary = false; + this->displayVisualResilienceSummary = false; + this->displayThermalResilienceSummaryExplicitly = false; + this->displayCO2ResilienceSummaryExplicitly = false; + this->displayVisualResilienceSummaryExplicitly = false; } }; diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 97cd830a4f6..fbb98072fa8 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -2616,7 +2616,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) state->dataGlobal->NumOfZones = 1; state->dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::RunPeriodWeather; - OutputReportTabular::displayThermalResilienceSummary = true; + state->dataOutRptTab->displayThermalResilienceSummary = true; state->dataEnvrn->Month = 7; state->dataEnvrn->DayOfMonth = 1; @@ -2754,7 +2754,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) state->dataContaminantBalance->ZoneAirCO2Avg.allocate(state->dataGlobal->NumOfZones); state->dataContaminantBalance->Contaminant.CO2Simulation = true; ScheduleManager::Schedule(1).CurrentValue = 1; - OutputReportTabular::displayCO2ResilienceSummary = true; + state->dataOutRptTab->displayCO2ResilienceSummary = true; state->dataContaminantBalance->ZoneAirCO2Avg(1) = 1100; ReportCO2Resilience(*state); EXPECT_EQ(1, DataHeatBalFanSys::ZoneCO2LevelHourBins(1)[1]); @@ -2769,7 +2769,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) state->dataDaylightingData->ZoneDaylight(1).ZonePowerReductionFactor = 0.5; state->dataDaylightingData->ZoneDaylight(1).DaylIllumAtRefPt(1) = 300; state->dataDaylightingData->ZoneDaylight(1).IllumSetPoint(1) = 400; - OutputReportTabular::displayVisualResilienceSummary = true; + state->dataOutRptTab->displayVisualResilienceSummary = true; ReportVisualResilience(*state); EXPECT_EQ(1, DataHeatBalFanSys::ZoneLightingLevelHourBins(1)[2]); diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 446caf2d474..7ffd617acab 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -3564,7 +3564,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_ConfirmResetBEPSGathering) state->dataGlobal->DoWeathSim = true; state->dataGlobal->TimeStepZone = 1.0; state->dataGlobal->TimeStepZoneSec = state->dataGlobal->TimeStepZone * 60.0; - displayTabularBEPS = true; + state->dataOutRptTab->displayTabularBEPS = true; // OutputProcessor::TimeValue.allocate(2); auto timeStep = 1.0; @@ -3610,8 +3610,8 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) { // Glazer - Sep 2017 - displayDemandEndUse = true; - displayLEEDSummary = true; + state->dataOutRptTab->displayDemandEndUse = true; + state->dataOutRptTab->displayLEEDSummary = true; state->dataGlobal->TimeStepZoneSec = 900.0; int resourceNum = 1; @@ -3713,7 +3713,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) TEST_F(EnergyPlusFixture, OutputReportTabular_GatherHeatEmissionReport) { - displayHeatEmissionsSummary = true; + state->dataOutRptTab->displayHeatEmissionsSummary = true; state->dataGlobal->DoWeathSim = true; DataHVACGlobals::TimeStepSys = 10.0; state->dataEnvrn->OutHumRat = 0.005; @@ -6048,7 +6048,7 @@ TEST_F(SQLiteFixture, WriteVeriSumTableAreasTest) EnergyPlus::sqlite->sqliteBegin(); EnergyPlus::sqlite->createSQLiteSimulationsRecord(1, "EnergyPlus Version", "Current Time"); - displayTabularVeriSum = true; + state->dataOutRptTab->displayTabularVeriSum = true; state->dataEnvrn->Latitude = 12.3; state->dataEnvrn->Longitude = 45.6; @@ -6158,7 +6158,7 @@ TEST_F(SQLiteFixture, WriteVeriSumTable_TestNotPartOfTotal) EnergyPlus::sqlite->sqliteBegin(); EnergyPlus::sqlite->createSQLiteSimulationsRecord(1, "EnergyPlus Version", "Current Time"); - displayTabularVeriSum = true; + state->dataOutRptTab->displayTabularVeriSum = true; state->dataEnvrn->Latitude = 12.3; state->dataEnvrn->Longitude = 45.6; @@ -6891,7 +6891,7 @@ TEST_F(SQLiteFixture, OutputReportTabular_WriteLoadComponentSummaryTables_AirLoo int numDesDays = 2; state->dataAirLoop->AirToZoneNodeInfo.allocate(DataHVACGlobals::NumPrimaryAirSys); state->dataGlobal->NumOfZones = 0; - displayAirLoopComponentLoadSummary = true; + state->dataOutRptTab->displayAirLoopComponentLoadSummary = true; state->dataGlobal->CompLoadReportIsReq = true; SysSizPeakDDNum(DataHVACGlobals::NumPrimaryAirSys).TimeStepAtTotCoolPk.allocate(numDesDays); @@ -6923,9 +6923,9 @@ TEST_F(SQLiteFixture, OutputReportTabular_WriteLoadComponentSummaryTables_AirLoo // We ask for the air loop component load summary since that's the one we test // We also ask for the zone component load summary because that's necessary to "copy" the load and trigger a potential double conversion - OutputReportTabular::displayAirLoopComponentLoadSummary = true; - OutputReportTabular::displayZoneComponentLoadSummary = true; - OutputReportTabular::displayFacilityComponentLoadSummary = true; + state->dataOutRptTab->displayAirLoopComponentLoadSummary = true; + state->dataOutRptTab->displayZoneComponentLoadSummary = true; + state->dataOutRptTab->displayFacilityComponentLoadSummary = true; state->dataGlobal->CompLoadReportIsReq = true; @@ -7624,7 +7624,7 @@ TEST_F(SQLiteFixture, WriteSourceEnergyEndUseSummary_TestPerArea) { EnergyPlus::sqlite->sqliteBegin(); EnergyPlus::sqlite->createSQLiteSimulationsRecord(1, "EnergyPlus Version", "Current Time"); - OutputReportTabular::displaySourceEnergyEndUseSummary = true; + state->dataOutRptTab->displaySourceEnergyEndUseSummary = true; // DetermineBuildingFloorArea @@ -7805,9 +7805,9 @@ TEST_F(SQLiteFixture, OutputReportTabular_EndUseBySubcategorySQL) EnergyPlus::sqlite->sqliteBegin(); EnergyPlus::sqlite->createSQLiteSimulationsRecord(1, "EnergyPlus Version", "Current Time"); - OutputReportTabular::displayTabularBEPS = true; - OutputReportTabular::displayDemandEndUse = true; - OutputReportTabular::displayLEEDSummary = true; + state->dataOutRptTab->displayTabularBEPS = true; + state->dataOutRptTab->displayDemandEndUse = true; + state->dataOutRptTab->displayLEEDSummary = true; state->dataOutRptTab->WriteTabularFiles = true; @@ -7887,7 +7887,7 @@ TEST_F(SQLiteFixture, OutputReportTabular_EndUseBySubcategorySQL) state->dataGlobal->DoWeathSim = true; state->dataGlobal->TimeStepZone = 1.0; state->dataGlobal->TimeStepZoneSec = state->dataGlobal->TimeStepZone * 60.0; - displayTabularBEPS = true; + state->dataOutRptTab->displayTabularBEPS = true; // OutputProcessor::TimeValue.allocate(2); auto timeStep = 1.0; diff --git a/tst/EnergyPlus/unit/WeatherManager.unit.cc b/tst/EnergyPlus/unit/WeatherManager.unit.cc index 70c06bd1a3e..5f2cf5824cd 100644 --- a/tst/EnergyPlus/unit/WeatherManager.unit.cc +++ b/tst/EnergyPlus/unit/WeatherManager.unit.cc @@ -690,7 +690,7 @@ TEST_F(SQLiteFixture, DesignDay_EnthalphyAtMaxDB) EnergyPlus::sqlite->createSQLiteSimulationsRecord(1, "EnergyPlus Version", "Current Time"); state->dataOutRptTab->WriteTabularFiles = true; - OutputReportTabular::displayEioSummary = true; + state->dataOutRptTab->displayEioSummary = true; std::string const idf_objects = delimited_string({ From 67029f415208596f559cface64867dba00ce5914 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 18 Dec 2020 19:58:51 -0700 Subject: [PATCH 08/14] moving OutputReportTabular to state --- src/EnergyPlus/OutputReportTabular.cc | 962 ++++++++---------- src/EnergyPlus/OutputReportTabular.hh | 97 +- .../unit/OutputReportTabular.unit.cc | 104 +- 3 files changed, 557 insertions(+), 606 deletions(-) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 43f2553f0f3..e3aa6f7d3dd 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -177,39 +177,6 @@ namespace EnergyPlus::OutputReportTabular { // arrays for time binned results - // BEPS Report Related Variables - // From Report:Table:Predefined - BEPS - // arrays that hold the meter numbers that are initialized at get input - Array1D_int meterNumTotalsBEPS(numResourceTypes, 0); - Array1D_int meterNumTotalsSource(numSourceTypes, 0); - Array1D_bool fuelfactorsused(numSourceTypes, false); - Array1D_bool ffUsed(numResourceTypes, false); - Array1D SourceFactors(numResourceTypes, 0.0); - Array1D_bool ffSchedUsed(numResourceTypes, false); - Array1D_int ffSchedIndex(numResourceTypes, 0); - Array2D_int meterNumEndUseBEPS(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0); - Array3D_int meterNumEndUseSubBEPS; - // arrays that hold the names of the resource and end uses - Array1D_string resourceTypeNames(numResourceTypes); - Array1D_string sourceTypeNames(numSourceTypes); - Array1D_string endUseNames(DataGlobalConstants::iEndUse.size()); - // arrays that hold the actual values for the year - Array1D gatherTotalsBEPS(numResourceTypes, 0.0); - Array1D gatherTotalsBySourceBEPS(numResourceTypes, 0.0); - Array1D gatherTotalsSource(numSourceTypes, 0.0); - Array1D gatherTotalsBySource(numSourceTypes, 0.0); - Array2D gatherEndUseBEPS(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); - Array2D gatherEndUseBySourceBEPS(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); - Array3D gatherEndUseSubBEPS; - Array1D_bool needOtherRowLEED45(DataGlobalConstants::iEndUse.size()); - - // arrays the hold the demand values - Array1D gatherDemandTotal(numResourceTypes, 0.0); - Array2D gatherDemandEndUse(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); - Array2D gatherDemandIndEndUse(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); - Array3D gatherDemandEndUseSub; - Array3D gatherDemandIndEndUseSub; - Array1D_int gatherDemandTimeStamp(numResourceTypes, 0); // to keep track of hours for the BEPS report gathering Real64 gatherElapsedTimeBEPS(0.0); // for normalization of results @@ -217,7 +184,7 @@ namespace EnergyPlus::OutputReportTabular { Real64 buildingConditionedFloorArea(0.0); // keep track if schedules are used in fuel factors bool fuelFactorSchedulesUsed(false); - // for electic load components on BEPS report + // for electric load components on BEPS report int meterNumPowerFuelFireGen(0); Real64 gatherPowerFuelFireGen(0.0); int meterNumPowerPV(0); @@ -383,51 +350,6 @@ namespace EnergyPlus::OutputReportTabular { GatherHeatGainReportfirstTime = true; AllocateLoadComponentArraysDoAllocate = true; initAdjFenDone = false; - state.dataOutRptTab->timeInYear = 0.0; - state.dataOutRptTab->displayTabularBEPS = false; - state.dataOutRptTab->displayLEEDSummary = false; - state.dataOutRptTab->displayTabularCompCosts = false; - state.dataOutRptTab->displayTabularVeriSum = false; - state.dataOutRptTab->displayComponentSizing = false; - state.dataOutRptTab->displaySurfaceShadowing = false; - state.dataOutRptTab->displayDemandEndUse = false; - state.dataOutRptTab->displayAdaptiveComfort = false; - state.dataOutRptTab->displaySourceEnergyEndUseSummary = false; - state.dataOutRptTab->displayZoneComponentLoadSummary = false; - state.dataOutRptTab->displayAirLoopComponentLoadSummary = false; - state.dataOutRptTab->displayFacilityComponentLoadSummary = false; - state.dataOutRptTab->displayLifeCycleCostReport = false; - state.dataOutRptTab->displayTariffReport = false; - state.dataOutRptTab->displayEconomicResultSummary = false; - state.dataOutRptTab->displayHeatEmissionsSummary = false; - state.dataOutRptTab->displayThermalResilienceSummary = false; - state.dataOutRptTab->displayCO2ResilienceSummary = false; - state.dataOutRptTab->displayVisualResilienceSummary = false; - state.dataOutRptTab->displayThermalResilienceSummaryExplicitly = false; - state.dataOutRptTab->displayCO2ResilienceSummaryExplicitly = false; - state.dataOutRptTab->displayVisualResilienceSummaryExplicitly = false; - state.dataOutRptTab->displayEioSummary = false; - meterNumTotalsBEPS = Array1D_int(numResourceTypes, 0); - meterNumTotalsSource = Array1D_int(numSourceTypes, 0); - fuelfactorsused = Array1D_bool(numSourceTypes, false); - ffUsed = Array1D_bool(numResourceTypes, false); - SourceFactors = Array1D(numResourceTypes, 0.0); - ffSchedUsed = Array1D_bool(numResourceTypes, false); - ffSchedIndex = Array1D_int(numResourceTypes, 0); - meterNumEndUseBEPS = Array2D_int(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0); - meterNumEndUseSubBEPS.deallocate(); - gatherTotalsBEPS = Array1D(numResourceTypes, 0.0); - gatherTotalsBySourceBEPS = Array1D(numResourceTypes, 0.0); - gatherTotalsSource = Array1D(numSourceTypes, 0.0); - gatherTotalsBySource = Array1D(numSourceTypes, 0.0); - gatherEndUseBEPS = Array2D(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); - gatherEndUseBySourceBEPS = Array2D(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); - gatherEndUseSubBEPS.deallocate(); - gatherDemandTotal = Array1D(numResourceTypes, 0.0); - gatherDemandEndUse = Array2D(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); - gatherDemandEndUseSub.deallocate(); - gatherDemandIndEndUseSub.deallocate(); - gatherDemandTimeStamp = Array1D_int(numResourceTypes, 0); gatherElapsedTimeBEPS = 0.0; buildingGrossFloorArea = 0.0; buildingConditionedFloorArea = 0.0; @@ -2061,93 +1983,93 @@ namespace EnergyPlus::OutputReportTabular { // if the BEPS report has been called for than initialize its arrays if (state.dataOutRptTab->displayTabularBEPS || state.dataOutRptTab->displayDemandEndUse || state.dataOutRptTab->displaySourceEnergyEndUseSummary || state.dataOutRptTab->displayLEEDSummary) { // initialize the resource type names - resourceTypeNames(1) = "Electricity"; - resourceTypeNames(2) = "NaturalGas"; - resourceTypeNames(3) = "DistrictCooling"; - resourceTypeNames(4) = "DistrictHeating"; - resourceTypeNames(5) = "Steam"; - resourceTypeNames(6) = "Gasoline"; - resourceTypeNames(7) = "Water"; - resourceTypeNames(8) = "Diesel"; - resourceTypeNames(9) = "Coal"; - resourceTypeNames(10) = "FuelOilNo1"; - resourceTypeNames(11) = "FuelOilNo2"; - resourceTypeNames(12) = "Propane"; - resourceTypeNames(13) = "OtherFuel1"; - resourceTypeNames(14) = "OtherFuel2"; - - sourceTypeNames(1) = "Electricity"; - sourceTypeNames(2) = "NaturalGas"; - sourceTypeNames(3) = "Gasoline"; - sourceTypeNames(4) = "Diesel"; - sourceTypeNames(5) = "Coal"; - sourceTypeNames(6) = "FuelOilNo1"; - sourceTypeNames(7) = "FuelOilNo2"; - sourceTypeNames(8) = "Propane"; - sourceTypeNames(9) = "PurchasedElectric"; - sourceTypeNames(10) = "SoldElectric"; - sourceTypeNames(11) = "OtherFuel1"; - sourceTypeNames(12) = "OtherFuel2"; + state.dataOutRptTab->resourceTypeNames(1) = "Electricity"; + state.dataOutRptTab->resourceTypeNames(2) = "NaturalGas"; + state.dataOutRptTab->resourceTypeNames(3) = "DistrictCooling"; + state.dataOutRptTab->resourceTypeNames(4) = "DistrictHeating"; + state.dataOutRptTab->resourceTypeNames(5) = "Steam"; + state.dataOutRptTab->resourceTypeNames(6) = "Gasoline"; + state.dataOutRptTab->resourceTypeNames(7) = "Water"; + state.dataOutRptTab->resourceTypeNames(8) = "Diesel"; + state.dataOutRptTab->resourceTypeNames(9) = "Coal"; + state.dataOutRptTab->resourceTypeNames(10) = "FuelOilNo1"; + state.dataOutRptTab->resourceTypeNames(11) = "FuelOilNo2"; + state.dataOutRptTab->resourceTypeNames(12) = "Propane"; + state.dataOutRptTab->resourceTypeNames(13) = "OtherFuel1"; + state.dataOutRptTab->resourceTypeNames(14) = "OtherFuel2"; + + state.dataOutRptTab->sourceTypeNames(1) = "Electricity"; + state.dataOutRptTab->sourceTypeNames(2) = "NaturalGas"; + state.dataOutRptTab->sourceTypeNames(3) = "Gasoline"; + state.dataOutRptTab->sourceTypeNames(4) = "Diesel"; + state.dataOutRptTab->sourceTypeNames(5) = "Coal"; + state.dataOutRptTab->sourceTypeNames(6) = "FuelOilNo1"; + state.dataOutRptTab->sourceTypeNames(7) = "FuelOilNo2"; + state.dataOutRptTab->sourceTypeNames(8) = "Propane"; + state.dataOutRptTab->sourceTypeNames(9) = "PurchasedElectric"; + state.dataOutRptTab->sourceTypeNames(10) = "SoldElectric"; + state.dataOutRptTab->sourceTypeNames(11) = "OtherFuel1"; + state.dataOutRptTab->sourceTypeNames(12) = "OtherFuel2"; // initialize the end use names - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)) = "Heating"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cooling)) = "Cooling"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorLights)) = "InteriorLights"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)) = "ExteriorLights"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorEquipment)) = "InteriorEquipment"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorEquipment)) = "ExteriorEquipment"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Fans)) = "Fans"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Pumps)) = "Pumps"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRejection)) = "HeatRejection"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Humidification)) = "Humidifier"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRecovery)) = "HeatRecovery"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::WaterSystem)) = "WaterSystems"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Refrigeration)) = "Refrigeration"; - endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cogeneration)) = "Cogeneration"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)) = "Heating"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cooling)) = "Cooling"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorLights)) = "InteriorLights"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)) = "ExteriorLights"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorEquipment)) = "InteriorEquipment"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorEquipment)) = "ExteriorEquipment"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Fans)) = "Fans"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Pumps)) = "Pumps"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRejection)) = "HeatRejection"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Humidification)) = "Humidifier"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRecovery)) = "HeatRecovery"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::WaterSystem)) = "WaterSystems"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Refrigeration)) = "Refrigeration"; + state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cogeneration)) = "Cogeneration"; // End use subs must be dynamically allocated to accomodate the end use with the most subcategories - meterNumEndUseSubBEPS.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); - meterNumEndUseSubBEPS = 0; + state.dataOutRptTab->meterNumEndUseSubBEPS.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); + state.dataOutRptTab->meterNumEndUseSubBEPS = 0; // loop through all of the resources and end uses and sub end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { - meterName = resourceTypeNames(iResource) + ":FACILITY"; + meterName = state.dataOutRptTab->resourceTypeNames(iResource) + ":FACILITY"; meterNumber = GetMeterIndex(state, meterName); - meterNumTotalsBEPS(iResource) = meterNumber; + state.dataOutRptTab->meterNumTotalsBEPS(iResource) = meterNumber; for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - meterName = endUseNames(jEndUse) + ':' + resourceTypeNames(iResource); //// ':FACILITY' + meterName = state.dataOutRptTab->endUseNames(jEndUse) + ':' + state.dataOutRptTab->resourceTypeNames(iResource); //// ':FACILITY' meterNumber = GetMeterIndex(state, meterName); - meterNumEndUseBEPS(iResource, jEndUse) = meterNumber; + state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse) = meterNumber; for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { meterName = - state.dataOutputProcessor->EndUseCategory(jEndUse).SubcategoryName(kEndUseSub) + ':' + endUseNames(jEndUse) + ':' + resourceTypeNames(iResource); + state.dataOutputProcessor->EndUseCategory(jEndUse).SubcategoryName(kEndUseSub) + ':' + state.dataOutRptTab->endUseNames(jEndUse) + ':' + state.dataOutRptTab->resourceTypeNames(iResource); meterNumber = GetMeterIndex(state, meterName); - meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource) = meterNumber; + state.dataOutRptTab->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource) = meterNumber; } } } for (iResource = 1; iResource <= numSourceTypes; ++iResource) { - meterNumber = GetMeterIndex(state, sourceTypeNames(iResource) + "Emissions:Source"); - meterNumTotalsSource(iResource) = meterNumber; + meterNumber = GetMeterIndex(state, state.dataOutRptTab->sourceTypeNames(iResource) + "Emissions:Source"); + state.dataOutRptTab->meterNumTotalsSource(iResource) = meterNumber; } // initialize the gathering arrays to zero - gatherTotalsBEPS = 0.0; - gatherTotalsBySourceBEPS = 0.0; - gatherTotalsSource = 0.0; - gatherTotalsBySource = 0.0; - gatherEndUseBEPS = 0.0; - gatherEndUseBySourceBEPS = 0.0; + state.dataOutRptTab->gatherTotalsBEPS = 0.0; + state.dataOutRptTab->gatherTotalsBySourceBEPS = 0.0; + state.dataOutRptTab->gatherTotalsSource = 0.0; + state.dataOutRptTab->gatherTotalsBySource = 0.0; + state.dataOutRptTab->gatherEndUseBEPS = 0.0; + state.dataOutRptTab->gatherEndUseBySourceBEPS = 0.0; // End use subs must be dynamically allocated to accommodate the end use with the most subcategories - gatherEndUseSubBEPS.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); - gatherEndUseSubBEPS = 0.0; - gatherDemandEndUseSub.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); - gatherDemandEndUseSub = 0.0; - gatherDemandIndEndUseSub.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); - gatherDemandIndEndUseSub = 0.0; + state.dataOutRptTab->gatherEndUseSubBEPS.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); + state.dataOutRptTab->gatherEndUseSubBEPS = 0.0; + state.dataOutRptTab->gatherDemandEndUseSub.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); + state.dataOutRptTab->gatherDemandEndUseSub = 0.0; + state.dataOutRptTab->gatherDemandIndEndUseSub.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); + state.dataOutRptTab->gatherDemandIndEndUseSub = 0.0; // get meter numbers for other meters relating to electric load components meterNumPowerFuelFireGen = GetMeterIndex(state, "Cogeneration:ElectricityProduced"); @@ -3162,161 +3084,161 @@ namespace EnergyPlus::OutputReportTabular { GetFuelFactorInfo(state, "NaturalGas", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { sourceFactorNaturalGas = curSourceFactor; - fuelfactorsused(2) = true; - ffUsed(2) = true; + state.dataOutRptTab->fuelfactorsused(2) = true; + state.dataOutRptTab->ffUsed(2) = true; } - SourceFactors(2) = curSourceFactor; + state.dataOutRptTab->SourceFactors(2) = curSourceFactor; if (fFScheduleUsed) { fuelFactorSchedulesUsed = true; - ffSchedUsed(2) = true; - ffSchedIndex(2) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(2) = true; + state.dataOutRptTab->ffSchedIndex(2) = ffScheduleIndex; } GetFuelFactorInfo(state, "FuelOilNo2", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { sourceFactorFuelOil2 = curSourceFactor; - fuelfactorsused(7) = true; - ffUsed(11) = true; + state.dataOutRptTab->fuelfactorsused(7) = true; + state.dataOutRptTab->ffUsed(11) = true; } - SourceFactors(11) = curSourceFactor; + state.dataOutRptTab->SourceFactors(11) = curSourceFactor; if (fFScheduleUsed) { fuelFactorSchedulesUsed = true; - ffSchedUsed(11) = true; - ffSchedIndex(11) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(11) = true; + state.dataOutRptTab->ffSchedIndex(11) = ffScheduleIndex; } GetFuelFactorInfo(state, "FuelOilNo1", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { sourceFactorFuelOil1 = curSourceFactor; - fuelfactorsused(6) = true; - ffUsed(10) = true; + state.dataOutRptTab->fuelfactorsused(6) = true; + state.dataOutRptTab->ffUsed(10) = true; } - SourceFactors(10) = curSourceFactor; + state.dataOutRptTab->SourceFactors(10) = curSourceFactor; if (fFScheduleUsed) { fuelFactorSchedulesUsed = true; - ffSchedUsed(10) = true; - ffSchedIndex(10) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(10) = true; + state.dataOutRptTab->ffSchedIndex(10) = ffScheduleIndex; } GetFuelFactorInfo(state, "Coal", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { sourceFactorCoal = curSourceFactor; - fuelfactorsused(5) = true; - ffUsed(9) = true; + state.dataOutRptTab->fuelfactorsused(5) = true; + state.dataOutRptTab->ffUsed(9) = true; } - SourceFactors(9) = curSourceFactor; + state.dataOutRptTab->SourceFactors(9) = curSourceFactor; if (fFScheduleUsed) { fuelFactorSchedulesUsed = true; - ffSchedUsed(9) = true; - ffSchedIndex(9) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(9) = true; + state.dataOutRptTab->ffSchedIndex(9) = ffScheduleIndex; } GetFuelFactorInfo(state, "Electricity", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { sourceFactorElectric = curSourceFactor; - fuelfactorsused(1) = true; - ffUsed(1) = true; + state.dataOutRptTab->fuelfactorsused(1) = true; + state.dataOutRptTab->ffUsed(1) = true; } - SourceFactors(1) = curSourceFactor; + state.dataOutRptTab->SourceFactors(1) = curSourceFactor; if (fFScheduleUsed) { fuelFactorSchedulesUsed = true; - ffSchedUsed(1) = true; - ffSchedIndex(1) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(1) = true; + state.dataOutRptTab->ffSchedIndex(1) = ffScheduleIndex; } GetFuelFactorInfo(state, "Gasoline", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { sourceFactorGasoline = curSourceFactor; - fuelfactorsused(3) = true; - ffUsed(6) = true; + state.dataOutRptTab->fuelfactorsused(3) = true; + state.dataOutRptTab->ffUsed(6) = true; } - SourceFactors(6) = curSourceFactor; + state.dataOutRptTab->SourceFactors(6) = curSourceFactor; if (fFScheduleUsed) { fuelFactorSchedulesUsed = true; - ffSchedUsed(6) = true; - ffSchedIndex(6) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(6) = true; + state.dataOutRptTab->ffSchedIndex(6) = ffScheduleIndex; } GetFuelFactorInfo(state, "Propane", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { sourceFactorPropane = curSourceFactor; - fuelfactorsused(8) = true; - ffUsed(12) = true; + state.dataOutRptTab->fuelfactorsused(8) = true; + state.dataOutRptTab->ffUsed(12) = true; } - SourceFactors(12) = curSourceFactor; + state.dataOutRptTab->SourceFactors(12) = curSourceFactor; if (fFScheduleUsed) { fuelFactorSchedulesUsed = true; - ffSchedUsed(12) = true; - ffSchedIndex(12) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(12) = true; + state.dataOutRptTab->ffSchedIndex(12) = ffScheduleIndex; } GetFuelFactorInfo(state, "Diesel", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { sourceFactorDiesel = curSourceFactor; - fuelfactorsused(4) = true; - ffUsed(8) = true; + state.dataOutRptTab->fuelfactorsused(4) = true; + state.dataOutRptTab->ffUsed(8) = true; } - SourceFactors(8) = curSourceFactor; + state.dataOutRptTab->SourceFactors(8) = curSourceFactor; if (fFScheduleUsed) { fuelFactorSchedulesUsed = true; - ffSchedUsed(8) = true; - ffSchedIndex(8) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(8) = true; + state.dataOutRptTab->ffSchedIndex(8) = ffScheduleIndex; } GetFuelFactorInfo(state, "DistrictCooling", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - ffUsed(3) = true; + state.dataOutRptTab->ffUsed(3) = true; } - SourceFactors(3) = curSourceFactor; + state.dataOutRptTab->SourceFactors(3) = curSourceFactor; if (fFScheduleUsed) { - ffSchedUsed(3) = true; - ffSchedIndex(3) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(3) = true; + state.dataOutRptTab->ffSchedIndex(3) = ffScheduleIndex; } GetFuelFactorInfo(state, "DistrictHeating", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - ffUsed(4) = true; + state.dataOutRptTab->ffUsed(4) = true; } - SourceFactors(4) = curSourceFactor; + state.dataOutRptTab->SourceFactors(4) = curSourceFactor; if (fFScheduleUsed) { - ffSchedUsed(4) = true; - ffSchedIndex(4) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(4) = true; + state.dataOutRptTab->ffSchedIndex(4) = ffScheduleIndex; } GetFuelFactorInfo(state, "Steam", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - ffUsed(5) = true; + state.dataOutRptTab->ffUsed(5) = true; } - SourceFactors(5) = curSourceFactor; + state.dataOutRptTab->SourceFactors(5) = curSourceFactor; if (fFScheduleUsed) { - ffSchedUsed(5) = true; - ffSchedIndex(5) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(5) = true; + state.dataOutRptTab->ffSchedIndex(5) = ffScheduleIndex; } GetFuelFactorInfo(state, "OtherFuel1", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { sourceFactorOtherFuel1 = curSourceFactor; - fuelfactorsused(11) = true; // should be source number - ffUsed(13) = true; + state.dataOutRptTab->fuelfactorsused(11) = true; // should be source number + state.dataOutRptTab->ffUsed(13) = true; } - SourceFactors(13) = curSourceFactor; + state.dataOutRptTab->SourceFactors(13) = curSourceFactor; if (fFScheduleUsed) { fuelFactorSchedulesUsed = true; - ffSchedUsed(13) = true; - ffSchedIndex(13) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(13) = true; + state.dataOutRptTab->ffSchedIndex(13) = ffScheduleIndex; } GetFuelFactorInfo(state, "OtherFuel2", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { sourceFactorOtherFuel2 = curSourceFactor; - fuelfactorsused(12) = true; // should be source number - ffUsed(14) = true; + state.dataOutRptTab->fuelfactorsused(12) = true; // should be source number + state.dataOutRptTab->ffUsed(14) = true; } - SourceFactors(14) = curSourceFactor; + state.dataOutRptTab->SourceFactors(14) = curSourceFactor; if (fFScheduleUsed) { fuelFactorSchedulesUsed = true; - ffSchedUsed(14) = true; - ffSchedIndex(14) = ffScheduleIndex; + state.dataOutRptTab->ffSchedUsed(14) = true; + state.dataOutRptTab->ffSchedIndex(14) = ffScheduleIndex; } GetEnvironmentalImpactFactorInfo(state, efficiencyDistrictHeating, efficiencyDistrictCooling, sourceFactorSteam); @@ -4285,23 +4207,23 @@ namespace EnergyPlus::OutputReportTabular { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { - curMeterNumber = meterNumTotalsBEPS(iResource); + curMeterNumber = state.dataOutRptTab->meterNumTotalsBEPS(iResource); if (curMeterNumber > 0) { curMeterValue = GetCurrentMeterValue(state, curMeterNumber); - gatherTotalsBEPS(iResource) += curMeterValue; + state.dataOutRptTab->gatherTotalsBEPS(iResource) += curMeterValue; } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - curMeterNumber = meterNumEndUseBEPS(iResource, jEndUse); + curMeterNumber = state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { curMeterValue = GetCurrentMeterValue(state, curMeterNumber); - gatherEndUseBEPS(iResource, jEndUse) += curMeterValue; + state.dataOutRptTab->gatherEndUseBEPS(iResource, jEndUse) += curMeterValue; for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - curMeterNumber = meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); + curMeterNumber = state.dataOutRptTab->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); if (curMeterNumber > 0) { curMeterValue = GetCurrentMeterValue(state, curMeterNumber); - gatherEndUseSubBEPS(kEndUseSub, jEndUse, iResource) += curMeterValue; + state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, iResource) += curMeterValue; } } } @@ -4309,10 +4231,10 @@ namespace EnergyPlus::OutputReportTabular { } for (iResource = 1; iResource <= numSourceTypes; ++iResource) { - curMeterNumber = meterNumTotalsSource(iResource); + curMeterNumber = state.dataOutRptTab->meterNumTotalsSource(iResource); if (curMeterNumber > 0) { curMeterValue = GetCurrentMeterValue(state, curMeterNumber); - gatherTotalsSource(iResource) += curMeterValue; + state.dataOutRptTab->gatherTotalsSource(iResource) += curMeterValue; } } @@ -4433,34 +4355,34 @@ namespace EnergyPlus::OutputReportTabular { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { - if (ffSchedUsed(iResource)) { - curMeterNumber = meterNumTotalsBEPS(iResource); + if (state.dataOutRptTab->ffSchedUsed(iResource)) { + curMeterNumber = state.dataOutRptTab->meterNumTotalsBEPS(iResource); if (curMeterNumber > 0) { curMeterValue = - GetCurrentMeterValue(state, curMeterNumber) * GetCurrentScheduleValue(state, ffSchedIndex(iResource)) * SourceFactors(iResource); - gatherTotalsBySourceBEPS(iResource) += curMeterValue; + GetCurrentMeterValue(state, curMeterNumber) * GetCurrentScheduleValue(state, state.dataOutRptTab->ffSchedIndex(iResource)) * state.dataOutRptTab->SourceFactors(iResource); + state.dataOutRptTab->gatherTotalsBySourceBEPS(iResource) += curMeterValue; } } else { - curMeterNumber = meterNumTotalsBEPS(iResource); + curMeterNumber = state.dataOutRptTab->meterNumTotalsBEPS(iResource); if (curMeterNumber > 0) { - curMeterValue = GetCurrentMeterValue(state, curMeterNumber) * SourceFactors(iResource); - gatherTotalsBySourceBEPS(iResource) += curMeterValue; + curMeterValue = GetCurrentMeterValue(state, curMeterNumber) * state.dataOutRptTab->SourceFactors(iResource); + state.dataOutRptTab->gatherTotalsBySourceBEPS(iResource) += curMeterValue; } } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - if (ffSchedUsed(iResource)) { - curMeterNumber = meterNumEndUseBEPS(iResource, jEndUse); + if (state.dataOutRptTab->ffSchedUsed(iResource)) { + curMeterNumber = state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { curMeterValue = - GetCurrentMeterValue(state, curMeterNumber) * GetCurrentScheduleValue(state, ffSchedIndex(iResource)) * SourceFactors(iResource); - gatherEndUseBySourceBEPS(iResource, jEndUse) += curMeterValue; + GetCurrentMeterValue(state, curMeterNumber) * GetCurrentScheduleValue(state, state.dataOutRptTab->ffSchedIndex(iResource)) * state.dataOutRptTab->SourceFactors(iResource); + state.dataOutRptTab->gatherEndUseBySourceBEPS(iResource, jEndUse) += curMeterValue; } } else { - curMeterNumber = meterNumEndUseBEPS(iResource, jEndUse); + curMeterNumber = state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { - curMeterValue = GetCurrentMeterValue(state, curMeterNumber) * SourceFactors(iResource); - gatherEndUseBySourceBEPS(iResource, jEndUse) += curMeterValue; + curMeterValue = GetCurrentMeterValue(state, curMeterNumber) * state.dataOutRptTab->SourceFactors(iResource); + state.dataOutRptTab->gatherEndUseBySourceBEPS(iResource, jEndUse) += curMeterValue; } } } @@ -4553,29 +4475,29 @@ namespace EnergyPlus::OutputReportTabular { if ((state.dataOutRptTab->displayDemandEndUse) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { - curMeterNumber = meterNumTotalsBEPS(iResource); + curMeterNumber = state.dataOutRptTab->meterNumTotalsBEPS(iResource); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(state, curMeterNumber) / state.dataGlobal->TimeStepZoneSec; // check if current value is greater than existing peak demand value - if (curDemandValue > gatherDemandTotal(iResource)) { - gatherDemandTotal(iResource) = curDemandValue; + if (curDemandValue > state.dataOutRptTab->gatherDemandTotal(iResource)) { + state.dataOutRptTab->gatherDemandTotal(iResource) = curDemandValue; // save the time that the peak demand occurred // minuteCalculated = (CurrentTime - INT(CurrentTime))*60 minuteCalculated = DetermineMinuteForReporting(state, t_timeStepType); EncodeMonDayHrMin(timestepTimeStamp, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->HourOfDay, minuteCalculated); - gatherDemandTimeStamp(iResource) = timestepTimeStamp; + state.dataOutRptTab->gatherDemandTimeStamp(iResource) = timestepTimeStamp; // if new peak demand is set, then gather all of the end use values at this particular // time to find the components of the peak demand for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - curMeterNumber = meterNumEndUseBEPS(iResource, jEndUse); + curMeterNumber = state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(state, curMeterNumber) / state.dataGlobal->TimeStepZoneSec; - gatherDemandEndUse(iResource, jEndUse) = curDemandValue; + state.dataOutRptTab->gatherDemandEndUse(iResource, jEndUse) = curDemandValue; for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - curMeterNumber = meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); + curMeterNumber = state.dataOutRptTab->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(state, curMeterNumber) / state.dataGlobal->TimeStepZoneSec; - gatherDemandEndUseSub(kEndUseSub, jEndUse, iResource) = curDemandValue; + state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, iResource) = curDemandValue; } } } @@ -4590,19 +4512,19 @@ namespace EnergyPlus::OutputReportTabular { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - curMeterNumber = meterNumEndUseBEPS(iResource, jEndUse); + curMeterNumber = state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(state, curMeterNumber) / state.dataGlobal->TimeStepZoneSec; - if (curDemandValue > gatherDemandIndEndUse(iResource, jEndUse)) { - gatherDemandIndEndUse(iResource, jEndUse) = curDemandValue; + if (curDemandValue > state.dataOutRptTab->gatherDemandIndEndUse(iResource, jEndUse)) { + state.dataOutRptTab->gatherDemandIndEndUse(iResource, jEndUse) = curDemandValue; } for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - curMeterNumber = meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); + curMeterNumber = state.dataOutRptTab->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(state, curMeterNumber) / state.dataGlobal->TimeStepZoneSec; // check if current value is greater than existing peak demand value - if (curDemandValue > gatherDemandIndEndUseSub(kEndUseSub, jEndUse, iResource)) { - gatherDemandIndEndUseSub(kEndUseSub, jEndUse, iResource) = curDemandValue; + if (curDemandValue > state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, iResource)) { + state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, iResource) = curDemandValue; } } } @@ -7344,35 +7266,35 @@ namespace EnergyPlus::OutputReportTabular { DetermineBuildingFloorArea(state); // collapse the gatherEndUseBEPS array to the resource groups displayed for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - collapsedEndUse(1, jEndUse) = gatherEndUseBEPS(1, jEndUse); // electricity - collapsedEndUse(2, jEndUse) = gatherEndUseBEPS(2, jEndUse); // natural gas - collapsedEndUse(3, jEndUse) = gatherEndUseBEPS(6, jEndUse); // gasoline - collapsedEndUse(4, jEndUse) = gatherEndUseBEPS(8, jEndUse); // diesel - collapsedEndUse(5, jEndUse) = gatherEndUseBEPS(9, jEndUse); // coal - collapsedEndUse(6, jEndUse) = gatherEndUseBEPS(10, jEndUse); // Fuel Oil No1 - collapsedEndUse(7, jEndUse) = gatherEndUseBEPS(11, jEndUse); // Fuel Oil No2 - collapsedEndUse(8, jEndUse) = gatherEndUseBEPS(12, jEndUse); // propane - collapsedEndUse(9, jEndUse) = gatherEndUseBEPS(13, jEndUse); // otherfuel1 - collapsedEndUse(10, jEndUse) = gatherEndUseBEPS(14, jEndUse); // otherfuel2 - collapsedEndUse(11, jEndUse) = gatherEndUseBEPS(3, jEndUse); // district cooling <- purchased cooling + collapsedEndUse(1, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(1, jEndUse); // electricity + collapsedEndUse(2, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(2, jEndUse); // natural gas + collapsedEndUse(3, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(6, jEndUse); // gasoline + collapsedEndUse(4, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(8, jEndUse); // diesel + collapsedEndUse(5, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(9, jEndUse); // coal + collapsedEndUse(6, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(10, jEndUse); // Fuel Oil No1 + collapsedEndUse(7, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(11, jEndUse); // Fuel Oil No2 + collapsedEndUse(8, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(12, jEndUse); // propane + collapsedEndUse(9, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(13, jEndUse); // otherfuel1 + collapsedEndUse(10, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(14, jEndUse); // otherfuel2 + collapsedEndUse(11, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(3, jEndUse); // district cooling <- purchased cooling collapsedEndUse(12, jEndUse) = - gatherEndUseBEPS(4, jEndUse) + gatherEndUseBEPS(5, jEndUse); // district heating <- purchased heating | <- steam - collapsedEndUse(13, jEndUse) = gatherEndUseBEPS(7, jEndUse); // water + state.dataOutRptTab->gatherEndUseBEPS(4, jEndUse) + state.dataOutRptTab->gatherEndUseBEPS(5, jEndUse); // district heating <- purchased heating | <- steam + collapsedEndUse(13, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(7, jEndUse); // water } // repeat with totals - collapsedTotal(1) = gatherTotalsBEPS(1); // electricity - collapsedTotal(2) = gatherTotalsBEPS(2); // natural gas - collapsedTotal(3) = gatherTotalsBEPS(6); // gasoline - collapsedTotal(4) = gatherTotalsBEPS(8); // diesel - collapsedTotal(5) = gatherTotalsBEPS(9); // coal - collapsedTotal(6) = gatherTotalsBEPS(10); // Fuel Oil No1 - collapsedTotal(7) = gatherTotalsBEPS(11); // Fuel Oil No2 - collapsedTotal(8) = gatherTotalsBEPS(12); // propane - collapsedTotal(9) = gatherTotalsBEPS(13); // other fuel 1 - collapsedTotal(10) = gatherTotalsBEPS(14); // other fuel 2 - collapsedTotal(11) = gatherTotalsBEPS(3); // district cooling <- purchased cooling - collapsedTotal(12) = gatherTotalsBEPS(4) + gatherTotalsBEPS(5); // district heating <- purchased heating | <- steam - collapsedTotal(13) = gatherTotalsBEPS(7); // water + collapsedTotal(1) = state.dataOutRptTab->gatherTotalsBEPS(1); // electricity + collapsedTotal(2) = state.dataOutRptTab->gatherTotalsBEPS(2); // natural gas + collapsedTotal(3) = state.dataOutRptTab->gatherTotalsBEPS(6); // gasoline + collapsedTotal(4) = state.dataOutRptTab->gatherTotalsBEPS(8); // diesel + collapsedTotal(5) = state.dataOutRptTab->gatherTotalsBEPS(9); // coal + collapsedTotal(6) = state.dataOutRptTab->gatherTotalsBEPS(10); // Fuel Oil No1 + collapsedTotal(7) = state.dataOutRptTab->gatherTotalsBEPS(11); // Fuel Oil No2 + collapsedTotal(8) = state.dataOutRptTab->gatherTotalsBEPS(12); // propane + collapsedTotal(9) = state.dataOutRptTab->gatherTotalsBEPS(13); // other fuel 1 + collapsedTotal(10) = state.dataOutRptTab->gatherTotalsBEPS(14); // other fuel 2 + collapsedTotal(11) = state.dataOutRptTab->gatherTotalsBEPS(3); // district cooling <- purchased cooling + collapsedTotal(12) = state.dataOutRptTab->gatherTotalsBEPS(4) + state.dataOutRptTab->gatherTotalsBEPS(5); // district heating <- purchased heating | <- steam + collapsedTotal(13) = state.dataOutRptTab->gatherTotalsBEPS(7); // water if (state.dataGlobal->createPerfLog) { UtilityRoutines::appendPerfLog(state, "Electricity ABUPS Total [J]", format("{:.3R}", collapsedTotal(1))); @@ -7401,21 +7323,21 @@ namespace EnergyPlus::OutputReportTabular { } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - collapsedEndUseSub(kEndUseSub, jEndUse, 1) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 1); // electricity - collapsedEndUseSub(kEndUseSub, jEndUse, 2) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 2); // natural gas - collapsedEndUseSub(kEndUseSub, jEndUse, 3) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 6); // gasoline - collapsedEndUseSub(kEndUseSub, jEndUse, 4) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 8); // diesel - collapsedEndUseSub(kEndUseSub, jEndUse, 5) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 9); // coal - collapsedEndUseSub(kEndUseSub, jEndUse, 6) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 10); // Fuel Oil No1 - collapsedEndUseSub(kEndUseSub, jEndUse, 7) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 11); // Fuel Oil No2 - collapsedEndUseSub(kEndUseSub, jEndUse, 8) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 12); // propane - collapsedEndUseSub(kEndUseSub, jEndUse, 9) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 13); // otherfuel1 - collapsedEndUseSub(kEndUseSub, jEndUse, 10) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 14); // otherfuel2 - collapsedEndUseSub(kEndUseSub, jEndUse, 11) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 3); // district cooling <- purch cooling + collapsedEndUseSub(kEndUseSub, jEndUse, 1) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 1); // electricity + collapsedEndUseSub(kEndUseSub, jEndUse, 2) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 2); // natural gas + collapsedEndUseSub(kEndUseSub, jEndUse, 3) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 6); // gasoline + collapsedEndUseSub(kEndUseSub, jEndUse, 4) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 8); // diesel + collapsedEndUseSub(kEndUseSub, jEndUse, 5) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 9); // coal + collapsedEndUseSub(kEndUseSub, jEndUse, 6) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 10); // Fuel Oil No1 + collapsedEndUseSub(kEndUseSub, jEndUse, 7) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 11); // Fuel Oil No2 + collapsedEndUseSub(kEndUseSub, jEndUse, 8) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 12); // propane + collapsedEndUseSub(kEndUseSub, jEndUse, 9) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 13); // otherfuel1 + collapsedEndUseSub(kEndUseSub, jEndUse, 10) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 14); // otherfuel2 + collapsedEndUseSub(kEndUseSub, jEndUse, 11) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 3); // district cooling <- purch cooling collapsedEndUseSub(kEndUseSub, jEndUse, 12) = - gatherEndUseSubBEPS(kEndUseSub, jEndUse, 4) + - gatherEndUseSubBEPS(kEndUseSub, jEndUse, 5); // district heating <- purch heating | <- steam - collapsedEndUseSub(kEndUseSub, jEndUse, 13) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 7); // water + state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 4) + + state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 5); // district heating <- purch heating | <- steam + collapsedEndUseSub(kEndUseSub, jEndUse, 13) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 7); // water } } @@ -7530,18 +7452,18 @@ namespace EnergyPlus::OutputReportTabular { // previously these variables were converted into GJ so now we don't need // to do any conversion // water is not included gatherTotalsBEPS(7) !water - totalSiteEnergyUse = (gatherTotalsBEPS(1) + gatherTotalsBEPS(2) + gatherTotalsBEPS(3) + gatherTotalsBEPS(4) + gatherTotalsBEPS(5) + - gatherTotalsBEPS(6) + gatherTotalsBEPS(8) + gatherTotalsBEPS(9) + gatherTotalsBEPS(10) + gatherTotalsBEPS(11) + - gatherTotalsBEPS(12) + gatherTotalsBEPS(13) + gatherTotalsBEPS(14)) / + totalSiteEnergyUse = (state.dataOutRptTab->gatherTotalsBEPS(1) + state.dataOutRptTab->gatherTotalsBEPS(2) + state.dataOutRptTab->gatherTotalsBEPS(3) + state.dataOutRptTab->gatherTotalsBEPS(4) + state.dataOutRptTab->gatherTotalsBEPS(5) + + state.dataOutRptTab->gatherTotalsBEPS(6) + state.dataOutRptTab->gatherTotalsBEPS(8) + state.dataOutRptTab->gatherTotalsBEPS(9) + state.dataOutRptTab->gatherTotalsBEPS(10) + state.dataOutRptTab->gatherTotalsBEPS(11) + + state.dataOutRptTab->gatherTotalsBEPS(12) + state.dataOutRptTab->gatherTotalsBEPS(13) + state.dataOutRptTab->gatherTotalsBEPS(14)) / largeConversionFactor; // electricity | natural gas | district cooling | district heating | steam | gasoline | diesel // | coal | Fuel Oil No1 | Fuel Oil No2 | propane | otherfuel1 | otherfuel2 netElecPurchasedSold = gatherElecPurchased - gatherElecSurplusSold; // water is not included gatherTotalsBEPS(7) !water - netSiteEnergyUse = netElecPurchasedSold + (gatherTotalsBEPS(2) + gatherTotalsBEPS(3) + gatherTotalsBEPS(4) + gatherTotalsBEPS(5) + - gatherTotalsBEPS(6) + gatherTotalsBEPS(8) + gatherTotalsBEPS(9) + gatherTotalsBEPS(10) + - gatherTotalsBEPS(11) + gatherTotalsBEPS(12) + gatherTotalsBEPS(13) + gatherTotalsBEPS(14)) / + netSiteEnergyUse = netElecPurchasedSold + (state.dataOutRptTab->gatherTotalsBEPS(2) + state.dataOutRptTab->gatherTotalsBEPS(3) + state.dataOutRptTab->gatherTotalsBEPS(4) + state.dataOutRptTab->gatherTotalsBEPS(5) + + state.dataOutRptTab->gatherTotalsBEPS(6) + state.dataOutRptTab->gatherTotalsBEPS(8) + state.dataOutRptTab->gatherTotalsBEPS(9) + state.dataOutRptTab->gatherTotalsBEPS(10) + + state.dataOutRptTab->gatherTotalsBEPS(11) + state.dataOutRptTab->gatherTotalsBEPS(12) + state.dataOutRptTab->gatherTotalsBEPS(13) + state.dataOutRptTab->gatherTotalsBEPS(14)) / largeConversionFactor; // electricity (already in GJ) | natural gas | district cooling | // district heating | steam | gasoline | diesel | coal | Fuel Oil No1 // | Fuel Oil No2 | propane | otherfuel1 | otherfuel2 @@ -7552,138 +7474,138 @@ namespace EnergyPlus::OutputReportTabular { // source emissions already have the source factors included in the calcs. totalSourceEnergyUse = 0.0; // electricity - if (fuelfactorsused(1)) { - totalSourceEnergyUse += gatherTotalsSource(1); + if (state.dataOutRptTab->fuelfactorsused(1)) { + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(1); } else { - totalSourceEnergyUse += gatherTotalsBEPS(1) * sourceFactorElectric; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(1) * sourceFactorElectric; } // natural gas - if (fuelfactorsused(2)) { - totalSourceEnergyUse += gatherTotalsSource(2); + if (state.dataOutRptTab->fuelfactorsused(2)) { + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(2); } else { - totalSourceEnergyUse += gatherTotalsBEPS(2) * sourceFactorNaturalGas; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(2) * sourceFactorNaturalGas; } // gasoline - if (fuelfactorsused(3)) { - totalSourceEnergyUse += gatherTotalsSource(3); + if (state.dataOutRptTab->fuelfactorsused(3)) { + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(3); } else { - totalSourceEnergyUse += gatherTotalsBEPS(6) * sourceFactorGasoline; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(6) * sourceFactorGasoline; } // diesel - if (fuelfactorsused(4)) { - totalSourceEnergyUse += gatherTotalsSource(4); + if (state.dataOutRptTab->fuelfactorsused(4)) { + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(4); } else { - totalSourceEnergyUse += gatherTotalsBEPS(8) * sourceFactorDiesel; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(8) * sourceFactorDiesel; } // coal - if (fuelfactorsused(5)) { - totalSourceEnergyUse += gatherTotalsSource(5); + if (state.dataOutRptTab->fuelfactorsused(5)) { + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(5); } else { - totalSourceEnergyUse += gatherTotalsBEPS(9) * sourceFactorCoal; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(9) * sourceFactorCoal; } // Fuel Oil No1 - if (fuelfactorsused(6)) { - totalSourceEnergyUse += gatherTotalsSource(6); + if (state.dataOutRptTab->fuelfactorsused(6)) { + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(6); } else { - totalSourceEnergyUse += gatherTotalsBEPS(10) * sourceFactorFuelOil1; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(10) * sourceFactorFuelOil1; } // Fuel Oil No2 - if (fuelfactorsused(7)) { - totalSourceEnergyUse += gatherTotalsSource(7); + if (state.dataOutRptTab->fuelfactorsused(7)) { + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(7); } else { - totalSourceEnergyUse += gatherTotalsBEPS(11) * sourceFactorFuelOil2; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(11) * sourceFactorFuelOil2; } // propane - if (fuelfactorsused(8)) { - totalSourceEnergyUse += gatherTotalsSource(8); + if (state.dataOutRptTab->fuelfactorsused(8)) { + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(8); } else { - totalSourceEnergyUse += gatherTotalsBEPS(12) * sourceFactorPropane; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(12) * sourceFactorPropane; } // otherfuel1 - if (fuelfactorsused(11)) { - totalSourceEnergyUse += gatherTotalsSource(11); + if (state.dataOutRptTab->fuelfactorsused(11)) { + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(11); } else { - totalSourceEnergyUse += gatherTotalsBEPS(13) * sourceFactorOtherFuel1; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(13) * sourceFactorOtherFuel1; } // otherfuel2 - if (fuelfactorsused(12)) { - totalSourceEnergyUse += gatherTotalsSource(12); + if (state.dataOutRptTab->fuelfactorsused(12)) { + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(12); } else { - totalSourceEnergyUse += gatherTotalsBEPS(14) * sourceFactorOtherFuel2; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(14) * sourceFactorOtherFuel2; } totalSourceEnergyUse = - (totalSourceEnergyUse + gatherTotalsBEPS(3) * sourceFactorElectric / efficiencyDistrictCooling + - gatherTotalsBEPS(4) * sourceFactorNaturalGas / efficiencyDistrictHeating + gatherTotalsBEPS(5) * sourceFactorSteam) / + (totalSourceEnergyUse + state.dataOutRptTab->gatherTotalsBEPS(3) * sourceFactorElectric / efficiencyDistrictCooling + + state.dataOutRptTab->gatherTotalsBEPS(4) * sourceFactorNaturalGas / efficiencyDistrictHeating + state.dataOutRptTab->gatherTotalsBEPS(5) * sourceFactorSteam) / largeConversionFactor; // district cooling | district heating | steam // now determine "net" source from purchased and surplus sold (still in J) - if (fuelfactorsused(1)) { - netSourceElecPurchasedSold = gatherTotalsSource(9) - gatherTotalsSource(10); + if (state.dataOutRptTab->fuelfactorsused(1)) { + netSourceElecPurchasedSold = state.dataOutRptTab->gatherTotalsSource(9) - state.dataOutRptTab->gatherTotalsSource(10); } else { netSourceElecPurchasedSold = netElecPurchasedSold * sourceFactorElectric * largeConversionFactor; // back to J } netSourceEnergyUse = 0.0; // natural gas - if (fuelfactorsused(2)) { - netSourceEnergyUse += gatherTotalsSource(2); + if (state.dataOutRptTab->fuelfactorsused(2)) { + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(2); } else { - netSourceEnergyUse += gatherTotalsBEPS(2) * sourceFactorNaturalGas; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(2) * sourceFactorNaturalGas; } // gasoline - if (fuelfactorsused(3)) { - netSourceEnergyUse += gatherTotalsSource(3); + if (state.dataOutRptTab->fuelfactorsused(3)) { + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(3); } else { - netSourceEnergyUse += gatherTotalsBEPS(6) * sourceFactorGasoline; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(6) * sourceFactorGasoline; } // diesel - if (fuelfactorsused(4)) { - netSourceEnergyUse += gatherTotalsSource(4); + if (state.dataOutRptTab->fuelfactorsused(4)) { + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(4); } else { - netSourceEnergyUse += gatherTotalsBEPS(8) * sourceFactorDiesel; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(8) * sourceFactorDiesel; } // coal - if (fuelfactorsused(5)) { - netSourceEnergyUse += gatherTotalsSource(5); + if (state.dataOutRptTab->fuelfactorsused(5)) { + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(5); } else { - netSourceEnergyUse += gatherTotalsBEPS(9) * sourceFactorCoal; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(9) * sourceFactorCoal; } // Fuel Oil No1 - if (fuelfactorsused(6)) { - netSourceEnergyUse += gatherTotalsSource(6); + if (state.dataOutRptTab->fuelfactorsused(6)) { + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(6); } else { - netSourceEnergyUse += gatherTotalsBEPS(10) * sourceFactorFuelOil1; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(10) * sourceFactorFuelOil1; } // Fuel Oil No2 - if (fuelfactorsused(7)) { - netSourceEnergyUse += gatherTotalsSource(7); + if (state.dataOutRptTab->fuelfactorsused(7)) { + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(7); } else { - netSourceEnergyUse += gatherTotalsBEPS(11) * sourceFactorFuelOil2; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(11) * sourceFactorFuelOil2; } // propane - if (fuelfactorsused(8)) { - netSourceEnergyUse += gatherTotalsSource(8); + if (state.dataOutRptTab->fuelfactorsused(8)) { + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(8); } else { - netSourceEnergyUse += gatherTotalsBEPS(12) * sourceFactorPropane; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(12) * sourceFactorPropane; } // otherfuel1 - if (fuelfactorsused(11)) { - netSourceEnergyUse += gatherTotalsSource(11); + if (state.dataOutRptTab->fuelfactorsused(11)) { + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(11); } else { - netSourceEnergyUse += gatherTotalsBEPS(13) * sourceFactorOtherFuel1; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(13) * sourceFactorOtherFuel1; } // otherfuel2 - if (fuelfactorsused(12)) { - netSourceEnergyUse += gatherTotalsSource(12); + if (state.dataOutRptTab->fuelfactorsused(12)) { + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(12); } else { - netSourceEnergyUse += gatherTotalsBEPS(14) * sourceFactorOtherFuel2; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(14) * sourceFactorOtherFuel2; } netSourceEnergyUse = - (netSourceEnergyUse + netSourceElecPurchasedSold + gatherTotalsBEPS(3) * sourceFactorElectric / efficiencyDistrictCooling + - gatherTotalsBEPS(4) * sourceFactorNaturalGas / efficiencyDistrictHeating + gatherTotalsBEPS(5) * sourceFactorSteam) / + (netSourceEnergyUse + netSourceElecPurchasedSold + state.dataOutRptTab->gatherTotalsBEPS(3) * sourceFactorElectric / efficiencyDistrictCooling + + state.dataOutRptTab->gatherTotalsBEPS(4) * sourceFactorNaturalGas / efficiencyDistrictHeating + state.dataOutRptTab->gatherTotalsBEPS(5) * sourceFactorSteam) / largeConversionFactor; // from other fuels | net source from electricity | district cooling | district heating | steam // show annual values @@ -7760,20 +7682,20 @@ namespace EnergyPlus::OutputReportTabular { // tableBody(10,1) = TRIM(RealToStr(sourceFactorFuelOil2 ,3)) // tableBody(11,1) = TRIM(RealToStr(sourceFactorPropane ,3)) - if (!ffSchedUsed(1)) { + if (!state.dataOutRptTab->ffSchedUsed(1)) { tableBody(1, 1) = RealToStr(sourceFactorElectric, 3); - } else if (gatherTotalsBEPS(1) > SmallValue) { - tableBody(1, 1) = "Effective Factor = " + RealToStr(gatherTotalsBySourceBEPS(1) / gatherTotalsBEPS(1), 3) + - " (calculated using schedule \"" + GetScheduleName(state, ffSchedIndex(1)) + "\")"; + } else if (state.dataOutRptTab->gatherTotalsBEPS(1) > SmallValue) { + tableBody(1, 1) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(1) / state.dataOutRptTab->gatherTotalsBEPS(1), 3) + + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(1)) + "\")"; } else { tableBody(1, 1) = "N/A"; } - if (!ffSchedUsed(2)) { + if (!state.dataOutRptTab->ffSchedUsed(2)) { tableBody(1, 2) = RealToStr(sourceFactorNaturalGas, 3); - } else if (gatherTotalsBEPS(2) > SmallValue) { - tableBody(1, 2) = "Effective Factor = " + RealToStr(gatherTotalsBySourceBEPS(2) / gatherTotalsBEPS(2), 3) + - " (calculated using schedule \"" + GetScheduleName(state, ffSchedIndex(2)) + "\")"; + } else if (state.dataOutRptTab->gatherTotalsBEPS(2) > SmallValue) { + tableBody(1, 2) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(2) / state.dataOutRptTab->gatherTotalsBEPS(2), 3) + + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(2)) + "\")"; } else { tableBody(1, 2) = "N/A"; } @@ -7784,74 +7706,74 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 5) = RealToStr(sourceFactorSteam, 3); // Steam - if (!ffSchedUsed(6)) { + if (!state.dataOutRptTab->ffSchedUsed(6)) { tableBody(1, 6) = RealToStr(sourceFactorGasoline, 3); - } else if (gatherTotalsBEPS(6) > SmallValue) { - tableBody(1, 6) = "Effective Factor = " + RealToStr(gatherTotalsBySourceBEPS(6) / gatherTotalsBEPS(6), 3) + - " (calculated using schedule \"" + GetScheduleName(state, ffSchedIndex(6)) + "\")"; + } else if (state.dataOutRptTab->gatherTotalsBEPS(6) > SmallValue) { + tableBody(1, 6) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(6) / state.dataOutRptTab->gatherTotalsBEPS(6), 3) + + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(6)) + "\")"; } else { tableBody(1, 6) = "N/A"; } - if (!ffSchedUsed(8)) { + if (!state.dataOutRptTab->ffSchedUsed(8)) { tableBody(1, 7) = RealToStr(sourceFactorDiesel, 3); - } else if (gatherTotalsBEPS(8) > SmallValue) { - tableBody(1, 7) = "Effective Factor = " + RealToStr(gatherTotalsBySourceBEPS(8) / gatherTotalsBEPS(8), 3) + - " (calculated using schedule \"" + GetScheduleName(state, ffSchedIndex(8)) + "\")"; + } else if (state.dataOutRptTab->gatherTotalsBEPS(8) > SmallValue) { + tableBody(1, 7) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(8) / state.dataOutRptTab->gatherTotalsBEPS(8), 3) + + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(8)) + "\")"; } else { tableBody(1, 7) = "N/A"; } - if (!ffSchedUsed(9)) { + if (!state.dataOutRptTab->ffSchedUsed(9)) { tableBody(1, 8) = RealToStr(sourceFactorCoal, 3); - } else if (gatherTotalsBEPS(9) > SmallValue) { - tableBody(1, 8) = "Effective Factor = " + RealToStr(gatherTotalsBySourceBEPS(9) / gatherTotalsBEPS(9), 3) + - " (calculated using schedule \"" + GetScheduleName(state, ffSchedIndex(9)) + "\")"; + } else if (state.dataOutRptTab->gatherTotalsBEPS(9) > SmallValue) { + tableBody(1, 8) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(9) / state.dataOutRptTab->gatherTotalsBEPS(9), 3) + + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(9)) + "\")"; } else { tableBody(1, 8) = "N/A"; } - if (!ffSchedUsed(10)) { + if (!state.dataOutRptTab->ffSchedUsed(10)) { tableBody(1, 9) = RealToStr(sourceFactorFuelOil1, 3); - } else if (gatherTotalsBEPS(10) > SmallValue) { - tableBody(1, 9) = "Effective Factor = " + RealToStr(gatherTotalsBySourceBEPS(10) / gatherTotalsBEPS(10), 3) + - " (calculated using schedule \"" + GetScheduleName(state, ffSchedIndex(10)) + "\")"; + } else if (state.dataOutRptTab->gatherTotalsBEPS(10) > SmallValue) { + tableBody(1, 9) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(10) / state.dataOutRptTab->gatherTotalsBEPS(10), 3) + + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(10)) + "\")"; } else { tableBody(1, 9) = "N/A"; } - if (!ffSchedUsed(11)) { + if (!state.dataOutRptTab->ffSchedUsed(11)) { tableBody(1, 10) = RealToStr(sourceFactorFuelOil2, 3); - } else if (gatherTotalsBEPS(11) > SmallValue) { - tableBody(1, 10) = "Effective Factor = " + RealToStr(gatherTotalsBySourceBEPS(11) / gatherTotalsBEPS(11), 3) + - " (calculated using schedule \"" + GetScheduleName(state, ffSchedIndex(11)) + "\")"; + } else if (state.dataOutRptTab->gatherTotalsBEPS(11) > SmallValue) { + tableBody(1, 10) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(11) / state.dataOutRptTab->gatherTotalsBEPS(11), 3) + + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(11)) + "\")"; } else { tableBody(1, 10) = "N/A"; } - if (!ffSchedUsed(12)) { + if (!state.dataOutRptTab->ffSchedUsed(12)) { tableBody(1, 11) = RealToStr(sourceFactorPropane, 3); - } else if (gatherTotalsBEPS(12) > SmallValue) { - tableBody(1, 11) = "Effective Factor = " + RealToStr(gatherTotalsBySourceBEPS(12) / gatherTotalsBEPS(12), 3) + - " (calculated using schedule \"" + GetScheduleName(state, ffSchedIndex(12)) + "\")"; + } else if (state.dataOutRptTab->gatherTotalsBEPS(12) > SmallValue) { + tableBody(1, 11) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(12) / state.dataOutRptTab->gatherTotalsBEPS(12), 3) + + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(12)) + "\")"; } else { tableBody(1, 11) = "N/A"; } - if (!ffSchedUsed(13)) { + if (!state.dataOutRptTab->ffSchedUsed(13)) { tableBody(1, 12) = RealToStr(sourceFactorOtherFuel1, 3); - } else if (gatherTotalsBEPS(13) > SmallValue) { - tableBody(1, 12) = "Effective Factor = " + RealToStr(gatherTotalsBySourceBEPS(13) / gatherTotalsBEPS(13), 3) + - " (calculated using schedule \"" + GetScheduleName(state, ffSchedIndex(13)) + "\")"; + } else if (state.dataOutRptTab->gatherTotalsBEPS(13) > SmallValue) { + tableBody(1, 12) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(13) / state.dataOutRptTab->gatherTotalsBEPS(13), 3) + + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(13)) + "\")"; } else { tableBody(1, 12) = "N/A"; } - if (!ffSchedUsed(14)) { + if (!state.dataOutRptTab->ffSchedUsed(14)) { tableBody(1, 13) = RealToStr(sourceFactorOtherFuel2, 3); - } else if (gatherTotalsBEPS(14) > SmallValue) { - tableBody(1, 13) = "Effective Factor = " + RealToStr(gatherTotalsBySourceBEPS(14) / gatherTotalsBEPS(14), 3) + - " (calculated using schedule \"" + GetScheduleName(state, ffSchedIndex(14)) + "\")"; + } else if (state.dataOutRptTab->gatherTotalsBEPS(14) > SmallValue) { + tableBody(1, 13) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(14) / state.dataOutRptTab->gatherTotalsBEPS(14), 3) + + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(14)) + "\")"; } else { tableBody(1, 13) = "N/A"; } @@ -8185,7 +8107,7 @@ namespace EnergyPlus::OutputReportTabular { // determine if subcategories add up to the total and // if not, determine the difference for the 'other' row - needOtherRowLEED45 = false; // set array to all false assuming no other rows are needed + state.dataOutRptTab->needOtherRowLEED45 = false; // set array to all false assuming no other rows are needed for (iResource = 1; iResource <= 13; ++iResource) { for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { if (state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories > 0) { @@ -8197,7 +8119,7 @@ namespace EnergyPlus::OutputReportTabular { } // if just a small value remains set it to zero if (std::abs(endUseSubOther(iResource, jEndUse)) > 0.01) { - needOtherRowLEED45(jEndUse) = true; + state.dataOutRptTab->needOtherRowLEED45(jEndUse) = true; } else { endUseSubOther(iResource, jEndUse) = 0.0; } @@ -8215,7 +8137,7 @@ namespace EnergyPlus::OutputReportTabular { ++numRows; } // check if an 'other' row is needed - if (needOtherRowLEED45(jEndUse)) { + if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { ++numRows; } } else { @@ -8241,7 +8163,7 @@ namespace EnergyPlus::OutputReportTabular { ++i; } // check if an 'other' row is needed - if (needOtherRowLEED45(jEndUse)) { + if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { tableBody(1, i) = "Other"; ++i; } @@ -8309,7 +8231,7 @@ namespace EnergyPlus::OutputReportTabular { ++i; } // put other - if (needOtherRowLEED45(jEndUse)) { + if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { tableBody(iResource + 1, i) = RealToStr(endUseSubOther(iResource, jEndUse), 2); ++i; } @@ -8388,7 +8310,7 @@ namespace EnergyPlus::OutputReportTabular { ++i; } // put other - if (needOtherRowLEED45(jEndUse)) { + if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { PreDefTableEntry(state, resource_entry_map(iResource), state.dataOutputProcessor->EndUseCategory(jEndUse).DisplayName + " -- Other", unconvert * endUseSubOther(iResource, jEndUse)); @@ -8956,35 +8878,35 @@ namespace EnergyPlus::OutputReportTabular { DetermineBuildingFloorArea(state); // collapse the gatherEndUseBEPS array to the resource groups displayed for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - collapsedEndUse(1, jEndUse) = gatherEndUseBySourceBEPS(1, jEndUse); // electricity - collapsedEndUse(2, jEndUse) = gatherEndUseBySourceBEPS(2, jEndUse); // natural gas - collapsedEndUse(3, jEndUse) = gatherEndUseBySourceBEPS(6, jEndUse); // gasoline - collapsedEndUse(4, jEndUse) = gatherEndUseBySourceBEPS(8, jEndUse); // diesel - collapsedEndUse(5, jEndUse) = gatherEndUseBySourceBEPS(9, jEndUse); // coal - collapsedEndUse(6, jEndUse) = gatherEndUseBySourceBEPS(10, jEndUse); // Fuel Oil No1 - collapsedEndUse(7, jEndUse) = gatherEndUseBySourceBEPS(11, jEndUse); // Fuel Oil No2 - collapsedEndUse(8, jEndUse) = gatherEndUseBySourceBEPS(12, jEndUse); // propane - collapsedEndUse(9, jEndUse) = gatherEndUseBySourceBEPS(13, jEndUse); // otherfuel1 - collapsedEndUse(10, jEndUse) = gatherEndUseBySourceBEPS(14, jEndUse); // otherfuel2 - collapsedEndUse(11, jEndUse) = gatherEndUseBySourceBEPS(3, jEndUse); // district cooling <- purchased cooling + collapsedEndUse(1, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(1, jEndUse); // electricity + collapsedEndUse(2, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(2, jEndUse); // natural gas + collapsedEndUse(3, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(6, jEndUse); // gasoline + collapsedEndUse(4, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(8, jEndUse); // diesel + collapsedEndUse(5, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(9, jEndUse); // coal + collapsedEndUse(6, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(10, jEndUse); // Fuel Oil No1 + collapsedEndUse(7, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(11, jEndUse); // Fuel Oil No2 + collapsedEndUse(8, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(12, jEndUse); // propane + collapsedEndUse(9, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(13, jEndUse); // otherfuel1 + collapsedEndUse(10, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(14, jEndUse); // otherfuel2 + collapsedEndUse(11, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(3, jEndUse); // district cooling <- purchased cooling collapsedEndUse(12, jEndUse) = - gatherEndUseBySourceBEPS(4, jEndUse) + gatherEndUseBySourceBEPS(5, jEndUse); // district heating <- purchased heating | <- steam - collapsedEndUse(13, jEndUse) = gatherEndUseBySourceBEPS(7, jEndUse); // water + state.dataOutRptTab->gatherEndUseBySourceBEPS(4, jEndUse) + state.dataOutRptTab->gatherEndUseBySourceBEPS(5, jEndUse); // district heating <- purchased heating | <- steam + collapsedEndUse(13, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(7, jEndUse); // water } // repeat with totals - collapsedTotal(1) = gatherTotalsBySourceBEPS(1); // electricity - collapsedTotal(2) = gatherTotalsBySourceBEPS(2); // natural gas - collapsedTotal(3) = gatherTotalsBySourceBEPS(6); // gasoline - collapsedTotal(4) = gatherTotalsBySourceBEPS(8); // diesel - collapsedTotal(5) = gatherTotalsBySourceBEPS(9); // coal - collapsedTotal(6) = gatherTotalsBySourceBEPS(10); // Fuel Oil No1 - collapsedTotal(7) = gatherTotalsBySourceBEPS(11); // Fuel Oil No2 - collapsedTotal(8) = gatherTotalsBySourceBEPS(12); // propane - collapsedTotal(9) = gatherTotalsBySourceBEPS(13); // otherfuel1 - collapsedTotal(10) = gatherTotalsBySourceBEPS(14); // otherfuel2 - collapsedTotal(11) = gatherTotalsBySourceBEPS(3); // district cooling <- purchased cooling - collapsedTotal(12) = gatherTotalsBySourceBEPS(4) + gatherTotalsBySourceBEPS(5); // district heating <- purchased heating | <- steam - collapsedTotal(13) = gatherTotalsBySourceBEPS(7); // water + collapsedTotal(1) = state.dataOutRptTab->gatherTotalsBySourceBEPS(1); // electricity + collapsedTotal(2) = state.dataOutRptTab->gatherTotalsBySourceBEPS(2); // natural gas + collapsedTotal(3) = state.dataOutRptTab->gatherTotalsBySourceBEPS(6); // gasoline + collapsedTotal(4) = state.dataOutRptTab->gatherTotalsBySourceBEPS(8); // diesel + collapsedTotal(5) = state.dataOutRptTab->gatherTotalsBySourceBEPS(9); // coal + collapsedTotal(6) = state.dataOutRptTab->gatherTotalsBySourceBEPS(10); // Fuel Oil No1 + collapsedTotal(7) = state.dataOutRptTab->gatherTotalsBySourceBEPS(11); // Fuel Oil No2 + collapsedTotal(8) = state.dataOutRptTab->gatherTotalsBySourceBEPS(12); // propane + collapsedTotal(9) = state.dataOutRptTab->gatherTotalsBySourceBEPS(13); // otherfuel1 + collapsedTotal(10) = state.dataOutRptTab->gatherTotalsBySourceBEPS(14); // otherfuel2 + collapsedTotal(11) = state.dataOutRptTab->gatherTotalsBySourceBEPS(3); // district cooling <- purchased cooling + collapsedTotal(12) = state.dataOutRptTab->gatherTotalsBySourceBEPS(4) + state.dataOutRptTab->gatherTotalsBySourceBEPS(5); // district heating <- purchased heating | <- steam + collapsedTotal(13) = state.dataOutRptTab->gatherTotalsBySourceBEPS(7); // water // unit conversion - all values are used as divisors @@ -9301,35 +9223,35 @@ namespace EnergyPlus::OutputReportTabular { WriteReportHeaders(state, "Demand End Use Components Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // totals - select which additional fuel to display and which other district heating collapsedTotal = 0.0; - collapsedTotal(1) = gatherDemandTotal(1); // electricity - collapsedTimeStep(1) = gatherDemandTimeStamp(1); - collapsedTotal(2) = gatherDemandTotal(2); // natural gas - collapsedTimeStep(2) = gatherDemandTimeStamp(2); - collapsedTotal(3) = gatherDemandTotal(6); // gasoline - collapsedTimeStep(3) = gatherDemandTimeStamp(6); - collapsedTotal(4) = gatherDemandTotal(8); // diesel - collapsedTimeStep(4) = gatherDemandTimeStamp(8); - collapsedTotal(5) = gatherDemandTotal(9); // coal - collapsedTimeStep(5) = gatherDemandTimeStamp(9); - collapsedTotal(6) = gatherDemandTotal(10); // fuel oil no 1 - collapsedTimeStep(6) = gatherDemandTimeStamp(10); - collapsedTotal(7) = gatherDemandTotal(11); // fuel oil no 2 - collapsedTimeStep(7) = gatherDemandTimeStamp(11); - collapsedTotal(8) = gatherDemandTotal(12); // propane - collapsedTimeStep(8) = gatherDemandTimeStamp(12); - collapsedTotal(9) = gatherDemandTotal(13); // other fuel 1 - collapsedTimeStep(9) = gatherDemandTimeStamp(13); - collapsedTotal(10) = gatherDemandTotal(14); // other fuel 2 - collapsedTimeStep(10) = gatherDemandTimeStamp(14); - collapsedTotal(11) = gatherDemandTotal(3); // district cooling <- purchased cooling - collapsedTimeStep(11) = gatherDemandTimeStamp(3); - collapsedTotal(13) = gatherDemandTotal(7); // water - collapsedTimeStep(13) = gatherDemandTimeStamp(7); + collapsedTotal(1) = state.dataOutRptTab->gatherDemandTotal(1); // electricity + collapsedTimeStep(1) = state.dataOutRptTab->gatherDemandTimeStamp(1); + collapsedTotal(2) = state.dataOutRptTab->gatherDemandTotal(2); // natural gas + collapsedTimeStep(2) = state.dataOutRptTab->gatherDemandTimeStamp(2); + collapsedTotal(3) = state.dataOutRptTab->gatherDemandTotal(6); // gasoline + collapsedTimeStep(3) = state.dataOutRptTab->gatherDemandTimeStamp(6); + collapsedTotal(4) = state.dataOutRptTab->gatherDemandTotal(8); // diesel + collapsedTimeStep(4) = state.dataOutRptTab->gatherDemandTimeStamp(8); + collapsedTotal(5) = state.dataOutRptTab->gatherDemandTotal(9); // coal + collapsedTimeStep(5) = state.dataOutRptTab->gatherDemandTimeStamp(9); + collapsedTotal(6) = state.dataOutRptTab->gatherDemandTotal(10); // fuel oil no 1 + collapsedTimeStep(6) = state.dataOutRptTab->gatherDemandTimeStamp(10); + collapsedTotal(7) = state.dataOutRptTab->gatherDemandTotal(11); // fuel oil no 2 + collapsedTimeStep(7) = state.dataOutRptTab->gatherDemandTimeStamp(11); + collapsedTotal(8) = state.dataOutRptTab->gatherDemandTotal(12); // propane + collapsedTimeStep(8) = state.dataOutRptTab->gatherDemandTimeStamp(12); + collapsedTotal(9) = state.dataOutRptTab->gatherDemandTotal(13); // other fuel 1 + collapsedTimeStep(9) = state.dataOutRptTab->gatherDemandTimeStamp(13); + collapsedTotal(10) = state.dataOutRptTab->gatherDemandTotal(14); // other fuel 2 + collapsedTimeStep(10) = state.dataOutRptTab->gatherDemandTimeStamp(14); + collapsedTotal(11) = state.dataOutRptTab->gatherDemandTotal(3); // district cooling <- purchased cooling + collapsedTimeStep(11) = state.dataOutRptTab->gatherDemandTimeStamp(3); + collapsedTotal(13) = state.dataOutRptTab->gatherDemandTotal(7); // water + collapsedTimeStep(13) = state.dataOutRptTab->gatherDemandTimeStamp(7); // set flag if both puchased heating and steam both have positive demand - bothDistrHeatNonZero = (gatherDemandTotal(4) > 0.0) && (gatherDemandTotal(5) > 0.0); + bothDistrHeatNonZero = (state.dataOutRptTab->gatherDemandTotal(4) > 0.0) && (state.dataOutRptTab->gatherDemandTotal(5) > 0.0); // select the district heating source that has a larger demand - if (gatherDemandTotal(4) > gatherDemandTotal(5)) { + if (state.dataOutRptTab->gatherDemandTotal(4) > state.dataOutRptTab->gatherDemandTotal(5)) { distrHeatSelected = 4; // purchased heating if (bothDistrHeatNonZero) { footnote += " Steam has non-zero demand but is not shown on this report."; @@ -9341,8 +9263,8 @@ namespace EnergyPlus::OutputReportTabular { } } // set the time of peak demand and total demand for the purchased heating/steam - collapsedTimeStep(12) = gatherDemandTimeStamp(distrHeatSelected); - collapsedTotal(12) = gatherDemandTotal(distrHeatSelected); + collapsedTimeStep(12) = state.dataOutRptTab->gatherDemandTimeStamp(distrHeatSelected); + collapsedTotal(12) = state.dataOutRptTab->gatherDemandTotal(distrHeatSelected); // establish unit conversion factors if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { @@ -9356,36 +9278,36 @@ namespace EnergyPlus::OutputReportTabular { // collapse the gatherEndUseBEPS array to the resource groups displayed collapsedEndUse = 0.0; for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - collapsedEndUse(1, jEndUse) = gatherDemandEndUse(1, jEndUse) * powerConversion; // electricity - collapsedEndUse(2, jEndUse) = gatherDemandEndUse(2, jEndUse) * powerConversion; // natural gas - collapsedEndUse(3, jEndUse) = gatherDemandEndUse(6, jEndUse) * powerConversion; // gasoline - collapsedEndUse(4, jEndUse) = gatherDemandEndUse(8, jEndUse) * powerConversion; // diesel - collapsedEndUse(5, jEndUse) = gatherDemandEndUse(9, jEndUse) * powerConversion; // coal - collapsedEndUse(6, jEndUse) = gatherDemandEndUse(10, jEndUse) * powerConversion; // fuel oil no 1 - collapsedEndUse(7, jEndUse) = gatherDemandEndUse(11, jEndUse) * powerConversion; // fuel oil no 2 - collapsedEndUse(8, jEndUse) = gatherDemandEndUse(12, jEndUse) * powerConversion; // propane - collapsedEndUse(9, jEndUse) = gatherDemandEndUse(13, jEndUse) * powerConversion; // otherfuel1 - collapsedEndUse(10, jEndUse) = gatherDemandEndUse(14, jEndUse) * powerConversion; // otherfuel2 - collapsedEndUse(11, jEndUse) = gatherDemandEndUse(3, jEndUse) * powerConversion; // purchased cooling - collapsedEndUse(12, jEndUse) = gatherDemandEndUse(distrHeatSelected, jEndUse) * powerConversion; // district heating - collapsedEndUse(13, jEndUse) = gatherDemandEndUse(7, jEndUse) * flowConversion; // water + collapsedEndUse(1, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(1, jEndUse) * powerConversion; // electricity + collapsedEndUse(2, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(2, jEndUse) * powerConversion; // natural gas + collapsedEndUse(3, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(6, jEndUse) * powerConversion; // gasoline + collapsedEndUse(4, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(8, jEndUse) * powerConversion; // diesel + collapsedEndUse(5, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(9, jEndUse) * powerConversion; // coal + collapsedEndUse(6, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(10, jEndUse) * powerConversion; // fuel oil no 1 + collapsedEndUse(7, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(11, jEndUse) * powerConversion; // fuel oil no 2 + collapsedEndUse(8, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(12, jEndUse) * powerConversion; // propane + collapsedEndUse(9, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(13, jEndUse) * powerConversion; // otherfuel1 + collapsedEndUse(10, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(14, jEndUse) * powerConversion; // otherfuel2 + collapsedEndUse(11, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(3, jEndUse) * powerConversion; // purchased cooling + collapsedEndUse(12, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(distrHeatSelected, jEndUse) * powerConversion; // district heating + collapsedEndUse(13, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(7, jEndUse) * flowConversion; // water } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - collapsedEndUseSub(kEndUseSub, jEndUse, 1) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 1) * powerConversion; // electricity - collapsedEndUseSub(kEndUseSub, jEndUse, 2) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 2) * powerConversion; // natural gas - collapsedEndUseSub(kEndUseSub, jEndUse, 3) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 6) * powerConversion; // gasoline - collapsedEndUseSub(kEndUseSub, jEndUse, 4) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 8) * powerConversion; // diesel - collapsedEndUseSub(kEndUseSub, jEndUse, 5) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 9) * powerConversion; // coal - collapsedEndUseSub(kEndUseSub, jEndUse, 6) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 10) * powerConversion; // fuel oil no 1 - collapsedEndUseSub(kEndUseSub, jEndUse, 7) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 11) * powerConversion; // fuel oil no 2 - collapsedEndUseSub(kEndUseSub, jEndUse, 8) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 12) * powerConversion; // propane - collapsedEndUseSub(kEndUseSub, jEndUse, 9) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 13) * powerConversion; // otherfuel1 - collapsedEndUseSub(kEndUseSub, jEndUse, 10) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 14) * powerConversion; // otherfuel2 - collapsedEndUseSub(kEndUseSub, jEndUse, 11) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 3) * powerConversion; // purch cooling + collapsedEndUseSub(kEndUseSub, jEndUse, 1) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 1) * powerConversion; // electricity + collapsedEndUseSub(kEndUseSub, jEndUse, 2) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 2) * powerConversion; // natural gas + collapsedEndUseSub(kEndUseSub, jEndUse, 3) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 6) * powerConversion; // gasoline + collapsedEndUseSub(kEndUseSub, jEndUse, 4) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 8) * powerConversion; // diesel + collapsedEndUseSub(kEndUseSub, jEndUse, 5) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 9) * powerConversion; // coal + collapsedEndUseSub(kEndUseSub, jEndUse, 6) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 10) * powerConversion; // fuel oil no 1 + collapsedEndUseSub(kEndUseSub, jEndUse, 7) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 11) * powerConversion; // fuel oil no 2 + collapsedEndUseSub(kEndUseSub, jEndUse, 8) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 12) * powerConversion; // propane + collapsedEndUseSub(kEndUseSub, jEndUse, 9) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 13) * powerConversion; // otherfuel1 + collapsedEndUseSub(kEndUseSub, jEndUse, 10) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 14) * powerConversion; // otherfuel2 + collapsedEndUseSub(kEndUseSub, jEndUse, 11) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 3) * powerConversion; // purch cooling collapsedEndUseSub(kEndUseSub, jEndUse, 12) = - gatherDemandEndUseSub(kEndUseSub, jEndUse, distrHeatSelected) * powerConversion; // district heating - collapsedEndUseSub(kEndUseSub, jEndUse, 13) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 7) * flowConversion; // water + state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, distrHeatSelected) * powerConversion; // district heating + collapsedEndUseSub(kEndUseSub, jEndUse, 13) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 7) * flowConversion; // water } } // collapse the individual peaks for the end use subcategories for the LEED report @@ -9393,36 +9315,36 @@ namespace EnergyPlus::OutputReportTabular { // no unit conversion, it is done at the reporting stage if necessary collapsedIndEndUse = 0.0; for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - collapsedIndEndUse(1, jEndUse) = gatherDemandIndEndUse(1, jEndUse); // electricity - collapsedIndEndUse(2, jEndUse) = gatherDemandIndEndUse(2, jEndUse); // natural gas - collapsedIndEndUse(3, jEndUse) = gatherDemandIndEndUse(6, jEndUse); // gasoline - collapsedIndEndUse(4, jEndUse) = gatherDemandIndEndUse(8, jEndUse); // diesel - collapsedIndEndUse(5, jEndUse) = gatherDemandIndEndUse(9, jEndUse); // coal - collapsedIndEndUse(6, jEndUse) = gatherDemandIndEndUse(10, jEndUse); // fuel oil no 1 - collapsedIndEndUse(7, jEndUse) = gatherDemandIndEndUse(11, jEndUse); // fuel oil no 2 - collapsedIndEndUse(8, jEndUse) = gatherDemandIndEndUse(12, jEndUse); // propane - collapsedIndEndUse(9, jEndUse) = gatherDemandIndEndUse(13, jEndUse); // otherfuel1 - collapsedIndEndUse(10, jEndUse) = gatherDemandIndEndUse(14, jEndUse); // otherfuel2 - collapsedIndEndUse(11, jEndUse) = gatherDemandIndEndUse(3, jEndUse); // purchased cooling - collapsedIndEndUse(12, jEndUse) = gatherDemandIndEndUse(distrHeatSelected, jEndUse); // district heating - collapsedIndEndUse(13, jEndUse) = gatherDemandIndEndUse(7, jEndUse); // water + collapsedIndEndUse(1, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(1, jEndUse); // electricity + collapsedIndEndUse(2, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(2, jEndUse); // natural gas + collapsedIndEndUse(3, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(6, jEndUse); // gasoline + collapsedIndEndUse(4, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(8, jEndUse); // diesel + collapsedIndEndUse(5, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(9, jEndUse); // coal + collapsedIndEndUse(6, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(10, jEndUse); // fuel oil no 1 + collapsedIndEndUse(7, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(11, jEndUse); // fuel oil no 2 + collapsedIndEndUse(8, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(12, jEndUse); // propane + collapsedIndEndUse(9, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(13, jEndUse); // otherfuel1 + collapsedIndEndUse(10, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(14, jEndUse); // otherfuel2 + collapsedIndEndUse(11, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(3, jEndUse); // purchased cooling + collapsedIndEndUse(12, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(distrHeatSelected, jEndUse); // district heating + collapsedIndEndUse(13, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(7, jEndUse); // water } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - collapsedIndEndUseSub(kEndUseSub, jEndUse, 1) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 1); // electricity - collapsedIndEndUseSub(kEndUseSub, jEndUse, 2) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 2); // natural gas - collapsedIndEndUseSub(kEndUseSub, jEndUse, 3) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 6); // gasoline - collapsedIndEndUseSub(kEndUseSub, jEndUse, 4) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 8); // diesel - collapsedIndEndUseSub(kEndUseSub, jEndUse, 5) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 9); // coal - collapsedIndEndUseSub(kEndUseSub, jEndUse, 6) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 10); // fuel oil no 1 - collapsedIndEndUseSub(kEndUseSub, jEndUse, 7) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 11); // fuel oil no 2 - collapsedIndEndUseSub(kEndUseSub, jEndUse, 8) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 12); // propane - collapsedIndEndUseSub(kEndUseSub, jEndUse, 9) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 13); // otherfuel1 - collapsedIndEndUseSub(kEndUseSub, jEndUse, 10) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 14); // otherfuel2 - collapsedIndEndUseSub(kEndUseSub, jEndUse, 11) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 3); // purch cooling + collapsedIndEndUseSub(kEndUseSub, jEndUse, 1) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 1); // electricity + collapsedIndEndUseSub(kEndUseSub, jEndUse, 2) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 2); // natural gas + collapsedIndEndUseSub(kEndUseSub, jEndUse, 3) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 6); // gasoline + collapsedIndEndUseSub(kEndUseSub, jEndUse, 4) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 8); // diesel + collapsedIndEndUseSub(kEndUseSub, jEndUse, 5) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 9); // coal + collapsedIndEndUseSub(kEndUseSub, jEndUse, 6) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 10); // fuel oil no 1 + collapsedIndEndUseSub(kEndUseSub, jEndUse, 7) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 11); // fuel oil no 2 + collapsedIndEndUseSub(kEndUseSub, jEndUse, 8) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 12); // propane + collapsedIndEndUseSub(kEndUseSub, jEndUse, 9) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 13); // otherfuel1 + collapsedIndEndUseSub(kEndUseSub, jEndUse, 10) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 14); // otherfuel2 + collapsedIndEndUseSub(kEndUseSub, jEndUse, 11) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 3); // purch cooling collapsedIndEndUseSub(kEndUseSub, jEndUse, 12) = - gatherDemandIndEndUseSub(kEndUseSub, jEndUse, distrHeatSelected); // district heating - collapsedIndEndUseSub(kEndUseSub, jEndUse, 13) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 7); // water + state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, distrHeatSelected); // district heating + collapsedIndEndUseSub(kEndUseSub, jEndUse, 13) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 7); // water } } @@ -9678,7 +9600,7 @@ namespace EnergyPlus::OutputReportTabular { // EAp2-4/5. Performance Rating Method Compliance for (iResource = 1; iResource <= 13; ++iResource) { for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - if (needOtherRowLEED45(jEndUse)) { + if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { if (state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories == 0) { endUseSubOther(iResource, jEndUse) = collapsedIndEndUse(iResource, jEndUse); // often the case that no subcategories are defined @@ -9722,7 +9644,7 @@ namespace EnergyPlus::OutputReportTabular { ++i; } // put other - if (needOtherRowLEED45(jEndUse)) { + if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { PreDefTableEntry(state, resource_entry_map(iResource), state.dataOutputProcessor->EndUseCategory(jEndUse).DisplayName + " -- Other", endUseSubOther(iResource, jEndUse)); ++i; @@ -15061,9 +14983,9 @@ namespace EnergyPlus::OutputReportTabular { ResetMonthlyGathering(state); OutputReportTabularAnnual::ResetAnnualGathering(); ResetBinGathering(); - ResetBEPSGathering(); - ResetSourceEnergyEndUseGathering(); - ResetPeakDemandGathering(); + ResetBEPSGathering(state); + ResetSourceEnergyEndUseGathering(state); + ResetPeakDemandGathering(state); ResetHeatGainGathering(state); ResetRemainingPredefinedEntries(state); ThermalComfort::ResetThermalComfortSimpleASH55(state); @@ -15134,16 +15056,16 @@ namespace EnergyPlus::OutputReportTabular { } } - void ResetBEPSGathering() + void ResetBEPSGathering(EnergyPlusData &state) { // Jason Glazer - October 2015 // Reset all ABUPS gathering arrays to zero for multi-year simulations // so that only last year is reported in tabular reports - gatherTotalsBEPS = 0.0; - gatherEndUseBEPS = 0.0; - gatherEndUseSubBEPS = 0.0; - gatherTotalsSource = 0.0; - // reset the specific componenents being gathered + state.dataOutRptTab->gatherTotalsBEPS = 0.0; + state.dataOutRptTab->gatherEndUseBEPS = 0.0; + state.dataOutRptTab->gatherEndUseSubBEPS = 0.0; + state.dataOutRptTab->gatherTotalsSource = 0.0; + // reset the specific components being gathered gatherPowerFuelFireGen = 0.0; gatherPowerPV = 0.0; gatherPowerWind = 0.0; @@ -15166,24 +15088,24 @@ namespace EnergyPlus::OutputReportTabular { gatherWaterEndUseTotal = 0.0; } - void ResetSourceEnergyEndUseGathering() + void ResetSourceEnergyEndUseGathering(EnergyPlusData &state) { // Jason Glazer - October 2015 // Reset all source energy end use table gathering arrays to zero for multi-year simulations // so that only last year is reported in tabular reports - gatherTotalsBySourceBEPS = 0.0; - gatherEndUseBySourceBEPS = 0.0; + state.dataOutRptTab->gatherTotalsBySourceBEPS = 0.0; + state.dataOutRptTab->gatherEndUseBySourceBEPS = 0.0; } - void ResetPeakDemandGathering() + void ResetPeakDemandGathering(EnergyPlusData &state) { // Jason Glazer - October 2015 // Reset all demand end use components table gathering arrays to zero for multi-year simulations // so that only last year is reported in tabular reports - gatherDemandTotal = 0.0; - gatherDemandTimeStamp = 0; - gatherDemandEndUse = 0.0; - gatherDemandEndUseSub = 0.0; + state.dataOutRptTab->gatherDemandTotal = 0.0; + state.dataOutRptTab->gatherDemandTimeStamp = 0; + state.dataOutRptTab->gatherDemandEndUse = 0.0; + state.dataOutRptTab->gatherDemandEndUseSub = 0.0; } void ResetHeatGainGathering(EnergyPlusData &state) diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 65e165e9766..5d012433807 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -182,37 +182,6 @@ namespace OutputReportTabular { // Allow up to five output files to be created constexpr int maxNumStyles(5); - // BEPS Report Related Variables - // From Report:Table:Predefined - BEPS - // arrays that hold the meter numbers that are initialized at get input - extern Array1D_int meterNumTotalsBEPS; - extern Array1D_int meterNumTotalsSource; - extern Array1D_bool fuelfactorsused; - extern Array1D_bool ffUsed; - extern Array1D SourceFactors; - extern Array1D_bool ffSchedUsed; - extern Array1D_int ffSchedIndex; - extern Array2D_int meterNumEndUseBEPS; - extern Array3D_int meterNumEndUseSubBEPS; - // arrays that hold the names of the resource and end uses - extern Array1D_string resourceTypeNames; - extern Array1D_string sourceTypeNames; - extern Array1D_string endUseNames; - // arrays that hold the actual values for the year - extern Array1D gatherTotalsBEPS; - extern Array1D gatherTotalsBySourceBEPS; - extern Array1D gatherTotalsSource; - extern Array1D gatherTotalsBySource; - extern Array2D gatherEndUseBEPS; - extern Array2D gatherEndUseBySourceBEPS; - extern Array3D gatherEndUseSubBEPS; - // arrays the hold the demand values - extern Array1D gatherDemandTotal; - extern Array2D gatherDemandEndUse; - extern Array2D gatherDemandIndEndUse; - extern Array3D gatherDemandEndUseSub; - extern Array3D gatherDemandIndEndUseSub; - extern Array1D_int gatherDemandTimeStamp; // to keep track of hours for the BEPS report gathering extern Real64 gatherElapsedTimeBEPS; // for normalization of results @@ -931,11 +900,11 @@ namespace OutputReportTabular { void ResetBinGathering(); - void ResetBEPSGathering(); + void ResetBEPSGathering(EnergyPlusData &state); - void ResetSourceEnergyEndUseGathering(); + void ResetSourceEnergyEndUseGathering(EnergyPlusData &state); - void ResetPeakDemandGathering(); + void ResetPeakDemandGathering(EnergyPlusData &state); void ResetHeatGainGathering(EnergyPlusData &state); @@ -1063,6 +1032,39 @@ struct OutputReportTabularData : BaseGlobalStruct { bool displayThermalResilienceSummaryExplicitly = false; bool displayCO2ResilienceSummaryExplicitly = false; bool displayVisualResilienceSummaryExplicitly = false; + // BEPS Report Related Variables + // From Report:Table:Predefined - BEPS + // arrays that hold the meter numbers that are initialized at get input + Array1D_int meterNumTotalsBEPS= Array1D_int(OutputReportTabular::numResourceTypes, 0); + Array1D_int meterNumTotalsSource = Array1D_int(OutputReportTabular::numSourceTypes, 0); + Array1D_bool fuelfactorsused = Array1D_bool(OutputReportTabular::numSourceTypes, false); + Array1D_bool ffUsed = Array1D_bool(OutputReportTabular::numResourceTypes, false); + Array1D SourceFactors = Array1D(OutputReportTabular::numResourceTypes, 0.0); + Array1D_bool ffSchedUsed = Array1D_bool(OutputReportTabular::numResourceTypes, false); + Array1D_int ffSchedIndex = Array1D_int(OutputReportTabular::numResourceTypes, 0); + Array2D_int meterNumEndUseBEPS = Array2D_int(OutputReportTabular::numResourceTypes, DataGlobalConstants::iEndUse.size(), 0); + Array3D_int meterNumEndUseSubBEPS; + // arrays that hold the names of the resource and end uses + Array1D_string resourceTypeNames = Array1D_string(OutputReportTabular::numResourceTypes); + Array1D_string sourceTypeNames = Array1D_string(OutputReportTabular::numSourceTypes); + Array1D_string endUseNames = Array1D_string(DataGlobalConstants::iEndUse.size()); + // arrays that hold the actual values for the year + Array1D gatherTotalsBEPS = Array1D(OutputReportTabular::numResourceTypes, 0.0); + Array1D gatherTotalsBySourceBEPS = Array1D(OutputReportTabular::numResourceTypes, 0.0); + Array1D gatherTotalsSource = Array1D(OutputReportTabular::numSourceTypes, 0.0); + Array1D gatherTotalsBySource = Array1D(OutputReportTabular::numSourceTypes, 0.0); + Array2D gatherEndUseBEPS = Array2D(OutputReportTabular::numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); + Array2D gatherEndUseBySourceBEPS = Array2D(OutputReportTabular::numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); + Array3D gatherEndUseSubBEPS; + Array1D_bool needOtherRowLEED45 = Array1D_bool(DataGlobalConstants::iEndUse.size()); + + // arrays the hold the demand values + Array1D gatherDemandTotal = Array1D(OutputReportTabular::numResourceTypes, 0.0); + Array2D gatherDemandEndUse = Array2D(OutputReportTabular::numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); + Array2D gatherDemandIndEndUse = Array2D(OutputReportTabular::numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); + Array3D gatherDemandEndUseSub; + Array3D gatherDemandIndEndUseSub; + Array1D_int gatherDemandTimeStamp = Array1D_int(OutputReportTabular::numResourceTypes, 0); void clear_state() override { @@ -1111,6 +1113,33 @@ struct OutputReportTabularData : BaseGlobalStruct { this->displayThermalResilienceSummaryExplicitly = false; this->displayCO2ResilienceSummaryExplicitly = false; this->displayVisualResilienceSummaryExplicitly = false; + this->meterNumTotalsBEPS= Array1D_int(OutputReportTabular::numResourceTypes, 0); + this->meterNumTotalsSource = Array1D_int(OutputReportTabular::numSourceTypes, 0); + this->fuelfactorsused = Array1D_bool(OutputReportTabular::numSourceTypes, false); + this->ffUsed = Array1D_bool(OutputReportTabular::numResourceTypes, false); + this->SourceFactors = Array1D(OutputReportTabular::numResourceTypes, 0.0); + this->ffSchedUsed = Array1D_bool(OutputReportTabular::numResourceTypes, false); + this->ffSchedIndex = Array1D_int(OutputReportTabular::numResourceTypes, 0); + this->meterNumEndUseBEPS = Array2D_int(OutputReportTabular::numResourceTypes, DataGlobalConstants::iEndUse.size(), 0); + this->meterNumEndUseSubBEPS.deallocate(); + this->resourceTypeNames = Array1D_string(OutputReportTabular::numResourceTypes); + this->sourceTypeNames = Array1D_string(OutputReportTabular::numSourceTypes); + this->endUseNames = Array1D_string(DataGlobalConstants::iEndUse.size()); + this->gatherTotalsBEPS = Array1D(OutputReportTabular::numResourceTypes, 0.0); + this->gatherTotalsBySourceBEPS = Array1D(OutputReportTabular::numResourceTypes, 0.0); + this->gatherTotalsSource = Array1D(OutputReportTabular::numSourceTypes, 0.0); + this->gatherTotalsBySource = Array1D(OutputReportTabular::numSourceTypes, 0.0); + this->gatherEndUseBEPS = Array2D(OutputReportTabular::numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); + this->gatherEndUseBySourceBEPS = Array2D(OutputReportTabular::numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); + this->gatherEndUseSubBEPS.deallocate(); + this->needOtherRowLEED45 = Array1D_bool(DataGlobalConstants::iEndUse.size()); + this->gatherDemandTotal = Array1D(OutputReportTabular::numResourceTypes, 0.0); + this->gatherDemandEndUse = Array2D(OutputReportTabular::numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); + this->gatherDemandIndEndUse = Array2D(OutputReportTabular::numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); + this->gatherDemandEndUseSub.deallocate(); + this->gatherDemandIndEndUseSub.deallocate(); + this->gatherDemandTimeStamp = Array1D_int(OutputReportTabular::numResourceTypes, 0); + } }; diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 7ffd617acab..0d58d6485f5 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -3584,26 +3584,26 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_ConfirmResetBEPSGathering) UpdateMeterReporting(*state); UpdateDataandReport(*state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 3, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); + EXPECT_EQ(extLitUse * 3, state->dataOutRptTab->gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); UpdateMeterReporting(*state); UpdateDataandReport(*state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 6, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); + EXPECT_EQ(extLitUse * 6, state->dataOutRptTab->gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); UpdateMeterReporting(*state); UpdateDataandReport(*state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 9, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); + EXPECT_EQ(extLitUse * 9, state->dataOutRptTab->gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); - ResetBEPSGathering(); + ResetBEPSGathering(*state); - EXPECT_EQ(0., gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); + EXPECT_EQ(0., state->dataOutRptTab->gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); UpdateMeterReporting(*state); UpdateDataandReport(*state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 3, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); + EXPECT_EQ(extLitUse * 3, state->dataOutRptTab->gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); } TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) @@ -3622,24 +3622,24 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) int endUseNum = 1; int subEndUseNum = 1; - meterNumEndUseSubBEPS.allocate(10, 10, 10); - gatherDemandEndUseSub.allocate(10, 10, 10); - gatherDemandIndEndUseSub.allocate(10, 10, 10); + state->dataOutRptTab->meterNumEndUseSubBEPS.allocate(10, 10, 10); + state->dataOutRptTab->gatherDemandEndUseSub.allocate(10, 10, 10); + state->dataOutRptTab->gatherDemandIndEndUseSub.allocate(10, 10, 10); state->dataOutputProcessor->EnergyMeters.allocate(100); state->dataOutputProcessor->EndUseCategory.allocate(endUseNum); state->dataOutputProcessor->EndUseCategory(endUseNum).NumSubcategories = 1; - meterNumTotalsBEPS(resourceNum) = totalMeterNum; // create a test meter number - gatherDemandTotal(resourceNum) = 0.; + state->dataOutRptTab->meterNumTotalsBEPS(resourceNum) = totalMeterNum; // create a test meter number + state->dataOutRptTab->gatherDemandTotal(resourceNum) = 0.; - meterNumEndUseBEPS(resourceNum, endUseNum) = endUseMeterNum; - gatherDemandEndUse(resourceNum, endUseNum) = 0.; - gatherDemandIndEndUse(resourceNum, endUseNum) = 0.; + state->dataOutRptTab->meterNumEndUseBEPS(resourceNum, endUseNum) = endUseMeterNum; + state->dataOutRptTab->gatherDemandEndUse(resourceNum, endUseNum) = 0.; + state->dataOutRptTab->gatherDemandIndEndUse(resourceNum, endUseNum) = 0.; - meterNumEndUseSubBEPS(subEndUseNum, endUseNum, resourceNum) = subEndUseMeterNum; - gatherDemandEndUseSub(subEndUseNum, endUseNum, resourceNum) = 0.; - gatherDemandIndEndUseSub(subEndUseNum, endUseNum, resourceNum) = 0.; + state->dataOutRptTab->meterNumEndUseSubBEPS(subEndUseNum, endUseNum, resourceNum) = subEndUseMeterNum; + state->dataOutRptTab->gatherDemandEndUseSub(subEndUseNum, endUseNum, resourceNum) = 0.; + state->dataOutRptTab->gatherDemandIndEndUseSub(subEndUseNum, endUseNum, resourceNum) = 0.; // first "timestep" @@ -3649,13 +3649,13 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) GatherPeakDemandForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(123., gatherDemandTotal(resourceNum)); + EXPECT_EQ(123., state->dataOutRptTab->gatherDemandTotal(resourceNum)); - EXPECT_EQ(47., gatherDemandEndUse(resourceNum, endUseNum)); - EXPECT_EQ(47., gatherDemandIndEndUse(resourceNum, endUseNum)); + EXPECT_EQ(47., state->dataOutRptTab->gatherDemandEndUse(resourceNum, endUseNum)); + EXPECT_EQ(47., state->dataOutRptTab->gatherDemandIndEndUse(resourceNum, endUseNum)); - EXPECT_EQ(28., gatherDemandEndUseSub(subEndUseNum, endUseNum, resourceNum)); - EXPECT_EQ(28., gatherDemandIndEndUseSub(subEndUseNum, endUseNum, resourceNum)); + EXPECT_EQ(28., state->dataOutRptTab->gatherDemandEndUseSub(subEndUseNum, endUseNum, resourceNum)); + EXPECT_EQ(28., state->dataOutRptTab->gatherDemandIndEndUseSub(subEndUseNum, endUseNum, resourceNum)); // next "timestep" total higher @@ -3665,13 +3665,13 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) GatherPeakDemandForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(133., gatherDemandTotal(resourceNum)); + EXPECT_EQ(133., state->dataOutRptTab->gatherDemandTotal(resourceNum)); - EXPECT_EQ(57., gatherDemandEndUse(resourceNum, endUseNum)); - EXPECT_EQ(57., gatherDemandIndEndUse(resourceNum, endUseNum)); + EXPECT_EQ(57., state->dataOutRptTab->gatherDemandEndUse(resourceNum, endUseNum)); + EXPECT_EQ(57., state->dataOutRptTab->gatherDemandIndEndUse(resourceNum, endUseNum)); - EXPECT_EQ(38., gatherDemandEndUseSub(subEndUseNum, endUseNum, resourceNum)); - EXPECT_EQ(38., gatherDemandIndEndUseSub(subEndUseNum, endUseNum, resourceNum)); + EXPECT_EQ(38., state->dataOutRptTab->gatherDemandEndUseSub(subEndUseNum, endUseNum, resourceNum)); + EXPECT_EQ(38., state->dataOutRptTab->gatherDemandIndEndUseSub(subEndUseNum, endUseNum, resourceNum)); // next "timestep" total lower but end use higher and sub end use higher @@ -3681,13 +3681,13 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) GatherPeakDemandForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(133., gatherDemandTotal(resourceNum)); + EXPECT_EQ(133., state->dataOutRptTab->gatherDemandTotal(resourceNum)); - EXPECT_EQ(57., gatherDemandEndUse(resourceNum, endUseNum)); - EXPECT_EQ(61., gatherDemandIndEndUse(resourceNum, endUseNum)); + EXPECT_EQ(57., state->dataOutRptTab->gatherDemandEndUse(resourceNum, endUseNum)); + EXPECT_EQ(61., state->dataOutRptTab->gatherDemandIndEndUse(resourceNum, endUseNum)); - EXPECT_EQ(38., gatherDemandEndUseSub(subEndUseNum, endUseNum, resourceNum)); - EXPECT_EQ(42., gatherDemandIndEndUseSub(subEndUseNum, endUseNum, resourceNum)); + EXPECT_EQ(38., state->dataOutRptTab->gatherDemandEndUseSub(subEndUseNum, endUseNum, resourceNum)); + EXPECT_EQ(42., state->dataOutRptTab->gatherDemandIndEndUseSub(subEndUseNum, endUseNum, resourceNum)); // next "timestep" total higher but end use lower and sub end use lower @@ -3697,17 +3697,17 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) GatherPeakDemandForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(143., gatherDemandTotal(resourceNum)); + EXPECT_EQ(143., state->dataOutRptTab->gatherDemandTotal(resourceNum)); - EXPECT_EQ(59., gatherDemandEndUse(resourceNum, endUseNum)); - EXPECT_EQ(61., gatherDemandIndEndUse(resourceNum, endUseNum)); + EXPECT_EQ(59., state->dataOutRptTab->gatherDemandEndUse(resourceNum, endUseNum)); + EXPECT_EQ(61., state->dataOutRptTab->gatherDemandIndEndUse(resourceNum, endUseNum)); - EXPECT_EQ(39., gatherDemandEndUseSub(subEndUseNum, endUseNum, resourceNum)); - EXPECT_EQ(42., gatherDemandIndEndUseSub(subEndUseNum, endUseNum, resourceNum)); + EXPECT_EQ(39., state->dataOutRptTab->gatherDemandEndUseSub(subEndUseNum, endUseNum, resourceNum)); + EXPECT_EQ(42., state->dataOutRptTab->gatherDemandIndEndUseSub(subEndUseNum, endUseNum, resourceNum)); - meterNumEndUseSubBEPS.deallocate(); - gatherDemandEndUseSub.deallocate(); - gatherDemandIndEndUseSub.deallocate(); + state->dataOutRptTab->meterNumEndUseSubBEPS.deallocate(); + state->dataOutRptTab->gatherDemandEndUseSub.deallocate(); + state->dataOutRptTab->gatherDemandIndEndUseSub.deallocate(); } TEST_F(EnergyPlusFixture, OutputReportTabular_GatherHeatEmissionReport) @@ -7742,14 +7742,14 @@ TEST_F(SQLiteFixture, WriteSourceEnergyEndUseSummary_TestPerArea) { // Gross takes all that are PartOfTot Real64 expectedBuildingGrossFloorArea = Zone(1).FloorArea + Zone(2).FloorArea; - // Conditionned takes only PartOfTot AND COnditioned + // Conditioned takes only PartOfTot AND COnditioned Real64 expectedBuildingConditionedFloorArea = Zone(1).FloorArea; // Assume that we only have electricity with a value of 3.6e6 * 1e4 J =10.000 kWh. // And that this only comes for a single end use DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)=1 - OutputReportTabular::gatherEndUseBySourceBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)) = 3.6e10; - OutputReportTabular::gatherTotalsBySourceBEPS(1) = 3.6e10; + state->dataOutRptTab->gatherEndUseBySourceBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)) = 3.6e10; + state->dataOutRptTab->gatherTotalsBySourceBEPS(1) = 3.6e10; Real64 eleckWh = 1e4; state->dataOutRptTab->unitsStyle = OutputReportTabular::iUnitsStyle::JtoKWH; @@ -7906,31 +7906,31 @@ TEST_F(SQLiteFixture, OutputReportTabular_EndUseBySubcategorySQL) UpdateDataandReport(*state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); GatherPeakDemandForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_NEAR(extLitUse * 3, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)), 1.); + EXPECT_NEAR(extLitUse * 3, state->dataOutRptTab->gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)), 1.); // General - EXPECT_NEAR(extLitUse * 2, gatherEndUseSubBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); + EXPECT_NEAR(extLitUse * 2, state->dataOutRptTab->gatherEndUseSubBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); // AnotherEndUseSubCat - EXPECT_NEAR(extLitUse * 1, gatherEndUseSubBEPS(2, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); + EXPECT_NEAR(extLitUse * 1, state->dataOutRptTab->gatherEndUseSubBEPS(2, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); UpdateMeterReporting(*state); UpdateDataandReport(*state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); GatherPeakDemandForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_NEAR(extLitUse * 6, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)), 1.); + EXPECT_NEAR(extLitUse * 6, state->dataOutRptTab->gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)), 1.); // General - EXPECT_NEAR(extLitUse * 4, gatherEndUseSubBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); + EXPECT_NEAR(extLitUse * 4, state->dataOutRptTab->gatherEndUseSubBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); // AnotherEndUseSubCat - EXPECT_NEAR(extLitUse * 2, gatherEndUseSubBEPS(2, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); + EXPECT_NEAR(extLitUse * 2, state->dataOutRptTab->gatherEndUseSubBEPS(2, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); UpdateMeterReporting(*state); UpdateDataandReport(*state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); GatherPeakDemandForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_NEAR(extLitUse * 9, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)), 1.); + EXPECT_NEAR(extLitUse * 9, state->dataOutRptTab->gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)), 1.); // General - EXPECT_NEAR(extLitUse * 6, gatherEndUseSubBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); + EXPECT_NEAR(extLitUse * 6, state->dataOutRptTab->gatherEndUseSubBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); // AnotherEndUseSubCat - EXPECT_NEAR(extLitUse * 3, gatherEndUseSubBEPS(2, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); + EXPECT_NEAR(extLitUse * 3, state->dataOutRptTab->gatherEndUseSubBEPS(2, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); OutputReportTabular::WriteBEPSTable(*state); OutputReportTabular::WriteDemandEndUseSummary(*state); From 8494a180bc1dc6767a4ebc0708314f0b95a907f5 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Sat, 19 Dec 2020 11:09:41 -0700 Subject: [PATCH 09/14] moving OutputReportTabular to state --- src/EnergyPlus/EconomicTariff.cc | 24 +- src/EnergyPlus/OutputReportTabular.cc | 677 +++++++----------- src/EnergyPlus/OutputReportTabular.hh | 191 +++-- .../unit/OutputReportTabular.unit.cc | 4 +- 4 files changed, 415 insertions(+), 481 deletions(-) diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index 12d3121f9ba..7a5d207223c 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -4019,8 +4019,6 @@ namespace EnergyPlus::EconomicTariff { // MODIFIED January 2010, Kyle Benne // Added SQLite output - using OutputReportTabular::buildingConditionedFloorArea; - using OutputReportTabular::buildingGrossFloorArea; using OutputReportTabular::ConvertIP; using OutputReportTabular::DetermineBuildingFloorArea; using OutputReportTabular::LookupSItoIP; @@ -4060,7 +4058,7 @@ namespace EnergyPlus::EconomicTariff { auto &chargeBlock(state.dataEconTariff->chargeBlock); // compute floor area if no ABUPS - if (buildingConditionedFloorArea == 0.0) { + if (state.dataOutRptTab->buildingConditionedFloorArea == 0.0) { DetermineBuildingFloorArea(state); } @@ -4121,17 +4119,17 @@ namespace EnergyPlus::EconomicTariff { tableBody(2, 1) = RealToStr(gasTotalCost, 2); tableBody(3, 1) = RealToStr(otherTotalCost, 2); tableBody(4, 1) = RealToStr(allTotalCost, 2); - if (buildingGrossFloorArea > 0.0) { - tableBody(1, 2) = RealToStr((elecTotalCost / buildingGrossFloorArea) * perAreaUnitConv, 2); - tableBody(2, 2) = RealToStr((gasTotalCost / buildingGrossFloorArea) * perAreaUnitConv, 2); - tableBody(3, 2) = RealToStr((otherTotalCost / buildingGrossFloorArea) * perAreaUnitConv, 2); - tableBody(4, 2) = RealToStr((allTotalCost / buildingGrossFloorArea) * perAreaUnitConv, 2); + if (state.dataOutRptTab->buildingGrossFloorArea > 0.0) { + tableBody(1, 2) = RealToStr((elecTotalCost / state.dataOutRptTab->buildingGrossFloorArea) * perAreaUnitConv, 2); + tableBody(2, 2) = RealToStr((gasTotalCost / state.dataOutRptTab->buildingGrossFloorArea) * perAreaUnitConv, 2); + tableBody(3, 2) = RealToStr((otherTotalCost / state.dataOutRptTab->buildingGrossFloorArea) * perAreaUnitConv, 2); + tableBody(4, 2) = RealToStr((allTotalCost / state.dataOutRptTab->buildingGrossFloorArea) * perAreaUnitConv, 2); } - if (buildingConditionedFloorArea > 0.0) { - tableBody(1, 3) = RealToStr((elecTotalCost / buildingConditionedFloorArea) * perAreaUnitConv, 2); - tableBody(2, 3) = RealToStr((gasTotalCost / buildingConditionedFloorArea) * perAreaUnitConv, 2); - tableBody(3, 3) = RealToStr((otherTotalCost / buildingConditionedFloorArea) * perAreaUnitConv, 2); - tableBody(4, 3) = RealToStr((allTotalCost / buildingConditionedFloorArea) * perAreaUnitConv, 2); + if (state.dataOutRptTab->buildingConditionedFloorArea > 0.0) { + tableBody(1, 3) = RealToStr((elecTotalCost / state.dataOutRptTab->buildingConditionedFloorArea) * perAreaUnitConv, 2); + tableBody(2, 3) = RealToStr((gasTotalCost / state.dataOutRptTab->buildingConditionedFloorArea) * perAreaUnitConv, 2); + tableBody(3, 3) = RealToStr((otherTotalCost / state.dataOutRptTab->buildingConditionedFloorArea) * perAreaUnitConv, 2); + tableBody(4, 3) = RealToStr((allTotalCost / state.dataOutRptTab->buildingConditionedFloorArea) * perAreaUnitConv, 2); } columnWidth = 14; // array assignment - same for all columns WriteSubtitle(state, "Annual Cost"); diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index e3aa6f7d3dd..54216af5381 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -177,72 +177,6 @@ namespace EnergyPlus::OutputReportTabular { // arrays for time binned results - // to keep track of hours for the BEPS report gathering - Real64 gatherElapsedTimeBEPS(0.0); - // for normalization of results - Real64 buildingGrossFloorArea(0.0); - Real64 buildingConditionedFloorArea(0.0); - // keep track if schedules are used in fuel factors - bool fuelFactorSchedulesUsed(false); - // for electric load components on BEPS report - int meterNumPowerFuelFireGen(0); - Real64 gatherPowerFuelFireGen(0.0); - int meterNumPowerPV(0); - Real64 gatherPowerPV(0.0); - int meterNumPowerWind(0); - Real64 gatherPowerWind(0.0); - Real64 OverallNetEnergyFromStorage(0.0); - int meterNumPowerHTGeothermal(0); - Real64 gatherPowerHTGeothermal(0.0); - int meterNumElecProduced(0); - Real64 gatherElecProduced(0.0); - int meterNumElecPurchased(0); - Real64 gatherElecPurchased(0.0); - int meterNumElecSurplusSold(0); - Real64 gatherElecSurplusSold(0.0); - int meterNumElecStorage = (0); - Real64 gatherElecStorage = (0.0); - int meterNumPowerConversion = (0); - Real64 gatherPowerConversion = (0.0); - // for on site thermal source components on BEPS report - int meterNumWaterHeatRecovery(0); - Real64 gatherWaterHeatRecovery(0.0); - int meterNumAirHeatRecoveryCool(0); - Real64 gatherAirHeatRecoveryCool(0.0); - int meterNumAirHeatRecoveryHeat(0); - Real64 gatherAirHeatRecoveryHeat(0.0); - int meterNumHeatHTGeothermal(0); - Real64 gatherHeatHTGeothermal(0.0); - int meterNumHeatSolarWater(0); - Real64 gatherHeatSolarWater(0.0); - int meterNumHeatSolarAir(0); - Real64 gatherHeatSolarAir(0.0); - // for on site water components on BEPS report - int meterNumRainWater(0); - Real64 gatherRainWater(0.0); - int meterNumCondensate(0); - Real64 gatherCondensate(0.0); - int meterNumGroundwater(0); - Real64 gatherWellwater(0.0); - int meterNumMains(0); - Real64 gatherMains(0.0); - int meterNumWaterEndUseTotal(0); - Real64 gatherWaterEndUseTotal(0.0); - // for source energy conversion factors on BEPS report - Real64 sourceFactorElectric(0.0); - Real64 sourceFactorNaturalGas(0.0); - Real64 efficiencyDistrictCooling(0.0); - Real64 efficiencyDistrictHeating(0.0); - Real64 sourceFactorSteam(0.0); - Real64 sourceFactorGasoline(0.0); - Real64 sourceFactorDiesel(0.0); - Real64 sourceFactorCoal(0.0); - Real64 sourceFactorFuelOil1(0.0); - Real64 sourceFactorFuelOil2(0.0); - Real64 sourceFactorPropane(0.0); - Real64 sourceFactorOtherFuel1(0.0); - Real64 sourceFactorOtherFuel2(0.0); - Array1D_int td(8); //(1) Current year //(2) Current month @@ -303,7 +237,6 @@ namespace EnergyPlus::OutputReportTabular { Array3D interZoneMixLatentSeq; Array3D feneCondInstantSeq; - // REAL(r64), DIMENSION(:,:,:),ALLOCATABLE,PUBLIC :: feneSolarInstantSeq Array3D feneSolarRadSeq; int maxUniqueKeyCount(0); @@ -350,60 +283,6 @@ namespace EnergyPlus::OutputReportTabular { GatherHeatGainReportfirstTime = true; AllocateLoadComponentArraysDoAllocate = true; initAdjFenDone = false; - gatherElapsedTimeBEPS = 0.0; - buildingGrossFloorArea = 0.0; - buildingConditionedFloorArea = 0.0; - fuelFactorSchedulesUsed = false; - meterNumPowerFuelFireGen = 0; - gatherPowerFuelFireGen = 0.0; - meterNumPowerPV = 0; - gatherPowerPV = 0.0; - meterNumPowerWind = 0; - gatherPowerWind = 0.0; - OverallNetEnergyFromStorage = 0.0; - meterNumPowerHTGeothermal = 0; - gatherPowerHTGeothermal = 0.0; - meterNumElecProduced = 0; - gatherElecProduced = 0.0; - meterNumElecPurchased = 0; - gatherElecPurchased = 0.0; - meterNumElecSurplusSold = 0; - gatherElecSurplusSold = 0.0; - meterNumWaterHeatRecovery = 0; - gatherWaterHeatRecovery = 0.0; - meterNumAirHeatRecoveryCool = 0; - gatherAirHeatRecoveryCool = 0.0; - meterNumAirHeatRecoveryHeat = 0; - gatherAirHeatRecoveryHeat = 0.0; - meterNumHeatHTGeothermal = 0; - gatherHeatHTGeothermal = 0.0; - meterNumHeatSolarWater = 0; - gatherHeatSolarWater = 0.0; - meterNumHeatSolarAir = 0; - gatherHeatSolarAir = 0.0; - meterNumRainWater = 0; - gatherRainWater = 0.0; - meterNumCondensate = 0; - gatherCondensate = 0.0; - meterNumGroundwater = 0; - gatherWellwater = 0.0; - meterNumMains = 0; - gatherMains = 0.0; - meterNumWaterEndUseTotal = 0; - gatherWaterEndUseTotal = 0.0; - sourceFactorElectric = 0.0; - sourceFactorNaturalGas = 0.0; - efficiencyDistrictCooling = 0.0; - efficiencyDistrictHeating = 0.0; - sourceFactorSteam = 0.0; - sourceFactorGasoline = 0.0; - sourceFactorDiesel = 0.0; - sourceFactorCoal = 0.0; - sourceFactorFuelOil1 = 0.0; - sourceFactorFuelOil2 = 0.0; - sourceFactorPropane = 0.0; - sourceFactorOtherFuel1 = 0.0; - sourceFactorOtherFuel2 = 0.0; DesignDayName.deallocate(); DesignDayCount = 0; radiantPulseTimestep.deallocate(); @@ -514,7 +393,7 @@ namespace EnergyPlus::OutputReportTabular { } if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { - gatherElapsedTimeBEPS += state.dataGlobal->TimeStepZone; + state.dataOutRptTab->gatherElapsedTimeBEPS += state.dataGlobal->TimeStepZone; } if (state.dataGlobal->DoWeathSim) { GatherMonthlyResultsForTimestep(state, t_timeStepType); @@ -2072,61 +1951,61 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptTab->gatherDemandIndEndUseSub = 0.0; // get meter numbers for other meters relating to electric load components - meterNumPowerFuelFireGen = GetMeterIndex(state, "Cogeneration:ElectricityProduced"); - meterNumPowerPV = GetMeterIndex(state, "Photovoltaic:ElectricityProduced"); - meterNumPowerWind = GetMeterIndex(state, "WindTurbine:ElectricityProduced"); - meterNumPowerHTGeothermal = GetMeterIndex(state, "HTGeothermal:ElectricityProduced"); - meterNumElecStorage = GetMeterIndex(state, "ElectricStorage:ElectricityProduced"); - meterNumPowerConversion = GetMeterIndex(state, "PowerConversion:ElectricityProduced"); - meterNumElecProduced = GetMeterIndex(state, "ElectricityProduced:Facility"); - meterNumElecPurchased = GetMeterIndex(state, "ElectricityPurchased:Facility"); - meterNumElecSurplusSold = GetMeterIndex(state, "ElectricitySurplusSold:Facility"); + state.dataOutRptTab->meterNumPowerFuelFireGen = GetMeterIndex(state, "Cogeneration:ElectricityProduced"); + state.dataOutRptTab->meterNumPowerPV = GetMeterIndex(state, "Photovoltaic:ElectricityProduced"); + state.dataOutRptTab->meterNumPowerWind = GetMeterIndex(state, "WindTurbine:ElectricityProduced"); + state.dataOutRptTab->meterNumPowerHTGeothermal = GetMeterIndex(state, "HTGeothermal:ElectricityProduced"); + state.dataOutRptTab->meterNumElecStorage = GetMeterIndex(state, "ElectricStorage:ElectricityProduced"); + state.dataOutRptTab->meterNumPowerConversion = GetMeterIndex(state, "PowerConversion:ElectricityProduced"); + state.dataOutRptTab->meterNumElecProduced = GetMeterIndex(state, "ElectricityProduced:Facility"); + state.dataOutRptTab->meterNumElecPurchased = GetMeterIndex(state, "ElectricityPurchased:Facility"); + state.dataOutRptTab->meterNumElecSurplusSold = GetMeterIndex(state, "ElectricitySurplusSold:Facility"); // if no ElectricityPurchased:Facility meter is defined then no electric load center // was created by the user and no power generation will occur in the plant. The amount // purchased would be the total end use. - if (meterNumElecPurchased == 0) { - meterNumElecPurchased = GetMeterIndex(state, "Electricity:Facility"); + if (state.dataOutRptTab->meterNumElecPurchased == 0) { + state.dataOutRptTab->meterNumElecPurchased = GetMeterIndex(state, "Electricity:Facility"); } // initialize the gathering variables for the electric load components - gatherPowerFuelFireGen = 0.0; - gatherPowerPV = 0.0; - gatherPowerWind = 0.0; - gatherPowerHTGeothermal = 0.0; - gatherElecProduced = 0.0; - gatherElecPurchased = 0.0; - gatherElecSurplusSold = 0.0; - gatherElecStorage = 0.0; - gatherPowerConversion = 0.0; + state.dataOutRptTab->gatherPowerFuelFireGen = 0.0; + state.dataOutRptTab->gatherPowerPV = 0.0; + state.dataOutRptTab->gatherPowerWind = 0.0; + state.dataOutRptTab->gatherPowerHTGeothermal = 0.0; + state.dataOutRptTab->gatherElecProduced = 0.0; + state.dataOutRptTab->gatherElecPurchased = 0.0; + state.dataOutRptTab->gatherElecSurplusSold = 0.0; + state.dataOutRptTab->gatherElecStorage = 0.0; + state.dataOutRptTab->gatherPowerConversion = 0.0; // get meter numbers for onsite thermal components on BEPS report - meterNumWaterHeatRecovery = GetMeterIndex(state, "HeatRecovery:EnergyTransfer"); - meterNumAirHeatRecoveryCool = GetMeterIndex(state, "HeatRecoveryForCooling:EnergyTransfer"); - meterNumAirHeatRecoveryHeat = GetMeterIndex(state, "HeatRecoveryForHeating:EnergyTransfer"); - meterNumHeatHTGeothermal = GetMeterIndex(state, "HTGeothermal:HeatProduced"); - meterNumHeatSolarWater = GetMeterIndex(state, "SolarWater:Facility"); - meterNumHeatSolarAir = GetMeterIndex(state, "HeatProduced:SolarAir"); + state.dataOutRptTab->meterNumWaterHeatRecovery = GetMeterIndex(state, "HeatRecovery:EnergyTransfer"); + state.dataOutRptTab->meterNumAirHeatRecoveryCool = GetMeterIndex(state, "HeatRecoveryForCooling:EnergyTransfer"); + state.dataOutRptTab->meterNumAirHeatRecoveryHeat = GetMeterIndex(state, "HeatRecoveryForHeating:EnergyTransfer"); + state.dataOutRptTab->meterNumHeatHTGeothermal = GetMeterIndex(state, "HTGeothermal:HeatProduced"); + state.dataOutRptTab->meterNumHeatSolarWater = GetMeterIndex(state, "SolarWater:Facility"); + state.dataOutRptTab->meterNumHeatSolarAir = GetMeterIndex(state, "HeatProduced:SolarAir"); // initialize the gathering variables for onsite thermal components on BEPS report - gatherWaterHeatRecovery = 0.0; - gatherAirHeatRecoveryCool = 0.0; - gatherAirHeatRecoveryHeat = 0.0; - gatherHeatHTGeothermal = 0.0; - gatherHeatSolarWater = 0.0; - gatherHeatSolarAir = 0.0; + state.dataOutRptTab->gatherWaterHeatRecovery = 0.0; + state.dataOutRptTab->gatherAirHeatRecoveryCool = 0.0; + state.dataOutRptTab->gatherAirHeatRecoveryHeat = 0.0; + state.dataOutRptTab->gatherHeatHTGeothermal = 0.0; + state.dataOutRptTab->gatherHeatSolarWater = 0.0; + state.dataOutRptTab->gatherHeatSolarAir = 0.0; // get meter numbers for water components on BEPS report - meterNumRainWater = GetMeterIndex(state, "Rainwater:OnSiteWater"); - meterNumCondensate = GetMeterIndex(state, "Condensate:OnSiteWater"); - meterNumGroundwater = GetMeterIndex(state, "Wellwater:OnSiteWater"); - meterNumMains = GetMeterIndex(state, "MainsWater:Facility"); - meterNumWaterEndUseTotal = GetMeterIndex(state, "Water:Facility"); + state.dataOutRptTab->meterNumRainWater = GetMeterIndex(state, "Rainwater:OnSiteWater"); + state.dataOutRptTab->meterNumCondensate = GetMeterIndex(state, "Condensate:OnSiteWater"); + state.dataOutRptTab->meterNumGroundwater = GetMeterIndex(state, "Wellwater:OnSiteWater"); + state.dataOutRptTab->meterNumMains = GetMeterIndex(state, "MainsWater:Facility"); + state.dataOutRptTab->meterNumWaterEndUseTotal = GetMeterIndex(state, "Water:Facility"); // initialize the gathering variables for water components on BEPS report - gatherRainWater = 0.0; - gatherCondensate = 0.0; - gatherWellwater = 0.0; - gatherMains = 0.0; - gatherWaterEndUseTotal = 0.0; + state.dataOutRptTab->gatherRainWater = 0.0; + state.dataOutRptTab->gatherCondensate = 0.0; + state.dataOutRptTab->gatherWellwater = 0.0; + state.dataOutRptTab->gatherMains = 0.0; + state.dataOutRptTab->gatherWaterEndUseTotal = 0.0; } } @@ -3053,20 +2932,20 @@ namespace EnergyPlus::OutputReportTabular { int ffScheduleIndex; // set the default factors for source energy - they will be overwritten if the user sets any values - sourceFactorElectric = 3.167; - sourceFactorNaturalGas = 1.084; - sourceFactorSteam = 1.20; - sourceFactorGasoline = 1.05; - sourceFactorDiesel = 1.05; - sourceFactorCoal = 1.05; - sourceFactorFuelOil1 = 1.05; - sourceFactorFuelOil2 = 1.05; - sourceFactorPropane = 1.05; - sourceFactorOtherFuel1 = 1.0; - sourceFactorOtherFuel2 = 1.0; + state.dataOutRptTab->sourceFactorElectric = 3.167; + state.dataOutRptTab->sourceFactorNaturalGas = 1.084; + state.dataOutRptTab->sourceFactorSteam = 1.20; + state.dataOutRptTab->sourceFactorGasoline = 1.05; + state.dataOutRptTab->sourceFactorDiesel = 1.05; + state.dataOutRptTab->sourceFactorCoal = 1.05; + state.dataOutRptTab->sourceFactorFuelOil1 = 1.05; + state.dataOutRptTab->sourceFactorFuelOil2 = 1.05; + state.dataOutRptTab->sourceFactorPropane = 1.05; + state.dataOutRptTab->sourceFactorOtherFuel1 = 1.0; + state.dataOutRptTab->sourceFactorOtherFuel2 = 1.0; // the following should be kept consistent with the assumptions in the pollution calculation routines - efficiencyDistrictCooling = 3.0; - efficiencyDistrictHeating = 0.3; + state.dataOutRptTab->efficiencyDistrictCooling = 3.0; + state.dataOutRptTab->efficiencyDistrictHeating = 0.3; // TotalSourceEnergyUse = (gatherTotalsSource(1) & !total source from electricity // + gatherTotalsSource(2) & !natural gas @@ -3083,104 +2962,104 @@ namespace EnergyPlus::OutputReportTabular { GetFuelFactorInfo(state, "NaturalGas", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - sourceFactorNaturalGas = curSourceFactor; + state.dataOutRptTab->sourceFactorNaturalGas = curSourceFactor; state.dataOutRptTab->fuelfactorsused(2) = true; state.dataOutRptTab->ffUsed(2) = true; } state.dataOutRptTab->SourceFactors(2) = curSourceFactor; if (fFScheduleUsed) { - fuelFactorSchedulesUsed = true; + state.dataOutRptTab->fuelFactorSchedulesUsed = true; state.dataOutRptTab->ffSchedUsed(2) = true; state.dataOutRptTab->ffSchedIndex(2) = ffScheduleIndex; } GetFuelFactorInfo(state, "FuelOilNo2", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - sourceFactorFuelOil2 = curSourceFactor; + state.dataOutRptTab->sourceFactorFuelOil2 = curSourceFactor; state.dataOutRptTab->fuelfactorsused(7) = true; state.dataOutRptTab->ffUsed(11) = true; } state.dataOutRptTab->SourceFactors(11) = curSourceFactor; if (fFScheduleUsed) { - fuelFactorSchedulesUsed = true; + state.dataOutRptTab->fuelFactorSchedulesUsed = true; state.dataOutRptTab->ffSchedUsed(11) = true; state.dataOutRptTab->ffSchedIndex(11) = ffScheduleIndex; } GetFuelFactorInfo(state, "FuelOilNo1", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - sourceFactorFuelOil1 = curSourceFactor; + state.dataOutRptTab->sourceFactorFuelOil1 = curSourceFactor; state.dataOutRptTab->fuelfactorsused(6) = true; state.dataOutRptTab->ffUsed(10) = true; } state.dataOutRptTab->SourceFactors(10) = curSourceFactor; if (fFScheduleUsed) { - fuelFactorSchedulesUsed = true; + state.dataOutRptTab->fuelFactorSchedulesUsed = true; state.dataOutRptTab->ffSchedUsed(10) = true; state.dataOutRptTab->ffSchedIndex(10) = ffScheduleIndex; } GetFuelFactorInfo(state, "Coal", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - sourceFactorCoal = curSourceFactor; + state.dataOutRptTab->sourceFactorCoal = curSourceFactor; state.dataOutRptTab->fuelfactorsused(5) = true; state.dataOutRptTab->ffUsed(9) = true; } state.dataOutRptTab->SourceFactors(9) = curSourceFactor; if (fFScheduleUsed) { - fuelFactorSchedulesUsed = true; + state.dataOutRptTab->fuelFactorSchedulesUsed = true; state.dataOutRptTab->ffSchedUsed(9) = true; state.dataOutRptTab->ffSchedIndex(9) = ffScheduleIndex; } GetFuelFactorInfo(state, "Electricity", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - sourceFactorElectric = curSourceFactor; + state.dataOutRptTab->sourceFactorElectric = curSourceFactor; state.dataOutRptTab->fuelfactorsused(1) = true; state.dataOutRptTab->ffUsed(1) = true; } state.dataOutRptTab->SourceFactors(1) = curSourceFactor; if (fFScheduleUsed) { - fuelFactorSchedulesUsed = true; + state.dataOutRptTab->fuelFactorSchedulesUsed = true; state.dataOutRptTab->ffSchedUsed(1) = true; state.dataOutRptTab->ffSchedIndex(1) = ffScheduleIndex; } GetFuelFactorInfo(state, "Gasoline", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - sourceFactorGasoline = curSourceFactor; + state.dataOutRptTab->sourceFactorGasoline = curSourceFactor; state.dataOutRptTab->fuelfactorsused(3) = true; state.dataOutRptTab->ffUsed(6) = true; } state.dataOutRptTab->SourceFactors(6) = curSourceFactor; if (fFScheduleUsed) { - fuelFactorSchedulesUsed = true; + state.dataOutRptTab->fuelFactorSchedulesUsed = true; state.dataOutRptTab->ffSchedUsed(6) = true; state.dataOutRptTab->ffSchedIndex(6) = ffScheduleIndex; } GetFuelFactorInfo(state, "Propane", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - sourceFactorPropane = curSourceFactor; + state.dataOutRptTab->sourceFactorPropane = curSourceFactor; state.dataOutRptTab->fuelfactorsused(8) = true; state.dataOutRptTab->ffUsed(12) = true; } state.dataOutRptTab->SourceFactors(12) = curSourceFactor; if (fFScheduleUsed) { - fuelFactorSchedulesUsed = true; + state.dataOutRptTab->fuelFactorSchedulesUsed = true; state.dataOutRptTab->ffSchedUsed(12) = true; state.dataOutRptTab->ffSchedIndex(12) = ffScheduleIndex; } GetFuelFactorInfo(state, "Diesel", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - sourceFactorDiesel = curSourceFactor; + state.dataOutRptTab->sourceFactorDiesel = curSourceFactor; state.dataOutRptTab->fuelfactorsused(4) = true; state.dataOutRptTab->ffUsed(8) = true; } state.dataOutRptTab->SourceFactors(8) = curSourceFactor; if (fFScheduleUsed) { - fuelFactorSchedulesUsed = true; + state.dataOutRptTab->fuelFactorSchedulesUsed = true; state.dataOutRptTab->ffSchedUsed(8) = true; state.dataOutRptTab->ffSchedIndex(8) = ffScheduleIndex; } @@ -3217,31 +3096,31 @@ namespace EnergyPlus::OutputReportTabular { GetFuelFactorInfo(state, "OtherFuel1", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - sourceFactorOtherFuel1 = curSourceFactor; + state.dataOutRptTab->sourceFactorOtherFuel1 = curSourceFactor; state.dataOutRptTab->fuelfactorsused(11) = true; // should be source number state.dataOutRptTab->ffUsed(13) = true; } state.dataOutRptTab->SourceFactors(13) = curSourceFactor; if (fFScheduleUsed) { - fuelFactorSchedulesUsed = true; + state.dataOutRptTab->fuelFactorSchedulesUsed = true; state.dataOutRptTab->ffSchedUsed(13) = true; state.dataOutRptTab->ffSchedIndex(13) = ffScheduleIndex; } GetFuelFactorInfo(state, "OtherFuel2", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - sourceFactorOtherFuel2 = curSourceFactor; + state.dataOutRptTab->sourceFactorOtherFuel2 = curSourceFactor; state.dataOutRptTab->fuelfactorsused(12) = true; // should be source number state.dataOutRptTab->ffUsed(14) = true; } state.dataOutRptTab->SourceFactors(14) = curSourceFactor; if (fFScheduleUsed) { - fuelFactorSchedulesUsed = true; + state.dataOutRptTab->fuelFactorSchedulesUsed = true; state.dataOutRptTab->ffSchedUsed(14) = true; state.dataOutRptTab->ffSchedIndex(14) = ffScheduleIndex; } - GetEnvironmentalImpactFactorInfo(state, efficiencyDistrictHeating, efficiencyDistrictCooling, sourceFactorSteam); + GetEnvironmentalImpactFactorInfo(state, state.dataOutRptTab->efficiencyDistrictHeating, state.dataOutRptTab->efficiencyDistrictCooling, state.dataOutRptTab->sourceFactorSteam); } //====================================================================================================================== @@ -4239,28 +4118,28 @@ namespace EnergyPlus::OutputReportTabular { } // gather the electric load components - gatherPowerFuelFireGen += GetCurrentMeterValue(state, meterNumPowerFuelFireGen); - gatherPowerPV += GetCurrentMeterValue(state, meterNumPowerPV); - gatherPowerWind += GetCurrentMeterValue(state, meterNumPowerWind); - gatherPowerHTGeothermal += GetCurrentMeterValue(state, meterNumPowerHTGeothermal); - gatherElecProduced += GetCurrentMeterValue(state, meterNumElecProduced); - gatherElecPurchased += GetCurrentMeterValue(state, meterNumElecPurchased); - gatherElecSurplusSold += GetCurrentMeterValue(state, meterNumElecSurplusSold); - gatherElecStorage += GetCurrentMeterValue(state, meterNumElecStorage); - gatherPowerConversion += GetCurrentMeterValue(state, meterNumPowerConversion); + state.dataOutRptTab->gatherPowerFuelFireGen += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumPowerFuelFireGen); + state.dataOutRptTab->gatherPowerPV += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumPowerPV); + state.dataOutRptTab->gatherPowerWind += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumPowerWind); + state.dataOutRptTab->gatherPowerHTGeothermal += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumPowerHTGeothermal); + state.dataOutRptTab->gatherElecProduced += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumElecProduced); + state.dataOutRptTab->gatherElecPurchased += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumElecPurchased); + state.dataOutRptTab->gatherElecSurplusSold += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumElecSurplusSold); + state.dataOutRptTab->gatherElecStorage += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumElecStorage); + state.dataOutRptTab->gatherPowerConversion += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumPowerConversion); // gather the onsite thermal components - gatherWaterHeatRecovery += GetCurrentMeterValue(state, meterNumWaterHeatRecovery); - gatherAirHeatRecoveryCool += GetCurrentMeterValue(state, meterNumAirHeatRecoveryCool); - gatherAirHeatRecoveryHeat += GetCurrentMeterValue(state, meterNumAirHeatRecoveryHeat); - gatherHeatHTGeothermal += GetCurrentMeterValue(state, meterNumHeatHTGeothermal); - gatherHeatSolarWater += GetCurrentMeterValue(state, meterNumHeatSolarWater); - gatherHeatSolarAir += GetCurrentMeterValue(state, meterNumHeatSolarAir); + state.dataOutRptTab->gatherWaterHeatRecovery += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumWaterHeatRecovery); + state.dataOutRptTab->gatherAirHeatRecoveryCool += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumAirHeatRecoveryCool); + state.dataOutRptTab->gatherAirHeatRecoveryHeat += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumAirHeatRecoveryHeat); + state.dataOutRptTab->gatherHeatHTGeothermal += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumHeatHTGeothermal); + state.dataOutRptTab->gatherHeatSolarWater += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumHeatSolarWater); + state.dataOutRptTab->gatherHeatSolarAir += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumHeatSolarAir); // gather the water supply components - gatherRainWater += GetCurrentMeterValue(state, meterNumRainWater); - gatherCondensate += GetCurrentMeterValue(state, meterNumCondensate); - gatherWellwater += GetCurrentMeterValue(state, meterNumGroundwater); - gatherMains += GetCurrentMeterValue(state, meterNumMains); - gatherWaterEndUseTotal += GetCurrentMeterValue(state, meterNumWaterEndUseTotal); + state.dataOutRptTab->gatherRainWater += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumRainWater); + state.dataOutRptTab->gatherCondensate += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumCondensate); + state.dataOutRptTab->gatherWellwater += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumGroundwater); + state.dataOutRptTab->gatherMains += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumMains); + state.dataOutRptTab->gatherWaterEndUseTotal += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumWaterEndUseTotal); } } @@ -6179,13 +6058,13 @@ namespace EnergyPlus::OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtAvgHrSchd, Lights(iLight).Name, ScheduleAverageHoursPerWeek(state, Lights(iLight).SchedPtr, StartOfWeek, state.dataEnvrn->CurrentYearIsLeapYear)); // average operating hours per week - if (gatherElapsedTimeBEPS > 0) { - HrsPerWeek = 24 * 7 * Lights(iLight).SumTimeNotZeroCons / gatherElapsedTimeBEPS; + if (state.dataOutRptTab->gatherElapsedTimeBEPS > 0) { + HrsPerWeek = 24 * 7 * Lights(iLight).SumTimeNotZeroCons / state.dataOutRptTab->gatherElapsedTimeBEPS; PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtAvgHrOper, Lights(iLight).Name, HrsPerWeek); } // full load hours per week - if ((Lights(iLight).DesignLevel * gatherElapsedTimeBEPS) > 0) { - HrsPerWeek = 24 * 7 * Lights(iLight).SumConsumption / (Lights(iLight).DesignLevel * gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour); + if ((Lights(iLight).DesignLevel * state.dataOutRptTab->gatherElapsedTimeBEPS) > 0) { + HrsPerWeek = 24 * 7 * Lights(iLight).SumConsumption / (Lights(iLight).DesignLevel * state.dataOutRptTab->gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour); PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtFullLoadHrs, Lights(iLight).Name, HrsPerWeek); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtConsump, Lights(iLight).Name, Lights(iLight).SumConsumption * mult / 1000000000.0); @@ -6202,14 +6081,14 @@ namespace EnergyPlus::OutputReportTabular { ScheduleAverageHoursPerWeek(state, state.dataExteriorEnergyUse->ExteriorLights(iLight).SchedPtr, StartOfWeek, state.dataEnvrn->CurrentYearIsLeapYear)); } // average operating hours per week - if (gatherElapsedTimeBEPS > 0) { - HrsPerWeek = 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumTimeNotZeroCons / gatherElapsedTimeBEPS; + if (state.dataOutRptTab->gatherElapsedTimeBEPS > 0) { + HrsPerWeek = 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumTimeNotZeroCons / state.dataOutRptTab->gatherElapsedTimeBEPS; PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtAvgHrOper, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, HrsPerWeek); } // full load hours per week - if ((state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * gatherElapsedTimeBEPS) > 0) { + if ((state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * state.dataOutRptTab->gatherElapsedTimeBEPS) > 0) { HrsPerWeek = - 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / (state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour); + 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / (state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * state.dataOutRptTab->gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour); PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtFullLoadHrs, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, HrsPerWeek); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtConsump, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / 1000000000.0); @@ -7256,8 +7135,8 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataOutRptTab->displayTabularBEPS) { WriteReportHeaders(state, "Annual Building Utility Performance Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // show the number of hours that the table applies to - WriteTextLine(state, "Values gathered over " + RealToStr(gatherElapsedTimeBEPS, 2) + " hours", true); - if (gatherElapsedTimeBEPS < 8759.0) { // might not add up to 8760 exactly but can't be more than 1 hour diff. + WriteTextLine(state, "Values gathered over " + RealToStr(state.dataOutRptTab->gatherElapsedTimeBEPS, 2) + " hours", true); + if (state.dataOutRptTab->gatherElapsedTimeBEPS < 8759.0) { // might not add up to 8760 exactly but can't be more than 1 hour diff. WriteTextLine(state, "WARNING: THE REPORT DOES NOT REPRESENT A FULL ANNUAL SIMULATION.", true); } WriteTextLine(state, "", true); @@ -7310,7 +7189,7 @@ namespace EnergyPlus::OutputReportTabular { UtilityRoutines::appendPerfLog(state, "District Cooling ABUPS Total [J]", format("{:.3R}", collapsedTotal(11))); UtilityRoutines::appendPerfLog(state, "District Heating ABUPS Total [J]", format("{:.3R}", collapsedTotal(12))); UtilityRoutines::appendPerfLog(state, "Water ABUPS Total [m3]", format("{:.3R}", collapsedTotal(13))); - UtilityRoutines::appendPerfLog(state, "Values Gathered Over [hours]", format("{:.2R}", gatherElapsedTimeBEPS)); + UtilityRoutines::appendPerfLog(state, "Values Gathered Over [hours]", format("{:.2R}", state.dataOutRptTab->gatherElapsedTimeBEPS)); UtilityRoutines::appendPerfLog(state, "Facility Any Zone Oscillating Temperatures Time [hours]", format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillate)); @@ -7363,8 +7242,8 @@ namespace EnergyPlus::OutputReportTabular { } // convert floor areas - convBldgGrossFloorArea = buildingGrossFloorArea / areaConversionFactor; - convBldgCondFloorArea = buildingConditionedFloorArea / areaConversionFactor; + convBldgGrossFloorArea = state.dataOutRptTab->buildingGrossFloorArea / areaConversionFactor; + convBldgCondFloorArea = state.dataOutRptTab->buildingConditionedFloorArea / areaConversionFactor; // convert units into GJ (divide by 1,000,000,000) if J otherwise kWh for (iResource = 1; iResource <= 12; ++iResource) { // don't do water @@ -7387,24 +7266,24 @@ namespace EnergyPlus::OutputReportTabular { collapsedTotal(13) = WaterConversionFunct(collapsedTotal(13), waterConversionFactor); // convert to GJ - gatherPowerFuelFireGen /= largeConversionFactor; - gatherPowerPV /= largeConversionFactor; - gatherPowerWind /= largeConversionFactor; - gatherPowerHTGeothermal /= largeConversionFactor; - gatherPowerConversion /= largeConversionFactor; - gatherElecProduced /= largeConversionFactor; - gatherElecPurchased /= largeConversionFactor; - gatherElecSurplusSold /= largeConversionFactor; + state.dataOutRptTab->gatherPowerFuelFireGen /= largeConversionFactor; + state.dataOutRptTab->gatherPowerPV /= largeConversionFactor; + state.dataOutRptTab->gatherPowerWind /= largeConversionFactor; + state.dataOutRptTab->gatherPowerHTGeothermal /= largeConversionFactor; + state.dataOutRptTab->gatherPowerConversion /= largeConversionFactor; + state.dataOutRptTab->gatherElecProduced /= largeConversionFactor; + state.dataOutRptTab->gatherElecPurchased /= largeConversionFactor; + state.dataOutRptTab->gatherElecSurplusSold /= largeConversionFactor; // get change in overall state of charge for electrical storage devices. if (facilityElectricServiceObj->numElecStorageDevices > 0) { // All flow in/out of storage is accounted for in gatherElecStorage, so separate calculation of change in state of charge is not // necessary OverallNetEnergyFromStorage = ( sum( ElecStorage.StartingEnergyStored() ) - sum( ElecStorage.ThisTimeStepStateOfCharge() // ) ) + gatherElecStorage; - OverallNetEnergyFromStorage = gatherElecStorage; - OverallNetEnergyFromStorage /= largeConversionFactor; + state.dataOutRptTab->OverallNetEnergyFromStorage = state.dataOutRptTab->gatherElecStorage; + state.dataOutRptTab->OverallNetEnergyFromStorage /= largeConversionFactor; } else { - OverallNetEnergyFromStorage = 0.0; + state.dataOutRptTab->OverallNetEnergyFromStorage = 0.0; } // determine which resource is the primary heating resourse resourcePrimaryHeating = 0; @@ -7458,7 +7337,7 @@ namespace EnergyPlus::OutputReportTabular { largeConversionFactor; // electricity | natural gas | district cooling | district heating | steam | gasoline | diesel // | coal | Fuel Oil No1 | Fuel Oil No2 | propane | otherfuel1 | otherfuel2 - netElecPurchasedSold = gatherElecPurchased - gatherElecSurplusSold; + netElecPurchasedSold = state.dataOutRptTab->gatherElecPurchased - state.dataOutRptTab->gatherElecSurplusSold; // water is not included gatherTotalsBEPS(7) !water netSiteEnergyUse = netElecPurchasedSold + (state.dataOutRptTab->gatherTotalsBEPS(2) + state.dataOutRptTab->gatherTotalsBEPS(3) + state.dataOutRptTab->gatherTotalsBEPS(4) + state.dataOutRptTab->gatherTotalsBEPS(5) + @@ -7468,8 +7347,8 @@ namespace EnergyPlus::OutputReportTabular { // district heating | steam | gasoline | diesel | coal | Fuel Oil No1 // | Fuel Oil No2 | propane | otherfuel1 | otherfuel2 - if (efficiencyDistrictCooling == 0) efficiencyDistrictCooling = 1.0; - if (efficiencyDistrictHeating == 0) efficiencyDistrictHeating = 1.0; + if (state.dataOutRptTab->efficiencyDistrictCooling == 0) state.dataOutRptTab->efficiencyDistrictCooling = 1.0; + if (state.dataOutRptTab->efficiencyDistrictHeating == 0) state.dataOutRptTab->efficiencyDistrictHeating = 1.0; // source emissions already have the source factors included in the calcs. totalSourceEnergyUse = 0.0; @@ -7477,66 +7356,66 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataOutRptTab->fuelfactorsused(1)) { totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(1); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(1) * sourceFactorElectric; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(1) * state.dataOutRptTab->sourceFactorElectric; } // natural gas if (state.dataOutRptTab->fuelfactorsused(2)) { totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(2); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(2) * sourceFactorNaturalGas; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(2) * state.dataOutRptTab->sourceFactorNaturalGas; } // gasoline if (state.dataOutRptTab->fuelfactorsused(3)) { totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(3); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(6) * sourceFactorGasoline; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(6) * state.dataOutRptTab->sourceFactorGasoline; } // diesel if (state.dataOutRptTab->fuelfactorsused(4)) { totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(4); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(8) * sourceFactorDiesel; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(8) * state.dataOutRptTab->sourceFactorDiesel; } // coal if (state.dataOutRptTab->fuelfactorsused(5)) { totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(5); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(9) * sourceFactorCoal; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(9) * state.dataOutRptTab->sourceFactorCoal; } // Fuel Oil No1 if (state.dataOutRptTab->fuelfactorsused(6)) { totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(6); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(10) * sourceFactorFuelOil1; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(10) * state.dataOutRptTab->sourceFactorFuelOil1; } // Fuel Oil No2 if (state.dataOutRptTab->fuelfactorsused(7)) { totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(7); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(11) * sourceFactorFuelOil2; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(11) * state.dataOutRptTab->sourceFactorFuelOil2; } // propane if (state.dataOutRptTab->fuelfactorsused(8)) { totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(8); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(12) * sourceFactorPropane; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(12) * state.dataOutRptTab->sourceFactorPropane; } // otherfuel1 if (state.dataOutRptTab->fuelfactorsused(11)) { totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(11); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(13) * sourceFactorOtherFuel1; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(13) * state.dataOutRptTab->sourceFactorOtherFuel1; } // otherfuel2 if (state.dataOutRptTab->fuelfactorsused(12)) { totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(12); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(14) * sourceFactorOtherFuel2; + totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(14) * state.dataOutRptTab->sourceFactorOtherFuel2; } totalSourceEnergyUse = - (totalSourceEnergyUse + state.dataOutRptTab->gatherTotalsBEPS(3) * sourceFactorElectric / efficiencyDistrictCooling + - state.dataOutRptTab->gatherTotalsBEPS(4) * sourceFactorNaturalGas / efficiencyDistrictHeating + state.dataOutRptTab->gatherTotalsBEPS(5) * sourceFactorSteam) / + (totalSourceEnergyUse + state.dataOutRptTab->gatherTotalsBEPS(3) * state.dataOutRptTab->sourceFactorElectric / state.dataOutRptTab->efficiencyDistrictCooling + + state.dataOutRptTab->gatherTotalsBEPS(4) * state.dataOutRptTab->sourceFactorNaturalGas / state.dataOutRptTab->efficiencyDistrictHeating + state.dataOutRptTab->gatherTotalsBEPS(5) * state.dataOutRptTab->sourceFactorSteam) / largeConversionFactor; // district cooling | district heating | steam // now determine "net" source from purchased and surplus sold (still in J) @@ -7544,7 +7423,7 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataOutRptTab->fuelfactorsused(1)) { netSourceElecPurchasedSold = state.dataOutRptTab->gatherTotalsSource(9) - state.dataOutRptTab->gatherTotalsSource(10); } else { - netSourceElecPurchasedSold = netElecPurchasedSold * sourceFactorElectric * largeConversionFactor; // back to J + netSourceElecPurchasedSold = netElecPurchasedSold * state.dataOutRptTab->sourceFactorElectric * largeConversionFactor; // back to J } netSourceEnergyUse = 0.0; @@ -7552,60 +7431,60 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataOutRptTab->fuelfactorsused(2)) { netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(2); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(2) * sourceFactorNaturalGas; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(2) * state.dataOutRptTab->sourceFactorNaturalGas; } // gasoline if (state.dataOutRptTab->fuelfactorsused(3)) { netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(3); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(6) * sourceFactorGasoline; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(6) * state.dataOutRptTab->sourceFactorGasoline; } // diesel if (state.dataOutRptTab->fuelfactorsused(4)) { netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(4); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(8) * sourceFactorDiesel; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(8) * state.dataOutRptTab->sourceFactorDiesel; } // coal if (state.dataOutRptTab->fuelfactorsused(5)) { netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(5); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(9) * sourceFactorCoal; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(9) * state.dataOutRptTab->sourceFactorCoal; } // Fuel Oil No1 if (state.dataOutRptTab->fuelfactorsused(6)) { netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(6); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(10) * sourceFactorFuelOil1; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(10) * state.dataOutRptTab->sourceFactorFuelOil1; } // Fuel Oil No2 if (state.dataOutRptTab->fuelfactorsused(7)) { netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(7); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(11) * sourceFactorFuelOil2; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(11) * state.dataOutRptTab->sourceFactorFuelOil2; } // propane if (state.dataOutRptTab->fuelfactorsused(8)) { netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(8); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(12) * sourceFactorPropane; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(12) * state.dataOutRptTab->sourceFactorPropane; } // otherfuel1 if (state.dataOutRptTab->fuelfactorsused(11)) { netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(11); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(13) * sourceFactorOtherFuel1; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(13) * state.dataOutRptTab->sourceFactorOtherFuel1; } // otherfuel2 if (state.dataOutRptTab->fuelfactorsused(12)) { netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(12); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(14) * sourceFactorOtherFuel2; + netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(14) * state.dataOutRptTab->sourceFactorOtherFuel2; } netSourceEnergyUse = - (netSourceEnergyUse + netSourceElecPurchasedSold + state.dataOutRptTab->gatherTotalsBEPS(3) * sourceFactorElectric / efficiencyDistrictCooling + - state.dataOutRptTab->gatherTotalsBEPS(4) * sourceFactorNaturalGas / efficiencyDistrictHeating + state.dataOutRptTab->gatherTotalsBEPS(5) * sourceFactorSteam) / + (netSourceEnergyUse + netSourceElecPurchasedSold + state.dataOutRptTab->gatherTotalsBEPS(3) * state.dataOutRptTab->sourceFactorElectric / state.dataOutRptTab->efficiencyDistrictCooling + + state.dataOutRptTab->gatherTotalsBEPS(4) * state.dataOutRptTab->sourceFactorNaturalGas / state.dataOutRptTab->efficiencyDistrictHeating + state.dataOutRptTab->gatherTotalsBEPS(5) * state.dataOutRptTab->sourceFactorSteam) / largeConversionFactor; // from other fuels | net source from electricity | district cooling | district heating | steam // show annual values @@ -7683,7 +7562,7 @@ namespace EnergyPlus::OutputReportTabular { // tableBody(11,1) = TRIM(RealToStr(sourceFactorPropane ,3)) if (!state.dataOutRptTab->ffSchedUsed(1)) { - tableBody(1, 1) = RealToStr(sourceFactorElectric, 3); + tableBody(1, 1) = RealToStr(state.dataOutRptTab->sourceFactorElectric, 3); } else if (state.dataOutRptTab->gatherTotalsBEPS(1) > SmallValue) { tableBody(1, 1) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(1) / state.dataOutRptTab->gatherTotalsBEPS(1), 3) + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(1)) + "\")"; @@ -7692,7 +7571,7 @@ namespace EnergyPlus::OutputReportTabular { } if (!state.dataOutRptTab->ffSchedUsed(2)) { - tableBody(1, 2) = RealToStr(sourceFactorNaturalGas, 3); + tableBody(1, 2) = RealToStr(state.dataOutRptTab->sourceFactorNaturalGas, 3); } else if (state.dataOutRptTab->gatherTotalsBEPS(2) > SmallValue) { tableBody(1, 2) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(2) / state.dataOutRptTab->gatherTotalsBEPS(2), 3) + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(2)) + "\")"; @@ -7700,14 +7579,14 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 2) = "N/A"; } - tableBody(1, 3) = RealToStr(sourceFactorElectric / efficiencyDistrictCooling, 3); // District Cooling + tableBody(1, 3) = RealToStr(state.dataOutRptTab->sourceFactorElectric / state.dataOutRptTab->efficiencyDistrictCooling, 3); // District Cooling - tableBody(1, 4) = RealToStr(sourceFactorNaturalGas / efficiencyDistrictHeating, 3); // District Heating + tableBody(1, 4) = RealToStr(state.dataOutRptTab->sourceFactorNaturalGas / state.dataOutRptTab->efficiencyDistrictHeating, 3); // District Heating - tableBody(1, 5) = RealToStr(sourceFactorSteam, 3); // Steam + tableBody(1, 5) = RealToStr(state.dataOutRptTab->sourceFactorSteam, 3); // Steam if (!state.dataOutRptTab->ffSchedUsed(6)) { - tableBody(1, 6) = RealToStr(sourceFactorGasoline, 3); + tableBody(1, 6) = RealToStr(state.dataOutRptTab->sourceFactorGasoline, 3); } else if (state.dataOutRptTab->gatherTotalsBEPS(6) > SmallValue) { tableBody(1, 6) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(6) / state.dataOutRptTab->gatherTotalsBEPS(6), 3) + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(6)) + "\")"; @@ -7716,7 +7595,7 @@ namespace EnergyPlus::OutputReportTabular { } if (!state.dataOutRptTab->ffSchedUsed(8)) { - tableBody(1, 7) = RealToStr(sourceFactorDiesel, 3); + tableBody(1, 7) = RealToStr(state.dataOutRptTab->sourceFactorDiesel, 3); } else if (state.dataOutRptTab->gatherTotalsBEPS(8) > SmallValue) { tableBody(1, 7) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(8) / state.dataOutRptTab->gatherTotalsBEPS(8), 3) + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(8)) + "\")"; @@ -7725,7 +7604,7 @@ namespace EnergyPlus::OutputReportTabular { } if (!state.dataOutRptTab->ffSchedUsed(9)) { - tableBody(1, 8) = RealToStr(sourceFactorCoal, 3); + tableBody(1, 8) = RealToStr(state.dataOutRptTab->sourceFactorCoal, 3); } else if (state.dataOutRptTab->gatherTotalsBEPS(9) > SmallValue) { tableBody(1, 8) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(9) / state.dataOutRptTab->gatherTotalsBEPS(9), 3) + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(9)) + "\")"; @@ -7734,7 +7613,7 @@ namespace EnergyPlus::OutputReportTabular { } if (!state.dataOutRptTab->ffSchedUsed(10)) { - tableBody(1, 9) = RealToStr(sourceFactorFuelOil1, 3); + tableBody(1, 9) = RealToStr(state.dataOutRptTab->sourceFactorFuelOil1, 3); } else if (state.dataOutRptTab->gatherTotalsBEPS(10) > SmallValue) { tableBody(1, 9) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(10) / state.dataOutRptTab->gatherTotalsBEPS(10), 3) + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(10)) + "\")"; @@ -7743,7 +7622,7 @@ namespace EnergyPlus::OutputReportTabular { } if (!state.dataOutRptTab->ffSchedUsed(11)) { - tableBody(1, 10) = RealToStr(sourceFactorFuelOil2, 3); + tableBody(1, 10) = RealToStr(state.dataOutRptTab->sourceFactorFuelOil2, 3); } else if (state.dataOutRptTab->gatherTotalsBEPS(11) > SmallValue) { tableBody(1, 10) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(11) / state.dataOutRptTab->gatherTotalsBEPS(11), 3) + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(11)) + "\")"; @@ -7752,7 +7631,7 @@ namespace EnergyPlus::OutputReportTabular { } if (!state.dataOutRptTab->ffSchedUsed(12)) { - tableBody(1, 11) = RealToStr(sourceFactorPropane, 3); + tableBody(1, 11) = RealToStr(state.dataOutRptTab->sourceFactorPropane, 3); } else if (state.dataOutRptTab->gatherTotalsBEPS(12) > SmallValue) { tableBody(1, 11) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(12) / state.dataOutRptTab->gatherTotalsBEPS(12), 3) + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(12)) + "\")"; @@ -7761,7 +7640,7 @@ namespace EnergyPlus::OutputReportTabular { } if (!state.dataOutRptTab->ffSchedUsed(13)) { - tableBody(1, 12) = RealToStr(sourceFactorOtherFuel1, 3); + tableBody(1, 12) = RealToStr(state.dataOutRptTab->sourceFactorOtherFuel1, 3); } else if (state.dataOutRptTab->gatherTotalsBEPS(13) > SmallValue) { tableBody(1, 12) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(13) / state.dataOutRptTab->gatherTotalsBEPS(13), 3) + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(13)) + "\")"; @@ -7770,7 +7649,7 @@ namespace EnergyPlus::OutputReportTabular { } if (!state.dataOutRptTab->ffSchedUsed(14)) { - tableBody(1, 13) = RealToStr(sourceFactorOtherFuel2, 3); + tableBody(1, 13) = RealToStr(state.dataOutRptTab->sourceFactorOtherFuel2, 3); } else if (state.dataOutRptTab->gatherTotalsBEPS(14) > SmallValue) { tableBody(1, 13) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(14) / state.dataOutRptTab->gatherTotalsBEPS(14), 3) + " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(14)) + "\")"; @@ -7957,16 +7836,16 @@ namespace EnergyPlus::OutputReportTabular { unconvert = largeConversionFactor / 1000000000.0; // to avoid double converting, the values for the LEED report should be in GJ // Energy Use Intensities - Electricity - if (buildingGrossFloorArea > 0) { + if (state.dataOutRptTab->buildingGrossFloorArea > 0) { PreDefTableEntry(state, - state.dataOutRptPredefined->pdchLeedEuiElec, "Interior Lighting (All)", unconvert * 1000 * useVal(colElectricity, 3) / buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Space Heating", unconvert * 1000 * useVal(colElectricity, 1) / buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Space Cooling", unconvert * 1000 * useVal(colElectricity, 2) / buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Fans (All)", unconvert * 1000 * useVal(colElectricity, 7) / buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Service Water Heating", unconvert * 1000 * useVal(colElectricity, 12) / buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Receptacle Equipment", unconvert * 1000 * useVal(colElectricity, 5) / buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Miscellaneous (All)", unconvert * 1000 * (useVal(colElectricity, 15)) / buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Subtotal", unconvert * 1000 * useVal(colElectricity, 15) / buildingGrossFloorArea, 2); + state.dataOutRptPredefined->pdchLeedEuiElec, "Interior Lighting (All)", unconvert * 1000 * useVal(colElectricity, 3) / state.dataOutRptTab->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Space Heating", unconvert * 1000 * useVal(colElectricity, 1) / state.dataOutRptTab->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Space Cooling", unconvert * 1000 * useVal(colElectricity, 2) / state.dataOutRptTab->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Fans (All)", unconvert * 1000 * useVal(colElectricity, 7) / state.dataOutRptTab->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Service Water Heating", unconvert * 1000 * useVal(colElectricity, 12) / state.dataOutRptTab->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Receptacle Equipment", unconvert * 1000 * useVal(colElectricity, 5) / state.dataOutRptTab->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Miscellaneous (All)", unconvert * 1000 * (useVal(colElectricity, 15)) / state.dataOutRptTab->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Subtotal", unconvert * 1000 * useVal(colElectricity, 15) / state.dataOutRptTab->buildingGrossFloorArea, 2); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEusTotal, "Electricity", unconvert * useVal(colElectricity, 15), 2); @@ -7981,11 +7860,11 @@ namespace EnergyPlus::OutputReportTabular { addFootNoteSubTable(state, state.dataOutRptPredefined->pdstLeedEneCostSum, "Process energy cost based on ratio of process to total energy."); // Energy Use Intensities- Natural Gas - if (buildingGrossFloorArea > 0) { - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Space Heating", unconvert * 1000 * useVal(colGas, 1) / buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Service Water Heating", unconvert * 1000 * useVal(colGas, 12) / buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Miscellaneous (All)", unconvert * 1000 * useVal(colGas, 15) / buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Subtotal", unconvert * 1000 * useVal(colGas, 15) / buildingGrossFloorArea, 2); + if (state.dataOutRptTab->buildingGrossFloorArea > 0) { + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Space Heating", unconvert * 1000 * useVal(colGas, 1) / state.dataOutRptTab->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Service Water Heating", unconvert * 1000 * useVal(colGas, 12) / state.dataOutRptTab->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Miscellaneous (All)", unconvert * 1000 * useVal(colGas, 15) / state.dataOutRptTab->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Subtotal", unconvert * 1000 * useVal(colGas, 15) / state.dataOutRptTab->buildingGrossFloorArea, 2); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEusTotal, "Natural Gas", unconvert * useVal(colGas, 15), 2); PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEusProc, "Natural Gas", unconvert * (useVal(colGas, 5) + useVal(colGas, 13)), 2); @@ -8004,9 +7883,9 @@ namespace EnergyPlus::OutputReportTabular { useVal(3, 5) + useVal(4, 5) + useVal(5, 5) + useVal(6, 5) + useVal(7, 5) + useVal(8, 5) + useVal(9, 5) + useVal(10, 5); useValColAddFuel13 = useVal(3, 13) + useVal(4, 13) + useVal(5, 13) + useVal(6, 13) + useVal(7, 13) + useVal(8, 13) + useVal(9, 13) + useVal(10, 13); - if (buildingGrossFloorArea > 0) { - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiOthr, "Miscellaneous", unconvert * 1000 * useValColAddFuel15 / buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiOthr, "Subtotal", unconvert * 1000 * useValColAddFuel15 / buildingGrossFloorArea, 2); + if (state.dataOutRptTab->buildingGrossFloorArea > 0) { + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiOthr, "Miscellaneous", unconvert * 1000 * useValColAddFuel15 / state.dataOutRptTab->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiOthr, "Subtotal", unconvert * 1000 * useValColAddFuel15 / state.dataOutRptTab->buildingGrossFloorArea, 2); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEusTotal, "Additional", unconvert * (useValColAddFuel15 + useVal(colPurchCool, 15) + useVal(colPurchHeat, 15)), 2); @@ -8512,34 +8391,34 @@ namespace EnergyPlus::OutputReportTabular { // show annual values unconvert = largeConversionFactor / 1000000000.0; // to avoid double converting, the values for the LEED report should be in GJ - tableBody(1, 1) = RealToStr(gatherPowerFuelFireGen, 3); - tableBody(1, 2) = RealToStr(gatherPowerHTGeothermal, 3); - tableBody(1, 3) = RealToStr(gatherPowerPV, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedRenAnGen, "Photovoltaic", unconvert * gatherPowerPV, 2); - tableBody(1, 4) = RealToStr(gatherPowerWind, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedRenAnGen, "Wind", unconvert * gatherPowerWind, 2); - tableBody(1, 5) = RealToStr(gatherPowerConversion, 3); - tableBody(1, 6) = RealToStr(OverallNetEnergyFromStorage, 3); - tableBody(1, 7) = RealToStr(gatherElecProduced, 3); - tableBody(1, 9) = RealToStr(gatherElecPurchased, 3); - tableBody(1, 10) = RealToStr(gatherElecSurplusSold, 3); - tableBody(1, 11) = RealToStr(gatherElecPurchased - gatherElecSurplusSold, 3); - tableBody(1, 13) = RealToStr(gatherElecProduced + (gatherElecPurchased - gatherElecSurplusSold), 3); + tableBody(1, 1) = RealToStr(state.dataOutRptTab->gatherPowerFuelFireGen, 3); + tableBody(1, 2) = RealToStr(state.dataOutRptTab->gatherPowerHTGeothermal, 3); + tableBody(1, 3) = RealToStr(state.dataOutRptTab->gatherPowerPV, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedRenAnGen, "Photovoltaic", unconvert * state.dataOutRptTab->gatherPowerPV, 2); + tableBody(1, 4) = RealToStr(state.dataOutRptTab->gatherPowerWind, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedRenAnGen, "Wind", unconvert * state.dataOutRptTab->gatherPowerWind, 2); + tableBody(1, 5) = RealToStr(state.dataOutRptTab->gatherPowerConversion, 3); + tableBody(1, 6) = RealToStr(state.dataOutRptTab->OverallNetEnergyFromStorage, 3); + tableBody(1, 7) = RealToStr(state.dataOutRptTab->gatherElecProduced, 3); + tableBody(1, 9) = RealToStr(state.dataOutRptTab->gatherElecPurchased, 3); + tableBody(1, 10) = RealToStr(state.dataOutRptTab->gatherElecSurplusSold, 3); + tableBody(1, 11) = RealToStr(state.dataOutRptTab->gatherElecPurchased - state.dataOutRptTab->gatherElecSurplusSold, 3); + tableBody(1, 13) = RealToStr(state.dataOutRptTab->gatherElecProduced + (state.dataOutRptTab->gatherElecPurchased - state.dataOutRptTab->gatherElecSurplusSold), 3); tableBody(1, 14) = RealToStr(collapsedTotal(1), 3); // show annual percentages if (collapsedTotal(1) > 0) { - tableBody(2, 1) = RealToStr(100.0 * gatherPowerFuelFireGen / collapsedTotal(1), 2); - tableBody(2, 2) = RealToStr(100.0 * gatherPowerHTGeothermal / collapsedTotal(1), 2); - tableBody(2, 3) = RealToStr(100.0 * gatherPowerPV / collapsedTotal(1), 2); - tableBody(2, 4) = RealToStr(100.0 * gatherPowerWind / collapsedTotal(1), 2); - tableBody(2, 5) = RealToStr(100.0 * gatherPowerConversion / collapsedTotal(1), 2); - tableBody(2, 6) = RealToStr(100.0 * OverallNetEnergyFromStorage / collapsedTotal(1), 2); - tableBody(2, 7) = RealToStr(100.0 * gatherElecProduced / collapsedTotal(1), 2); - tableBody(2, 9) = RealToStr(100.0 * gatherElecPurchased / collapsedTotal(1), 2); - tableBody(2, 10) = RealToStr(100.0 * gatherElecSurplusSold / collapsedTotal(1), 2); - tableBody(2, 11) = RealToStr(100.0 * (gatherElecPurchased - gatherElecSurplusSold) / collapsedTotal(1), 2); - tableBody(2, 13) = RealToStr(100.0 * (gatherElecProduced + (gatherElecPurchased - gatherElecSurplusSold)) / collapsedTotal(1), 2); + tableBody(2, 1) = RealToStr(100.0 * state.dataOutRptTab->gatherPowerFuelFireGen / collapsedTotal(1), 2); + tableBody(2, 2) = RealToStr(100.0 * state.dataOutRptTab->gatherPowerHTGeothermal / collapsedTotal(1), 2); + tableBody(2, 3) = RealToStr(100.0 * state.dataOutRptTab->gatherPowerPV / collapsedTotal(1), 2); + tableBody(2, 4) = RealToStr(100.0 * state.dataOutRptTab->gatherPowerWind / collapsedTotal(1), 2); + tableBody(2, 5) = RealToStr(100.0 * state.dataOutRptTab->gatherPowerConversion / collapsedTotal(1), 2); + tableBody(2, 6) = RealToStr(100.0 * state.dataOutRptTab->OverallNetEnergyFromStorage / collapsedTotal(1), 2); + tableBody(2, 7) = RealToStr(100.0 * state.dataOutRptTab->gatherElecProduced / collapsedTotal(1), 2); + tableBody(2, 9) = RealToStr(100.0 * state.dataOutRptTab->gatherElecPurchased / collapsedTotal(1), 2); + tableBody(2, 10) = RealToStr(100.0 * state.dataOutRptTab->gatherElecSurplusSold / collapsedTotal(1), 2); + tableBody(2, 11) = RealToStr(100.0 * (state.dataOutRptTab->gatherElecPurchased - state.dataOutRptTab->gatherElecSurplusSold) / collapsedTotal(1), 2); + tableBody(2, 13) = RealToStr(100.0 * (state.dataOutRptTab->gatherElecProduced + (state.dataOutRptTab->gatherElecPurchased - state.dataOutRptTab->gatherElecSurplusSold)) / collapsedTotal(1), 2); tableBody(2, 14) = RealToStr(100.0, 2); } @@ -8589,33 +8468,33 @@ namespace EnergyPlus::OutputReportTabular { // convert to GJ - gatherWaterHeatRecovery /= largeConversionFactor; - gatherAirHeatRecoveryCool /= largeConversionFactor; - gatherAirHeatRecoveryHeat /= largeConversionFactor; - gatherHeatHTGeothermal /= largeConversionFactor; - gatherHeatSolarWater /= largeConversionFactor; - gatherHeatSolarAir /= largeConversionFactor; + state.dataOutRptTab->gatherWaterHeatRecovery /= largeConversionFactor; + state.dataOutRptTab->gatherAirHeatRecoveryCool /= largeConversionFactor; + state.dataOutRptTab->gatherAirHeatRecoveryHeat /= largeConversionFactor; + state.dataOutRptTab->gatherHeatHTGeothermal /= largeConversionFactor; + state.dataOutRptTab->gatherHeatSolarWater /= largeConversionFactor; + state.dataOutRptTab->gatherHeatSolarAir /= largeConversionFactor; // determine total on site heat - totalOnsiteHeat = gatherWaterHeatRecovery + gatherAirHeatRecoveryCool + gatherAirHeatRecoveryHeat + gatherHeatHTGeothermal + - gatherHeatSolarWater + gatherHeatSolarAir; + totalOnsiteHeat = state.dataOutRptTab->gatherWaterHeatRecovery + state.dataOutRptTab->gatherAirHeatRecoveryCool + state.dataOutRptTab->gatherAirHeatRecoveryHeat + state.dataOutRptTab->gatherHeatHTGeothermal + + state.dataOutRptTab->gatherHeatSolarWater + state.dataOutRptTab->gatherHeatSolarAir; // show annual values - tableBody(1, 1) = RealToStr(gatherWaterHeatRecovery, 2); - tableBody(1, 2) = RealToStr(gatherAirHeatRecoveryCool, 2); - tableBody(1, 3) = RealToStr(gatherAirHeatRecoveryHeat, 2); - tableBody(1, 4) = RealToStr(gatherHeatHTGeothermal, 2); - tableBody(1, 5) = RealToStr(gatherHeatSolarWater, 2); - tableBody(1, 6) = RealToStr(gatherHeatSolarAir, 2); + tableBody(1, 1) = RealToStr(state.dataOutRptTab->gatherWaterHeatRecovery, 2); + tableBody(1, 2) = RealToStr(state.dataOutRptTab->gatherAirHeatRecoveryCool, 2); + tableBody(1, 3) = RealToStr(state.dataOutRptTab->gatherAirHeatRecoveryHeat, 2); + tableBody(1, 4) = RealToStr(state.dataOutRptTab->gatherHeatHTGeothermal, 2); + tableBody(1, 5) = RealToStr(state.dataOutRptTab->gatherHeatSolarWater, 2); + tableBody(1, 6) = RealToStr(state.dataOutRptTab->gatherHeatSolarAir, 2); tableBody(1, 7) = RealToStr(totalOnsiteHeat, 2); if (totalOnsiteHeat > 0) { - tableBody(2, 1) = RealToStr(100.0 * gatherWaterHeatRecovery / totalOnsiteHeat, 2); - tableBody(2, 2) = RealToStr(100.0 * gatherAirHeatRecoveryCool / totalOnsiteHeat, 2); - tableBody(2, 3) = RealToStr(100.0 * gatherAirHeatRecoveryHeat / totalOnsiteHeat, 2); - tableBody(2, 4) = RealToStr(100.0 * gatherHeatHTGeothermal / totalOnsiteHeat, 2); - tableBody(2, 5) = RealToStr(100.0 * gatherHeatSolarWater / totalOnsiteHeat, 2); - tableBody(2, 6) = RealToStr(100.0 * gatherHeatSolarAir / totalOnsiteHeat, 2); + tableBody(2, 1) = RealToStr(100.0 * state.dataOutRptTab->gatherWaterHeatRecovery / totalOnsiteHeat, 2); + tableBody(2, 2) = RealToStr(100.0 * state.dataOutRptTab->gatherAirHeatRecoveryCool / totalOnsiteHeat, 2); + tableBody(2, 3) = RealToStr(100.0 * state.dataOutRptTab->gatherAirHeatRecoveryHeat / totalOnsiteHeat, 2); + tableBody(2, 4) = RealToStr(100.0 * state.dataOutRptTab->gatherHeatHTGeothermal / totalOnsiteHeat, 2); + tableBody(2, 5) = RealToStr(100.0 * state.dataOutRptTab->gatherHeatSolarWater / totalOnsiteHeat, 2); + tableBody(2, 6) = RealToStr(100.0 * state.dataOutRptTab->gatherHeatSolarAir / totalOnsiteHeat, 2); tableBody(2, 7) = RealToStr(100.0, 2); } @@ -8672,12 +8551,12 @@ namespace EnergyPlus::OutputReportTabular { rowHead(13) = "Total Water End Uses"; tableBody = "-"; - totalOnsiteWater = gatherRainWater + gatherCondensate + gatherWellwater; + totalOnsiteWater = state.dataOutRptTab->gatherRainWater + state.dataOutRptTab->gatherCondensate + state.dataOutRptTab->gatherWellwater; // ! show annual values - tableBody(1, 1) = RealToStr(gatherRainWater / waterConversionFactor, 2); - tableBody(1, 2) = RealToStr(gatherCondensate / waterConversionFactor, 2); - tableBody(1, 3) = RealToStr(gatherWellwater / waterConversionFactor, 2); + tableBody(1, 1) = RealToStr(state.dataOutRptTab->gatherRainWater / waterConversionFactor, 2); + tableBody(1, 2) = RealToStr(state.dataOutRptTab->gatherCondensate / waterConversionFactor, 2); + tableBody(1, 3) = RealToStr(state.dataOutRptTab->gatherWellwater / waterConversionFactor, 2); tableBody(1, 4) = RealToStr(totalOnsiteWater / waterConversionFactor, 2); if (allocated(state.dataWaterData->WaterStorage)) { @@ -8693,24 +8572,24 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 7) = RealToStr(finalStorage / waterConversionFactor, 2); tableBody(1, 8) = RealToStr(StorageChange / waterConversionFactor, 2); - totalWater = totalOnsiteWater + gatherMains + StorageChange; + totalWater = totalOnsiteWater + state.dataOutRptTab->gatherMains + StorageChange; - tableBody(1, 10) = RealToStr(gatherMains / waterConversionFactor, 2); + tableBody(1, 10) = RealToStr(state.dataOutRptTab->gatherMains / waterConversionFactor, 2); tableBody(1, 12) = RealToStr(totalWater / waterConversionFactor, 2); - tableBody(1, 13) = RealToStr(gatherWaterEndUseTotal / waterConversionFactor, 2); + tableBody(1, 13) = RealToStr(state.dataOutRptTab->gatherWaterEndUseTotal / waterConversionFactor, 2); - if (gatherWaterEndUseTotal > 0) { - tableBody(2, 1) = RealToStr(100.0 * gatherRainWater / gatherWaterEndUseTotal, 2); - tableBody(2, 2) = RealToStr(100.0 * gatherCondensate / gatherWaterEndUseTotal, 2); - tableBody(2, 3) = RealToStr(100.0 * gatherWellwater / gatherWaterEndUseTotal, 2); - tableBody(2, 4) = RealToStr(100.0 * totalOnsiteWater / gatherWaterEndUseTotal, 2); - tableBody(2, 6) = RealToStr(100.0 * initialStorage / gatherWaterEndUseTotal, 2); - tableBody(2, 7) = RealToStr(100.0 * finalStorage / gatherWaterEndUseTotal, 2); - tableBody(2, 8) = RealToStr(100.0 * StorageChange / gatherWaterEndUseTotal, 2); + if (state.dataOutRptTab->gatherWaterEndUseTotal > 0) { + tableBody(2, 1) = RealToStr(100.0 * state.dataOutRptTab->gatherRainWater / state.dataOutRptTab->gatherWaterEndUseTotal, 2); + tableBody(2, 2) = RealToStr(100.0 * state.dataOutRptTab->gatherCondensate / state.dataOutRptTab->gatherWaterEndUseTotal, 2); + tableBody(2, 3) = RealToStr(100.0 * state.dataOutRptTab->gatherWellwater / state.dataOutRptTab->gatherWaterEndUseTotal, 2); + tableBody(2, 4) = RealToStr(100.0 * totalOnsiteWater / state.dataOutRptTab->gatherWaterEndUseTotal, 2); + tableBody(2, 6) = RealToStr(100.0 * initialStorage / state.dataOutRptTab->gatherWaterEndUseTotal, 2); + tableBody(2, 7) = RealToStr(100.0 * finalStorage / state.dataOutRptTab->gatherWaterEndUseTotal, 2); + tableBody(2, 8) = RealToStr(100.0 * StorageChange / state.dataOutRptTab->gatherWaterEndUseTotal, 2); - tableBody(2, 10) = RealToStr(100.0 * gatherMains / gatherWaterEndUseTotal, 2); + tableBody(2, 10) = RealToStr(100.0 * state.dataOutRptTab->gatherMains / state.dataOutRptTab->gatherWaterEndUseTotal, 2); - tableBody(2, 12) = RealToStr(100.0 * totalWater / gatherWaterEndUseTotal, 2); + tableBody(2, 12) = RealToStr(100.0 * totalWater / state.dataOutRptTab->gatherWaterEndUseTotal, 2); tableBody(2, 13) = RealToStr(100.0, 2); } @@ -8869,8 +8748,8 @@ namespace EnergyPlus::OutputReportTabular { // show the headers of the report WriteReportHeaders(state, "Source Energy End Use Components Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // show the number of hours that the table applies to - WriteTextLine(state, "Values gathered over " + RealToStr(gatherElapsedTimeBEPS, 2) + " hours", true); - if (gatherElapsedTimeBEPS < 8759.0) { // might not add up to 8760 exactly but can't be more than 1 hour diff. + WriteTextLine(state, "Values gathered over " + RealToStr(state.dataOutRptTab->gatherElapsedTimeBEPS, 2) + " hours", true); + if (state.dataOutRptTab->gatherElapsedTimeBEPS < 8759.0) { // might not add up to 8760 exactly but can't be more than 1 hour diff. WriteTextLine(state, "WARNING: THE REPORT DOES NOT REPRESENT A FULL ANNUAL SIMULATION.", true); } WriteTextLine(state, "", true); @@ -9100,7 +8979,7 @@ namespace EnergyPlus::OutputReportTabular { { tableBody = ""; // convert floor area - Real64 convBldgCondFloorArea = buildingConditionedFloorArea / areaConversionFactor; + Real64 convBldgCondFloorArea = state.dataOutRptTab->buildingConditionedFloorArea / areaConversionFactor; if (convBldgCondFloorArea > 0) { for (iResource = 1; iResource <= 12; ++iResource) { for (size_t jEndUse = 1; jEndUse <= 14; ++jEndUse) { @@ -9137,7 +9016,7 @@ namespace EnergyPlus::OutputReportTabular { //---- Normalized by Total Area Sub-Table { tableBody = ""; - Real64 convBldgGrossFloorArea = buildingGrossFloorArea / areaConversionFactor; + Real64 convBldgGrossFloorArea = state.dataOutRptTab->buildingGrossFloorArea / areaConversionFactor; if (convBldgGrossFloorArea > 0) { for (iResource = 1; iResource <= 12; ++iResource) { @@ -9719,7 +9598,7 @@ namespace EnergyPlus::OutputReportTabular { WriteReportHeaders(state, "Component Cost Economics Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // compute floor area if no ABUPS - if (buildingConditionedFloorArea == 0.0) { + if (state.dataOutRptTab->buildingConditionedFloorArea == 0.0) { DetermineBuildingFloorArea(state); } @@ -9757,12 +9636,12 @@ namespace EnergyPlus::OutputReportTabular { TableBodyData(1, 1) = state.dataCostEstimateManager->RefrncBldg.LineItemTot; tableBody(1, 1) = RealToStr(TableBodyData(1, 1), 2); - TableBodyData(1, 2) = state.dataCostEstimateManager->RefrncBldg.MiscCostperSqMeter * buildingConditionedFloorArea; + TableBodyData(1, 2) = state.dataCostEstimateManager->RefrncBldg.MiscCostperSqMeter * state.dataOutRptTab->buildingConditionedFloorArea; tableBody(1, 2) = RealToStr(TableBodyData(1, 2), 2); if (state.dataCostEstimateManager->RefrncBldg.RegionalModifier != 1.0) { TableBodyData(1, 3) = - (state.dataCostEstimateManager->RefrncBldg.LineItemTot + state.dataCostEstimateManager->RefrncBldg.MiscCostperSqMeter * buildingConditionedFloorArea) * (state.dataCostEstimateManager->RefrncBldg.RegionalModifier - 1.0); + (state.dataCostEstimateManager->RefrncBldg.LineItemTot + state.dataCostEstimateManager->RefrncBldg.MiscCostperSqMeter * state.dataOutRptTab->buildingConditionedFloorArea) * (state.dataCostEstimateManager->RefrncBldg.RegionalModifier - 1.0); } else { TableBodyData(1, 3) = 0.0; } @@ -9783,18 +9662,18 @@ namespace EnergyPlus::OutputReportTabular { state.dataCostEstimateManager->RefrncBldg.GrandTotal = sum(TableBodyData(1, {1, 8})); TableBodyData(1, 9) = state.dataCostEstimateManager->RefrncBldg.GrandTotal; tableBody(1, 9) = RealToStr(TableBodyData(1, 9), 2); - if (buildingConditionedFloorArea > 0.0) { - TableBodyData(1, 10) = TableBodyData(1, 9) / (buildingConditionedFloorArea * m2_unitConv); + if (state.dataOutRptTab->buildingConditionedFloorArea > 0.0) { + TableBodyData(1, 10) = TableBodyData(1, 9) / (state.dataOutRptTab->buildingConditionedFloorArea * m2_unitConv); } tableBody(1, 10) = RealToStr(TableBodyData(1, 10), 2); TableBodyData(2, 1) = state.dataCostEstimateManager->CurntBldg.LineItemTot; tableBody(2, 1) = RealToStr(TableBodyData(2, 1), 2); - TableBodyData(2, 2) = state.dataCostEstimateManager->CurntBldg.MiscCostperSqMeter * buildingConditionedFloorArea; + TableBodyData(2, 2) = state.dataCostEstimateManager->CurntBldg.MiscCostperSqMeter * state.dataOutRptTab->buildingConditionedFloorArea; tableBody(2, 2) = RealToStr(TableBodyData(2, 2), 2); if (state.dataCostEstimateManager->CurntBldg.RegionalModifier != 1.0) { TableBodyData(2, 3) = - (state.dataCostEstimateManager->CurntBldg.LineItemTot + state.dataCostEstimateManager->CurntBldg.MiscCostperSqMeter * buildingConditionedFloorArea) * (state.dataCostEstimateManager->CurntBldg.RegionalModifier - 1.0); + (state.dataCostEstimateManager->CurntBldg.LineItemTot + state.dataCostEstimateManager->CurntBldg.MiscCostperSqMeter * state.dataOutRptTab->buildingConditionedFloorArea) * (state.dataCostEstimateManager->CurntBldg.RegionalModifier - 1.0); } else { TableBodyData(2, 3) = 0.0; } @@ -9817,8 +9696,8 @@ namespace EnergyPlus::OutputReportTabular { state.dataCostEstimateManager->CurntBldg.GrandTotal = sum(TableBodyData(2, {1, 8})); TableBodyData(2, 9) = state.dataCostEstimateManager->CurntBldg.GrandTotal; tableBody(2, 9) = RealToStr(TableBodyData(2, 9), 2); - if (buildingConditionedFloorArea > 0) { - TableBodyData(2, 10) = TableBodyData(2, 9) / (buildingConditionedFloorArea * m2_unitConv); + if (state.dataOutRptTab->buildingConditionedFloorArea > 0) { + TableBodyData(2, 10) = TableBodyData(2, 9) / (state.dataOutRptTab->buildingConditionedFloorArea * m2_unitConv); } tableBody(2, 10) = RealToStr(TableBodyData(2, 10), 2); @@ -10150,7 +10029,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 7) = RealToStr(state.dataEnvrn->TimeZoneNumber, 2); // Time Zone tableBody(1, 8) = RealToStr(BuildingAzimuth, 2); // north axis angle tableBody(1, 9) = RealToStr(BuildingRotationAppendixG, 2); // Rotation for Appendix G - tableBody(1, 10) = RealToStr(gatherElapsedTimeBEPS, 2); // hours simulated + tableBody(1, 10) = RealToStr(state.dataOutRptTab->gatherElapsedTimeBEPS, 2); // hours simulated // tableBody(9,1) = TRIM(fmt::to_string(state.dataOutRptPredefined->numTableEntry)) !number of table entries for predefined tables WriteSubtitle(state, "General"); @@ -14922,8 +14801,8 @@ namespace EnergyPlus::OutputReportTabular { int iZone; // INTEGER :: found - buildingGrossFloorArea = 0.0; - buildingConditionedFloorArea = 0.0; + state.dataOutRptTab->buildingGrossFloorArea = 0.0; + state.dataOutRptTab->buildingConditionedFloorArea = 0.0; for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { curZoneArea = Zone(iZone).FloorArea * Zone(iZone).Multiplier * Zone(iZone).ListMultiplier; @@ -14941,12 +14820,12 @@ namespace EnergyPlus::OutputReportTabular { // IF (found /= 0) curZoneArea = 0.0d0 if (Zone(iZone).isPartOfTotalArea) { - buildingGrossFloorArea += curZoneArea; + state.dataOutRptTab->buildingGrossFloorArea += curZoneArea; // If a ZoneHVAC:EquipmentConnections is used for a zone then // it is considered conditioned. Also ZONE SUPPLY PLENUM and ZONE RETURN PLENUM are // also is considered conditioned. if (Zone(iZone).SystemZoneNodeNumber > 0) { - buildingConditionedFloorArea += curZoneArea; + state.dataOutRptTab->buildingConditionedFloorArea += curZoneArea; } } } @@ -14979,7 +14858,7 @@ namespace EnergyPlus::OutputReportTabular { // Jason Glazer - October 2015 // Reset all gathering arrays to zero for multi-year simulations // so that only last year is reported in tabular reports - gatherElapsedTimeBEPS = 0.0; + state.dataOutRptTab->gatherElapsedTimeBEPS = 0.0; ResetMonthlyGathering(state); OutputReportTabularAnnual::ResetAnnualGathering(); ResetBinGathering(); @@ -15066,26 +14945,26 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptTab->gatherEndUseSubBEPS = 0.0; state.dataOutRptTab->gatherTotalsSource = 0.0; // reset the specific components being gathered - gatherPowerFuelFireGen = 0.0; - gatherPowerPV = 0.0; - gatherPowerWind = 0.0; - gatherPowerHTGeothermal = 0.0; - gatherElecProduced = 0.0; - gatherElecPurchased = 0.0; - gatherElecSurplusSold = 0.0; - gatherElecStorage = 0.0; - gatherPowerConversion = 0.0; - gatherWaterHeatRecovery = 0.0; - gatherAirHeatRecoveryCool = 0.0; - gatherAirHeatRecoveryHeat = 0.0; - gatherHeatHTGeothermal = 0.0; - gatherHeatSolarWater = 0.0; - gatherHeatSolarAir = 0.0; - gatherRainWater = 0.0; - gatherCondensate = 0.0; - gatherWellwater = 0.0; - gatherMains = 0.0; - gatherWaterEndUseTotal = 0.0; + state.dataOutRptTab->gatherPowerFuelFireGen = 0.0; + state.dataOutRptTab->gatherPowerPV = 0.0; + state.dataOutRptTab->gatherPowerWind = 0.0; + state.dataOutRptTab->gatherPowerHTGeothermal = 0.0; + state.dataOutRptTab->gatherElecProduced = 0.0; + state.dataOutRptTab->gatherElecPurchased = 0.0; + state.dataOutRptTab->gatherElecSurplusSold = 0.0; + state.dataOutRptTab->gatherElecStorage = 0.0; + state.dataOutRptTab->gatherPowerConversion = 0.0; + state.dataOutRptTab->gatherWaterHeatRecovery = 0.0; + state.dataOutRptTab->gatherAirHeatRecoveryCool = 0.0; + state.dataOutRptTab->gatherAirHeatRecoveryHeat = 0.0; + state.dataOutRptTab->gatherHeatHTGeothermal = 0.0; + state.dataOutRptTab->gatherHeatSolarWater = 0.0; + state.dataOutRptTab->gatherHeatSolarAir = 0.0; + state.dataOutRptTab->gatherRainWater = 0.0; + state.dataOutRptTab->gatherCondensate = 0.0; + state.dataOutRptTab->gatherWellwater = 0.0; + state.dataOutRptTab->gatherMains = 0.0; + state.dataOutRptTab->gatherWaterEndUseTotal = 0.0; } void ResetSourceEnergyEndUseGathering(EnergyPlusData &state) diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 5d012433807..79482c01955 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -182,72 +182,6 @@ namespace OutputReportTabular { // Allow up to five output files to be created constexpr int maxNumStyles(5); - // to keep track of hours for the BEPS report gathering - extern Real64 gatherElapsedTimeBEPS; - // for normalization of results - extern Real64 buildingGrossFloorArea; - extern Real64 buildingConditionedFloorArea; - // keep track if schedules are used in fuel factors - extern bool fuelFactorSchedulesUsed; - // for electic load components on BEPS report - extern int meterNumPowerFuelFireGen; - extern Real64 gatherPowerFuelFireGen; - extern int meterNumPowerPV; - extern Real64 gatherPowerPV; - extern int meterNumPowerWind; - extern Real64 gatherPowerWind; - extern Real64 OverallNetEnergyFromStorage; - extern int meterNumPowerHTGeothermal; - extern Real64 gatherPowerHTGeothermal; - extern int meterNumElecProduced; - extern Real64 gatherElecProduced; - extern int meterNumElecPurchased; - extern Real64 gatherElecPurchased; - extern int meterNumElecSurplusSold; - extern Real64 gatherElecSurplusSold; - extern int meterNumElecStorage; - extern Real64 gatherElecStorage; - extern int meterNumPowerConversion; - extern Real64 gatherPowerConversion; - // for on site thermal source components on BEPS report - extern int meterNumWaterHeatRecovery; - extern Real64 gatherWaterHeatRecovery; - extern int meterNumAirHeatRecoveryCool; - extern Real64 gatherAirHeatRecoveryCool; - extern int meterNumAirHeatRecoveryHeat; - extern Real64 gatherAirHeatRecoveryHeat; - extern int meterNumHeatHTGeothermal; - extern Real64 gatherHeatHTGeothermal; - extern int meterNumHeatSolarWater; - extern Real64 gatherHeatSolarWater; - extern int meterNumHeatSolarAir; - extern Real64 gatherHeatSolarAir; - // for on site water components on BEPS report - extern int meterNumRainWater; - extern Real64 gatherRainWater; - extern int meterNumCondensate; - extern Real64 gatherCondensate; - extern int meterNumGroundwater; - extern Real64 gatherWellwater; - extern int meterNumMains; - extern Real64 gatherMains; - extern int meterNumWaterEndUseTotal; - extern Real64 gatherWaterEndUseTotal; - // for source energy conversion factors on BEPS report - extern Real64 sourceFactorElectric; - extern Real64 sourceFactorNaturalGas; - extern Real64 efficiencyDistrictCooling; - extern Real64 efficiencyDistrictHeating; - extern Real64 sourceFactorSteam; - extern Real64 sourceFactorGasoline; - extern Real64 sourceFactorDiesel; - extern Real64 sourceFactorCoal; - extern Real64 sourceFactorFuelOil1; - extern Real64 sourceFactorFuelOil2; - extern Real64 sourceFactorPropane; - extern Real64 sourceFactorOtherFuel1; - extern Real64 sourceFactorOtherFuel2; - extern Array1D_int td; //(1) Current year //(2) Current month @@ -1066,6 +1000,72 @@ struct OutputReportTabularData : BaseGlobalStruct { Array3D gatherDemandIndEndUseSub; Array1D_int gatherDemandTimeStamp = Array1D_int(OutputReportTabular::numResourceTypes, 0); + // to keep track of hours for the BEPS report gathering + Real64 gatherElapsedTimeBEPS = 0.0; + // for normalization of results + Real64 buildingGrossFloorArea = 0.0; + Real64 buildingConditionedFloorArea = 0.0; + // keep track if schedules are used in fuel factors + bool fuelFactorSchedulesUsed = false; + // for electric load components on BEPS report + int meterNumPowerFuelFireGen = 0; + Real64 gatherPowerFuelFireGen = 0.0; + int meterNumPowerPV = 0; + Real64 gatherPowerPV = 0.0; + int meterNumPowerWind = 0; + Real64 gatherPowerWind = 0.0; + Real64 OverallNetEnergyFromStorage = 0.0; + int meterNumPowerHTGeothermal = 0; + Real64 gatherPowerHTGeothermal = 0.0; + int meterNumElecProduced = 0; + Real64 gatherElecProduced = 0.0; + int meterNumElecPurchased = 0; + Real64 gatherElecPurchased = 0.0; + int meterNumElecSurplusSold = 0; + Real64 gatherElecSurplusSold = 0.0; + int meterNumElecStorage = 0; + Real64 gatherElecStorage = 0.0; + int meterNumPowerConversion = 0; + Real64 gatherPowerConversion = 0.0; + // for on site thermal source components on BEPS report + int meterNumWaterHeatRecovery = 0; + Real64 gatherWaterHeatRecovery = 0.0; + int meterNumAirHeatRecoveryCool = 0; + Real64 gatherAirHeatRecoveryCool = 0.0; + int meterNumAirHeatRecoveryHeat = 0; + Real64 gatherAirHeatRecoveryHeat = 0.0; + int meterNumHeatHTGeothermal = 0; + Real64 gatherHeatHTGeothermal = 0.0; + int meterNumHeatSolarWater = 0; + Real64 gatherHeatSolarWater = 0.0; + int meterNumHeatSolarAir = 0; + Real64 gatherHeatSolarAir = 0.0; + // for on site water components on BEPS report + int meterNumRainWater = 0; + Real64 gatherRainWater = 0.0; + int meterNumCondensate = 0; + Real64 gatherCondensate = 0.0; + int meterNumGroundwater = 0; + Real64 gatherWellwater = 0.0; + int meterNumMains = 0; + Real64 gatherMains = 0.0; + int meterNumWaterEndUseTotal = 0; + Real64 gatherWaterEndUseTotal = 0.0; + // for source energy conversion factors on BEPS report + Real64 sourceFactorElectric = 0.0; + Real64 sourceFactorNaturalGas = 0.0; + Real64 efficiencyDistrictCooling = 0.0; + Real64 efficiencyDistrictHeating = 0.0; + Real64 sourceFactorSteam = 0.0; + Real64 sourceFactorGasoline = 0.0; + Real64 sourceFactorDiesel = 0.0; + Real64 sourceFactorCoal = 0.0; + Real64 sourceFactorFuelOil1 = 0.0; + Real64 sourceFactorFuelOil2 = 0.0; + Real64 sourceFactorPropane = 0.0; + Real64 sourceFactorOtherFuel1 = 0.0; + Real64 sourceFactorOtherFuel2 = 0.0; + void clear_state() override { this->unitsStyle = OutputReportTabular::iUnitsStyle::None; @@ -1139,7 +1139,64 @@ struct OutputReportTabularData : BaseGlobalStruct { this->gatherDemandEndUseSub.deallocate(); this->gatherDemandIndEndUseSub.deallocate(); this->gatherDemandTimeStamp = Array1D_int(OutputReportTabular::numResourceTypes, 0); - + this->gatherElapsedTimeBEPS = 0.0; + this->buildingGrossFloorArea = 0.0; + this->buildingConditionedFloorArea = 0.0; + this->fuelFactorSchedulesUsed = false; + this->meterNumPowerFuelFireGen = 0; + this->gatherPowerFuelFireGen = 0.0; + this->meterNumPowerPV = 0; + this->gatherPowerPV = 0.0; + this->meterNumPowerWind = 0; + this->gatherPowerWind = 0.0; + this->OverallNetEnergyFromStorage = 0.0; + this->meterNumPowerHTGeothermal = 0; + this->gatherPowerHTGeothermal = 0.0; + this->meterNumElecProduced = 0; + this->gatherElecProduced = 0.0; + this->meterNumElecPurchased = 0; + this->gatherElecPurchased = 0.0; + this->meterNumElecSurplusSold = 0; + this->gatherElecSurplusSold = 0.0; + this->meterNumElecStorage = 0; + this->gatherElecStorage = 0.0; + this->meterNumPowerConversion = 0; + this->gatherPowerConversion = 0.0; + this->meterNumWaterHeatRecovery = 0; + this->gatherWaterHeatRecovery = 0.0; + this->meterNumAirHeatRecoveryCool = 0; + this->gatherAirHeatRecoveryCool = 0.0; + this->meterNumAirHeatRecoveryHeat = 0; + this->gatherAirHeatRecoveryHeat = 0.0; + this->meterNumHeatHTGeothermal = 0; + this->gatherHeatHTGeothermal = 0.0; + this->meterNumHeatSolarWater = 0; + this->gatherHeatSolarWater = 0.0; + this->meterNumHeatSolarAir = 0; + this->gatherHeatSolarAir = 0.0; + this->meterNumRainWater = 0; + this->gatherRainWater = 0.0; + this->meterNumCondensate = 0; + this->gatherCondensate = 0.0; + this->meterNumGroundwater = 0; + this->gatherWellwater = 0.0; + this->meterNumMains = 0; + this->gatherMains = 0.0; + this->meterNumWaterEndUseTotal = 0; + this->gatherWaterEndUseTotal = 0.0; + this->sourceFactorElectric = 0.0; + this->sourceFactorNaturalGas = 0.0; + this->efficiencyDistrictCooling = 0.0; + this->efficiencyDistrictHeating = 0.0; + this->sourceFactorSteam = 0.0; + this->sourceFactorGasoline = 0.0; + this->sourceFactorDiesel = 0.0; + this->sourceFactorCoal = 0.0; + this->sourceFactorFuelOil1 = 0.0; + this->sourceFactorFuelOil2 = 0.0; + this->sourceFactorPropane = 0.0; + this->sourceFactorOtherFuel1 = 0.0; + this->sourceFactorOtherFuel2 = 0.0; } }; diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 0d58d6485f5..48df188a13c 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -7760,8 +7760,8 @@ TEST_F(SQLiteFixture, WriteSourceEnergyEndUseSummary_TestPerArea) { // Before we test the reporting itself, we check that DetermineBuildingFloorArea (called from WriteSourceEnergyEndUseSummary) // actually did what we expected - EXPECT_EQ(expectedBuildingGrossFloorArea, OutputReportTabular::buildingGrossFloorArea); - EXPECT_EQ(expectedBuildingConditionedFloorArea, OutputReportTabular::buildingConditionedFloorArea); + EXPECT_EQ(expectedBuildingGrossFloorArea, state->dataOutRptTab->buildingGrossFloorArea); + EXPECT_EQ(expectedBuildingConditionedFloorArea, state->dataOutRptTab->buildingConditionedFloorArea); // Now we test the reporting itself: // We consistently test in the same report (three different tables) and at the same column for fuel = Elec From 30af9e682834f986781a596a5dee4161da109525 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Sat, 19 Dec 2020 11:46:44 -0700 Subject: [PATCH 10/14] moving OutputReportTabular to state --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 24 +- src/EnergyPlus/InternalHeatGains.cc | 60 +-- src/EnergyPlus/OutputReportTabular.cc | 430 +++++++----------- src/EnergyPlus/OutputReportTabular.hh | 175 ++++--- src/EnergyPlus/SizingManager.cc | 2 +- tst/EnergyPlus/unit/InternalHeatGains.unit.cc | 14 +- .../unit/OutputReportTabular.unit.cc | 106 ++--- 7 files changed, 354 insertions(+), 457 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index e4ddcbd4c99..53f81ed9597 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -5347,8 +5347,6 @@ namespace HeatBalanceSurfaceManager { // This subroutine puts the reporting part of the HBSurface Module in one area. using DataSizing::CurOverallSimDay; - using OutputReportTabular::feneSolarRadSeq; - using OutputReportTabular::lightSWRadSeq; using SolarShading::ReportSurfaceShading; SumSurfaceHeatEmission = 0.0; @@ -5377,8 +5375,8 @@ namespace HeatBalanceSurfaceManager { if (state.dataGlobal->ZoneSizingCalc && state.dataGlobal->CompLoadReportIsReq) { int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; - lightSWRadSeq(CurOverallSimDay, TimeStepInDay, SurfNum) = QdotRadLightsInRep(SurfNum); - feneSolarRadSeq(CurOverallSimDay, TimeStepInDay, SurfNum) = QdotRadSolarInRep(SurfNum); + state.dataOutRptTab->lightSWRadSeq(CurOverallSimDay, TimeStepInDay, SurfNum) = QdotRadLightsInRep(SurfNum); + state.dataOutRptTab->feneSolarRadSeq(CurOverallSimDay, TimeStepInDay, SurfNum) = QdotRadSolarInRep(SurfNum); } } else { // can we fill these for windows? } @@ -7012,10 +7010,10 @@ namespace HeatBalanceSurfaceManager { if (!state.dataGlobal->WarmupFlag) { int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; if (state.dataGlobal->isPulseZoneSizing) { - OutputReportTabular::loadConvectedWithPulse(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = QdotConvInRep(surfNum); + state.dataOutRptTab->loadConvectedWithPulse(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = QdotConvInRep(surfNum); } else { - OutputReportTabular::loadConvectedNormal(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = QdotConvInRep(surfNum); - OutputReportTabular::netSurfRadSeq(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = + state.dataOutRptTab->loadConvectedNormal(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = QdotConvInRep(surfNum); + state.dataOutRptTab->netSurfRadSeq(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = SurfNetLWRadToSurf(surfNum) * Surface(surfNum).Area; } } @@ -7699,11 +7697,11 @@ namespace HeatBalanceSurfaceManager { if (!state.dataGlobal->WarmupFlag) { int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; if (state.dataGlobal->isPulseZoneSizing) { - OutputReportTabular::loadConvectedWithPulse(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = + state.dataOutRptTab->loadConvectedWithPulse(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = QdotConvInRep(surfNum); } else { - OutputReportTabular::loadConvectedNormal(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = QdotConvInRep(surfNum); - OutputReportTabular::netSurfRadSeq(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = + state.dataOutRptTab->loadConvectedNormal(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = QdotConvInRep(surfNum); + state.dataOutRptTab->netSurfRadSeq(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = SurfNetLWRadToSurf(surfNum) * Surface(surfNum).Area; } } @@ -8333,18 +8331,16 @@ namespace HeatBalanceSurfaceManager { using DataSizing::CurOverallSimDay; using DataSurfaces::Surface; using DataSurfaces::TotSurfaces; - using OutputReportTabular::ITABSFseq; - using OutputReportTabular::TMULTseq; if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; for (int enclosureNum = 1; enclosureNum <= DataViewFactorInformation::NumOfRadiantEnclosures; ++enclosureNum) { - TMULTseq(CurOverallSimDay, TimeStepInDay, enclosureNum) = TMULT(enclosureNum); + state.dataOutRptTab->TMULTseq(CurOverallSimDay, TimeStepInDay, enclosureNum) = TMULT(enclosureNum); } for (int jSurf = 1; jSurf <= TotSurfaces; ++jSurf) { if (!Surface(jSurf).HeatTransSurf || Surface(jSurf).Zone == 0) continue; // Skip non-heat transfer surfaces if (Surface(jSurf).Class == SurfaceClass::TDD_Dome) continue; // Skip tubular daylighting device domes - ITABSFseq(CurOverallSimDay, TimeStepInDay, jSurf) = ITABSF(jSurf); + state.dataOutRptTab->ITABSFseq(CurOverallSimDay, TimeStepInDay, jSurf) = ITABSF(jSurf); } } } diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index ac2bc34c164..699f174d789 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -5265,8 +5265,6 @@ namespace InternalHeatGains { using FuelCellElectricGenerator::FigureFuelCellZoneGains; using MicroCHPElectricGenerator::FigureMicroCHPZoneGains; using OutputReportTabular::AllocateLoadComponentArrays; - using OutputReportTabular::radiantPulseReceived; - using OutputReportTabular::radiantPulseTimestep; using Psychrometrics::PsyRhoAirFnPbTdbW; using RefrigeratedCase::FigureRefrigerationZoneGains; using WaterThermalTanks::CalcWaterThermalTankZoneGains; @@ -5688,8 +5686,8 @@ namespace InternalHeatGains { // QRadThermInAbs is the thermal radiation absorbed on inside surfaces SurfQRadThermInAbs(SurfNum) = adjQL * TMULT(radEnclosureNum) * ITABSF(SurfNum); // store the magnitude and time of the pulse - radiantPulseTimestep(CurOverallSimDay, zoneNum) = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; - radiantPulseReceived(CurOverallSimDay, SurfNum) = + state.dataOutRptTab->radiantPulseTimestep(CurOverallSimDay, zoneNum) = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; + state.dataOutRptTab->radiantPulseReceived(CurOverallSimDay, SurfNum) = (adjQL - curQL) * TMULT(radEnclosureNum) * ITABSF(SurfNum) * Surface(SurfNum).Area; } } @@ -7040,24 +7038,6 @@ namespace InternalHeatGains { // Using/Aliasing using namespace DataHeatBalance; using DataSizing::CurOverallSimDay; - using OutputReportTabular::equipInstantSeq; - using OutputReportTabular::equipLatentSeq; - using OutputReportTabular::equipRadSeq; - using OutputReportTabular::hvacLossInstantSeq; - using OutputReportTabular::hvacLossRadSeq; - using OutputReportTabular::lightInstantSeq; - using OutputReportTabular::lightLWRadSeq; - using OutputReportTabular::lightRetAirSeq; - using OutputReportTabular::peopleInstantSeq; - using OutputReportTabular::peopleLatentSeq; - using OutputReportTabular::peopleRadSeq; - using OutputReportTabular::powerGenInstantSeq; - using OutputReportTabular::powerGenRadSeq; - using OutputReportTabular::refrigInstantSeq; - using OutputReportTabular::refrigLatentSeq; - using OutputReportTabular::refrigRetAirSeq; - using OutputReportTabular::waterUseInstantSeq; - using OutputReportTabular::waterUseLatentSeq; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static int iZone(0); @@ -7119,30 +7099,30 @@ namespace InternalHeatGains { if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - SumInternalConvectionGainsByTypes(iZone, IntGainTypesPeople, peopleInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes(iZone, IntGainTypesPeople, peopleLatentSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes(iZone, IntGainTypesPeople, peopleRadSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalConvectionGainsByTypes(iZone, IntGainTypesPeople, state.dataOutRptTab->peopleInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes(iZone, IntGainTypesPeople, state.dataOutRptTab->peopleLatentSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes(iZone, IntGainTypesPeople, state.dataOutRptTab->peopleRadSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalConvectionGainsByTypes(iZone, IntGainTypesLight, lightInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumReturnAirConvectionGainsByTypes(iZone, IntGainTypesLight, lightRetAirSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes(iZone, IntGainTypesLight, lightLWRadSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalConvectionGainsByTypes(iZone, IntGainTypesLight, state.dataOutRptTab->lightInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumReturnAirConvectionGainsByTypes(iZone, IntGainTypesLight, state.dataOutRptTab->lightRetAirSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes(iZone, IntGainTypesLight, state.dataOutRptTab->lightLWRadSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalConvectionGainsByTypes(iZone, IntGainTypesEquip, equipInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes(iZone, IntGainTypesEquip, equipLatentSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes(iZone, IntGainTypesEquip, equipRadSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalConvectionGainsByTypes(iZone, IntGainTypesEquip, state.dataOutRptTab->equipInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes(iZone, IntGainTypesEquip, state.dataOutRptTab->equipLatentSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes(iZone, IntGainTypesEquip, state.dataOutRptTab->equipRadSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalConvectionGainsByTypes(iZone, IntGainTypesRefrig, refrigInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumReturnAirConvectionGainsByTypes(iZone, IntGainTypesRefrig, refrigRetAirSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes(iZone, IntGainTypesRefrig, refrigLatentSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalConvectionGainsByTypes(iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumReturnAirConvectionGainsByTypes(iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigRetAirSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes(iZone, IntGainTypesRefrig, state.dataOutRptTab->refrigLatentSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalConvectionGainsByTypes(iZone, IntGainTypesWaterUse, waterUseInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalLatentGainsByTypes(iZone, IntGainTypesWaterUse, waterUseLatentSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalConvectionGainsByTypes(iZone, IntGainTypesWaterUse, state.dataOutRptTab->waterUseInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalLatentGainsByTypes(iZone, IntGainTypesWaterUse, state.dataOutRptTab->waterUseLatentSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalConvectionGainsByTypes(iZone, IntGainTypesHvacLoss, hvacLossInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes(iZone, IntGainTypesHvacLoss, hvacLossRadSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalConvectionGainsByTypes(iZone, IntGainTypesHvacLoss, state.dataOutRptTab->hvacLossInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes(iZone, IntGainTypesHvacLoss, state.dataOutRptTab->hvacLossRadSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalConvectionGainsByTypes(iZone, IntGainTypesPowerGen, powerGenInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); - SumInternalRadiationGainsByTypes(iZone, IntGainTypesPowerGen, powerGenRadSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalConvectionGainsByTypes(iZone, IntGainTypesPowerGen, state.dataOutRptTab->powerGenInstantSeq(CurOverallSimDay, TimeStepInDay, iZone)); + SumInternalRadiationGainsByTypes(iZone, IntGainTypesPowerGen, state.dataOutRptTab->powerGenRadSeq(CurOverallSimDay, TimeStepInDay, iZone)); } } } diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 54216af5381..25ca321608b 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -177,68 +177,6 @@ namespace EnergyPlus::OutputReportTabular { // arrays for time binned results - Array1D_int td(8); - //(1) Current year - //(2) Current month - //(3) Current day - //(4) Time difference with respect to UTC in minutes (0-59) - //(5) Hour of the day (0-23) - //(6) Minutes (0-59) - //(7) Seconds (0-59) - //(8) Milliseconds (0-999) - - // Design day name storage - Array1D_string DesignDayName; - int DesignDayCount(0); - - // arrays related to pulse and load component reporting - Array2D_int radiantPulseTimestep; - Array2D radiantPulseReceived; - Array3D loadConvectedNormal; - Array3D loadConvectedWithPulse; - Array3D netSurfRadSeq; - Array2D decayCurveCool; - Array2D decayCurveHeat; - Array3D ITABSFseq; // used for determining the radiant fraction on each surface - Array3D TMULTseq; // used for determining the radiant fraction on each surface - - Array3D peopleInstantSeq; - Array3D peopleLatentSeq; - Array3D peopleRadSeq; - - Array3D lightInstantSeq; - Array3D lightRetAirSeq; - Array3D lightLWRadSeq; // long wave thermal radiation - Array3D lightSWRadSeq; // short wave visible radiation - - Array3D equipInstantSeq; - Array3D equipLatentSeq; - Array3D equipRadSeq; - - Array3D refrigInstantSeq; - Array3D refrigRetAirSeq; - Array3D refrigLatentSeq; - - Array3D waterUseInstantSeq; - Array3D waterUseLatentSeq; - - Array3D hvacLossInstantSeq; - Array3D hvacLossRadSeq; - - Array3D powerGenInstantSeq; - Array3D powerGenRadSeq; - Array3D infilInstantSeq; - Array3D infilLatentSeq; - - Array3D zoneVentInstantSeq; - Array3D zoneVentLatentSeq; - - Array3D interZoneMixInstantSeq; - Array3D interZoneMixLatentSeq; - - Array3D feneCondInstantSeq; - Array3D feneSolarRadSeq; - int maxUniqueKeyCount(0); // for the XML report must keep track fo the active sub-table name and report set by other routines @@ -248,9 +186,6 @@ namespace EnergyPlus::OutputReportTabular { std::string activeForName; std::string prevReportName; - // SUBROUTINE SPECIFICATIONS FOR MODULE PrimaryPlantLoops - // PRIVATE DateToStr - // Object Data Array1D OutputTableBinned; Array2D BinResults; // table number, number of intervals @@ -283,44 +218,6 @@ namespace EnergyPlus::OutputReportTabular { GatherHeatGainReportfirstTime = true; AllocateLoadComponentArraysDoAllocate = true; initAdjFenDone = false; - DesignDayName.deallocate(); - DesignDayCount = 0; - radiantPulseTimestep.deallocate(); - radiantPulseReceived.deallocate(); - loadConvectedNormal.deallocate(); - loadConvectedWithPulse.deallocate(); - netSurfRadSeq.deallocate(); - decayCurveCool.deallocate(); - decayCurveHeat.deallocate(); - ITABSFseq.deallocate(); - TMULTseq.deallocate(); - peopleInstantSeq.deallocate(); - peopleLatentSeq.deallocate(); - peopleRadSeq.deallocate(); - lightInstantSeq.deallocate(); - lightRetAirSeq.deallocate(); - lightLWRadSeq.deallocate(); - lightSWRadSeq.deallocate(); - equipInstantSeq.deallocate(); - equipLatentSeq.deallocate(); - equipRadSeq.deallocate(); - refrigInstantSeq.deallocate(); - refrigRetAirSeq.deallocate(); - refrigLatentSeq.deallocate(); - waterUseInstantSeq.deallocate(); - waterUseLatentSeq.deallocate(); - hvacLossInstantSeq.deallocate(); - hvacLossRadSeq.deallocate(); - powerGenInstantSeq.deallocate(); - powerGenRadSeq.deallocate(); - infilInstantSeq.deallocate(); - infilLatentSeq.deallocate(); - zoneVentInstantSeq.deallocate(); - zoneVentLatentSeq.deallocate(); - interZoneMixInstantSeq.deallocate(); - interZoneMixLatentSeq.deallocate(); - feneCondInstantSeq.deallocate(); - feneSolarRadSeq.deallocate(); maxUniqueKeyCount = 0; OutputTableBinned.deallocate(); BinResults.deallocate(); @@ -389,7 +286,7 @@ namespace EnergyPlus::OutputReportTabular { SetupUnitConversions(state); AddTOCLoadComponentTableSummaries(state); UpdateTabularReportsGetInput = false; - date_and_time(_, _, _, td); + date_and_time(_, _, _, state.dataOutRptTab->td); } if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { @@ -3214,9 +3111,9 @@ namespace EnergyPlus::OutputReportTabular { } else { tbl_stream << " " << BuildingName << ' ' << state.dataEnvrn->EnvironmentName << " ** " << state.dataEnvrn->WeatherFileLocationTitle << '\n'; } - tbl_stream << " " << std::setw(4) << td(1) << '-' << std::setfill('0') << std::setw(2) << td(2) << '-' << std::setw(2) << td(3) + tbl_stream << " " << std::setw(4) << state.dataOutRptTab->td(1) << '-' << std::setfill('0') << std::setw(2) << state.dataOutRptTab->td(2) << '-' << std::setw(2) << state.dataOutRptTab->td(3) << '\n'; - tbl_stream << " " << std::setw(2) << td(5) << ':' << std::setw(2) << td(6) << ':' << std::setw(2) << td(7) << std::setfill(' ') + tbl_stream << " " << std::setw(2) << state.dataOutRptTab->td(5) << ':' << std::setw(2) << state.dataOutRptTab->td(6) << ':' << std::setw(2) << state.dataOutRptTab->td(7) << std::setfill(' ') << '\n'; tbl_stream << " - EnergyPlus\n"; tbl_stream << "\n"; @@ -3232,9 +3129,9 @@ namespace EnergyPlus::OutputReportTabular { } else { tbl_stream << "

Environment: " << state.dataEnvrn->EnvironmentName << " ** " << state.dataEnvrn->WeatherFileLocationTitle << "

\n"; } - tbl_stream << "

Simulation Timestamp: " << std::setw(4) << td(1) << '-' << std::setfill('0') << std::setw(2) << td(2) << '-' - << std::setw(2) << td(3) << '\n'; - tbl_stream << " " << std::setw(2) << td(5) << ':' << std::setw(2) << td(6) << ':' << std::setw(2) << td(7) << std::setfill(' ') + tbl_stream << "

Simulation Timestamp: " << std::setw(4) << state.dataOutRptTab->td(1) << '-' << std::setfill('0') << std::setw(2) << state.dataOutRptTab->td(2) << '-' + << std::setw(2) << state.dataOutRptTab->td(3) << '\n'; + tbl_stream << " " << std::setw(2) << state.dataOutRptTab->td(5) << ':' << std::setw(2) << state.dataOutRptTab->td(6) << ':' << std::setw(2) << state.dataOutRptTab->td(7) << std::setfill(' ') << "

\n"; } else if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::XML) { DisplayString(state, "Writing tabular output file results using XML format."); @@ -3247,11 +3144,11 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << " " << VerString << "\n"; tbl_stream << " \n"; tbl_stream << " \n"; - tbl_stream << " " << std::setw(4) << td(1) << '-' << std::setfill('0') << std::setw(2) << td(2) << '-' << std::setw(2) - << td(3) << '\n'; + tbl_stream << " " << std::setw(4) << state.dataOutRptTab->td(1) << '-' << std::setfill('0') << std::setw(2) << state.dataOutRptTab->td(2) << '-' << std::setw(2) + << state.dataOutRptTab->td(3) << '\n'; tbl_stream << " \n"; tbl_stream << " \n"; tbl_stream << " \n"; @@ -11805,85 +11702,83 @@ namespace EnergyPlus::OutputReportTabular { if (AllocateLoadComponentArraysDoAllocate) { // For many of the following arrays the last dimension is the number of environments and is same as sizing arrays - radiantPulseTimestep.allocate({0, state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays}, state.dataGlobal->NumOfZones); - radiantPulseTimestep = 0; - radiantPulseReceived.allocate({0, state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays}, TotSurfaces); - radiantPulseReceived = 0.0; - loadConvectedNormal.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, {0, state.dataGlobal->NumOfTimeStepInHour * 24}, TotSurfaces); - loadConvectedNormal = 0.0; - loadConvectedWithPulse.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, {0, state.dataGlobal->NumOfTimeStepInHour * 24}, TotSurfaces); - loadConvectedWithPulse = 0.0; - netSurfRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - netSurfRadSeq = 0.0; - decayCurveCool.allocate(state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - decayCurveCool = 0.0; - decayCurveHeat.allocate(state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - decayCurveHeat = 0.0; - ITABSFseq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - ITABSFseq = 0.0; - TMULTseq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - TMULTseq = 0.0; - peopleInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - peopleInstantSeq = 0.0; - peopleLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - peopleLatentSeq = 0.0; - peopleRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - peopleRadSeq = 0.0; - lightInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - lightInstantSeq = 0.0; - lightRetAirSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - lightRetAirSeq = 0.0; - lightLWRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - lightLWRadSeq = 0.0; - lightSWRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - lightSWRadSeq = 0.0; - equipInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - equipInstantSeq = 0.0; - equipLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - equipLatentSeq = 0.0; - equipRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - equipRadSeq = 0.0; - refrigInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - refrigInstantSeq = 0.0; - refrigRetAirSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - refrigRetAirSeq = 0.0; - refrigLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - refrigLatentSeq = 0.0; - waterUseInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - waterUseInstantSeq = 0.0; - waterUseLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - waterUseLatentSeq = 0.0; - hvacLossInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - hvacLossInstantSeq = 0.0; - hvacLossRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - hvacLossRadSeq = 0.0; - powerGenInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - powerGenInstantSeq = 0.0; - powerGenRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - powerGenRadSeq = 0.0; - infilInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - infilInstantSeq = 0.0; - infilLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - infilLatentSeq = 0.0; - zoneVentInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - zoneVentInstantSeq = 0.0; - zoneVentLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - zoneVentLatentSeq = 0.0; - interZoneMixInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - interZoneMixInstantSeq = 0.0; - interZoneMixLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - interZoneMixLatentSeq = 0.0; - feneCondInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - feneCondInstantSeq = 0.0; - // ALLOCATE(feneSolarInstantSeq(NumOfZones,NumOfTimeStepInHour*24,TotDesDays+TotRunDesPersDays)) - // feneSolarInstantSeq = 0.0d0 - feneSolarRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - feneSolarRadSeq = 0.0; + state.dataOutRptTab->radiantPulseTimestep.allocate({0, state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays}, state.dataGlobal->NumOfZones); + state.dataOutRptTab->radiantPulseTimestep = 0; + state.dataOutRptTab->radiantPulseReceived.allocate({0, state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays}, TotSurfaces); + state.dataOutRptTab->radiantPulseReceived = 0.0; + state.dataOutRptTab->loadConvectedNormal.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, {0, state.dataGlobal->NumOfTimeStepInHour * 24}, TotSurfaces); + state.dataOutRptTab->loadConvectedNormal = 0.0; + state.dataOutRptTab->loadConvectedWithPulse.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, {0, state.dataGlobal->NumOfTimeStepInHour * 24}, TotSurfaces); + state.dataOutRptTab->loadConvectedWithPulse = 0.0; + state.dataOutRptTab->netSurfRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + state.dataOutRptTab->netSurfRadSeq = 0.0; + state.dataOutRptTab->decayCurveCool.allocate(state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + state.dataOutRptTab->decayCurveCool = 0.0; + state.dataOutRptTab->decayCurveHeat.allocate(state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + state.dataOutRptTab->decayCurveHeat = 0.0; + state.dataOutRptTab->ITABSFseq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + state.dataOutRptTab->ITABSFseq = 0.0; + state.dataOutRptTab->TMULTseq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->TMULTseq = 0.0; + state.dataOutRptTab->peopleInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->peopleInstantSeq = 0.0; + state.dataOutRptTab->peopleLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->peopleLatentSeq = 0.0; + state.dataOutRptTab->peopleRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->peopleRadSeq = 0.0; + state.dataOutRptTab->lightInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->lightInstantSeq = 0.0; + state.dataOutRptTab->lightRetAirSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->lightRetAirSeq = 0.0; + state.dataOutRptTab->lightLWRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->lightLWRadSeq = 0.0; + state.dataOutRptTab->lightSWRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + state.dataOutRptTab->lightSWRadSeq = 0.0; + state.dataOutRptTab->equipInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->equipInstantSeq = 0.0; + state.dataOutRptTab->equipLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->equipLatentSeq = 0.0; + state.dataOutRptTab->equipRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->equipRadSeq = 0.0; + state.dataOutRptTab->refrigInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->refrigInstantSeq = 0.0; + state.dataOutRptTab->refrigRetAirSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->refrigRetAirSeq = 0.0; + state.dataOutRptTab->refrigLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->refrigLatentSeq = 0.0; + state.dataOutRptTab->waterUseInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->waterUseInstantSeq = 0.0; + state.dataOutRptTab->waterUseLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->waterUseLatentSeq = 0.0; + state.dataOutRptTab->hvacLossInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->hvacLossInstantSeq = 0.0; + state.dataOutRptTab->hvacLossRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->hvacLossRadSeq = 0.0; + state.dataOutRptTab->powerGenInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->powerGenInstantSeq = 0.0; + state.dataOutRptTab->powerGenRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->powerGenRadSeq = 0.0; + state.dataOutRptTab->infilInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->infilInstantSeq = 0.0; + state.dataOutRptTab->infilLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->infilLatentSeq = 0.0; + state.dataOutRptTab->zoneVentInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->zoneVentInstantSeq = 0.0; + state.dataOutRptTab->zoneVentLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->zoneVentLatentSeq = 0.0; + state.dataOutRptTab->interZoneMixInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->interZoneMixInstantSeq = 0.0; + state.dataOutRptTab->interZoneMixLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->interZoneMixLatentSeq = 0.0; + state.dataOutRptTab->feneCondInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + state.dataOutRptTab->feneCondInstantSeq = 0.0; + state.dataOutRptTab->feneSolarRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + state.dataOutRptTab->feneSolarRadSeq = 0.0; AllocateLoadComponentArraysDoAllocate = false; } } - void DeallocateLoadComponentArrays() + void DeallocateLoadComponentArrays(EnergyPlusData &state) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -11920,12 +11815,9 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - radiantPulseTimestep.deallocate(); - radiantPulseReceived.deallocate(); - // need for reporting DEALLOCATE(loadConvectedNormal) - loadConvectedWithPulse.deallocate(); - // need for reporting DEALLOCATE(decayCurveCool) - // need for reporting DEALLOCATE(decayCurveHeat) + state.dataOutRptTab->radiantPulseTimestep.deallocate(); + state.dataOutRptTab->radiantPulseReceived.deallocate(); + state.dataOutRptTab->loadConvectedWithPulse.deallocate(); } void ComputeLoadComponentDecayCurve(EnergyPlusData &state) @@ -11983,43 +11875,43 @@ namespace EnergyPlus::OutputReportTabular { CoolDesSelected = CalcFinalZoneSizing(ZoneNum).CoolDDNum; // loop over timesteps after pulse occurred if (CoolDesSelected != 0) { - TimeOfPulse = radiantPulseTimestep(CoolDesSelected, ZoneNum); + TimeOfPulse = state.dataOutRptTab->radiantPulseTimestep(CoolDesSelected, ZoneNum); // if the CoolDesSelected time is on a different day than // when the pulse occurred, need to scan back and find when // the pulse occurred. if (TimeOfPulse == 0) { for (i = CoolDesSelected; i >= 1; --i) { - TimeOfPulse = radiantPulseTimestep(i, ZoneNum); + TimeOfPulse = state.dataOutRptTab->radiantPulseTimestep(i, ZoneNum); if (TimeOfPulse != 0) break; } } if (TimeOfPulse == 0) TimeOfPulse = 1; for (TimeStep = TimeOfPulse; TimeStep <= state.dataGlobal->NumOfTimeStepInHour * 24; ++TimeStep) { - if (radiantPulseReceived(CoolDesSelected, SurfNum) != 0.0) { - diff = loadConvectedWithPulse(CoolDesSelected, TimeStep, SurfNum) - loadConvectedNormal(CoolDesSelected, TimeStep, SurfNum); - decayCurveCool(TimeStep - TimeOfPulse + 1, SurfNum) = -diff / radiantPulseReceived(CoolDesSelected, SurfNum); + if (state.dataOutRptTab->radiantPulseReceived(CoolDesSelected, SurfNum) != 0.0) { + diff = state.dataOutRptTab->loadConvectedWithPulse(CoolDesSelected, TimeStep, SurfNum) - state.dataOutRptTab->loadConvectedNormal(CoolDesSelected, TimeStep, SurfNum); + state.dataOutRptTab->decayCurveCool(TimeStep - TimeOfPulse + 1, SurfNum) = -diff / state.dataOutRptTab->radiantPulseReceived(CoolDesSelected, SurfNum); } else { - decayCurveCool(TimeStep - TimeOfPulse + 1, SurfNum) = 0.0; + state.dataOutRptTab->decayCurveCool(TimeStep - TimeOfPulse + 1, SurfNum) = 0.0; } } } HeatDesSelected = CalcFinalZoneSizing(ZoneNum).HeatDDNum; if (HeatDesSelected != 0) { - TimeOfPulse = radiantPulseTimestep(HeatDesSelected, ZoneNum); + TimeOfPulse = state.dataOutRptTab->radiantPulseTimestep(HeatDesSelected, ZoneNum); // scan back to the day that the heating pulse occurs, if necessary if (TimeOfPulse == 0) { for (i = HeatDesSelected; i >= 1; --i) { - TimeOfPulse = radiantPulseTimestep(i, ZoneNum); + TimeOfPulse = state.dataOutRptTab->radiantPulseTimestep(i, ZoneNum); if (TimeOfPulse != 0) break; } } if (TimeOfPulse == 0) TimeOfPulse = 1; for (TimeStep = TimeOfPulse; TimeStep <= state.dataGlobal->NumOfTimeStepInHour * 24; ++TimeStep) { - if (radiantPulseReceived(HeatDesSelected, SurfNum) != 0.0) { - diff = loadConvectedWithPulse(HeatDesSelected, TimeStep, SurfNum) - loadConvectedNormal(HeatDesSelected, TimeStep, SurfNum); - decayCurveHeat(TimeStep - TimeOfPulse + 1, SurfNum) = -diff / radiantPulseReceived(HeatDesSelected, SurfNum); + if (state.dataOutRptTab->radiantPulseReceived(HeatDesSelected, SurfNum) != 0.0) { + diff = state.dataOutRptTab->loadConvectedWithPulse(HeatDesSelected, TimeStep, SurfNum) - state.dataOutRptTab->loadConvectedNormal(HeatDesSelected, TimeStep, SurfNum); + state.dataOutRptTab->decayCurveHeat(TimeStep - TimeOfPulse + 1, SurfNum) = -diff / state.dataOutRptTab->radiantPulseReceived(HeatDesSelected, SurfNum); } else { - decayCurveHeat(TimeStep - TimeOfPulse + 1, SurfNum) = 0.0; + state.dataOutRptTab->decayCurveHeat(TimeStep - TimeOfPulse + 1, SurfNum) = 0.0; } } } @@ -12039,7 +11931,7 @@ namespace EnergyPlus::OutputReportTabular { if (Surface(kSurf).Zone != iZone) continue; print(state.files.eio, "{},{},{}", "Radiant to Convective Decay Curves for Cooling", Zone(iZone).Name, Surface(kSurf).Name); for (int jTime = 1; jTime <= min(state.dataGlobal->NumOfTimeStepInHour * 24, 36); ++jTime) { - print(state.files.eio, ",{:6.3F}", decayCurveCool(jTime, kSurf)); + print(state.files.eio, ",{:6.3F}", state.dataOutRptTab->decayCurveCool(jTime, kSurf)); } // put a line feed at the end of the line print(state.files.eio, "\n"); @@ -12049,7 +11941,7 @@ namespace EnergyPlus::OutputReportTabular { if (Surface(kSurf).Zone != iZone) continue; print(state.files.eio, "{},{},{}", "Radiant to Convective Decay Curves for Heating", Zone(iZone).Name, Surface(kSurf).Name); for (int jTime = 1; jTime <= min(state.dataGlobal->NumOfTimeStepInHour * 24, 36); ++jTime) { - print(state.files.eio, ",{:6.3F}", decayCurveHeat(jTime, kSurf)); + print(state.files.eio, ",{:6.3F}", state.dataOutRptTab->decayCurveHeat(jTime, kSurf)); } // put a line feed at the end of the line print(state.files.eio, "\n"); @@ -12108,13 +12000,13 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; - feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, _) = 0.0; + state.dataOutRptTab->feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, _) = 0.0; for (iSurf = 1; iSurf <= TotSurfaces; ++iSurf) { ZoneNum = Surface(iSurf).Zone; if (ZoneNum == 0) continue; if (Surface(iSurf).Class != DataSurfaces::SurfaceClass::Window) continue; // IF (.not. ZoneEquipConfig(ZoneNum)%IsControlled) CYCLE - feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, ZoneNum) += + state.dataOutRptTab->feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, ZoneNum) += SurfWinGainConvGlazToZoneRep(iSurf) + SurfWinGainConvGlazShadGapToZoneRep(iSurf) + SurfWinGainConvShadeToZoneRep(iSurf) + SurfWinGainFrameDividerToZoneRep(iSurf); // for now assume zero instant solar - may change related @@ -12125,7 +12017,7 @@ namespace EnergyPlus::OutputReportTabular { for (int izone = 1; izone <= state.dataGlobal->NumOfZones; ++izone) { Real64 tubularGain = 0.0; InternalHeatGains::SumInternalConvectionGainsByTypes(izone, IntGainTypesTubular, tubularGain); - feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, izone) += tubularGain; + state.dataOutRptTab->feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, izone) += tubularGain; } } } @@ -12174,47 +12066,47 @@ namespace EnergyPlus::OutputReportTabular { if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - infilInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = + state.dataOutRptTab->infilInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).InfilHeatGain - ZnAirRpt(iZone).InfilHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone infiltration if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - infilInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += + state.dataOutRptTab->infilInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneInfiSenGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneInfiSenLossW); // air flow network } - infilLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = + state.dataOutRptTab->infilLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).InfilLatentGain - ZnAirRpt(iZone).InfilLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone infiltration if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - infilLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) += + state.dataOutRptTab->infilLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneInfiLatGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneInfiLatLossW); // air flow network } - zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = + state.dataOutRptTab->zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).VentilHeatGain - ZnAirRpt(iZone).VentilHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone ventilation if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += + state.dataOutRptTab->zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneVentSenGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneVentSenLossW); // air flow network } - zoneVentLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = + state.dataOutRptTab->zoneVentLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).VentilLatentGain - ZnAirRpt(iZone).VentilLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone ventilation if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += + state.dataOutRptTab->zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneVentLatGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneVentLatLossW); // air flow network } - interZoneMixInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = + state.dataOutRptTab->interZoneMixInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).MixHeatGain - ZnAirRpt(iZone).MixHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone mixing if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - interZoneMixInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += + state.dataOutRptTab->interZoneMixInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneMixSenGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneMixSenLossW); // air flow network } - interZoneMixLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = + state.dataOutRptTab->interZoneMixLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).MixLatentGain - ZnAirRpt(iZone).MixLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone mixing if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - interZoneMixLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) += + state.dataOutRptTab->interZoneMixLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneMixLatGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneMixLatLossW); // air flow network } @@ -12458,7 +12350,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqCool); ComputeTableBodyUsingMovingAvg(state, ZoneCoolCompLoadTables(iZone).cells, @@ -12472,7 +12364,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqCool); CollectPeakZoneConditions(state, ZoneCoolCompLoadTables(iZone), coolDesSelected, timeCoolMax, iZone, true); // send latent load info to coil summary report @@ -12493,7 +12385,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqHeat); ComputeTableBodyUsingMovingAvg(state, ZoneHeatCompLoadTables(iZone).cells, @@ -12507,7 +12399,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqHeat); CollectPeakZoneConditions(state, ZoneHeatCompLoadTables(iZone), heatDesSelected, timeHeatMax, iZone, false); @@ -12614,7 +12506,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqCool); ComputeTableBodyUsingMovingAvg(state, AirLoopZonesCoolCompLoadTables(iZone).cells, @@ -12628,7 +12520,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqCool); CollectPeakZoneConditions(state, AirLoopZonesCoolCompLoadTables(iZone), coolDesSelected, timeCoolMax, iZone, true); AddAreaColumnForZone(iZone, ZoneComponentAreas, AirLoopZonesCoolCompLoadTables(iZone)); @@ -12651,7 +12543,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqHeat); ComputeTableBodyUsingMovingAvg(state, AirLoopZonesHeatCompLoadTables(iZone).cells, @@ -12665,7 +12557,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqHeat); CollectPeakZoneConditions(state, AirLoopZonesHeatCompLoadTables(iZone), heatDesSelected, timeHeatMax, iZone, false); AddAreaColumnForZone(iZone, ZoneComponentAreas, AirLoopZonesHeatCompLoadTables(iZone)); @@ -12733,7 +12625,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqCool); ComputeTableBodyUsingMovingAvg(state, FacilityZonesCoolCompLoadTables(iZone).cells, @@ -12747,7 +12639,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqCool); CollectPeakZoneConditions(state, FacilityZonesCoolCompLoadTables(iZone), coolDesSelected, timeCoolMax, iZone, true); AddAreaColumnForZone(iZone, ZoneComponentAreas, FacilityZonesCoolCompLoadTables(iZone)); @@ -12770,7 +12662,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqHeat); ComputeTableBodyUsingMovingAvg(state, FacilityZonesHeatCompLoadTables(iZone).cells, @@ -12784,7 +12676,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - feneCondInstantSeq, + state.dataOutRptTab->feneCondInstantSeq, surfDelaySeqHeat); CollectPeakZoneConditions(state, FacilityZonesHeatCompLoadTables(iZone), heatDesSelected, timeHeatMax, iZone, false); AddAreaColumnForZone(iZone, ZoneComponentAreas, FacilityZonesHeatCompLoadTables(iZone)); @@ -12879,9 +12771,9 @@ namespace EnergyPlus::OutputReportTabular { Array2D decayCurve; if (isCooling) { - decayCurve = decayCurveCool; + decayCurve = state.dataOutRptTab->decayCurveCool; } else { - decayCurve = decayCurveHeat; + decayCurve = state.dataOutRptTab->decayCurveHeat; } for (int kTimeStep = 1; kTimeStep <= state.dataGlobal->NumOfTimeStepInHour * 24; ++kTimeStep) { @@ -12909,17 +12801,17 @@ namespace EnergyPlus::OutputReportTabular { for (int mStepBack = 1; mStepBack <= kTimeStep; ++mStepBack) { int sourceStep = kTimeStep - mStepBack + 1; - Real64 thisQRadThermInAbsMult = TMULTseq(desDaySelected, sourceStep, radEnclosureNum) * - ITABSFseq(desDaySelected, sourceStep, jSurf) * Surface(jSurf).Area * + Real64 thisQRadThermInAbsMult = state.dataOutRptTab->TMULTseq(desDaySelected, sourceStep, radEnclosureNum) * + state.dataOutRptTab->ITABSFseq(desDaySelected, sourceStep, jSurf) * Surface(jSurf).Area * decayCurve(mStepBack, jSurf); - peopleConvFromSurf += peopleRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; - equipConvFromSurf += equipRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; - hvacLossConvFromSurf += hvacLossRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; - powerGenConvFromSurf += powerGenRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; - lightLWConvFromSurf += lightLWRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; + peopleConvFromSurf += state.dataOutRptTab->peopleRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; + equipConvFromSurf += state.dataOutRptTab->equipRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; + hvacLossConvFromSurf += state.dataOutRptTab->hvacLossRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; + powerGenConvFromSurf += state.dataOutRptTab->powerGenRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; + lightLWConvFromSurf += state.dataOutRptTab->lightLWRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; // short wave is already accumulated by surface - lightSWConvFromSurf += lightSWRadSeq(desDaySelected, sourceStep, jSurf) * decayCurve(mStepBack, jSurf); - feneSolarConvFromSurf += feneSolarRadSeq(desDaySelected, sourceStep, jSurf) * decayCurve(mStepBack, jSurf); + lightSWConvFromSurf += state.dataOutRptTab->lightSWRadSeq(desDaySelected, sourceStep, jSurf) * decayCurve(mStepBack, jSurf); + feneSolarConvFromSurf += state.dataOutRptTab->feneSolarRadSeq(desDaySelected, sourceStep, jSurf) * decayCurve(mStepBack, jSurf); } // for mStepBack peopleConvIntoZone += peopleConvFromSurf; @@ -12934,13 +12826,13 @@ namespace EnergyPlus::OutputReportTabular { // on any of these other loads // negative because heat from surface should be positive surfDelaySeq(kTimeStep, jSurf) = - -loadConvectedNormal(desDaySelected, kTimeStep, jSurf) - netSurfRadSeq(desDaySelected, kTimeStep, jSurf) - + -state.dataOutRptTab->loadConvectedNormal(desDaySelected, kTimeStep, jSurf) - state.dataOutRptTab->netSurfRadSeq(desDaySelected, kTimeStep, jSurf) - (peopleConvFromSurf + equipConvFromSurf + hvacLossConvFromSurf + powerGenConvFromSurf + lightLWConvFromSurf + lightSWConvFromSurf + feneSolarConvFromSurf); // remove net radiant for the surface // also remove the net radiant component on the instanteous conduction for fenestration if (Surface(jSurf).Class == DataSurfaces::SurfaceClass::Window) { - adjFeneSurfNetRadSeq += netSurfRadSeq(desDaySelected, kTimeStep, jSurf); + adjFeneSurfNetRadSeq += state.dataOutRptTab->netSurfRadSeq(desDaySelected, kTimeStep, jSurf); } } // for jSurf peopleDelaySeq(kTimeStep) = peopleConvIntoZone; @@ -13024,51 +12916,51 @@ namespace EnergyPlus::OutputReportTabular { if (desDaySelected != 0 && timeOfMax != 0) { // PEOPLE - resultCells(cSensInst, rPeople) = MovingAvgAtMaxTime(peopleInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rPeople) = MovingAvgAtMaxTime(state.dataOutRptTab->peopleInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rPeople) = true; - resultCells(cLatent, rPeople) = MovingAvgAtMaxTime(peopleLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rPeople) = MovingAvgAtMaxTime(state.dataOutRptTab->peopleLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rPeople) = true; resultCells(cSensDelay, rPeople) = MovingAvgAtMaxTime(peopleDelaySeq(_), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensDelay, rPeople) = true; // LIGHTS - resultCells(cSensInst, rLights) = MovingAvgAtMaxTime(lightInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rLights) = MovingAvgAtMaxTime(state.dataOutRptTab->lightInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rLights) = true; - resultCells(cSensRA, rLights) = MovingAvgAtMaxTime(lightRetAirSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensRA, rLights) = MovingAvgAtMaxTime(state.dataOutRptTab->lightRetAirSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensRA, rLights) = true; resultCells(cSensDelay, rLights) = MovingAvgAtMaxTime(lightDelaySeq(_), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensDelay, rLights) = true; // EQUIPMENT - resultCells(cSensInst, rEquip) = MovingAvgAtMaxTime(equipInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rEquip) = MovingAvgAtMaxTime(state.dataOutRptTab->equipInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rEquip) = true; - resultCells(cLatent, rEquip) = MovingAvgAtMaxTime(equipLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rEquip) = MovingAvgAtMaxTime(state.dataOutRptTab->equipLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rEquip) = true; resultCells(cSensDelay, rEquip) = MovingAvgAtMaxTime(equipDelaySeq(_), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensDelay, rEquip) = true; // REFRIGERATION EQUIPMENT - resultCells(cSensInst, rRefrig) = MovingAvgAtMaxTime(refrigInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rRefrig) = MovingAvgAtMaxTime(state.dataOutRptTab->refrigInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rRefrig) = true; - resultCells(cSensRA, rRefrig) = MovingAvgAtMaxTime(refrigRetAirSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensRA, rRefrig) = MovingAvgAtMaxTime(state.dataOutRptTab->refrigRetAirSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensRA, rRefrig) = true; - resultCells(cLatent, rRefrig) = MovingAvgAtMaxTime(refrigLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rRefrig) = MovingAvgAtMaxTime(state.dataOutRptTab->refrigLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rRefrig) = true; // WATER USE EQUIPMENT - resultCells(cSensInst, rWaterUse) = MovingAvgAtMaxTime(waterUseInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rWaterUse) = MovingAvgAtMaxTime(state.dataOutRptTab->waterUseInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rWaterUse) = true; - resultCells(cLatent, rWaterUse) = MovingAvgAtMaxTime(waterUseLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rWaterUse) = MovingAvgAtMaxTime(state.dataOutRptTab->waterUseLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rWaterUse) = true; // HVAC EQUIPMENT LOSSES - resultCells(cSensInst, rHvacLoss) = MovingAvgAtMaxTime(hvacLossInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rHvacLoss) = MovingAvgAtMaxTime(state.dataOutRptTab->hvacLossInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rHvacLoss) = true; resultCells(cSensDelay, rHvacLoss) = MovingAvgAtMaxTime(hvacLossDelaySeq(_), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensDelay, rHvacLoss) = true; // POWER GENERATION EQUIPMENT - resultCells(cSensInst, rPowerGen) = MovingAvgAtMaxTime(powerGenInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rPowerGen) = MovingAvgAtMaxTime(state.dataOutRptTab->powerGenInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rPowerGen) = true; resultCells(cSensDelay, rPowerGen) = MovingAvgAtMaxTime(powerGenDelaySeq(_), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensDelay, rPowerGen) = true; @@ -13080,22 +12972,22 @@ namespace EnergyPlus::OutputReportTabular { resCellsUsd(cLatent, rDOAS) = true; // INFILTRATION - resultCells(cSensInst, rInfil) = MovingAvgAtMaxTime(infilInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rInfil) = MovingAvgAtMaxTime(state.dataOutRptTab->infilInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rInfil) = true; - resultCells(cLatent, rInfil) = MovingAvgAtMaxTime(infilLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rInfil) = MovingAvgAtMaxTime(state.dataOutRptTab->infilLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rInfil) = true; // ZONE VENTILATION - resultCells(cSensInst, rZoneVent) = MovingAvgAtMaxTime(zoneVentInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rZoneVent) = MovingAvgAtMaxTime(state.dataOutRptTab->zoneVentInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rZoneVent) = true; - resultCells(cLatent, rZoneVent) = MovingAvgAtMaxTime(zoneVentLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rZoneVent) = MovingAvgAtMaxTime(state.dataOutRptTab->zoneVentLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rZoneVent) = true; // INTERZONE MIXING resultCells(cSensInst, rIntZonMix) = - MovingAvgAtMaxTime(interZoneMixInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + MovingAvgAtMaxTime(state.dataOutRptTab->interZoneMixInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rIntZonMix) = true; - resultCells(cLatent, rIntZonMix) = MovingAvgAtMaxTime(interZoneMixLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rIntZonMix) = MovingAvgAtMaxTime(state.dataOutRptTab->interZoneMixLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rIntZonMix) = true; // FENESTRATION CONDUCTION @@ -13984,9 +13876,9 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << "\n"; tbl_stream << "

Report:" << curDel << modifiedReportName << "

\n"; tbl_stream << "

For:" << curDel << objectName << "

\n"; - tbl_stream << "

Timestamp: " << std::setw(4) << td(1) << '-' << std::setfill('0') << std::setw(2) << td(2) << '-' << std::setw(2) - << td(3) << '\n'; - tbl_stream << " " << std::setw(2) << td(5) << ':' << std::setw(2) << td(6) << ':' << std::setw(2) << td(7) << std::setfill(' ') + tbl_stream << "

Timestamp: " << std::setw(4) << state.dataOutRptTab->td(1) << '-' << std::setfill('0') << std::setw(2) << state.dataOutRptTab->td(2) << '-' << std::setw(2) + << state.dataOutRptTab->td(3) << '\n'; + tbl_stream << " " << std::setw(2) << state.dataOutRptTab->td(5) << ':' << std::setw(2) << state.dataOutRptTab->td(6) << ':' << std::setw(2) << state.dataOutRptTab->td(7) << std::setfill(' ') << "

\n"; } else if (style == iTableStyle::XML) { if (len(prevReportName) != 0) { diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 79482c01955..80fd0ebb112 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -182,78 +182,6 @@ namespace OutputReportTabular { // Allow up to five output files to be created constexpr int maxNumStyles(5); - extern Array1D_int td; - //(1) Current year - //(2) Current month - //(3) Current day - //(4) Time difference with respect to UTC in minutes (0-59) - //(5) Hour of the day (0-23) - //(6) Minutes (0-59) - //(7) Seconds (0-59) - //(8) Milliseconds (0-999) - - // Design day name storage - extern Array1D_string DesignDayName; - extern int DesignDayCount; - - // arrays related to pulse and load component reporting - extern Array2D_int radiantPulseTimestep; - extern Array2D radiantPulseReceived; - extern Array3D loadConvectedNormal; - extern Array3D loadConvectedWithPulse; - extern Array3D netSurfRadSeq; - extern Array2D decayCurveCool; - extern Array2D decayCurveHeat; - extern Array3D ITABSFseq; // used for determining the radiant fraction on each surface - extern Array3D TMULTseq; // used for determining the radiant fraction on each surface - - extern Array3D peopleInstantSeq; - extern Array3D peopleLatentSeq; - extern Array3D peopleRadSeq; - extern Array3D peopleDelaySeq; - - extern Array3D lightInstantSeq; - extern Array3D lightRetAirSeq; - extern Array3D lightLWRadSeq; // long wave thermal radiation - extern Array3D lightSWRadSeq; // short wave visible radiation - extern Array3D lightDelaySeq; - - extern Array3D equipInstantSeq; - extern Array3D equipLatentSeq; - extern Array3D equipRadSeq; - extern Array3D equipDelaySeq; - - extern Array3D refrigInstantSeq; - extern Array3D refrigRetAirSeq; - extern Array3D refrigLatentSeq; - - extern Array3D waterUseInstantSeq; - extern Array3D waterUseLatentSeq; - - extern Array3D hvacLossInstantSeq; - extern Array3D hvacLossRadSeq; - extern Array3D hvacLossDelaySeq; - - extern Array3D powerGenInstantSeq; - extern Array3D powerGenRadSeq; - extern Array3D powerGenDelaySeq; - - extern Array3D infilInstantSeq; - extern Array3D infilLatentSeq; - - extern Array3D zoneVentInstantSeq; - extern Array3D zoneVentLatentSeq; - - extern Array3D interZoneMixInstantSeq; - extern Array3D interZoneMixLatentSeq; - - extern Array3D feneCondInstantSeq; - // REAL(r64), DIMENSION(:,:,:),ALLOCATABLE,PUBLIC :: feneSolarInstantSeq - extern Array3D feneSolarRadSeq; - extern Array3D feneSolarDelaySeq; - - extern Array3D surfDelaySeq; - extern int maxUniqueKeyCount; // for the XML report must keep track fo the active sub-table name and report set by other routines @@ -722,7 +650,7 @@ namespace OutputReportTabular { void AllocateLoadComponentArrays(EnergyPlusData &state); - void DeallocateLoadComponentArrays(); + void DeallocateLoadComponentArrays(EnergyPlusData &state); void ComputeLoadComponentDecayCurve(EnergyPlusData &state); @@ -1066,6 +994,68 @@ struct OutputReportTabularData : BaseGlobalStruct { Real64 sourceFactorOtherFuel1 = 0.0; Real64 sourceFactorOtherFuel2 = 0.0; + Array1D_int td = Array1D_int(8); + //(1) Current year + //(2) Current month + //(3) Current day + //(4) Time difference with respect to UTC in minutes (0-59) + //(5) Hour of the day (0-23) + //(6) Minutes (0-59) + //(7) Seconds (0-59) + //(8) Milliseconds (0-999) + + // Design day name storage + Array1D_string DesignDayName; + int DesignDayCount = 0; + + // arrays related to pulse and load component reporting + Array2D_int radiantPulseTimestep; + Array2D radiantPulseReceived; + Array3D loadConvectedNormal; + Array3D loadConvectedWithPulse; + Array3D netSurfRadSeq; + Array2D decayCurveCool; + Array2D decayCurveHeat; + Array3D ITABSFseq; // used for determining the radiant fraction on each surface + Array3D TMULTseq; // used for determining the radiant fraction on each surface + + Array3D peopleInstantSeq; + Array3D peopleLatentSeq; + Array3D peopleRadSeq; + + Array3D lightInstantSeq; + Array3D lightRetAirSeq; + Array3D lightLWRadSeq; // long wave thermal radiation + Array3D lightSWRadSeq; // short wave visible radiation + + Array3D equipInstantSeq; + Array3D equipLatentSeq; + Array3D equipRadSeq; + + Array3D refrigInstantSeq; + Array3D refrigRetAirSeq; + Array3D refrigLatentSeq; + + Array3D waterUseInstantSeq; + Array3D waterUseLatentSeq; + + Array3D hvacLossInstantSeq; + Array3D hvacLossRadSeq; + + Array3D powerGenInstantSeq; + Array3D powerGenRadSeq; + Array3D infilInstantSeq; + Array3D infilLatentSeq; + + Array3D zoneVentInstantSeq; + Array3D zoneVentLatentSeq; + + Array3D interZoneMixInstantSeq; + Array3D interZoneMixLatentSeq; + + Array3D feneCondInstantSeq; + Array3D feneSolarRadSeq; + void clear_state() override { this->unitsStyle = OutputReportTabular::iUnitsStyle::None; @@ -1197,6 +1187,45 @@ struct OutputReportTabularData : BaseGlobalStruct { this->sourceFactorPropane = 0.0; this->sourceFactorOtherFuel1 = 0.0; this->sourceFactorOtherFuel2 = 0.0; + this->td = Array1D_int(8); + this->DesignDayName.deallocate(); + this->DesignDayCount = 0; + this->radiantPulseTimestep.deallocate(); + this->radiantPulseReceived.deallocate(); + this->loadConvectedNormal.deallocate(); + this->loadConvectedWithPulse.deallocate(); + this->netSurfRadSeq.deallocate(); + this->decayCurveCool.deallocate(); + this->decayCurveHeat.deallocate(); + this->ITABSFseq.deallocate(); + this->TMULTseq .deallocate(); + this->peopleInstantSeq.deallocate(); + this->peopleLatentSeq.deallocate(); + this->peopleRadSeq.deallocate(); + this->lightInstantSeq.deallocate(); + this->lightRetAirSeq.deallocate(); + this->lightLWRadSeq.deallocate(); + this->lightSWRadSeq.deallocate(); + this->equipInstantSeq.deallocate(); + this->equipLatentSeq.deallocate(); + this->equipRadSeq.deallocate(); + this->refrigInstantSeq.deallocate(); + this->refrigRetAirSeq.deallocate(); + this->refrigLatentSeq.deallocate(); + this->waterUseInstantSeq.deallocate(); + this->waterUseLatentSeq.deallocate(); + this->hvacLossInstantSeq.deallocate(); + this->hvacLossRadSeq.deallocate(); + this->powerGenInstantSeq.deallocate(); + this->powerGenRadSeq.deallocate(); + this->infilInstantSeq.deallocate(); + this->infilLatentSeq.deallocate(); + this->zoneVentInstantSeq.deallocate(); + this->zoneVentLatentSeq.deallocate(); + this->interZoneMixInstantSeq.deallocate(); + this->interZoneMixLatentSeq.deallocate(); + this->feneCondInstantSeq.deallocate(); + this->feneSolarRadSeq.deallocate(); } }; diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 9d0634a7649..42d8203193c 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -411,7 +411,7 @@ namespace SizingManager { // call the routine that computes the decay curve ComputeLoadComponentDecayCurve(state); // remove some of the arrays used to derive the decay curves - DeallocateLoadComponentArrays(); + DeallocateLoadComponentArrays(state); } } diff --git a/tst/EnergyPlus/unit/InternalHeatGains.unit.cc b/tst/EnergyPlus/unit/InternalHeatGains.unit.cc index 4014b8fdf26..c272bcd2604 100644 --- a/tst/EnergyPlus/unit/InternalHeatGains.unit.cc +++ b/tst/EnergyPlus/unit/InternalHeatGains.unit.cc @@ -691,13 +691,13 @@ TEST_F(EnergyPlusFixture, InternalHeatGains_CheckZoneComponentLoadSubtotals) state->dataGlobal->CompLoadReportIsReq = true; state->dataGlobal->isPulseZoneSizing = false; InternalHeatGains::GatherComponentLoadsIntGain(*state); - totConvGains = OutputReportTabular::peopleInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + - OutputReportTabular::lightInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + - OutputReportTabular::equipInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + - OutputReportTabular::refrigInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + - OutputReportTabular::waterUseInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + - OutputReportTabular::hvacLossInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + - OutputReportTabular::powerGenInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum); + totConvGains = state->dataOutRptTab->peopleInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + + state->dataOutRptTab->lightInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + + state->dataOutRptTab->equipInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + + state->dataOutRptTab->refrigInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + + state->dataOutRptTab->waterUseInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + + state->dataOutRptTab->hvacLossInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum) + + state->dataOutRptTab->powerGenInstantSeq(DataSizing::CurOverallSimDay, timeStepInDay, zoneNum); // Legitimate gain types excluded from this total expectedTotConvGains -= convGains(DataHeatBalance::IntGainTypeOf_ZoneContaminantSourceAndSinkCarbonDioxide); // this is only used for CO2 diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 48df188a13c..9c5568973dd 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -496,127 +496,127 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_AllocateLoadComponentArraysTes AllocateLoadComponentArrays(*state); // radiantPulseTimestep.allocate( { 0, TotDesDays + TotRunDesPersDays }, NumOfZones ); - EXPECT_EQ(radiantPulseTimestep.size(), 24u); + EXPECT_EQ(state->dataOutRptTab->radiantPulseTimestep.size(), 24u); // radiantPulseReceived.allocate( { 0, TotDesDays + TotRunDesPersDays }, TotSurfaces ); - EXPECT_EQ(radiantPulseReceived.size(), 42u); + EXPECT_EQ(state->dataOutRptTab->radiantPulseReceived.size(), 42u); // loadConvectedNormal.allocate( TotDesDays + TotRunDesPersDays, { 0, NumOfTimeStepInHour * 24 }, TotSurfaces ); - EXPECT_EQ(loadConvectedNormal.size(), 3395u); + EXPECT_EQ(state->dataOutRptTab->loadConvectedNormal.size(), 3395u); // loadConvectedWithPulse.allocate( TotDesDays + TotRunDesPersDays, { 0, NumOfTimeStepInHour * 24 }, TotSurfaces ); - EXPECT_EQ(loadConvectedWithPulse.size(), 3395u); + EXPECT_EQ(state->dataOutRptTab->loadConvectedWithPulse.size(), 3395u); // netSurfRadSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, TotSurfaces ); - EXPECT_EQ(netSurfRadSeq.size(), 3360u); + EXPECT_EQ(state->dataOutRptTab->netSurfRadSeq.size(), 3360u); // decayCurveCool.allocate( NumOfTimeStepInHour * 24, TotSurfaces ); - EXPECT_EQ(decayCurveCool.size(), 672u); + EXPECT_EQ(state->dataOutRptTab->decayCurveCool.size(), 672u); // decayCurveHeat.allocate( NumOfTimeStepInHour * 24, TotSurfaces ); - EXPECT_EQ(decayCurveHeat.size(), 672u); + EXPECT_EQ(state->dataOutRptTab->decayCurveHeat.size(), 672u); // ITABSFseq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, TotSurfaces ); - EXPECT_EQ(ITABSFseq.size(), 3360u); + EXPECT_EQ(state->dataOutRptTab->ITABSFseq.size(), 3360u); // TMULTseq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(TMULTseq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->TMULTseq.size(), 1920u); // peopleInstantSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(peopleInstantSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->peopleInstantSeq.size(), 1920u); // peopleLatentSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(peopleLatentSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->peopleLatentSeq.size(), 1920u); // peopleRadSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(peopleRadSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->peopleRadSeq.size(), 1920u); // peopleDelaySeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); // EXPECT_EQ( peopleDelaySeq.size(), 1920u ); // lightInstantSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(lightInstantSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->lightInstantSeq.size(), 1920u); // lightRetAirSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(lightRetAirSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->lightRetAirSeq.size(), 1920u); // lightLWRadSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(lightLWRadSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->lightLWRadSeq.size(), 1920u); // lightSWRadSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, TotSurfaces ); - EXPECT_EQ(lightSWRadSeq.size(), 3360u); + EXPECT_EQ(state->dataOutRptTab->lightSWRadSeq.size(), 3360u); // lightDelaySeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); // EXPECT_EQ( lightDelaySeq.size(), 1920u ); // equipInstantSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(equipInstantSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->equipInstantSeq.size(), 1920u); // equipLatentSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(equipLatentSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->equipLatentSeq.size(), 1920u); // equipRadSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(equipRadSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->equipRadSeq.size(), 1920u); // equipDelaySeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); // EXPECT_EQ( equipDelaySeq.size(), 1920u ); // refrigInstantSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(refrigInstantSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->refrigInstantSeq.size(), 1920u); // refrigRetAirSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(refrigRetAirSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->refrigRetAirSeq.size(), 1920u); // refrigLatentSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(refrigLatentSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->refrigLatentSeq.size(), 1920u); // waterUseInstantSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(waterUseInstantSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->waterUseInstantSeq.size(), 1920u); // waterUseLatentSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(waterUseLatentSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->waterUseLatentSeq.size(), 1920u); // hvacLossInstantSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(hvacLossInstantSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->hvacLossInstantSeq.size(), 1920u); // hvacLossRadSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(hvacLossRadSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->hvacLossRadSeq.size(), 1920u); // hvacLossDelaySeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); // EXPECT_EQ( hvacLossDelaySeq.size(), 1920u ); // powerGenInstantSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(powerGenInstantSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->powerGenInstantSeq.size(), 1920u); // powerGenRadSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(powerGenRadSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->powerGenRadSeq.size(), 1920u); // powerGenDelaySeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); // EXPECT_EQ( powerGenDelaySeq.size(), 1920u ); // infilInstantSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(infilInstantSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->infilInstantSeq.size(), 1920u); // infilLatentSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(infilLatentSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->infilLatentSeq.size(), 1920u); // zoneVentInstantSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(zoneVentInstantSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->zoneVentInstantSeq.size(), 1920u); // zoneVentLatentSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(zoneVentLatentSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->zoneVentLatentSeq.size(), 1920u); // interZoneMixInstantSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(interZoneMixInstantSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->interZoneMixInstantSeq.size(), 1920u); // interZoneMixLatentSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(interZoneMixLatentSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->interZoneMixLatentSeq.size(), 1920u); // feneCondInstantSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); - EXPECT_EQ(feneCondInstantSeq.size(), 1920u); + EXPECT_EQ(state->dataOutRptTab->feneCondInstantSeq.size(), 1920u); // feneSolarRadSeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, TotSurfaces ); - EXPECT_EQ(feneSolarRadSeq.size(), 3360u); + EXPECT_EQ(state->dataOutRptTab->feneSolarRadSeq.size(), 3360u); // feneSolarDelaySeq.allocate( TotDesDays + TotRunDesPersDays, NumOfTimeStepInHour * 24, NumOfZones ); // EXPECT_EQ( feneSolarDelaySeq.size(), 1920u ); @@ -6842,7 +6842,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_GetDelaySequencesTwice_test) feneCondInstantSeq(coolDesSelected, 1, 1) = 0.88; - netSurfRadSeq(coolDesSelected, 1, 1) = 0.05; + state->dataOutRptTab->netSurfRadSeq(coolDesSelected, 1, 1) = 0.05; GetDelaySequences(*state, coolDesSelected, @@ -8188,14 +8188,14 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_GetDelaySequencesSurfaceOrder_ for (int jSurf = 1; jSurf <= 4; ++jSurf) { for (int step = 1; step <= 10; ++step) { - OutputReportTabular::TMULTseq(coolDesSelected, step, radEnclosureNum) = 0.1 * step; - OutputReportTabular::ITABSFseq(coolDesSelected, step, jSurf) = 0.2 * step * surfBaseValue[jSurf - 1]; - OutputReportTabular::decayCurveCool(step, jSurf) = 0.3 * step * surfBaseValue[jSurf - 1]; - OutputReportTabular::peopleRadSeq(coolDesSelected, step, iZone) = 0.4 * step; - OutputReportTabular::equipRadSeq(coolDesSelected, step, iZone) = 0.5 * step; - OutputReportTabular::hvacLossRadSeq(coolDesSelected, step, iZone) = 0.6 * step; - OutputReportTabular::powerGenRadSeq(coolDesSelected, step, iZone) = 0.7 * step; - OutputReportTabular::lightLWRadSeq(coolDesSelected, step, iZone) = 0.8 * step; + state->dataOutRptTab->TMULTseq(coolDesSelected, step, radEnclosureNum) = 0.1 * step; + state->dataOutRptTab->ITABSFseq(coolDesSelected, step, jSurf) = 0.2 * step * surfBaseValue[jSurf - 1]; + state->dataOutRptTab->decayCurveCool(step, jSurf) = 0.3 * step * surfBaseValue[jSurf - 1]; + state->dataOutRptTab->peopleRadSeq(coolDesSelected, step, iZone) = 0.4 * step; + state->dataOutRptTab->equipRadSeq(coolDesSelected, step, iZone) = 0.5 * step; + state->dataOutRptTab->hvacLossRadSeq(coolDesSelected, step, iZone) = 0.6 * step; + state->dataOutRptTab->powerGenRadSeq(coolDesSelected, step, iZone) = 0.7 * step; + state->dataOutRptTab->lightLWRadSeq(coolDesSelected, step, iZone) = 0.8 * step; } } @@ -8237,14 +8237,14 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_GetDelaySequencesSurfaceOrder_ for (int jSurf = 1; jSurf <= 4; ++jSurf) { for (int step = 1; step <= 10; ++step) { - OutputReportTabular::TMULTseq(coolDesSelected, step, radEnclosureNum) = 0.1 * step; - OutputReportTabular::ITABSFseq(coolDesSelected, step, jSurf) = 0.2 * step * surfBaseValue[jSurf - 1]; - OutputReportTabular::decayCurveCool(step, jSurf) = 0.3 * step * surfBaseValue[jSurf - 1]; - OutputReportTabular::peopleRadSeq(coolDesSelected, step, iZone) = 0.4 * step; - OutputReportTabular::equipRadSeq(coolDesSelected, step, iZone) = 0.5 * step; - OutputReportTabular::hvacLossRadSeq(coolDesSelected, step, iZone) = 0.6 * step; - OutputReportTabular::powerGenRadSeq(coolDesSelected, step, iZone) = 0.7 * step; - OutputReportTabular::lightLWRadSeq(coolDesSelected, step, iZone) = 0.8 * step; + state->dataOutRptTab->TMULTseq(coolDesSelected, step, radEnclosureNum) = 0.1 * step; + state->dataOutRptTab->ITABSFseq(coolDesSelected, step, jSurf) = 0.2 * step * surfBaseValue[jSurf - 1]; + state->dataOutRptTab->decayCurveCool(step, jSurf) = 0.3 * step * surfBaseValue[jSurf - 1]; + state->dataOutRptTab->peopleRadSeq(coolDesSelected, step, iZone) = 0.4 * step; + state->dataOutRptTab->equipRadSeq(coolDesSelected, step, iZone) = 0.5 * step; + state->dataOutRptTab->hvacLossRadSeq(coolDesSelected, step, iZone) = 0.6 * step; + state->dataOutRptTab->powerGenRadSeq(coolDesSelected, step, iZone) = 0.7 * step; + state->dataOutRptTab->lightLWRadSeq(coolDesSelected, step, iZone) = 0.8 * step; } } From 7d741c00aea3315bb44d34b58868abc8c1fc58bc Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Sat, 19 Dec 2020 12:20:59 -0700 Subject: [PATCH 11/14] moving OutputReportTabular to state --- src/EnergyPlus/OutputReportTabular.cc | 1990 ++++++++--------- src/EnergyPlus/OutputReportTabular.hh | 82 +- src/EnergyPlus/SimulationManager.cc | 3 +- .../unit/OutputReportTabular.unit.cc | 34 +- 4 files changed, 1039 insertions(+), 1070 deletions(-) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 25ca321608b..eed029f79e6 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -170,72 +170,10 @@ namespace EnergyPlus::OutputReportTabular { using namespace DataHeatBalance; using namespace HybridModel; - // MODULE VARIABLE DECLARATIONS: - - // The Binned table type is different and only references one variable and its structure is very - // different from the others so it is has its own type. - - // arrays for time binned results - - int maxUniqueKeyCount(0); - - // for the XML report must keep track fo the active sub-table name and report set by other routines - std::string activeSubTableName; - std::string activeReportNameNoSpace; - std::string activeReportName; - std::string activeForName; - std::string prevReportName; - - // Object Data - Array1D OutputTableBinned; - Array2D BinResults; // table number, number of intervals - Array1D BinResultsBelow; // time below the lowest defined bin - Array1D BinResultsAbove; // time above the highest defined bin - Array1D BinObjVarID; - Array1D BinStatistics; - Array1D namedMonthly; // for predefined monthly report titles - Array1D MonthlyFieldSetInput; - Array1D MonthlyInput; - Array1D MonthlyTables; - Array1D MonthlyColumns; - Array1D TOCEntries; - Array1D UnitConv; - - namespace { - bool GatherMonthlyResultsForTimestepRunOnce(true); - bool UpdateTabularReportsGetInput(true); - bool GatherHeatGainReportfirstTime(true); - bool AllocateLoadComponentArraysDoAllocate(true); - bool initAdjFenDone(false); - int numPeopleAdaptive(0); - } // namespace - // Functions void clear_state(EnergyPlusData &state) { - GatherMonthlyResultsForTimestepRunOnce = true; - UpdateTabularReportsGetInput = true; - GatherHeatGainReportfirstTime = true; - AllocateLoadComponentArraysDoAllocate = true; - initAdjFenDone = false; - maxUniqueKeyCount = 0; - OutputTableBinned.deallocate(); - BinResults.deallocate(); - BinResultsBelow.deallocate(); - BinResultsAbove.deallocate(); - BinObjVarID.deallocate(); - BinStatistics.deallocate(); - namedMonthly.deallocate(); - MonthlyFieldSetInput.deallocate(); - MonthlyInput.deallocate(); - MonthlyTables.deallocate(); - MonthlyColumns.deallocate(); - TOCEntries.deallocate(); - UnitConv.deallocate(); - OutputReportTabular::ResetTabularReports(state); - - numPeopleAdaptive = 0; } std::ofstream & open_tbl_stream(EnergyPlusData &state, int const iStyle, std::string const & filename, bool output_to_file) @@ -270,7 +208,7 @@ namespace EnergyPlus::OutputReportTabular { ShowFatalError(state, "Invalid reporting requested -- UpdateTabularReports"); } - if (UpdateTabularReportsGetInput) { + if (state.dataOutRptTab->UpdateTabularReportsGetInput) { GetInputTabularMonthly(state); OutputReportTabularAnnual::GetInputTabularAnnual(state); OutputReportTabularAnnual::checkAggregationOrderForAnnual(state); @@ -285,7 +223,7 @@ namespace EnergyPlus::OutputReportTabular { GetInputFuelAndPollutionFactors(state); SetupUnitConversions(state); AddTOCLoadComponentTableSummaries(state); - UpdateTabularReportsGetInput = false; + state.dataOutRptTab->UpdateTabularReportsGetInput = false; date_and_time(_, _, _, state.dataOutRptTab->td); } if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { @@ -428,7 +366,7 @@ namespace EnergyPlus::OutputReportTabular { curAggType = iAggType::MinimumDuringHoursShown; } else { curAggType = iAggType::SumOrAvg; - ShowWarningError(state, CurrentModuleObject + '=' + MonthlyInput(TabNum).name + ", Variable name=" + AlphArray(jField)); + ShowWarningError(state, CurrentModuleObject + '=' + state.dataOutRptTab->MonthlyInput(TabNum).name + ", Variable name=" + AlphArray(jField)); ShowContinueError(state, "Invalid aggregation type=\"" + curAggString + "\" Defaulting to SumOrAverage."); } AddMonthlyFieldSetInput(state, curTable, AlphArray(jField), "", curAggType); @@ -472,20 +410,20 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int const SizeAdder(25); - if (!allocated(MonthlyInput)) { - MonthlyInput.allocate(SizeAdder); + if (!allocated(state.dataOutRptTab->MonthlyInput)) { + state.dataOutRptTab->MonthlyInput.allocate(SizeAdder); state.dataOutRptTab->sizeMonthlyInput = SizeAdder; state.dataOutRptTab->MonthlyInputCount = 1; } else { ++state.dataOutRptTab->MonthlyInputCount; // if larger than current size grow the array if (state.dataOutRptTab->MonthlyInputCount > state.dataOutRptTab->sizeMonthlyInput) { - MonthlyInput.redimension(state.dataOutRptTab->sizeMonthlyInput += SizeAdder); + state.dataOutRptTab->MonthlyInput.redimension(state.dataOutRptTab->sizeMonthlyInput += SizeAdder); } } // initialize new record - MonthlyInput(state.dataOutRptTab->MonthlyInputCount).name = inReportName; - MonthlyInput(state.dataOutRptTab->MonthlyInputCount).showDigits = inNumDigitsShown; + state.dataOutRptTab->MonthlyInput(state.dataOutRptTab->MonthlyInputCount).name = inReportName; + state.dataOutRptTab->MonthlyInput(state.dataOutRptTab->MonthlyInputCount).showDigits = inNumDigitsShown; return state.dataOutRptTab->MonthlyInputCount; } @@ -524,29 +462,29 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na - if (!allocated(MonthlyFieldSetInput)) { - MonthlyFieldSetInput.allocate(sizeIncrement); + if (!allocated(state.dataOutRptTab->MonthlyFieldSetInput)) { + state.dataOutRptTab->MonthlyFieldSetInput.allocate(sizeIncrement); state.dataOutRptTab->sizeMonthlyFieldSetInput = sizeIncrement; state.dataOutRptTab->MonthlyFieldSetInputCount = 1; } else { ++state.dataOutRptTab->MonthlyFieldSetInputCount; // if larger than current size grow the array if (state.dataOutRptTab->MonthlyFieldSetInputCount > state.dataOutRptTab->sizeMonthlyFieldSetInput) { - MonthlyFieldSetInput.redimension(state.dataOutRptTab->sizeMonthlyFieldSetInput *= + state.dataOutRptTab->MonthlyFieldSetInput.redimension(state.dataOutRptTab->sizeMonthlyFieldSetInput *= 2); // Tuned Changed += sizeIncrement to *= 2 for reduced heap allocations (at some space cost) } } // initialize new record) - MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).variMeter = inVariMeter; - MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).colHead = inColHead; - MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).aggregate = inAggregate; + state.dataOutRptTab->MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).variMeter = inVariMeter; + state.dataOutRptTab->MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).colHead = inColHead; + state.dataOutRptTab->MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).aggregate = inAggregate; // update the references from the MonthlyInput array if ((inMonthReport > 0) && (inMonthReport <= state.dataOutRptTab->MonthlyInputCount)) { - if (MonthlyInput(inMonthReport).firstFieldSet == 0) { - MonthlyInput(inMonthReport).firstFieldSet = state.dataOutRptTab->MonthlyFieldSetInputCount; - MonthlyInput(inMonthReport).numFieldSet = 1; + if (state.dataOutRptTab->MonthlyInput(inMonthReport).firstFieldSet == 0) { + state.dataOutRptTab->MonthlyInput(inMonthReport).firstFieldSet = state.dataOutRptTab->MonthlyFieldSetInputCount; + state.dataOutRptTab->MonthlyInput(inMonthReport).numFieldSet = 1; } else { - ++MonthlyInput(inMonthReport).numFieldSet; + ++state.dataOutRptTab->MonthlyInput(inMonthReport).numFieldSet; } } } @@ -624,8 +562,8 @@ namespace EnergyPlus::OutputReportTabular { // if not a running a weather simulation do not create reports if (!state.dataGlobal->DoWeathSim) return; - maxUniqueKeyCount = 1500; - UniqueKeyNames.allocate(maxUniqueKeyCount); + state.dataOutRptTab->maxUniqueKeyCount = 1500; + UniqueKeyNames.allocate(state.dataOutRptTab->maxUniqueKeyCount); // First pass through the input objects is to put the name of the report // into the array and count the number of unique keys found to allocate // the monthlyTables and monthlyColumns @@ -646,8 +584,8 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptTab->MonthlyTablesCount = 0; for (TabNum = 1; TabNum <= state.dataOutRptTab->MonthlyInputCount; ++TabNum) { // the number of columns based on number of alpha fields - NumColumns = MonthlyInput(TabNum).numFieldSet; - FirstColumn = MonthlyInput(TabNum).firstFieldSet; + NumColumns = state.dataOutRptTab->MonthlyInput(TabNum).numFieldSet; + FirstColumn = state.dataOutRptTab->MonthlyInput(TabNum).firstFieldSet; environmentKeyFound = false; UniqueKeyCount = 0; for (colNum = 1; colNum <= NumColumns; ++colNum) { @@ -655,11 +593,11 @@ namespace EnergyPlus::OutputReportTabular { //#ifdef ITM_KEYCACHE // Noel comment: First time in this TabNum/ColNum loop, let's save the results // of GetVariableKeyCountandType & GetVariableKeys. - curVariMeter = UtilityRoutines::MakeUPPERCase(MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeter); + curVariMeter = UtilityRoutines::MakeUPPERCase(state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeter); // call the key count function but only need count during this pass GetVariableKeyCountandType(state, curVariMeter, KeyCount, TypeVar, AvgSumVar, StepTypeVar, UnitsVar); if (TypeVar == OutputProcessor::VarType_NotFound) { - ShowWarningError(state, "In Output:Table:Monthly '" + MonthlyInput(TabNum).name + "' invalid Variable or Meter Name '" + curVariMeter + "'"); + ShowWarningError(state, "In Output:Table:Monthly '" + state.dataOutRptTab->MonthlyInput(TabNum).name + "' invalid Variable or Meter Name '" + curVariMeter + "'"); } // IF (KeyCount > maxKeyCount) THEN // DEALLOCATE(NamesOfKeys) @@ -668,22 +606,22 @@ namespace EnergyPlus::OutputReportTabular { // ALLOCATE(NamesOfKeys(maxKeyCount)) // ALLOCATE(IndexesForKeyVar(maxKeyCount)) // ENDIF - MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys.allocate(KeyCount); - MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar.allocate(KeyCount); + state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys.allocate(KeyCount); + state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar.allocate(KeyCount); // fill keys? GetVariableKeys(state, curVariMeter, TypeVar, - MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys, - MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar); + state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys, + state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar); // save these values to use later -- noel - MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper = curVariMeter; - MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar = TypeVar; - MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount = KeyCount; - MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum = AvgSumVar; - MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType = StepTypeVar; - MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits = UnitsVar; + state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper = curVariMeter; + state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar = TypeVar; + state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount = KeyCount; + state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum = AvgSumVar; + state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType = StepTypeVar; + state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits = UnitsVar; // DO iKey = 1, KeyCount // MonthlyFieldSetInput(FirstColumn + ColNum - 1)%NamesOfKeys(iKey) = NamesOfKeys(iKey) !noel // MonthlyFieldSetInput(FirstColumn + ColNum - 1)%IndexesForKeyVar(iKey) = IndexesForKeyVar(iKey) !noel @@ -700,22 +638,22 @@ namespace EnergyPlus::OutputReportTabular { for (iKey = 1; iKey <= KeyCount; ++iKey) { found = 0; // set a flag if environment variables are found - if (UtilityRoutines::SameString(MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { + if (UtilityRoutines::SameString(state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { environmentKeyFound = true; found = -1; // so not counted in list of unique keys } for (jUnique = 1; jUnique <= UniqueKeyCount; ++jUnique) { - if (UtilityRoutines::SameString(UniqueKeyNames(jUnique), MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { + if (UtilityRoutines::SameString(UniqueKeyNames(jUnique), state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { found = jUnique; break; } } if (found == 0) { ++UniqueKeyCount; - if (UniqueKeyCount > maxUniqueKeyCount) { - UniqueKeyNames.redimension(maxUniqueKeyCount += 500); + if (UniqueKeyCount > state.dataOutRptTab->maxUniqueKeyCount) { + UniqueKeyNames.redimension(state.dataOutRptTab->maxUniqueKeyCount += 500); } - UniqueKeyNames(UniqueKeyCount) = MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey); + UniqueKeyNames(UniqueKeyCount) = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey); } } //#ifdef ITM_KEYCACHE @@ -736,16 +674,16 @@ namespace EnergyPlus::OutputReportTabular { // Now that we have the maximum size of the number of tables (each table is // repeated for the number of keys found) and the number of total columns // of all of the tables, allocate the arrays to store this information. - MonthlyTables.allocate(state.dataOutRptTab->MonthlyTablesCount); - MonthlyColumns.allocate(state.dataOutRptTab->MonthlyColumnsCount); + state.dataOutRptTab->MonthlyTables.allocate(state.dataOutRptTab->MonthlyTablesCount); + state.dataOutRptTab->MonthlyColumns.allocate(state.dataOutRptTab->MonthlyColumnsCount); // Initialize tables and results - for (auto &e : MonthlyTables) { + for (auto &e : state.dataOutRptTab->MonthlyTables) { e.keyValue.clear(); e.firstColumn = 0; e.numColumns = 0; } - for (auto &e : MonthlyColumns) { + for (auto &e : state.dataOutRptTab->MonthlyColumns) { e.varName.clear(); e.varNum = 0; e.typeOfVar = 0; @@ -755,28 +693,28 @@ namespace EnergyPlus::OutputReportTabular { e.aggType = iAggType::Unassigned; } for (colNum = 1; colNum <= state.dataOutRptTab->MonthlyColumnsCount; ++colNum) { - MonthlyColumns(colNum).reslt = 0.0; - MonthlyColumns(colNum).timeStamp = 0; - MonthlyColumns(colNum).duration = 0.0; + state.dataOutRptTab->MonthlyColumns(colNum).reslt = 0.0; + state.dataOutRptTab->MonthlyColumns(colNum).timeStamp = 0; + state.dataOutRptTab->MonthlyColumns(colNum).duration = 0.0; } ColumnsRecount = 0; TablesRecount = 0; for (TabNum = 1; TabNum <= state.dataOutRptTab->MonthlyInputCount; ++TabNum) { // the number of columns based on number of alpha fields - NumColumns = MonthlyInput(TabNum).numFieldSet; - FirstColumn = MonthlyInput(TabNum).firstFieldSet; + NumColumns = state.dataOutRptTab->MonthlyInput(TabNum).numFieldSet; + FirstColumn = state.dataOutRptTab->MonthlyInput(TabNum).firstFieldSet; UniqueKeyCount = 0; environmentKeyFound = false; for (colNum = 1; colNum <= NumColumns; ++colNum) { //#ifdef ITM_KEYCACHE // Noel comment: Here is where we could use the saved values - curVariMeter = MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper; - KeyCount = MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount; - TypeVar = MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar; - AvgSumVar = MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum; - StepTypeVar = MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType; - UnitsVar = MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits; + curVariMeter = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper; + KeyCount = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount; + TypeVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar; + AvgSumVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum; + StepTypeVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType; + UnitsVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits; // DO iKey = 1, KeyCount !noel // NamesOfKeys(iKey) = MonthlyFieldSetInput(FirstColumn + ColNum - 1)%NamesOfKeys(iKey) !noel // IndexesForKeyVar(iKey) = MonthlyFieldSetInput(FirstColumn + ColNum - 1)%IndexesForKeyVar(iKey) !noel @@ -798,7 +736,7 @@ namespace EnergyPlus::OutputReportTabular { } // fixing CR5878 removed the showing of the warning once about a specific variable. if (state.dataGlobal->DisplayExtraWarnings && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { - ShowWarningError(state, "Processing Monthly Tabular Reports: " + MonthlyInput(TabNum).name); + ShowWarningError(state, "Processing Monthly Tabular Reports: " + state.dataOutRptTab->MonthlyInput(TabNum).name); ShowContinueError(state, "..Variable name=" + curVariMeter + " not valid for this simulation."); if (VarWarning) { ShowContinueError(state, "..Variables not valid for this simulation will have \"[Invalid/Undefined]\" in the Units Column of " @@ -810,19 +748,19 @@ namespace EnergyPlus::OutputReportTabular { for (iKey = 1; iKey <= KeyCount; ++iKey) { found = 0; // set a flag if environment variables are found - if (UtilityRoutines::SameString(MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { + if (UtilityRoutines::SameString(state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { environmentKeyFound = true; found = -1; // so not counted in list of unique keys } for (jUnique = 1; jUnique <= UniqueKeyCount; ++jUnique) { - if (UtilityRoutines::SameString(UniqueKeyNames(jUnique), MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { + if (UtilityRoutines::SameString(UniqueKeyNames(jUnique), state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { found = jUnique; break; } } if (found == 0) { ++UniqueKeyCount; - UniqueKeyNames(UniqueKeyCount) = MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey); + UniqueKeyNames(UniqueKeyCount) = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey); } } //#ifdef ITM_KEYCACHE @@ -837,40 +775,40 @@ namespace EnergyPlus::OutputReportTabular { UniqueKeyCount = 1; } // increment the number of tables based on the number of unique keys - MonthlyInput(TabNum).firstTable = TablesRecount + 1; - MonthlyInput(TabNum).numTables = UniqueKeyCount; + state.dataOutRptTab->MonthlyInput(TabNum).firstTable = TablesRecount + 1; + state.dataOutRptTab->MonthlyInput(TabNum).numTables = UniqueKeyCount; TablesRecount += UniqueKeyCount; // loop through the different unique keys since each user defined table // has that many instances - one for each unique key. // It is unusual that this loop is about 'keys' and an inner loop is also // about 'keys' but for this loop the keys are really instances of tables. for (kUniqueKey = 1; kUniqueKey <= UniqueKeyCount; ++kUniqueKey) { - lTable = kUniqueKey + MonthlyInput(TabNum).firstTable - 1; + lTable = kUniqueKey + state.dataOutRptTab->MonthlyInput(TabNum).firstTable - 1; // use the term 'environment' for identifying the report if if (environmentKeyFound && UniqueKeyCount == 1) { - MonthlyTables(lTable).keyValue = "Environment"; + state.dataOutRptTab->MonthlyTables(lTable).keyValue = "Environment"; } else { // this is the most common case is to use the unique key for the report - MonthlyTables(lTable).keyValue = UniqueKeyNames(kUniqueKey); + state.dataOutRptTab->MonthlyTables(lTable).keyValue = UniqueKeyNames(kUniqueKey); } - MonthlyTables(lTable).firstColumn = ColumnsRecount + 1; - MonthlyTables(lTable).numColumns = NumColumns; + state.dataOutRptTab->MonthlyTables(lTable).firstColumn = ColumnsRecount + 1; + state.dataOutRptTab->MonthlyTables(lTable).numColumns = NumColumns; ColumnsRecount += NumColumns; - FirstColumn = MonthlyInput(TabNum).firstFieldSet; + FirstColumn = state.dataOutRptTab->MonthlyInput(TabNum).firstFieldSet; for (colNum = 1; colNum <= NumColumns; ++colNum) { environmentKeyFound = false; - mColumn = colNum + MonthlyTables(lTable).firstColumn - 1; + mColumn = colNum + state.dataOutRptTab->MonthlyTables(lTable).firstColumn - 1; // when going through the columns this time, not all columns may have // a EP variable that corresponds to it. In no variable is found // then set it to 0 to be skipped during data gathering //#ifdef ITM_KEYCACHE // Noel comment: Here is where we could use the saved values - curVariMeter = MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper; - KeyCount = MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount; - TypeVar = MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar; - AvgSumVar = MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum; - StepTypeVar = MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType; - UnitsVar = MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits; + curVariMeter = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper; + KeyCount = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount; + TypeVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar; + AvgSumVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum; + StepTypeVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType; + UnitsVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits; // DO iKey = 1, KeyCount !noel // NamesOfKeys(iKey) = MonthlyFieldSetInput(FirstColumn + ColNum - 1)%NamesOfKeys(iKey) !noel // IndexesForKeyVar(iKey) = MonthlyFieldSetInput(FirstColumn + ColNum - 1)%IndexesForKeyVar(iKey) !noel @@ -885,7 +823,7 @@ namespace EnergyPlus::OutputReportTabular { //#endif if (KeyCount == 1) { // first test if KeyCount is one to avoid referencing a zero element array - if (UtilityRoutines::SameString(MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(1), "ENVIRONMENT")) { + if (UtilityRoutines::SameString(state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(1), "ENVIRONMENT")) { environmentKeyFound = true; } } @@ -896,7 +834,7 @@ namespace EnergyPlus::OutputReportTabular { // search through the keys for the currently active key "UniqueKeyNames(kUniqueKey)" found = 0; for (iKey = 1; iKey <= KeyCount; ++iKey) { - if (UtilityRoutines::SameString(MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), + if (UtilityRoutines::SameString(state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), UniqueKeyNames(kUniqueKey))) { found = iKey; break; @@ -904,54 +842,54 @@ namespace EnergyPlus::OutputReportTabular { } } if ((found > 0) && (KeyCount >= 1)) { - MonthlyColumns(mColumn).varName = curVariMeter; - MonthlyColumns(mColumn).varNum = MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar(found); - MonthlyColumns(mColumn).typeOfVar = TypeVar; - MonthlyColumns(mColumn).avgSum = AvgSumVar; - MonthlyColumns(mColumn).stepType = StepTypeVar; - MonthlyColumns(mColumn).units = UnitsVar; - MonthlyColumns(mColumn).aggType = MonthlyFieldSetInput(FirstColumn + colNum - 1).aggregate; + state.dataOutRptTab->MonthlyColumns(mColumn).varName = curVariMeter; + state.dataOutRptTab->MonthlyColumns(mColumn).varNum = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar(found); + state.dataOutRptTab->MonthlyColumns(mColumn).typeOfVar = TypeVar; + state.dataOutRptTab->MonthlyColumns(mColumn).avgSum = AvgSumVar; + state.dataOutRptTab->MonthlyColumns(mColumn).stepType = StepTypeVar; + state.dataOutRptTab->MonthlyColumns(mColumn).units = UnitsVar; + state.dataOutRptTab->MonthlyColumns(mColumn).aggType = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).aggregate; // set accumulator values to default as appropriate for aggregation type { - auto const SELECT_CASE_var(MonthlyColumns(mColumn).aggType); + auto const SELECT_CASE_var(state.dataOutRptTab->MonthlyColumns(mColumn).aggType); if (SELECT_CASE_var == iAggType::SumOrAvg) { - MonthlyColumns(mColumn).reslt = 0.0; - MonthlyColumns(mColumn).duration = 0.0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; + state.dataOutRptTab->MonthlyColumns(mColumn).duration = 0.0; } else if (SELECT_CASE_var == iAggType::Maximum) { - MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); - MonthlyColumns(mColumn).timeStamp = 0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); + state.dataOutRptTab->MonthlyColumns(mColumn).timeStamp = 0; } else if (SELECT_CASE_var == iAggType::Minimum) { - MonthlyColumns(mColumn).reslt = HUGE_(BigNum); - MonthlyColumns(mColumn).timeStamp = 0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = HUGE_(BigNum); + state.dataOutRptTab->MonthlyColumns(mColumn).timeStamp = 0; } else if (SELECT_CASE_var == iAggType::ValueWhenMaxMin) { - MonthlyColumns(mColumn).reslt = 0.0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursZero) { - MonthlyColumns(mColumn).reslt = 0.0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursNonZero) { - MonthlyColumns(mColumn).reslt = 0.0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursPositive) { - MonthlyColumns(mColumn).reslt = 0.0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursNonPositive) { - MonthlyColumns(mColumn).reslt = 0.0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursNegative) { - MonthlyColumns(mColumn).reslt = 0.0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursNonNegative) { - MonthlyColumns(mColumn).reslt = 0.0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::SumOrAverageHoursShown) { - MonthlyColumns(mColumn).reslt = 0.0; - MonthlyColumns(mColumn).duration = 0.0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; + state.dataOutRptTab->MonthlyColumns(mColumn).duration = 0.0; } else if (SELECT_CASE_var == iAggType::MaximumDuringHoursShown) { - MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); - MonthlyColumns(mColumn).timeStamp = 0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); + state.dataOutRptTab->MonthlyColumns(mColumn).timeStamp = 0; } else if (SELECT_CASE_var == iAggType::MinimumDuringHoursShown) { - MonthlyColumns(mColumn).reslt = HUGE_(BigNum); - MonthlyColumns(mColumn).timeStamp = 0; + state.dataOutRptTab->MonthlyColumns(mColumn).reslt = HUGE_(BigNum); + state.dataOutRptTab->MonthlyColumns(mColumn).timeStamp = 0; } } } else { // if no key corresponds to this instance of the report // fixing CR5878 removed the showing of the warning once about a specific variable. if (state.dataGlobal->DisplayExtraWarnings && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { - ShowWarningError(state, "Processing Monthly Tabular Reports: " + MonthlyInput(TabNum).name); + ShowWarningError(state, "Processing Monthly Tabular Reports: " + state.dataOutRptTab->MonthlyInput(TabNum).name); ShowContinueError(state, "..Variable name=" + curVariMeter + " not valid for this simulation."); ShowContinueError(state, "..i.e., Variable name=" + UniqueKeyNames(kUniqueKey) + ':' + curVariMeter + " not valid for this simulation."); @@ -961,13 +899,13 @@ namespace EnergyPlus::OutputReportTabular { VarWarning = false; } } - MonthlyColumns(mColumn).varName = curVariMeter; - MonthlyColumns(mColumn).varNum = 0; - MonthlyColumns(mColumn).typeOfVar = 0; - MonthlyColumns(mColumn).avgSum = OutputProcessor::StoreType::Averaged; - MonthlyColumns(mColumn).stepType = OutputProcessor::TimeStepType::TimeStepZone; - MonthlyColumns(mColumn).units = OutputProcessor::Unit::None; - MonthlyColumns(mColumn).aggType = iAggType::SumOrAvg; + state.dataOutRptTab->MonthlyColumns(mColumn).varName = curVariMeter; + state.dataOutRptTab->MonthlyColumns(mColumn).varNum = 0; + state.dataOutRptTab->MonthlyColumns(mColumn).typeOfVar = 0; + state.dataOutRptTab->MonthlyColumns(mColumn).avgSum = OutputProcessor::StoreType::Averaged; + state.dataOutRptTab->MonthlyColumns(mColumn).stepType = OutputProcessor::TimeStepType::TimeStepZone; + state.dataOutRptTab->MonthlyColumns(mColumn).units = OutputProcessor::Unit::None; + state.dataOutRptTab->MonthlyColumns(mColumn).aggType = iAggType::SumOrAvg; } //#ifdef ITM_KEYCACHE //#else @@ -995,13 +933,13 @@ namespace EnergyPlus::OutputReportTabular { bool foundHourAgg = false; bool missingMaxOrMinError = false; bool missingHourAggError = false; - for (int jTable = 1; jTable <= MonthlyInput(iInput).numTables; ++jTable) { - int curTable = jTable + MonthlyInput(iInput).firstTable - 1; + for (int jTable = 1; jTable <= state.dataOutRptTab->MonthlyInput(iInput).numTables; ++jTable) { + int curTable = jTable + state.dataOutRptTab->MonthlyInput(iInput).firstTable - 1; // test if the aggregation types are in the correct order - for (int kColumn = 1; kColumn <= MonthlyTables(curTable).numColumns; ++kColumn) { - int curCol = kColumn + MonthlyTables(curTable).firstColumn - 1; - if (MonthlyColumns(curCol).varNum == 0) break; // if no variable was ever found than stop checking - iAggType curAggType = MonthlyColumns(curCol).aggType; + for (int kColumn = 1; kColumn <= state.dataOutRptTab->MonthlyTables(curTable).numColumns; ++kColumn) { + int curCol = kColumn + state.dataOutRptTab->MonthlyTables(curTable).firstColumn - 1; + if (state.dataOutRptTab->MonthlyColumns(curCol).varNum == 0) break; // if no variable was ever found than stop checking + iAggType curAggType = state.dataOutRptTab->MonthlyColumns(curCol).aggType; if ((curAggType == iAggType::Maximum) || (curAggType == iAggType::Minimum)) { foundMinOrMax = true; } else if ((curAggType == iAggType::HoursNonZero) || (curAggType == iAggType::HoursZero) || (curAggType == iAggType::HoursPositive) || @@ -1021,13 +959,13 @@ namespace EnergyPlus::OutputReportTabular { } } if (missingMaxOrMinError) { - ShowSevereError(state, "The Output:Table:Monthly report named=\"" + MonthlyInput(iInput).name + + ShowSevereError(state, "The Output:Table:Monthly report named=\"" + state.dataOutRptTab->MonthlyInput(iInput).name + "\" has a valueWhenMaxMin aggregation type for a column without a previous column that uses either the minimum or " "maximum aggregation types. The report will not be generated."); foundError = true; } if (missingHourAggError) { - ShowSevereError(state, "The Output:Table:Monthly report named=\"" + MonthlyInput(iInput).name + + ShowSevereError(state, "The Output:Table:Monthly report named=\"" + state.dataOutRptTab->MonthlyInput(iInput).name + "\" has a --DuringHoursShown aggregation type for a column without a previous field that uses one of the Hour-- " "aggregation types. The report will not be generated."); foundError = true; @@ -1098,10 +1036,10 @@ namespace EnergyPlus::OutputReportTabular { AlphArray.allocate(NumAlphas); NumArray.dimension(NumNums, 0.0); - state.dataOutRptTab->timeInYear = 0.0; // intialize the time in year counter + state.dataOutRptTab->timeInYear = 0.0; // initialize the time in year counter // determine size of array that holds the IDF description state.dataOutRptTab->OutputTableBinnedCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - OutputTableBinned.allocate(state.dataOutRptTab->OutputTableBinnedCount); + state.dataOutRptTab->OutputTableBinned.allocate(state.dataOutRptTab->OutputTableBinnedCount); if (state.dataOutRptTab->OutputTableBinnedCount > 0) { state.dataOutRptTab->WriteTabularFiles = true; // if not a run period using weather do not create reports @@ -1127,17 +1065,17 @@ namespace EnergyPlus::OutputReportTabular { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - OutputTableBinned(iInObj).keyValue = AlphArray(1); - OutputTableBinned(iInObj).varOrMeter = AlphArray(2); + state.dataOutRptTab->OutputTableBinned(iInObj).keyValue = AlphArray(1); + state.dataOutRptTab->OutputTableBinned(iInObj).varOrMeter = AlphArray(2); // if a schedule has been specified assign if (len(AlphArray(3)) > 0) { - OutputTableBinned(iInObj).ScheduleName = AlphArray(3); - OutputTableBinned(iInObj).scheduleIndex = GetScheduleIndex(state, AlphArray(3)); - if (OutputTableBinned(iInObj).scheduleIndex == 0) { + state.dataOutRptTab->OutputTableBinned(iInObj).ScheduleName = AlphArray(3); + state.dataOutRptTab->OutputTableBinned(iInObj).scheduleIndex = GetScheduleIndex(state, AlphArray(3)); + if (state.dataOutRptTab->OutputTableBinned(iInObj).scheduleIndex == 0) { ShowWarningError(state, CurrentModuleObject + ": invalid " + cAlphaFieldNames(3) + "=\"" + AlphArray(3) + "\" - not found."); } } else { - OutputTableBinned(iInObj).scheduleIndex = 0; // flag value for no schedule used + state.dataOutRptTab->OutputTableBinned(iInObj).scheduleIndex = 0; // flag value for no schedule used } // validate the kind of variable - not used internally except for validation if (len(AlphArray(4)) > 0) { @@ -1147,61 +1085,61 @@ namespace EnergyPlus::OutputReportTabular { " the Variable Type was not energy, demand, temperature, or flowrate."); } } - OutputTableBinned(iInObj).intervalStart = NumArray(1); - OutputTableBinned(iInObj).intervalSize = NumArray(2); - OutputTableBinned(iInObj).intervalCount = int(NumArray(3)); + state.dataOutRptTab->OutputTableBinned(iInObj).intervalStart = NumArray(1); + state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize = NumArray(2); + state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount = int(NumArray(3)); // valid range checking on inputs - if (OutputTableBinned(iInObj).intervalCount < 1) { - OutputTableBinned(iInObj).intervalCount = 1; + if (state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount < 1) { + state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount = 1; } - if (OutputTableBinned(iInObj).intervalCount > 20) { - OutputTableBinned(iInObj).intervalCount = 20; + if (state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount > 20) { + state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount = 20; } - if (OutputTableBinned(iInObj).intervalSize < 0) { - OutputTableBinned(iInObj).intervalSize = 1000.0; + if (state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize < 0) { + state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize = 1000.0; } - OutputTableBinned(iInObj).resIndex = state.dataOutRptTab->BinResultsTableCount + 1; // the next results report + state.dataOutRptTab->OutputTableBinned(iInObj).resIndex = state.dataOutRptTab->BinResultsTableCount + 1; // the next results report // find maximum number of intervals - if (OutputTableBinned(iInObj).intervalCount > state.dataOutRptTab->BinResultsIntervalCount) { - state.dataOutRptTab->BinResultsIntervalCount = OutputTableBinned(iInObj).intervalCount; - } - GetVariableKeyCountandType(state, OutputTableBinned(iInObj).varOrMeter, - OutputTableBinned(iInObj).numTables, - OutputTableBinned(iInObj).typeOfVar, - OutputTableBinned(iInObj).avgSum, - OutputTableBinned(iInObj).stepType, - OutputTableBinned(iInObj).units); - if (OutputTableBinned(iInObj).typeOfVar == 0) { - ShowWarningError(state, CurrentModuleObject + ": User specified meter or variable not found: " + OutputTableBinned(iInObj).varOrMeter); + if (state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount > state.dataOutRptTab->BinResultsIntervalCount) { + state.dataOutRptTab->BinResultsIntervalCount = state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount; + } + GetVariableKeyCountandType(state, state.dataOutRptTab->OutputTableBinned(iInObj).varOrMeter, + state.dataOutRptTab->OutputTableBinned(iInObj).numTables, + state.dataOutRptTab->OutputTableBinned(iInObj).typeOfVar, + state.dataOutRptTab->OutputTableBinned(iInObj).avgSum, + state.dataOutRptTab->OutputTableBinned(iInObj).stepType, + state.dataOutRptTab->OutputTableBinned(iInObj).units); + if (state.dataOutRptTab->OutputTableBinned(iInObj).typeOfVar == 0) { + ShowWarningError(state, CurrentModuleObject + ": User specified meter or variable not found: " + state.dataOutRptTab->OutputTableBinned(iInObj).varOrMeter); } // If only a single table key is requested than only one should be counted // later will reset the numTables array pointer but for now use it to know // how many items to scan through - if (OutputTableBinned(iInObj).keyValue == "*") { - state.dataOutRptTab->BinResultsTableCount += OutputTableBinned(iInObj).numTables; + if (state.dataOutRptTab->OutputTableBinned(iInObj).keyValue == "*") { + state.dataOutRptTab->BinResultsTableCount += state.dataOutRptTab->OutputTableBinned(iInObj).numTables; } else { ++state.dataOutRptTab->BinResultsTableCount; // if a particular key is requested then only one more report } } // size the arrays that holds the bin results - BinResults.allocate(state.dataOutRptTab->BinResultsIntervalCount, state.dataOutRptTab->BinResultsTableCount); - BinResultsBelow.allocate(state.dataOutRptTab->BinResultsTableCount); - BinResultsAbove.allocate(state.dataOutRptTab->BinResultsTableCount); - BinStatistics.allocate(state.dataOutRptTab->BinResultsTableCount); - BinObjVarID.allocate(state.dataOutRptTab->BinResultsTableCount); + state.dataOutRptTab->BinResults.allocate(state.dataOutRptTab->BinResultsIntervalCount, state.dataOutRptTab->BinResultsTableCount); + state.dataOutRptTab->BinResultsBelow.allocate(state.dataOutRptTab->BinResultsTableCount); + state.dataOutRptTab->BinResultsAbove.allocate(state.dataOutRptTab->BinResultsTableCount); + state.dataOutRptTab->BinStatistics.allocate(state.dataOutRptTab->BinResultsTableCount); + state.dataOutRptTab->BinObjVarID.allocate(state.dataOutRptTab->BinResultsTableCount); // now that the arrays are sized go back and fill in // what ID numbers are used for each table for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { - firstReport = OutputTableBinned(iInObj).resIndex; + firstReport = state.dataOutRptTab->OutputTableBinned(iInObj).resIndex; // allocate the arrays to the number of objects - objNames.allocate(OutputTableBinned(iInObj).numTables); - objVarIDs.allocate(OutputTableBinned(iInObj).numTables); - GetVariableKeys(state, OutputTableBinned(iInObj).varOrMeter, OutputTableBinned(iInObj).typeOfVar, objNames, objVarIDs); - if (OutputTableBinned(iInObj).keyValue == "*") { - for (iTable = 1; iTable <= OutputTableBinned(iInObj).numTables; ++iTable) { + objNames.allocate(state.dataOutRptTab->OutputTableBinned(iInObj).numTables); + objVarIDs.allocate(state.dataOutRptTab->OutputTableBinned(iInObj).numTables); + GetVariableKeys(state, state.dataOutRptTab->OutputTableBinned(iInObj).varOrMeter, state.dataOutRptTab->OutputTableBinned(iInObj).typeOfVar, objNames, objVarIDs); + if (state.dataOutRptTab->OutputTableBinned(iInObj).keyValue == "*") { + for (iTable = 1; iTable <= state.dataOutRptTab->OutputTableBinned(iInObj).numTables; ++iTable) { repIndex = firstReport + (iTable - 1); - BinObjVarID(repIndex).namesOfObj = objNames(iTable); - BinObjVarID(repIndex).varMeterNum = objVarIDs(iTable); + state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj = objNames(iTable); + state.dataOutRptTab->BinObjVarID(repIndex).varMeterNum = objVarIDs(iTable); // check if valid meter or number if (objVarIDs(iTable) == 0) { ShowWarningError(state, CurrentModuleObject + ": Specified variable or meter not found: " + objNames(iTable)); @@ -1210,37 +1148,37 @@ namespace EnergyPlus::OutputReportTabular { } else { // scan through the keys and look for the user specified key found = 0; - for (iTable = 1; iTable <= OutputTableBinned(iInObj).numTables; ++iTable) { - if (UtilityRoutines::SameString(objNames(iTable), OutputTableBinned(iInObj).keyValue)) { + for (iTable = 1; iTable <= state.dataOutRptTab->OutputTableBinned(iInObj).numTables; ++iTable) { + if (UtilityRoutines::SameString(objNames(iTable), state.dataOutRptTab->OutputTableBinned(iInObj).keyValue)) { found = iTable; break; } } // the first and only report is assigned to the found object name if (!warningAboutKeyNotFound(state, found, iInObj, CurrentModuleObject)) { - BinObjVarID(firstReport).namesOfObj = objNames(found); - BinObjVarID(firstReport).varMeterNum = objVarIDs(found); + state.dataOutRptTab->BinObjVarID(firstReport).namesOfObj = objNames(found); + state.dataOutRptTab->BinObjVarID(firstReport).varMeterNum = objVarIDs(found); } // reset the number of tables to one - OutputTableBinned(iInObj).numTables = 1; + state.dataOutRptTab->OutputTableBinned(iInObj).numTables = 1; } } // clear the binning arrays to zeros - for (auto &e : BinResults) { + for (auto &e : state.dataOutRptTab->BinResults) { e.mnth = 0.0; e.hrly = 0.0; } - for (auto &e : BinResultsBelow) { + for (auto &e : state.dataOutRptTab->BinResultsBelow) { e.mnth = 0.0; e.hrly = 0.0; } - for (auto &e : BinResultsAbove) { + for (auto &e : state.dataOutRptTab->BinResultsAbove) { e.mnth = 0.0; e.hrly = 0.0; } // initialize statistics counters - for (auto &e : BinStatistics) { + for (auto &e : state.dataOutRptTab->BinStatistics) { e.minimum = HUGE_(bigVal); e.maximum = -HUGE_(bigVal); e.n = 0; @@ -1252,8 +1190,8 @@ namespace EnergyPlus::OutputReportTabular { bool warningAboutKeyNotFound(EnergyPlusData &state, int foundIndex, int inObjIndex, std::string const &moduleName) { if (foundIndex == 0) { - ShowWarningError(state, moduleName + ": Specified key not found: " + OutputTableBinned(inObjIndex).keyValue + - " for variable: " + OutputTableBinned(inObjIndex).varOrMeter); + ShowWarningError(state, moduleName + ": Specified key not found: " + state.dataOutRptTab->OutputTableBinned(inObjIndex).keyValue + + " for variable: " + state.dataOutRptTab->OutputTableBinned(inObjIndex).varOrMeter); return true; } else { return false; @@ -1659,7 +1597,7 @@ namespace EnergyPlus::OutputReportTabular { } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllMonthly")) { state.dataOutRptTab->WriteTabularFiles = true; for (jReport = 1; jReport <= numNamedMonthly; ++jReport) { - namedMonthly(jReport).show = true; + state.dataOutRptTab->namedMonthly(jReport).show = true; } nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryAndMonthly")) { @@ -1686,7 +1624,7 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptPredefined->reportName(jReport).show = true; } for (jReport = 1; jReport <= numNamedMonthly; ++jReport) { - namedMonthly(jReport).show = true; + state.dataOutRptTab->namedMonthly(jReport).show = true; } } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryMonthlyAndSizingPeriod")) { state.dataOutRptTab->WriteTabularFiles = true; @@ -1712,7 +1650,7 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptPredefined->reportName(jReport).show = true; } for (jReport = 1; jReport <= numNamedMonthly; ++jReport) { - namedMonthly(jReport).show = true; + state.dataOutRptTab->namedMonthly(jReport).show = true; } // the sizing period reports state.dataOutRptTab->displayZoneComponentLoadSummary = true; @@ -1734,8 +1672,8 @@ namespace EnergyPlus::OutputReportTabular { } // check if the predefined monthly reports are used for (jReport = 1; jReport <= numNamedMonthly; ++jReport) { - if (UtilityRoutines::SameString(AlphArray(iReport), namedMonthly(jReport).title)) { - namedMonthly(jReport).show = true; + if (UtilityRoutines::SameString(AlphArray(iReport), state.dataOutRptTab->namedMonthly(jReport).title)) { + state.dataOutRptTab->namedMonthly(jReport).show = true; state.dataOutRptTab->WriteTabularFiles = true; nameFound = true; } @@ -2029,70 +1967,70 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int xcount; - namedMonthly.allocate(numNamedMonthly); - namedMonthly(1).title = "ZoneCoolingSummaryMonthly"; - namedMonthly(2).title = "ZoneHeatingSummaryMonthly"; - namedMonthly(3).title = "ZoneElectricSummaryMonthly"; - namedMonthly(4).title = "SpaceGainsMonthly"; - namedMonthly(5).title = "PeakSpaceGainsMonthly"; - namedMonthly(6).title = "SpaceGainComponentsAtCoolingPeakMonthly"; - namedMonthly(7).title = "EnergyConsumptionElectricityNaturalGasMonthly"; - namedMonthly(8).title = "EnergyConsumptionElectricityGeneratedPropaneMonthly"; - namedMonthly(9).title = "EnergyConsumptionDieselFuelOilMonthly"; - namedMonthly(10).title = "EnergyConsumptionDistrictHeatingCoolingMonthly"; - namedMonthly(11).title = "EnergyConsumptionCoalGasolineMonthly"; - namedMonthly(12).title = "EnergyConsumptionOtherFuelsMonthly"; - namedMonthly(13).title = "EndUseEnergyConsumptionElectricityMonthly"; - namedMonthly(14).title = "EndUseEnergyConsumptionNaturalGasMonthly"; - namedMonthly(15).title = "EndUseEnergyConsumptionDieselMonthly"; - namedMonthly(16).title = "EndUseEnergyConsumptionFuelOilMonthly"; - namedMonthly(17).title = "EndUseEnergyConsumptionCoalMonthly"; - namedMonthly(18).title = "EndUseEnergyConsumptionPropaneMonthly"; - namedMonthly(19).title = "EndUseEnergyConsumptionGasolineMonthly"; - namedMonthly(20).title = "EndUseEnergyConsumptionOtherFuelsMonthly"; - namedMonthly(21).title = "PeakEnergyEndUseElectricityPart1Monthly"; - namedMonthly(22).title = "PeakEnergyEndUseElectricityPart2Monthly"; - namedMonthly(23).title = "ElectricComponentsOfPeakDemandMonthly"; - namedMonthly(24).title = "PeakEnergyEndUseNaturalGasMonthly"; - namedMonthly(25).title = "PeakEnergyEndUseDieselMonthly"; - namedMonthly(26).title = "PeakEnergyEndUseFuelOilMonthly"; - namedMonthly(27).title = "PeakEnergyEndUseCoalMonthly"; - namedMonthly(28).title = "PeakEnergyEndUsePropaneMonthly"; - namedMonthly(29).title = "PeakEnergyEndUseGasolineMonthly"; - namedMonthly(30).title = "PeakEnergyEndUseOtherFuelsMonthly"; - namedMonthly(31).title = "SetpointsNotMetWithTemperaturesMonthly"; - namedMonthly(32).title = "ComfortReportSimple55Monthly"; - namedMonthly(33).title = "UnglazedTranspiredSolarCollectorSummaryMonthly"; - namedMonthly(34).title = "OccupantComfortDataSummaryMonthly"; - namedMonthly(35).title = "ChillerReportMonthly"; - namedMonthly(36).title = "TowerReportMonthly"; - namedMonthly(37).title = "BoilerReportMonthly"; - namedMonthly(38).title = "DXReportMonthly"; - namedMonthly(39).title = "WindowReportMonthly"; - namedMonthly(40).title = "WindowEnergyReportMonthly"; - namedMonthly(41).title = "WindowZoneSummaryMonthly"; - namedMonthly(42).title = "WindowEnergyZoneSummaryMonthly"; - namedMonthly(43).title = "AverageOutdoorConditionsMonthly"; - namedMonthly(44).title = "OutdoorConditionsMaximumDryBulbMonthly"; - namedMonthly(45).title = "OutdoorConditionsMinimumDryBulbMonthly"; - namedMonthly(46).title = "OutdoorConditionsMaximumWetBulbMonthly"; - namedMonthly(47).title = "OutdoorConditionsMaximumDewPointMonthly"; - namedMonthly(48).title = "OutdoorGroundConditionsMonthly"; - namedMonthly(49).title = "WindowACReportMonthly"; - namedMonthly(50).title = "WaterHeaterReportMonthly"; - namedMonthly(51).title = "GeneratorReportMonthly"; - namedMonthly(52).title = "DaylightingReportMonthly"; - namedMonthly(53).title = "CoilReportMonthly"; - namedMonthly(54).title = "PlantLoopDemandReportMonthly"; - namedMonthly(55).title = "FanReportMonthly"; - namedMonthly(56).title = "PumpReportMonthly"; - namedMonthly(57).title = "CondLoopDemandReportMonthly"; - namedMonthly(58).title = "ZoneTemperatureOscillationReportMonthly"; - namedMonthly(59).title = "AirLoopSystemEnergyAndWaterUseMonthly"; - namedMonthly(60).title = "AirLoopSystemComponentLoadsMonthly"; - namedMonthly(61).title = "AirLoopSystemComponentEnergyUseMonthly"; - namedMonthly(62).title = "MechanicalVentilationLoadsMonthly"; - namedMonthly(63).title = "HeatEmissionsReportMonthly"; + state.dataOutRptTab->namedMonthly.allocate(numNamedMonthly); + state.dataOutRptTab->namedMonthly(1).title = "ZoneCoolingSummaryMonthly"; + state.dataOutRptTab->namedMonthly(2).title = "ZoneHeatingSummaryMonthly"; + state.dataOutRptTab->namedMonthly(3).title = "ZoneElectricSummaryMonthly"; + state.dataOutRptTab->namedMonthly(4).title = "SpaceGainsMonthly"; + state.dataOutRptTab->namedMonthly(5).title = "PeakSpaceGainsMonthly"; + state.dataOutRptTab->namedMonthly(6).title = "SpaceGainComponentsAtCoolingPeakMonthly"; + state.dataOutRptTab->namedMonthly(7).title = "EnergyConsumptionElectricityNaturalGasMonthly"; + state.dataOutRptTab->namedMonthly(8).title = "EnergyConsumptionElectricityGeneratedPropaneMonthly"; + state.dataOutRptTab->namedMonthly(9).title = "EnergyConsumptionDieselFuelOilMonthly"; + state.dataOutRptTab->namedMonthly(10).title = "EnergyConsumptionDistrictHeatingCoolingMonthly"; + state.dataOutRptTab->namedMonthly(11).title = "EnergyConsumptionCoalGasolineMonthly"; + state.dataOutRptTab->namedMonthly(12).title = "EnergyConsumptionOtherFuelsMonthly"; + state.dataOutRptTab->namedMonthly(13).title = "EndUseEnergyConsumptionElectricityMonthly"; + state.dataOutRptTab->namedMonthly(14).title = "EndUseEnergyConsumptionNaturalGasMonthly"; + state.dataOutRptTab->namedMonthly(15).title = "EndUseEnergyConsumptionDieselMonthly"; + state.dataOutRptTab->namedMonthly(16).title = "EndUseEnergyConsumptionFuelOilMonthly"; + state.dataOutRptTab->namedMonthly(17).title = "EndUseEnergyConsumptionCoalMonthly"; + state.dataOutRptTab->namedMonthly(18).title = "EndUseEnergyConsumptionPropaneMonthly"; + state.dataOutRptTab->namedMonthly(19).title = "EndUseEnergyConsumptionGasolineMonthly"; + state.dataOutRptTab->namedMonthly(20).title = "EndUseEnergyConsumptionOtherFuelsMonthly"; + state.dataOutRptTab->namedMonthly(21).title = "PeakEnergyEndUseElectricityPart1Monthly"; + state.dataOutRptTab->namedMonthly(22).title = "PeakEnergyEndUseElectricityPart2Monthly"; + state.dataOutRptTab->namedMonthly(23).title = "ElectricComponentsOfPeakDemandMonthly"; + state.dataOutRptTab->namedMonthly(24).title = "PeakEnergyEndUseNaturalGasMonthly"; + state.dataOutRptTab->namedMonthly(25).title = "PeakEnergyEndUseDieselMonthly"; + state.dataOutRptTab->namedMonthly(26).title = "PeakEnergyEndUseFuelOilMonthly"; + state.dataOutRptTab->namedMonthly(27).title = "PeakEnergyEndUseCoalMonthly"; + state.dataOutRptTab->namedMonthly(28).title = "PeakEnergyEndUsePropaneMonthly"; + state.dataOutRptTab->namedMonthly(29).title = "PeakEnergyEndUseGasolineMonthly"; + state.dataOutRptTab->namedMonthly(30).title = "PeakEnergyEndUseOtherFuelsMonthly"; + state.dataOutRptTab->namedMonthly(31).title = "SetpointsNotMetWithTemperaturesMonthly"; + state.dataOutRptTab->namedMonthly(32).title = "ComfortReportSimple55Monthly"; + state.dataOutRptTab->namedMonthly(33).title = "UnglazedTranspiredSolarCollectorSummaryMonthly"; + state.dataOutRptTab->namedMonthly(34).title = "OccupantComfortDataSummaryMonthly"; + state.dataOutRptTab->namedMonthly(35).title = "ChillerReportMonthly"; + state.dataOutRptTab->namedMonthly(36).title = "TowerReportMonthly"; + state.dataOutRptTab->namedMonthly(37).title = "BoilerReportMonthly"; + state.dataOutRptTab->namedMonthly(38).title = "DXReportMonthly"; + state.dataOutRptTab->namedMonthly(39).title = "WindowReportMonthly"; + state.dataOutRptTab->namedMonthly(40).title = "WindowEnergyReportMonthly"; + state.dataOutRptTab->namedMonthly(41).title = "WindowZoneSummaryMonthly"; + state.dataOutRptTab->namedMonthly(42).title = "WindowEnergyZoneSummaryMonthly"; + state.dataOutRptTab->namedMonthly(43).title = "AverageOutdoorConditionsMonthly"; + state.dataOutRptTab->namedMonthly(44).title = "OutdoorConditionsMaximumDryBulbMonthly"; + state.dataOutRptTab->namedMonthly(45).title = "OutdoorConditionsMinimumDryBulbMonthly"; + state.dataOutRptTab->namedMonthly(46).title = "OutdoorConditionsMaximumWetBulbMonthly"; + state.dataOutRptTab->namedMonthly(47).title = "OutdoorConditionsMaximumDewPointMonthly"; + state.dataOutRptTab->namedMonthly(48).title = "OutdoorGroundConditionsMonthly"; + state.dataOutRptTab->namedMonthly(49).title = "WindowACReportMonthly"; + state.dataOutRptTab->namedMonthly(50).title = "WaterHeaterReportMonthly"; + state.dataOutRptTab->namedMonthly(51).title = "GeneratorReportMonthly"; + state.dataOutRptTab->namedMonthly(52).title = "DaylightingReportMonthly"; + state.dataOutRptTab->namedMonthly(53).title = "CoilReportMonthly"; + state.dataOutRptTab->namedMonthly(54).title = "PlantLoopDemandReportMonthly"; + state.dataOutRptTab->namedMonthly(55).title = "FanReportMonthly"; + state.dataOutRptTab->namedMonthly(56).title = "PumpReportMonthly"; + state.dataOutRptTab->namedMonthly(57).title = "CondLoopDemandReportMonthly"; + state.dataOutRptTab->namedMonthly(58).title = "ZoneTemperatureOscillationReportMonthly"; + state.dataOutRptTab->namedMonthly(59).title = "AirLoopSystemEnergyAndWaterUseMonthly"; + state.dataOutRptTab->namedMonthly(60).title = "AirLoopSystemComponentLoadsMonthly"; + state.dataOutRptTab->namedMonthly(61).title = "AirLoopSystemComponentEnergyUseMonthly"; + state.dataOutRptTab->namedMonthly(62).title = "MechanicalVentilationLoadsMonthly"; + state.dataOutRptTab->namedMonthly(63).title = "HeatEmissionsReportMonthly"; if (numNamedMonthly != NumMonthlyReports) { ShowFatalError(state, @@ -2102,10 +2040,10 @@ namespace EnergyPlus::OutputReportTabular { NumMonthlyReports)); } else { for (xcount = 1; xcount <= numNamedMonthly; ++xcount) { - if (!UtilityRoutines::SameString(MonthlyNamedReports(xcount), namedMonthly(xcount).title)) { + if (!UtilityRoutines::SameString(MonthlyNamedReports(xcount), state.dataOutRptTab->namedMonthly(xcount).title)) { ShowSevereError(state, "InitializePredefinedMonthlyTitles: Monthly Report Titles in OutputReportTabular do not match titles in DataOutput."); - ShowContinueError(state, format("first mismatch at ORT [{}] =\"{}\".", numNamedMonthly, namedMonthly(xcount).title)); + ShowContinueError(state, format("first mismatch at ORT [{}] =\"{}\".", numNamedMonthly, state.dataOutRptTab->namedMonthly(xcount).title)); ShowContinueError(state, "same location in DO =\"" + MonthlyNamedReports(xcount) + "\"."); ShowFatalError(state, "Preceding condition causes termination."); } @@ -2152,7 +2090,7 @@ namespace EnergyPlus::OutputReportTabular { // AddVariablesForMonthlyReport routine in InputProcessor. // ---------------------------------------------------------------------------------------- - if (namedMonthly(1).show) { + if (state.dataOutRptTab->namedMonthly(1).show) { curReport = AddMonthlyReport(state, "ZoneCoolingSummaryMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Cooling Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Cooling Rate", "", iAggType::Maximum); @@ -2163,20 +2101,20 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); } - if (namedMonthly(2).show) { + if (state.dataOutRptTab->namedMonthly(2).show) { curReport = AddMonthlyReport(state, "ZoneHeatingSummaryMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Heating Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Heating Rate", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); } - if (namedMonthly(3).show) { + if (state.dataOutRptTab->namedMonthly(3).show) { curReport = AddMonthlyReport(state, "ZoneElectricSummaryMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Lights Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Lights Electricity Energy", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Zone Electric Equipment Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Electric Equipment Electricity Energy", "", iAggType::Maximum); } - if (namedMonthly(4).show) { + if (state.dataOutRptTab->namedMonthly(4).show) { curReport = AddMonthlyReport(state, "SpaceGainsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone People Total Heating Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Lights Total Heating Energy", "", iAggType::SumOrAvg); @@ -2188,7 +2126,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::SumOrAvg); } - if (namedMonthly(5).show) { + if (state.dataOutRptTab->namedMonthly(5).show) { curReport = AddMonthlyReport(state, "PeakSpaceGainsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone People Total Heating Energy", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Zone Lights Total Heating Energy", "", iAggType::Maximum); @@ -2200,7 +2138,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::Maximum); } - if (namedMonthly(6).show) { + if (state.dataOutRptTab->namedMonthly(6).show) { curReport = AddMonthlyReport(state, "SpaceGainComponentsAtCoolingPeakMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Cooling Rate", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Zone People Total Heating Energy", "", iAggType::ValueWhenMaxMin); @@ -2213,21 +2151,21 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::ValueWhenMaxMin); } - if (namedMonthly(7).show) { + if (state.dataOutRptTab->namedMonthly(7).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionElectricityNaturalGasMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Electricity:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Electricity:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "NaturalGas:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "NaturalGas:Facility", "", iAggType::Maximum); } - if (namedMonthly(8).show) { + if (state.dataOutRptTab->namedMonthly(8).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionElectricityGeneratedPropaneMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ElectricityProduced:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "ElectricityProduced:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Propane:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Propane:Facility", "", iAggType::Maximum); } - if (namedMonthly(9).show) { + if (state.dataOutRptTab->namedMonthly(9).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionDieselFuelOilMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Diesel:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Diesel:Facility", "", iAggType::Maximum); @@ -2236,28 +2174,28 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "FuelOilNo2:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "FuelOilNo2:Facility", "", iAggType::Maximum); } - if (namedMonthly(10).show) { + if (state.dataOutRptTab->namedMonthly(10).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionDistrictHeatingCoolingMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "DistrictCooling:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "DistrictCooling:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "DistrictHeating:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "DistrictHeating:Facility", "", iAggType::Maximum); } - if (namedMonthly(11).show) { + if (state.dataOutRptTab->namedMonthly(11).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionCoalGasolineMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Coal:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Coal:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Gasoline:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Gasoline:Facility", "", iAggType::Maximum); } - if (namedMonthly(12).show) { + if (state.dataOutRptTab->namedMonthly(12).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionOtherFuelsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "OtherFuel1:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "OtherFuel1:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "OtherFuel2:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "OtherFuel2:Facility", "", iAggType::Maximum); } - if (namedMonthly(13).show) { + if (state.dataOutRptTab->namedMonthly(13).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionElectricityMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "InteriorLights:Electricity", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "ExteriorLights:Electricity", "", iAggType::SumOrAvg); @@ -2273,7 +2211,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Electricity", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Electricity", "", iAggType::SumOrAvg); } - if (namedMonthly(14).show) { + if (state.dataOutRptTab->namedMonthly(14).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionNaturalGasMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "InteriorEquipment:NaturalGas", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:NaturalGas", "", iAggType::SumOrAvg); @@ -2283,7 +2221,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cogeneration:NaturalGas", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Humidifier:NaturalGas", "", iAggType::SumOrAvg); } - if (namedMonthly(15).show) { + if (state.dataOutRptTab->namedMonthly(15).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionDieselMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Diesel", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling:Diesel", "", iAggType::SumOrAvg); @@ -2291,7 +2229,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Diesel", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Diesel", "", iAggType::SumOrAvg); } - if (namedMonthly(16).show) { + if (state.dataOutRptTab->namedMonthly(16).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionFuelOilMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:FuelOilNo1", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling:FuelOilNo1", "", iAggType::SumOrAvg); @@ -2304,13 +2242,13 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:FuelOilNo2", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:FuelOilNo2", "", iAggType::SumOrAvg); } - if (namedMonthly(17).show) { + if (state.dataOutRptTab->namedMonthly(17).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionCoalMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Coal", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Heating:Coal", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Coal", "", iAggType::SumOrAvg); } - if (namedMonthly(18).show) { + if (state.dataOutRptTab->namedMonthly(18).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionPropaneMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Propane", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling:Propane", "", iAggType::SumOrAvg); @@ -2319,7 +2257,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Propane", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Humidifier:Propane", "", iAggType::SumOrAvg); } - if (namedMonthly(19).show) { + if (state.dataOutRptTab->namedMonthly(19).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionGasolineMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Gasoline", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling:Gasoline", "", iAggType::SumOrAvg); @@ -2327,7 +2265,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Gasoline", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Gasoline", "", iAggType::SumOrAvg); } - if (namedMonthly(20).show) { + if (state.dataOutRptTab->namedMonthly(20).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionOtherFuelsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:OtherFuel1", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling:OtherFuel1", "", iAggType::SumOrAvg); @@ -2340,7 +2278,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:OtherFuel2", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:OtherFuel2", "", iAggType::SumOrAvg); } - if (namedMonthly(21).show) { + if (state.dataOutRptTab->namedMonthly(21).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseElectricityPart1Monthly", 2); AddMonthlyFieldSetInput(state, curReport, "InteriorLights:Electricity", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "ExteriorLights:Electricity", "", iAggType::Maximum); @@ -2350,7 +2288,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Pumps:Electricity", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Heating:Electricity", "", iAggType::Maximum); } - if (namedMonthly(22).show) { + if (state.dataOutRptTab->namedMonthly(22).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseElectricityPart2Monthly", 2); AddMonthlyFieldSetInput(state, curReport, "Cooling:Electricity", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "HeatRejection:Electricity", "", iAggType::Maximum); @@ -2359,7 +2297,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Electricity", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Electricity", "", iAggType::Maximum); } - if (namedMonthly(23).show) { + if (state.dataOutRptTab->namedMonthly(23).show) { curReport = AddMonthlyReport(state, "ElectricComponentsOfPeakDemandMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Electricity:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "InteriorLights:Electricity", "", iAggType::ValueWhenMaxMin); @@ -2372,7 +2310,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cooling:Electricity", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "HeatRejection:Electricity", "", iAggType::ValueWhenMaxMin); } - if (namedMonthly(24).show) { + if (state.dataOutRptTab->namedMonthly(24).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseNaturalGasMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "InteriorEquipment:NaturalGas", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:NaturalGas", "", iAggType::Maximum); @@ -2381,7 +2319,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:NaturalGas", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:NaturalGas", "", iAggType::Maximum); } - if (namedMonthly(25).show) { + if (state.dataOutRptTab->namedMonthly(25).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseDieselMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Diesel", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling:Diesel", "", iAggType::Maximum); @@ -2389,7 +2327,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Diesel", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Diesel", "", iAggType::Maximum); } - if (namedMonthly(26).show) { + if (state.dataOutRptTab->namedMonthly(26).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseFuelOilMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:FuelOilNo1", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling:FuelOilNo1", "", iAggType::Maximum); @@ -2402,13 +2340,13 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:FuelOilNo2", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:FuelOilNo2", "", iAggType::Maximum); } - if (namedMonthly(27).show) { + if (state.dataOutRptTab->namedMonthly(27).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseCoalMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Coal", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Heating:Coal", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Coal", "", iAggType::Maximum); } - if (namedMonthly(28).show) { + if (state.dataOutRptTab->namedMonthly(28).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUsePropaneMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Propane", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling:Propane", "", iAggType::Maximum); @@ -2416,7 +2354,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Propane", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Propane", "", iAggType::Maximum); } - if (namedMonthly(29).show) { + if (state.dataOutRptTab->namedMonthly(29).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseGasolineMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Gasoline", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling:Gasoline", "", iAggType::Maximum); @@ -2424,7 +2362,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Gasoline", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Gasoline", "", iAggType::Maximum); } - if (namedMonthly(30).show) { + if (state.dataOutRptTab->namedMonthly(30).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseOtherFuelsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:OtherFuel1", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling:OtherFuel1", "", iAggType::Maximum); @@ -2437,7 +2375,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:OtherFuel2", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:OtherFuel2", "", iAggType::Maximum); } - if (namedMonthly(31).show) { + if (state.dataOutRptTab->namedMonthly(31).show) { curReport = AddMonthlyReport(state, "SetpointsNotMetWithTemperaturesMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Heating Setpoint Not Met Time", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); @@ -2448,7 +2386,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Cooling Setpoint Not Met While Occupied Time", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); } - if (namedMonthly(32).show) { + if (state.dataOutRptTab->namedMonthly(32).show) { curReport = AddMonthlyReport(state, "ComfortReportSimple55Monthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Summer Clothes Not Comfortable Time", "", iAggType::HoursNonZero); @@ -2460,14 +2398,14 @@ namespace EnergyPlus::OutputReportTabular { curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Summer or Winter Clothes Not Comfortable Time", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); } - if (namedMonthly(33).show) { + if (state.dataOutRptTab->namedMonthly(33).show) { curReport = AddMonthlyReport(state, "UnglazedTranspiredSolarCollectorSummaryMonthly", 5); AddMonthlyFieldSetInput(state, curReport, "Solar Collector System Efficiency", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Solar Collector System Efficiency", "", iAggType::SumOrAverageHoursShown); AddMonthlyFieldSetInput(state, curReport, "Solar Collector Outside Face Suction Velocity", "", iAggType::SumOrAverageHoursShown); AddMonthlyFieldSetInput(state, curReport, "Solar Collector Sensible Heating Rate", "", iAggType::SumOrAverageHoursShown); } - if (namedMonthly(34).show) { + if (state.dataOutRptTab->namedMonthly(34).show) { curReport = AddMonthlyReport(state, "OccupantComfortDataSummaryMonthly", 5); AddMonthlyFieldSetInput(state, curReport, "People Occupant Count", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "People Air Temperature", "", iAggType::SumOrAverageHoursShown); @@ -2475,7 +2413,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Thermal Comfort Fanger Model PMV", "", iAggType::SumOrAverageHoursShown); AddMonthlyFieldSetInput(state, curReport, "Zone Thermal Comfort Fanger Model PPD", "", iAggType::SumOrAverageHoursShown); } - if (namedMonthly(35).show) { + if (state.dataOutRptTab->namedMonthly(35).show) { curReport = AddMonthlyReport(state, "ChillerReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Chiller Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Chiller Electricity Rate", "", iAggType::Maximum); @@ -2488,7 +2426,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Chiller Part Load Ratio", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Chiller Part Load Ratio", "", iAggType::Maximum); } - if (namedMonthly(36).show) { + if (state.dataOutRptTab->namedMonthly(36).show) { curReport = AddMonthlyReport(state, "TowerReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Fan Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Fan Electricity Energy", "", iAggType::HoursNonZero); @@ -2498,7 +2436,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Outlet Temperature", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Mass Flow Rate", "", iAggType::SumOrAvg); } - if (namedMonthly(37).show) { + if (state.dataOutRptTab->namedMonthly(37).show) { curReport = AddMonthlyReport(state, "BoilerReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Boiler Heating Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Boiler Gas Consumption", "", iAggType::SumOrAvg); @@ -2512,7 +2450,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Boiler Part Load Ratio", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Boiler Part Load Ratio", "", iAggType::Maximum); } - if (namedMonthly(38).show) { + if (state.dataOutRptTab->namedMonthly(38).show) { curReport = AddMonthlyReport(state, "DXReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Electricity Energy", "", iAggType::SumOrAvg); @@ -2528,7 +2466,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Electricity Rate", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Crankcase Heater Electricity Rate", "", iAggType::Maximum); } - if (namedMonthly(39).show) { + if (state.dataOutRptTab->namedMonthly(39).show) { curReport = AddMonthlyReport(state, "WindowReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Solar Radiation Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); @@ -2539,7 +2477,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Surface Shading Device Is On Time Fraction", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Surface Storm Window On Off Status", "", iAggType::HoursNonZero); } - if (namedMonthly(40).show) { + if (state.dataOutRptTab->namedMonthly(40).show) { curReport = AddMonthlyReport(state, "WindowEnergyReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Solar Radiation Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); @@ -2547,7 +2485,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Surface Window Heat Gain Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Surface Window Heat Loss Energy", "", iAggType::SumOrAvg); } - if (namedMonthly(41).show) { + if (state.dataOutRptTab->namedMonthly(41).show) { curReport = AddMonthlyReport(state, "WindowZoneSummaryMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Gain Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Loss Rate", "", iAggType::SumOrAvg); @@ -2557,7 +2495,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); } - if (namedMonthly(42).show) { + if (state.dataOutRptTab->namedMonthly(42).show) { curReport = AddMonthlyReport(state, "WindowEnergyZoneSummaryMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Gain Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Loss Energy", "", iAggType::SumOrAvg); @@ -2567,7 +2505,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); } - if (namedMonthly(43).show) { + if (state.dataOutRptTab->namedMonthly(43).show) { curReport = AddMonthlyReport(state, "AverageOutdoorConditionsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::SumOrAvg); @@ -2578,7 +2516,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Site Rain Status", "", iAggType::SumOrAvg); } - if (namedMonthly(44).show) { + if (state.dataOutRptTab->namedMonthly(44).show) { curReport = AddMonthlyReport(state, "OutdoorConditionsMaximumDryBulbMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); @@ -2588,7 +2526,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } - if (namedMonthly(45).show) { + if (state.dataOutRptTab->namedMonthly(45).show) { curReport = AddMonthlyReport(state, "OutdoorConditionsMinimumDryBulbMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::Minimum); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); @@ -2598,7 +2536,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } - if (namedMonthly(46).show) { + if (state.dataOutRptTab->namedMonthly(46).show) { curReport = AddMonthlyReport(state, "OutdoorConditionsMaximumWetBulbMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); @@ -2608,7 +2546,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } - if (namedMonthly(47).show) { + if (state.dataOutRptTab->namedMonthly(47).show) { curReport = AddMonthlyReport(state, "OutdoorConditionsMaximumDewPointMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); @@ -2618,7 +2556,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } - if (namedMonthly(48).show) { + if (state.dataOutRptTab->namedMonthly(48).show) { curReport = AddMonthlyReport(state, "OutdoorGroundConditionsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Ground Temperature", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Site Surface Ground Temperature", "", iAggType::SumOrAvg); @@ -2627,7 +2565,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Ground Reflected Solar Radiation Rate per Area", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Site Snow on Ground Status", "", iAggType::SumOrAvg); } - if (namedMonthly(49).show) { + if (state.dataOutRptTab->namedMonthly(49).show) { curReport = AddMonthlyReport(state, "WindowACReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Total Cooling Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Electricity Energy", "", iAggType::SumOrAvg); @@ -2639,7 +2577,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Latent Cooling Rate", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Electricity Rate", "", iAggType::ValueWhenMaxMin); } - if (namedMonthly(50).show) { + if (state.dataOutRptTab->namedMonthly(50).show) { curReport = AddMonthlyReport(state, "WaterHeaterReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Water Heater Total Demand Heat Transfer Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Water Heater Use Side Heat Transfer Energy", "", iAggType::SumOrAvg); @@ -2652,7 +2590,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Water Heater Heat Recovery Supply Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Water Heater Source Energy", "", iAggType::SumOrAvg); } - if (namedMonthly(51).show) { + if (state.dataOutRptTab->namedMonthly(51).show) { curReport = AddMonthlyReport(state, "GeneratorReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Generator Produced AC Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Generator Diesel Consumption", "", iAggType::SumOrAvg); @@ -2664,7 +2602,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Generator Exhaust Heat Recovery Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Generator Exhaust Air Temperature", "", iAggType::SumOrAvg); } - if (namedMonthly(52).show) { + if (state.dataOutRptTab->namedMonthly(52).show) { curReport = AddMonthlyReport(state, "DaylightingReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Exterior Beam Normal Illuminance", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Daylighting Lighting Power Multiplier", "", iAggType::SumOrAverageHoursShown); @@ -2678,7 +2616,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 2 Glare Index Setpoint Exceeded Time", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 2 Daylight Illuminance Setpoint Exceeded Time", "", iAggType::SumOrAvg); } - if (namedMonthly(53).show) { + if (state.dataOutRptTab->namedMonthly(53).show) { curReport = AddMonthlyReport(state, "CoilReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Heating Coil Heating Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Heating Coil Heating Rate", "", iAggType::Maximum); @@ -2688,21 +2626,21 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Sensible Cooling Rate", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Wetted Area Fraction", "", iAggType::SumOrAvg); } - if (namedMonthly(54).show) { + if (state.dataOutRptTab->namedMonthly(54).show) { curReport = AddMonthlyReport(state, "PlantLoopDemandReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::Maximum); } - if (namedMonthly(55).show) { + if (state.dataOutRptTab->namedMonthly(55).show) { curReport = AddMonthlyReport(state, "FanReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Fan Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Fan Rise in Air Temperature", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Fan Electricity Rate", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Fan Rise in Air Temperature", "", iAggType::ValueWhenMaxMin); } - if (namedMonthly(56).show) { + if (state.dataOutRptTab->namedMonthly(56).show) { curReport = AddMonthlyReport(state, "PumpReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Pump Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Pump Fluid Heat Gain Energy", "", iAggType::SumOrAvg); @@ -2712,7 +2650,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Pump Outlet Temperature", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Pump Mass Flow Rate", "", iAggType::ValueWhenMaxMin); } - if (namedMonthly(57).show) { + if (state.dataOutRptTab->namedMonthly(57).show) { curReport = AddMonthlyReport(state, "CondLoopDemandReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::Maximum); @@ -2721,12 +2659,12 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::Maximum); } - if (namedMonthly(58).show) { + if (state.dataOutRptTab->namedMonthly(58).show) { curReport = AddMonthlyReport(state, "ZoneTemperatureOscillationReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Oscillating Temperatures Time", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Zone People Occupant Count", "", iAggType::SumOrAverageHoursShown); } - if (namedMonthly(59).show) { + if (state.dataOutRptTab->namedMonthly(59).show) { curReport = AddMonthlyReport(state, "AirLoopSystemEnergyAndWaterUseMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Air System Hot Water Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Air System Steam Energy", "", iAggType::SumOrAvg); @@ -2736,7 +2674,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Air System Water Volume", "", iAggType::SumOrAvg); } - if (namedMonthly(60).show) { + if (state.dataOutRptTab->namedMonthly(60).show) { curReport = AddMonthlyReport(state, "AirLoopSystemComponentLoadsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Air System Fan Air Heating Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Air System Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); @@ -2747,7 +2685,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Air System Evaporative Cooler Total Cooling Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Air System Desiccant Dehumidifier Total Cooling Energy", "", iAggType::SumOrAvg); } - if (namedMonthly(61).show) { + if (state.dataOutRptTab->namedMonthly(61).show) { curReport = AddMonthlyReport(state, "AirLoopSystemComponentEnergyUseMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Air System Fan Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Air System Heating Coil Hot Water Energy", "", iAggType::SumOrAvg); @@ -2762,7 +2700,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Air System Evaporative Cooler Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Air System Desiccant Dehumidifier Electricity Energy", "", iAggType::SumOrAvg); } - if (namedMonthly(62).show) { + if (state.dataOutRptTab->namedMonthly(62).show) { curReport = AddMonthlyReport(state, "MechanicalVentilationLoadsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation No Load Heat Removal Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Cooling Load Increase Energy", "", iAggType::SumOrAvg); @@ -2774,7 +2712,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Heating Load Decrease Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Air Changes per Hour", "", iAggType::SumOrAvg); } - if (namedMonthly(63).show) { + if (state.dataOutRptTab->namedMonthly(63).show) { curReport = AddMonthlyReport(state, "HeatEmissionsReportMonthly", 2); // Place holder AddMonthlyFieldSetInput(state, curReport, "Site Total Surface Heat Emission to Air", "", iAggType::SumOrAvg); @@ -3215,8 +3153,8 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << "\n"; tbl_stream << "\n"; } else if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::XML) { - if (!prevReportName.empty()) { - tbl_stream << "\n"; // close the last element if it was used. + if (!state.dataOutRptTab->prevReportName.empty()) { + tbl_stream << "prevReportName << ">\n"; // close the last element if it was used. } tbl_stream << "\n"; } @@ -3355,39 +3293,39 @@ namespace EnergyPlus::OutputReportTabular { } if (state.dataGlobal->DoWeathSim) { for (iInput = 1; iInput <= state.dataOutRptTab->MonthlyInputCount; ++iInput) { - if (MonthlyInput(iInput).numTables > 0) { - tbl_stream << "

" << MonthlyInput(iInput).name << "

|\n"; - for (jTable = 1; jTable <= MonthlyInput(iInput).numTables; ++jTable) { - curTable = jTable + MonthlyInput(iInput).firstTable - 1; - tbl_stream << "" - << MonthlyTables(curTable).keyValue << " | \n"; + if (state.dataOutRptTab->MonthlyInput(iInput).numTables > 0) { + tbl_stream << "

" << state.dataOutRptTab->MonthlyInput(iInput).name << "

|\n"; + for (jTable = 1; jTable <= state.dataOutRptTab->MonthlyInput(iInput).numTables; ++jTable) { + curTable = jTable + state.dataOutRptTab->MonthlyInput(iInput).firstTable - 1; + tbl_stream << "MonthlyInput(iInput).name, state.dataOutRptTab->MonthlyTables(curTable).keyValue) << "\">" + << state.dataOutRptTab->MonthlyTables(curTable).keyValue << " | \n"; } } } for (iInput = 1; iInput <= state.dataOutRptTab->OutputTableBinnedCount; ++iInput) { - if (OutputTableBinned(iInput).numTables > 0) { - if (OutputTableBinned(iInput).scheduleIndex == 0) { - tbl_stream << "

" << OutputTableBinned(iInput).varOrMeter << "

|\n"; + if (state.dataOutRptTab->OutputTableBinned(iInput).numTables > 0) { + if (state.dataOutRptTab->OutputTableBinned(iInput).scheduleIndex == 0) { + tbl_stream << "

" << state.dataOutRptTab->OutputTableBinned(iInput).varOrMeter << "

|\n"; } else { - tbl_stream << "

" << OutputTableBinned(iInput).varOrMeter << " [" << OutputTableBinned(iInput).ScheduleName + tbl_stream << "

" << state.dataOutRptTab->OutputTableBinned(iInput).varOrMeter << " [" << state.dataOutRptTab->OutputTableBinned(iInput).ScheduleName << "]

|\n"; } - for (jTable = 1; jTable <= OutputTableBinned(iInput).numTables; ++jTable) { - curTable = OutputTableBinned(iInput).resIndex + (jTable - 1); + for (jTable = 1; jTable <= state.dataOutRptTab->OutputTableBinned(iInput).numTables; ++jTable) { + curTable = state.dataOutRptTab->OutputTableBinned(iInput).resIndex + (jTable - 1); curName = ""; if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { - origName = OutputTableBinned(iInput).varOrMeter + unitEnumToStringBrackets(OutputTableBinned(iInput).units); + origName = state.dataOutRptTab->OutputTableBinned(iInput).varOrMeter + unitEnumToStringBrackets(state.dataOutRptTab->OutputTableBinned(iInput).units); LookupSItoIP(state, origName, indexUnitConv, curName); } else { - curName = OutputTableBinned(iInput).varOrMeter + unitEnumToStringBrackets(OutputTableBinned(iInput).units); + curName = state.dataOutRptTab->OutputTableBinned(iInput).varOrMeter + unitEnumToStringBrackets(state.dataOutRptTab->OutputTableBinned(iInput).units); } - if (OutputTableBinned(iInput).scheduleIndex == 0) { - tbl_stream << "" - << BinObjVarID(curTable).namesOfObj << " | \n"; + if (state.dataOutRptTab->OutputTableBinned(iInput).scheduleIndex == 0) { + tbl_stream << "BinObjVarID(curTable).namesOfObj) << "\">" + << state.dataOutRptTab->BinObjVarID(curTable).namesOfObj << " | \n"; } else { tbl_stream << "" << BinObjVarID(curTable).namesOfObj << " | \n"; + << MakeAnchorName(curName + state.dataOutRptTab->OutputTableBinned(iInput).ScheduleName, state.dataOutRptTab->BinObjVarID(curTable).namesOfObj) + << "\">" << state.dataOutRptTab->BinObjVarID(curTable).namesOfObj << " | \n"; } } } @@ -3396,15 +3334,15 @@ namespace EnergyPlus::OutputReportTabular { } // add entries specifically added using AddTOCEntry for (iEntry = 1; iEntry <= state.dataOutRptTab->TOCEntriesCount; ++iEntry) { - if (!TOCEntries(iEntry).isWritten) { - curSection = TOCEntries(iEntry).sectionName; + if (!state.dataOutRptTab->TOCEntries(iEntry).isWritten) { + curSection = state.dataOutRptTab->TOCEntries(iEntry).sectionName; tbl_stream << "

" << curSection << "

|\n"; for (jEntry = iEntry; jEntry <= state.dataOutRptTab->TOCEntriesCount; ++jEntry) { - if (!TOCEntries(jEntry).isWritten) { - if (TOCEntries(jEntry).sectionName == curSection) { - tbl_stream << "" << TOCEntries(jEntry).reportName << " | \n"; - TOCEntries(jEntry).isWritten = true; + if (!state.dataOutRptTab->TOCEntries(jEntry).isWritten) { + if (state.dataOutRptTab->TOCEntries(jEntry).sectionName == curSection) { + tbl_stream << "TOCEntries(jEntry).sectionName, state.dataOutRptTab->TOCEntries(jEntry).reportName) + << "\">" << state.dataOutRptTab->TOCEntries(jEntry).reportName << " | \n"; + state.dataOutRptTab->TOCEntries(jEntry).isWritten = true; } } } @@ -3476,15 +3414,15 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptTab->timeInYear += elapsedTime; for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { // get values of array for current object being referenced - curIntervalStart = OutputTableBinned(iInObj).intervalStart; - curIntervalSize = OutputTableBinned(iInObj).intervalSize; - curIntervalCount = OutputTableBinned(iInObj).intervalCount; - curResIndex = OutputTableBinned(iInObj).resIndex; - curNumTables = OutputTableBinned(iInObj).numTables; + curIntervalStart = state.dataOutRptTab->OutputTableBinned(iInObj).intervalStart; + curIntervalSize = state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize; + curIntervalCount = state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount; + curResIndex = state.dataOutRptTab->OutputTableBinned(iInObj).resIndex; + curNumTables = state.dataOutRptTab->OutputTableBinned(iInObj).numTables; topValue = curIntervalStart + curIntervalSize * curIntervalCount; - curTypeOfVar = OutputTableBinned(iInObj).typeOfVar; - curStepType = OutputTableBinned(iInObj).stepType; - curScheduleIndex = OutputTableBinned(iInObj).scheduleIndex; + curTypeOfVar = state.dataOutRptTab->OutputTableBinned(iInObj).typeOfVar; + curStepType = state.dataOutRptTab->OutputTableBinned(iInObj).stepType; + curScheduleIndex = state.dataOutRptTab->OutputTableBinned(iInObj).scheduleIndex; // if a schedule was used, check if it was non-zero value if (curScheduleIndex != 0) { if (GetCurrentScheduleValue(state, curScheduleIndex) != 0.0) { @@ -3503,14 +3441,14 @@ namespace EnergyPlus::OutputReportTabular { ((curStepType == OutputProcessor::TimeStepType::TimeStepSystem) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem))) { // put actual value from OutputProcesser arrays - curValue = GetInternalVariableValue(state, curTypeOfVar, BinObjVarID(repIndex).varMeterNum); + curValue = GetInternalVariableValue(state, curTypeOfVar, state.dataOutRptTab->BinObjVarID(repIndex).varMeterNum); // per MJW when a summed variable is used divide it by the length of the time step if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { elapsedTime = TimeStepSys; } else { elapsedTime = state.dataGlobal->TimeStepZone; } - if (OutputTableBinned(iInObj).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (state.dataOutRptTab->OutputTableBinned(iInObj).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable curValue /= (elapsedTime * DataGlobalConstants::SecInHour); } // round the value to the number of signficant digits used in the final output report @@ -3524,26 +3462,26 @@ namespace EnergyPlus::OutputReportTabular { // check if the value is above the maximum or below the minimum value // first before binning the value within the range. if (curValue < curIntervalStart) { - BinResultsBelow(repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; - BinResultsBelow(repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; + state.dataOutRptTab->BinResultsBelow(repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; + state.dataOutRptTab->BinResultsBelow(repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; } else if (curValue >= topValue) { - BinResultsAbove(repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; - BinResultsAbove(repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; + state.dataOutRptTab->BinResultsAbove(repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; + state.dataOutRptTab->BinResultsAbove(repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; } else { // determine which bin the results are in binNum = int((curValue - curIntervalStart) / curIntervalSize) + 1; - BinResults(binNum, repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; - BinResults(binNum, repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; + state.dataOutRptTab->BinResults(binNum, repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; + state.dataOutRptTab->BinResults(binNum, repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; } // add to statistics array - ++BinStatistics(repIndex).n; - BinStatistics(repIndex).sum += curValue; - BinStatistics(repIndex).sum2 += curValue * curValue; - if (curValue < BinStatistics(repIndex).minimum) { - BinStatistics(repIndex).minimum = curValue; + ++state.dataOutRptTab->BinStatistics(repIndex).n; + state.dataOutRptTab->BinStatistics(repIndex).sum += curValue; + state.dataOutRptTab->BinStatistics(repIndex).sum2 += curValue * curValue; + if (curValue < state.dataOutRptTab->BinStatistics(repIndex).minimum) { + state.dataOutRptTab->BinStatistics(repIndex).minimum = curValue; } - if (curValue > BinStatistics(repIndex).maximum) { - BinStatistics(repIndex).maximum = curValue; + if (curValue > state.dataOutRptTab->BinStatistics(repIndex).maximum) { + state.dataOutRptTab->BinStatistics(repIndex).maximum = curValue; } } } @@ -3621,14 +3559,14 @@ namespace EnergyPlus::OutputReportTabular { assert(state.dataGlobal->TimeStepZoneSec > 0.0); // create temporary arrays to speed processing of these arrays - if (GatherMonthlyResultsForTimestepRunOnce) { + if (state.dataOutRptTab->GatherMonthlyResultsForTimestepRunOnce) { // MonthlyColumns - MonthlyColumnsTypeOfVar.allocate(MonthlyColumns.I()); - MonthlyColumnsStepType.allocate(MonthlyColumns.I()); - MonthlyColumnsAggType.allocate(MonthlyColumns.I()); - MonthlyColumnsVarNum.allocate(MonthlyColumns.I()); - for (int i = MonthlyColumns.l(), e = MonthlyColumns.u(); i <= e; ++i) { - auto const &col(MonthlyColumns(i)); + MonthlyColumnsTypeOfVar.allocate(state.dataOutRptTab->MonthlyColumns.I()); + MonthlyColumnsStepType.allocate(state.dataOutRptTab->MonthlyColumns.I()); + MonthlyColumnsAggType.allocate(state.dataOutRptTab->MonthlyColumns.I()); + MonthlyColumnsVarNum.allocate(state.dataOutRptTab->MonthlyColumns.I()); + for (int i = state.dataOutRptTab->MonthlyColumns.l(), e = state.dataOutRptTab->MonthlyColumns.u(); i <= e; ++i) { + auto const &col(state.dataOutRptTab->MonthlyColumns(i)); MonthlyColumnsTypeOfVar(i) = col.typeOfVar; MonthlyColumnsStepType(i) = col.stepType; MonthlyColumnsAggType(i) = col.aggType; @@ -3636,13 +3574,13 @@ namespace EnergyPlus::OutputReportTabular { } // MonthlyTables - MonthlyTablesNumColumns.allocate(MonthlyTables.I()); - for (int i = MonthlyTables.l(), e = MonthlyTables.u(); i <= e; ++i) { - MonthlyTablesNumColumns(i) = MonthlyTables(i).numColumns; + MonthlyTablesNumColumns.allocate(state.dataOutRptTab->MonthlyTables.I()); + for (int i = state.dataOutRptTab->MonthlyTables.l(), e = state.dataOutRptTab->MonthlyTables.u(); i <= e; ++i) { + MonthlyTablesNumColumns(i) = state.dataOutRptTab->MonthlyTables(i).numColumns; } // set flag so this block is only executed once - GatherMonthlyResultsForTimestepRunOnce = false; + state.dataOutRptTab->GatherMonthlyResultsForTimestepRunOnce = false; } elapsedTime = TimeStepSys; @@ -3655,7 +3593,7 @@ namespace EnergyPlus::OutputReportTabular { for (iTable = 1; iTable <= state.dataOutRptTab->MonthlyTablesCount; ++iTable) { activeMinMax = false; // at the beginning of the new timestep activeHoursShown = false; // fix by JG addressing CR6482 - curFirstColumn = MonthlyTables(iTable).firstColumn; + curFirstColumn = state.dataOutRptTab->MonthlyTables(iTable).firstColumn; for (jColumn = 1; jColumn <= MonthlyTablesNumColumns(iTable); ++jColumn) { curCol = jColumn + curFirstColumn - 1; curTypeOfVar = MonthlyColumnsTypeOfVar(curCol); @@ -3669,9 +3607,9 @@ namespace EnergyPlus::OutputReportTabular { curVarNum = MonthlyColumnsVarNum(curCol); curValue = GetInternalVariableValue(state, curTypeOfVar, curVarNum); // Get the value from the result array - oldResultValue = MonthlyColumns(curCol).reslt(state.dataEnvrn->Month); - oldTimeStamp = MonthlyColumns(curCol).timeStamp(state.dataEnvrn->Month); - oldDuration = MonthlyColumns(curCol).duration(state.dataEnvrn->Month); + oldResultValue = state.dataOutRptTab->MonthlyColumns(curCol).reslt(state.dataEnvrn->Month); + oldTimeStamp = state.dataOutRptTab->MonthlyColumns(curCol).timeStamp(state.dataEnvrn->Month); + oldDuration = state.dataOutRptTab->MonthlyColumns(curCol).duration(state.dataEnvrn->Month); // Zero the revised values (as default if not set later in SELECT) newResultValue = 0.0; newTimeStamp = 0; @@ -3688,7 +3626,7 @@ namespace EnergyPlus::OutputReportTabular { { auto const SELECT_CASE_var(MonthlyColumnsAggType(curCol)); if (SELECT_CASE_var == iAggType::SumOrAvg) { - if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable newResultValue = oldResultValue + curValue; } else { newResultValue = oldResultValue + curValue * elapsedTime; // for averaging - weight by elapsed time @@ -3697,7 +3635,7 @@ namespace EnergyPlus::OutputReportTabular { activeNewValue = true; } else if (SELECT_CASE_var == iAggType::Maximum) { // per MJW when a summed variable is used divide it by the length of the time step - if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { curValue /= (TimeStepSys * DataGlobalConstants::SecInHour); } else { @@ -3714,7 +3652,7 @@ namespace EnergyPlus::OutputReportTabular { } } else if (SELECT_CASE_var == iAggType::Minimum) { // per MJW when a summed variable is used divide it by the length of the time step - if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { curValue /= (TimeStepSys * DataGlobalConstants::SecInHour); } else { @@ -3788,9 +3726,9 @@ namespace EnergyPlus::OutputReportTabular { // new columns. This skips the aggregation types that don't even get // triggered now such as valueWhenMinMax and all the agg*HoursShown if (activeNewValue) { - MonthlyColumns(curCol).reslt(state.dataEnvrn->Month) = newResultValue; - MonthlyColumns(curCol).timeStamp(state.dataEnvrn->Month) = newTimeStamp; - MonthlyColumns(curCol).duration(state.dataEnvrn->Month) = newDuration; + state.dataOutRptTab->MonthlyColumns(curCol).reslt(state.dataEnvrn->Month) = newResultValue; + state.dataOutRptTab->MonthlyColumns(curCol).timeStamp(state.dataEnvrn->Month) = newTimeStamp; + state.dataOutRptTab->MonthlyColumns(curCol).duration(state.dataEnvrn->Month) = newDuration; } // if a minimum or maximum value was set this timeStep then // scan the remaining columns of the table looking for values @@ -3798,27 +3736,27 @@ namespace EnergyPlus::OutputReportTabular { // if another minimum or maximum column is found then end // the scan (it will be taken care of when that column is done) if (activeMinMax) { - for (kOtherColumn = jColumn + 1; kOtherColumn <= MonthlyTables(iTable).numColumns; ++kOtherColumn) { - scanColumn = kOtherColumn + MonthlyTables(iTable).firstColumn - 1; + for (kOtherColumn = jColumn + 1; kOtherColumn <= state.dataOutRptTab->MonthlyTables(iTable).numColumns; ++kOtherColumn) { + scanColumn = kOtherColumn + state.dataOutRptTab->MonthlyTables(iTable).firstColumn - 1; { - auto const SELECT_CASE_var(MonthlyColumns(scanColumn).aggType); + auto const SELECT_CASE_var(state.dataOutRptTab->MonthlyColumns(scanColumn).aggType); if ((SELECT_CASE_var == iAggType::Maximum) || (SELECT_CASE_var == iAggType::Minimum)) { // end scanning since these might reset break; // do } else if (SELECT_CASE_var == iAggType::ValueWhenMaxMin) { // this case is when the value should be set - scanTypeOfVar = MonthlyColumns(scanColumn).typeOfVar; - scanVarNum = MonthlyColumns(scanColumn).varNum; + scanTypeOfVar = state.dataOutRptTab->MonthlyColumns(scanColumn).typeOfVar; + scanVarNum = state.dataOutRptTab->MonthlyColumns(scanColumn).varNum; scanValue = GetInternalVariableValue(state, scanTypeOfVar, scanVarNum); // When a summed variable is used divide it by the length of the time step - if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (state.dataOutRptTab->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { scanValue /= (TimeStepSys * DataGlobalConstants::SecInHour); } else { scanValue /= state.dataGlobal->TimeStepZoneSec; } } - MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; + state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; } else { // do nothing } @@ -3828,14 +3766,14 @@ namespace EnergyPlus::OutputReportTabular { // If the hours variable is active then scan through the rest of the variables // and accumulate if (activeHoursShown) { - for (kOtherColumn = jColumn + 1; kOtherColumn <= MonthlyTables(iTable).numColumns; ++kOtherColumn) { - scanColumn = kOtherColumn + MonthlyTables(iTable).firstColumn - 1; - scanTypeOfVar = MonthlyColumns(scanColumn).typeOfVar; - scanVarNum = MonthlyColumns(scanColumn).varNum; + for (kOtherColumn = jColumn + 1; kOtherColumn <= state.dataOutRptTab->MonthlyTables(iTable).numColumns; ++kOtherColumn) { + scanColumn = kOtherColumn + state.dataOutRptTab->MonthlyTables(iTable).firstColumn - 1; + scanTypeOfVar = state.dataOutRptTab->MonthlyColumns(scanColumn).typeOfVar; + scanVarNum = state.dataOutRptTab->MonthlyColumns(scanColumn).varNum; scanValue = GetInternalVariableValue(state, scanTypeOfVar, scanVarNum); - oldScanValue = MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month); + oldScanValue = state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month); { - auto const SELECT_CASE_var(MonthlyColumns(scanColumn).aggType); + auto const SELECT_CASE_var(state.dataOutRptTab->MonthlyColumns(scanColumn).aggType); if ((SELECT_CASE_var == iAggType::HoursZero) || (SELECT_CASE_var == iAggType::HoursNonZero)) { // end scanning since these might reset break; // do @@ -3847,15 +3785,15 @@ namespace EnergyPlus::OutputReportTabular { break; // do } else if (SELECT_CASE_var == iAggType::SumOrAverageHoursShown) { // this case is when the value should be set - if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable - MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = oldScanValue + scanValue; + if (state.dataOutRptTab->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = oldScanValue + scanValue; } else { // for averaging - weight by elapsed time - MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = oldScanValue + scanValue * elapsedTime; + state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = oldScanValue + scanValue * elapsedTime; } - MonthlyColumns(scanColumn).duration(state.dataEnvrn->Month) += elapsedTime; + state.dataOutRptTab->MonthlyColumns(scanColumn).duration(state.dataEnvrn->Month) += elapsedTime; } else if (SELECT_CASE_var == iAggType::MaximumDuringHoursShown) { - if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (state.dataOutRptTab->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { scanValue /= (TimeStepSys * DataGlobalConstants::SecInHour); } else { @@ -3863,11 +3801,11 @@ namespace EnergyPlus::OutputReportTabular { } } if (scanValue > oldScanValue) { - MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; - MonthlyColumns(scanColumn).timeStamp(state.dataEnvrn->Month) = timestepTimeStamp; + state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; + state.dataOutRptTab->MonthlyColumns(scanColumn).timeStamp(state.dataEnvrn->Month) = timestepTimeStamp; } } else if (SELECT_CASE_var == iAggType::MinimumDuringHoursShown) { - if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (state.dataOutRptTab->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { scanValue /= (TimeStepSys * DataGlobalConstants::SecInHour); } else { @@ -3875,8 +3813,8 @@ namespace EnergyPlus::OutputReportTabular { } } if (scanValue < oldScanValue) { - MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; - MonthlyColumns(scanColumn).timeStamp(state.dataEnvrn->Month) = timestepTimeStamp; + state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; + state.dataOutRptTab->MonthlyColumns(scanColumn).timeStamp(state.dataEnvrn->Month) = timestepTimeStamp; } } else { // do nothing @@ -4662,12 +4600,12 @@ namespace EnergyPlus::OutputReportTabular { if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) return; // only add values over the HVAC timestep basis - if (GatherHeatGainReportfirstTime) { + if (state.dataOutRptTab->GatherHeatGainReportfirstTime) { radiantHeat.allocate(state.dataGlobal->NumOfZones); radiantCool.allocate(state.dataGlobal->NumOfZones); ATUHeat.allocate(state.dataGlobal->NumOfZones); ATUCool.allocate(state.dataGlobal->NumOfZones); - GatherHeatGainReportfirstTime = false; + state.dataOutRptTab->GatherHeatGainReportfirstTime = false; } // clear the radiant surface accumulation variables radiantHeat = 0.0; @@ -6390,17 +6328,17 @@ namespace EnergyPlus::OutputReportTabular { // loop through each input to get the name of the tables for (iInput = 1; iInput <= state.dataOutRptTab->MonthlyInputCount; ++iInput) { // loop through each report and - digitsShown = MonthlyInput(iInput).showDigits; - for (jTable = 1; jTable <= MonthlyInput(iInput).numTables; ++jTable) { - curTable = jTable + MonthlyInput(iInput).firstTable - 1; + digitsShown = state.dataOutRptTab->MonthlyInput(iInput).showDigits; + for (jTable = 1; jTable <= state.dataOutRptTab->MonthlyInput(iInput).numTables; ++jTable) { + curTable = jTable + state.dataOutRptTab->MonthlyInput(iInput).firstTable - 1; // first loop through and count how many 'columns' are defined // since max and min actually define two columns (the value // and the timestamp). columnUsedCount = 0; - for (kColumn = 1; kColumn <= MonthlyTables(curTable).numColumns; ++kColumn) { - curCol = kColumn + MonthlyTables(curTable).firstColumn - 1; + for (kColumn = 1; kColumn <= state.dataOutRptTab->MonthlyTables(curTable).numColumns; ++kColumn) { + curCol = kColumn + state.dataOutRptTab->MonthlyTables(curTable).firstColumn - 1; { - auto const SELECT_CASE_var(MonthlyColumns(curCol).aggType); + auto const SELECT_CASE_var(state.dataOutRptTab->MonthlyColumns(curCol).aggType); if ((SELECT_CASE_var == iAggType::SumOrAvg) || (SELECT_CASE_var == iAggType::ValueWhenMaxMin) || (SELECT_CASE_var == iAggType::HoursZero) || (SELECT_CASE_var == iAggType::HoursNonZero) || (SELECT_CASE_var == iAggType::HoursPositive) || (SELECT_CASE_var == iAggType::HoursNonPositive) || @@ -6418,53 +6356,53 @@ namespace EnergyPlus::OutputReportTabular { tableBody.allocate(columnUsedCount, 16); tableBody = ""; // set entire table to blank as default columnRecount = 0; - for (kColumn = 1; kColumn <= MonthlyTables(curTable).numColumns; ++kColumn) { - curCol = kColumn + MonthlyTables(curTable).firstColumn - 1; - curAggString = aggString.at(MonthlyColumns(curCol).aggType); + for (kColumn = 1; kColumn <= state.dataOutRptTab->MonthlyTables(curTable).numColumns; ++kColumn) { + curCol = kColumn + state.dataOutRptTab->MonthlyTables(curTable).firstColumn - 1; + curAggString = aggString.at(state.dataOutRptTab->MonthlyColumns(curCol).aggType); if (len(curAggString) > 0) { curAggString = " {" + stripped(curAggString) + '}'; } // do the unit conversions if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { - varNameWithUnits = MonthlyColumns(curCol).varName + unitEnumToStringBrackets(MonthlyColumns(curCol).units); + varNameWithUnits = state.dataOutRptTab->MonthlyColumns(curCol).varName + unitEnumToStringBrackets(state.dataOutRptTab->MonthlyColumns(curCol).units); LookupSItoIP(state, varNameWithUnits, indexUnitConv, curUnits); GetUnitConversion(state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); } else { // just do the Joule conversion // if units is in Joules, convert if specified - if (UtilityRoutines::SameString(unitEnumToString(MonthlyColumns(curCol).units), "J")) { + if (UtilityRoutines::SameString(unitEnumToString(state.dataOutRptTab->MonthlyColumns(curCol).units), "J")) { curUnits = energyUnitsString; curConversionFactor = energyUnitsConversionFactor; curConversionOffset = 0.0; } else { // if not joules don't perform conversion - curUnits = unitEnumToString(MonthlyColumns(curCol).units); + curUnits = unitEnumToString(state.dataOutRptTab->MonthlyColumns(curCol).units); curConversionFactor = 1.0; curConversionOffset = 0.0; } } { - auto const SELECT_CASE_var(MonthlyColumns(curCol).aggType); + auto const SELECT_CASE_var(state.dataOutRptTab->MonthlyColumns(curCol).aggType); if ((SELECT_CASE_var == iAggType::SumOrAvg) || (SELECT_CASE_var == iAggType::SumOrAverageHoursShown)) { ++columnRecount; // put in the name of the variable for the column - columnHead(columnRecount) = MonthlyColumns(curCol).varName + curAggString + " [" + curUnits + ']'; + columnHead(columnRecount) = state.dataOutRptTab->MonthlyColumns(curCol).varName + curAggString + " [" + curUnits + ']'; sumVal = 0.0; sumDuration = 0.0; minVal = storedMaxVal; maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { - if (MonthlyColumns(curCol).avgSum == + if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Averaged) { // if it is a average variable divide by duration - if (MonthlyColumns(curCol).duration(lMonth) != 0) { + if (state.dataOutRptTab->MonthlyColumns(curCol).duration(lMonth) != 0) { curVal = - ((MonthlyColumns(curCol).reslt(lMonth) / MonthlyColumns(curCol).duration(lMonth)) * curConversionFactor) + + ((state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth) / state.dataOutRptTab->MonthlyColumns(curCol).duration(lMonth)) * curConversionFactor) + curConversionOffset; } else { curVal = 0.0; } - sumVal += (MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + curConversionOffset; - sumDuration += MonthlyColumns(curCol).duration(lMonth); + sumVal += (state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + curConversionOffset; + sumDuration += state.dataOutRptTab->MonthlyColumns(curCol).duration(lMonth); } else { - curVal = (MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + curConversionOffset; + curVal = (state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + curConversionOffset; sumVal += curVal; } if (state.dataOutRptTab->IsMonthGathered(lMonth)) { @@ -6476,7 +6414,7 @@ namespace EnergyPlus::OutputReportTabular { } } // lMonth // add the summary to bottom - if (MonthlyColumns(curCol).avgSum == + if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Averaged) { // if it is a average variable divide by duration if (sumDuration > 0) { tableBody(columnRecount, 14) = RealToStr(sumVal / sumDuration, digitsShown); @@ -6498,12 +6436,12 @@ namespace EnergyPlus::OutputReportTabular { ++columnRecount; // put in the name of the variable for the column - columnHead(columnRecount) = MonthlyColumns(curCol).varName + curAggString + " [HOURS]"; + columnHead(columnRecount) = state.dataOutRptTab->MonthlyColumns(curCol).varName + curAggString + " [HOURS]"; sumVal = 0.0; minVal = storedMaxVal; maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { - curVal = MonthlyColumns(curCol).reslt(lMonth); + curVal = state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth); if (state.dataOutRptTab->IsMonthGathered(lMonth)) { tableBody(columnRecount, lMonth) = RealToStr(curVal, digitsShown); sumVal += curVal; @@ -6523,7 +6461,7 @@ namespace EnergyPlus::OutputReportTabular { } } else if (SELECT_CASE_var == iAggType::ValueWhenMaxMin) { ++columnRecount; - if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { + if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { curUnits += "/s"; } if (UtilityRoutines::SameString(curUnits, "J/s")) { @@ -6554,11 +6492,11 @@ namespace EnergyPlus::OutputReportTabular { curUnits = "ton"; curConversionFactor *= 3600.0; } - columnHead(columnRecount) = MonthlyColumns(curCol).varName + curAggString + " [" + curUnits + ']'; + columnHead(columnRecount) = state.dataOutRptTab->MonthlyColumns(curCol).varName + curAggString + " [" + curUnits + ']'; minVal = storedMaxVal; maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { - curVal = MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor + curConversionOffset; + curVal = state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor + curConversionOffset; if (state.dataOutRptTab->IsMonthGathered(lMonth)) { tableBody(columnRecount, lMonth) = RealToStr(curVal, digitsShown); if (curVal > maxVal) maxVal = curVal; @@ -6578,7 +6516,7 @@ namespace EnergyPlus::OutputReportTabular { (SELECT_CASE_var == iAggType::MaximumDuringHoursShown) || (SELECT_CASE_var == iAggType::MinimumDuringHoursShown)) { columnRecount += 2; // put in the name of the variable for the column - if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable curUnits += "/s"; } if (UtilityRoutines::SameString(curUnits, "J/s")) { @@ -6609,13 +6547,13 @@ namespace EnergyPlus::OutputReportTabular { curUnits = "ton"; curConversionFactor *= 3600.0; } - columnHead(columnRecount - 1) = MonthlyColumns(curCol).varName + curAggString + '[' + curUnits + ']'; - columnHead(columnRecount) = MonthlyColumns(curCol).varName + " {TIMESTAMP} "; + columnHead(columnRecount - 1) = state.dataOutRptTab->MonthlyColumns(curCol).varName + curAggString + '[' + curUnits + ']'; + columnHead(columnRecount) = state.dataOutRptTab->MonthlyColumns(curCol).varName + " {TIMESTAMP} "; minVal = storedMaxVal; maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { if (state.dataOutRptTab->IsMonthGathered(lMonth)) { - curVal = MonthlyColumns(curCol).reslt(lMonth); + curVal = state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth); // CR7788 the conversion factors were causing an overflow for the InchPound case since the // value was very small // restructured the following lines to hide showing HUGE and -HUGE values in output table CR8154 Glazer @@ -6628,7 +6566,7 @@ namespace EnergyPlus::OutputReportTabular { } else { tableBody(columnRecount - 1, lMonth) = "-"; } - tableBody(columnRecount, lMonth) = DateToString(MonthlyColumns(curCol).timeStamp(lMonth)); + tableBody(columnRecount, lMonth) = DateToString(state.dataOutRptTab->MonthlyColumns(curCol).timeStamp(lMonth)); } else { tableBody(columnRecount - 1, lMonth) = "-"; tableBody(columnRecount, lMonth) = "-"; @@ -6653,16 +6591,16 @@ namespace EnergyPlus::OutputReportTabular { } } } // KColumn - WriteReportHeaders(state, MonthlyInput(iInput).name, MonthlyTables(curTable).keyValue, OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, state.dataOutRptTab->MonthlyInput(iInput).name, state.dataOutRptTab->MonthlyTables(curTable).keyValue, OutputProcessor::StoreType::Averaged); WriteSubtitle(state, "Custom Monthly Report"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth, true); // transpose monthly XML tables. if (sqlite) { sqlite->createSQLiteTabularDataRecords( - tableBody, rowHead, columnHead, MonthlyInput(iInput).name, MonthlyTables(curTable).keyValue, "Custom Monthly Report"); + tableBody, rowHead, columnHead, state.dataOutRptTab->MonthlyInput(iInput).name, state.dataOutRptTab->MonthlyTables(curTable).keyValue, "Custom Monthly Report"); } if (ResultsFramework::resultsFramework->timeSeriesAndTabularEnabled()) { ResultsFramework::resultsFramework->TabularReportsCollection.addReportTable( - tableBody, rowHead, columnHead, MonthlyInput(iInput).name, MonthlyTables(curTable).keyValue, "Custom Monthly Report"); + tableBody, rowHead, columnHead, state.dataOutRptTab->MonthlyInput(iInput).name, state.dataOutRptTab->MonthlyTables(curTable).keyValue, "Custom Monthly Report"); } } // jTables } // iInput @@ -6763,20 +6701,20 @@ namespace EnergyPlus::OutputReportTabular { rowHead(38) = "11:01 to 12:00 am"; rowHead(39) = "Total"; for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { - firstReport = OutputTableBinned(iInObj).resIndex; - curNameWithSIUnits = OutputTableBinned(iInObj).varOrMeter + unitEnumToStringBrackets(OutputTableBinned(iInObj).units); + firstReport = state.dataOutRptTab->OutputTableBinned(iInObj).resIndex; + curNameWithSIUnits = state.dataOutRptTab->OutputTableBinned(iInObj).varOrMeter + unitEnumToStringBrackets(state.dataOutRptTab->OutputTableBinned(iInObj).units); if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); - curIntervalStart = ConvertIP(state, indexUnitConv, OutputTableBinned(iInObj).intervalStart); - curIntervalSize = ConvertIPdelta(state, indexUnitConv, OutputTableBinned(iInObj).intervalSize); + curIntervalStart = ConvertIP(state, indexUnitConv, state.dataOutRptTab->OutputTableBinned(iInObj).intervalStart); + curIntervalSize = ConvertIPdelta(state, indexUnitConv, state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize); } else { curNameAndUnits = curNameWithSIUnits; - curIntervalStart = OutputTableBinned(iInObj).intervalStart; - curIntervalSize = OutputTableBinned(iInObj).intervalSize; + curIntervalStart = state.dataOutRptTab->OutputTableBinned(iInObj).intervalStart; + curIntervalSize = state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize; } - curIntervalCount = OutputTableBinned(iInObj).intervalCount; - curResIndex = OutputTableBinned(iInObj).resIndex; - curNumTables = OutputTableBinned(iInObj).numTables; + curIntervalCount = state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount; + curResIndex = state.dataOutRptTab->OutputTableBinned(iInObj).resIndex; + curNumTables = state.dataOutRptTab->OutputTableBinned(iInObj).numTables; topValue = curIntervalStart + curIntervalSize * curIntervalCount; if (curIntervalSize < 1) { numIntervalDigits = 4; @@ -6807,32 +6745,32 @@ namespace EnergyPlus::OutputReportTabular { tableBody(curIntervalCount + 3, 2) = "Total"; for (iTable = 1; iTable <= curNumTables; ++iTable) { repIndex = firstReport + (iTable - 1); - if (OutputTableBinned(iInObj).scheduleIndex == 0) { + if (state.dataOutRptTab->OutputTableBinned(iInObj).scheduleIndex == 0) { repNameWithUnitsandscheduleName = curNameAndUnits; } else { - repNameWithUnitsandscheduleName = curNameAndUnits + " [" + OutputTableBinned(iInObj).ScheduleName + ']'; + repNameWithUnitsandscheduleName = curNameAndUnits + " [" + state.dataOutRptTab->OutputTableBinned(iInObj).ScheduleName + ']'; } - WriteReportHeaders(state, repNameWithUnitsandscheduleName, BinObjVarID(repIndex).namesOfObj, OutputTableBinned(iInObj).avgSum); + WriteReportHeaders(state, repNameWithUnitsandscheduleName, state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj, state.dataOutRptTab->OutputTableBinned(iInObj).avgSum); for (kHour = 1; kHour <= 24; ++kHour) { - tableBody(1, 14 + kHour) = RealToStr(BinResultsBelow(repIndex).hrly(kHour), 2); - tableBody(curIntervalCount + 2, 14 + kHour) = RealToStr(BinResultsAbove(repIndex).hrly(kHour), 2); - rowTotal = BinResultsBelow(repIndex).hrly(kHour) + BinResultsAbove(repIndex).hrly(kHour); + tableBody(1, 14 + kHour) = RealToStr(state.dataOutRptTab->BinResultsBelow(repIndex).hrly(kHour), 2); + tableBody(curIntervalCount + 2, 14 + kHour) = RealToStr(state.dataOutRptTab->BinResultsAbove(repIndex).hrly(kHour), 2); + rowTotal = state.dataOutRptTab->BinResultsBelow(repIndex).hrly(kHour) + state.dataOutRptTab->BinResultsAbove(repIndex).hrly(kHour); for (nCol = 1; nCol <= curIntervalCount; ++nCol) { - tableBody(nCol + 1, 14 + kHour) = RealToStr(BinResults(nCol, repIndex).hrly(kHour), 2); + tableBody(nCol + 1, 14 + kHour) = RealToStr(state.dataOutRptTab->BinResults(nCol, repIndex).hrly(kHour), 2); // sum the total for all columns - rowTotal += BinResults(nCol, repIndex).hrly(kHour); + rowTotal += state.dataOutRptTab->BinResults(nCol, repIndex).hrly(kHour); } tableBody(nCol + 2, 14 + kHour) = RealToStr(rowTotal, 2); } tableTotal = 0.0; for (kMonth = 1; kMonth <= 12; ++kMonth) { - tableBody(1, 2 + kMonth) = RealToStr(BinResultsBelow(repIndex).mnth(kMonth), 2); - tableBody(curIntervalCount + 2, 2 + kMonth) = RealToStr(BinResultsAbove(repIndex).mnth(kMonth), 2); - rowTotal = BinResultsBelow(repIndex).mnth(kMonth) + BinResultsAbove(repIndex).mnth(kMonth); + tableBody(1, 2 + kMonth) = RealToStr(state.dataOutRptTab->BinResultsBelow(repIndex).mnth(kMonth), 2); + tableBody(curIntervalCount + 2, 2 + kMonth) = RealToStr(state.dataOutRptTab->BinResultsAbove(repIndex).mnth(kMonth), 2); + rowTotal = state.dataOutRptTab->BinResultsBelow(repIndex).mnth(kMonth) + state.dataOutRptTab->BinResultsAbove(repIndex).mnth(kMonth); for (nCol = 1; nCol <= curIntervalCount; ++nCol) { - tableBody(nCol + 1, 2 + kMonth) = RealToStr(BinResults(nCol, repIndex).mnth(kMonth), 2); + tableBody(nCol + 1, 2 + kMonth) = RealToStr(state.dataOutRptTab->BinResults(nCol, repIndex).mnth(kMonth), 2); // sum the total for all columns - rowTotal += BinResults(nCol, repIndex).mnth(kMonth); + rowTotal += state.dataOutRptTab->BinResults(nCol, repIndex).mnth(kMonth); } tableBody(nCol + 2, 2 + kMonth) = RealToStr(rowTotal, 2); tableTotal += rowTotal; @@ -6841,15 +6779,15 @@ namespace EnergyPlus::OutputReportTabular { for (nCol = 1; nCol <= curIntervalCount; ++nCol) { colTotal = 0.0; for (kMonth = 1; kMonth <= 12; ++kMonth) { - colTotal += BinResults(nCol, repIndex).mnth(kMonth); + colTotal += state.dataOutRptTab->BinResults(nCol, repIndex).mnth(kMonth); } tableBody(nCol + 1, 39) = RealToStr(colTotal, 2); } aboveTotal = 0.0; belowTotal = 0.0; for (kMonth = 1; kMonth <= 12; ++kMonth) { - aboveTotal += BinResultsAbove(repIndex).mnth(kMonth); - belowTotal += BinResultsBelow(repIndex).mnth(kMonth); + aboveTotal += state.dataOutRptTab->BinResultsAbove(repIndex).mnth(kMonth); + belowTotal += state.dataOutRptTab->BinResultsBelow(repIndex).mnth(kMonth); } tableBody(1, 39) = RealToStr(belowTotal, 2); tableBody(curIntervalCount + 2, 39) = RealToStr(aboveTotal, 2); @@ -6860,11 +6798,11 @@ namespace EnergyPlus::OutputReportTabular { WriteTable(state, tableBody, rowHead, columnHead, columnWidth, true); // transpose XML tables if (sqlite) { sqlite->createSQLiteTabularDataRecords( - tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, BinObjVarID(repIndex).namesOfObj, "Time Bin Results"); + tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj, "Time Bin Results"); } if (ResultsFramework::resultsFramework->timeSeriesAndTabularEnabled()) { ResultsFramework::resultsFramework->TabularReportsCollection.addReportTable( - tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, BinObjVarID(repIndex).namesOfObj, "Time Bin Results"); + tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj, "Time Bin Results"); } // create statistics table rowHeadStat(1) = "Minimum"; @@ -6877,42 +6815,42 @@ namespace EnergyPlus::OutputReportTabular { columnWidthStat(1) = 14; // per Applied Regression Analysis and Other Multivariate Methods, Kleinburger/Kupper, 1978 // first check if very large constant number has caused the second part to be larger than the first - if (BinStatistics(repIndex).n > 1) { - if (BinStatistics(repIndex).sum2 > (pow_2(BinStatistics(repIndex).sum) / BinStatistics(repIndex).n)) { - repStDev = std::sqrt((BinStatistics(repIndex).sum2 - (pow_2(BinStatistics(repIndex).sum) / BinStatistics(repIndex).n)) / - (BinStatistics(repIndex).n - 1)); + if (state.dataOutRptTab->BinStatistics(repIndex).n > 1) { + if (state.dataOutRptTab->BinStatistics(repIndex).sum2 > (pow_2(state.dataOutRptTab->BinStatistics(repIndex).sum) / state.dataOutRptTab->BinStatistics(repIndex).n)) { + repStDev = std::sqrt((state.dataOutRptTab->BinStatistics(repIndex).sum2 - (pow_2(state.dataOutRptTab->BinStatistics(repIndex).sum) / state.dataOutRptTab->BinStatistics(repIndex).n)) / + (state.dataOutRptTab->BinStatistics(repIndex).n - 1)); } else { repStDev = 0.0; } - repMean = BinStatistics(repIndex).sum / BinStatistics(repIndex).n; + repMean = state.dataOutRptTab->BinStatistics(repIndex).sum / state.dataOutRptTab->BinStatistics(repIndex).n; } else { repStDev = 0.0; repMean = 0.0; } if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { - tableBodyStat(1, 1) = RealToStr(ConvertIP(state, indexUnitConv, BinStatistics(repIndex).minimum), 2); + tableBodyStat(1, 1) = RealToStr(ConvertIP(state, indexUnitConv, state.dataOutRptTab->BinStatistics(repIndex).minimum), 2); tableBodyStat(1, 2) = RealToStr(ConvertIP(state, indexUnitConv, repMean - 2 * repStDev), 2); tableBodyStat(1, 3) = RealToStr(ConvertIP(state, indexUnitConv, repMean), 2); tableBodyStat(1, 4) = RealToStr(ConvertIP(state, indexUnitConv, repMean + 2 * repStDev), 2); - tableBodyStat(1, 5) = RealToStr(ConvertIP(state, indexUnitConv, BinStatistics(repIndex).maximum), 2); + tableBodyStat(1, 5) = RealToStr(ConvertIP(state, indexUnitConv, state.dataOutRptTab->BinStatistics(repIndex).maximum), 2); tableBodyStat(1, 6) = RealToStr(ConvertIPdelta(state, indexUnitConv, repStDev), 2); } else { - tableBodyStat(1, 1) = RealToStr(BinStatistics(repIndex).minimum, 2); + tableBodyStat(1, 1) = RealToStr(state.dataOutRptTab->BinStatistics(repIndex).minimum, 2); tableBodyStat(1, 2) = RealToStr(repMean - 2 * repStDev, 2); tableBodyStat(1, 3) = RealToStr(repMean, 2); tableBodyStat(1, 4) = RealToStr(repMean + 2 * repStDev, 2); - tableBodyStat(1, 5) = RealToStr(BinStatistics(repIndex).maximum, 2); + tableBodyStat(1, 5) = RealToStr(state.dataOutRptTab->BinStatistics(repIndex).maximum, 2); tableBodyStat(1, 6) = RealToStr(repStDev, 2); } WriteSubtitle(state, "Statistics"); WriteTable(state, tableBodyStat, rowHeadStat, columnHeadStat, columnWidthStat, true); // transpose XML table if (sqlite) { sqlite->createSQLiteTabularDataRecords( - tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, BinObjVarID(repIndex).namesOfObj, "Statistics"); + tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj, "Statistics"); } if (ResultsFramework::resultsFramework->timeSeriesAndTabularEnabled()) { ResultsFramework::resultsFramework->TabularReportsCollection.addReportTable( - tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, BinObjVarID(repIndex).namesOfObj, "Statistics"); + tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj, "Statistics"); } } } @@ -10572,13 +10510,13 @@ namespace EnergyPlus::OutputReportTabular { for (i = 1; i <= TotPeople; ++i) { if (People(i).AdaptiveASH55 || People(i).AdaptiveCEN15251) { - ++numPeopleAdaptive; - peopleInd(numPeopleAdaptive) = i; + ++state.dataOutRptTab->numPeopleAdaptive; + peopleInd(state.dataOutRptTab->numPeopleAdaptive) = i; } } - rowHead.allocate(numPeopleAdaptive); - tableBody.allocate(5, numPeopleAdaptive); + rowHead.allocate(state.dataOutRptTab->numPeopleAdaptive); + tableBody.allocate(5, state.dataOutRptTab->numPeopleAdaptive); WriteReportHeaders(state, "Adaptive Comfort Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); WriteSubtitle(state, "Time Not Meeting the Adaptive Comfort Models during Occupied Hours"); @@ -10592,7 +10530,7 @@ namespace EnergyPlus::OutputReportTabular { columnHead(5) = "CEN15251 Category III Acceptability Limits [Hours]"; tableBody = ""; - for (i = 1; i <= numPeopleAdaptive; ++i) { + for (i = 1; i <= state.dataOutRptTab->numPeopleAdaptive; ++i) { rowHead(i) = People(i).Name; if (People(i).AdaptiveASH55) { tableBody(1, i) = RealToStr(People(peopleInd(i)).TimeNotMetASH5590, 2); @@ -11700,7 +11638,7 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - if (AllocateLoadComponentArraysDoAllocate) { + if (state.dataOutRptTab->AllocateLoadComponentArraysDoAllocate) { // For many of the following arrays the last dimension is the number of environments and is same as sizing arrays state.dataOutRptTab->radiantPulseTimestep.allocate({0, state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays}, state.dataGlobal->NumOfZones); state.dataOutRptTab->radiantPulseTimestep = 0; @@ -11774,7 +11712,7 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptTab->feneCondInstantSeq = 0.0; state.dataOutRptTab->feneSolarRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); state.dataOutRptTab->feneSolarRadSeq = 0.0; - AllocateLoadComponentArraysDoAllocate = false; + state.dataOutRptTab->AllocateLoadComponentArraysDoAllocate = false; } } @@ -12759,10 +12697,10 @@ namespace EnergyPlus::OutputReportTabular { // static bool initAdjFenDone(false); moved to anonymous namespace for unit testing static Array3D_bool adjFenDone; - if (!initAdjFenDone) { + if (!state.dataOutRptTab->initAdjFenDone) { adjFenDone.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); adjFenDone = false; - initAdjFenDone = true; + state.dataOutRptTab->initAdjFenDone = true; } int radEnclosureNum = Zone(zoneIndex).RadiantEnclosureNum; @@ -13881,20 +13819,20 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << " " << std::setw(2) << state.dataOutRptTab->td(5) << ':' << std::setw(2) << state.dataOutRptTab->td(6) << ':' << std::setw(2) << state.dataOutRptTab->td(7) << std::setfill(' ') << "

\n"; } else if (style == iTableStyle::XML) { - if (len(prevReportName) != 0) { - tbl_stream << "\n"; // close the last element if it was used. + if (len(state.dataOutRptTab->prevReportName) != 0) { + tbl_stream << "prevReportName << ">\n"; // close the last element if it was used. } tbl_stream << "<" << ConvertToElementTag(modifiedReportName) << ">\n"; tbl_stream << " " << objectName << "\n"; - prevReportName = ConvertToElementTag(modifiedReportName); // save the name for next time + state.dataOutRptTab->prevReportName = ConvertToElementTag(modifiedReportName); // save the name for next time } } // clear the active subtable name for the XML reporting - activeSubTableName = ""; + state.dataOutRptTab->activeSubTableName = ""; // save the report name if the subtable name is not available during XML processing - activeReportName = modifiedReportName; + state.dataOutRptTab->activeReportName = modifiedReportName; // save the "for" which is the object name in the report for HTML comment that contains the report, for, and subtable - activeForName = objectName; + state.dataOutRptTab->activeForName = objectName; } void WriteSubtitle(EnergyPlusData &state, std::string const &subtitle) @@ -13930,10 +13868,10 @@ namespace EnergyPlus::OutputReportTabular { } else if (style == iTableStyle::HTML) { std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); tbl_stream << "" << subtitle << "

\n"; - tbl_stream << "\n"; + tbl_stream << "\n"; } else if (style == iTableStyle::XML) { // save the active subtable name for the XML reporting - activeSubTableName = subtitle; + state.dataOutRptTab->activeSubTableName = subtitle; // no other output is needed since WriteTable uses the subtable name for each record. } } @@ -14266,14 +14204,14 @@ namespace EnergyPlus::OutputReportTabular { // if non-blank cells in the table body were found create the table. if (!isTableBlank) { // if report name and subtable name the same add "record" to the end - activeSubTableName = ConvertToElementTag(activeSubTableName); - activeReportNameNoSpace = ConvertToElementTag(activeReportName); - if (UtilityRoutines::SameString(activeSubTableName, activeReportNameNoSpace)) { - activeSubTableName += "Record"; + state.dataOutRptTab->activeSubTableName = ConvertToElementTag(state.dataOutRptTab->activeSubTableName); + state.dataOutRptTab->activeReportNameNoSpace = ConvertToElementTag(state.dataOutRptTab->activeReportName); + if (UtilityRoutines::SameString(state.dataOutRptTab->activeSubTableName, state.dataOutRptTab->activeReportNameNoSpace)) { + state.dataOutRptTab->activeSubTableName += "Record"; } // if no subtable name use the report name and add "record" to the end - if (len(activeSubTableName) == 0) { - activeSubTableName = activeReportNameNoSpace + "Record"; + if (len(state.dataOutRptTab->activeSubTableName) == 0) { + state.dataOutRptTab->activeSubTableName = state.dataOutRptTab->activeReportNameNoSpace + "Record"; } // if a single column table, transpose it automatically if ((colsBody == 1) && (rowsBody > 1)) { @@ -14318,7 +14256,7 @@ namespace EnergyPlus::OutputReportTabular { } } if (!isRecordBlank) { - tbl_stream << " <" << activeSubTableName << ">\n"; + tbl_stream << " <" << state.dataOutRptTab->activeSubTableName << ">\n"; if (len(rowLabelTags(jRow)) > 0) { tbl_stream << " " << rowLabelTags(jRow) << "\n"; } @@ -14335,7 +14273,7 @@ namespace EnergyPlus::OutputReportTabular { << ">\n"; } } - tbl_stream << " \n"; + tbl_stream << " activeSubTableName << ">\n"; } } } else { // transpose XML table @@ -14350,7 +14288,7 @@ namespace EnergyPlus::OutputReportTabular { } } if (!isRecordBlank) { - tbl_stream << " <" << activeSubTableName << ">\n"; + tbl_stream << " <" << state.dataOutRptTab->activeSubTableName << ">\n"; // if the column has units put them into the name tag if (len(columnLabelTags(iCol)) > 0) { if (len(columnUnitStrings(iCol)) > 0) { @@ -14372,7 +14310,7 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << " " << tagWithAttrib << stripped(bodyEsc(iCol, jRow)) << "\n"; } } - tbl_stream << " \n"; + tbl_stream << " activeSubTableName << ">\n"; } } } @@ -14753,7 +14691,7 @@ namespace EnergyPlus::OutputReportTabular { state.dataOutRptTab->gatherElapsedTimeBEPS = 0.0; ResetMonthlyGathering(state); OutputReportTabularAnnual::ResetAnnualGathering(); - ResetBinGathering(); + ResetBinGathering(state); ResetBEPSGathering(state); ResetSourceEnergyEndUseGathering(state); ResetPeakDemandGathering(state); @@ -14778,25 +14716,25 @@ namespace EnergyPlus::OutputReportTabular { static Real64 BigNum(0.0); for (iInput = 1; iInput <= state.dataOutRptTab->MonthlyInputCount; ++iInput) { - for (jTable = 1; jTable <= MonthlyInput(iInput).numTables; ++jTable) { - curTable = jTable + MonthlyInput(iInput).firstTable - 1; - for (kColumn = 1; kColumn <= MonthlyTables(curTable).numColumns; ++kColumn) { - curCol = kColumn + MonthlyTables(curTable).firstColumn - 1; - MonthlyColumns(curCol).timeStamp = 0; - MonthlyColumns(curCol).duration = 0.0; - if (MonthlyColumns(curCol).aggType == iAggType::Maximum || MonthlyColumns(curCol).aggType == iAggType::MaximumDuringHoursShown) { - MonthlyColumns(curCol).reslt = -HUGE_(BigNum); - } else if (MonthlyColumns(curCol).aggType == iAggType::Minimum || MonthlyColumns(curCol).aggType == iAggType::MinimumDuringHoursShown) { - MonthlyColumns(curCol).reslt = HUGE_(BigNum); + for (jTable = 1; jTable <= state.dataOutRptTab->MonthlyInput(iInput).numTables; ++jTable) { + curTable = jTable + state.dataOutRptTab->MonthlyInput(iInput).firstTable - 1; + for (kColumn = 1; kColumn <= state.dataOutRptTab->MonthlyTables(curTable).numColumns; ++kColumn) { + curCol = kColumn + state.dataOutRptTab->MonthlyTables(curTable).firstColumn - 1; + state.dataOutRptTab->MonthlyColumns(curCol).timeStamp = 0; + state.dataOutRptTab->MonthlyColumns(curCol).duration = 0.0; + if (state.dataOutRptTab->MonthlyColumns(curCol).aggType == iAggType::Maximum || state.dataOutRptTab->MonthlyColumns(curCol).aggType == iAggType::MaximumDuringHoursShown) { + state.dataOutRptTab->MonthlyColumns(curCol).reslt = -HUGE_(BigNum); + } else if (state.dataOutRptTab->MonthlyColumns(curCol).aggType == iAggType::Minimum || state.dataOutRptTab->MonthlyColumns(curCol).aggType == iAggType::MinimumDuringHoursShown) { + state.dataOutRptTab->MonthlyColumns(curCol).reslt = HUGE_(BigNum); } else { - MonthlyColumns(curCol).reslt = 0.0; + state.dataOutRptTab->MonthlyColumns(curCol).reslt = 0.0; } } } } } - void ResetBinGathering() + void ResetBinGathering(EnergyPlusData &state) { // Jason Glazer - October 2015 // Reset all timebins gathering arrays to zero for multi-year simulations @@ -14804,21 +14742,21 @@ namespace EnergyPlus::OutputReportTabular { Real64 const bigVal(0.0); // used with HUGE: Value doesn't matter, only type: Initialize so compiler doesn't warn about use uninitialized // clear the binning arrays to zeros - for (auto &e : BinResults) { + for (auto &e : state.dataOutRptTab->BinResults) { e.mnth = 0.0; e.hrly = 0.0; } - for (auto &e : BinResultsBelow) { + for (auto &e : state.dataOutRptTab->BinResultsBelow) { e.mnth = 0.0; e.hrly = 0.0; } - for (auto &e : BinResultsAbove) { + for (auto &e : state.dataOutRptTab->BinResultsAbove) { e.mnth = 0.0; e.hrly = 0.0; } // re-initialize statistics counters - for (auto &e : BinStatistics) { + for (auto &e : state.dataOutRptTab->BinStatistics) { e.minimum = HUGE_(bigVal); e.maximum = -HUGE_(bigVal); e.n = 0; @@ -15402,19 +15340,19 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na - if (!allocated(TOCEntries)) { + if (!allocated(state.dataOutRptTab->TOCEntries)) { state.dataOutRptTab->TOCEntriesSize = 20; - TOCEntries.allocate(state.dataOutRptTab->TOCEntriesSize); + state.dataOutRptTab->TOCEntries.allocate(state.dataOutRptTab->TOCEntriesSize); state.dataOutRptTab->TOCEntriesCount = 1; } else { ++state.dataOutRptTab->TOCEntriesCount; // if larger than current size grow the array if (state.dataOutRptTab->TOCEntriesCount > state.dataOutRptTab->TOCEntriesSize) { - TOCEntries.redimension(state.dataOutRptTab->TOCEntriesSize += 20); + state.dataOutRptTab->TOCEntries.redimension(state.dataOutRptTab->TOCEntriesSize += 20); } } - TOCEntries(state.dataOutRptTab->TOCEntriesCount).reportName = nameReport; - TOCEntries(state.dataOutRptTab->TOCEntriesCount).sectionName = nameSection; + state.dataOutRptTab->TOCEntries(state.dataOutRptTab->TOCEntriesCount).reportName = nameReport; + state.dataOutRptTab->TOCEntries(state.dataOutRptTab->TOCEntriesCount).sectionName = nameSection; } void SetupUnitConversions(EnergyPlusData &state) @@ -15451,426 +15389,426 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na state.dataOutRptTab->UnitConvSize = 115; - UnitConv.allocate(state.dataOutRptTab->UnitConvSize); - UnitConv(1).siName = "%"; - UnitConv(2).siName = "°C"; - UnitConv(3).siName = "0=OFF 1=ON"; - UnitConv(4).siName = "0-NO 1-YES"; - UnitConv(5).siName = "1-YES 0-NO"; - UnitConv(6).siName = "A"; - UnitConv(7).siName = "ACH"; - UnitConv(8).siName = "ACH"; - UnitConv(9).siName = "BASE 10C"; - UnitConv(10).siName = "BASE 18C"; - UnitConv(11).siName = "C"; - UnitConv(12).siName = "CD/M2"; - UnitConv(13).siName = "DEG"; - UnitConv(14).siName = "FRAC"; - UnitConv(15).siName = "HOUR"; - UnitConv(16).siName = "HOURS"; - UnitConv(17).siName = "HR"; - UnitConv(18).siName = "HRS"; - UnitConv(19).siName = "J"; - UnitConv(20).siName = "J"; - UnitConv(21).siName = "J"; - UnitConv(22).siName = "J"; - UnitConv(23).siName = "J"; - UnitConv(24).siName = "J"; - UnitConv(25).siName = "J/KG"; - UnitConv(26).siName = "J/KGWATER"; - UnitConv(27).siName = "J/M2"; - UnitConv(28).siName = "K/M"; - UnitConv(29).siName = "KG"; - UnitConv(30).siName = "KG/KG"; - UnitConv(31).siName = "KG/M3"; - UnitConv(32).siName = "KG/S"; - UnitConv(33).siName = "KGWATER/KGDRYAIR"; - UnitConv(34).siName = "KGWATER/SEC"; - UnitConv(35).siName = "KMOL/S"; - UnitConv(36).siName = "KMOL/SEC"; - UnitConv(37).siName = "KWH"; - UnitConv(38).siName = "L"; - UnitConv(39).siName = "L"; - UnitConv(40).siName = "LUM/W"; - UnitConv(41).siName = "LUX"; - UnitConv(42).siName = "M"; - UnitConv(43).siName = "M"; - UnitConv(44).siName = "M/S"; - UnitConv(45).siName = "M/S"; - UnitConv(46).siName = "M2"; - UnitConv(47).siName = "M2/PERSON"; - UnitConv(48).siName = "M3"; - UnitConv(49).siName = "M3"; - UnitConv(50).siName = "M3/M2"; - UnitConv(51).siName = "M3/S"; - UnitConv(52).siName = "M3/S"; - UnitConv(53).siName = "M3/S-M2"; - UnitConv(54).siName = "M3/S-PERSON"; - UnitConv(55).siName = "M3/S-PERSON"; - UnitConv(56).siName = "PA"; - UnitConv(57).siName = "PA"; - UnitConv(58).siName = "PA"; - UnitConv(59).siName = "PA"; - UnitConv(60).siName = "PA"; - UnitConv(61).siName = "PA"; - UnitConv(62).siName = "PA"; - UnitConv(63).siName = "PA"; - UnitConv(64).siName = "S"; - UnitConv(65).siName = "V"; - UnitConv(66).siName = "W"; - UnitConv(67).siName = "W"; - UnitConv(68).siName = "W"; - UnitConv(69).siName = "W"; - UnitConv(70).siName = "W"; - UnitConv(71).siName = "W/KG"; - UnitConv(72).siName = "W/KG H2O"; // TODO: replace with W/kgWater? or rather just remove - UnitConv(73).siName = "W/K"; - UnitConv(74).siName = "W/M2"; - UnitConv(75).siName = "W/M2"; - UnitConv(76).siName = "W/M2-C"; - UnitConv(77).siName = "W/M2-K"; - UnitConv(78).siName = "W/W"; - UnitConv(79).siName = "W/W"; - UnitConv(80).siName = "deltaC"; - UnitConv(81).siName = "KJ/KG"; - UnitConv(82).siName = "W-S/M3"; - UnitConv(83).siName = "W-S/M3"; - UnitConv(84).siName = "~~$~~/m2"; - UnitConv(85).siName = "GJ"; - UnitConv(86).siName = "GJ"; - UnitConv(87).siName = "GJ"; - UnitConv(88).siName = "GJ"; - UnitConv(89).siName = "GJ"; - UnitConv(90).siName = "GJ"; - UnitConv(91).siName = "GJ"; - UnitConv(92).siName = "MJ/m2"; - UnitConv(93).siName = "MJ/m2"; - UnitConv(94).siName = "MJ/m2"; - UnitConv(95).siName = "MJ/m2"; - UnitConv(96).siName = "Invalid/Undefined"; - UnitConv(97).siName = ""; - UnitConv(98).siName = "W/C"; - UnitConv(99).siName = "DAY"; - UnitConv(100).siName = "MIN"; - UnitConv(101).siName = "HR/WK"; - UnitConv(102).siName = "$"; - UnitConv(103).siName = "$/UNIT ENERGY"; - UnitConv(104).siName = "KW"; - UnitConv(105).siName = " "; - UnitConv(106).siName = "AH"; - UnitConv(107).siName = "CLO"; - UnitConv(108).siName = "J/KG-K"; - UnitConv(109).siName = "KGWATER/S"; - UnitConv(110).siName = "PPM"; - UnitConv(111).siName = "RAD"; - UnitConv(112).siName = "REV/MIN"; - UnitConv(113).siName = "NM"; - UnitConv(114).siName = "BTU/W-H"; // Used for AHRI rating metrics (e.g. SEER) - UnitConv(115).siName = "PERSON/M2"; - - UnitConv(1).ipName = "%"; - UnitConv(2).ipName = "F"; - UnitConv(3).ipName = "0=Off 1=On"; - UnitConv(4).ipName = "0-No 1-Yes"; - UnitConv(5).ipName = "1-Yes 0-No"; - UnitConv(6).ipName = "A"; - UnitConv(7).ipName = "ACH"; - UnitConv(8).ipName = "ach"; - UnitConv(9).ipName = "base 50F"; - UnitConv(10).ipName = "base 65F"; - UnitConv(11).ipName = "F"; - UnitConv(12).ipName = "cd/in2"; - UnitConv(13).ipName = "deg"; - UnitConv(14).ipName = "Frac"; - UnitConv(15).ipName = "Hour"; - UnitConv(16).ipName = "Hours"; - UnitConv(17).ipName = "hr"; - UnitConv(18).ipName = "hrs"; - UnitConv(19).ipName = "kBtu"; - UnitConv(20).ipName = "kWh"; - UnitConv(21).ipName = "therm"; - UnitConv(22).ipName = "MMBtu"; - UnitConv(23).ipName = "Wh"; - UnitConv(24).ipName = "ton-hrs"; - UnitConv(25).ipName = "Btu/lb"; - UnitConv(26).ipName = "Btu/lbWater"; - UnitConv(27).ipName = "kBtu/sqft"; - UnitConv(28).ipName = "F/ft"; - UnitConv(29).ipName = "lb"; - UnitConv(30).ipName = "lb/lb"; - UnitConv(31).ipName = "lb/ft3"; - UnitConv(32).ipName = "lb/s"; - UnitConv(33).ipName = "lbWater/lbDryAir"; - UnitConv(34).ipName = "lbWater/s"; - UnitConv(35).ipName = "kmol/s"; - UnitConv(36).ipName = "kmol/sec"; - UnitConv(37).ipName = "kWh"; - UnitConv(38).ipName = "gal"; - UnitConv(39).ipName = "ft3"; - UnitConv(40).ipName = "lum/W"; - UnitConv(41).ipName = "foot-candles"; - UnitConv(42).ipName = "ft"; - UnitConv(43).ipName = "in"; - UnitConv(44).ipName = "ft/min"; - UnitConv(45).ipName = "miles/hr"; - UnitConv(46).ipName = "ft2"; - UnitConv(47).ipName = "ft2/person"; - UnitConv(48).ipName = "ft3"; - UnitConv(49).ipName = "gal"; - UnitConv(50).ipName = "f3/f2"; - UnitConv(51).ipName = "ft3/min"; - UnitConv(52).ipName = "gal/min"; - UnitConv(53).ipName = "ft3/min-ft2"; - UnitConv(54).ipName = "ft3/min-person"; - UnitConv(55).ipName = "gal/min-person"; - UnitConv(56).ipName = "psi"; - UnitConv(57).ipName = "inHg"; - UnitConv(58).ipName = "inH2O"; - UnitConv(59).ipName = "ftH2O"; - UnitConv(60).ipName = "psi"; - UnitConv(61).ipName = "inHg"; - UnitConv(62).ipName = "inH2O"; - UnitConv(63).ipName = "ftH2O"; - UnitConv(64).ipName = "s"; - UnitConv(65).ipName = "V"; - UnitConv(66).ipName = "Btu/h"; - UnitConv(67).ipName = "W"; - UnitConv(68).ipName = "kW"; - UnitConv(69).ipName = "kBtuh"; - UnitConv(70).ipName = "ton"; - UnitConv(71).ipName = "kBtuh/lb"; - UnitConv(72).ipName = "kBtuh/lb"; - UnitConv(73).ipName = "Btu/h-F"; - UnitConv(74).ipName = "Btu/h-ft2"; - UnitConv(75).ipName = "kBtuh/ft2"; - UnitConv(76).ipName = "Btu/h-ft2-F"; - UnitConv(77).ipName = "Btu/h-ft2-F"; - UnitConv(78).ipName = "Btuh/Btuh"; - UnitConv(79).ipName = "W/W"; - UnitConv(80).ipName = "deltaF"; - UnitConv(81).ipName = "Btu/lb"; - UnitConv(82).ipName = "W-min/ft3"; - UnitConv(83).ipName = "W-min/gal"; - UnitConv(84).ipName = "~~$~~/ft2"; - UnitConv(85).ipName = "kBtu"; - UnitConv(86).ipName = "kWh"; - UnitConv(87).ipName = "kWh"; - UnitConv(88).ipName = "therm"; - UnitConv(89).ipName = "MMBtu"; - UnitConv(90).ipName = "Wh"; - UnitConv(91).ipName = "ton-hrs"; - UnitConv(92).ipName = "kWh/ft2"; - UnitConv(93).ipName = "kBtu/ft2"; - UnitConv(94).ipName = "kBtu/ft2"; - UnitConv(95).ipName = "kWh/m2"; - UnitConv(96).ipName = "Invalid/Undefined"; - UnitConv(97).ipName = ""; - UnitConv(98).ipName = "Btu/h-F"; - UnitConv(99).ipName = "day"; - UnitConv(100).ipName = "min"; - UnitConv(101).ipName = "hr/wk"; - UnitConv(102).ipName = "$"; - UnitConv(103).ipName = "$/unit energy"; - UnitConv(104).ipName = "kW"; - UnitConv(105).ipName = " "; - UnitConv(106).ipName = "Ah"; - UnitConv(107).ipName = "clo"; - UnitConv(108).ipName = "Btu/lbm-R"; - UnitConv(109).ipName = "lbWater/s"; - UnitConv(110).ipName = "ppm"; - UnitConv(111).ipName = "rad"; - UnitConv(112).ipName = "rev/min"; - UnitConv(113).ipName = "lbf-ft"; - UnitConv(114).ipName = "Btu/W-h"; - UnitConv(115).ipName = "person/ft2"; - - UnitConv(1).mult = 1.0; - UnitConv(2).mult = 1.8; - UnitConv(3).mult = 1.0; - UnitConv(4).mult = 1.0; - UnitConv(5).mult = 1.0; - UnitConv(6).mult = 1.0; - UnitConv(7).mult = 1.0; - UnitConv(8).mult = 1.0; - UnitConv(9).mult = 1.8; - UnitConv(10).mult = 1.8; - UnitConv(11).mult = 1.8; - UnitConv(12).mult = 0.000645160041625726; - UnitConv(13).mult = 1.0; - UnitConv(14).mult = 1.0; - UnitConv(15).mult = 1.0; - UnitConv(16).mult = 1.0; - UnitConv(17).mult = 1.0; - UnitConv(18).mult = 1.0; - UnitConv(19).mult = 0.00000094845; - UnitConv(20).mult = 0.000000277778; - UnitConv(21).mult = 0.0000000094845; - UnitConv(22).mult = 0.00000000094845; - UnitConv(23).mult = 0.000277777777777778; - UnitConv(24).mult = 0.0000000789847; - UnitConv(25).mult = 0.00042956; - UnitConv(26).mult = 0.0000004302105; - UnitConv(27).mult = 0.00000008811404; - UnitConv(28).mult = 0.54861322767449; - UnitConv(29).mult = 2.2046; - UnitConv(30).mult = 1.0; - UnitConv(31).mult = 0.062428; - UnitConv(32).mult = 2.2046; - UnitConv(33).mult = 1.0; - UnitConv(34).mult = 2.2046; - UnitConv(35).mult = 1.0; - UnitConv(36).mult = 1.0; - UnitConv(37).mult = 1.0; - UnitConv(38).mult = 0.264172037284185; - UnitConv(39).mult = 0.0353146624712848; - UnitConv(40).mult = 1.0; - UnitConv(41).mult = 0.092902267; - UnitConv(42).mult = 3.281; - UnitConv(43).mult = 39.37; - UnitConv(44).mult = 196.86; - UnitConv(45).mult = 2.2369; - UnitConv(46).mult = 10.764961; - UnitConv(47).mult = 10.764961; - UnitConv(48).mult = 35.319837041; - UnitConv(49).mult = 264.172; - UnitConv(50).mult = 3.281; - UnitConv(51).mult = 2118.6438; - UnitConv(52).mult = 15852.0; - UnitConv(53).mult = 196.85; - UnitConv(54).mult = 2118.6438; - UnitConv(55).mult = 15852.0; - UnitConv(56).mult = 0.0001450377; - UnitConv(57).mult = 0.00029613; - UnitConv(58).mult = 0.00401463; - UnitConv(59).mult = 0.00033455; - UnitConv(60).mult = 0.0001450377; - UnitConv(61).mult = 0.00029613; - UnitConv(62).mult = 0.00401463; - UnitConv(63).mult = 0.00033455; - UnitConv(64).mult = 1.0; - UnitConv(65).mult = 1.0; - UnitConv(66).mult = 3.412; - UnitConv(67).mult = 1.0; - UnitConv(68).mult = 0.001; - UnitConv(69).mult = 0.00341442; - UnitConv(70).mult = 0.0002843333; - UnitConv(71).mult = 0.001547673; - UnitConv(72).mult = 0.001547673; - UnitConv(73).mult = 1.8987; - UnitConv(74).mult = 0.316954237; - UnitConv(75).mult = 0.000316954237; - UnitConv(76).mult = 0.176085687; - UnitConv(77).mult = 0.176085687; - UnitConv(78).mult = 1.0; - UnitConv(79).mult = 1.0; - UnitConv(80).mult = 1.8; - UnitConv(81).mult = 0.42956; - UnitConv(82).mult = 1.0 / 2118.6438; - UnitConv(83).mult = 1.0 / 15852; - UnitConv(84).mult = 1.0 / 10.764961; - UnitConv(85).mult = 0.00000094845 * 1000000000; - UnitConv(86).mult = 0.000000277778 * 1000000000; - UnitConv(87).mult = 0.000000277778 * 1000000000; - UnitConv(88).mult = 0.0000000094845 * 1000000000; - UnitConv(89).mult = 0.00000000094845 * 1000000000; - UnitConv(90).mult = 0.000277777777777778 * 1000000000; - UnitConv(91).mult = 0.0000000789847 * 1000000000; - UnitConv(92).mult = 0.277777777777778 / 10.764961; - UnitConv(93).mult = 0.94708628903179 / 10.764961; - UnitConv(94).mult = 0.94708628903179 / 10.764961; - UnitConv(95).mult = 0.27777777777778; - UnitConv(96).mult = 1.0; - UnitConv(97).mult = 1.0; - UnitConv(98).mult = 1.8987; - UnitConv(99).mult = 1.0; - UnitConv(100).mult = 1.0; - UnitConv(101).mult = 1.0; - UnitConv(102).mult = 1.0; - UnitConv(103).mult = 1.0; - UnitConv(104).mult = 1.0; - UnitConv(105).mult = 1.0; - UnitConv(106).mult = 1.0; - UnitConv(107).mult = 1.0; - UnitConv(108).mult = 0.000238845896627; - UnitConv(109).mult = 2.2046; - UnitConv(110).mult = 1.0; - UnitConv(111).mult = 1.0; - UnitConv(112).mult = 1.0; - UnitConv(113).mult = 0.737562149277; - UnitConv(114).mult = 1.0; - UnitConv(115).mult = 0.09290304; - - UnitConv(2).offset = 32.0; - UnitConv(11).offset = 32.0; - UnitConv(25).offset = 7.6736; - UnitConv(81).offset = 7.6736; // 80 is KJ/KG -- should this be multiplied by 1000? - - UnitConv(20).hint = "ELEC"; - UnitConv(21).hint = "GAS"; - UnitConv(24).hint = "COOL"; - UnitConv(38).hint = "WATER"; - UnitConv(49).hint = "WATER"; - UnitConv(52).hint = "WATER"; - UnitConv(67).hint = "ELEC"; - UnitConv(70).hint = "COOL"; - UnitConv(79).hint = "SI"; - UnitConv(83).hint = "WATER"; - UnitConv(86).hint = "CONSUMP"; - UnitConv(87).hint = "ELEC"; - UnitConv(88).hint = "GAS"; - UnitConv(91).hint = "COOL"; - UnitConv(92).hint = "ELEC"; - UnitConv(93).hint = "GAS"; - UnitConv(93).hint = "ADDITIONAL"; - - UnitConv(19).several = true; - UnitConv(20).several = true; - UnitConv(21).several = true; - UnitConv(22).several = true; - UnitConv(23).several = true; - UnitConv(24).several = true; - UnitConv(38).several = true; - UnitConv(39).several = true; - UnitConv(42).several = true; - UnitConv(43).several = true; - UnitConv(44).several = true; - UnitConv(45).several = true; - UnitConv(48).several = true; - UnitConv(49).several = true; - UnitConv(51).several = true; - UnitConv(52).several = true; - UnitConv(54).several = true; - UnitConv(55).several = true; - UnitConv(56).several = true; - UnitConv(57).several = true; - UnitConv(58).several = true; - UnitConv(59).several = true; - UnitConv(60).several = true; - UnitConv(61).several = true; - UnitConv(62).several = true; - UnitConv(63).several = true; - UnitConv(66).several = true; - UnitConv(67).several = true; - UnitConv(68).several = true; - UnitConv(69).several = true; - UnitConv(70).several = true; - UnitConv(74).several = true; - UnitConv(75).several = true; - UnitConv(78).several = true; - UnitConv(79).several = true; - UnitConv(82).several = true; - UnitConv(83).several = true; - UnitConv(85).several = true; - UnitConv(86).several = true; - UnitConv(87).several = true; - UnitConv(88).several = true; - UnitConv(89).several = true; - UnitConv(90).several = true; - UnitConv(91).several = true; - UnitConv(92).several = true; - UnitConv(93).several = true; - UnitConv(94).several = true; - UnitConv(95).several = true; + state.dataOutRptTab->UnitConv.allocate(state.dataOutRptTab->UnitConvSize); + state.dataOutRptTab->UnitConv(1).siName = "%"; + state.dataOutRptTab->UnitConv(2).siName = "°C"; + state.dataOutRptTab->UnitConv(3).siName = "0=OFF 1=ON"; + state.dataOutRptTab->UnitConv(4).siName = "0-NO 1-YES"; + state.dataOutRptTab->UnitConv(5).siName = "1-YES 0-NO"; + state.dataOutRptTab->UnitConv(6).siName = "A"; + state.dataOutRptTab->UnitConv(7).siName = "ACH"; + state.dataOutRptTab->UnitConv(8).siName = "ACH"; + state.dataOutRptTab->UnitConv(9).siName = "BASE 10C"; + state.dataOutRptTab->UnitConv(10).siName = "BASE 18C"; + state.dataOutRptTab->UnitConv(11).siName = "C"; + state.dataOutRptTab->UnitConv(12).siName = "CD/M2"; + state.dataOutRptTab->UnitConv(13).siName = "DEG"; + state.dataOutRptTab->UnitConv(14).siName = "FRAC"; + state.dataOutRptTab->UnitConv(15).siName = "HOUR"; + state.dataOutRptTab->UnitConv(16).siName = "HOURS"; + state.dataOutRptTab->UnitConv(17).siName = "HR"; + state.dataOutRptTab->UnitConv(18).siName = "HRS"; + state.dataOutRptTab->UnitConv(19).siName = "J"; + state.dataOutRptTab->UnitConv(20).siName = "J"; + state.dataOutRptTab->UnitConv(21).siName = "J"; + state.dataOutRptTab->UnitConv(22).siName = "J"; + state.dataOutRptTab->UnitConv(23).siName = "J"; + state.dataOutRptTab->UnitConv(24).siName = "J"; + state.dataOutRptTab->UnitConv(25).siName = "J/KG"; + state.dataOutRptTab->UnitConv(26).siName = "J/KGWATER"; + state.dataOutRptTab->UnitConv(27).siName = "J/M2"; + state.dataOutRptTab->UnitConv(28).siName = "K/M"; + state.dataOutRptTab->UnitConv(29).siName = "KG"; + state.dataOutRptTab->UnitConv(30).siName = "KG/KG"; + state.dataOutRptTab->UnitConv(31).siName = "KG/M3"; + state.dataOutRptTab->UnitConv(32).siName = "KG/S"; + state.dataOutRptTab->UnitConv(33).siName = "KGWATER/KGDRYAIR"; + state.dataOutRptTab->UnitConv(34).siName = "KGWATER/SEC"; + state.dataOutRptTab->UnitConv(35).siName = "KMOL/S"; + state.dataOutRptTab->UnitConv(36).siName = "KMOL/SEC"; + state.dataOutRptTab->UnitConv(37).siName = "KWH"; + state.dataOutRptTab->UnitConv(38).siName = "L"; + state.dataOutRptTab->UnitConv(39).siName = "L"; + state.dataOutRptTab->UnitConv(40).siName = "LUM/W"; + state.dataOutRptTab->UnitConv(41).siName = "LUX"; + state.dataOutRptTab->UnitConv(42).siName = "M"; + state.dataOutRptTab->UnitConv(43).siName = "M"; + state.dataOutRptTab->UnitConv(44).siName = "M/S"; + state.dataOutRptTab->UnitConv(45).siName = "M/S"; + state.dataOutRptTab->UnitConv(46).siName = "M2"; + state.dataOutRptTab->UnitConv(47).siName = "M2/PERSON"; + state.dataOutRptTab->UnitConv(48).siName = "M3"; + state.dataOutRptTab->UnitConv(49).siName = "M3"; + state.dataOutRptTab->UnitConv(50).siName = "M3/M2"; + state.dataOutRptTab->UnitConv(51).siName = "M3/S"; + state.dataOutRptTab->UnitConv(52).siName = "M3/S"; + state.dataOutRptTab->UnitConv(53).siName = "M3/S-M2"; + state.dataOutRptTab->UnitConv(54).siName = "M3/S-PERSON"; + state.dataOutRptTab->UnitConv(55).siName = "M3/S-PERSON"; + state.dataOutRptTab->UnitConv(56).siName = "PA"; + state.dataOutRptTab->UnitConv(57).siName = "PA"; + state.dataOutRptTab->UnitConv(58).siName = "PA"; + state.dataOutRptTab->UnitConv(59).siName = "PA"; + state.dataOutRptTab->UnitConv(60).siName = "PA"; + state.dataOutRptTab->UnitConv(61).siName = "PA"; + state.dataOutRptTab->UnitConv(62).siName = "PA"; + state.dataOutRptTab->UnitConv(63).siName = "PA"; + state.dataOutRptTab->UnitConv(64).siName = "S"; + state.dataOutRptTab->UnitConv(65).siName = "V"; + state.dataOutRptTab->UnitConv(66).siName = "W"; + state.dataOutRptTab->UnitConv(67).siName = "W"; + state.dataOutRptTab->UnitConv(68).siName = "W"; + state.dataOutRptTab->UnitConv(69).siName = "W"; + state.dataOutRptTab->UnitConv(70).siName = "W"; + state.dataOutRptTab->UnitConv(71).siName = "W/KG"; + state.dataOutRptTab->UnitConv(72).siName = "W/KG H2O"; // TODO: replace with W/kgWater? or rather just remove + state.dataOutRptTab->UnitConv(73).siName = "W/K"; + state.dataOutRptTab->UnitConv(74).siName = "W/M2"; + state.dataOutRptTab->UnitConv(75).siName = "W/M2"; + state.dataOutRptTab->UnitConv(76).siName = "W/M2-C"; + state.dataOutRptTab->UnitConv(77).siName = "W/M2-K"; + state.dataOutRptTab->UnitConv(78).siName = "W/W"; + state.dataOutRptTab->UnitConv(79).siName = "W/W"; + state.dataOutRptTab->UnitConv(80).siName = "deltaC"; + state.dataOutRptTab->UnitConv(81).siName = "KJ/KG"; + state.dataOutRptTab->UnitConv(82).siName = "W-S/M3"; + state.dataOutRptTab->UnitConv(83).siName = "W-S/M3"; + state.dataOutRptTab->UnitConv(84).siName = "~~$~~/m2"; + state.dataOutRptTab->UnitConv(85).siName = "GJ"; + state.dataOutRptTab->UnitConv(86).siName = "GJ"; + state.dataOutRptTab->UnitConv(87).siName = "GJ"; + state.dataOutRptTab->UnitConv(88).siName = "GJ"; + state.dataOutRptTab->UnitConv(89).siName = "GJ"; + state.dataOutRptTab->UnitConv(90).siName = "GJ"; + state.dataOutRptTab->UnitConv(91).siName = "GJ"; + state.dataOutRptTab->UnitConv(92).siName = "MJ/m2"; + state.dataOutRptTab->UnitConv(93).siName = "MJ/m2"; + state.dataOutRptTab->UnitConv(94).siName = "MJ/m2"; + state.dataOutRptTab->UnitConv(95).siName = "MJ/m2"; + state.dataOutRptTab->UnitConv(96).siName = "Invalid/Undefined"; + state.dataOutRptTab->UnitConv(97).siName = ""; + state.dataOutRptTab->UnitConv(98).siName = "W/C"; + state.dataOutRptTab->UnitConv(99).siName = "DAY"; + state.dataOutRptTab->UnitConv(100).siName = "MIN"; + state.dataOutRptTab->UnitConv(101).siName = "HR/WK"; + state.dataOutRptTab->UnitConv(102).siName = "$"; + state.dataOutRptTab->UnitConv(103).siName = "$/UNIT ENERGY"; + state.dataOutRptTab->UnitConv(104).siName = "KW"; + state.dataOutRptTab->UnitConv(105).siName = " "; + state.dataOutRptTab->UnitConv(106).siName = "AH"; + state.dataOutRptTab->UnitConv(107).siName = "CLO"; + state.dataOutRptTab->UnitConv(108).siName = "J/KG-K"; + state.dataOutRptTab->UnitConv(109).siName = "KGWATER/S"; + state.dataOutRptTab->UnitConv(110).siName = "PPM"; + state.dataOutRptTab->UnitConv(111).siName = "RAD"; + state.dataOutRptTab->UnitConv(112).siName = "REV/MIN"; + state.dataOutRptTab->UnitConv(113).siName = "NM"; + state.dataOutRptTab->UnitConv(114).siName = "BTU/W-H"; // Used for AHRI rating metrics (e.g. SEER) + state.dataOutRptTab->UnitConv(115).siName = "PERSON/M2"; + + state.dataOutRptTab->UnitConv(1).ipName = "%"; + state.dataOutRptTab->UnitConv(2).ipName = "F"; + state.dataOutRptTab->UnitConv(3).ipName = "0=Off 1=On"; + state.dataOutRptTab->UnitConv(4).ipName = "0-No 1-Yes"; + state.dataOutRptTab->UnitConv(5).ipName = "1-Yes 0-No"; + state.dataOutRptTab->UnitConv(6).ipName = "A"; + state.dataOutRptTab->UnitConv(7).ipName = "ACH"; + state.dataOutRptTab->UnitConv(8).ipName = "ach"; + state.dataOutRptTab->UnitConv(9).ipName = "base 50F"; + state.dataOutRptTab->UnitConv(10).ipName = "base 65F"; + state.dataOutRptTab->UnitConv(11).ipName = "F"; + state.dataOutRptTab->UnitConv(12).ipName = "cd/in2"; + state.dataOutRptTab->UnitConv(13).ipName = "deg"; + state.dataOutRptTab->UnitConv(14).ipName = "Frac"; + state.dataOutRptTab->UnitConv(15).ipName = "Hour"; + state.dataOutRptTab->UnitConv(16).ipName = "Hours"; + state.dataOutRptTab->UnitConv(17).ipName = "hr"; + state.dataOutRptTab->UnitConv(18).ipName = "hrs"; + state.dataOutRptTab->UnitConv(19).ipName = "kBtu"; + state.dataOutRptTab->UnitConv(20).ipName = "kWh"; + state.dataOutRptTab->UnitConv(21).ipName = "therm"; + state.dataOutRptTab->UnitConv(22).ipName = "MMBtu"; + state.dataOutRptTab->UnitConv(23).ipName = "Wh"; + state.dataOutRptTab->UnitConv(24).ipName = "ton-hrs"; + state.dataOutRptTab->UnitConv(25).ipName = "Btu/lb"; + state.dataOutRptTab->UnitConv(26).ipName = "Btu/lbWater"; + state.dataOutRptTab->UnitConv(27).ipName = "kBtu/sqft"; + state.dataOutRptTab->UnitConv(28).ipName = "F/ft"; + state.dataOutRptTab->UnitConv(29).ipName = "lb"; + state.dataOutRptTab->UnitConv(30).ipName = "lb/lb"; + state.dataOutRptTab->UnitConv(31).ipName = "lb/ft3"; + state.dataOutRptTab->UnitConv(32).ipName = "lb/s"; + state.dataOutRptTab->UnitConv(33).ipName = "lbWater/lbDryAir"; + state.dataOutRptTab->UnitConv(34).ipName = "lbWater/s"; + state.dataOutRptTab->UnitConv(35).ipName = "kmol/s"; + state.dataOutRptTab->UnitConv(36).ipName = "kmol/sec"; + state.dataOutRptTab->UnitConv(37).ipName = "kWh"; + state.dataOutRptTab->UnitConv(38).ipName = "gal"; + state.dataOutRptTab->UnitConv(39).ipName = "ft3"; + state.dataOutRptTab->UnitConv(40).ipName = "lum/W"; + state.dataOutRptTab->UnitConv(41).ipName = "foot-candles"; + state.dataOutRptTab->UnitConv(42).ipName = "ft"; + state.dataOutRptTab->UnitConv(43).ipName = "in"; + state.dataOutRptTab->UnitConv(44).ipName = "ft/min"; + state.dataOutRptTab->UnitConv(45).ipName = "miles/hr"; + state.dataOutRptTab->UnitConv(46).ipName = "ft2"; + state.dataOutRptTab->UnitConv(47).ipName = "ft2/person"; + state.dataOutRptTab->UnitConv(48).ipName = "ft3"; + state.dataOutRptTab->UnitConv(49).ipName = "gal"; + state.dataOutRptTab->UnitConv(50).ipName = "f3/f2"; + state.dataOutRptTab->UnitConv(51).ipName = "ft3/min"; + state.dataOutRptTab->UnitConv(52).ipName = "gal/min"; + state.dataOutRptTab->UnitConv(53).ipName = "ft3/min-ft2"; + state.dataOutRptTab->UnitConv(54).ipName = "ft3/min-person"; + state.dataOutRptTab->UnitConv(55).ipName = "gal/min-person"; + state.dataOutRptTab->UnitConv(56).ipName = "psi"; + state.dataOutRptTab->UnitConv(57).ipName = "inHg"; + state.dataOutRptTab->UnitConv(58).ipName = "inH2O"; + state.dataOutRptTab->UnitConv(59).ipName = "ftH2O"; + state.dataOutRptTab->UnitConv(60).ipName = "psi"; + state.dataOutRptTab->UnitConv(61).ipName = "inHg"; + state.dataOutRptTab->UnitConv(62).ipName = "inH2O"; + state.dataOutRptTab->UnitConv(63).ipName = "ftH2O"; + state.dataOutRptTab->UnitConv(64).ipName = "s"; + state.dataOutRptTab->UnitConv(65).ipName = "V"; + state.dataOutRptTab->UnitConv(66).ipName = "Btu/h"; + state.dataOutRptTab->UnitConv(67).ipName = "W"; + state.dataOutRptTab->UnitConv(68).ipName = "kW"; + state.dataOutRptTab->UnitConv(69).ipName = "kBtuh"; + state.dataOutRptTab->UnitConv(70).ipName = "ton"; + state.dataOutRptTab->UnitConv(71).ipName = "kBtuh/lb"; + state.dataOutRptTab->UnitConv(72).ipName = "kBtuh/lb"; + state.dataOutRptTab->UnitConv(73).ipName = "Btu/h-F"; + state.dataOutRptTab->UnitConv(74).ipName = "Btu/h-ft2"; + state.dataOutRptTab->UnitConv(75).ipName = "kBtuh/ft2"; + state.dataOutRptTab->UnitConv(76).ipName = "Btu/h-ft2-F"; + state.dataOutRptTab->UnitConv(77).ipName = "Btu/h-ft2-F"; + state.dataOutRptTab->UnitConv(78).ipName = "Btuh/Btuh"; + state.dataOutRptTab->UnitConv(79).ipName = "W/W"; + state.dataOutRptTab->UnitConv(80).ipName = "deltaF"; + state.dataOutRptTab->UnitConv(81).ipName = "Btu/lb"; + state.dataOutRptTab->UnitConv(82).ipName = "W-min/ft3"; + state.dataOutRptTab->UnitConv(83).ipName = "W-min/gal"; + state.dataOutRptTab->UnitConv(84).ipName = "~~$~~/ft2"; + state.dataOutRptTab->UnitConv(85).ipName = "kBtu"; + state.dataOutRptTab->UnitConv(86).ipName = "kWh"; + state.dataOutRptTab->UnitConv(87).ipName = "kWh"; + state.dataOutRptTab->UnitConv(88).ipName = "therm"; + state.dataOutRptTab->UnitConv(89).ipName = "MMBtu"; + state.dataOutRptTab->UnitConv(90).ipName = "Wh"; + state.dataOutRptTab->UnitConv(91).ipName = "ton-hrs"; + state.dataOutRptTab->UnitConv(92).ipName = "kWh/ft2"; + state.dataOutRptTab->UnitConv(93).ipName = "kBtu/ft2"; + state.dataOutRptTab->UnitConv(94).ipName = "kBtu/ft2"; + state.dataOutRptTab->UnitConv(95).ipName = "kWh/m2"; + state.dataOutRptTab->UnitConv(96).ipName = "Invalid/Undefined"; + state.dataOutRptTab->UnitConv(97).ipName = ""; + state.dataOutRptTab->UnitConv(98).ipName = "Btu/h-F"; + state.dataOutRptTab->UnitConv(99).ipName = "day"; + state.dataOutRptTab->UnitConv(100).ipName = "min"; + state.dataOutRptTab->UnitConv(101).ipName = "hr/wk"; + state.dataOutRptTab->UnitConv(102).ipName = "$"; + state.dataOutRptTab->UnitConv(103).ipName = "$/unit energy"; + state.dataOutRptTab->UnitConv(104).ipName = "kW"; + state.dataOutRptTab->UnitConv(105).ipName = " "; + state.dataOutRptTab->UnitConv(106).ipName = "Ah"; + state.dataOutRptTab->UnitConv(107).ipName = "clo"; + state.dataOutRptTab->UnitConv(108).ipName = "Btu/lbm-R"; + state.dataOutRptTab->UnitConv(109).ipName = "lbWater/s"; + state.dataOutRptTab->UnitConv(110).ipName = "ppm"; + state.dataOutRptTab->UnitConv(111).ipName = "rad"; + state.dataOutRptTab->UnitConv(112).ipName = "rev/min"; + state.dataOutRptTab->UnitConv(113).ipName = "lbf-ft"; + state.dataOutRptTab->UnitConv(114).ipName = "Btu/W-h"; + state.dataOutRptTab->UnitConv(115).ipName = "person/ft2"; + + state.dataOutRptTab->UnitConv(1).mult = 1.0; + state.dataOutRptTab->UnitConv(2).mult = 1.8; + state.dataOutRptTab->UnitConv(3).mult = 1.0; + state.dataOutRptTab->UnitConv(4).mult = 1.0; + state.dataOutRptTab->UnitConv(5).mult = 1.0; + state.dataOutRptTab->UnitConv(6).mult = 1.0; + state.dataOutRptTab->UnitConv(7).mult = 1.0; + state.dataOutRptTab->UnitConv(8).mult = 1.0; + state.dataOutRptTab->UnitConv(9).mult = 1.8; + state.dataOutRptTab->UnitConv(10).mult = 1.8; + state.dataOutRptTab->UnitConv(11).mult = 1.8; + state.dataOutRptTab->UnitConv(12).mult = 0.000645160041625726; + state.dataOutRptTab->UnitConv(13).mult = 1.0; + state.dataOutRptTab->UnitConv(14).mult = 1.0; + state.dataOutRptTab->UnitConv(15).mult = 1.0; + state.dataOutRptTab->UnitConv(16).mult = 1.0; + state.dataOutRptTab->UnitConv(17).mult = 1.0; + state.dataOutRptTab->UnitConv(18).mult = 1.0; + state.dataOutRptTab->UnitConv(19).mult = 0.00000094845; + state.dataOutRptTab->UnitConv(20).mult = 0.000000277778; + state.dataOutRptTab->UnitConv(21).mult = 0.0000000094845; + state.dataOutRptTab->UnitConv(22).mult = 0.00000000094845; + state.dataOutRptTab->UnitConv(23).mult = 0.000277777777777778; + state.dataOutRptTab->UnitConv(24).mult = 0.0000000789847; + state.dataOutRptTab->UnitConv(25).mult = 0.00042956; + state.dataOutRptTab->UnitConv(26).mult = 0.0000004302105; + state.dataOutRptTab->UnitConv(27).mult = 0.00000008811404; + state.dataOutRptTab->UnitConv(28).mult = 0.54861322767449; + state.dataOutRptTab->UnitConv(29).mult = 2.2046; + state.dataOutRptTab->UnitConv(30).mult = 1.0; + state.dataOutRptTab->UnitConv(31).mult = 0.062428; + state.dataOutRptTab->UnitConv(32).mult = 2.2046; + state.dataOutRptTab->UnitConv(33).mult = 1.0; + state.dataOutRptTab->UnitConv(34).mult = 2.2046; + state.dataOutRptTab->UnitConv(35).mult = 1.0; + state.dataOutRptTab->UnitConv(36).mult = 1.0; + state.dataOutRptTab->UnitConv(37).mult = 1.0; + state.dataOutRptTab->UnitConv(38).mult = 0.264172037284185; + state.dataOutRptTab->UnitConv(39).mult = 0.0353146624712848; + state.dataOutRptTab->UnitConv(40).mult = 1.0; + state.dataOutRptTab->UnitConv(41).mult = 0.092902267; + state.dataOutRptTab->UnitConv(42).mult = 3.281; + state.dataOutRptTab->UnitConv(43).mult = 39.37; + state.dataOutRptTab->UnitConv(44).mult = 196.86; + state.dataOutRptTab->UnitConv(45).mult = 2.2369; + state.dataOutRptTab->UnitConv(46).mult = 10.764961; + state.dataOutRptTab->UnitConv(47).mult = 10.764961; + state.dataOutRptTab->UnitConv(48).mult = 35.319837041; + state.dataOutRptTab->UnitConv(49).mult = 264.172; + state.dataOutRptTab->UnitConv(50).mult = 3.281; + state.dataOutRptTab->UnitConv(51).mult = 2118.6438; + state.dataOutRptTab->UnitConv(52).mult = 15852.0; + state.dataOutRptTab->UnitConv(53).mult = 196.85; + state.dataOutRptTab->UnitConv(54).mult = 2118.6438; + state.dataOutRptTab->UnitConv(55).mult = 15852.0; + state.dataOutRptTab->UnitConv(56).mult = 0.0001450377; + state.dataOutRptTab->UnitConv(57).mult = 0.00029613; + state.dataOutRptTab->UnitConv(58).mult = 0.00401463; + state.dataOutRptTab->UnitConv(59).mult = 0.00033455; + state.dataOutRptTab->UnitConv(60).mult = 0.0001450377; + state.dataOutRptTab->UnitConv(61).mult = 0.00029613; + state.dataOutRptTab->UnitConv(62).mult = 0.00401463; + state.dataOutRptTab->UnitConv(63).mult = 0.00033455; + state.dataOutRptTab->UnitConv(64).mult = 1.0; + state.dataOutRptTab->UnitConv(65).mult = 1.0; + state.dataOutRptTab->UnitConv(66).mult = 3.412; + state.dataOutRptTab->UnitConv(67).mult = 1.0; + state.dataOutRptTab->UnitConv(68).mult = 0.001; + state.dataOutRptTab->UnitConv(69).mult = 0.00341442; + state.dataOutRptTab->UnitConv(70).mult = 0.0002843333; + state.dataOutRptTab->UnitConv(71).mult = 0.001547673; + state.dataOutRptTab->UnitConv(72).mult = 0.001547673; + state.dataOutRptTab->UnitConv(73).mult = 1.8987; + state.dataOutRptTab->UnitConv(74).mult = 0.316954237; + state.dataOutRptTab->UnitConv(75).mult = 0.000316954237; + state.dataOutRptTab->UnitConv(76).mult = 0.176085687; + state.dataOutRptTab->UnitConv(77).mult = 0.176085687; + state.dataOutRptTab->UnitConv(78).mult = 1.0; + state.dataOutRptTab->UnitConv(79).mult = 1.0; + state.dataOutRptTab->UnitConv(80).mult = 1.8; + state.dataOutRptTab->UnitConv(81).mult = 0.42956; + state.dataOutRptTab->UnitConv(82).mult = 1.0 / 2118.6438; + state.dataOutRptTab->UnitConv(83).mult = 1.0 / 15852; + state.dataOutRptTab->UnitConv(84).mult = 1.0 / 10.764961; + state.dataOutRptTab->UnitConv(85).mult = 0.00000094845 * 1000000000; + state.dataOutRptTab->UnitConv(86).mult = 0.000000277778 * 1000000000; + state.dataOutRptTab->UnitConv(87).mult = 0.000000277778 * 1000000000; + state.dataOutRptTab->UnitConv(88).mult = 0.0000000094845 * 1000000000; + state.dataOutRptTab->UnitConv(89).mult = 0.00000000094845 * 1000000000; + state.dataOutRptTab->UnitConv(90).mult = 0.000277777777777778 * 1000000000; + state.dataOutRptTab->UnitConv(91).mult = 0.0000000789847 * 1000000000; + state.dataOutRptTab->UnitConv(92).mult = 0.277777777777778 / 10.764961; + state.dataOutRptTab->UnitConv(93).mult = 0.94708628903179 / 10.764961; + state.dataOutRptTab->UnitConv(94).mult = 0.94708628903179 / 10.764961; + state.dataOutRptTab->UnitConv(95).mult = 0.27777777777778; + state.dataOutRptTab->UnitConv(96).mult = 1.0; + state.dataOutRptTab->UnitConv(97).mult = 1.0; + state.dataOutRptTab->UnitConv(98).mult = 1.8987; + state.dataOutRptTab->UnitConv(99).mult = 1.0; + state.dataOutRptTab->UnitConv(100).mult = 1.0; + state.dataOutRptTab->UnitConv(101).mult = 1.0; + state.dataOutRptTab->UnitConv(102).mult = 1.0; + state.dataOutRptTab->UnitConv(103).mult = 1.0; + state.dataOutRptTab->UnitConv(104).mult = 1.0; + state.dataOutRptTab->UnitConv(105).mult = 1.0; + state.dataOutRptTab->UnitConv(106).mult = 1.0; + state.dataOutRptTab->UnitConv(107).mult = 1.0; + state.dataOutRptTab->UnitConv(108).mult = 0.000238845896627; + state.dataOutRptTab->UnitConv(109).mult = 2.2046; + state.dataOutRptTab->UnitConv(110).mult = 1.0; + state.dataOutRptTab->UnitConv(111).mult = 1.0; + state.dataOutRptTab->UnitConv(112).mult = 1.0; + state.dataOutRptTab->UnitConv(113).mult = 0.737562149277; + state.dataOutRptTab->UnitConv(114).mult = 1.0; + state.dataOutRptTab->UnitConv(115).mult = 0.09290304; + + state.dataOutRptTab->UnitConv(2).offset = 32.0; + state.dataOutRptTab->UnitConv(11).offset = 32.0; + state.dataOutRptTab->UnitConv(25).offset = 7.6736; + state.dataOutRptTab->UnitConv(81).offset = 7.6736; // 80 is KJ/KG -- should this be multiplied by 1000? + + state.dataOutRptTab->UnitConv(20).hint = "ELEC"; + state.dataOutRptTab->UnitConv(21).hint = "GAS"; + state.dataOutRptTab->UnitConv(24).hint = "COOL"; + state.dataOutRptTab->UnitConv(38).hint = "WATER"; + state.dataOutRptTab->UnitConv(49).hint = "WATER"; + state.dataOutRptTab->UnitConv(52).hint = "WATER"; + state.dataOutRptTab->UnitConv(67).hint = "ELEC"; + state.dataOutRptTab->UnitConv(70).hint = "COOL"; + state.dataOutRptTab->UnitConv(79).hint = "SI"; + state.dataOutRptTab->UnitConv(83).hint = "WATER"; + state.dataOutRptTab->UnitConv(86).hint = "CONSUMP"; + state.dataOutRptTab->UnitConv(87).hint = "ELEC"; + state.dataOutRptTab->UnitConv(88).hint = "GAS"; + state.dataOutRptTab->UnitConv(91).hint = "COOL"; + state.dataOutRptTab->UnitConv(92).hint = "ELEC"; + state.dataOutRptTab->UnitConv(93).hint = "GAS"; + state.dataOutRptTab->UnitConv(93).hint = "ADDITIONAL"; + + state.dataOutRptTab->UnitConv(19).several = true; + state.dataOutRptTab->UnitConv(20).several = true; + state.dataOutRptTab->UnitConv(21).several = true; + state.dataOutRptTab->UnitConv(22).several = true; + state.dataOutRptTab->UnitConv(23).several = true; + state.dataOutRptTab->UnitConv(24).several = true; + state.dataOutRptTab->UnitConv(38).several = true; + state.dataOutRptTab->UnitConv(39).several = true; + state.dataOutRptTab->UnitConv(42).several = true; + state.dataOutRptTab->UnitConv(43).several = true; + state.dataOutRptTab->UnitConv(44).several = true; + state.dataOutRptTab->UnitConv(45).several = true; + state.dataOutRptTab->UnitConv(48).several = true; + state.dataOutRptTab->UnitConv(49).several = true; + state.dataOutRptTab->UnitConv(51).several = true; + state.dataOutRptTab->UnitConv(52).several = true; + state.dataOutRptTab->UnitConv(54).several = true; + state.dataOutRptTab->UnitConv(55).several = true; + state.dataOutRptTab->UnitConv(56).several = true; + state.dataOutRptTab->UnitConv(57).several = true; + state.dataOutRptTab->UnitConv(58).several = true; + state.dataOutRptTab->UnitConv(59).several = true; + state.dataOutRptTab->UnitConv(60).several = true; + state.dataOutRptTab->UnitConv(61).several = true; + state.dataOutRptTab->UnitConv(62).several = true; + state.dataOutRptTab->UnitConv(63).several = true; + state.dataOutRptTab->UnitConv(66).several = true; + state.dataOutRptTab->UnitConv(67).several = true; + state.dataOutRptTab->UnitConv(68).several = true; + state.dataOutRptTab->UnitConv(69).several = true; + state.dataOutRptTab->UnitConv(70).several = true; + state.dataOutRptTab->UnitConv(74).several = true; + state.dataOutRptTab->UnitConv(75).several = true; + state.dataOutRptTab->UnitConv(78).several = true; + state.dataOutRptTab->UnitConv(79).several = true; + state.dataOutRptTab->UnitConv(82).several = true; + state.dataOutRptTab->UnitConv(83).several = true; + state.dataOutRptTab->UnitConv(85).several = true; + state.dataOutRptTab->UnitConv(86).several = true; + state.dataOutRptTab->UnitConv(87).several = true; + state.dataOutRptTab->UnitConv(88).several = true; + state.dataOutRptTab->UnitConv(89).several = true; + state.dataOutRptTab->UnitConv(90).several = true; + state.dataOutRptTab->UnitConv(91).several = true; + state.dataOutRptTab->UnitConv(92).several = true; + state.dataOutRptTab->UnitConv(93).several = true; + state.dataOutRptTab->UnitConv(94).several = true; + state.dataOutRptTab->UnitConv(95).several = true; } std::string GetUnitSubString(std::string const &inString) // Input String @@ -15971,13 +15909,13 @@ namespace EnergyPlus::OutputReportTabular { int foundConv = 0; int firstOfSeveral = 0; for (int iUnit = 1; iUnit <= state.dataOutRptTab->UnitConvSize; ++iUnit) { - if (UtilityRoutines::SameString(UnitConv(iUnit).siName, unitSIOnly)) { - if (UnitConv(iUnit).several) { + if (UtilityRoutines::SameString(state.dataOutRptTab->UnitConv(iUnit).siName, unitSIOnly)) { + if (state.dataOutRptTab->UnitConv(iUnit).several) { if (firstOfSeveral == 0) firstOfSeveral = iUnit; - if (UnitConv(iUnit).is_default) defaultConv = iUnit; + if (state.dataOutRptTab->UnitConv(iUnit).is_default) defaultConv = iUnit; // look for the hint string - if (len(UnitConv(iUnit).hint) > 0) { - if (has(stringInUpper, UnitConv(iUnit).hint)) { + if (len(state.dataOutRptTab->UnitConv(iUnit).hint) > 0) { + if (has(stringInUpper, state.dataOutRptTab->UnitConv(iUnit).hint)) { foundConv = iUnit; break; } @@ -16009,13 +15947,13 @@ namespace EnergyPlus::OutputReportTabular { // if one was selected substitute the units into the output string if (selectedConv > 0) { if (modeInString == misBrac) { - stringOutWithIP = stringInWithSI.substr(0, posLBrac + 1) + UnitConv(selectedConv).ipName + stringInWithSI.substr(posRBrac); + stringOutWithIP = stringInWithSI.substr(0, posLBrac + 1) + state.dataOutRptTab->UnitConv(selectedConv).ipName + stringInWithSI.substr(posRBrac); } else if (modeInString == misParen) { - stringOutWithIP = stringInWithSI.substr(0, posLParen + 1) + UnitConv(selectedConv).ipName + stringInWithSI.substr(posRParen); + stringOutWithIP = stringInWithSI.substr(0, posLParen + 1) + state.dataOutRptTab->UnitConv(selectedConv).ipName + stringInWithSI.substr(posRParen); } else if (modeInString == misBrce) { - stringOutWithIP = stringInWithSI.substr(0, posLBrce + 1) + UnitConv(selectedConv).ipName + stringInWithSI.substr(posRBrce); + stringOutWithIP = stringInWithSI.substr(0, posLBrce + 1) + state.dataOutRptTab->UnitConv(selectedConv).ipName + stringInWithSI.substr(posRBrce); } else if (modeInString == misNoHint) { - stringOutWithIP = UnitConv(selectedConv).ipName; + stringOutWithIP = state.dataOutRptTab->UnitConv(selectedConv).ipName; } } else { // if no conversion just output the input string @@ -16098,7 +16036,7 @@ namespace EnergyPlus::OutputReportTabular { if (unitConvIndex == 0 || SIvalue == -999.0 || SIvalue == -99999.0) { // don't convert unknown data to IP ConvertIP = SIvalue; } else if ((unitConvIndex > 0) && (unitConvIndex <= state.dataOutRptTab->UnitConvSize)) { - ConvertIP = (SIvalue * UnitConv(unitConvIndex).mult) + UnitConv(unitConvIndex).offset; + ConvertIP = (SIvalue * state.dataOutRptTab->UnitConv(unitConvIndex).mult) + state.dataOutRptTab->UnitConv(unitConvIndex).offset; } else { ConvertIP = SIvalue; } @@ -16148,7 +16086,7 @@ namespace EnergyPlus::OutputReportTabular { if (unitConvIndex == 0) { ConvertIPdelta = SIvalue; } else if ((unitConvIndex > 0) && (unitConvIndex <= state.dataOutRptTab->UnitConvSize)) { - ConvertIPdelta = SIvalue * UnitConv(unitConvIndex).mult; + ConvertIPdelta = SIvalue * state.dataOutRptTab->UnitConv(unitConvIndex).mult; } else { ConvertIPdelta = SIvalue; } @@ -16193,9 +16131,9 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na if ((unitConvIndex > 0) && (unitConvIndex <= state.dataOutRptTab->UnitConvSize)) { - multiplier = UnitConv(unitConvIndex).mult; - offset = UnitConv(unitConvIndex).offset; - IPunit = UnitConv(unitConvIndex).ipName; + multiplier = state.dataOutRptTab->UnitConv(unitConvIndex).mult; + offset = state.dataOutRptTab->UnitConv(unitConvIndex).offset; + IPunit = state.dataOutRptTab->UnitConv(unitConvIndex).ipName; } else { multiplier = 1.0; offset = 0.0; @@ -16249,15 +16187,15 @@ namespace EnergyPlus::OutputReportTabular { static int iUnit(0); for (iUnit = 1; iUnit <= state.dataOutRptTab->UnitConvSize; ++iUnit) { - if (UtilityRoutines::SameString(UnitConv(iUnit).siName, SIunit)) { - if (UtilityRoutines::SameString(UnitConv(iUnit).ipName, IPunit)) { + if (UtilityRoutines::SameString(state.dataOutRptTab->UnitConv(iUnit).siName, SIunit)) { + if (UtilityRoutines::SameString(state.dataOutRptTab->UnitConv(iUnit).ipName, IPunit)) { found = iUnit; break; } } } if (found != 0) { - getSpecificUnitMultiplier = UnitConv(found).mult; + getSpecificUnitMultiplier = state.dataOutRptTab->UnitConv(found).mult; } else { ShowWarningError(state, "Unable to find a unit conversion from " + SIunit + " to " + IPunit); ShowContinueError(state, "Applying default conversion factor of 1.0"); @@ -16364,8 +16302,8 @@ namespace EnergyPlus::OutputReportTabular { static int iUnit(0); for (iUnit = 1; iUnit <= state.dataOutRptTab->UnitConvSize; ++iUnit) { - if (UtilityRoutines::SameString(UnitConv(iUnit).siName, SIunit)) { - if (UtilityRoutines::SameString(UnitConv(iUnit).ipName, IPunit)) { + if (UtilityRoutines::SameString(state.dataOutRptTab->UnitConv(iUnit).siName, SIunit)) { + if (UtilityRoutines::SameString(state.dataOutRptTab->UnitConv(iUnit).ipName, IPunit)) { found = iUnit; break; } diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 80fd0ebb112..a9ab3330805 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -182,15 +182,6 @@ namespace OutputReportTabular { // Allow up to five output files to be created constexpr int maxNumStyles(5); - extern int maxUniqueKeyCount; - - // for the XML report must keep track fo the active sub-table name and report set by other routines - extern std::string activeSubTableName; - extern std::string activeReportNameNoSpace; - extern std::string activeReportName; - extern std::string activeForName; - extern std::string prevReportName; - // LineTypes for reading the stat file enum class StatLineType { Initialized, // used as a dummy placeholder @@ -478,21 +469,6 @@ namespace OutputReportTabular { } }; - // Object Data - extern Array1D OutputTableBinned; - extern Array2D BinResults; // table number, number of intervals - extern Array1D BinResultsBelow; // time below the lowest defined bin - extern Array1D BinResultsAbove; // time above the highest defined bin - extern Array1D BinObjVarID; - extern Array1D BinStatistics; - extern Array1D namedMonthly; // for predefined monthly report titles - extern Array1D MonthlyFieldSetInput; - extern Array1D MonthlyInput; - extern Array1D MonthlyTables; - extern Array1D MonthlyColumns; - extern Array1D TOCEntries; - extern Array1D UnitConv; - // Functions void clear_state(EnergyPlusData &state); @@ -760,7 +736,7 @@ namespace OutputReportTabular { void ResetMonthlyGathering(EnergyPlusData &state); - void ResetBinGathering(); + void ResetBinGathering(EnergyPlusData &state); void ResetBEPSGathering(EnergyPlusData &state); @@ -1056,6 +1032,37 @@ struct OutputReportTabularData : BaseGlobalStruct { Array3D feneCondInstantSeq; Array3D feneSolarRadSeq; + int maxUniqueKeyCount = 0; + + // for the XML report must keep track fo the active sub-table name and report set by other routines + std::string activeSubTableName; + std::string activeReportNameNoSpace; + std::string activeReportName; + std::string activeForName; + std::string prevReportName; + + // Object Data + Array1D OutputTableBinned; + Array2D BinResults; // table number, number of intervals + Array1D BinResultsBelow; // time below the lowest defined bin + Array1D BinResultsAbove; // time above the highest defined bin + Array1D BinObjVarID; + Array1D BinStatistics; + Array1D namedMonthly; // for predefined monthly report titles + Array1D MonthlyFieldSetInput; + Array1D MonthlyInput; + Array1D MonthlyTables; + Array1D MonthlyColumns; + Array1D TOCEntries; + Array1D UnitConv; + + bool GatherMonthlyResultsForTimestepRunOnce = true; + bool UpdateTabularReportsGetInput = true; + bool GatherHeatGainReportfirstTime = true; + bool AllocateLoadComponentArraysDoAllocate = true; + bool initAdjFenDone = false; + int numPeopleAdaptive = 0; + void clear_state() override { this->unitsStyle = OutputReportTabular::iUnitsStyle::None; @@ -1226,6 +1233,31 @@ struct OutputReportTabularData : BaseGlobalStruct { this->interZoneMixLatentSeq.deallocate(); this->feneCondInstantSeq.deallocate(); this->feneSolarRadSeq.deallocate(); + this->maxUniqueKeyCount = 0; + this->activeSubTableName.clear(); + this->activeReportNameNoSpace.clear(); + this->activeReportName.clear(); + this->activeForName.clear(); + this->prevReportName.clear(); + this->OutputTableBinned.deallocate(); + this->BinResults.deallocate(); + this->BinResultsBelow.deallocate(); + this->BinResultsAbove.deallocate(); + this->BinObjVarID.deallocate(); + this->BinStatistics.deallocate(); + this->namedMonthly.deallocate(); + this->MonthlyFieldSetInput.deallocate(); + this->MonthlyInput.deallocate(); + this->MonthlyTables.deallocate(); + this->MonthlyColumns.deallocate(); + this->TOCEntries.deallocate(); + this->UnitConv.deallocate(); + this->GatherMonthlyResultsForTimestepRunOnce = true; + this->UpdateTabularReportsGetInput = true; + this->GatherHeatGainReportfirstTime = true; + this->AllocateLoadComponentArraysDoAllocate = true; + this->initAdjFenDone = false; + this->numPeopleAdaptive = 0; } }; diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 5556e45d083..37c5aa4b31d 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -1838,7 +1838,6 @@ namespace SimulationManager { // Using/Aliasing using namespace DataOutputs; - using OutputReportTabular::maxUniqueKeyCount; using namespace DataRuntimeLanguage; using DataHeatBalance::CondFDRelaxFactor; using DataHeatBalance::CondFDRelaxFactorInput; @@ -1880,7 +1879,7 @@ namespace SimulationManager { print(state.files.audit, variable_fmt, "MaxIVariable", state.dataOutputProcessor->MaxIVariable); print(state.files.audit, variable_fmt, "NumEnergyMeters", state.dataOutputProcessor->NumEnergyMeters); print(state.files.audit, variable_fmt, "NumVarMeterArrays", state.dataOutputProcessor->NumVarMeterArrays); - print(state.files.audit, variable_fmt, "maxUniqueKeyCount", maxUniqueKeyCount); + print(state.files.audit, variable_fmt, "maxUniqueKeyCount", state.dataOutRptTab->maxUniqueKeyCount); print(state.files.audit, variable_fmt, "maxNumberOfFigures", state.dataSolarShading->maxNumberOfFigures); print(state.files.audit, variable_fmt, "MAXHCArrayBounds", state.dataSolarShading->MAXHCArrayBounds); print(state.files.audit, variable_fmt, "MaxVerticesPerSurface", MaxVerticesPerSurface); diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 9c5568973dd..2bc5575af71 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -113,7 +113,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_ConfirmSetUnitsStyleFromString TEST_F(EnergyPlusFixture, OutputReportTabularTest_Basic) { - OutputTableBinned.allocate(10); + state->dataOutRptTab->OutputTableBinned.allocate(10); EXPECT_TRUE(warningAboutKeyNotFound(*state, 0, 1, "moduleName")); EXPECT_FALSE(warningAboutKeyNotFound(*state, 100, 1, "moduleName")); } @@ -3509,20 +3509,20 @@ TEST_F(EnergyPlusFixture, OutputReportTabularMonthly_ResetMonthlyGathering) state->dataEnvrn->Month = 12; GatherMonthlyResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 1, MonthlyColumns(1).reslt(12)); + EXPECT_EQ(extLitUse * 1, state->dataOutRptTab->MonthlyColumns(1).reslt(12)); GatherMonthlyResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 2, MonthlyColumns(1).reslt(12)); + EXPECT_EQ(extLitUse * 2, state->dataOutRptTab->MonthlyColumns(1).reslt(12)); GatherMonthlyResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 3, MonthlyColumns(1).reslt(12)); + EXPECT_EQ(extLitUse * 3, state->dataOutRptTab->MonthlyColumns(1).reslt(12)); ResetMonthlyGathering(*state); - EXPECT_EQ(0., MonthlyColumns(1).reslt(12)); + EXPECT_EQ(0., state->dataOutRptTab->MonthlyColumns(1).reslt(12)); GatherMonthlyResultsForTimestep(*state, OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 1, MonthlyColumns(1).reslt(12)); + EXPECT_EQ(extLitUse * 1, state->dataOutRptTab->MonthlyColumns(1).reslt(12)); } TEST_F(EnergyPlusFixture, OutputReportTabular_ConfirmResetBEPSGathering) @@ -3779,13 +3779,13 @@ TEST_F(EnergyPlusFixture, OutputTableTimeBins_GetInput) GetInputTabularTimeBins(*state); - EXPECT_EQ(OutputReportTabular::OutputTableBinned.size(), 1u); - EXPECT_EQ(OutputTableBinned(1).keyValue, "SYSTEM1"); - EXPECT_EQ(OutputTableBinned(1).varOrMeter, "SOME TEMPERATURE VARIABLE"); - EXPECT_EQ(OutputTableBinned(1).intervalStart, 0.0); - EXPECT_EQ(OutputTableBinned(1).intervalSize, 0.20); - EXPECT_EQ(OutputTableBinned(1).intervalCount, 5); - EXPECT_EQ(OutputTableBinned(1).ScheduleName, "ALWAYS1"); + EXPECT_EQ(state->dataOutRptTab->OutputTableBinned.size(), 1u); + EXPECT_EQ(state->dataOutRptTab->OutputTableBinned(1).keyValue, "SYSTEM1"); + EXPECT_EQ(state->dataOutRptTab->OutputTableBinned(1).varOrMeter, "SOME TEMPERATURE VARIABLE"); + EXPECT_EQ(state->dataOutRptTab->OutputTableBinned(1).intervalStart, 0.0); + EXPECT_EQ(state->dataOutRptTab->OutputTableBinned(1).intervalSize, 0.20); + EXPECT_EQ(state->dataOutRptTab->OutputTableBinned(1).intervalCount, 5); + EXPECT_EQ(state->dataOutRptTab->OutputTableBinned(1).ScheduleName, "ALWAYS1"); } // TEST_F( EnergyPlusFixture, FinAndOverhangCount ) @@ -7217,13 +7217,13 @@ TEST_F(EnergyPlusFixture, OutputReportTabularMonthlyPredefined_FindNeededOutputV OutputReportTabular::InitializeTabularMonthly(*state); // We check that the Predefined Table is actually set to show - EXPECT_EQ("SetpointsNotMetWithTemperaturesMonthly", namedMonthly(31).title); - EXPECT_TRUE(namedMonthly(31).show); + EXPECT_EQ("SetpointsNotMetWithTemperaturesMonthly", state->dataOutRptTab->namedMonthly(31).title); + EXPECT_TRUE(state->dataOutRptTab->namedMonthly(31).show); // Check that it's the only one that's shown for (int i = 1; i <= OutputReportTabular::numNamedMonthly; ++i) { if (i != 31) { - EXPECT_FALSE(OutputReportTabular::namedMonthly(i).show); + EXPECT_FALSE(state->dataOutRptTab->namedMonthly(i).show); } } @@ -7234,7 +7234,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularMonthlyPredefined_FindNeededOutputV // If everything worked, we should have 2 tables, one for each zone. // Previously, KeyCount was 0 because it couldn't find the variable in the OutputVariablesForSimulation // and so the numTables was zero - EXPECT_EQ(OutputReportTabular::MonthlyInput(1).numTables, 2); + EXPECT_EQ(state->dataOutRptTab->MonthlyInput(1).numTables, 2); } // https://github.com/NREL/EnergyPlus/issues/6442 TEST_F(SQLiteFixture, OutputReportTabularTest_PredefinedTableDXConversion) From b0c68ce36b2faf8e350cc9d903eeae053c75d86f Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Sat, 19 Dec 2020 12:39:42 -0700 Subject: [PATCH 12/14] cleanup --- src/EnergyPlus/OutputReportTabular.cc | 4534 +++++++++++++------------ 1 file changed, 2308 insertions(+), 2226 deletions(-) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index eed029f79e6..8ee86aa5917 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -204,11 +204,13 @@ namespace EnergyPlus::OutputReportTabular { // loop and updates the arrays of data that will later being put // into the tabular reports. + auto &ort(state.dataOutRptTab); + if (t_timeStepType != OutputProcessor::TimeStepType::TimeStepZone && t_timeStepType != OutputProcessor::TimeStepType::TimeStepSystem) { ShowFatalError(state, "Invalid reporting requested -- UpdateTabularReports"); } - if (state.dataOutRptTab->UpdateTabularReportsGetInput) { + if (ort->UpdateTabularReportsGetInput) { GetInputTabularMonthly(state); OutputReportTabularAnnual::GetInputTabularAnnual(state); OutputReportTabularAnnual::checkAggregationOrderForAnnual(state); @@ -223,12 +225,12 @@ namespace EnergyPlus::OutputReportTabular { GetInputFuelAndPollutionFactors(state); SetupUnitConversions(state); AddTOCLoadComponentTableSummaries(state); - state.dataOutRptTab->UpdateTabularReportsGetInput = false; - date_and_time(_, _, _, state.dataOutRptTab->td); + ort->UpdateTabularReportsGetInput = false; + date_and_time(_, _, _, ort->td); } - if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { + if (state.dataGlobal->DoOutputReporting && ort->WriteTabularFiles && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { - state.dataOutRptTab->gatherElapsedTimeBEPS += state.dataGlobal->TimeStepZone; + ort->gatherElapsedTimeBEPS += state.dataGlobal->TimeStepZone; } if (state.dataGlobal->DoWeathSim) { GatherMonthlyResultsForTimestep(state, t_timeStepType); @@ -302,15 +304,16 @@ namespace EnergyPlus::OutputReportTabular { Array1D NumArray; // numeric data int IOStat; // IO Status when calling get input subroutine static bool ErrorsFound(false); + auto &ort(state.dataOutRptTab); if (!(state.files.outputControl.tabular || state.files.outputControl.sqlite)) { - state.dataOutRptTab->WriteTabularFiles = false; + ort->WriteTabularFiles = false; return; } - state.dataOutRptTab->MonthlyInputCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - if (state.dataOutRptTab->MonthlyInputCount > 0) { - state.dataOutRptTab->WriteTabularFiles = true; + ort->MonthlyInputCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + if (ort->MonthlyInputCount > 0) { + ort->WriteTabularFiles = true; // if not a run period using weather do not create reports if (!state.dataGlobal->DoWeathSim) { ShowWarningError(state, CurrentModuleObject + " requested with SimulationControl Run Simulation for Weather File Run Periods set to No so " + @@ -321,7 +324,7 @@ namespace EnergyPlus::OutputReportTabular { inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, NumParams, NumAlphas, NumNums); AlphArray.allocate(NumAlphas); NumArray.dimension(NumNums, 0.0); - for (int TabNum = 1, TabNum_end = state.dataOutRptTab->MonthlyInputCount; TabNum <= TabNum_end; ++TabNum) { // MonthlyInputCount is modified in the loop + for (int TabNum = 1, TabNum_end = ort->MonthlyInputCount; TabNum <= TabNum_end; ++TabNum) { // MonthlyInputCount is modified in the loop inputProcessor->getObjectItem(state, CurrentModuleObject, TabNum, AlphArray, NumAlphas, NumArray, NumNums, IOStat); if (TabNum - 1 > 0) { @@ -366,7 +369,7 @@ namespace EnergyPlus::OutputReportTabular { curAggType = iAggType::MinimumDuringHoursShown; } else { curAggType = iAggType::SumOrAvg; - ShowWarningError(state, CurrentModuleObject + '=' + state.dataOutRptTab->MonthlyInput(TabNum).name + ", Variable name=" + AlphArray(jField)); + ShowWarningError(state, CurrentModuleObject + '=' + ort->MonthlyInput(TabNum).name + ", Variable name=" + AlphArray(jField)); ShowContinueError(state, "Invalid aggregation type=\"" + curAggString + "\" Defaulting to SumOrAverage."); } AddMonthlyFieldSetInput(state, curTable, AlphArray(jField), "", curAggType); @@ -409,22 +412,23 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int const SizeAdder(25); + auto &ort(state.dataOutRptTab); - if (!allocated(state.dataOutRptTab->MonthlyInput)) { - state.dataOutRptTab->MonthlyInput.allocate(SizeAdder); - state.dataOutRptTab->sizeMonthlyInput = SizeAdder; - state.dataOutRptTab->MonthlyInputCount = 1; + if (!allocated(ort->MonthlyInput)) { + ort->MonthlyInput.allocate(SizeAdder); + ort->sizeMonthlyInput = SizeAdder; + ort->MonthlyInputCount = 1; } else { - ++state.dataOutRptTab->MonthlyInputCount; + ++ort->MonthlyInputCount; // if larger than current size grow the array - if (state.dataOutRptTab->MonthlyInputCount > state.dataOutRptTab->sizeMonthlyInput) { - state.dataOutRptTab->MonthlyInput.redimension(state.dataOutRptTab->sizeMonthlyInput += SizeAdder); + if (ort->MonthlyInputCount > ort->sizeMonthlyInput) { + ort->MonthlyInput.redimension(ort->sizeMonthlyInput += SizeAdder); } } // initialize new record - state.dataOutRptTab->MonthlyInput(state.dataOutRptTab->MonthlyInputCount).name = inReportName; - state.dataOutRptTab->MonthlyInput(state.dataOutRptTab->MonthlyInputCount).showDigits = inNumDigitsShown; - return state.dataOutRptTab->MonthlyInputCount; + ort->MonthlyInput(ort->MonthlyInputCount).name = inReportName; + ort->MonthlyInput(ort->MonthlyInputCount).showDigits = inNumDigitsShown; + return ort->MonthlyInputCount; } void AddMonthlyFieldSetInput(EnergyPlusData &state, int const inMonthReport, std::string const &inVariMeter, std::string const &inColHead, iAggType const inAggregate) @@ -452,6 +456,7 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE PARAMETER DEFINITIONS: int const sizeIncrement(50); + auto &ort(state.dataOutRptTab); // INTERFACE BLOCK SPECIFICATIONS: // na @@ -462,29 +467,29 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na - if (!allocated(state.dataOutRptTab->MonthlyFieldSetInput)) { - state.dataOutRptTab->MonthlyFieldSetInput.allocate(sizeIncrement); - state.dataOutRptTab->sizeMonthlyFieldSetInput = sizeIncrement; - state.dataOutRptTab->MonthlyFieldSetInputCount = 1; + if (!allocated(ort->MonthlyFieldSetInput)) { + ort->MonthlyFieldSetInput.allocate(sizeIncrement); + ort->sizeMonthlyFieldSetInput = sizeIncrement; + ort->MonthlyFieldSetInputCount = 1; } else { - ++state.dataOutRptTab->MonthlyFieldSetInputCount; + ++ort->MonthlyFieldSetInputCount; // if larger than current size grow the array - if (state.dataOutRptTab->MonthlyFieldSetInputCount > state.dataOutRptTab->sizeMonthlyFieldSetInput) { - state.dataOutRptTab->MonthlyFieldSetInput.redimension(state.dataOutRptTab->sizeMonthlyFieldSetInput *= + if (ort->MonthlyFieldSetInputCount > ort->sizeMonthlyFieldSetInput) { + ort->MonthlyFieldSetInput.redimension(ort->sizeMonthlyFieldSetInput *= 2); // Tuned Changed += sizeIncrement to *= 2 for reduced heap allocations (at some space cost) } } // initialize new record) - state.dataOutRptTab->MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).variMeter = inVariMeter; - state.dataOutRptTab->MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).colHead = inColHead; - state.dataOutRptTab->MonthlyFieldSetInput(state.dataOutRptTab->MonthlyFieldSetInputCount).aggregate = inAggregate; + ort->MonthlyFieldSetInput(ort->MonthlyFieldSetInputCount).variMeter = inVariMeter; + ort->MonthlyFieldSetInput(ort->MonthlyFieldSetInputCount).colHead = inColHead; + ort->MonthlyFieldSetInput(ort->MonthlyFieldSetInputCount).aggregate = inAggregate; // update the references from the MonthlyInput array - if ((inMonthReport > 0) && (inMonthReport <= state.dataOutRptTab->MonthlyInputCount)) { - if (state.dataOutRptTab->MonthlyInput(inMonthReport).firstFieldSet == 0) { - state.dataOutRptTab->MonthlyInput(inMonthReport).firstFieldSet = state.dataOutRptTab->MonthlyFieldSetInputCount; - state.dataOutRptTab->MonthlyInput(inMonthReport).numFieldSet = 1; + if ((inMonthReport > 0) && (inMonthReport <= ort->MonthlyInputCount)) { + if (ort->MonthlyInput(inMonthReport).firstFieldSet == 0) { + ort->MonthlyInput(inMonthReport).firstFieldSet = ort->MonthlyFieldSetInputCount; + ort->MonthlyInput(inMonthReport).numFieldSet = 1; } else { - ++state.dataOutRptTab->MonthlyInput(inMonthReport).numFieldSet; + ++ort->MonthlyInput(inMonthReport).numFieldSet; } } } @@ -558,12 +563,12 @@ namespace EnergyPlus::OutputReportTabular { bool environmentKeyFound; static bool VarWarning(true); static int ErrCount1(0); - // INTEGER :: maxKeyCount + auto &ort(state.dataOutRptTab); // if not a running a weather simulation do not create reports if (!state.dataGlobal->DoWeathSim) return; - state.dataOutRptTab->maxUniqueKeyCount = 1500; - UniqueKeyNames.allocate(state.dataOutRptTab->maxUniqueKeyCount); + ort->maxUniqueKeyCount = 1500; + UniqueKeyNames.allocate(ort->maxUniqueKeyCount); // First pass through the input objects is to put the name of the report // into the array and count the number of unique keys found to allocate // the monthlyTables and monthlyColumns @@ -580,12 +585,12 @@ namespace EnergyPlus::OutputReportTabular { // ALLOCATE(IndexesForKeyVar(maxKeyCount)) //#endif - state.dataOutRptTab->MonthlyColumnsCount = 0; - state.dataOutRptTab->MonthlyTablesCount = 0; - for (TabNum = 1; TabNum <= state.dataOutRptTab->MonthlyInputCount; ++TabNum) { + ort->MonthlyColumnsCount = 0; + ort->MonthlyTablesCount = 0; + for (TabNum = 1; TabNum <= ort->MonthlyInputCount; ++TabNum) { // the number of columns based on number of alpha fields - NumColumns = state.dataOutRptTab->MonthlyInput(TabNum).numFieldSet; - FirstColumn = state.dataOutRptTab->MonthlyInput(TabNum).firstFieldSet; + NumColumns = ort->MonthlyInput(TabNum).numFieldSet; + FirstColumn = ort->MonthlyInput(TabNum).firstFieldSet; environmentKeyFound = false; UniqueKeyCount = 0; for (colNum = 1; colNum <= NumColumns; ++colNum) { @@ -593,11 +598,11 @@ namespace EnergyPlus::OutputReportTabular { //#ifdef ITM_KEYCACHE // Noel comment: First time in this TabNum/ColNum loop, let's save the results // of GetVariableKeyCountandType & GetVariableKeys. - curVariMeter = UtilityRoutines::MakeUPPERCase(state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeter); + curVariMeter = UtilityRoutines::MakeUPPERCase(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeter); // call the key count function but only need count during this pass GetVariableKeyCountandType(state, curVariMeter, KeyCount, TypeVar, AvgSumVar, StepTypeVar, UnitsVar); if (TypeVar == OutputProcessor::VarType_NotFound) { - ShowWarningError(state, "In Output:Table:Monthly '" + state.dataOutRptTab->MonthlyInput(TabNum).name + "' invalid Variable or Meter Name '" + curVariMeter + "'"); + ShowWarningError(state, "In Output:Table:Monthly '" + ort->MonthlyInput(TabNum).name + "' invalid Variable or Meter Name '" + curVariMeter + "'"); } // IF (KeyCount > maxKeyCount) THEN // DEALLOCATE(NamesOfKeys) @@ -606,22 +611,22 @@ namespace EnergyPlus::OutputReportTabular { // ALLOCATE(NamesOfKeys(maxKeyCount)) // ALLOCATE(IndexesForKeyVar(maxKeyCount)) // ENDIF - state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys.allocate(KeyCount); - state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar.allocate(KeyCount); + ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys.allocate(KeyCount); + ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar.allocate(KeyCount); // fill keys? GetVariableKeys(state, curVariMeter, TypeVar, - state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys, - state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar); + ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys, + ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar); // save these values to use later -- noel - state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper = curVariMeter; - state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar = TypeVar; - state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount = KeyCount; - state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum = AvgSumVar; - state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType = StepTypeVar; - state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits = UnitsVar; + ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper = curVariMeter; + ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar = TypeVar; + ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount = KeyCount; + ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum = AvgSumVar; + ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType = StepTypeVar; + ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits = UnitsVar; // DO iKey = 1, KeyCount // MonthlyFieldSetInput(FirstColumn + ColNum - 1)%NamesOfKeys(iKey) = NamesOfKeys(iKey) !noel // MonthlyFieldSetInput(FirstColumn + ColNum - 1)%IndexesForKeyVar(iKey) = IndexesForKeyVar(iKey) !noel @@ -638,22 +643,22 @@ namespace EnergyPlus::OutputReportTabular { for (iKey = 1; iKey <= KeyCount; ++iKey) { found = 0; // set a flag if environment variables are found - if (UtilityRoutines::SameString(state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { + if (UtilityRoutines::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { environmentKeyFound = true; found = -1; // so not counted in list of unique keys } for (jUnique = 1; jUnique <= UniqueKeyCount; ++jUnique) { - if (UtilityRoutines::SameString(UniqueKeyNames(jUnique), state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { + if (UtilityRoutines::SameString(UniqueKeyNames(jUnique), ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { found = jUnique; break; } } if (found == 0) { ++UniqueKeyCount; - if (UniqueKeyCount > state.dataOutRptTab->maxUniqueKeyCount) { - UniqueKeyNames.redimension(state.dataOutRptTab->maxUniqueKeyCount += 500); + if (UniqueKeyCount > ort->maxUniqueKeyCount) { + UniqueKeyNames.redimension(ort->maxUniqueKeyCount += 500); } - UniqueKeyNames(UniqueKeyCount) = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey); + UniqueKeyNames(UniqueKeyCount) = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey); } } //#ifdef ITM_KEYCACHE @@ -668,22 +673,22 @@ namespace EnergyPlus::OutputReportTabular { UniqueKeyCount = 1; } // increment the number of tables based on the number of unique keys - state.dataOutRptTab->MonthlyTablesCount += UniqueKeyCount; - state.dataOutRptTab->MonthlyColumnsCount += UniqueKeyCount * NumColumns; + ort->MonthlyTablesCount += UniqueKeyCount; + ort->MonthlyColumnsCount += UniqueKeyCount * NumColumns; } // TabNum the end of the loop through the inputs objects // Now that we have the maximum size of the number of tables (each table is // repeated for the number of keys found) and the number of total columns // of all of the tables, allocate the arrays to store this information. - state.dataOutRptTab->MonthlyTables.allocate(state.dataOutRptTab->MonthlyTablesCount); - state.dataOutRptTab->MonthlyColumns.allocate(state.dataOutRptTab->MonthlyColumnsCount); + ort->MonthlyTables.allocate(ort->MonthlyTablesCount); + ort->MonthlyColumns.allocate(ort->MonthlyColumnsCount); // Initialize tables and results - for (auto &e : state.dataOutRptTab->MonthlyTables) { + for (auto &e : ort->MonthlyTables) { e.keyValue.clear(); e.firstColumn = 0; e.numColumns = 0; } - for (auto &e : state.dataOutRptTab->MonthlyColumns) { + for (auto &e : ort->MonthlyColumns) { e.varName.clear(); e.varNum = 0; e.typeOfVar = 0; @@ -692,29 +697,29 @@ namespace EnergyPlus::OutputReportTabular { e.units = OutputProcessor::Unit::None; e.aggType = iAggType::Unassigned; } - for (colNum = 1; colNum <= state.dataOutRptTab->MonthlyColumnsCount; ++colNum) { - state.dataOutRptTab->MonthlyColumns(colNum).reslt = 0.0; - state.dataOutRptTab->MonthlyColumns(colNum).timeStamp = 0; - state.dataOutRptTab->MonthlyColumns(colNum).duration = 0.0; + for (colNum = 1; colNum <= ort->MonthlyColumnsCount; ++colNum) { + ort->MonthlyColumns(colNum).reslt = 0.0; + ort->MonthlyColumns(colNum).timeStamp = 0; + ort->MonthlyColumns(colNum).duration = 0.0; } ColumnsRecount = 0; TablesRecount = 0; - for (TabNum = 1; TabNum <= state.dataOutRptTab->MonthlyInputCount; ++TabNum) { + for (TabNum = 1; TabNum <= ort->MonthlyInputCount; ++TabNum) { // the number of columns based on number of alpha fields - NumColumns = state.dataOutRptTab->MonthlyInput(TabNum).numFieldSet; - FirstColumn = state.dataOutRptTab->MonthlyInput(TabNum).firstFieldSet; + NumColumns = ort->MonthlyInput(TabNum).numFieldSet; + FirstColumn = ort->MonthlyInput(TabNum).firstFieldSet; UniqueKeyCount = 0; environmentKeyFound = false; for (colNum = 1; colNum <= NumColumns; ++colNum) { //#ifdef ITM_KEYCACHE // Noel comment: Here is where we could use the saved values - curVariMeter = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper; - KeyCount = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount; - TypeVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar; - AvgSumVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum; - StepTypeVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType; - UnitsVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits; + curVariMeter = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper; + KeyCount = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount; + TypeVar = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar; + AvgSumVar = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum; + StepTypeVar = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType; + UnitsVar = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits; // DO iKey = 1, KeyCount !noel // NamesOfKeys(iKey) = MonthlyFieldSetInput(FirstColumn + ColNum - 1)%NamesOfKeys(iKey) !noel // IndexesForKeyVar(iKey) = MonthlyFieldSetInput(FirstColumn + ColNum - 1)%IndexesForKeyVar(iKey) !noel @@ -736,7 +741,7 @@ namespace EnergyPlus::OutputReportTabular { } // fixing CR5878 removed the showing of the warning once about a specific variable. if (state.dataGlobal->DisplayExtraWarnings && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { - ShowWarningError(state, "Processing Monthly Tabular Reports: " + state.dataOutRptTab->MonthlyInput(TabNum).name); + ShowWarningError(state, "Processing Monthly Tabular Reports: " + ort->MonthlyInput(TabNum).name); ShowContinueError(state, "..Variable name=" + curVariMeter + " not valid for this simulation."); if (VarWarning) { ShowContinueError(state, "..Variables not valid for this simulation will have \"[Invalid/Undefined]\" in the Units Column of " @@ -748,19 +753,19 @@ namespace EnergyPlus::OutputReportTabular { for (iKey = 1; iKey <= KeyCount; ++iKey) { found = 0; // set a flag if environment variables are found - if (UtilityRoutines::SameString(state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { + if (UtilityRoutines::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { environmentKeyFound = true; found = -1; // so not counted in list of unique keys } for (jUnique = 1; jUnique <= UniqueKeyCount; ++jUnique) { - if (UtilityRoutines::SameString(UniqueKeyNames(jUnique), state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { + if (UtilityRoutines::SameString(UniqueKeyNames(jUnique), ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { found = jUnique; break; } } if (found == 0) { ++UniqueKeyCount; - UniqueKeyNames(UniqueKeyCount) = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey); + UniqueKeyNames(UniqueKeyCount) = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey); } } //#ifdef ITM_KEYCACHE @@ -775,40 +780,40 @@ namespace EnergyPlus::OutputReportTabular { UniqueKeyCount = 1; } // increment the number of tables based on the number of unique keys - state.dataOutRptTab->MonthlyInput(TabNum).firstTable = TablesRecount + 1; - state.dataOutRptTab->MonthlyInput(TabNum).numTables = UniqueKeyCount; + ort->MonthlyInput(TabNum).firstTable = TablesRecount + 1; + ort->MonthlyInput(TabNum).numTables = UniqueKeyCount; TablesRecount += UniqueKeyCount; // loop through the different unique keys since each user defined table // has that many instances - one for each unique key. // It is unusual that this loop is about 'keys' and an inner loop is also // about 'keys' but for this loop the keys are really instances of tables. for (kUniqueKey = 1; kUniqueKey <= UniqueKeyCount; ++kUniqueKey) { - lTable = kUniqueKey + state.dataOutRptTab->MonthlyInput(TabNum).firstTable - 1; + lTable = kUniqueKey + ort->MonthlyInput(TabNum).firstTable - 1; // use the term 'environment' for identifying the report if if (environmentKeyFound && UniqueKeyCount == 1) { - state.dataOutRptTab->MonthlyTables(lTable).keyValue = "Environment"; + ort->MonthlyTables(lTable).keyValue = "Environment"; } else { // this is the most common case is to use the unique key for the report - state.dataOutRptTab->MonthlyTables(lTable).keyValue = UniqueKeyNames(kUniqueKey); + ort->MonthlyTables(lTable).keyValue = UniqueKeyNames(kUniqueKey); } - state.dataOutRptTab->MonthlyTables(lTable).firstColumn = ColumnsRecount + 1; - state.dataOutRptTab->MonthlyTables(lTable).numColumns = NumColumns; + ort->MonthlyTables(lTable).firstColumn = ColumnsRecount + 1; + ort->MonthlyTables(lTable).numColumns = NumColumns; ColumnsRecount += NumColumns; - FirstColumn = state.dataOutRptTab->MonthlyInput(TabNum).firstFieldSet; + FirstColumn = ort->MonthlyInput(TabNum).firstFieldSet; for (colNum = 1; colNum <= NumColumns; ++colNum) { environmentKeyFound = false; - mColumn = colNum + state.dataOutRptTab->MonthlyTables(lTable).firstColumn - 1; + mColumn = colNum + ort->MonthlyTables(lTable).firstColumn - 1; // when going through the columns this time, not all columns may have // a EP variable that corresponds to it. In no variable is found // then set it to 0 to be skipped during data gathering //#ifdef ITM_KEYCACHE // Noel comment: Here is where we could use the saved values - curVariMeter = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper; - KeyCount = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount; - TypeVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar; - AvgSumVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum; - StepTypeVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType; - UnitsVar = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits; + curVariMeter = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeterUpper; + KeyCount = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).keyCount; + TypeVar = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).typeOfVar; + AvgSumVar = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).varAvgSum; + StepTypeVar = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).varStepType; + UnitsVar = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).varUnits; // DO iKey = 1, KeyCount !noel // NamesOfKeys(iKey) = MonthlyFieldSetInput(FirstColumn + ColNum - 1)%NamesOfKeys(iKey) !noel // IndexesForKeyVar(iKey) = MonthlyFieldSetInput(FirstColumn + ColNum - 1)%IndexesForKeyVar(iKey) !noel @@ -823,7 +828,7 @@ namespace EnergyPlus::OutputReportTabular { //#endif if (KeyCount == 1) { // first test if KeyCount is one to avoid referencing a zero element array - if (UtilityRoutines::SameString(state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(1), "ENVIRONMENT")) { + if (UtilityRoutines::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(1), "ENVIRONMENT")) { environmentKeyFound = true; } } @@ -834,7 +839,7 @@ namespace EnergyPlus::OutputReportTabular { // search through the keys for the currently active key "UniqueKeyNames(kUniqueKey)" found = 0; for (iKey = 1; iKey <= KeyCount; ++iKey) { - if (UtilityRoutines::SameString(state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), + if (UtilityRoutines::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), UniqueKeyNames(kUniqueKey))) { found = iKey; break; @@ -842,54 +847,54 @@ namespace EnergyPlus::OutputReportTabular { } } if ((found > 0) && (KeyCount >= 1)) { - state.dataOutRptTab->MonthlyColumns(mColumn).varName = curVariMeter; - state.dataOutRptTab->MonthlyColumns(mColumn).varNum = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar(found); - state.dataOutRptTab->MonthlyColumns(mColumn).typeOfVar = TypeVar; - state.dataOutRptTab->MonthlyColumns(mColumn).avgSum = AvgSumVar; - state.dataOutRptTab->MonthlyColumns(mColumn).stepType = StepTypeVar; - state.dataOutRptTab->MonthlyColumns(mColumn).units = UnitsVar; - state.dataOutRptTab->MonthlyColumns(mColumn).aggType = state.dataOutRptTab->MonthlyFieldSetInput(FirstColumn + colNum - 1).aggregate; + ort->MonthlyColumns(mColumn).varName = curVariMeter; + ort->MonthlyColumns(mColumn).varNum = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).IndexesForKeyVar(found); + ort->MonthlyColumns(mColumn).typeOfVar = TypeVar; + ort->MonthlyColumns(mColumn).avgSum = AvgSumVar; + ort->MonthlyColumns(mColumn).stepType = StepTypeVar; + ort->MonthlyColumns(mColumn).units = UnitsVar; + ort->MonthlyColumns(mColumn).aggType = ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).aggregate; // set accumulator values to default as appropriate for aggregation type { - auto const SELECT_CASE_var(state.dataOutRptTab->MonthlyColumns(mColumn).aggType); + auto const SELECT_CASE_var(ort->MonthlyColumns(mColumn).aggType); if (SELECT_CASE_var == iAggType::SumOrAvg) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; - state.dataOutRptTab->MonthlyColumns(mColumn).duration = 0.0; + ort->MonthlyColumns(mColumn).reslt = 0.0; + ort->MonthlyColumns(mColumn).duration = 0.0; } else if (SELECT_CASE_var == iAggType::Maximum) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); - state.dataOutRptTab->MonthlyColumns(mColumn).timeStamp = 0; + ort->MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); + ort->MonthlyColumns(mColumn).timeStamp = 0; } else if (SELECT_CASE_var == iAggType::Minimum) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = HUGE_(BigNum); - state.dataOutRptTab->MonthlyColumns(mColumn).timeStamp = 0; + ort->MonthlyColumns(mColumn).reslt = HUGE_(BigNum); + ort->MonthlyColumns(mColumn).timeStamp = 0; } else if (SELECT_CASE_var == iAggType::ValueWhenMaxMin) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; + ort->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursZero) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; + ort->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursNonZero) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; + ort->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursPositive) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; + ort->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursNonPositive) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; + ort->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursNegative) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; + ort->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::HoursNonNegative) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; + ort->MonthlyColumns(mColumn).reslt = 0.0; } else if (SELECT_CASE_var == iAggType::SumOrAverageHoursShown) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = 0.0; - state.dataOutRptTab->MonthlyColumns(mColumn).duration = 0.0; + ort->MonthlyColumns(mColumn).reslt = 0.0; + ort->MonthlyColumns(mColumn).duration = 0.0; } else if (SELECT_CASE_var == iAggType::MaximumDuringHoursShown) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); - state.dataOutRptTab->MonthlyColumns(mColumn).timeStamp = 0; + ort->MonthlyColumns(mColumn).reslt = -HUGE_(BigNum); + ort->MonthlyColumns(mColumn).timeStamp = 0; } else if (SELECT_CASE_var == iAggType::MinimumDuringHoursShown) { - state.dataOutRptTab->MonthlyColumns(mColumn).reslt = HUGE_(BigNum); - state.dataOutRptTab->MonthlyColumns(mColumn).timeStamp = 0; + ort->MonthlyColumns(mColumn).reslt = HUGE_(BigNum); + ort->MonthlyColumns(mColumn).timeStamp = 0; } } } else { // if no key corresponds to this instance of the report // fixing CR5878 removed the showing of the warning once about a specific variable. if (state.dataGlobal->DisplayExtraWarnings && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { - ShowWarningError(state, "Processing Monthly Tabular Reports: " + state.dataOutRptTab->MonthlyInput(TabNum).name); + ShowWarningError(state, "Processing Monthly Tabular Reports: " + ort->MonthlyInput(TabNum).name); ShowContinueError(state, "..Variable name=" + curVariMeter + " not valid for this simulation."); ShowContinueError(state, "..i.e., Variable name=" + UniqueKeyNames(kUniqueKey) + ':' + curVariMeter + " not valid for this simulation."); @@ -899,13 +904,13 @@ namespace EnergyPlus::OutputReportTabular { VarWarning = false; } } - state.dataOutRptTab->MonthlyColumns(mColumn).varName = curVariMeter; - state.dataOutRptTab->MonthlyColumns(mColumn).varNum = 0; - state.dataOutRptTab->MonthlyColumns(mColumn).typeOfVar = 0; - state.dataOutRptTab->MonthlyColumns(mColumn).avgSum = OutputProcessor::StoreType::Averaged; - state.dataOutRptTab->MonthlyColumns(mColumn).stepType = OutputProcessor::TimeStepType::TimeStepZone; - state.dataOutRptTab->MonthlyColumns(mColumn).units = OutputProcessor::Unit::None; - state.dataOutRptTab->MonthlyColumns(mColumn).aggType = iAggType::SumOrAvg; + ort->MonthlyColumns(mColumn).varName = curVariMeter; + ort->MonthlyColumns(mColumn).varNum = 0; + ort->MonthlyColumns(mColumn).typeOfVar = 0; + ort->MonthlyColumns(mColumn).avgSum = OutputProcessor::StoreType::Averaged; + ort->MonthlyColumns(mColumn).stepType = OutputProcessor::TimeStepType::TimeStepZone; + ort->MonthlyColumns(mColumn).units = OutputProcessor::Unit::None; + ort->MonthlyColumns(mColumn).aggType = iAggType::SumOrAvg; } //#ifdef ITM_KEYCACHE //#else @@ -924,22 +929,23 @@ namespace EnergyPlus::OutputReportTabular { bool isInvalidAggregationOrder(EnergyPlusData &state) { + auto &ort(state.dataOutRptTab); bool foundError = false; if (!state.dataGlobal->DoWeathSim) { // if no weather simulation than no reading of MonthlyInput array return foundError; } - for (int iInput = 1; iInput <= state.dataOutRptTab->MonthlyInputCount; ++iInput) { + for (int iInput = 1; iInput <= ort->MonthlyInputCount; ++iInput) { bool foundMinOrMax = false; bool foundHourAgg = false; bool missingMaxOrMinError = false; bool missingHourAggError = false; - for (int jTable = 1; jTable <= state.dataOutRptTab->MonthlyInput(iInput).numTables; ++jTable) { - int curTable = jTable + state.dataOutRptTab->MonthlyInput(iInput).firstTable - 1; + for (int jTable = 1; jTable <= ort->MonthlyInput(iInput).numTables; ++jTable) { + int curTable = jTable + ort->MonthlyInput(iInput).firstTable - 1; // test if the aggregation types are in the correct order - for (int kColumn = 1; kColumn <= state.dataOutRptTab->MonthlyTables(curTable).numColumns; ++kColumn) { - int curCol = kColumn + state.dataOutRptTab->MonthlyTables(curTable).firstColumn - 1; - if (state.dataOutRptTab->MonthlyColumns(curCol).varNum == 0) break; // if no variable was ever found than stop checking - iAggType curAggType = state.dataOutRptTab->MonthlyColumns(curCol).aggType; + for (int kColumn = 1; kColumn <= ort->MonthlyTables(curTable).numColumns; ++kColumn) { + int curCol = kColumn + ort->MonthlyTables(curTable).firstColumn - 1; + if (ort->MonthlyColumns(curCol).varNum == 0) break; // if no variable was ever found than stop checking + iAggType curAggType = ort->MonthlyColumns(curCol).aggType; if ((curAggType == iAggType::Maximum) || (curAggType == iAggType::Minimum)) { foundMinOrMax = true; } else if ((curAggType == iAggType::HoursNonZero) || (curAggType == iAggType::HoursZero) || (curAggType == iAggType::HoursPositive) || @@ -959,13 +965,13 @@ namespace EnergyPlus::OutputReportTabular { } } if (missingMaxOrMinError) { - ShowSevereError(state, "The Output:Table:Monthly report named=\"" + state.dataOutRptTab->MonthlyInput(iInput).name + + ShowSevereError(state, "The Output:Table:Monthly report named=\"" + ort->MonthlyInput(iInput).name + "\" has a valueWhenMaxMin aggregation type for a column without a previous column that uses either the minimum or " "maximum aggregation types. The report will not be generated."); foundError = true; } if (missingHourAggError) { - ShowSevereError(state, "The Output:Table:Monthly report named=\"" + state.dataOutRptTab->MonthlyInput(iInput).name + + ShowSevereError(state, "The Output:Table:Monthly report named=\"" + ort->MonthlyInput(iInput).name + "\" has a --DuringHoursShown aggregation type for a column without a previous field that uses one of the Hour-- " "aggregation types. The report will not be generated."); foundError = true; @@ -1026,9 +1032,10 @@ namespace EnergyPlus::OutputReportTabular { Array1D_string objNames; Array1D_int objVarIDs; + auto &ort(state.dataOutRptTab); if (!(state.files.outputControl.tabular || state.files.outputControl.sqlite)) { - state.dataOutRptTab->WriteTabularFiles = false; + ort->WriteTabularFiles = false; return; } @@ -1036,12 +1043,12 @@ namespace EnergyPlus::OutputReportTabular { AlphArray.allocate(NumAlphas); NumArray.dimension(NumNums, 0.0); - state.dataOutRptTab->timeInYear = 0.0; // initialize the time in year counter + ort->timeInYear = 0.0; // initialize the time in year counter // determine size of array that holds the IDF description - state.dataOutRptTab->OutputTableBinnedCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - state.dataOutRptTab->OutputTableBinned.allocate(state.dataOutRptTab->OutputTableBinnedCount); - if (state.dataOutRptTab->OutputTableBinnedCount > 0) { - state.dataOutRptTab->WriteTabularFiles = true; + ort->OutputTableBinnedCount = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + ort->OutputTableBinned.allocate(ort->OutputTableBinnedCount); + if (ort->OutputTableBinnedCount > 0) { + ort->WriteTabularFiles = true; // if not a run period using weather do not create reports if (!state.dataGlobal->DoWeathSim) { ShowWarningError(state, CurrentModuleObject + " requested with SimulationControl Run Simulation for Weather File Run Periods set to No so " + @@ -1050,9 +1057,9 @@ namespace EnergyPlus::OutputReportTabular { } } // looking for maximum number of intervals for sizing - state.dataOutRptTab->BinResultsIntervalCount = 0; - state.dataOutRptTab->BinResultsTableCount = 0; - for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { + ort->BinResultsIntervalCount = 0; + ort->BinResultsTableCount = 0; + for (iInObj = 1; iInObj <= ort->OutputTableBinnedCount; ++iInObj) { inputProcessor->getObjectItem(state, CurrentModuleObject, iInObj, @@ -1065,17 +1072,17 @@ namespace EnergyPlus::OutputReportTabular { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - state.dataOutRptTab->OutputTableBinned(iInObj).keyValue = AlphArray(1); - state.dataOutRptTab->OutputTableBinned(iInObj).varOrMeter = AlphArray(2); + ort->OutputTableBinned(iInObj).keyValue = AlphArray(1); + ort->OutputTableBinned(iInObj).varOrMeter = AlphArray(2); // if a schedule has been specified assign if (len(AlphArray(3)) > 0) { - state.dataOutRptTab->OutputTableBinned(iInObj).ScheduleName = AlphArray(3); - state.dataOutRptTab->OutputTableBinned(iInObj).scheduleIndex = GetScheduleIndex(state, AlphArray(3)); - if (state.dataOutRptTab->OutputTableBinned(iInObj).scheduleIndex == 0) { + ort->OutputTableBinned(iInObj).ScheduleName = AlphArray(3); + ort->OutputTableBinned(iInObj).scheduleIndex = GetScheduleIndex(state, AlphArray(3)); + if (ort->OutputTableBinned(iInObj).scheduleIndex == 0) { ShowWarningError(state, CurrentModuleObject + ": invalid " + cAlphaFieldNames(3) + "=\"" + AlphArray(3) + "\" - not found."); } } else { - state.dataOutRptTab->OutputTableBinned(iInObj).scheduleIndex = 0; // flag value for no schedule used + ort->OutputTableBinned(iInObj).scheduleIndex = 0; // flag value for no schedule used } // validate the kind of variable - not used internally except for validation if (len(AlphArray(4)) > 0) { @@ -1085,61 +1092,61 @@ namespace EnergyPlus::OutputReportTabular { " the Variable Type was not energy, demand, temperature, or flowrate."); } } - state.dataOutRptTab->OutputTableBinned(iInObj).intervalStart = NumArray(1); - state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize = NumArray(2); - state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount = int(NumArray(3)); + ort->OutputTableBinned(iInObj).intervalStart = NumArray(1); + ort->OutputTableBinned(iInObj).intervalSize = NumArray(2); + ort->OutputTableBinned(iInObj).intervalCount = int(NumArray(3)); // valid range checking on inputs - if (state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount < 1) { - state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount = 1; + if (ort->OutputTableBinned(iInObj).intervalCount < 1) { + ort->OutputTableBinned(iInObj).intervalCount = 1; } - if (state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount > 20) { - state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount = 20; + if (ort->OutputTableBinned(iInObj).intervalCount > 20) { + ort->OutputTableBinned(iInObj).intervalCount = 20; } - if (state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize < 0) { - state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize = 1000.0; + if (ort->OutputTableBinned(iInObj).intervalSize < 0) { + ort->OutputTableBinned(iInObj).intervalSize = 1000.0; } - state.dataOutRptTab->OutputTableBinned(iInObj).resIndex = state.dataOutRptTab->BinResultsTableCount + 1; // the next results report + ort->OutputTableBinned(iInObj).resIndex = ort->BinResultsTableCount + 1; // the next results report // find maximum number of intervals - if (state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount > state.dataOutRptTab->BinResultsIntervalCount) { - state.dataOutRptTab->BinResultsIntervalCount = state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount; - } - GetVariableKeyCountandType(state, state.dataOutRptTab->OutputTableBinned(iInObj).varOrMeter, - state.dataOutRptTab->OutputTableBinned(iInObj).numTables, - state.dataOutRptTab->OutputTableBinned(iInObj).typeOfVar, - state.dataOutRptTab->OutputTableBinned(iInObj).avgSum, - state.dataOutRptTab->OutputTableBinned(iInObj).stepType, - state.dataOutRptTab->OutputTableBinned(iInObj).units); - if (state.dataOutRptTab->OutputTableBinned(iInObj).typeOfVar == 0) { - ShowWarningError(state, CurrentModuleObject + ": User specified meter or variable not found: " + state.dataOutRptTab->OutputTableBinned(iInObj).varOrMeter); + if (ort->OutputTableBinned(iInObj).intervalCount > ort->BinResultsIntervalCount) { + ort->BinResultsIntervalCount = ort->OutputTableBinned(iInObj).intervalCount; + } + GetVariableKeyCountandType(state, ort->OutputTableBinned(iInObj).varOrMeter, + ort->OutputTableBinned(iInObj).numTables, + ort->OutputTableBinned(iInObj).typeOfVar, + ort->OutputTableBinned(iInObj).avgSum, + ort->OutputTableBinned(iInObj).stepType, + ort->OutputTableBinned(iInObj).units); + if (ort->OutputTableBinned(iInObj).typeOfVar == 0) { + ShowWarningError(state, CurrentModuleObject + ": User specified meter or variable not found: " + ort->OutputTableBinned(iInObj).varOrMeter); } // If only a single table key is requested than only one should be counted // later will reset the numTables array pointer but for now use it to know // how many items to scan through - if (state.dataOutRptTab->OutputTableBinned(iInObj).keyValue == "*") { - state.dataOutRptTab->BinResultsTableCount += state.dataOutRptTab->OutputTableBinned(iInObj).numTables; + if (ort->OutputTableBinned(iInObj).keyValue == "*") { + ort->BinResultsTableCount += ort->OutputTableBinned(iInObj).numTables; } else { - ++state.dataOutRptTab->BinResultsTableCount; // if a particular key is requested then only one more report + ++ort->BinResultsTableCount; // if a particular key is requested then only one more report } } // size the arrays that holds the bin results - state.dataOutRptTab->BinResults.allocate(state.dataOutRptTab->BinResultsIntervalCount, state.dataOutRptTab->BinResultsTableCount); - state.dataOutRptTab->BinResultsBelow.allocate(state.dataOutRptTab->BinResultsTableCount); - state.dataOutRptTab->BinResultsAbove.allocate(state.dataOutRptTab->BinResultsTableCount); - state.dataOutRptTab->BinStatistics.allocate(state.dataOutRptTab->BinResultsTableCount); - state.dataOutRptTab->BinObjVarID.allocate(state.dataOutRptTab->BinResultsTableCount); + ort->BinResults.allocate(ort->BinResultsIntervalCount, ort->BinResultsTableCount); + ort->BinResultsBelow.allocate(ort->BinResultsTableCount); + ort->BinResultsAbove.allocate(ort->BinResultsTableCount); + ort->BinStatistics.allocate(ort->BinResultsTableCount); + ort->BinObjVarID.allocate(ort->BinResultsTableCount); // now that the arrays are sized go back and fill in // what ID numbers are used for each table - for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { - firstReport = state.dataOutRptTab->OutputTableBinned(iInObj).resIndex; + for (iInObj = 1; iInObj <= ort->OutputTableBinnedCount; ++iInObj) { + firstReport = ort->OutputTableBinned(iInObj).resIndex; // allocate the arrays to the number of objects - objNames.allocate(state.dataOutRptTab->OutputTableBinned(iInObj).numTables); - objVarIDs.allocate(state.dataOutRptTab->OutputTableBinned(iInObj).numTables); - GetVariableKeys(state, state.dataOutRptTab->OutputTableBinned(iInObj).varOrMeter, state.dataOutRptTab->OutputTableBinned(iInObj).typeOfVar, objNames, objVarIDs); - if (state.dataOutRptTab->OutputTableBinned(iInObj).keyValue == "*") { - for (iTable = 1; iTable <= state.dataOutRptTab->OutputTableBinned(iInObj).numTables; ++iTable) { + objNames.allocate(ort->OutputTableBinned(iInObj).numTables); + objVarIDs.allocate(ort->OutputTableBinned(iInObj).numTables); + GetVariableKeys(state, ort->OutputTableBinned(iInObj).varOrMeter, ort->OutputTableBinned(iInObj).typeOfVar, objNames, objVarIDs); + if (ort->OutputTableBinned(iInObj).keyValue == "*") { + for (iTable = 1; iTable <= ort->OutputTableBinned(iInObj).numTables; ++iTable) { repIndex = firstReport + (iTable - 1); - state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj = objNames(iTable); - state.dataOutRptTab->BinObjVarID(repIndex).varMeterNum = objVarIDs(iTable); + ort->BinObjVarID(repIndex).namesOfObj = objNames(iTable); + ort->BinObjVarID(repIndex).varMeterNum = objVarIDs(iTable); // check if valid meter or number if (objVarIDs(iTable) == 0) { ShowWarningError(state, CurrentModuleObject + ": Specified variable or meter not found: " + objNames(iTable)); @@ -1148,37 +1155,37 @@ namespace EnergyPlus::OutputReportTabular { } else { // scan through the keys and look for the user specified key found = 0; - for (iTable = 1; iTable <= state.dataOutRptTab->OutputTableBinned(iInObj).numTables; ++iTable) { - if (UtilityRoutines::SameString(objNames(iTable), state.dataOutRptTab->OutputTableBinned(iInObj).keyValue)) { + for (iTable = 1; iTable <= ort->OutputTableBinned(iInObj).numTables; ++iTable) { + if (UtilityRoutines::SameString(objNames(iTable), ort->OutputTableBinned(iInObj).keyValue)) { found = iTable; break; } } // the first and only report is assigned to the found object name if (!warningAboutKeyNotFound(state, found, iInObj, CurrentModuleObject)) { - state.dataOutRptTab->BinObjVarID(firstReport).namesOfObj = objNames(found); - state.dataOutRptTab->BinObjVarID(firstReport).varMeterNum = objVarIDs(found); + ort->BinObjVarID(firstReport).namesOfObj = objNames(found); + ort->BinObjVarID(firstReport).varMeterNum = objVarIDs(found); } // reset the number of tables to one - state.dataOutRptTab->OutputTableBinned(iInObj).numTables = 1; + ort->OutputTableBinned(iInObj).numTables = 1; } } // clear the binning arrays to zeros - for (auto &e : state.dataOutRptTab->BinResults) { + for (auto &e : ort->BinResults) { e.mnth = 0.0; e.hrly = 0.0; } - for (auto &e : state.dataOutRptTab->BinResultsBelow) { + for (auto &e : ort->BinResultsBelow) { e.mnth = 0.0; e.hrly = 0.0; } - for (auto &e : state.dataOutRptTab->BinResultsAbove) { + for (auto &e : ort->BinResultsAbove) { e.mnth = 0.0; e.hrly = 0.0; } // initialize statistics counters - for (auto &e : state.dataOutRptTab->BinStatistics) { + for (auto &e : ort->BinStatistics) { e.minimum = HUGE_(bigVal); e.maximum = -HUGE_(bigVal); e.n = 0; @@ -1243,6 +1250,7 @@ namespace EnergyPlus::OutputReportTabular { Array1D_string AlphArray; // character string data Array1D NumArray; // numeric data int IOStat; // IO Status when calling get input subroutine + auto &ort(state.dataOutRptTab); inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, NumParams, NumAlphas, NumNums); AlphArray.allocate(NumAlphas); @@ -1252,10 +1260,10 @@ namespace EnergyPlus::OutputReportTabular { if (NumTabularStyle == 0) { AlphArray(1) = "COMMA"; - state.dataOutRptTab->numStyles = 1; - state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; - state.dataOutRptTab->del(1) = CharComma; // comma - state.dataOutRptTab->unitsStyle = iUnitsStyle::None; + ort->numStyles = 1; + ort->TableStyle(1) = iTableStyle::Comma; + ort->del(1) = CharComma; // comma + ort->unitsStyle = iUnitsStyle::None; } else if (NumTabularStyle == 1) { inputProcessor->getObjectItem(state, CurrentModuleObject, @@ -1271,89 +1279,89 @@ namespace EnergyPlus::OutputReportTabular { cNumericFieldNames); // ColumnSeparator if (UtilityRoutines::SameString(AlphArray(1), "Comma")) { - state.dataOutRptTab->numStyles = 1; - state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; - state.dataOutRptTab->del(1) = CharComma; // comma + ort->numStyles = 1; + ort->TableStyle(1) = iTableStyle::Comma; + ort->del(1) = CharComma; // comma } else if (UtilityRoutines::SameString(AlphArray(1), "Tab")) { - state.dataOutRptTab->numStyles = 1; - state.dataOutRptTab->TableStyle(1) = iTableStyle::Tab; - state.dataOutRptTab->del(1) = CharTab; // tab + ort->numStyles = 1; + ort->TableStyle(1) = iTableStyle::Tab; + ort->del(1) = CharTab; // tab } else if (UtilityRoutines::SameString(AlphArray(1), "Fixed")) { - state.dataOutRptTab->numStyles = 1; - state.dataOutRptTab->TableStyle(1) = iTableStyle::Fixed; - state.dataOutRptTab->del(1) = CharSpace; // space + ort->numStyles = 1; + ort->TableStyle(1) = iTableStyle::Fixed; + ort->del(1) = CharSpace; // space } else if (UtilityRoutines::SameString(AlphArray(1), "HTML")) { - state.dataOutRptTab->numStyles = 1; - state.dataOutRptTab->TableStyle(1) = iTableStyle::HTML; - state.dataOutRptTab->del(1) = CharSpace; // space - this is not used much for HTML output + ort->numStyles = 1; + ort->TableStyle(1) = iTableStyle::HTML; + ort->del(1) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "XML")) { - state.dataOutRptTab->numStyles = 1; - state.dataOutRptTab->TableStyle(1) = iTableStyle::XML; - state.dataOutRptTab->del(1) = CharSpace; // space - this is not used much for XML output + ort->numStyles = 1; + ort->TableStyle(1) = iTableStyle::XML; + ort->del(1) = CharSpace; // space - this is not used much for XML output } else if (UtilityRoutines::SameString(AlphArray(1), "CommaAndHTML")) { - state.dataOutRptTab->numStyles = 2; - state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; - state.dataOutRptTab->del(1) = CharComma; // comma - state.dataOutRptTab->TableStyle(2) = iTableStyle::HTML; - state.dataOutRptTab->del(2) = CharSpace; // space - this is not used much for HTML output + ort->numStyles = 2; + ort->TableStyle(1) = iTableStyle::Comma; + ort->del(1) = CharComma; // comma + ort->TableStyle(2) = iTableStyle::HTML; + ort->del(2) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "CommaAndXML")) { - state.dataOutRptTab->numStyles = 2; - state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; - state.dataOutRptTab->del(1) = CharComma; // comma - state.dataOutRptTab->TableStyle(2) = iTableStyle::XML; - state.dataOutRptTab->del(2) = CharSpace; // space - this is not used much for XML output + ort->numStyles = 2; + ort->TableStyle(1) = iTableStyle::Comma; + ort->del(1) = CharComma; // comma + ort->TableStyle(2) = iTableStyle::XML; + ort->del(2) = CharSpace; // space - this is not used much for XML output } else if (UtilityRoutines::SameString(AlphArray(1), "TabAndHTML")) { - state.dataOutRptTab->numStyles = 2; - state.dataOutRptTab->TableStyle(1) = iTableStyle::Tab; - state.dataOutRptTab->del(1) = CharTab; // tab - state.dataOutRptTab->TableStyle(2) = iTableStyle::HTML; - state.dataOutRptTab->del(2) = CharSpace; // space - this is not used much for HTML output + ort->numStyles = 2; + ort->TableStyle(1) = iTableStyle::Tab; + ort->del(1) = CharTab; // tab + ort->TableStyle(2) = iTableStyle::HTML; + ort->del(2) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "XMLandHTML")) { - state.dataOutRptTab->numStyles = 2; - state.dataOutRptTab->TableStyle(1) = iTableStyle::XML; - state.dataOutRptTab->del(1) = CharSpace; // space - this is not used much for XML output - state.dataOutRptTab->TableStyle(2) = iTableStyle::HTML; - state.dataOutRptTab->del(2) = CharSpace; // space - this is not used much for HTML output + ort->numStyles = 2; + ort->TableStyle(1) = iTableStyle::XML; + ort->del(1) = CharSpace; // space - this is not used much for XML output + ort->TableStyle(2) = iTableStyle::HTML; + ort->del(2) = CharSpace; // space - this is not used much for HTML output } else if (UtilityRoutines::SameString(AlphArray(1), "All")) { - state.dataOutRptTab->numStyles = 5; - state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; - state.dataOutRptTab->del(1) = CharComma; // comma - state.dataOutRptTab->TableStyle(2) = iTableStyle::Tab; - state.dataOutRptTab->del(2) = CharTab; // tab - state.dataOutRptTab->TableStyle(3) = iTableStyle::Fixed; - state.dataOutRptTab->del(3) = CharSpace; // space - state.dataOutRptTab->TableStyle(4) = iTableStyle::HTML; - state.dataOutRptTab->del(4) = CharSpace; // space - this is not used much for HTML output - state.dataOutRptTab->TableStyle(5) = iTableStyle::XML; - state.dataOutRptTab->del(5) = CharSpace; // space - this is not used much for XML output + ort->numStyles = 5; + ort->TableStyle(1) = iTableStyle::Comma; + ort->del(1) = CharComma; // comma + ort->TableStyle(2) = iTableStyle::Tab; + ort->del(2) = CharTab; // tab + ort->TableStyle(3) = iTableStyle::Fixed; + ort->del(3) = CharSpace; // space + ort->TableStyle(4) = iTableStyle::HTML; + ort->del(4) = CharSpace; // space - this is not used much for HTML output + ort->TableStyle(5) = iTableStyle::XML; + ort->del(5) = CharSpace; // space - this is not used much for XML output } else { ShowWarningError(state, CurrentModuleObject + ": Invalid " + cAlphaFieldNames(1) + "=\"" + AlphArray(1) + "\". Commas will be used."); - state.dataOutRptTab->numStyles = 1; - state.dataOutRptTab->TableStyle(1) = iTableStyle::Comma; - state.dataOutRptTab->del(1) = CharComma; // comma + ort->numStyles = 1; + ort->TableStyle(1) = iTableStyle::Comma; + ort->del(1) = CharComma; // comma AlphArray(1) = "COMMA"; } // MonthlyUnitConversion if (NumAlphas >= 2) { - state.dataOutRptTab->unitsStyle = SetUnitsStyleFromString(AlphArray(2)); - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::NotFound) { + ort->unitsStyle = SetUnitsStyleFromString(AlphArray(2)); + if (ort->unitsStyle == iUnitsStyle::NotFound) { ShowWarningError(state, CurrentModuleObject + ": Invalid " + cAlphaFieldNames(2) + "=\"" + AlphArray(2) + "\". No unit conversion will be performed. Normal SI units will be shown."); } } else { - state.dataOutRptTab->unitsStyle = iUnitsStyle::None; + ort->unitsStyle = iUnitsStyle::None; AlphArray(2) = "None"; } } else if (NumTabularStyle > 1) { ShowWarningError(state, CurrentModuleObject + ": Only one instance of this object is allowed. Commas will be used."); - state.dataOutRptTab->TableStyle = iTableStyle::Comma; - state.dataOutRptTab->del = std::string(1, CharComma); // comma + ort->TableStyle = iTableStyle::Comma; + ort->del = std::string(1, CharComma); // comma AlphArray(1) = "COMMA"; - state.dataOutRptTab->unitsStyle = iUnitsStyle::None; + ort->unitsStyle = iUnitsStyle::None; AlphArray(2) = "None"; } - if (state.dataOutRptTab->WriteTabularFiles) { + if (ort->WriteTabularFiles) { print(state.files.eio, "! ,Style,Unit Conversion\n"); if (AlphArray(1) != "HTML") { ConvertCaseToLower(AlphArray(1), AlphArray(2)); @@ -1432,9 +1440,10 @@ namespace EnergyPlus::OutputReportTabular { int jReport; bool nameFound; bool ErrorsFound; + auto &ort(state.dataOutRptTab); if (!(state.files.outputControl.tabular || state.files.outputControl.sqlite)) { - state.dataOutRptTab->WriteTabularFiles = false; + ort->WriteTabularFiles = false; return; } @@ -1450,7 +1459,7 @@ namespace EnergyPlus::OutputReportTabular { // get the object inputProcessor->getObjectItem(state, CurrentModuleObject, 1, AlphArray, NumAlphas, NumArray, NumNums, IOStat); // default all report flags to false (do not get produced) - state.dataOutRptTab->displayTabularBEPS = false; + ort->displayTabularBEPS = false; // initialize the names of the predefined monthly report titles InitializePredefinedMonthlyTitles(state); // loop through the fields looking for matching report titles @@ -1459,222 +1468,222 @@ namespace EnergyPlus::OutputReportTabular { if (AlphArray(iReport).empty()) { ShowFatalError(state, "Blank report name in Output:Table:SummaryReports"); } else if (UtilityRoutines::SameString(AlphArray(iReport), "AnnualBuildingUtilityPerformanceSummary")) { - state.dataOutRptTab->displayTabularBEPS = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayTabularBEPS = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ComponentCostEconomicsSummary")) { - state.dataOutRptTab->displayTabularCompCosts = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayTabularCompCosts = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "InputVerificationandResultsSummary")) { - state.dataOutRptTab->displayTabularVeriSum = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayTabularVeriSum = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ComponentSizingSummary")) { - state.dataOutRptTab->displayComponentSizing = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayComponentSizing = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "SurfaceShadowingSummary")) { - state.dataOutRptTab->displaySurfaceShadowing = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displaySurfaceShadowing = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "DemandEndUseComponentsSummary")) { - state.dataOutRptTab->displayDemandEndUse = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayDemandEndUse = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AdaptiveComfortSummary")) { - state.dataOutRptTab->displayAdaptiveComfort = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayAdaptiveComfort = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "SourceEnergyEndUseComponentsSummary")) { - state.dataOutRptTab->displaySourceEnergyEndUseSummary = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displaySourceEnergyEndUseSummary = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ZoneComponentLoadSummary")) { - state.dataOutRptTab->displayZoneComponentLoadSummary = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayZoneComponentLoadSummary = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AirLoopComponentLoadSummary")) { - state.dataOutRptTab->displayAirLoopComponentLoadSummary = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayAirLoopComponentLoadSummary = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "FacilityComponentLoadSummary")) { - state.dataOutRptTab->displayFacilityComponentLoadSummary = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayFacilityComponentLoadSummary = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "LEEDSummary")) { - state.dataOutRptTab->displayLEEDSummary = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayLEEDSummary = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "LifeCycleCostReport")) { - state.dataOutRptTab->displayLifeCycleCostReport = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayLifeCycleCostReport = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "TariffReport")) { - state.dataOutRptTab->displayTariffReport = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayTariffReport = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "EconomicResultSummary")) { - state.dataOutRptTab->displayEconomicResultSummary = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayEconomicResultSummary = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "HeatEmissionsSummary")) { - state.dataOutRptTab->displayHeatEmissionsSummary = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayHeatEmissionsSummary = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "ThermalResilienceSummary")) { - state.dataOutRptTab->displayThermalResilienceSummary = true; - state.dataOutRptTab->displayThermalResilienceSummaryExplicitly = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayThermalResilienceSummary = true; + ort->displayThermalResilienceSummaryExplicitly = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "CO2ResilienceSummary")) { - state.dataOutRptTab->displayCO2ResilienceSummary = true; - state.dataOutRptTab->displayCO2ResilienceSummaryExplicitly = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayCO2ResilienceSummary = true; + ort->displayCO2ResilienceSummaryExplicitly = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "VisualResilienceSummary")) { - state.dataOutRptTab->displayVisualResilienceSummary = true; - state.dataOutRptTab->displayVisualResilienceSummaryExplicitly = true; - state.dataOutRptTab->WriteTabularFiles = true; + ort->displayVisualResilienceSummary = true; + ort->displayVisualResilienceSummaryExplicitly = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "EnergyMeters")) { - state.dataOutRptTab->WriteTabularFiles = true; + ort->WriteTabularFiles = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "InitializationSummary")) { - state.dataOutRptTab->WriteTabularFiles = true; - state.dataOutRptTab->displayEioSummary = true; + ort->WriteTabularFiles = true; + ort->displayEioSummary = true; nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummary")) { - state.dataOutRptTab->WriteTabularFiles = true; - state.dataOutRptTab->displayTabularBEPS = true; - state.dataOutRptTab->displayTabularVeriSum = true; - state.dataOutRptTab->displayTabularCompCosts = true; - state.dataOutRptTab->displaySurfaceShadowing = true; - state.dataOutRptTab->displayComponentSizing = true; - state.dataOutRptTab->displayDemandEndUse = true; - state.dataOutRptTab->displayAdaptiveComfort = true; - state.dataOutRptTab->displaySourceEnergyEndUseSummary = true; - state.dataOutRptTab->displayLifeCycleCostReport = true; - state.dataOutRptTab->displayTariffReport = true; - state.dataOutRptTab->displayEconomicResultSummary = true; - state.dataOutRptTab->displayEioSummary = true; - state.dataOutRptTab->displayLEEDSummary = true; - state.dataOutRptTab->displayHeatEmissionsSummary = true; - state.dataOutRptTab->displayThermalResilienceSummary = true; - state.dataOutRptTab->displayCO2ResilienceSummary = true; - state.dataOutRptTab->displayVisualResilienceSummary = true; + ort->WriteTabularFiles = true; + ort->displayTabularBEPS = true; + ort->displayTabularVeriSum = true; + ort->displayTabularCompCosts = true; + ort->displaySurfaceShadowing = true; + ort->displayComponentSizing = true; + ort->displayDemandEndUse = true; + ort->displayAdaptiveComfort = true; + ort->displaySourceEnergyEndUseSummary = true; + ort->displayLifeCycleCostReport = true; + ort->displayTariffReport = true; + ort->displayEconomicResultSummary = true; + ort->displayEioSummary = true; + ort->displayLEEDSummary = true; + ort->displayHeatEmissionsSummary = true; + ort->displayThermalResilienceSummary = true; + ort->displayCO2ResilienceSummary = true; + ort->displayVisualResilienceSummary = true; nameFound = true; for (jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { state.dataOutRptPredefined->reportName(jReport).show = true; } } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryAndSizingPeriod")) { - state.dataOutRptTab->WriteTabularFiles = true; - state.dataOutRptTab->displayTabularBEPS = true; - state.dataOutRptTab->displayTabularVeriSum = true; - state.dataOutRptTab->displayTabularCompCosts = true; - state.dataOutRptTab->displaySurfaceShadowing = true; - state.dataOutRptTab->displayComponentSizing = true; - state.dataOutRptTab->displayDemandEndUse = true; - state.dataOutRptTab->displayAdaptiveComfort = true; - state.dataOutRptTab->displaySourceEnergyEndUseSummary = true; - state.dataOutRptTab->displayLifeCycleCostReport = true; - state.dataOutRptTab->displayTariffReport = true; - state.dataOutRptTab->displayEconomicResultSummary = true; - state.dataOutRptTab->displayEioSummary = true; - state.dataOutRptTab->displayLEEDSummary = true; - state.dataOutRptTab->displayHeatEmissionsSummary = true; - state.dataOutRptTab->displayThermalResilienceSummary = true; - state.dataOutRptTab->displayCO2ResilienceSummary = true; - state.dataOutRptTab->displayVisualResilienceSummary = true; + ort->WriteTabularFiles = true; + ort->displayTabularBEPS = true; + ort->displayTabularVeriSum = true; + ort->displayTabularCompCosts = true; + ort->displaySurfaceShadowing = true; + ort->displayComponentSizing = true; + ort->displayDemandEndUse = true; + ort->displayAdaptiveComfort = true; + ort->displaySourceEnergyEndUseSummary = true; + ort->displayLifeCycleCostReport = true; + ort->displayTariffReport = true; + ort->displayEconomicResultSummary = true; + ort->displayEioSummary = true; + ort->displayLEEDSummary = true; + ort->displayHeatEmissionsSummary = true; + ort->displayThermalResilienceSummary = true; + ort->displayCO2ResilienceSummary = true; + ort->displayVisualResilienceSummary = true; nameFound = true; for (jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { state.dataOutRptPredefined->reportName(jReport).show = true; } // the sizing period reports - state.dataOutRptTab->displayZoneComponentLoadSummary = true; - state.dataOutRptTab->displayAirLoopComponentLoadSummary = true; - state.dataOutRptTab->displayFacilityComponentLoadSummary = true; + ort->displayZoneComponentLoadSummary = true; + ort->displayAirLoopComponentLoadSummary = true; + ort->displayFacilityComponentLoadSummary = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllMonthly")) { - state.dataOutRptTab->WriteTabularFiles = true; + ort->WriteTabularFiles = true; for (jReport = 1; jReport <= numNamedMonthly; ++jReport) { - state.dataOutRptTab->namedMonthly(jReport).show = true; + ort->namedMonthly(jReport).show = true; } nameFound = true; } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryAndMonthly")) { - state.dataOutRptTab->WriteTabularFiles = true; - state.dataOutRptTab->displayTabularBEPS = true; - state.dataOutRptTab->displayTabularVeriSum = true; - state.dataOutRptTab->displayTabularCompCosts = true; - state.dataOutRptTab->displaySurfaceShadowing = true; - state.dataOutRptTab->displayComponentSizing = true; - state.dataOutRptTab->displayDemandEndUse = true; - state.dataOutRptTab->displayAdaptiveComfort = true; - state.dataOutRptTab->displaySourceEnergyEndUseSummary = true; - state.dataOutRptTab->displayLifeCycleCostReport = true; - state.dataOutRptTab->displayTariffReport = true; - state.dataOutRptTab->displayEconomicResultSummary = true; - state.dataOutRptTab->displayEioSummary = true; - state.dataOutRptTab->displayLEEDSummary = true; - state.dataOutRptTab->displayHeatEmissionsSummary = true; - state.dataOutRptTab->displayThermalResilienceSummary = true; - state.dataOutRptTab->displayCO2ResilienceSummary = true; - state.dataOutRptTab->displayVisualResilienceSummary = true; + ort->WriteTabularFiles = true; + ort->displayTabularBEPS = true; + ort->displayTabularVeriSum = true; + ort->displayTabularCompCosts = true; + ort->displaySurfaceShadowing = true; + ort->displayComponentSizing = true; + ort->displayDemandEndUse = true; + ort->displayAdaptiveComfort = true; + ort->displaySourceEnergyEndUseSummary = true; + ort->displayLifeCycleCostReport = true; + ort->displayTariffReport = true; + ort->displayEconomicResultSummary = true; + ort->displayEioSummary = true; + ort->displayLEEDSummary = true; + ort->displayHeatEmissionsSummary = true; + ort->displayThermalResilienceSummary = true; + ort->displayCO2ResilienceSummary = true; + ort->displayVisualResilienceSummary = true; nameFound = true; for (jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { state.dataOutRptPredefined->reportName(jReport).show = true; } for (jReport = 1; jReport <= numNamedMonthly; ++jReport) { - state.dataOutRptTab->namedMonthly(jReport).show = true; + ort->namedMonthly(jReport).show = true; } } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryMonthlyAndSizingPeriod")) { - state.dataOutRptTab->WriteTabularFiles = true; - state.dataOutRptTab->displayTabularBEPS = true; - state.dataOutRptTab->displayTabularVeriSum = true; - state.dataOutRptTab->displayTabularCompCosts = true; - state.dataOutRptTab->displaySurfaceShadowing = true; - state.dataOutRptTab->displayComponentSizing = true; - state.dataOutRptTab->displayDemandEndUse = true; - state.dataOutRptTab->displayAdaptiveComfort = true; - state.dataOutRptTab->displaySourceEnergyEndUseSummary = true; - state.dataOutRptTab->displayLifeCycleCostReport = true; - state.dataOutRptTab->displayTariffReport = true; - state.dataOutRptTab->displayEconomicResultSummary = true; - state.dataOutRptTab->displayEioSummary = true; - state.dataOutRptTab->displayLEEDSummary = true; - state.dataOutRptTab->displayHeatEmissionsSummary = true; - state.dataOutRptTab->displayThermalResilienceSummary = true; - state.dataOutRptTab->displayCO2ResilienceSummary = true; - state.dataOutRptTab->displayVisualResilienceSummary = true; + ort->WriteTabularFiles = true; + ort->displayTabularBEPS = true; + ort->displayTabularVeriSum = true; + ort->displayTabularCompCosts = true; + ort->displaySurfaceShadowing = true; + ort->displayComponentSizing = true; + ort->displayDemandEndUse = true; + ort->displayAdaptiveComfort = true; + ort->displaySourceEnergyEndUseSummary = true; + ort->displayLifeCycleCostReport = true; + ort->displayTariffReport = true; + ort->displayEconomicResultSummary = true; + ort->displayEioSummary = true; + ort->displayLEEDSummary = true; + ort->displayHeatEmissionsSummary = true; + ort->displayThermalResilienceSummary = true; + ort->displayCO2ResilienceSummary = true; + ort->displayVisualResilienceSummary = true; nameFound = true; for (jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { state.dataOutRptPredefined->reportName(jReport).show = true; } for (jReport = 1; jReport <= numNamedMonthly; ++jReport) { - state.dataOutRptTab->namedMonthly(jReport).show = true; + ort->namedMonthly(jReport).show = true; } // the sizing period reports - state.dataOutRptTab->displayZoneComponentLoadSummary = true; - state.dataOutRptTab->displayAirLoopComponentLoadSummary = true; - state.dataOutRptTab->displayFacilityComponentLoadSummary = true; + ort->displayZoneComponentLoadSummary = true; + ort->displayAirLoopComponentLoadSummary = true; + ort->displayFacilityComponentLoadSummary = true; } // check the reports that are predefined and are created by OutputReportPredefined for (jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { if (UtilityRoutines::SameString(AlphArray(iReport), state.dataOutRptPredefined->reportName(jReport).name)) { - state.dataOutRptTab->WriteTabularFiles = true; + ort->WriteTabularFiles = true; state.dataOutRptPredefined->reportName(jReport).show = true; nameFound = true; } if (UtilityRoutines::SameString(AlphArray(iReport), state.dataOutRptPredefined->reportName(jReport).abrev)) { - state.dataOutRptTab->WriteTabularFiles = true; + ort->WriteTabularFiles = true; state.dataOutRptPredefined->reportName(jReport).show = true; nameFound = true; } } // check if the predefined monthly reports are used for (jReport = 1; jReport <= numNamedMonthly; ++jReport) { - if (UtilityRoutines::SameString(AlphArray(iReport), state.dataOutRptTab->namedMonthly(jReport).title)) { - state.dataOutRptTab->namedMonthly(jReport).show = true; - state.dataOutRptTab->WriteTabularFiles = true; + if (UtilityRoutines::SameString(AlphArray(iReport), ort->namedMonthly(jReport).title)) { + ort->namedMonthly(jReport).show = true; + ort->WriteTabularFiles = true; nameFound = true; } } @@ -1695,152 +1704,152 @@ namespace EnergyPlus::OutputReportTabular { ShowFatalError(state, CurrentModuleObject + ": Preceding errors cause termination."); } // if the BEPS report has been called for than initialize its arrays - if (state.dataOutRptTab->displayTabularBEPS || state.dataOutRptTab->displayDemandEndUse || state.dataOutRptTab->displaySourceEnergyEndUseSummary || state.dataOutRptTab->displayLEEDSummary) { + if (ort->displayTabularBEPS || ort->displayDemandEndUse || ort->displaySourceEnergyEndUseSummary || ort->displayLEEDSummary) { // initialize the resource type names - state.dataOutRptTab->resourceTypeNames(1) = "Electricity"; - state.dataOutRptTab->resourceTypeNames(2) = "NaturalGas"; - state.dataOutRptTab->resourceTypeNames(3) = "DistrictCooling"; - state.dataOutRptTab->resourceTypeNames(4) = "DistrictHeating"; - state.dataOutRptTab->resourceTypeNames(5) = "Steam"; - state.dataOutRptTab->resourceTypeNames(6) = "Gasoline"; - state.dataOutRptTab->resourceTypeNames(7) = "Water"; - state.dataOutRptTab->resourceTypeNames(8) = "Diesel"; - state.dataOutRptTab->resourceTypeNames(9) = "Coal"; - state.dataOutRptTab->resourceTypeNames(10) = "FuelOilNo1"; - state.dataOutRptTab->resourceTypeNames(11) = "FuelOilNo2"; - state.dataOutRptTab->resourceTypeNames(12) = "Propane"; - state.dataOutRptTab->resourceTypeNames(13) = "OtherFuel1"; - state.dataOutRptTab->resourceTypeNames(14) = "OtherFuel2"; - - state.dataOutRptTab->sourceTypeNames(1) = "Electricity"; - state.dataOutRptTab->sourceTypeNames(2) = "NaturalGas"; - state.dataOutRptTab->sourceTypeNames(3) = "Gasoline"; - state.dataOutRptTab->sourceTypeNames(4) = "Diesel"; - state.dataOutRptTab->sourceTypeNames(5) = "Coal"; - state.dataOutRptTab->sourceTypeNames(6) = "FuelOilNo1"; - state.dataOutRptTab->sourceTypeNames(7) = "FuelOilNo2"; - state.dataOutRptTab->sourceTypeNames(8) = "Propane"; - state.dataOutRptTab->sourceTypeNames(9) = "PurchasedElectric"; - state.dataOutRptTab->sourceTypeNames(10) = "SoldElectric"; - state.dataOutRptTab->sourceTypeNames(11) = "OtherFuel1"; - state.dataOutRptTab->sourceTypeNames(12) = "OtherFuel2"; + ort->resourceTypeNames(1) = "Electricity"; + ort->resourceTypeNames(2) = "NaturalGas"; + ort->resourceTypeNames(3) = "DistrictCooling"; + ort->resourceTypeNames(4) = "DistrictHeating"; + ort->resourceTypeNames(5) = "Steam"; + ort->resourceTypeNames(6) = "Gasoline"; + ort->resourceTypeNames(7) = "Water"; + ort->resourceTypeNames(8) = "Diesel"; + ort->resourceTypeNames(9) = "Coal"; + ort->resourceTypeNames(10) = "FuelOilNo1"; + ort->resourceTypeNames(11) = "FuelOilNo2"; + ort->resourceTypeNames(12) = "Propane"; + ort->resourceTypeNames(13) = "OtherFuel1"; + ort->resourceTypeNames(14) = "OtherFuel2"; + + ort->sourceTypeNames(1) = "Electricity"; + ort->sourceTypeNames(2) = "NaturalGas"; + ort->sourceTypeNames(3) = "Gasoline"; + ort->sourceTypeNames(4) = "Diesel"; + ort->sourceTypeNames(5) = "Coal"; + ort->sourceTypeNames(6) = "FuelOilNo1"; + ort->sourceTypeNames(7) = "FuelOilNo2"; + ort->sourceTypeNames(8) = "Propane"; + ort->sourceTypeNames(9) = "PurchasedElectric"; + ort->sourceTypeNames(10) = "SoldElectric"; + ort->sourceTypeNames(11) = "OtherFuel1"; + ort->sourceTypeNames(12) = "OtherFuel2"; // initialize the end use names - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)) = "Heating"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cooling)) = "Cooling"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorLights)) = "InteriorLights"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)) = "ExteriorLights"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorEquipment)) = "InteriorEquipment"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorEquipment)) = "ExteriorEquipment"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Fans)) = "Fans"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Pumps)) = "Pumps"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRejection)) = "HeatRejection"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Humidification)) = "Humidifier"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRecovery)) = "HeatRecovery"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::WaterSystem)) = "WaterSystems"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Refrigeration)) = "Refrigeration"; - state.dataOutRptTab->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cogeneration)) = "Cogeneration"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)) = "Heating"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cooling)) = "Cooling"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorLights)) = "InteriorLights"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)) = "ExteriorLights"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorEquipment)) = "InteriorEquipment"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorEquipment)) = "ExteriorEquipment"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Fans)) = "Fans"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Pumps)) = "Pumps"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRejection)) = "HeatRejection"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Humidification)) = "Humidifier"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRecovery)) = "HeatRecovery"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::WaterSystem)) = "WaterSystems"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Refrigeration)) = "Refrigeration"; + ort->endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cogeneration)) = "Cogeneration"; // End use subs must be dynamically allocated to accomodate the end use with the most subcategories - state.dataOutRptTab->meterNumEndUseSubBEPS.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); - state.dataOutRptTab->meterNumEndUseSubBEPS = 0; + ort->meterNumEndUseSubBEPS.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); + ort->meterNumEndUseSubBEPS = 0; // loop through all of the resources and end uses and sub end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { - meterName = state.dataOutRptTab->resourceTypeNames(iResource) + ":FACILITY"; + meterName = ort->resourceTypeNames(iResource) + ":FACILITY"; meterNumber = GetMeterIndex(state, meterName); - state.dataOutRptTab->meterNumTotalsBEPS(iResource) = meterNumber; + ort->meterNumTotalsBEPS(iResource) = meterNumber; for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - meterName = state.dataOutRptTab->endUseNames(jEndUse) + ':' + state.dataOutRptTab->resourceTypeNames(iResource); //// ':FACILITY' + meterName = ort->endUseNames(jEndUse) + ':' + ort->resourceTypeNames(iResource); //// ':FACILITY' meterNumber = GetMeterIndex(state, meterName); - state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse) = meterNumber; + ort->meterNumEndUseBEPS(iResource, jEndUse) = meterNumber; for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { meterName = - state.dataOutputProcessor->EndUseCategory(jEndUse).SubcategoryName(kEndUseSub) + ':' + state.dataOutRptTab->endUseNames(jEndUse) + ':' + state.dataOutRptTab->resourceTypeNames(iResource); + state.dataOutputProcessor->EndUseCategory(jEndUse).SubcategoryName(kEndUseSub) + ':' + ort->endUseNames(jEndUse) + ':' + ort->resourceTypeNames(iResource); meterNumber = GetMeterIndex(state, meterName); - state.dataOutRptTab->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource) = meterNumber; + ort->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource) = meterNumber; } } } for (iResource = 1; iResource <= numSourceTypes; ++iResource) { - meterNumber = GetMeterIndex(state, state.dataOutRptTab->sourceTypeNames(iResource) + "Emissions:Source"); - state.dataOutRptTab->meterNumTotalsSource(iResource) = meterNumber; + meterNumber = GetMeterIndex(state, ort->sourceTypeNames(iResource) + "Emissions:Source"); + ort->meterNumTotalsSource(iResource) = meterNumber; } // initialize the gathering arrays to zero - state.dataOutRptTab->gatherTotalsBEPS = 0.0; - state.dataOutRptTab->gatherTotalsBySourceBEPS = 0.0; - state.dataOutRptTab->gatherTotalsSource = 0.0; - state.dataOutRptTab->gatherTotalsBySource = 0.0; - state.dataOutRptTab->gatherEndUseBEPS = 0.0; - state.dataOutRptTab->gatherEndUseBySourceBEPS = 0.0; + ort->gatherTotalsBEPS = 0.0; + ort->gatherTotalsBySourceBEPS = 0.0; + ort->gatherTotalsSource = 0.0; + ort->gatherTotalsBySource = 0.0; + ort->gatherEndUseBEPS = 0.0; + ort->gatherEndUseBySourceBEPS = 0.0; // End use subs must be dynamically allocated to accommodate the end use with the most subcategories - state.dataOutRptTab->gatherEndUseSubBEPS.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); - state.dataOutRptTab->gatherEndUseSubBEPS = 0.0; - state.dataOutRptTab->gatherDemandEndUseSub.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); - state.dataOutRptTab->gatherDemandEndUseSub = 0.0; - state.dataOutRptTab->gatherDemandIndEndUseSub.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); - state.dataOutRptTab->gatherDemandIndEndUseSub = 0.0; + ort->gatherEndUseSubBEPS.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); + ort->gatherEndUseSubBEPS = 0.0; + ort->gatherDemandEndUseSub.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); + ort->gatherDemandEndUseSub = 0.0; + ort->gatherDemandIndEndUseSub.allocate(state.dataOutputProcessor->MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); + ort->gatherDemandIndEndUseSub = 0.0; // get meter numbers for other meters relating to electric load components - state.dataOutRptTab->meterNumPowerFuelFireGen = GetMeterIndex(state, "Cogeneration:ElectricityProduced"); - state.dataOutRptTab->meterNumPowerPV = GetMeterIndex(state, "Photovoltaic:ElectricityProduced"); - state.dataOutRptTab->meterNumPowerWind = GetMeterIndex(state, "WindTurbine:ElectricityProduced"); - state.dataOutRptTab->meterNumPowerHTGeothermal = GetMeterIndex(state, "HTGeothermal:ElectricityProduced"); - state.dataOutRptTab->meterNumElecStorage = GetMeterIndex(state, "ElectricStorage:ElectricityProduced"); - state.dataOutRptTab->meterNumPowerConversion = GetMeterIndex(state, "PowerConversion:ElectricityProduced"); - state.dataOutRptTab->meterNumElecProduced = GetMeterIndex(state, "ElectricityProduced:Facility"); - state.dataOutRptTab->meterNumElecPurchased = GetMeterIndex(state, "ElectricityPurchased:Facility"); - state.dataOutRptTab->meterNumElecSurplusSold = GetMeterIndex(state, "ElectricitySurplusSold:Facility"); + ort->meterNumPowerFuelFireGen = GetMeterIndex(state, "Cogeneration:ElectricityProduced"); + ort->meterNumPowerPV = GetMeterIndex(state, "Photovoltaic:ElectricityProduced"); + ort->meterNumPowerWind = GetMeterIndex(state, "WindTurbine:ElectricityProduced"); + ort->meterNumPowerHTGeothermal = GetMeterIndex(state, "HTGeothermal:ElectricityProduced"); + ort->meterNumElecStorage = GetMeterIndex(state, "ElectricStorage:ElectricityProduced"); + ort->meterNumPowerConversion = GetMeterIndex(state, "PowerConversion:ElectricityProduced"); + ort->meterNumElecProduced = GetMeterIndex(state, "ElectricityProduced:Facility"); + ort->meterNumElecPurchased = GetMeterIndex(state, "ElectricityPurchased:Facility"); + ort->meterNumElecSurplusSold = GetMeterIndex(state, "ElectricitySurplusSold:Facility"); // if no ElectricityPurchased:Facility meter is defined then no electric load center // was created by the user and no power generation will occur in the plant. The amount // purchased would be the total end use. - if (state.dataOutRptTab->meterNumElecPurchased == 0) { - state.dataOutRptTab->meterNumElecPurchased = GetMeterIndex(state, "Electricity:Facility"); + if (ort->meterNumElecPurchased == 0) { + ort->meterNumElecPurchased = GetMeterIndex(state, "Electricity:Facility"); } // initialize the gathering variables for the electric load components - state.dataOutRptTab->gatherPowerFuelFireGen = 0.0; - state.dataOutRptTab->gatherPowerPV = 0.0; - state.dataOutRptTab->gatherPowerWind = 0.0; - state.dataOutRptTab->gatherPowerHTGeothermal = 0.0; - state.dataOutRptTab->gatherElecProduced = 0.0; - state.dataOutRptTab->gatherElecPurchased = 0.0; - state.dataOutRptTab->gatherElecSurplusSold = 0.0; - state.dataOutRptTab->gatherElecStorage = 0.0; - state.dataOutRptTab->gatherPowerConversion = 0.0; + ort->gatherPowerFuelFireGen = 0.0; + ort->gatherPowerPV = 0.0; + ort->gatherPowerWind = 0.0; + ort->gatherPowerHTGeothermal = 0.0; + ort->gatherElecProduced = 0.0; + ort->gatherElecPurchased = 0.0; + ort->gatherElecSurplusSold = 0.0; + ort->gatherElecStorage = 0.0; + ort->gatherPowerConversion = 0.0; // get meter numbers for onsite thermal components on BEPS report - state.dataOutRptTab->meterNumWaterHeatRecovery = GetMeterIndex(state, "HeatRecovery:EnergyTransfer"); - state.dataOutRptTab->meterNumAirHeatRecoveryCool = GetMeterIndex(state, "HeatRecoveryForCooling:EnergyTransfer"); - state.dataOutRptTab->meterNumAirHeatRecoveryHeat = GetMeterIndex(state, "HeatRecoveryForHeating:EnergyTransfer"); - state.dataOutRptTab->meterNumHeatHTGeothermal = GetMeterIndex(state, "HTGeothermal:HeatProduced"); - state.dataOutRptTab->meterNumHeatSolarWater = GetMeterIndex(state, "SolarWater:Facility"); - state.dataOutRptTab->meterNumHeatSolarAir = GetMeterIndex(state, "HeatProduced:SolarAir"); + ort->meterNumWaterHeatRecovery = GetMeterIndex(state, "HeatRecovery:EnergyTransfer"); + ort->meterNumAirHeatRecoveryCool = GetMeterIndex(state, "HeatRecoveryForCooling:EnergyTransfer"); + ort->meterNumAirHeatRecoveryHeat = GetMeterIndex(state, "HeatRecoveryForHeating:EnergyTransfer"); + ort->meterNumHeatHTGeothermal = GetMeterIndex(state, "HTGeothermal:HeatProduced"); + ort->meterNumHeatSolarWater = GetMeterIndex(state, "SolarWater:Facility"); + ort->meterNumHeatSolarAir = GetMeterIndex(state, "HeatProduced:SolarAir"); // initialize the gathering variables for onsite thermal components on BEPS report - state.dataOutRptTab->gatherWaterHeatRecovery = 0.0; - state.dataOutRptTab->gatherAirHeatRecoveryCool = 0.0; - state.dataOutRptTab->gatherAirHeatRecoveryHeat = 0.0; - state.dataOutRptTab->gatherHeatHTGeothermal = 0.0; - state.dataOutRptTab->gatherHeatSolarWater = 0.0; - state.dataOutRptTab->gatherHeatSolarAir = 0.0; + ort->gatherWaterHeatRecovery = 0.0; + ort->gatherAirHeatRecoveryCool = 0.0; + ort->gatherAirHeatRecoveryHeat = 0.0; + ort->gatherHeatHTGeothermal = 0.0; + ort->gatherHeatSolarWater = 0.0; + ort->gatherHeatSolarAir = 0.0; // get meter numbers for water components on BEPS report - state.dataOutRptTab->meterNumRainWater = GetMeterIndex(state, "Rainwater:OnSiteWater"); - state.dataOutRptTab->meterNumCondensate = GetMeterIndex(state, "Condensate:OnSiteWater"); - state.dataOutRptTab->meterNumGroundwater = GetMeterIndex(state, "Wellwater:OnSiteWater"); - state.dataOutRptTab->meterNumMains = GetMeterIndex(state, "MainsWater:Facility"); - state.dataOutRptTab->meterNumWaterEndUseTotal = GetMeterIndex(state, "Water:Facility"); + ort->meterNumRainWater = GetMeterIndex(state, "Rainwater:OnSiteWater"); + ort->meterNumCondensate = GetMeterIndex(state, "Condensate:OnSiteWater"); + ort->meterNumGroundwater = GetMeterIndex(state, "Wellwater:OnSiteWater"); + ort->meterNumMains = GetMeterIndex(state, "MainsWater:Facility"); + ort->meterNumWaterEndUseTotal = GetMeterIndex(state, "Water:Facility"); // initialize the gathering variables for water components on BEPS report - state.dataOutRptTab->gatherRainWater = 0.0; - state.dataOutRptTab->gatherCondensate = 0.0; - state.dataOutRptTab->gatherWellwater = 0.0; - state.dataOutRptTab->gatherMains = 0.0; - state.dataOutRptTab->gatherWaterEndUseTotal = 0.0; + ort->gatherRainWater = 0.0; + ort->gatherCondensate = 0.0; + ort->gatherWellwater = 0.0; + ort->gatherMains = 0.0; + ort->gatherWaterEndUseTotal = 0.0; } } @@ -1966,71 +1975,72 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int xcount; - - state.dataOutRptTab->namedMonthly.allocate(numNamedMonthly); - state.dataOutRptTab->namedMonthly(1).title = "ZoneCoolingSummaryMonthly"; - state.dataOutRptTab->namedMonthly(2).title = "ZoneHeatingSummaryMonthly"; - state.dataOutRptTab->namedMonthly(3).title = "ZoneElectricSummaryMonthly"; - state.dataOutRptTab->namedMonthly(4).title = "SpaceGainsMonthly"; - state.dataOutRptTab->namedMonthly(5).title = "PeakSpaceGainsMonthly"; - state.dataOutRptTab->namedMonthly(6).title = "SpaceGainComponentsAtCoolingPeakMonthly"; - state.dataOutRptTab->namedMonthly(7).title = "EnergyConsumptionElectricityNaturalGasMonthly"; - state.dataOutRptTab->namedMonthly(8).title = "EnergyConsumptionElectricityGeneratedPropaneMonthly"; - state.dataOutRptTab->namedMonthly(9).title = "EnergyConsumptionDieselFuelOilMonthly"; - state.dataOutRptTab->namedMonthly(10).title = "EnergyConsumptionDistrictHeatingCoolingMonthly"; - state.dataOutRptTab->namedMonthly(11).title = "EnergyConsumptionCoalGasolineMonthly"; - state.dataOutRptTab->namedMonthly(12).title = "EnergyConsumptionOtherFuelsMonthly"; - state.dataOutRptTab->namedMonthly(13).title = "EndUseEnergyConsumptionElectricityMonthly"; - state.dataOutRptTab->namedMonthly(14).title = "EndUseEnergyConsumptionNaturalGasMonthly"; - state.dataOutRptTab->namedMonthly(15).title = "EndUseEnergyConsumptionDieselMonthly"; - state.dataOutRptTab->namedMonthly(16).title = "EndUseEnergyConsumptionFuelOilMonthly"; - state.dataOutRptTab->namedMonthly(17).title = "EndUseEnergyConsumptionCoalMonthly"; - state.dataOutRptTab->namedMonthly(18).title = "EndUseEnergyConsumptionPropaneMonthly"; - state.dataOutRptTab->namedMonthly(19).title = "EndUseEnergyConsumptionGasolineMonthly"; - state.dataOutRptTab->namedMonthly(20).title = "EndUseEnergyConsumptionOtherFuelsMonthly"; - state.dataOutRptTab->namedMonthly(21).title = "PeakEnergyEndUseElectricityPart1Monthly"; - state.dataOutRptTab->namedMonthly(22).title = "PeakEnergyEndUseElectricityPart2Monthly"; - state.dataOutRptTab->namedMonthly(23).title = "ElectricComponentsOfPeakDemandMonthly"; - state.dataOutRptTab->namedMonthly(24).title = "PeakEnergyEndUseNaturalGasMonthly"; - state.dataOutRptTab->namedMonthly(25).title = "PeakEnergyEndUseDieselMonthly"; - state.dataOutRptTab->namedMonthly(26).title = "PeakEnergyEndUseFuelOilMonthly"; - state.dataOutRptTab->namedMonthly(27).title = "PeakEnergyEndUseCoalMonthly"; - state.dataOutRptTab->namedMonthly(28).title = "PeakEnergyEndUsePropaneMonthly"; - state.dataOutRptTab->namedMonthly(29).title = "PeakEnergyEndUseGasolineMonthly"; - state.dataOutRptTab->namedMonthly(30).title = "PeakEnergyEndUseOtherFuelsMonthly"; - state.dataOutRptTab->namedMonthly(31).title = "SetpointsNotMetWithTemperaturesMonthly"; - state.dataOutRptTab->namedMonthly(32).title = "ComfortReportSimple55Monthly"; - state.dataOutRptTab->namedMonthly(33).title = "UnglazedTranspiredSolarCollectorSummaryMonthly"; - state.dataOutRptTab->namedMonthly(34).title = "OccupantComfortDataSummaryMonthly"; - state.dataOutRptTab->namedMonthly(35).title = "ChillerReportMonthly"; - state.dataOutRptTab->namedMonthly(36).title = "TowerReportMonthly"; - state.dataOutRptTab->namedMonthly(37).title = "BoilerReportMonthly"; - state.dataOutRptTab->namedMonthly(38).title = "DXReportMonthly"; - state.dataOutRptTab->namedMonthly(39).title = "WindowReportMonthly"; - state.dataOutRptTab->namedMonthly(40).title = "WindowEnergyReportMonthly"; - state.dataOutRptTab->namedMonthly(41).title = "WindowZoneSummaryMonthly"; - state.dataOutRptTab->namedMonthly(42).title = "WindowEnergyZoneSummaryMonthly"; - state.dataOutRptTab->namedMonthly(43).title = "AverageOutdoorConditionsMonthly"; - state.dataOutRptTab->namedMonthly(44).title = "OutdoorConditionsMaximumDryBulbMonthly"; - state.dataOutRptTab->namedMonthly(45).title = "OutdoorConditionsMinimumDryBulbMonthly"; - state.dataOutRptTab->namedMonthly(46).title = "OutdoorConditionsMaximumWetBulbMonthly"; - state.dataOutRptTab->namedMonthly(47).title = "OutdoorConditionsMaximumDewPointMonthly"; - state.dataOutRptTab->namedMonthly(48).title = "OutdoorGroundConditionsMonthly"; - state.dataOutRptTab->namedMonthly(49).title = "WindowACReportMonthly"; - state.dataOutRptTab->namedMonthly(50).title = "WaterHeaterReportMonthly"; - state.dataOutRptTab->namedMonthly(51).title = "GeneratorReportMonthly"; - state.dataOutRptTab->namedMonthly(52).title = "DaylightingReportMonthly"; - state.dataOutRptTab->namedMonthly(53).title = "CoilReportMonthly"; - state.dataOutRptTab->namedMonthly(54).title = "PlantLoopDemandReportMonthly"; - state.dataOutRptTab->namedMonthly(55).title = "FanReportMonthly"; - state.dataOutRptTab->namedMonthly(56).title = "PumpReportMonthly"; - state.dataOutRptTab->namedMonthly(57).title = "CondLoopDemandReportMonthly"; - state.dataOutRptTab->namedMonthly(58).title = "ZoneTemperatureOscillationReportMonthly"; - state.dataOutRptTab->namedMonthly(59).title = "AirLoopSystemEnergyAndWaterUseMonthly"; - state.dataOutRptTab->namedMonthly(60).title = "AirLoopSystemComponentLoadsMonthly"; - state.dataOutRptTab->namedMonthly(61).title = "AirLoopSystemComponentEnergyUseMonthly"; - state.dataOutRptTab->namedMonthly(62).title = "MechanicalVentilationLoadsMonthly"; - state.dataOutRptTab->namedMonthly(63).title = "HeatEmissionsReportMonthly"; + auto &ort(state.dataOutRptTab); + + ort->namedMonthly.allocate(numNamedMonthly); + ort->namedMonthly(1).title = "ZoneCoolingSummaryMonthly"; + ort->namedMonthly(2).title = "ZoneHeatingSummaryMonthly"; + ort->namedMonthly(3).title = "ZoneElectricSummaryMonthly"; + ort->namedMonthly(4).title = "SpaceGainsMonthly"; + ort->namedMonthly(5).title = "PeakSpaceGainsMonthly"; + ort->namedMonthly(6).title = "SpaceGainComponentsAtCoolingPeakMonthly"; + ort->namedMonthly(7).title = "EnergyConsumptionElectricityNaturalGasMonthly"; + ort->namedMonthly(8).title = "EnergyConsumptionElectricityGeneratedPropaneMonthly"; + ort->namedMonthly(9).title = "EnergyConsumptionDieselFuelOilMonthly"; + ort->namedMonthly(10).title = "EnergyConsumptionDistrictHeatingCoolingMonthly"; + ort->namedMonthly(11).title = "EnergyConsumptionCoalGasolineMonthly"; + ort->namedMonthly(12).title = "EnergyConsumptionOtherFuelsMonthly"; + ort->namedMonthly(13).title = "EndUseEnergyConsumptionElectricityMonthly"; + ort->namedMonthly(14).title = "EndUseEnergyConsumptionNaturalGasMonthly"; + ort->namedMonthly(15).title = "EndUseEnergyConsumptionDieselMonthly"; + ort->namedMonthly(16).title = "EndUseEnergyConsumptionFuelOilMonthly"; + ort->namedMonthly(17).title = "EndUseEnergyConsumptionCoalMonthly"; + ort->namedMonthly(18).title = "EndUseEnergyConsumptionPropaneMonthly"; + ort->namedMonthly(19).title = "EndUseEnergyConsumptionGasolineMonthly"; + ort->namedMonthly(20).title = "EndUseEnergyConsumptionOtherFuelsMonthly"; + ort->namedMonthly(21).title = "PeakEnergyEndUseElectricityPart1Monthly"; + ort->namedMonthly(22).title = "PeakEnergyEndUseElectricityPart2Monthly"; + ort->namedMonthly(23).title = "ElectricComponentsOfPeakDemandMonthly"; + ort->namedMonthly(24).title = "PeakEnergyEndUseNaturalGasMonthly"; + ort->namedMonthly(25).title = "PeakEnergyEndUseDieselMonthly"; + ort->namedMonthly(26).title = "PeakEnergyEndUseFuelOilMonthly"; + ort->namedMonthly(27).title = "PeakEnergyEndUseCoalMonthly"; + ort->namedMonthly(28).title = "PeakEnergyEndUsePropaneMonthly"; + ort->namedMonthly(29).title = "PeakEnergyEndUseGasolineMonthly"; + ort->namedMonthly(30).title = "PeakEnergyEndUseOtherFuelsMonthly"; + ort->namedMonthly(31).title = "SetpointsNotMetWithTemperaturesMonthly"; + ort->namedMonthly(32).title = "ComfortReportSimple55Monthly"; + ort->namedMonthly(33).title = "UnglazedTranspiredSolarCollectorSummaryMonthly"; + ort->namedMonthly(34).title = "OccupantComfortDataSummaryMonthly"; + ort->namedMonthly(35).title = "ChillerReportMonthly"; + ort->namedMonthly(36).title = "TowerReportMonthly"; + ort->namedMonthly(37).title = "BoilerReportMonthly"; + ort->namedMonthly(38).title = "DXReportMonthly"; + ort->namedMonthly(39).title = "WindowReportMonthly"; + ort->namedMonthly(40).title = "WindowEnergyReportMonthly"; + ort->namedMonthly(41).title = "WindowZoneSummaryMonthly"; + ort->namedMonthly(42).title = "WindowEnergyZoneSummaryMonthly"; + ort->namedMonthly(43).title = "AverageOutdoorConditionsMonthly"; + ort->namedMonthly(44).title = "OutdoorConditionsMaximumDryBulbMonthly"; + ort->namedMonthly(45).title = "OutdoorConditionsMinimumDryBulbMonthly"; + ort->namedMonthly(46).title = "OutdoorConditionsMaximumWetBulbMonthly"; + ort->namedMonthly(47).title = "OutdoorConditionsMaximumDewPointMonthly"; + ort->namedMonthly(48).title = "OutdoorGroundConditionsMonthly"; + ort->namedMonthly(49).title = "WindowACReportMonthly"; + ort->namedMonthly(50).title = "WaterHeaterReportMonthly"; + ort->namedMonthly(51).title = "GeneratorReportMonthly"; + ort->namedMonthly(52).title = "DaylightingReportMonthly"; + ort->namedMonthly(53).title = "CoilReportMonthly"; + ort->namedMonthly(54).title = "PlantLoopDemandReportMonthly"; + ort->namedMonthly(55).title = "FanReportMonthly"; + ort->namedMonthly(56).title = "PumpReportMonthly"; + ort->namedMonthly(57).title = "CondLoopDemandReportMonthly"; + ort->namedMonthly(58).title = "ZoneTemperatureOscillationReportMonthly"; + ort->namedMonthly(59).title = "AirLoopSystemEnergyAndWaterUseMonthly"; + ort->namedMonthly(60).title = "AirLoopSystemComponentLoadsMonthly"; + ort->namedMonthly(61).title = "AirLoopSystemComponentEnergyUseMonthly"; + ort->namedMonthly(62).title = "MechanicalVentilationLoadsMonthly"; + ort->namedMonthly(63).title = "HeatEmissionsReportMonthly"; if (numNamedMonthly != NumMonthlyReports) { ShowFatalError(state, @@ -2040,10 +2050,10 @@ namespace EnergyPlus::OutputReportTabular { NumMonthlyReports)); } else { for (xcount = 1; xcount <= numNamedMonthly; ++xcount) { - if (!UtilityRoutines::SameString(MonthlyNamedReports(xcount), state.dataOutRptTab->namedMonthly(xcount).title)) { + if (!UtilityRoutines::SameString(MonthlyNamedReports(xcount), ort->namedMonthly(xcount).title)) { ShowSevereError(state, "InitializePredefinedMonthlyTitles: Monthly Report Titles in OutputReportTabular do not match titles in DataOutput."); - ShowContinueError(state, format("first mismatch at ORT [{}] =\"{}\".", numNamedMonthly, state.dataOutRptTab->namedMonthly(xcount).title)); + ShowContinueError(state, format("first mismatch at ORT [{}] =\"{}\".", numNamedMonthly, ort->namedMonthly(xcount).title)); ShowContinueError(state, "same location in DO =\"" + MonthlyNamedReports(xcount) + "\"."); ShowFatalError(state, "Preceding condition causes termination."); } @@ -2084,13 +2094,14 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int curReport; + auto &ort(state.dataOutRptTab); // ---------------------------------------------------------------------------------------- // If any variable are added to these reports they also need to be added to the // AddVariablesForMonthlyReport routine in InputProcessor. // ---------------------------------------------------------------------------------------- - if (state.dataOutRptTab->namedMonthly(1).show) { + if (ort->namedMonthly(1).show) { curReport = AddMonthlyReport(state, "ZoneCoolingSummaryMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Cooling Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Cooling Rate", "", iAggType::Maximum); @@ -2101,20 +2112,20 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); } - if (state.dataOutRptTab->namedMonthly(2).show) { + if (ort->namedMonthly(2).show) { curReport = AddMonthlyReport(state, "ZoneHeatingSummaryMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Heating Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Heating Rate", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); } - if (state.dataOutRptTab->namedMonthly(3).show) { + if (ort->namedMonthly(3).show) { curReport = AddMonthlyReport(state, "ZoneElectricSummaryMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Lights Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Lights Electricity Energy", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Zone Electric Equipment Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Electric Equipment Electricity Energy", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(4).show) { + if (ort->namedMonthly(4).show) { curReport = AddMonthlyReport(state, "SpaceGainsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone People Total Heating Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Lights Total Heating Energy", "", iAggType::SumOrAvg); @@ -2126,7 +2137,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(5).show) { + if (ort->namedMonthly(5).show) { curReport = AddMonthlyReport(state, "PeakSpaceGainsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone People Total Heating Energy", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Zone Lights Total Heating Energy", "", iAggType::Maximum); @@ -2138,7 +2149,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(6).show) { + if (ort->namedMonthly(6).show) { curReport = AddMonthlyReport(state, "SpaceGainComponentsAtCoolingPeakMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Air System Sensible Cooling Rate", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Zone People Total Heating Energy", "", iAggType::ValueWhenMaxMin); @@ -2151,21 +2162,21 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Gain Energy", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Zone Infiltration Sensible Heat Loss Energy", "", iAggType::ValueWhenMaxMin); } - if (state.dataOutRptTab->namedMonthly(7).show) { + if (ort->namedMonthly(7).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionElectricityNaturalGasMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Electricity:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Electricity:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "NaturalGas:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "NaturalGas:Facility", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(8).show) { + if (ort->namedMonthly(8).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionElectricityGeneratedPropaneMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ElectricityProduced:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "ElectricityProduced:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Propane:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Propane:Facility", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(9).show) { + if (ort->namedMonthly(9).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionDieselFuelOilMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Diesel:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Diesel:Facility", "", iAggType::Maximum); @@ -2174,28 +2185,28 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "FuelOilNo2:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "FuelOilNo2:Facility", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(10).show) { + if (ort->namedMonthly(10).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionDistrictHeatingCoolingMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "DistrictCooling:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "DistrictCooling:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "DistrictHeating:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "DistrictHeating:Facility", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(11).show) { + if (ort->namedMonthly(11).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionCoalGasolineMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Coal:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Coal:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Gasoline:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Gasoline:Facility", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(12).show) { + if (ort->namedMonthly(12).show) { curReport = AddMonthlyReport(state, "EnergyConsumptionOtherFuelsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "OtherFuel1:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "OtherFuel1:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "OtherFuel2:Facility", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "OtherFuel2:Facility", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(13).show) { + if (ort->namedMonthly(13).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionElectricityMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "InteriorLights:Electricity", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "ExteriorLights:Electricity", "", iAggType::SumOrAvg); @@ -2211,7 +2222,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Electricity", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Electricity", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(14).show) { + if (ort->namedMonthly(14).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionNaturalGasMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "InteriorEquipment:NaturalGas", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:NaturalGas", "", iAggType::SumOrAvg); @@ -2221,7 +2232,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cogeneration:NaturalGas", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Humidifier:NaturalGas", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(15).show) { + if (ort->namedMonthly(15).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionDieselMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Diesel", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling:Diesel", "", iAggType::SumOrAvg); @@ -2229,7 +2240,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Diesel", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Diesel", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(16).show) { + if (ort->namedMonthly(16).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionFuelOilMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:FuelOilNo1", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling:FuelOilNo1", "", iAggType::SumOrAvg); @@ -2242,13 +2253,13 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:FuelOilNo2", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:FuelOilNo2", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(17).show) { + if (ort->namedMonthly(17).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionCoalMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Coal", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Heating:Coal", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Coal", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(18).show) { + if (ort->namedMonthly(18).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionPropaneMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Propane", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling:Propane", "", iAggType::SumOrAvg); @@ -2257,7 +2268,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Propane", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Humidifier:Propane", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(19).show) { + if (ort->namedMonthly(19).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionGasolineMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Gasoline", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling:Gasoline", "", iAggType::SumOrAvg); @@ -2265,7 +2276,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Gasoline", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Gasoline", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(20).show) { + if (ort->namedMonthly(20).show) { curReport = AddMonthlyReport(state, "EndUseEnergyConsumptionOtherFuelsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:OtherFuel1", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling:OtherFuel1", "", iAggType::SumOrAvg); @@ -2278,7 +2289,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:OtherFuel2", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:OtherFuel2", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(21).show) { + if (ort->namedMonthly(21).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseElectricityPart1Monthly", 2); AddMonthlyFieldSetInput(state, curReport, "InteriorLights:Electricity", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "ExteriorLights:Electricity", "", iAggType::Maximum); @@ -2288,7 +2299,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Pumps:Electricity", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Heating:Electricity", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(22).show) { + if (ort->namedMonthly(22).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseElectricityPart2Monthly", 2); AddMonthlyFieldSetInput(state, curReport, "Cooling:Electricity", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "HeatRejection:Electricity", "", iAggType::Maximum); @@ -2297,7 +2308,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Electricity", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Electricity", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(23).show) { + if (ort->namedMonthly(23).show) { curReport = AddMonthlyReport(state, "ElectricComponentsOfPeakDemandMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Electricity:Facility", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "InteriorLights:Electricity", "", iAggType::ValueWhenMaxMin); @@ -2310,7 +2321,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cooling:Electricity", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "HeatRejection:Electricity", "", iAggType::ValueWhenMaxMin); } - if (state.dataOutRptTab->namedMonthly(24).show) { + if (ort->namedMonthly(24).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseNaturalGasMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "InteriorEquipment:NaturalGas", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:NaturalGas", "", iAggType::Maximum); @@ -2319,7 +2330,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:NaturalGas", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:NaturalGas", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(25).show) { + if (ort->namedMonthly(25).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseDieselMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Diesel", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling:Diesel", "", iAggType::Maximum); @@ -2327,7 +2338,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Diesel", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Diesel", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(26).show) { + if (ort->namedMonthly(26).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseFuelOilMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:FuelOilNo1", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling:FuelOilNo1", "", iAggType::Maximum); @@ -2340,13 +2351,13 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:FuelOilNo2", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:FuelOilNo2", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(27).show) { + if (ort->namedMonthly(27).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseCoalMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Coal", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Heating:Coal", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Coal", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(28).show) { + if (ort->namedMonthly(28).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUsePropaneMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Propane", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling:Propane", "", iAggType::Maximum); @@ -2354,7 +2365,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Propane", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Propane", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(29).show) { + if (ort->namedMonthly(29).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseGasolineMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:Gasoline", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling:Gasoline", "", iAggType::Maximum); @@ -2362,7 +2373,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:Gasoline", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:Gasoline", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(30).show) { + if (ort->namedMonthly(30).show) { curReport = AddMonthlyReport(state, "PeakEnergyEndUseOtherFuelsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "ExteriorEquipment:OtherFuel1", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling:OtherFuel1", "", iAggType::Maximum); @@ -2375,7 +2386,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "WaterSystems:OtherFuel2", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cogeneration:OtherFuel2", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(31).show) { + if (ort->namedMonthly(31).show) { curReport = AddMonthlyReport(state, "SetpointsNotMetWithTemperaturesMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Heating Setpoint Not Met Time", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); @@ -2386,7 +2397,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Cooling Setpoint Not Met While Occupied Time", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); } - if (state.dataOutRptTab->namedMonthly(32).show) { + if (ort->namedMonthly(32).show) { curReport = AddMonthlyReport(state, "ComfortReportSimple55Monthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Summer Clothes Not Comfortable Time", "", iAggType::HoursNonZero); @@ -2398,14 +2409,14 @@ namespace EnergyPlus::OutputReportTabular { curReport, "Zone Thermal Comfort ASHRAE 55 Simple Model Summer or Winter Clothes Not Comfortable Time", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Zone Mean Air Temperature", "", iAggType::SumOrAverageHoursShown); } - if (state.dataOutRptTab->namedMonthly(33).show) { + if (ort->namedMonthly(33).show) { curReport = AddMonthlyReport(state, "UnglazedTranspiredSolarCollectorSummaryMonthly", 5); AddMonthlyFieldSetInput(state, curReport, "Solar Collector System Efficiency", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Solar Collector System Efficiency", "", iAggType::SumOrAverageHoursShown); AddMonthlyFieldSetInput(state, curReport, "Solar Collector Outside Face Suction Velocity", "", iAggType::SumOrAverageHoursShown); AddMonthlyFieldSetInput(state, curReport, "Solar Collector Sensible Heating Rate", "", iAggType::SumOrAverageHoursShown); } - if (state.dataOutRptTab->namedMonthly(34).show) { + if (ort->namedMonthly(34).show) { curReport = AddMonthlyReport(state, "OccupantComfortDataSummaryMonthly", 5); AddMonthlyFieldSetInput(state, curReport, "People Occupant Count", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "People Air Temperature", "", iAggType::SumOrAverageHoursShown); @@ -2413,7 +2424,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Thermal Comfort Fanger Model PMV", "", iAggType::SumOrAverageHoursShown); AddMonthlyFieldSetInput(state, curReport, "Zone Thermal Comfort Fanger Model PPD", "", iAggType::SumOrAverageHoursShown); } - if (state.dataOutRptTab->namedMonthly(35).show) { + if (ort->namedMonthly(35).show) { curReport = AddMonthlyReport(state, "ChillerReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Chiller Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Chiller Electricity Rate", "", iAggType::Maximum); @@ -2426,7 +2437,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Chiller Part Load Ratio", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Chiller Part Load Ratio", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(36).show) { + if (ort->namedMonthly(36).show) { curReport = AddMonthlyReport(state, "TowerReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Fan Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Fan Electricity Energy", "", iAggType::HoursNonZero); @@ -2436,7 +2447,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Outlet Temperature", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling Tower Mass Flow Rate", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(37).show) { + if (ort->namedMonthly(37).show) { curReport = AddMonthlyReport(state, "BoilerReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Boiler Heating Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Boiler Gas Consumption", "", iAggType::SumOrAvg); @@ -2450,7 +2461,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Boiler Part Load Ratio", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Boiler Part Load Ratio", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(38).show) { + if (ort->namedMonthly(38).show) { curReport = AddMonthlyReport(state, "DXReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Electricity Energy", "", iAggType::SumOrAvg); @@ -2466,7 +2477,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Electricity Rate", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Crankcase Heater Electricity Rate", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(39).show) { + if (ort->namedMonthly(39).show) { curReport = AddMonthlyReport(state, "WindowReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Solar Radiation Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); @@ -2477,7 +2488,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Surface Shading Device Is On Time Fraction", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Surface Storm Window On Off Status", "", iAggType::HoursNonZero); } - if (state.dataOutRptTab->namedMonthly(40).show) { + if (ort->namedMonthly(40).show) { curReport = AddMonthlyReport(state, "WindowEnergyReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Solar Radiation Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Surface Window Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); @@ -2485,7 +2496,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Surface Window Heat Gain Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Surface Window Heat Loss Energy", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(41).show) { + if (ort->namedMonthly(41).show) { curReport = AddMonthlyReport(state, "WindowZoneSummaryMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Gain Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Loss Rate", "", iAggType::SumOrAvg); @@ -2495,7 +2506,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Rate", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(42).show) { + if (ort->namedMonthly(42).show) { curReport = AddMonthlyReport(state, "WindowEnergyZoneSummaryMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Gain Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Windows Total Heat Loss Energy", "", iAggType::SumOrAvg); @@ -2505,7 +2516,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Diffuse Solar Radiation Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Interior Windows Total Transmitted Beam Solar Radiation Energy", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(43).show) { + if (ort->namedMonthly(43).show) { curReport = AddMonthlyReport(state, "AverageOutdoorConditionsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::SumOrAvg); @@ -2516,7 +2527,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Site Rain Status", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(44).show) { + if (ort->namedMonthly(44).show) { curReport = AddMonthlyReport(state, "OutdoorConditionsMaximumDryBulbMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); @@ -2526,7 +2537,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } - if (state.dataOutRptTab->namedMonthly(45).show) { + if (ort->namedMonthly(45).show) { curReport = AddMonthlyReport(state, "OutdoorConditionsMinimumDryBulbMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::Minimum); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::ValueWhenMaxMin); @@ -2536,7 +2547,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } - if (state.dataOutRptTab->namedMonthly(46).show) { + if (ort->namedMonthly(46).show) { curReport = AddMonthlyReport(state, "OutdoorConditionsMaximumWetBulbMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Wetbulb Temperature", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); @@ -2546,7 +2557,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } - if (state.dataOutRptTab->namedMonthly(47).show) { + if (ort->namedMonthly(47).show) { curReport = AddMonthlyReport(state, "OutdoorConditionsMaximumDewPointMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Dewpoint Temperature", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Site Outdoor Air Drybulb Temperature", "", iAggType::ValueWhenMaxMin); @@ -2556,7 +2567,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Diffuse Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Site Direct Solar Radiation Rate per Area", "", iAggType::ValueWhenMaxMin); } - if (state.dataOutRptTab->namedMonthly(48).show) { + if (ort->namedMonthly(48).show) { curReport = AddMonthlyReport(state, "OutdoorGroundConditionsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Ground Temperature", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Site Surface Ground Temperature", "", iAggType::SumOrAvg); @@ -2565,7 +2576,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Site Ground Reflected Solar Radiation Rate per Area", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Site Snow on Ground Status", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(49).show) { + if (ort->namedMonthly(49).show) { curReport = AddMonthlyReport(state, "WindowACReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Total Cooling Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Electricity Energy", "", iAggType::SumOrAvg); @@ -2577,7 +2588,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Latent Cooling Rate", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Zone Window Air Conditioner Electricity Rate", "", iAggType::ValueWhenMaxMin); } - if (state.dataOutRptTab->namedMonthly(50).show) { + if (ort->namedMonthly(50).show) { curReport = AddMonthlyReport(state, "WaterHeaterReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Water Heater Total Demand Heat Transfer Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Water Heater Use Side Heat Transfer Energy", "", iAggType::SumOrAvg); @@ -2590,7 +2601,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Water Heater Heat Recovery Supply Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Water Heater Source Energy", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(51).show) { + if (ort->namedMonthly(51).show) { curReport = AddMonthlyReport(state, "GeneratorReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Generator Produced AC Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Generator Diesel Consumption", "", iAggType::SumOrAvg); @@ -2602,7 +2613,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Generator Exhaust Heat Recovery Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Generator Exhaust Air Temperature", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(52).show) { + if (ort->namedMonthly(52).show) { curReport = AddMonthlyReport(state, "DaylightingReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Site Exterior Beam Normal Illuminance", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Daylighting Lighting Power Multiplier", "", iAggType::SumOrAverageHoursShown); @@ -2616,7 +2627,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 2 Glare Index Setpoint Exceeded Time", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Daylighting Reference Point 2 Daylight Illuminance Setpoint Exceeded Time", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(53).show) { + if (ort->namedMonthly(53).show) { curReport = AddMonthlyReport(state, "CoilReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Heating Coil Heating Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Heating Coil Heating Rate", "", iAggType::Maximum); @@ -2626,21 +2637,21 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Sensible Cooling Rate", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Cooling Coil Wetted Area Fraction", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(54).show) { + if (ort->namedMonthly(54).show) { curReport = AddMonthlyReport(state, "PlantLoopDemandReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(55).show) { + if (ort->namedMonthly(55).show) { curReport = AddMonthlyReport(state, "FanReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Fan Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Fan Rise in Air Temperature", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Fan Electricity Rate", "", iAggType::Maximum); AddMonthlyFieldSetInput(state, curReport, "Fan Rise in Air Temperature", "", iAggType::ValueWhenMaxMin); } - if (state.dataOutRptTab->namedMonthly(56).show) { + if (ort->namedMonthly(56).show) { curReport = AddMonthlyReport(state, "PumpReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Pump Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Pump Fluid Heat Gain Energy", "", iAggType::SumOrAvg); @@ -2650,7 +2661,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Pump Outlet Temperature", "", iAggType::ValueWhenMaxMin); AddMonthlyFieldSetInput(state, curReport, "Pump Mass Flow Rate", "", iAggType::ValueWhenMaxMin); } - if (state.dataOutRptTab->namedMonthly(57).show) { + if (ort->namedMonthly(57).show) { curReport = AddMonthlyReport(state, "CondLoopDemandReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Cooling Demand Rate", "", iAggType::Maximum); @@ -2659,12 +2670,12 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Plant Supply Side Heating Demand Rate", "", iAggType::Maximum); } - if (state.dataOutRptTab->namedMonthly(58).show) { + if (ort->namedMonthly(58).show) { curReport = AddMonthlyReport(state, "ZoneTemperatureOscillationReportMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Oscillating Temperatures Time", "", iAggType::HoursNonZero); AddMonthlyFieldSetInput(state, curReport, "Zone People Occupant Count", "", iAggType::SumOrAverageHoursShown); } - if (state.dataOutRptTab->namedMonthly(59).show) { + if (ort->namedMonthly(59).show) { curReport = AddMonthlyReport(state, "AirLoopSystemEnergyAndWaterUseMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Air System Hot Water Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Air System Steam Energy", "", iAggType::SumOrAvg); @@ -2674,7 +2685,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Air System Water Volume", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(60).show) { + if (ort->namedMonthly(60).show) { curReport = AddMonthlyReport(state, "AirLoopSystemComponentLoadsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Air System Fan Air Heating Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Air System Cooling Coil Total Cooling Energy", "", iAggType::SumOrAvg); @@ -2685,7 +2696,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Air System Evaporative Cooler Total Cooling Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Air System Desiccant Dehumidifier Total Cooling Energy", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(61).show) { + if (ort->namedMonthly(61).show) { curReport = AddMonthlyReport(state, "AirLoopSystemComponentEnergyUseMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Air System Fan Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Air System Heating Coil Hot Water Energy", "", iAggType::SumOrAvg); @@ -2700,7 +2711,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Air System Evaporative Cooler Electricity Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Air System Desiccant Dehumidifier Electricity Energy", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(62).show) { + if (ort->namedMonthly(62).show) { curReport = AddMonthlyReport(state, "MechanicalVentilationLoadsMonthly", 2); AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation No Load Heat Removal Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Cooling Load Increase Energy", "", iAggType::SumOrAvg); @@ -2712,7 +2723,7 @@ namespace EnergyPlus::OutputReportTabular { AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Heating Load Decrease Energy", "", iAggType::SumOrAvg); AddMonthlyFieldSetInput(state, curReport, "Zone Mechanical Ventilation Air Changes per Hour", "", iAggType::SumOrAvg); } - if (state.dataOutRptTab->namedMonthly(63).show) { + if (ort->namedMonthly(63).show) { curReport = AddMonthlyReport(state, "HeatEmissionsReportMonthly", 2); // Place holder AddMonthlyFieldSetInput(state, curReport, "Site Total Surface Heat Emission to Air", "", iAggType::SumOrAvg); @@ -2765,22 +2776,23 @@ namespace EnergyPlus::OutputReportTabular { bool fuelFactorUsed; bool fFScheduleUsed; int ffScheduleIndex; + auto &ort(state.dataOutRptTab); // set the default factors for source energy - they will be overwritten if the user sets any values - state.dataOutRptTab->sourceFactorElectric = 3.167; - state.dataOutRptTab->sourceFactorNaturalGas = 1.084; - state.dataOutRptTab->sourceFactorSteam = 1.20; - state.dataOutRptTab->sourceFactorGasoline = 1.05; - state.dataOutRptTab->sourceFactorDiesel = 1.05; - state.dataOutRptTab->sourceFactorCoal = 1.05; - state.dataOutRptTab->sourceFactorFuelOil1 = 1.05; - state.dataOutRptTab->sourceFactorFuelOil2 = 1.05; - state.dataOutRptTab->sourceFactorPropane = 1.05; - state.dataOutRptTab->sourceFactorOtherFuel1 = 1.0; - state.dataOutRptTab->sourceFactorOtherFuel2 = 1.0; + ort->sourceFactorElectric = 3.167; + ort->sourceFactorNaturalGas = 1.084; + ort->sourceFactorSteam = 1.20; + ort->sourceFactorGasoline = 1.05; + ort->sourceFactorDiesel = 1.05; + ort->sourceFactorCoal = 1.05; + ort->sourceFactorFuelOil1 = 1.05; + ort->sourceFactorFuelOil2 = 1.05; + ort->sourceFactorPropane = 1.05; + ort->sourceFactorOtherFuel1 = 1.0; + ort->sourceFactorOtherFuel2 = 1.0; // the following should be kept consistent with the assumptions in the pollution calculation routines - state.dataOutRptTab->efficiencyDistrictCooling = 3.0; - state.dataOutRptTab->efficiencyDistrictHeating = 0.3; + ort->efficiencyDistrictCooling = 3.0; + ort->efficiencyDistrictHeating = 0.3; // TotalSourceEnergyUse = (gatherTotalsSource(1) & !total source from electricity // + gatherTotalsSource(2) & !natural gas @@ -2797,165 +2809,165 @@ namespace EnergyPlus::OutputReportTabular { GetFuelFactorInfo(state, "NaturalGas", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->sourceFactorNaturalGas = curSourceFactor; - state.dataOutRptTab->fuelfactorsused(2) = true; - state.dataOutRptTab->ffUsed(2) = true; + ort->sourceFactorNaturalGas = curSourceFactor; + ort->fuelfactorsused(2) = true; + ort->ffUsed(2) = true; } - state.dataOutRptTab->SourceFactors(2) = curSourceFactor; + ort->SourceFactors(2) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->fuelFactorSchedulesUsed = true; - state.dataOutRptTab->ffSchedUsed(2) = true; - state.dataOutRptTab->ffSchedIndex(2) = ffScheduleIndex; + ort->fuelFactorSchedulesUsed = true; + ort->ffSchedUsed(2) = true; + ort->ffSchedIndex(2) = ffScheduleIndex; } GetFuelFactorInfo(state, "FuelOilNo2", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->sourceFactorFuelOil2 = curSourceFactor; - state.dataOutRptTab->fuelfactorsused(7) = true; - state.dataOutRptTab->ffUsed(11) = true; + ort->sourceFactorFuelOil2 = curSourceFactor; + ort->fuelfactorsused(7) = true; + ort->ffUsed(11) = true; } - state.dataOutRptTab->SourceFactors(11) = curSourceFactor; + ort->SourceFactors(11) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->fuelFactorSchedulesUsed = true; - state.dataOutRptTab->ffSchedUsed(11) = true; - state.dataOutRptTab->ffSchedIndex(11) = ffScheduleIndex; + ort->fuelFactorSchedulesUsed = true; + ort->ffSchedUsed(11) = true; + ort->ffSchedIndex(11) = ffScheduleIndex; } GetFuelFactorInfo(state, "FuelOilNo1", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->sourceFactorFuelOil1 = curSourceFactor; - state.dataOutRptTab->fuelfactorsused(6) = true; - state.dataOutRptTab->ffUsed(10) = true; + ort->sourceFactorFuelOil1 = curSourceFactor; + ort->fuelfactorsused(6) = true; + ort->ffUsed(10) = true; } - state.dataOutRptTab->SourceFactors(10) = curSourceFactor; + ort->SourceFactors(10) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->fuelFactorSchedulesUsed = true; - state.dataOutRptTab->ffSchedUsed(10) = true; - state.dataOutRptTab->ffSchedIndex(10) = ffScheduleIndex; + ort->fuelFactorSchedulesUsed = true; + ort->ffSchedUsed(10) = true; + ort->ffSchedIndex(10) = ffScheduleIndex; } GetFuelFactorInfo(state, "Coal", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->sourceFactorCoal = curSourceFactor; - state.dataOutRptTab->fuelfactorsused(5) = true; - state.dataOutRptTab->ffUsed(9) = true; + ort->sourceFactorCoal = curSourceFactor; + ort->fuelfactorsused(5) = true; + ort->ffUsed(9) = true; } - state.dataOutRptTab->SourceFactors(9) = curSourceFactor; + ort->SourceFactors(9) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->fuelFactorSchedulesUsed = true; - state.dataOutRptTab->ffSchedUsed(9) = true; - state.dataOutRptTab->ffSchedIndex(9) = ffScheduleIndex; + ort->fuelFactorSchedulesUsed = true; + ort->ffSchedUsed(9) = true; + ort->ffSchedIndex(9) = ffScheduleIndex; } GetFuelFactorInfo(state, "Electricity", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->sourceFactorElectric = curSourceFactor; - state.dataOutRptTab->fuelfactorsused(1) = true; - state.dataOutRptTab->ffUsed(1) = true; + ort->sourceFactorElectric = curSourceFactor; + ort->fuelfactorsused(1) = true; + ort->ffUsed(1) = true; } - state.dataOutRptTab->SourceFactors(1) = curSourceFactor; + ort->SourceFactors(1) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->fuelFactorSchedulesUsed = true; - state.dataOutRptTab->ffSchedUsed(1) = true; - state.dataOutRptTab->ffSchedIndex(1) = ffScheduleIndex; + ort->fuelFactorSchedulesUsed = true; + ort->ffSchedUsed(1) = true; + ort->ffSchedIndex(1) = ffScheduleIndex; } GetFuelFactorInfo(state, "Gasoline", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->sourceFactorGasoline = curSourceFactor; - state.dataOutRptTab->fuelfactorsused(3) = true; - state.dataOutRptTab->ffUsed(6) = true; + ort->sourceFactorGasoline = curSourceFactor; + ort->fuelfactorsused(3) = true; + ort->ffUsed(6) = true; } - state.dataOutRptTab->SourceFactors(6) = curSourceFactor; + ort->SourceFactors(6) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->fuelFactorSchedulesUsed = true; - state.dataOutRptTab->ffSchedUsed(6) = true; - state.dataOutRptTab->ffSchedIndex(6) = ffScheduleIndex; + ort->fuelFactorSchedulesUsed = true; + ort->ffSchedUsed(6) = true; + ort->ffSchedIndex(6) = ffScheduleIndex; } GetFuelFactorInfo(state, "Propane", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->sourceFactorPropane = curSourceFactor; - state.dataOutRptTab->fuelfactorsused(8) = true; - state.dataOutRptTab->ffUsed(12) = true; + ort->sourceFactorPropane = curSourceFactor; + ort->fuelfactorsused(8) = true; + ort->ffUsed(12) = true; } - state.dataOutRptTab->SourceFactors(12) = curSourceFactor; + ort->SourceFactors(12) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->fuelFactorSchedulesUsed = true; - state.dataOutRptTab->ffSchedUsed(12) = true; - state.dataOutRptTab->ffSchedIndex(12) = ffScheduleIndex; + ort->fuelFactorSchedulesUsed = true; + ort->ffSchedUsed(12) = true; + ort->ffSchedIndex(12) = ffScheduleIndex; } GetFuelFactorInfo(state, "Diesel", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->sourceFactorDiesel = curSourceFactor; - state.dataOutRptTab->fuelfactorsused(4) = true; - state.dataOutRptTab->ffUsed(8) = true; + ort->sourceFactorDiesel = curSourceFactor; + ort->fuelfactorsused(4) = true; + ort->ffUsed(8) = true; } - state.dataOutRptTab->SourceFactors(8) = curSourceFactor; + ort->SourceFactors(8) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->fuelFactorSchedulesUsed = true; - state.dataOutRptTab->ffSchedUsed(8) = true; - state.dataOutRptTab->ffSchedIndex(8) = ffScheduleIndex; + ort->fuelFactorSchedulesUsed = true; + ort->ffSchedUsed(8) = true; + ort->ffSchedIndex(8) = ffScheduleIndex; } GetFuelFactorInfo(state, "DistrictCooling", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->ffUsed(3) = true; + ort->ffUsed(3) = true; } - state.dataOutRptTab->SourceFactors(3) = curSourceFactor; + ort->SourceFactors(3) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->ffSchedUsed(3) = true; - state.dataOutRptTab->ffSchedIndex(3) = ffScheduleIndex; + ort->ffSchedUsed(3) = true; + ort->ffSchedIndex(3) = ffScheduleIndex; } GetFuelFactorInfo(state, "DistrictHeating", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->ffUsed(4) = true; + ort->ffUsed(4) = true; } - state.dataOutRptTab->SourceFactors(4) = curSourceFactor; + ort->SourceFactors(4) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->ffSchedUsed(4) = true; - state.dataOutRptTab->ffSchedIndex(4) = ffScheduleIndex; + ort->ffSchedUsed(4) = true; + ort->ffSchedIndex(4) = ffScheduleIndex; } GetFuelFactorInfo(state, "Steam", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->ffUsed(5) = true; + ort->ffUsed(5) = true; } - state.dataOutRptTab->SourceFactors(5) = curSourceFactor; + ort->SourceFactors(5) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->ffSchedUsed(5) = true; - state.dataOutRptTab->ffSchedIndex(5) = ffScheduleIndex; + ort->ffSchedUsed(5) = true; + ort->ffSchedIndex(5) = ffScheduleIndex; } GetFuelFactorInfo(state, "OtherFuel1", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->sourceFactorOtherFuel1 = curSourceFactor; - state.dataOutRptTab->fuelfactorsused(11) = true; // should be source number - state.dataOutRptTab->ffUsed(13) = true; + ort->sourceFactorOtherFuel1 = curSourceFactor; + ort->fuelfactorsused(11) = true; // should be source number + ort->ffUsed(13) = true; } - state.dataOutRptTab->SourceFactors(13) = curSourceFactor; + ort->SourceFactors(13) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->fuelFactorSchedulesUsed = true; - state.dataOutRptTab->ffSchedUsed(13) = true; - state.dataOutRptTab->ffSchedIndex(13) = ffScheduleIndex; + ort->fuelFactorSchedulesUsed = true; + ort->ffSchedUsed(13) = true; + ort->ffSchedIndex(13) = ffScheduleIndex; } GetFuelFactorInfo(state, "OtherFuel2", fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); if (fuelFactorUsed) { - state.dataOutRptTab->sourceFactorOtherFuel2 = curSourceFactor; - state.dataOutRptTab->fuelfactorsused(12) = true; // should be source number - state.dataOutRptTab->ffUsed(14) = true; + ort->sourceFactorOtherFuel2 = curSourceFactor; + ort->fuelfactorsused(12) = true; // should be source number + ort->ffUsed(14) = true; } - state.dataOutRptTab->SourceFactors(14) = curSourceFactor; + ort->SourceFactors(14) = curSourceFactor; if (fFScheduleUsed) { - state.dataOutRptTab->fuelFactorSchedulesUsed = true; - state.dataOutRptTab->ffSchedUsed(14) = true; - state.dataOutRptTab->ffSchedIndex(14) = ffScheduleIndex; + ort->fuelFactorSchedulesUsed = true; + ort->ffSchedUsed(14) = true; + ort->ffSchedIndex(14) = ffScheduleIndex; } - GetEnvironmentalImpactFactorInfo(state, state.dataOutRptTab->efficiencyDistrictHeating, state.dataOutRptTab->efficiencyDistrictCooling, state.dataOutRptTab->sourceFactorSteam); + GetEnvironmentalImpactFactorInfo(state, ort->efficiencyDistrictHeating, ort->efficiencyDistrictCooling, ort->sourceFactorSteam); } //====================================================================================================================== @@ -3004,15 +3016,16 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int iStyle; std::string curDel; + auto &ort(state.dataOutRptTab); // get a new file unit number // create a file to hold the results - // Use a CSV file if comma seperated but otherwise use TXT file + // Use a CSV file if comma separated but otherwise use TXT file // extension. - if (state.dataOutRptTab->WriteTabularFiles && state.files.outputControl.tabular) { - for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { - curDel = state.dataOutRptTab->del(iStyle); - if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::Comma) { + if (ort->WriteTabularFiles && state.files.outputControl.tabular) { + for (iStyle = 1; iStyle <= ort->numStyles; ++iStyle) { + curDel = ort->del(iStyle); + if (ort->TableStyle(iStyle) == iTableStyle::Comma) { DisplayString(state, "Writing tabular output file results using comma format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblCsvFileName, state.files.outputControl.tabular); tbl_stream << "Program Version:" << curDel << VerString << '\n'; @@ -3025,7 +3038,7 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << "Environment:" << curDel << state.dataEnvrn->EnvironmentName << " ** " << state.dataEnvrn->WeatherFileLocationTitle << '\n'; } tbl_stream << '\n'; - } else if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::Tab) { + } else if (ort->TableStyle(iStyle) == iTableStyle::Tab) { DisplayString(state, "Writing tabular output file results using tab format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblTabFileName, state.files.outputControl.tabular); tbl_stream << "Program Version" << curDel << VerString << '\n'; @@ -3038,7 +3051,7 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << "Environment:" << curDel << state.dataEnvrn->EnvironmentName << " ** " << state.dataEnvrn->WeatherFileLocationTitle << '\n'; } tbl_stream << '\n'; - } else if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::HTML) { + } else if (ort->TableStyle(iStyle) == iTableStyle::HTML) { DisplayString(state, "Writing tabular output file results using HTML format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblHtmFileName, state.files.outputControl.tabular); tbl_stream << "\n"; @@ -3049,9 +3062,9 @@ namespace EnergyPlus::OutputReportTabular { } else { tbl_stream << " " << BuildingName << ' ' << state.dataEnvrn->EnvironmentName << " ** " << state.dataEnvrn->WeatherFileLocationTitle << '\n'; } - tbl_stream << " " << std::setw(4) << state.dataOutRptTab->td(1) << '-' << std::setfill('0') << std::setw(2) << state.dataOutRptTab->td(2) << '-' << std::setw(2) << state.dataOutRptTab->td(3) + tbl_stream << " " << std::setw(4) << ort->td(1) << '-' << std::setfill('0') << std::setw(2) << ort->td(2) << '-' << std::setw(2) << ort->td(3) << '\n'; - tbl_stream << " " << std::setw(2) << state.dataOutRptTab->td(5) << ':' << std::setw(2) << state.dataOutRptTab->td(6) << ':' << std::setw(2) << state.dataOutRptTab->td(7) << std::setfill(' ') + tbl_stream << " " << std::setw(2) << ort->td(5) << ':' << std::setw(2) << ort->td(6) << ':' << std::setw(2) << ort->td(7) << std::setfill(' ') << '\n'; tbl_stream << " - EnergyPlus\n"; tbl_stream << "\n"; @@ -3067,11 +3080,11 @@ namespace EnergyPlus::OutputReportTabular { } else { tbl_stream << "

Environment: " << state.dataEnvrn->EnvironmentName << " ** " << state.dataEnvrn->WeatherFileLocationTitle << "

\n"; } - tbl_stream << "

Simulation Timestamp: " << std::setw(4) << state.dataOutRptTab->td(1) << '-' << std::setfill('0') << std::setw(2) << state.dataOutRptTab->td(2) << '-' - << std::setw(2) << state.dataOutRptTab->td(3) << '\n'; - tbl_stream << " " << std::setw(2) << state.dataOutRptTab->td(5) << ':' << std::setw(2) << state.dataOutRptTab->td(6) << ':' << std::setw(2) << state.dataOutRptTab->td(7) << std::setfill(' ') + tbl_stream << "

Simulation Timestamp: " << std::setw(4) << ort->td(1) << '-' << std::setfill('0') << std::setw(2) << ort->td(2) << '-' + << std::setw(2) << ort->td(3) << '\n'; + tbl_stream << " " << std::setw(2) << ort->td(5) << ':' << std::setw(2) << ort->td(6) << ':' << std::setw(2) << ort->td(7) << std::setfill(' ') << "

\n"; - } else if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::XML) { + } else if (ort->TableStyle(iStyle) == iTableStyle::XML) { DisplayString(state, "Writing tabular output file results using XML format."); std::ofstream & tbl_stream = open_tbl_stream(state, iStyle, DataStringGlobals::outputTblXmlFileName, state.files.outputControl.tabular); tbl_stream << "\n"; @@ -3082,11 +3095,11 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << " " << VerString << "\n"; tbl_stream << " \n"; tbl_stream << " \n"; - tbl_stream << " " << std::setw(4) << state.dataOutRptTab->td(1) << '-' << std::setfill('0') << std::setw(2) << state.dataOutRptTab->td(2) << '-' << std::setw(2) - << state.dataOutRptTab->td(3) << '\n'; + tbl_stream << " " << std::setw(4) << ort->td(1) << '-' << std::setfill('0') << std::setw(2) << ort->td(2) << '-' << std::setw(2) + << ort->td(3) << '\n'; tbl_stream << " \n"; tbl_stream << " \n"; tbl_stream << " \n"; @@ -3145,16 +3158,17 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int iStyle; + auto &ort(state.dataOutRptTab); - if (state.dataOutRptTab->WriteTabularFiles) { - for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { - std::ofstream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); - if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::HTML) { // if HTML file put ending info + if (ort->WriteTabularFiles) { + for (iStyle = 1; iStyle <= ort->numStyles; ++iStyle) { + std::ofstream &tbl_stream(*ort->TabularOutputFile(iStyle)); + if (ort->TableStyle(iStyle) == iTableStyle::HTML) { // if HTML file put ending info tbl_stream << "\n"; tbl_stream << "\n"; - } else if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::XML) { - if (!state.dataOutRptTab->prevReportName.empty()) { - tbl_stream << "prevReportName << ">\n"; // close the last element if it was used. + } else if (ort->TableStyle(iStyle) == iTableStyle::XML) { + if (!ort->prevReportName.empty()) { + tbl_stream << "prevReportName << ">\n"; // close the last element if it was used. } tbl_stream << "\n"; } @@ -3221,32 +3235,33 @@ namespace EnergyPlus::OutputReportTabular { std::string origName; std::string curName; int indexUnitConv; + auto &ort(state.dataOutRptTab); // normally do not add to the table of contents here but the order of calls is different for the life-cycle costs - if (state.dataOutRptTab->displayLifeCycleCostReport && LCCparamPresent) { + if (ort->displayLifeCycleCostReport && LCCparamPresent) { AddTOCEntry(state, "Life-Cycle Cost Report", "Entire Facility"); } - for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { - if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::HTML) { - std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); + for (iStyle = 1; iStyle <= ort->numStyles; ++iStyle) { + if (ort->TableStyle(iStyle) == iTableStyle::HTML) { + std::ostream &tbl_stream(*ort->TabularOutputFile(iStyle)); tbl_stream << "
\n"; tbl_stream << "\n"; tbl_stream << "

Table of Contents

\n"; tbl_stream << "Top\n"; - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { tbl_stream << "
Annual Building Utility Performance Summary\n"; } - if (state.dataOutRptTab->displayTabularVeriSum) { + if (ort->displayTabularVeriSum) { tbl_stream << "
Input Verification and Results Summary\n"; } - if (state.dataOutRptTab->displayDemandEndUse) { + if (ort->displayDemandEndUse) { tbl_stream << "
Demand End Use Components Summary\n"; } - if (state.dataOutRptTab->displaySourceEnergyEndUseSummary) { + if (ort->displaySourceEnergyEndUseSummary) { tbl_stream << "
Source Energy End Use Components Summary\n"; } @@ -3254,22 +3269,22 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << "
Component Cost Economics Summary\n"; } - if (state.dataOutRptTab->displayComponentSizing) { + if (ort->displayComponentSizing) { tbl_stream << "
Component Sizing Summary\n"; } - if (state.dataOutRptTab->displaySurfaceShadowing) { + if (ort->displaySurfaceShadowing) { tbl_stream << "
Surface Shadowing Summary\n"; } - if (state.dataOutRptTab->displayAdaptiveComfort) { + if (ort->displayAdaptiveComfort) { tbl_stream << "
Adaptive Comfort Summary\n"; } - if (state.dataOutRptTab->displayEioSummary) { + if (ort->displayEioSummary) { tbl_stream << "
Initialization Summary\n"; } - if (state.dataOutRptTab->displayHeatEmissionsSummary) { + if (ort->displayHeatEmissionsSummary) { tbl_stream << "
Annual Heat Emissions Summary\n"; } @@ -3292,40 +3307,40 @@ namespace EnergyPlus::OutputReportTabular { } } if (state.dataGlobal->DoWeathSim) { - for (iInput = 1; iInput <= state.dataOutRptTab->MonthlyInputCount; ++iInput) { - if (state.dataOutRptTab->MonthlyInput(iInput).numTables > 0) { - tbl_stream << "

" << state.dataOutRptTab->MonthlyInput(iInput).name << "

|\n"; - for (jTable = 1; jTable <= state.dataOutRptTab->MonthlyInput(iInput).numTables; ++jTable) { - curTable = jTable + state.dataOutRptTab->MonthlyInput(iInput).firstTable - 1; - tbl_stream << "MonthlyInput(iInput).name, state.dataOutRptTab->MonthlyTables(curTable).keyValue) << "\">" - << state.dataOutRptTab->MonthlyTables(curTable).keyValue << " | \n"; + for (iInput = 1; iInput <= ort->MonthlyInputCount; ++iInput) { + if (ort->MonthlyInput(iInput).numTables > 0) { + tbl_stream << "

" << ort->MonthlyInput(iInput).name << "

|\n"; + for (jTable = 1; jTable <= ort->MonthlyInput(iInput).numTables; ++jTable) { + curTable = jTable + ort->MonthlyInput(iInput).firstTable - 1; + tbl_stream << "MonthlyInput(iInput).name, ort->MonthlyTables(curTable).keyValue) << "\">" + << ort->MonthlyTables(curTable).keyValue << " | \n"; } } } - for (iInput = 1; iInput <= state.dataOutRptTab->OutputTableBinnedCount; ++iInput) { - if (state.dataOutRptTab->OutputTableBinned(iInput).numTables > 0) { - if (state.dataOutRptTab->OutputTableBinned(iInput).scheduleIndex == 0) { - tbl_stream << "

" << state.dataOutRptTab->OutputTableBinned(iInput).varOrMeter << "

|\n"; + for (iInput = 1; iInput <= ort->OutputTableBinnedCount; ++iInput) { + if (ort->OutputTableBinned(iInput).numTables > 0) { + if (ort->OutputTableBinned(iInput).scheduleIndex == 0) { + tbl_stream << "

" << ort->OutputTableBinned(iInput).varOrMeter << "

|\n"; } else { - tbl_stream << "

" << state.dataOutRptTab->OutputTableBinned(iInput).varOrMeter << " [" << state.dataOutRptTab->OutputTableBinned(iInput).ScheduleName + tbl_stream << "

" << ort->OutputTableBinned(iInput).varOrMeter << " [" << ort->OutputTableBinned(iInput).ScheduleName << "]

|\n"; } - for (jTable = 1; jTable <= state.dataOutRptTab->OutputTableBinned(iInput).numTables; ++jTable) { - curTable = state.dataOutRptTab->OutputTableBinned(iInput).resIndex + (jTable - 1); + for (jTable = 1; jTable <= ort->OutputTableBinned(iInput).numTables; ++jTable) { + curTable = ort->OutputTableBinned(iInput).resIndex + (jTable - 1); curName = ""; - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { - origName = state.dataOutRptTab->OutputTableBinned(iInput).varOrMeter + unitEnumToStringBrackets(state.dataOutRptTab->OutputTableBinned(iInput).units); + if (ort->unitsStyle == iUnitsStyle::InchPound) { + origName = ort->OutputTableBinned(iInput).varOrMeter + unitEnumToStringBrackets(ort->OutputTableBinned(iInput).units); LookupSItoIP(state, origName, indexUnitConv, curName); } else { - curName = state.dataOutRptTab->OutputTableBinned(iInput).varOrMeter + unitEnumToStringBrackets(state.dataOutRptTab->OutputTableBinned(iInput).units); + curName = ort->OutputTableBinned(iInput).varOrMeter + unitEnumToStringBrackets(ort->OutputTableBinned(iInput).units); } - if (state.dataOutRptTab->OutputTableBinned(iInput).scheduleIndex == 0) { - tbl_stream << "BinObjVarID(curTable).namesOfObj) << "\">" - << state.dataOutRptTab->BinObjVarID(curTable).namesOfObj << " | \n"; + if (ort->OutputTableBinned(iInput).scheduleIndex == 0) { + tbl_stream << "BinObjVarID(curTable).namesOfObj) << "\">" + << ort->BinObjVarID(curTable).namesOfObj << " | \n"; } else { tbl_stream << "OutputTableBinned(iInput).ScheduleName, state.dataOutRptTab->BinObjVarID(curTable).namesOfObj) - << "\">" << state.dataOutRptTab->BinObjVarID(curTable).namesOfObj << " | \n"; + << MakeAnchorName(curName + ort->OutputTableBinned(iInput).ScheduleName, ort->BinObjVarID(curTable).namesOfObj) + << "\">" << ort->BinObjVarID(curTable).namesOfObj << " | \n"; } } } @@ -3333,16 +3348,16 @@ namespace EnergyPlus::OutputReportTabular { OutputReportTabularAnnual::AddAnnualTableOfContents(tbl_stream); } // add entries specifically added using AddTOCEntry - for (iEntry = 1; iEntry <= state.dataOutRptTab->TOCEntriesCount; ++iEntry) { - if (!state.dataOutRptTab->TOCEntries(iEntry).isWritten) { - curSection = state.dataOutRptTab->TOCEntries(iEntry).sectionName; + for (iEntry = 1; iEntry <= ort->TOCEntriesCount; ++iEntry) { + if (!ort->TOCEntries(iEntry).isWritten) { + curSection = ort->TOCEntries(iEntry).sectionName; tbl_stream << "

" << curSection << "

|\n"; - for (jEntry = iEntry; jEntry <= state.dataOutRptTab->TOCEntriesCount; ++jEntry) { - if (!state.dataOutRptTab->TOCEntries(jEntry).isWritten) { - if (state.dataOutRptTab->TOCEntries(jEntry).sectionName == curSection) { - tbl_stream << "TOCEntries(jEntry).sectionName, state.dataOutRptTab->TOCEntries(jEntry).reportName) - << "\">" << state.dataOutRptTab->TOCEntries(jEntry).reportName << " | \n"; - state.dataOutRptTab->TOCEntries(jEntry).isWritten = true; + for (jEntry = iEntry; jEntry <= ort->TOCEntriesCount; ++jEntry) { + if (!ort->TOCEntries(jEntry).isWritten) { + if (ort->TOCEntries(jEntry).sectionName == curSection) { + tbl_stream << "TOCEntries(jEntry).sectionName, ort->TOCEntries(jEntry).reportName) + << "\">" << ort->TOCEntries(jEntry).reportName << " | \n"; + ort->TOCEntries(jEntry).isWritten = true; } } } @@ -3406,23 +3421,22 @@ namespace EnergyPlus::OutputReportTabular { int binNum; int repIndex; OutputProcessor::TimeStepType curStepType; - - // REAL(r64), external :: GetInternalVariableValue + auto &ort(state.dataOutRptTab); if (!state.dataGlobal->DoWeathSim) return; elapsedTime = TimeStepSys; - state.dataOutRptTab->timeInYear += elapsedTime; - for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { + ort->timeInYear += elapsedTime; + for (iInObj = 1; iInObj <= ort->OutputTableBinnedCount; ++iInObj) { // get values of array for current object being referenced - curIntervalStart = state.dataOutRptTab->OutputTableBinned(iInObj).intervalStart; - curIntervalSize = state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize; - curIntervalCount = state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount; - curResIndex = state.dataOutRptTab->OutputTableBinned(iInObj).resIndex; - curNumTables = state.dataOutRptTab->OutputTableBinned(iInObj).numTables; + curIntervalStart = ort->OutputTableBinned(iInObj).intervalStart; + curIntervalSize = ort->OutputTableBinned(iInObj).intervalSize; + curIntervalCount = ort->OutputTableBinned(iInObj).intervalCount; + curResIndex = ort->OutputTableBinned(iInObj).resIndex; + curNumTables = ort->OutputTableBinned(iInObj).numTables; topValue = curIntervalStart + curIntervalSize * curIntervalCount; - curTypeOfVar = state.dataOutRptTab->OutputTableBinned(iInObj).typeOfVar; - curStepType = state.dataOutRptTab->OutputTableBinned(iInObj).stepType; - curScheduleIndex = state.dataOutRptTab->OutputTableBinned(iInObj).scheduleIndex; + curTypeOfVar = ort->OutputTableBinned(iInObj).typeOfVar; + curStepType = ort->OutputTableBinned(iInObj).stepType; + curScheduleIndex = ort->OutputTableBinned(iInObj).scheduleIndex; // if a schedule was used, check if it was non-zero value if (curScheduleIndex != 0) { if (GetCurrentScheduleValue(state, curScheduleIndex) != 0.0) { @@ -3441,14 +3455,14 @@ namespace EnergyPlus::OutputReportTabular { ((curStepType == OutputProcessor::TimeStepType::TimeStepSystem) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem))) { // put actual value from OutputProcesser arrays - curValue = GetInternalVariableValue(state, curTypeOfVar, state.dataOutRptTab->BinObjVarID(repIndex).varMeterNum); + curValue = GetInternalVariableValue(state, curTypeOfVar, ort->BinObjVarID(repIndex).varMeterNum); // per MJW when a summed variable is used divide it by the length of the time step if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { elapsedTime = TimeStepSys; } else { elapsedTime = state.dataGlobal->TimeStepZone; } - if (state.dataOutRptTab->OutputTableBinned(iInObj).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (ort->OutputTableBinned(iInObj).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable curValue /= (elapsedTime * DataGlobalConstants::SecInHour); } // round the value to the number of signficant digits used in the final output report @@ -3462,26 +3476,26 @@ namespace EnergyPlus::OutputReportTabular { // check if the value is above the maximum or below the minimum value // first before binning the value within the range. if (curValue < curIntervalStart) { - state.dataOutRptTab->BinResultsBelow(repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; - state.dataOutRptTab->BinResultsBelow(repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; + ort->BinResultsBelow(repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; + ort->BinResultsBelow(repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; } else if (curValue >= topValue) { - state.dataOutRptTab->BinResultsAbove(repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; - state.dataOutRptTab->BinResultsAbove(repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; + ort->BinResultsAbove(repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; + ort->BinResultsAbove(repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; } else { // determine which bin the results are in binNum = int((curValue - curIntervalStart) / curIntervalSize) + 1; - state.dataOutRptTab->BinResults(binNum, repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; - state.dataOutRptTab->BinResults(binNum, repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; + ort->BinResults(binNum, repIndex).mnth(state.dataEnvrn->Month) += elapsedTime; + ort->BinResults(binNum, repIndex).hrly(state.dataGlobal->HourOfDay) += elapsedTime; } // add to statistics array - ++state.dataOutRptTab->BinStatistics(repIndex).n; - state.dataOutRptTab->BinStatistics(repIndex).sum += curValue; - state.dataOutRptTab->BinStatistics(repIndex).sum2 += curValue * curValue; - if (curValue < state.dataOutRptTab->BinStatistics(repIndex).minimum) { - state.dataOutRptTab->BinStatistics(repIndex).minimum = curValue; + ++ort->BinStatistics(repIndex).n; + ort->BinStatistics(repIndex).sum += curValue; + ort->BinStatistics(repIndex).sum2 += curValue * curValue; + if (curValue < ort->BinStatistics(repIndex).minimum) { + ort->BinStatistics(repIndex).minimum = curValue; } - if (curValue > state.dataOutRptTab->BinStatistics(repIndex).maximum) { - state.dataOutRptTab->BinStatistics(repIndex).maximum = curValue; + if (curValue > ort->BinStatistics(repIndex).maximum) { + ort->BinStatistics(repIndex).maximum = curValue; } } } @@ -3556,17 +3570,18 @@ namespace EnergyPlus::OutputReportTabular { static int curFirstColumn(0); if (!state.dataGlobal->DoWeathSim) return; + auto &ort(state.dataOutRptTab); assert(state.dataGlobal->TimeStepZoneSec > 0.0); // create temporary arrays to speed processing of these arrays - if (state.dataOutRptTab->GatherMonthlyResultsForTimestepRunOnce) { + if (ort->GatherMonthlyResultsForTimestepRunOnce) { // MonthlyColumns - MonthlyColumnsTypeOfVar.allocate(state.dataOutRptTab->MonthlyColumns.I()); - MonthlyColumnsStepType.allocate(state.dataOutRptTab->MonthlyColumns.I()); - MonthlyColumnsAggType.allocate(state.dataOutRptTab->MonthlyColumns.I()); - MonthlyColumnsVarNum.allocate(state.dataOutRptTab->MonthlyColumns.I()); - for (int i = state.dataOutRptTab->MonthlyColumns.l(), e = state.dataOutRptTab->MonthlyColumns.u(); i <= e; ++i) { - auto const &col(state.dataOutRptTab->MonthlyColumns(i)); + MonthlyColumnsTypeOfVar.allocate(ort->MonthlyColumns.I()); + MonthlyColumnsStepType.allocate(ort->MonthlyColumns.I()); + MonthlyColumnsAggType.allocate(ort->MonthlyColumns.I()); + MonthlyColumnsVarNum.allocate(ort->MonthlyColumns.I()); + for (int i = ort->MonthlyColumns.l(), e = ort->MonthlyColumns.u(); i <= e; ++i) { + auto const &col(ort->MonthlyColumns(i)); MonthlyColumnsTypeOfVar(i) = col.typeOfVar; MonthlyColumnsStepType(i) = col.stepType; MonthlyColumnsAggType(i) = col.aggType; @@ -3574,13 +3589,13 @@ namespace EnergyPlus::OutputReportTabular { } // MonthlyTables - MonthlyTablesNumColumns.allocate(state.dataOutRptTab->MonthlyTables.I()); - for (int i = state.dataOutRptTab->MonthlyTables.l(), e = state.dataOutRptTab->MonthlyTables.u(); i <= e; ++i) { - MonthlyTablesNumColumns(i) = state.dataOutRptTab->MonthlyTables(i).numColumns; + MonthlyTablesNumColumns.allocate(ort->MonthlyTables.I()); + for (int i = ort->MonthlyTables.l(), e = ort->MonthlyTables.u(); i <= e; ++i) { + MonthlyTablesNumColumns(i) = ort->MonthlyTables(i).numColumns; } // set flag so this block is only executed once - state.dataOutRptTab->GatherMonthlyResultsForTimestepRunOnce = false; + ort->GatherMonthlyResultsForTimestepRunOnce = false; } elapsedTime = TimeStepSys; @@ -3589,11 +3604,11 @@ namespace EnergyPlus::OutputReportTabular { } else { elapsedTime = state.dataGlobal->TimeStepZone; } - state.dataOutRptTab->IsMonthGathered(state.dataEnvrn->Month) = true; - for (iTable = 1; iTable <= state.dataOutRptTab->MonthlyTablesCount; ++iTable) { + ort->IsMonthGathered(state.dataEnvrn->Month) = true; + for (iTable = 1; iTable <= ort->MonthlyTablesCount; ++iTable) { activeMinMax = false; // at the beginning of the new timestep activeHoursShown = false; // fix by JG addressing CR6482 - curFirstColumn = state.dataOutRptTab->MonthlyTables(iTable).firstColumn; + curFirstColumn = ort->MonthlyTables(iTable).firstColumn; for (jColumn = 1; jColumn <= MonthlyTablesNumColumns(iTable); ++jColumn) { curCol = jColumn + curFirstColumn - 1; curTypeOfVar = MonthlyColumnsTypeOfVar(curCol); @@ -3607,9 +3622,9 @@ namespace EnergyPlus::OutputReportTabular { curVarNum = MonthlyColumnsVarNum(curCol); curValue = GetInternalVariableValue(state, curTypeOfVar, curVarNum); // Get the value from the result array - oldResultValue = state.dataOutRptTab->MonthlyColumns(curCol).reslt(state.dataEnvrn->Month); - oldTimeStamp = state.dataOutRptTab->MonthlyColumns(curCol).timeStamp(state.dataEnvrn->Month); - oldDuration = state.dataOutRptTab->MonthlyColumns(curCol).duration(state.dataEnvrn->Month); + oldResultValue = ort->MonthlyColumns(curCol).reslt(state.dataEnvrn->Month); + oldTimeStamp = ort->MonthlyColumns(curCol).timeStamp(state.dataEnvrn->Month); + oldDuration = ort->MonthlyColumns(curCol).duration(state.dataEnvrn->Month); // Zero the revised values (as default if not set later in SELECT) newResultValue = 0.0; newTimeStamp = 0; @@ -3626,7 +3641,7 @@ namespace EnergyPlus::OutputReportTabular { { auto const SELECT_CASE_var(MonthlyColumnsAggType(curCol)); if (SELECT_CASE_var == iAggType::SumOrAvg) { - if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (ort->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable newResultValue = oldResultValue + curValue; } else { newResultValue = oldResultValue + curValue * elapsedTime; // for averaging - weight by elapsed time @@ -3635,7 +3650,7 @@ namespace EnergyPlus::OutputReportTabular { activeNewValue = true; } else if (SELECT_CASE_var == iAggType::Maximum) { // per MJW when a summed variable is used divide it by the length of the time step - if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (ort->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { curValue /= (TimeStepSys * DataGlobalConstants::SecInHour); } else { @@ -3652,7 +3667,7 @@ namespace EnergyPlus::OutputReportTabular { } } else if (SELECT_CASE_var == iAggType::Minimum) { // per MJW when a summed variable is used divide it by the length of the time step - if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (ort->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { curValue /= (TimeStepSys * DataGlobalConstants::SecInHour); } else { @@ -3726,9 +3741,9 @@ namespace EnergyPlus::OutputReportTabular { // new columns. This skips the aggregation types that don't even get // triggered now such as valueWhenMinMax and all the agg*HoursShown if (activeNewValue) { - state.dataOutRptTab->MonthlyColumns(curCol).reslt(state.dataEnvrn->Month) = newResultValue; - state.dataOutRptTab->MonthlyColumns(curCol).timeStamp(state.dataEnvrn->Month) = newTimeStamp; - state.dataOutRptTab->MonthlyColumns(curCol).duration(state.dataEnvrn->Month) = newDuration; + ort->MonthlyColumns(curCol).reslt(state.dataEnvrn->Month) = newResultValue; + ort->MonthlyColumns(curCol).timeStamp(state.dataEnvrn->Month) = newTimeStamp; + ort->MonthlyColumns(curCol).duration(state.dataEnvrn->Month) = newDuration; } // if a minimum or maximum value was set this timeStep then // scan the remaining columns of the table looking for values @@ -3736,27 +3751,27 @@ namespace EnergyPlus::OutputReportTabular { // if another minimum or maximum column is found then end // the scan (it will be taken care of when that column is done) if (activeMinMax) { - for (kOtherColumn = jColumn + 1; kOtherColumn <= state.dataOutRptTab->MonthlyTables(iTable).numColumns; ++kOtherColumn) { - scanColumn = kOtherColumn + state.dataOutRptTab->MonthlyTables(iTable).firstColumn - 1; + for (kOtherColumn = jColumn + 1; kOtherColumn <= ort->MonthlyTables(iTable).numColumns; ++kOtherColumn) { + scanColumn = kOtherColumn + ort->MonthlyTables(iTable).firstColumn - 1; { - auto const SELECT_CASE_var(state.dataOutRptTab->MonthlyColumns(scanColumn).aggType); + auto const SELECT_CASE_var(ort->MonthlyColumns(scanColumn).aggType); if ((SELECT_CASE_var == iAggType::Maximum) || (SELECT_CASE_var == iAggType::Minimum)) { // end scanning since these might reset break; // do } else if (SELECT_CASE_var == iAggType::ValueWhenMaxMin) { // this case is when the value should be set - scanTypeOfVar = state.dataOutRptTab->MonthlyColumns(scanColumn).typeOfVar; - scanVarNum = state.dataOutRptTab->MonthlyColumns(scanColumn).varNum; + scanTypeOfVar = ort->MonthlyColumns(scanColumn).typeOfVar; + scanVarNum = ort->MonthlyColumns(scanColumn).varNum; scanValue = GetInternalVariableValue(state, scanTypeOfVar, scanVarNum); // When a summed variable is used divide it by the length of the time step - if (state.dataOutRptTab->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (ort->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { scanValue /= (TimeStepSys * DataGlobalConstants::SecInHour); } else { scanValue /= state.dataGlobal->TimeStepZoneSec; } } - state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; + ort->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; } else { // do nothing } @@ -3766,14 +3781,14 @@ namespace EnergyPlus::OutputReportTabular { // If the hours variable is active then scan through the rest of the variables // and accumulate if (activeHoursShown) { - for (kOtherColumn = jColumn + 1; kOtherColumn <= state.dataOutRptTab->MonthlyTables(iTable).numColumns; ++kOtherColumn) { - scanColumn = kOtherColumn + state.dataOutRptTab->MonthlyTables(iTable).firstColumn - 1; - scanTypeOfVar = state.dataOutRptTab->MonthlyColumns(scanColumn).typeOfVar; - scanVarNum = state.dataOutRptTab->MonthlyColumns(scanColumn).varNum; + for (kOtherColumn = jColumn + 1; kOtherColumn <= ort->MonthlyTables(iTable).numColumns; ++kOtherColumn) { + scanColumn = kOtherColumn + ort->MonthlyTables(iTable).firstColumn - 1; + scanTypeOfVar = ort->MonthlyColumns(scanColumn).typeOfVar; + scanVarNum = ort->MonthlyColumns(scanColumn).varNum; scanValue = GetInternalVariableValue(state, scanTypeOfVar, scanVarNum); - oldScanValue = state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month); + oldScanValue = ort->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month); { - auto const SELECT_CASE_var(state.dataOutRptTab->MonthlyColumns(scanColumn).aggType); + auto const SELECT_CASE_var(ort->MonthlyColumns(scanColumn).aggType); if ((SELECT_CASE_var == iAggType::HoursZero) || (SELECT_CASE_var == iAggType::HoursNonZero)) { // end scanning since these might reset break; // do @@ -3785,15 +3800,15 @@ namespace EnergyPlus::OutputReportTabular { break; // do } else if (SELECT_CASE_var == iAggType::SumOrAverageHoursShown) { // this case is when the value should be set - if (state.dataOutRptTab->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable - state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = oldScanValue + scanValue; + if (ort->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + ort->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = oldScanValue + scanValue; } else { // for averaging - weight by elapsed time - state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = oldScanValue + scanValue * elapsedTime; + ort->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = oldScanValue + scanValue * elapsedTime; } - state.dataOutRptTab->MonthlyColumns(scanColumn).duration(state.dataEnvrn->Month) += elapsedTime; + ort->MonthlyColumns(scanColumn).duration(state.dataEnvrn->Month) += elapsedTime; } else if (SELECT_CASE_var == iAggType::MaximumDuringHoursShown) { - if (state.dataOutRptTab->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (ort->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { scanValue /= (TimeStepSys * DataGlobalConstants::SecInHour); } else { @@ -3801,11 +3816,11 @@ namespace EnergyPlus::OutputReportTabular { } } if (scanValue > oldScanValue) { - state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; - state.dataOutRptTab->MonthlyColumns(scanColumn).timeStamp(state.dataEnvrn->Month) = timestepTimeStamp; + ort->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; + ort->MonthlyColumns(scanColumn).timeStamp(state.dataEnvrn->Month) = timestepTimeStamp; } } else if (SELECT_CASE_var == iAggType::MinimumDuringHoursShown) { - if (state.dataOutRptTab->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (ort->MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { scanValue /= (TimeStepSys * DataGlobalConstants::SecInHour); } else { @@ -3813,8 +3828,8 @@ namespace EnergyPlus::OutputReportTabular { } } if (scanValue < oldScanValue) { - state.dataOutRptTab->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; - state.dataOutRptTab->MonthlyColumns(scanColumn).timeStamp(state.dataEnvrn->Month) = timestepTimeStamp; + ort->MonthlyColumns(scanColumn).reslt(state.dataEnvrn->Month) = scanValue; + ort->MonthlyColumns(scanColumn).timeStamp(state.dataEnvrn->Month) = timestepTimeStamp; } } else { // do nothing @@ -3903,10 +3918,11 @@ namespace EnergyPlus::OutputReportTabular { int kEndUseSub; Real64 curMeterValue; int curMeterNumber; + auto &ort(state.dataOutRptTab); // if no beps report is called then skip - if ((state.dataOutRptTab->displayTabularBEPS || state.dataOutRptTab->displayLEEDSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { + if ((ort->displayTabularBEPS || ort->displayLEEDSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // add the current time to the total elapsed time // FOLLOWING LINE MOVED TO UPDATETABULARREPORTS because used even when beps is not called // gatherElapsedTimeBEPS = gatherElapsedTimeBEPS + TimeStepZone @@ -3921,23 +3937,23 @@ namespace EnergyPlus::OutputReportTabular { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { - curMeterNumber = state.dataOutRptTab->meterNumTotalsBEPS(iResource); + curMeterNumber = ort->meterNumTotalsBEPS(iResource); if (curMeterNumber > 0) { curMeterValue = GetCurrentMeterValue(state, curMeterNumber); - state.dataOutRptTab->gatherTotalsBEPS(iResource) += curMeterValue; + ort->gatherTotalsBEPS(iResource) += curMeterValue; } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - curMeterNumber = state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse); + curMeterNumber = ort->meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { curMeterValue = GetCurrentMeterValue(state, curMeterNumber); - state.dataOutRptTab->gatherEndUseBEPS(iResource, jEndUse) += curMeterValue; + ort->gatherEndUseBEPS(iResource, jEndUse) += curMeterValue; for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - curMeterNumber = state.dataOutRptTab->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); + curMeterNumber = ort->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); if (curMeterNumber > 0) { curMeterValue = GetCurrentMeterValue(state, curMeterNumber); - state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, iResource) += curMeterValue; + ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, iResource) += curMeterValue; } } } @@ -3945,36 +3961,36 @@ namespace EnergyPlus::OutputReportTabular { } for (iResource = 1; iResource <= numSourceTypes; ++iResource) { - curMeterNumber = state.dataOutRptTab->meterNumTotalsSource(iResource); + curMeterNumber = ort->meterNumTotalsSource(iResource); if (curMeterNumber > 0) { curMeterValue = GetCurrentMeterValue(state, curMeterNumber); - state.dataOutRptTab->gatherTotalsSource(iResource) += curMeterValue; + ort->gatherTotalsSource(iResource) += curMeterValue; } } // gather the electric load components - state.dataOutRptTab->gatherPowerFuelFireGen += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumPowerFuelFireGen); - state.dataOutRptTab->gatherPowerPV += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumPowerPV); - state.dataOutRptTab->gatherPowerWind += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumPowerWind); - state.dataOutRptTab->gatherPowerHTGeothermal += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumPowerHTGeothermal); - state.dataOutRptTab->gatherElecProduced += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumElecProduced); - state.dataOutRptTab->gatherElecPurchased += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumElecPurchased); - state.dataOutRptTab->gatherElecSurplusSold += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumElecSurplusSold); - state.dataOutRptTab->gatherElecStorage += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumElecStorage); - state.dataOutRptTab->gatherPowerConversion += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumPowerConversion); + ort->gatherPowerFuelFireGen += GetCurrentMeterValue(state, ort->meterNumPowerFuelFireGen); + ort->gatherPowerPV += GetCurrentMeterValue(state, ort->meterNumPowerPV); + ort->gatherPowerWind += GetCurrentMeterValue(state, ort->meterNumPowerWind); + ort->gatherPowerHTGeothermal += GetCurrentMeterValue(state, ort->meterNumPowerHTGeothermal); + ort->gatherElecProduced += GetCurrentMeterValue(state, ort->meterNumElecProduced); + ort->gatherElecPurchased += GetCurrentMeterValue(state, ort->meterNumElecPurchased); + ort->gatherElecSurplusSold += GetCurrentMeterValue(state, ort->meterNumElecSurplusSold); + ort->gatherElecStorage += GetCurrentMeterValue(state, ort->meterNumElecStorage); + ort->gatherPowerConversion += GetCurrentMeterValue(state, ort->meterNumPowerConversion); // gather the onsite thermal components - state.dataOutRptTab->gatherWaterHeatRecovery += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumWaterHeatRecovery); - state.dataOutRptTab->gatherAirHeatRecoveryCool += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumAirHeatRecoveryCool); - state.dataOutRptTab->gatherAirHeatRecoveryHeat += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumAirHeatRecoveryHeat); - state.dataOutRptTab->gatherHeatHTGeothermal += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumHeatHTGeothermal); - state.dataOutRptTab->gatherHeatSolarWater += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumHeatSolarWater); - state.dataOutRptTab->gatherHeatSolarAir += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumHeatSolarAir); + ort->gatherWaterHeatRecovery += GetCurrentMeterValue(state, ort->meterNumWaterHeatRecovery); + ort->gatherAirHeatRecoveryCool += GetCurrentMeterValue(state, ort->meterNumAirHeatRecoveryCool); + ort->gatherAirHeatRecoveryHeat += GetCurrentMeterValue(state, ort->meterNumAirHeatRecoveryHeat); + ort->gatherHeatHTGeothermal += GetCurrentMeterValue(state, ort->meterNumHeatHTGeothermal); + ort->gatherHeatSolarWater += GetCurrentMeterValue(state, ort->meterNumHeatSolarWater); + ort->gatherHeatSolarAir += GetCurrentMeterValue(state, ort->meterNumHeatSolarAir); // gather the water supply components - state.dataOutRptTab->gatherRainWater += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumRainWater); - state.dataOutRptTab->gatherCondensate += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumCondensate); - state.dataOutRptTab->gatherWellwater += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumGroundwater); - state.dataOutRptTab->gatherMains += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumMains); - state.dataOutRptTab->gatherWaterEndUseTotal += GetCurrentMeterValue(state, state.dataOutRptTab->meterNumWaterEndUseTotal); + ort->gatherRainWater += GetCurrentMeterValue(state, ort->meterNumRainWater); + ort->gatherCondensate += GetCurrentMeterValue(state, ort->meterNumCondensate); + ort->gatherWellwater += GetCurrentMeterValue(state, ort->meterNumGroundwater); + ort->gatherMains += GetCurrentMeterValue(state, ort->meterNumMains); + ort->gatherWaterEndUseTotal += GetCurrentMeterValue(state, ort->meterNumWaterEndUseTotal); } } @@ -4062,41 +4078,42 @@ namespace EnergyPlus::OutputReportTabular { int iResource; Real64 curMeterValue; int curMeterNumber; + auto &ort(state.dataOutRptTab); // if no beps by source report is called then skip - if ((state.dataOutRptTab->displaySourceEnergyEndUseSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { + if ((ort->displaySourceEnergyEndUseSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { - if (state.dataOutRptTab->ffSchedUsed(iResource)) { - curMeterNumber = state.dataOutRptTab->meterNumTotalsBEPS(iResource); + if (ort->ffSchedUsed(iResource)) { + curMeterNumber = ort->meterNumTotalsBEPS(iResource); if (curMeterNumber > 0) { curMeterValue = - GetCurrentMeterValue(state, curMeterNumber) * GetCurrentScheduleValue(state, state.dataOutRptTab->ffSchedIndex(iResource)) * state.dataOutRptTab->SourceFactors(iResource); - state.dataOutRptTab->gatherTotalsBySourceBEPS(iResource) += curMeterValue; + GetCurrentMeterValue(state, curMeterNumber) * GetCurrentScheduleValue(state, ort->ffSchedIndex(iResource)) * ort->SourceFactors(iResource); + ort->gatherTotalsBySourceBEPS(iResource) += curMeterValue; } } else { - curMeterNumber = state.dataOutRptTab->meterNumTotalsBEPS(iResource); + curMeterNumber = ort->meterNumTotalsBEPS(iResource); if (curMeterNumber > 0) { - curMeterValue = GetCurrentMeterValue(state, curMeterNumber) * state.dataOutRptTab->SourceFactors(iResource); - state.dataOutRptTab->gatherTotalsBySourceBEPS(iResource) += curMeterValue; + curMeterValue = GetCurrentMeterValue(state, curMeterNumber) * ort->SourceFactors(iResource); + ort->gatherTotalsBySourceBEPS(iResource) += curMeterValue; } } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - if (state.dataOutRptTab->ffSchedUsed(iResource)) { - curMeterNumber = state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse); + if (ort->ffSchedUsed(iResource)) { + curMeterNumber = ort->meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { curMeterValue = - GetCurrentMeterValue(state, curMeterNumber) * GetCurrentScheduleValue(state, state.dataOutRptTab->ffSchedIndex(iResource)) * state.dataOutRptTab->SourceFactors(iResource); - state.dataOutRptTab->gatherEndUseBySourceBEPS(iResource, jEndUse) += curMeterValue; + GetCurrentMeterValue(state, curMeterNumber) * GetCurrentScheduleValue(state, ort->ffSchedIndex(iResource)) * ort->SourceFactors(iResource); + ort->gatherEndUseBySourceBEPS(iResource, jEndUse) += curMeterValue; } } else { - curMeterNumber = state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse); + curMeterNumber = ort->meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { - curMeterValue = GetCurrentMeterValue(state, curMeterNumber) * state.dataOutRptTab->SourceFactors(iResource); - state.dataOutRptTab->gatherEndUseBySourceBEPS(iResource, jEndUse) += curMeterValue; + curMeterValue = GetCurrentMeterValue(state, curMeterNumber) * ort->SourceFactors(iResource); + ort->gatherEndUseBySourceBEPS(iResource, jEndUse) += curMeterValue; } } } @@ -4185,33 +4202,34 @@ namespace EnergyPlus::OutputReportTabular { int minuteCalculated; int timestepTimeStamp; assert(state.dataGlobal->TimeStepZoneSec > 0.0); + auto &ort(state.dataOutRptTab); - if ((state.dataOutRptTab->displayDemandEndUse) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { + if ((ort->displayDemandEndUse) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { - curMeterNumber = state.dataOutRptTab->meterNumTotalsBEPS(iResource); + curMeterNumber = ort->meterNumTotalsBEPS(iResource); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(state, curMeterNumber) / state.dataGlobal->TimeStepZoneSec; // check if current value is greater than existing peak demand value - if (curDemandValue > state.dataOutRptTab->gatherDemandTotal(iResource)) { - state.dataOutRptTab->gatherDemandTotal(iResource) = curDemandValue; + if (curDemandValue > ort->gatherDemandTotal(iResource)) { + ort->gatherDemandTotal(iResource) = curDemandValue; // save the time that the peak demand occurred // minuteCalculated = (CurrentTime - INT(CurrentTime))*60 minuteCalculated = DetermineMinuteForReporting(state, t_timeStepType); EncodeMonDayHrMin(timestepTimeStamp, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->HourOfDay, minuteCalculated); - state.dataOutRptTab->gatherDemandTimeStamp(iResource) = timestepTimeStamp; + ort->gatherDemandTimeStamp(iResource) = timestepTimeStamp; // if new peak demand is set, then gather all of the end use values at this particular // time to find the components of the peak demand for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - curMeterNumber = state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse); + curMeterNumber = ort->meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(state, curMeterNumber) / state.dataGlobal->TimeStepZoneSec; - state.dataOutRptTab->gatherDemandEndUse(iResource, jEndUse) = curDemandValue; + ort->gatherDemandEndUse(iResource, jEndUse) = curDemandValue; for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - curMeterNumber = state.dataOutRptTab->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); + curMeterNumber = ort->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(state, curMeterNumber) / state.dataGlobal->TimeStepZoneSec; - state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, iResource) = curDemandValue; + ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, iResource) = curDemandValue; } } } @@ -4222,23 +4240,23 @@ namespace EnergyPlus::OutputReportTabular { } // gather the peak demands of each individual enduse subcategory for the LEED report - if ((state.dataOutRptTab->displayLEEDSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { + if ((ort->displayLEEDSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - curMeterNumber = state.dataOutRptTab->meterNumEndUseBEPS(iResource, jEndUse); + curMeterNumber = ort->meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(state, curMeterNumber) / state.dataGlobal->TimeStepZoneSec; - if (curDemandValue > state.dataOutRptTab->gatherDemandIndEndUse(iResource, jEndUse)) { - state.dataOutRptTab->gatherDemandIndEndUse(iResource, jEndUse) = curDemandValue; + if (curDemandValue > ort->gatherDemandIndEndUse(iResource, jEndUse)) { + ort->gatherDemandIndEndUse(iResource, jEndUse) = curDemandValue; } for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - curMeterNumber = state.dataOutRptTab->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); + curMeterNumber = ort->meterNumEndUseSubBEPS(kEndUseSub, jEndUse, iResource); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(state, curMeterNumber) / state.dataGlobal->TimeStepZoneSec; // check if current value is greater than existing peak demand value - if (curDemandValue > state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, iResource)) { - state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, iResource) = curDemandValue; + if (curDemandValue > ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, iResource)) { + ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, iResource) = curDemandValue; } } } @@ -4266,8 +4284,9 @@ namespace EnergyPlus::OutputReportTabular { SysTotalHVACReliefHeatLoss = 0; SysTotalHVACRejectHeatLoss = 0; + auto &ort(state.dataOutRptTab); - if (!state.dataOutRptTab->displayHeatEmissionsSummary) return; // don't gather data if report isn't requested + if (!ort->displayHeatEmissionsSummary) return; // don't gather data if report isn't requested // Only gather zone report at zone time steps if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { @@ -4600,12 +4619,14 @@ namespace EnergyPlus::OutputReportTabular { if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) return; // only add values over the HVAC timestep basis - if (state.dataOutRptTab->GatherHeatGainReportfirstTime) { + auto &ort(state.dataOutRptTab); + + if (ort->GatherHeatGainReportfirstTime) { radiantHeat.allocate(state.dataGlobal->NumOfZones); radiantCool.allocate(state.dataGlobal->NumOfZones); ATUHeat.allocate(state.dataGlobal->NumOfZones); ATUCool.allocate(state.dataGlobal->NumOfZones); - state.dataOutRptTab->GatherHeatGainReportfirstTime = false; + ort->GatherHeatGainReportfirstTime = false; } // clear the radiant surface accumulation variables radiantHeat = 0.0; @@ -5112,8 +5133,9 @@ namespace EnergyPlus::OutputReportTabular { FillWeatherPredefinedEntries(state); FillRemainingPredefinedEntries(state); + auto &ort(state.dataOutRptTab); - if (state.dataOutRptTab->WriteTabularFiles) { + if (ort->WriteTabularFiles) { // call each type of report in turn WriteBEPSTable(state); WriteTableOfContents(state); @@ -5128,9 +5150,9 @@ namespace EnergyPlus::OutputReportTabular { WriteLoadComponentSummaryTables(state); WriteHeatEmissionTable(state); - if (state.dataOutRptTab->displayThermalResilienceSummary) WriteThermalResilienceTables(state); - if (state.dataOutRptTab->displayCO2ResilienceSummary) WriteCO2ResilienceTables(state); - if (state.dataOutRptTab->displayVisualResilienceSummary) WriteVisualResilienceTables(state); + if (ort->displayThermalResilienceSummary) WriteThermalResilienceTables(state); + if (ort->displayCO2ResilienceSummary) WriteCO2ResilienceTables(state); + if (ort->displayVisualResilienceSummary) WriteVisualResilienceTables(state); coilSelectionReportObj->finishCoilSummaryReportTable(state); // call to write out the coil selection summary table data WritePredefinedTables(state); // moved to come after zone load components is finished @@ -5144,12 +5166,12 @@ namespace EnergyPlus::OutputReportTabular { constexpr static auto variable_fmt{" {}={:12}\n"}; state.files.audit.ensure_open(state, "WriteTabularReports", state.files.outputControl.audit); - print(state.files.audit, variable_fmt, "MonthlyInputCount", state.dataOutRptTab->MonthlyInputCount); - print(state.files.audit, variable_fmt, "sizeMonthlyInput", state.dataOutRptTab->sizeMonthlyInput); - print(state.files.audit, variable_fmt, "MonthlyFieldSetInputCount", state.dataOutRptTab->MonthlyFieldSetInputCount); - print(state.files.audit, variable_fmt, "sizeMonthlyFieldSetInput", state.dataOutRptTab->sizeMonthlyFieldSetInput); - print(state.files.audit, variable_fmt, "MonthlyTablesCount", state.dataOutRptTab->MonthlyTablesCount); - print(state.files.audit, variable_fmt, "MonthlyColumnsCount", state.dataOutRptTab->MonthlyColumnsCount); + print(state.files.audit, variable_fmt, "MonthlyInputCount", ort->MonthlyInputCount); + print(state.files.audit, variable_fmt, "sizeMonthlyInput", ort->sizeMonthlyInput); + print(state.files.audit, variable_fmt, "MonthlyFieldSetInputCount", ort->MonthlyFieldSetInputCount); + print(state.files.audit, variable_fmt, "sizeMonthlyFieldSetInput", ort->sizeMonthlyFieldSetInput); + print(state.files.audit, variable_fmt, "MonthlyTablesCount", ort->MonthlyTablesCount); + print(state.files.audit, variable_fmt, "MonthlyColumnsCount", ort->MonthlyColumnsCount); print(state.files.audit, variable_fmt, "sizeReportName", state.dataOutRptPredefined->sizeReportName); print(state.files.audit, variable_fmt, "numReportName", state.dataOutRptPredefined->numReportName); print(state.files.audit, variable_fmt, "sizeSubTable", state.dataOutRptPredefined->sizeSubTable); @@ -5246,6 +5268,8 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE PARAMETER DEFINITIONS: static std::string const degChar("°"); + auto &ort(state.dataOutRptTab); + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: StatLineType lineType = StatLineType::Initialized; @@ -5336,7 +5360,7 @@ namespace EnergyPlus::OutputReportTabular { lnPtr = index(lineIn.substr(12), 'm'); if (lnPtr != std::string::npos) { curNameWithSIUnits = "Elevation (m) " + lineIn.substr(12 + lnPtr + 2); - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, curNameAndUnits, RealToStr(ConvertIP(state, indexUnitConv, StrToReal(lineIn.substr(12, lnPtr))), 1)); @@ -5376,7 +5400,7 @@ namespace EnergyPlus::OutputReportTabular { if (iscalc) { if (isASHRAE) { if (ashDesYear == "2001") { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Heating Design Temperature 99.6% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5391,7 +5415,7 @@ namespace EnergyPlus::OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Heating Design Temperature 99% (C)", GetColumnUsingTabs(lineIn, 3) + degChar); } } else { // 2005 and 2009 are the same - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Heating Design Temperature 99.6% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5414,7 +5438,7 @@ namespace EnergyPlus::OutputReportTabular { col1 = 4; col2 = 5; } - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Heating Design Temperature 99.6% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5433,7 +5457,7 @@ namespace EnergyPlus::OutputReportTabular { if (iscalc) { if (isASHRAE) { if (ashDesYear == "2001") { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Cooling Design Temperature 0.4% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5451,7 +5475,7 @@ namespace EnergyPlus::OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "Cooling Design Temperature 2% (C)", GetColumnUsingTabs(lineIn, 6) + degChar); } } else { // 2005 and 2009 are the same - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Cooling Design Temperature 0.4% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5479,7 +5503,7 @@ namespace EnergyPlus::OutputReportTabular { col2 = 5; col3 = 6; } - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Cooling Design Temperature 0.4% (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5513,7 +5537,7 @@ namespace EnergyPlus::OutputReportTabular { eposlt -= 2; } if (sposlt != std::string::npos && eposlt != std::string::npos) { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Maximum Dry Bulb Temperature (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5545,7 +5569,7 @@ namespace EnergyPlus::OutputReportTabular { eposlt -= 2; } if (sposlt != std::string::npos && eposlt != std::string::npos) { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Minimum Dry Bulb Temperature (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5577,7 +5601,7 @@ namespace EnergyPlus::OutputReportTabular { eposlt -= 2; } if (sposlt != std::string::npos && eposlt != std::string::npos) { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Maximum Dew Point Temperature (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5609,7 +5633,7 @@ namespace EnergyPlus::OutputReportTabular { eposlt -= 2; } if (sposlt != std::string::npos && eposlt != std::string::npos) { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Minimum Dew Point Temperature (C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, @@ -5632,7 +5656,7 @@ namespace EnergyPlus::OutputReportTabular { } } else if (SELECT_CASE_var == StatLineType::wthHDDLine) { // - 1745 (wthr file) annual heating degree-days (10°C baseline) if (storeASHRAEHDD != "") { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "ASHRAE Handbook 2009 Heating Degree-Days - base 65°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, @@ -5641,13 +5665,13 @@ namespace EnergyPlus::OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Heating Degree-Days (base 18.3°C)", storeASHRAEHDD); } } else { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Heating Degree-Days (base 65°F)", "not found"); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Heating Degree-Days (base 18.3°C)", "not found"); } } - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Weather File Heating Degree-Days - base 65°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, @@ -5661,7 +5685,7 @@ namespace EnergyPlus::OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "HDD and CDD data source", "Weather File Stat"); } else if (SELECT_CASE_var == StatLineType::wthCDDLine) { // - 464 (wthr file) annual cooling degree-days (18°C baseline) if (storeASHRAECDD != "") { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "ASHRAE Handbook 2009 Cooling Degree-Days - base 50°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, @@ -5670,13 +5694,13 @@ namespace EnergyPlus::OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Cooling Degree-Days (base 10°C)", storeASHRAECDD); } } else { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Cooling Degree-Days (base 50°F)", "not found"); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchWthrVal, "ASHRAE Handbook 2009 Cooling Degree-Days (base 10°C)", "not found"); } } - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { curNameWithSIUnits = "Weather File Cooling Degree-Days - base 50°(C)"; LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); PreDefTableEntry(state, @@ -5877,6 +5901,8 @@ namespace EnergyPlus::OutputReportTabular { static Real64 totalInfilRem(0.0); static Real64 totalOtherRem(0.0); + auto &ort(state.dataOutRptTab); + StartOfWeek = state.dataEnvrn->RunPeriodStartDayOfWeek; if (StartOfWeek == 0) StartOfWeek = 2; // if the first day of the week has not been set yet, assume monday @@ -5893,13 +5919,13 @@ namespace EnergyPlus::OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtAvgHrSchd, Lights(iLight).Name, ScheduleAverageHoursPerWeek(state, Lights(iLight).SchedPtr, StartOfWeek, state.dataEnvrn->CurrentYearIsLeapYear)); // average operating hours per week - if (state.dataOutRptTab->gatherElapsedTimeBEPS > 0) { - HrsPerWeek = 24 * 7 * Lights(iLight).SumTimeNotZeroCons / state.dataOutRptTab->gatherElapsedTimeBEPS; + if (ort->gatherElapsedTimeBEPS > 0) { + HrsPerWeek = 24 * 7 * Lights(iLight).SumTimeNotZeroCons / ort->gatherElapsedTimeBEPS; PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtAvgHrOper, Lights(iLight).Name, HrsPerWeek); } // full load hours per week - if ((Lights(iLight).DesignLevel * state.dataOutRptTab->gatherElapsedTimeBEPS) > 0) { - HrsPerWeek = 24 * 7 * Lights(iLight).SumConsumption / (Lights(iLight).DesignLevel * state.dataOutRptTab->gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour); + if ((Lights(iLight).DesignLevel * ort->gatherElapsedTimeBEPS) > 0) { + HrsPerWeek = 24 * 7 * Lights(iLight).SumConsumption / (Lights(iLight).DesignLevel * ort->gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour); PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtFullLoadHrs, Lights(iLight).Name, HrsPerWeek); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtConsump, Lights(iLight).Name, Lights(iLight).SumConsumption * mult / 1000000000.0); @@ -5916,14 +5942,14 @@ namespace EnergyPlus::OutputReportTabular { ScheduleAverageHoursPerWeek(state, state.dataExteriorEnergyUse->ExteriorLights(iLight).SchedPtr, StartOfWeek, state.dataEnvrn->CurrentYearIsLeapYear)); } // average operating hours per week - if (state.dataOutRptTab->gatherElapsedTimeBEPS > 0) { - HrsPerWeek = 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumTimeNotZeroCons / state.dataOutRptTab->gatherElapsedTimeBEPS; + if (ort->gatherElapsedTimeBEPS > 0) { + HrsPerWeek = 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumTimeNotZeroCons / ort->gatherElapsedTimeBEPS; PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtAvgHrOper, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, HrsPerWeek); } // full load hours per week - if ((state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * state.dataOutRptTab->gatherElapsedTimeBEPS) > 0) { + if ((state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * ort->gatherElapsedTimeBEPS) > 0) { HrsPerWeek = - 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / (state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * state.dataOutRptTab->gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour); + 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / (state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * ort->gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour); PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtFullLoadHrs, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, HrsPerWeek); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtConsump, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / 1000000000.0); @@ -6201,7 +6227,7 @@ namespace EnergyPlus::OutputReportTabular { // CALL PreDefTableEntry(state, pdchLeedGenData,'Climate Zone','-') // CALL PreDefTableEntry(state, pdchLeedGenData,'Heating Degree Days','-') // CALL PreDefTableEntry(state, pdchLeedGenData,'Cooling Degree Days','-') - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "Total gross floor area [ft2]", "-"); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "Total gross floor area [m2]", "-"); @@ -6307,17 +6333,19 @@ namespace EnergyPlus::OutputReportTabular { veryLarge = 1.0E280; verySmall = -1.0E280; + auto &ort(state.dataOutRptTab); + // set the unit conversion - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::None) { + if (ort->unitsStyle == iUnitsStyle::None) { energyUnitsString = "J"; energyUnitsConversionFactor = 1.0; - } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { + } else if (ort->unitsStyle == iUnitsStyle::JtoKWH) { energyUnitsString = "kWh"; energyUnitsConversionFactor = 1.0 / 3600000.0; - } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoMJ) { + } else if (ort->unitsStyle == iUnitsStyle::JtoMJ) { energyUnitsString = "MJ"; energyUnitsConversionFactor = 1.0 / 1000000.0; - } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoGJ) { + } else if (ort->unitsStyle == iUnitsStyle::JtoGJ) { energyUnitsString = "GJ"; energyUnitsConversionFactor = 1.0 / 1000000000.0; } else { // Should never happen but assures compilers of initialization @@ -6326,19 +6354,19 @@ namespace EnergyPlus::OutputReportTabular { } // loop through each input to get the name of the tables - for (iInput = 1; iInput <= state.dataOutRptTab->MonthlyInputCount; ++iInput) { + for (iInput = 1; iInput <= ort->MonthlyInputCount; ++iInput) { // loop through each report and - digitsShown = state.dataOutRptTab->MonthlyInput(iInput).showDigits; - for (jTable = 1; jTable <= state.dataOutRptTab->MonthlyInput(iInput).numTables; ++jTable) { - curTable = jTable + state.dataOutRptTab->MonthlyInput(iInput).firstTable - 1; + digitsShown = ort->MonthlyInput(iInput).showDigits; + for (jTable = 1; jTable <= ort->MonthlyInput(iInput).numTables; ++jTable) { + curTable = jTable + ort->MonthlyInput(iInput).firstTable - 1; // first loop through and count how many 'columns' are defined // since max and min actually define two columns (the value // and the timestamp). columnUsedCount = 0; - for (kColumn = 1; kColumn <= state.dataOutRptTab->MonthlyTables(curTable).numColumns; ++kColumn) { - curCol = kColumn + state.dataOutRptTab->MonthlyTables(curTable).firstColumn - 1; + for (kColumn = 1; kColumn <= ort->MonthlyTables(curTable).numColumns; ++kColumn) { + curCol = kColumn + ort->MonthlyTables(curTable).firstColumn - 1; { - auto const SELECT_CASE_var(state.dataOutRptTab->MonthlyColumns(curCol).aggType); + auto const SELECT_CASE_var(ort->MonthlyColumns(curCol).aggType); if ((SELECT_CASE_var == iAggType::SumOrAvg) || (SELECT_CASE_var == iAggType::ValueWhenMaxMin) || (SELECT_CASE_var == iAggType::HoursZero) || (SELECT_CASE_var == iAggType::HoursNonZero) || (SELECT_CASE_var == iAggType::HoursPositive) || (SELECT_CASE_var == iAggType::HoursNonPositive) || @@ -6356,56 +6384,56 @@ namespace EnergyPlus::OutputReportTabular { tableBody.allocate(columnUsedCount, 16); tableBody = ""; // set entire table to blank as default columnRecount = 0; - for (kColumn = 1; kColumn <= state.dataOutRptTab->MonthlyTables(curTable).numColumns; ++kColumn) { - curCol = kColumn + state.dataOutRptTab->MonthlyTables(curTable).firstColumn - 1; - curAggString = aggString.at(state.dataOutRptTab->MonthlyColumns(curCol).aggType); + for (kColumn = 1; kColumn <= ort->MonthlyTables(curTable).numColumns; ++kColumn) { + curCol = kColumn + ort->MonthlyTables(curTable).firstColumn - 1; + curAggString = aggString.at(ort->MonthlyColumns(curCol).aggType); if (len(curAggString) > 0) { curAggString = " {" + stripped(curAggString) + '}'; } // do the unit conversions - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { - varNameWithUnits = state.dataOutRptTab->MonthlyColumns(curCol).varName + unitEnumToStringBrackets(state.dataOutRptTab->MonthlyColumns(curCol).units); + if (ort->unitsStyle == iUnitsStyle::InchPound) { + varNameWithUnits = ort->MonthlyColumns(curCol).varName + unitEnumToStringBrackets(ort->MonthlyColumns(curCol).units); LookupSItoIP(state, varNameWithUnits, indexUnitConv, curUnits); GetUnitConversion(state, indexUnitConv, curConversionFactor, curConversionOffset, curUnits); } else { // just do the Joule conversion // if units is in Joules, convert if specified - if (UtilityRoutines::SameString(unitEnumToString(state.dataOutRptTab->MonthlyColumns(curCol).units), "J")) { + if (UtilityRoutines::SameString(unitEnumToString(ort->MonthlyColumns(curCol).units), "J")) { curUnits = energyUnitsString; curConversionFactor = energyUnitsConversionFactor; curConversionOffset = 0.0; } else { // if not joules don't perform conversion - curUnits = unitEnumToString(state.dataOutRptTab->MonthlyColumns(curCol).units); + curUnits = unitEnumToString(ort->MonthlyColumns(curCol).units); curConversionFactor = 1.0; curConversionOffset = 0.0; } } { - auto const SELECT_CASE_var(state.dataOutRptTab->MonthlyColumns(curCol).aggType); + auto const SELECT_CASE_var(ort->MonthlyColumns(curCol).aggType); if ((SELECT_CASE_var == iAggType::SumOrAvg) || (SELECT_CASE_var == iAggType::SumOrAverageHoursShown)) { ++columnRecount; // put in the name of the variable for the column - columnHead(columnRecount) = state.dataOutRptTab->MonthlyColumns(curCol).varName + curAggString + " [" + curUnits + ']'; + columnHead(columnRecount) = ort->MonthlyColumns(curCol).varName + curAggString + " [" + curUnits + ']'; sumVal = 0.0; sumDuration = 0.0; minVal = storedMaxVal; maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { - if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == + if (ort->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Averaged) { // if it is a average variable divide by duration - if (state.dataOutRptTab->MonthlyColumns(curCol).duration(lMonth) != 0) { + if (ort->MonthlyColumns(curCol).duration(lMonth) != 0) { curVal = - ((state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth) / state.dataOutRptTab->MonthlyColumns(curCol).duration(lMonth)) * curConversionFactor) + + ((ort->MonthlyColumns(curCol).reslt(lMonth) / ort->MonthlyColumns(curCol).duration(lMonth)) * curConversionFactor) + curConversionOffset; } else { curVal = 0.0; } - sumVal += (state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + curConversionOffset; - sumDuration += state.dataOutRptTab->MonthlyColumns(curCol).duration(lMonth); + sumVal += (ort->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + curConversionOffset; + sumDuration += ort->MonthlyColumns(curCol).duration(lMonth); } else { - curVal = (state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + curConversionOffset; + curVal = (ort->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor) + curConversionOffset; sumVal += curVal; } - if (state.dataOutRptTab->IsMonthGathered(lMonth)) { + if (ort->IsMonthGathered(lMonth)) { tableBody(columnRecount, lMonth) = RealToStr(curVal, digitsShown); if (curVal > maxVal) maxVal = curVal; if (curVal < minVal) minVal = curVal; @@ -6414,7 +6442,7 @@ namespace EnergyPlus::OutputReportTabular { } } // lMonth // add the summary to bottom - if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == + if (ort->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Averaged) { // if it is a average variable divide by duration if (sumDuration > 0) { tableBody(columnRecount, 14) = RealToStr(sumVal / sumDuration, digitsShown); @@ -6436,13 +6464,13 @@ namespace EnergyPlus::OutputReportTabular { ++columnRecount; // put in the name of the variable for the column - columnHead(columnRecount) = state.dataOutRptTab->MonthlyColumns(curCol).varName + curAggString + " [HOURS]"; + columnHead(columnRecount) = ort->MonthlyColumns(curCol).varName + curAggString + " [HOURS]"; sumVal = 0.0; minVal = storedMaxVal; maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { - curVal = state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth); - if (state.dataOutRptTab->IsMonthGathered(lMonth)) { + curVal = ort->MonthlyColumns(curCol).reslt(lMonth); + if (ort->IsMonthGathered(lMonth)) { tableBody(columnRecount, lMonth) = RealToStr(curVal, digitsShown); sumVal += curVal; if (curVal > maxVal) maxVal = curVal; @@ -6461,7 +6489,7 @@ namespace EnergyPlus::OutputReportTabular { } } else if (SELECT_CASE_var == iAggType::ValueWhenMaxMin) { ++columnRecount; - if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { + if (ort->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { curUnits += "/s"; } if (UtilityRoutines::SameString(curUnits, "J/s")) { @@ -6492,12 +6520,12 @@ namespace EnergyPlus::OutputReportTabular { curUnits = "ton"; curConversionFactor *= 3600.0; } - columnHead(columnRecount) = state.dataOutRptTab->MonthlyColumns(curCol).varName + curAggString + " [" + curUnits + ']'; + columnHead(columnRecount) = ort->MonthlyColumns(curCol).varName + curAggString + " [" + curUnits + ']'; minVal = storedMaxVal; maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { - curVal = state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor + curConversionOffset; - if (state.dataOutRptTab->IsMonthGathered(lMonth)) { + curVal = ort->MonthlyColumns(curCol).reslt(lMonth) * curConversionFactor + curConversionOffset; + if (ort->IsMonthGathered(lMonth)) { tableBody(columnRecount, lMonth) = RealToStr(curVal, digitsShown); if (curVal > maxVal) maxVal = curVal; if (curVal < minVal) minVal = curVal; @@ -6516,7 +6544,7 @@ namespace EnergyPlus::OutputReportTabular { (SELECT_CASE_var == iAggType::MaximumDuringHoursShown) || (SELECT_CASE_var == iAggType::MinimumDuringHoursShown)) { columnRecount += 2; // put in the name of the variable for the column - if (state.dataOutRptTab->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable + if (ort->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable curUnits += "/s"; } if (UtilityRoutines::SameString(curUnits, "J/s")) { @@ -6547,13 +6575,13 @@ namespace EnergyPlus::OutputReportTabular { curUnits = "ton"; curConversionFactor *= 3600.0; } - columnHead(columnRecount - 1) = state.dataOutRptTab->MonthlyColumns(curCol).varName + curAggString + '[' + curUnits + ']'; - columnHead(columnRecount) = state.dataOutRptTab->MonthlyColumns(curCol).varName + " {TIMESTAMP} "; + columnHead(columnRecount - 1) = ort->MonthlyColumns(curCol).varName + curAggString + '[' + curUnits + ']'; + columnHead(columnRecount) = ort->MonthlyColumns(curCol).varName + " {TIMESTAMP} "; minVal = storedMaxVal; maxVal = storedMinVal; for (lMonth = 1; lMonth <= 12; ++lMonth) { - if (state.dataOutRptTab->IsMonthGathered(lMonth)) { - curVal = state.dataOutRptTab->MonthlyColumns(curCol).reslt(lMonth); + if (ort->IsMonthGathered(lMonth)) { + curVal = ort->MonthlyColumns(curCol).reslt(lMonth); // CR7788 the conversion factors were causing an overflow for the InchPound case since the // value was very small // restructured the following lines to hide showing HUGE and -HUGE values in output table CR8154 Glazer @@ -6566,7 +6594,7 @@ namespace EnergyPlus::OutputReportTabular { } else { tableBody(columnRecount - 1, lMonth) = "-"; } - tableBody(columnRecount, lMonth) = DateToString(state.dataOutRptTab->MonthlyColumns(curCol).timeStamp(lMonth)); + tableBody(columnRecount, lMonth) = DateToString(ort->MonthlyColumns(curCol).timeStamp(lMonth)); } else { tableBody(columnRecount - 1, lMonth) = "-"; tableBody(columnRecount, lMonth) = "-"; @@ -6591,16 +6619,16 @@ namespace EnergyPlus::OutputReportTabular { } } } // KColumn - WriteReportHeaders(state, state.dataOutRptTab->MonthlyInput(iInput).name, state.dataOutRptTab->MonthlyTables(curTable).keyValue, OutputProcessor::StoreType::Averaged); + WriteReportHeaders(state, ort->MonthlyInput(iInput).name, ort->MonthlyTables(curTable).keyValue, OutputProcessor::StoreType::Averaged); WriteSubtitle(state, "Custom Monthly Report"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth, true); // transpose monthly XML tables. if (sqlite) { sqlite->createSQLiteTabularDataRecords( - tableBody, rowHead, columnHead, state.dataOutRptTab->MonthlyInput(iInput).name, state.dataOutRptTab->MonthlyTables(curTable).keyValue, "Custom Monthly Report"); + tableBody, rowHead, columnHead, ort->MonthlyInput(iInput).name, ort->MonthlyTables(curTable).keyValue, "Custom Monthly Report"); } if (ResultsFramework::resultsFramework->timeSeriesAndTabularEnabled()) { ResultsFramework::resultsFramework->TabularReportsCollection.addReportTable( - tableBody, rowHead, columnHead, state.dataOutRptTab->MonthlyInput(iInput).name, state.dataOutRptTab->MonthlyTables(curTable).keyValue, "Custom Monthly Report"); + tableBody, rowHead, columnHead, ort->MonthlyInput(iInput).name, ort->MonthlyTables(curTable).keyValue, "Custom Monthly Report"); } } // jTables } // iInput @@ -6661,6 +6689,8 @@ namespace EnergyPlus::OutputReportTabular { std::string curNameAndUnits; int indexUnitConv; + auto &ort(state.dataOutRptTab); + rowHead(1) = "Interval Start"; rowHead(2) = "Interval End"; rowHead(3) = "January"; @@ -6700,21 +6730,21 @@ namespace EnergyPlus::OutputReportTabular { rowHead(37) = "10:01 to 11:00 pm"; rowHead(38) = "11:01 to 12:00 am"; rowHead(39) = "Total"; - for (iInObj = 1; iInObj <= state.dataOutRptTab->OutputTableBinnedCount; ++iInObj) { - firstReport = state.dataOutRptTab->OutputTableBinned(iInObj).resIndex; - curNameWithSIUnits = state.dataOutRptTab->OutputTableBinned(iInObj).varOrMeter + unitEnumToStringBrackets(state.dataOutRptTab->OutputTableBinned(iInObj).units); - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + for (iInObj = 1; iInObj <= ort->OutputTableBinnedCount; ++iInObj) { + firstReport = ort->OutputTableBinned(iInObj).resIndex; + curNameWithSIUnits = ort->OutputTableBinned(iInObj).varOrMeter + unitEnumToStringBrackets(ort->OutputTableBinned(iInObj).units); + if (ort->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); - curIntervalStart = ConvertIP(state, indexUnitConv, state.dataOutRptTab->OutputTableBinned(iInObj).intervalStart); - curIntervalSize = ConvertIPdelta(state, indexUnitConv, state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize); + curIntervalStart = ConvertIP(state, indexUnitConv, ort->OutputTableBinned(iInObj).intervalStart); + curIntervalSize = ConvertIPdelta(state, indexUnitConv, ort->OutputTableBinned(iInObj).intervalSize); } else { curNameAndUnits = curNameWithSIUnits; - curIntervalStart = state.dataOutRptTab->OutputTableBinned(iInObj).intervalStart; - curIntervalSize = state.dataOutRptTab->OutputTableBinned(iInObj).intervalSize; + curIntervalStart = ort->OutputTableBinned(iInObj).intervalStart; + curIntervalSize = ort->OutputTableBinned(iInObj).intervalSize; } - curIntervalCount = state.dataOutRptTab->OutputTableBinned(iInObj).intervalCount; - curResIndex = state.dataOutRptTab->OutputTableBinned(iInObj).resIndex; - curNumTables = state.dataOutRptTab->OutputTableBinned(iInObj).numTables; + curIntervalCount = ort->OutputTableBinned(iInObj).intervalCount; + curResIndex = ort->OutputTableBinned(iInObj).resIndex; + curNumTables = ort->OutputTableBinned(iInObj).numTables; topValue = curIntervalStart + curIntervalSize * curIntervalCount; if (curIntervalSize < 1) { numIntervalDigits = 4; @@ -6745,32 +6775,32 @@ namespace EnergyPlus::OutputReportTabular { tableBody(curIntervalCount + 3, 2) = "Total"; for (iTable = 1; iTable <= curNumTables; ++iTable) { repIndex = firstReport + (iTable - 1); - if (state.dataOutRptTab->OutputTableBinned(iInObj).scheduleIndex == 0) { + if (ort->OutputTableBinned(iInObj).scheduleIndex == 0) { repNameWithUnitsandscheduleName = curNameAndUnits; } else { - repNameWithUnitsandscheduleName = curNameAndUnits + " [" + state.dataOutRptTab->OutputTableBinned(iInObj).ScheduleName + ']'; + repNameWithUnitsandscheduleName = curNameAndUnits + " [" + ort->OutputTableBinned(iInObj).ScheduleName + ']'; } - WriteReportHeaders(state, repNameWithUnitsandscheduleName, state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj, state.dataOutRptTab->OutputTableBinned(iInObj).avgSum); + WriteReportHeaders(state, repNameWithUnitsandscheduleName, ort->BinObjVarID(repIndex).namesOfObj, ort->OutputTableBinned(iInObj).avgSum); for (kHour = 1; kHour <= 24; ++kHour) { - tableBody(1, 14 + kHour) = RealToStr(state.dataOutRptTab->BinResultsBelow(repIndex).hrly(kHour), 2); - tableBody(curIntervalCount + 2, 14 + kHour) = RealToStr(state.dataOutRptTab->BinResultsAbove(repIndex).hrly(kHour), 2); - rowTotal = state.dataOutRptTab->BinResultsBelow(repIndex).hrly(kHour) + state.dataOutRptTab->BinResultsAbove(repIndex).hrly(kHour); + tableBody(1, 14 + kHour) = RealToStr(ort->BinResultsBelow(repIndex).hrly(kHour), 2); + tableBody(curIntervalCount + 2, 14 + kHour) = RealToStr(ort->BinResultsAbove(repIndex).hrly(kHour), 2); + rowTotal = ort->BinResultsBelow(repIndex).hrly(kHour) + ort->BinResultsAbove(repIndex).hrly(kHour); for (nCol = 1; nCol <= curIntervalCount; ++nCol) { - tableBody(nCol + 1, 14 + kHour) = RealToStr(state.dataOutRptTab->BinResults(nCol, repIndex).hrly(kHour), 2); + tableBody(nCol + 1, 14 + kHour) = RealToStr(ort->BinResults(nCol, repIndex).hrly(kHour), 2); // sum the total for all columns - rowTotal += state.dataOutRptTab->BinResults(nCol, repIndex).hrly(kHour); + rowTotal += ort->BinResults(nCol, repIndex).hrly(kHour); } tableBody(nCol + 2, 14 + kHour) = RealToStr(rowTotal, 2); } tableTotal = 0.0; for (kMonth = 1; kMonth <= 12; ++kMonth) { - tableBody(1, 2 + kMonth) = RealToStr(state.dataOutRptTab->BinResultsBelow(repIndex).mnth(kMonth), 2); - tableBody(curIntervalCount + 2, 2 + kMonth) = RealToStr(state.dataOutRptTab->BinResultsAbove(repIndex).mnth(kMonth), 2); - rowTotal = state.dataOutRptTab->BinResultsBelow(repIndex).mnth(kMonth) + state.dataOutRptTab->BinResultsAbove(repIndex).mnth(kMonth); + tableBody(1, 2 + kMonth) = RealToStr(ort->BinResultsBelow(repIndex).mnth(kMonth), 2); + tableBody(curIntervalCount + 2, 2 + kMonth) = RealToStr(ort->BinResultsAbove(repIndex).mnth(kMonth), 2); + rowTotal = ort->BinResultsBelow(repIndex).mnth(kMonth) + ort->BinResultsAbove(repIndex).mnth(kMonth); for (nCol = 1; nCol <= curIntervalCount; ++nCol) { - tableBody(nCol + 1, 2 + kMonth) = RealToStr(state.dataOutRptTab->BinResults(nCol, repIndex).mnth(kMonth), 2); + tableBody(nCol + 1, 2 + kMonth) = RealToStr(ort->BinResults(nCol, repIndex).mnth(kMonth), 2); // sum the total for all columns - rowTotal += state.dataOutRptTab->BinResults(nCol, repIndex).mnth(kMonth); + rowTotal += ort->BinResults(nCol, repIndex).mnth(kMonth); } tableBody(nCol + 2, 2 + kMonth) = RealToStr(rowTotal, 2); tableTotal += rowTotal; @@ -6779,15 +6809,15 @@ namespace EnergyPlus::OutputReportTabular { for (nCol = 1; nCol <= curIntervalCount; ++nCol) { colTotal = 0.0; for (kMonth = 1; kMonth <= 12; ++kMonth) { - colTotal += state.dataOutRptTab->BinResults(nCol, repIndex).mnth(kMonth); + colTotal += ort->BinResults(nCol, repIndex).mnth(kMonth); } tableBody(nCol + 1, 39) = RealToStr(colTotal, 2); } aboveTotal = 0.0; belowTotal = 0.0; for (kMonth = 1; kMonth <= 12; ++kMonth) { - aboveTotal += state.dataOutRptTab->BinResultsAbove(repIndex).mnth(kMonth); - belowTotal += state.dataOutRptTab->BinResultsBelow(repIndex).mnth(kMonth); + aboveTotal += ort->BinResultsAbove(repIndex).mnth(kMonth); + belowTotal += ort->BinResultsBelow(repIndex).mnth(kMonth); } tableBody(1, 39) = RealToStr(belowTotal, 2); tableBody(curIntervalCount + 2, 39) = RealToStr(aboveTotal, 2); @@ -6798,11 +6828,11 @@ namespace EnergyPlus::OutputReportTabular { WriteTable(state, tableBody, rowHead, columnHead, columnWidth, true); // transpose XML tables if (sqlite) { sqlite->createSQLiteTabularDataRecords( - tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj, "Time Bin Results"); + tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, ort->BinObjVarID(repIndex).namesOfObj, "Time Bin Results"); } if (ResultsFramework::resultsFramework->timeSeriesAndTabularEnabled()) { ResultsFramework::resultsFramework->TabularReportsCollection.addReportTable( - tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj, "Time Bin Results"); + tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, ort->BinObjVarID(repIndex).namesOfObj, "Time Bin Results"); } // create statistics table rowHeadStat(1) = "Minimum"; @@ -6815,42 +6845,42 @@ namespace EnergyPlus::OutputReportTabular { columnWidthStat(1) = 14; // per Applied Regression Analysis and Other Multivariate Methods, Kleinburger/Kupper, 1978 // first check if very large constant number has caused the second part to be larger than the first - if (state.dataOutRptTab->BinStatistics(repIndex).n > 1) { - if (state.dataOutRptTab->BinStatistics(repIndex).sum2 > (pow_2(state.dataOutRptTab->BinStatistics(repIndex).sum) / state.dataOutRptTab->BinStatistics(repIndex).n)) { - repStDev = std::sqrt((state.dataOutRptTab->BinStatistics(repIndex).sum2 - (pow_2(state.dataOutRptTab->BinStatistics(repIndex).sum) / state.dataOutRptTab->BinStatistics(repIndex).n)) / - (state.dataOutRptTab->BinStatistics(repIndex).n - 1)); + if (ort->BinStatistics(repIndex).n > 1) { + if (ort->BinStatistics(repIndex).sum2 > (pow_2(ort->BinStatistics(repIndex).sum) / ort->BinStatistics(repIndex).n)) { + repStDev = std::sqrt((ort->BinStatistics(repIndex).sum2 - (pow_2(ort->BinStatistics(repIndex).sum) / ort->BinStatistics(repIndex).n)) / + (ort->BinStatistics(repIndex).n - 1)); } else { repStDev = 0.0; } - repMean = state.dataOutRptTab->BinStatistics(repIndex).sum / state.dataOutRptTab->BinStatistics(repIndex).n; + repMean = ort->BinStatistics(repIndex).sum / ort->BinStatistics(repIndex).n; } else { repStDev = 0.0; repMean = 0.0; } - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { - tableBodyStat(1, 1) = RealToStr(ConvertIP(state, indexUnitConv, state.dataOutRptTab->BinStatistics(repIndex).minimum), 2); + if (ort->unitsStyle == iUnitsStyle::InchPound) { + tableBodyStat(1, 1) = RealToStr(ConvertIP(state, indexUnitConv, ort->BinStatistics(repIndex).minimum), 2); tableBodyStat(1, 2) = RealToStr(ConvertIP(state, indexUnitConv, repMean - 2 * repStDev), 2); tableBodyStat(1, 3) = RealToStr(ConvertIP(state, indexUnitConv, repMean), 2); tableBodyStat(1, 4) = RealToStr(ConvertIP(state, indexUnitConv, repMean + 2 * repStDev), 2); - tableBodyStat(1, 5) = RealToStr(ConvertIP(state, indexUnitConv, state.dataOutRptTab->BinStatistics(repIndex).maximum), 2); + tableBodyStat(1, 5) = RealToStr(ConvertIP(state, indexUnitConv, ort->BinStatistics(repIndex).maximum), 2); tableBodyStat(1, 6) = RealToStr(ConvertIPdelta(state, indexUnitConv, repStDev), 2); } else { - tableBodyStat(1, 1) = RealToStr(state.dataOutRptTab->BinStatistics(repIndex).minimum, 2); + tableBodyStat(1, 1) = RealToStr(ort->BinStatistics(repIndex).minimum, 2); tableBodyStat(1, 2) = RealToStr(repMean - 2 * repStDev, 2); tableBodyStat(1, 3) = RealToStr(repMean, 2); tableBodyStat(1, 4) = RealToStr(repMean + 2 * repStDev, 2); - tableBodyStat(1, 5) = RealToStr(state.dataOutRptTab->BinStatistics(repIndex).maximum, 2); + tableBodyStat(1, 5) = RealToStr(ort->BinStatistics(repIndex).maximum, 2); tableBodyStat(1, 6) = RealToStr(repStDev, 2); } WriteSubtitle(state, "Statistics"); WriteTable(state, tableBodyStat, rowHeadStat, columnHeadStat, columnWidthStat, true); // transpose XML table if (sqlite) { sqlite->createSQLiteTabularDataRecords( - tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj, "Statistics"); + tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, ort->BinObjVarID(repIndex).namesOfObj, "Statistics"); } if (ResultsFramework::resultsFramework->timeSeriesAndTabularEnabled()) { ResultsFramework::resultsFramework->TabularReportsCollection.addReportTable( - tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, state.dataOutRptTab->BinObjVarID(repIndex).namesOfObj, "Statistics"); + tableBody, rowHead, columnHead, repNameWithUnitsandscheduleName, ort->BinObjVarID(repIndex).namesOfObj, "Statistics"); } } } @@ -6897,6 +6927,7 @@ namespace EnergyPlus::OutputReportTabular { int const colPurchHeat(12); Real64 const SmallValue(1.e-14); + auto &ort(state.dataOutRptTab); // INTERFACE BLOCK SPECIFICATIONS: // na @@ -6965,13 +6996,13 @@ namespace EnergyPlus::OutputReportTabular { static Real64 leedSiteTotal(0.0); Real64 unconvert; - if (state.dataOutRptTab->displayTabularBEPS || state.dataOutRptTab->displayLEEDSummary) { + if (ort->displayTabularBEPS || ort->displayLEEDSummary) { // show the headers of the report - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteReportHeaders(state, "Annual Building Utility Performance Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // show the number of hours that the table applies to - WriteTextLine(state, "Values gathered over " + RealToStr(state.dataOutRptTab->gatherElapsedTimeBEPS, 2) + " hours", true); - if (state.dataOutRptTab->gatherElapsedTimeBEPS < 8759.0) { // might not add up to 8760 exactly but can't be more than 1 hour diff. + WriteTextLine(state, "Values gathered over " + RealToStr(ort->gatherElapsedTimeBEPS, 2) + " hours", true); + if (ort->gatherElapsedTimeBEPS < 8759.0) { // might not add up to 8760 exactly but can't be more than 1 hour diff. WriteTextLine(state, "WARNING: THE REPORT DOES NOT REPRESENT A FULL ANNUAL SIMULATION.", true); } WriteTextLine(state, "", true); @@ -6980,35 +7011,35 @@ namespace EnergyPlus::OutputReportTabular { DetermineBuildingFloorArea(state); // collapse the gatherEndUseBEPS array to the resource groups displayed for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - collapsedEndUse(1, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(1, jEndUse); // electricity - collapsedEndUse(2, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(2, jEndUse); // natural gas - collapsedEndUse(3, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(6, jEndUse); // gasoline - collapsedEndUse(4, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(8, jEndUse); // diesel - collapsedEndUse(5, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(9, jEndUse); // coal - collapsedEndUse(6, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(10, jEndUse); // Fuel Oil No1 - collapsedEndUse(7, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(11, jEndUse); // Fuel Oil No2 - collapsedEndUse(8, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(12, jEndUse); // propane - collapsedEndUse(9, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(13, jEndUse); // otherfuel1 - collapsedEndUse(10, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(14, jEndUse); // otherfuel2 - collapsedEndUse(11, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(3, jEndUse); // district cooling <- purchased cooling + collapsedEndUse(1, jEndUse) = ort->gatherEndUseBEPS(1, jEndUse); // electricity + collapsedEndUse(2, jEndUse) = ort->gatherEndUseBEPS(2, jEndUse); // natural gas + collapsedEndUse(3, jEndUse) = ort->gatherEndUseBEPS(6, jEndUse); // gasoline + collapsedEndUse(4, jEndUse) = ort->gatherEndUseBEPS(8, jEndUse); // diesel + collapsedEndUse(5, jEndUse) = ort->gatherEndUseBEPS(9, jEndUse); // coal + collapsedEndUse(6, jEndUse) = ort->gatherEndUseBEPS(10, jEndUse); // Fuel Oil No1 + collapsedEndUse(7, jEndUse) = ort->gatherEndUseBEPS(11, jEndUse); // Fuel Oil No2 + collapsedEndUse(8, jEndUse) = ort->gatherEndUseBEPS(12, jEndUse); // propane + collapsedEndUse(9, jEndUse) = ort->gatherEndUseBEPS(13, jEndUse); // otherfuel1 + collapsedEndUse(10, jEndUse) = ort->gatherEndUseBEPS(14, jEndUse); // otherfuel2 + collapsedEndUse(11, jEndUse) = ort->gatherEndUseBEPS(3, jEndUse); // district cooling <- purchased cooling collapsedEndUse(12, jEndUse) = - state.dataOutRptTab->gatherEndUseBEPS(4, jEndUse) + state.dataOutRptTab->gatherEndUseBEPS(5, jEndUse); // district heating <- purchased heating | <- steam - collapsedEndUse(13, jEndUse) = state.dataOutRptTab->gatherEndUseBEPS(7, jEndUse); // water + ort->gatherEndUseBEPS(4, jEndUse) + ort->gatherEndUseBEPS(5, jEndUse); // district heating <- purchased heating | <- steam + collapsedEndUse(13, jEndUse) = ort->gatherEndUseBEPS(7, jEndUse); // water } // repeat with totals - collapsedTotal(1) = state.dataOutRptTab->gatherTotalsBEPS(1); // electricity - collapsedTotal(2) = state.dataOutRptTab->gatherTotalsBEPS(2); // natural gas - collapsedTotal(3) = state.dataOutRptTab->gatherTotalsBEPS(6); // gasoline - collapsedTotal(4) = state.dataOutRptTab->gatherTotalsBEPS(8); // diesel - collapsedTotal(5) = state.dataOutRptTab->gatherTotalsBEPS(9); // coal - collapsedTotal(6) = state.dataOutRptTab->gatherTotalsBEPS(10); // Fuel Oil No1 - collapsedTotal(7) = state.dataOutRptTab->gatherTotalsBEPS(11); // Fuel Oil No2 - collapsedTotal(8) = state.dataOutRptTab->gatherTotalsBEPS(12); // propane - collapsedTotal(9) = state.dataOutRptTab->gatherTotalsBEPS(13); // other fuel 1 - collapsedTotal(10) = state.dataOutRptTab->gatherTotalsBEPS(14); // other fuel 2 - collapsedTotal(11) = state.dataOutRptTab->gatherTotalsBEPS(3); // district cooling <- purchased cooling - collapsedTotal(12) = state.dataOutRptTab->gatherTotalsBEPS(4) + state.dataOutRptTab->gatherTotalsBEPS(5); // district heating <- purchased heating | <- steam - collapsedTotal(13) = state.dataOutRptTab->gatherTotalsBEPS(7); // water + collapsedTotal(1) = ort->gatherTotalsBEPS(1); // electricity + collapsedTotal(2) = ort->gatherTotalsBEPS(2); // natural gas + collapsedTotal(3) = ort->gatherTotalsBEPS(6); // gasoline + collapsedTotal(4) = ort->gatherTotalsBEPS(8); // diesel + collapsedTotal(5) = ort->gatherTotalsBEPS(9); // coal + collapsedTotal(6) = ort->gatherTotalsBEPS(10); // Fuel Oil No1 + collapsedTotal(7) = ort->gatherTotalsBEPS(11); // Fuel Oil No2 + collapsedTotal(8) = ort->gatherTotalsBEPS(12); // propane + collapsedTotal(9) = ort->gatherTotalsBEPS(13); // other fuel 1 + collapsedTotal(10) = ort->gatherTotalsBEPS(14); // other fuel 2 + collapsedTotal(11) = ort->gatherTotalsBEPS(3); // district cooling <- purchased cooling + collapsedTotal(12) = ort->gatherTotalsBEPS(4) + ort->gatherTotalsBEPS(5); // district heating <- purchased heating | <- steam + collapsedTotal(13) = ort->gatherTotalsBEPS(7); // water if (state.dataGlobal->createPerfLog) { UtilityRoutines::appendPerfLog(state, "Electricity ABUPS Total [J]", format("{:.3R}", collapsedTotal(1))); @@ -7024,7 +7055,7 @@ namespace EnergyPlus::OutputReportTabular { UtilityRoutines::appendPerfLog(state, "District Cooling ABUPS Total [J]", format("{:.3R}", collapsedTotal(11))); UtilityRoutines::appendPerfLog(state, "District Heating ABUPS Total [J]", format("{:.3R}", collapsedTotal(12))); UtilityRoutines::appendPerfLog(state, "Water ABUPS Total [m3]", format("{:.3R}", collapsedTotal(13))); - UtilityRoutines::appendPerfLog(state, "Values Gathered Over [hours]", format("{:.2R}", state.dataOutRptTab->gatherElapsedTimeBEPS)); + UtilityRoutines::appendPerfLog(state, "Values Gathered Over [hours]", format("{:.2R}", ort->gatherElapsedTimeBEPS)); UtilityRoutines::appendPerfLog(state, "Facility Any Zone Oscillating Temperatures Time [hours]", format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillate)); @@ -7037,27 +7068,27 @@ namespace EnergyPlus::OutputReportTabular { } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - collapsedEndUseSub(kEndUseSub, jEndUse, 1) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 1); // electricity - collapsedEndUseSub(kEndUseSub, jEndUse, 2) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 2); // natural gas - collapsedEndUseSub(kEndUseSub, jEndUse, 3) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 6); // gasoline - collapsedEndUseSub(kEndUseSub, jEndUse, 4) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 8); // diesel - collapsedEndUseSub(kEndUseSub, jEndUse, 5) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 9); // coal - collapsedEndUseSub(kEndUseSub, jEndUse, 6) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 10); // Fuel Oil No1 - collapsedEndUseSub(kEndUseSub, jEndUse, 7) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 11); // Fuel Oil No2 - collapsedEndUseSub(kEndUseSub, jEndUse, 8) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 12); // propane - collapsedEndUseSub(kEndUseSub, jEndUse, 9) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 13); // otherfuel1 - collapsedEndUseSub(kEndUseSub, jEndUse, 10) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 14); // otherfuel2 - collapsedEndUseSub(kEndUseSub, jEndUse, 11) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 3); // district cooling <- purch cooling + collapsedEndUseSub(kEndUseSub, jEndUse, 1) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 1); // electricity + collapsedEndUseSub(kEndUseSub, jEndUse, 2) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 2); // natural gas + collapsedEndUseSub(kEndUseSub, jEndUse, 3) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 6); // gasoline + collapsedEndUseSub(kEndUseSub, jEndUse, 4) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 8); // diesel + collapsedEndUseSub(kEndUseSub, jEndUse, 5) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 9); // coal + collapsedEndUseSub(kEndUseSub, jEndUse, 6) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 10); // Fuel Oil No1 + collapsedEndUseSub(kEndUseSub, jEndUse, 7) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 11); // Fuel Oil No2 + collapsedEndUseSub(kEndUseSub, jEndUse, 8) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 12); // propane + collapsedEndUseSub(kEndUseSub, jEndUse, 9) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 13); // otherfuel1 + collapsedEndUseSub(kEndUseSub, jEndUse, 10) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 14); // otherfuel2 + collapsedEndUseSub(kEndUseSub, jEndUse, 11) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 3); // district cooling <- purch cooling collapsedEndUseSub(kEndUseSub, jEndUse, 12) = - state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 4) + - state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 5); // district heating <- purch heating | <- steam - collapsedEndUseSub(kEndUseSub, jEndUse, 13) = state.dataOutRptTab->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 7); // water + ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 4) + + ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 5); // district heating <- purch heating | <- steam + collapsedEndUseSub(kEndUseSub, jEndUse, 13) = ort->gatherEndUseSubBEPS(kEndUseSub, jEndUse, 7); // water } } // unit conversion - all values are used as divisors { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { largeConversionFactor = 3600000.0; kConversionFactor = 1.0; @@ -7077,8 +7108,8 @@ namespace EnergyPlus::OutputReportTabular { } // convert floor areas - convBldgGrossFloorArea = state.dataOutRptTab->buildingGrossFloorArea / areaConversionFactor; - convBldgCondFloorArea = state.dataOutRptTab->buildingConditionedFloorArea / areaConversionFactor; + convBldgGrossFloorArea = ort->buildingGrossFloorArea / areaConversionFactor; + convBldgCondFloorArea = ort->buildingConditionedFloorArea / areaConversionFactor; // convert units into GJ (divide by 1,000,000,000) if J otherwise kWh for (iResource = 1; iResource <= 12; ++iResource) { // don't do water @@ -7101,24 +7132,24 @@ namespace EnergyPlus::OutputReportTabular { collapsedTotal(13) = WaterConversionFunct(collapsedTotal(13), waterConversionFactor); // convert to GJ - state.dataOutRptTab->gatherPowerFuelFireGen /= largeConversionFactor; - state.dataOutRptTab->gatherPowerPV /= largeConversionFactor; - state.dataOutRptTab->gatherPowerWind /= largeConversionFactor; - state.dataOutRptTab->gatherPowerHTGeothermal /= largeConversionFactor; - state.dataOutRptTab->gatherPowerConversion /= largeConversionFactor; - state.dataOutRptTab->gatherElecProduced /= largeConversionFactor; - state.dataOutRptTab->gatherElecPurchased /= largeConversionFactor; - state.dataOutRptTab->gatherElecSurplusSold /= largeConversionFactor; + ort->gatherPowerFuelFireGen /= largeConversionFactor; + ort->gatherPowerPV /= largeConversionFactor; + ort->gatherPowerWind /= largeConversionFactor; + ort->gatherPowerHTGeothermal /= largeConversionFactor; + ort->gatherPowerConversion /= largeConversionFactor; + ort->gatherElecProduced /= largeConversionFactor; + ort->gatherElecPurchased /= largeConversionFactor; + ort->gatherElecSurplusSold /= largeConversionFactor; // get change in overall state of charge for electrical storage devices. if (facilityElectricServiceObj->numElecStorageDevices > 0) { // All flow in/out of storage is accounted for in gatherElecStorage, so separate calculation of change in state of charge is not // necessary OverallNetEnergyFromStorage = ( sum( ElecStorage.StartingEnergyStored() ) - sum( ElecStorage.ThisTimeStepStateOfCharge() // ) ) + gatherElecStorage; - state.dataOutRptTab->OverallNetEnergyFromStorage = state.dataOutRptTab->gatherElecStorage; - state.dataOutRptTab->OverallNetEnergyFromStorage /= largeConversionFactor; + ort->OverallNetEnergyFromStorage = ort->gatherElecStorage; + ort->OverallNetEnergyFromStorage /= largeConversionFactor; } else { - state.dataOutRptTab->OverallNetEnergyFromStorage = 0.0; + ort->OverallNetEnergyFromStorage = 0.0; } // determine which resource is the primary heating resourse resourcePrimaryHeating = 0; @@ -7138,7 +7169,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody.allocate(3, 4); { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Total Energy [kWh]"; columnHead(2) = "Energy Per Total Building Area [kWh/m2]"; @@ -7166,160 +7197,160 @@ namespace EnergyPlus::OutputReportTabular { // previously these variables were converted into GJ so now we don't need // to do any conversion // water is not included gatherTotalsBEPS(7) !water - totalSiteEnergyUse = (state.dataOutRptTab->gatherTotalsBEPS(1) + state.dataOutRptTab->gatherTotalsBEPS(2) + state.dataOutRptTab->gatherTotalsBEPS(3) + state.dataOutRptTab->gatherTotalsBEPS(4) + state.dataOutRptTab->gatherTotalsBEPS(5) + - state.dataOutRptTab->gatherTotalsBEPS(6) + state.dataOutRptTab->gatherTotalsBEPS(8) + state.dataOutRptTab->gatherTotalsBEPS(9) + state.dataOutRptTab->gatherTotalsBEPS(10) + state.dataOutRptTab->gatherTotalsBEPS(11) + - state.dataOutRptTab->gatherTotalsBEPS(12) + state.dataOutRptTab->gatherTotalsBEPS(13) + state.dataOutRptTab->gatherTotalsBEPS(14)) / + totalSiteEnergyUse = (ort->gatherTotalsBEPS(1) + ort->gatherTotalsBEPS(2) + ort->gatherTotalsBEPS(3) + ort->gatherTotalsBEPS(4) + ort->gatherTotalsBEPS(5) + + ort->gatherTotalsBEPS(6) + ort->gatherTotalsBEPS(8) + ort->gatherTotalsBEPS(9) + ort->gatherTotalsBEPS(10) + ort->gatherTotalsBEPS(11) + + ort->gatherTotalsBEPS(12) + ort->gatherTotalsBEPS(13) + ort->gatherTotalsBEPS(14)) / largeConversionFactor; // electricity | natural gas | district cooling | district heating | steam | gasoline | diesel // | coal | Fuel Oil No1 | Fuel Oil No2 | propane | otherfuel1 | otherfuel2 - netElecPurchasedSold = state.dataOutRptTab->gatherElecPurchased - state.dataOutRptTab->gatherElecSurplusSold; + netElecPurchasedSold = ort->gatherElecPurchased - ort->gatherElecSurplusSold; // water is not included gatherTotalsBEPS(7) !water - netSiteEnergyUse = netElecPurchasedSold + (state.dataOutRptTab->gatherTotalsBEPS(2) + state.dataOutRptTab->gatherTotalsBEPS(3) + state.dataOutRptTab->gatherTotalsBEPS(4) + state.dataOutRptTab->gatherTotalsBEPS(5) + - state.dataOutRptTab->gatherTotalsBEPS(6) + state.dataOutRptTab->gatherTotalsBEPS(8) + state.dataOutRptTab->gatherTotalsBEPS(9) + state.dataOutRptTab->gatherTotalsBEPS(10) + - state.dataOutRptTab->gatherTotalsBEPS(11) + state.dataOutRptTab->gatherTotalsBEPS(12) + state.dataOutRptTab->gatherTotalsBEPS(13) + state.dataOutRptTab->gatherTotalsBEPS(14)) / + netSiteEnergyUse = netElecPurchasedSold + (ort->gatherTotalsBEPS(2) + ort->gatherTotalsBEPS(3) + ort->gatherTotalsBEPS(4) + ort->gatherTotalsBEPS(5) + + ort->gatherTotalsBEPS(6) + ort->gatherTotalsBEPS(8) + ort->gatherTotalsBEPS(9) + ort->gatherTotalsBEPS(10) + + ort->gatherTotalsBEPS(11) + ort->gatherTotalsBEPS(12) + ort->gatherTotalsBEPS(13) + ort->gatherTotalsBEPS(14)) / largeConversionFactor; // electricity (already in GJ) | natural gas | district cooling | // district heating | steam | gasoline | diesel | coal | Fuel Oil No1 // | Fuel Oil No2 | propane | otherfuel1 | otherfuel2 - if (state.dataOutRptTab->efficiencyDistrictCooling == 0) state.dataOutRptTab->efficiencyDistrictCooling = 1.0; - if (state.dataOutRptTab->efficiencyDistrictHeating == 0) state.dataOutRptTab->efficiencyDistrictHeating = 1.0; + if (ort->efficiencyDistrictCooling == 0) ort->efficiencyDistrictCooling = 1.0; + if (ort->efficiencyDistrictHeating == 0) ort->efficiencyDistrictHeating = 1.0; // source emissions already have the source factors included in the calcs. totalSourceEnergyUse = 0.0; // electricity - if (state.dataOutRptTab->fuelfactorsused(1)) { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(1); + if (ort->fuelfactorsused(1)) { + totalSourceEnergyUse += ort->gatherTotalsSource(1); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(1) * state.dataOutRptTab->sourceFactorElectric; + totalSourceEnergyUse += ort->gatherTotalsBEPS(1) * ort->sourceFactorElectric; } // natural gas - if (state.dataOutRptTab->fuelfactorsused(2)) { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(2); + if (ort->fuelfactorsused(2)) { + totalSourceEnergyUse += ort->gatherTotalsSource(2); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(2) * state.dataOutRptTab->sourceFactorNaturalGas; + totalSourceEnergyUse += ort->gatherTotalsBEPS(2) * ort->sourceFactorNaturalGas; } // gasoline - if (state.dataOutRptTab->fuelfactorsused(3)) { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(3); + if (ort->fuelfactorsused(3)) { + totalSourceEnergyUse += ort->gatherTotalsSource(3); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(6) * state.dataOutRptTab->sourceFactorGasoline; + totalSourceEnergyUse += ort->gatherTotalsBEPS(6) * ort->sourceFactorGasoline; } // diesel - if (state.dataOutRptTab->fuelfactorsused(4)) { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(4); + if (ort->fuelfactorsused(4)) { + totalSourceEnergyUse += ort->gatherTotalsSource(4); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(8) * state.dataOutRptTab->sourceFactorDiesel; + totalSourceEnergyUse += ort->gatherTotalsBEPS(8) * ort->sourceFactorDiesel; } // coal - if (state.dataOutRptTab->fuelfactorsused(5)) { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(5); + if (ort->fuelfactorsused(5)) { + totalSourceEnergyUse += ort->gatherTotalsSource(5); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(9) * state.dataOutRptTab->sourceFactorCoal; + totalSourceEnergyUse += ort->gatherTotalsBEPS(9) * ort->sourceFactorCoal; } // Fuel Oil No1 - if (state.dataOutRptTab->fuelfactorsused(6)) { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(6); + if (ort->fuelfactorsused(6)) { + totalSourceEnergyUse += ort->gatherTotalsSource(6); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(10) * state.dataOutRptTab->sourceFactorFuelOil1; + totalSourceEnergyUse += ort->gatherTotalsBEPS(10) * ort->sourceFactorFuelOil1; } // Fuel Oil No2 - if (state.dataOutRptTab->fuelfactorsused(7)) { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(7); + if (ort->fuelfactorsused(7)) { + totalSourceEnergyUse += ort->gatherTotalsSource(7); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(11) * state.dataOutRptTab->sourceFactorFuelOil2; + totalSourceEnergyUse += ort->gatherTotalsBEPS(11) * ort->sourceFactorFuelOil2; } // propane - if (state.dataOutRptTab->fuelfactorsused(8)) { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(8); + if (ort->fuelfactorsused(8)) { + totalSourceEnergyUse += ort->gatherTotalsSource(8); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(12) * state.dataOutRptTab->sourceFactorPropane; + totalSourceEnergyUse += ort->gatherTotalsBEPS(12) * ort->sourceFactorPropane; } // otherfuel1 - if (state.dataOutRptTab->fuelfactorsused(11)) { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(11); + if (ort->fuelfactorsused(11)) { + totalSourceEnergyUse += ort->gatherTotalsSource(11); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(13) * state.dataOutRptTab->sourceFactorOtherFuel1; + totalSourceEnergyUse += ort->gatherTotalsBEPS(13) * ort->sourceFactorOtherFuel1; } // otherfuel2 - if (state.dataOutRptTab->fuelfactorsused(12)) { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(12); + if (ort->fuelfactorsused(12)) { + totalSourceEnergyUse += ort->gatherTotalsSource(12); } else { - totalSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(14) * state.dataOutRptTab->sourceFactorOtherFuel2; + totalSourceEnergyUse += ort->gatherTotalsBEPS(14) * ort->sourceFactorOtherFuel2; } totalSourceEnergyUse = - (totalSourceEnergyUse + state.dataOutRptTab->gatherTotalsBEPS(3) * state.dataOutRptTab->sourceFactorElectric / state.dataOutRptTab->efficiencyDistrictCooling + - state.dataOutRptTab->gatherTotalsBEPS(4) * state.dataOutRptTab->sourceFactorNaturalGas / state.dataOutRptTab->efficiencyDistrictHeating + state.dataOutRptTab->gatherTotalsBEPS(5) * state.dataOutRptTab->sourceFactorSteam) / + (totalSourceEnergyUse + ort->gatherTotalsBEPS(3) * ort->sourceFactorElectric / ort->efficiencyDistrictCooling + + ort->gatherTotalsBEPS(4) * ort->sourceFactorNaturalGas / ort->efficiencyDistrictHeating + ort->gatherTotalsBEPS(5) * ort->sourceFactorSteam) / largeConversionFactor; // district cooling | district heating | steam // now determine "net" source from purchased and surplus sold (still in J) - if (state.dataOutRptTab->fuelfactorsused(1)) { - netSourceElecPurchasedSold = state.dataOutRptTab->gatherTotalsSource(9) - state.dataOutRptTab->gatherTotalsSource(10); + if (ort->fuelfactorsused(1)) { + netSourceElecPurchasedSold = ort->gatherTotalsSource(9) - ort->gatherTotalsSource(10); } else { - netSourceElecPurchasedSold = netElecPurchasedSold * state.dataOutRptTab->sourceFactorElectric * largeConversionFactor; // back to J + netSourceElecPurchasedSold = netElecPurchasedSold * ort->sourceFactorElectric * largeConversionFactor; // back to J } netSourceEnergyUse = 0.0; // natural gas - if (state.dataOutRptTab->fuelfactorsused(2)) { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(2); + if (ort->fuelfactorsused(2)) { + netSourceEnergyUse += ort->gatherTotalsSource(2); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(2) * state.dataOutRptTab->sourceFactorNaturalGas; + netSourceEnergyUse += ort->gatherTotalsBEPS(2) * ort->sourceFactorNaturalGas; } // gasoline - if (state.dataOutRptTab->fuelfactorsused(3)) { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(3); + if (ort->fuelfactorsused(3)) { + netSourceEnergyUse += ort->gatherTotalsSource(3); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(6) * state.dataOutRptTab->sourceFactorGasoline; + netSourceEnergyUse += ort->gatherTotalsBEPS(6) * ort->sourceFactorGasoline; } // diesel - if (state.dataOutRptTab->fuelfactorsused(4)) { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(4); + if (ort->fuelfactorsused(4)) { + netSourceEnergyUse += ort->gatherTotalsSource(4); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(8) * state.dataOutRptTab->sourceFactorDiesel; + netSourceEnergyUse += ort->gatherTotalsBEPS(8) * ort->sourceFactorDiesel; } // coal - if (state.dataOutRptTab->fuelfactorsused(5)) { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(5); + if (ort->fuelfactorsused(5)) { + netSourceEnergyUse += ort->gatherTotalsSource(5); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(9) * state.dataOutRptTab->sourceFactorCoal; + netSourceEnergyUse += ort->gatherTotalsBEPS(9) * ort->sourceFactorCoal; } // Fuel Oil No1 - if (state.dataOutRptTab->fuelfactorsused(6)) { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(6); + if (ort->fuelfactorsused(6)) { + netSourceEnergyUse += ort->gatherTotalsSource(6); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(10) * state.dataOutRptTab->sourceFactorFuelOil1; + netSourceEnergyUse += ort->gatherTotalsBEPS(10) * ort->sourceFactorFuelOil1; } // Fuel Oil No2 - if (state.dataOutRptTab->fuelfactorsused(7)) { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(7); + if (ort->fuelfactorsused(7)) { + netSourceEnergyUse += ort->gatherTotalsSource(7); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(11) * state.dataOutRptTab->sourceFactorFuelOil2; + netSourceEnergyUse += ort->gatherTotalsBEPS(11) * ort->sourceFactorFuelOil2; } // propane - if (state.dataOutRptTab->fuelfactorsused(8)) { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(8); + if (ort->fuelfactorsused(8)) { + netSourceEnergyUse += ort->gatherTotalsSource(8); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(12) * state.dataOutRptTab->sourceFactorPropane; + netSourceEnergyUse += ort->gatherTotalsBEPS(12) * ort->sourceFactorPropane; } // otherfuel1 - if (state.dataOutRptTab->fuelfactorsused(11)) { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(11); + if (ort->fuelfactorsused(11)) { + netSourceEnergyUse += ort->gatherTotalsSource(11); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(13) * state.dataOutRptTab->sourceFactorOtherFuel1; + netSourceEnergyUse += ort->gatherTotalsBEPS(13) * ort->sourceFactorOtherFuel1; } // otherfuel2 - if (state.dataOutRptTab->fuelfactorsused(12)) { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsSource(12); + if (ort->fuelfactorsused(12)) { + netSourceEnergyUse += ort->gatherTotalsSource(12); } else { - netSourceEnergyUse += state.dataOutRptTab->gatherTotalsBEPS(14) * state.dataOutRptTab->sourceFactorOtherFuel2; + netSourceEnergyUse += ort->gatherTotalsBEPS(14) * ort->sourceFactorOtherFuel2; } netSourceEnergyUse = - (netSourceEnergyUse + netSourceElecPurchasedSold + state.dataOutRptTab->gatherTotalsBEPS(3) * state.dataOutRptTab->sourceFactorElectric / state.dataOutRptTab->efficiencyDistrictCooling + - state.dataOutRptTab->gatherTotalsBEPS(4) * state.dataOutRptTab->sourceFactorNaturalGas / state.dataOutRptTab->efficiencyDistrictHeating + state.dataOutRptTab->gatherTotalsBEPS(5) * state.dataOutRptTab->sourceFactorSteam) / + (netSourceEnergyUse + netSourceElecPurchasedSold + ort->gatherTotalsBEPS(3) * ort->sourceFactorElectric / ort->efficiencyDistrictCooling + + ort->gatherTotalsBEPS(4) * ort->sourceFactorNaturalGas / ort->efficiencyDistrictHeating + ort->gatherTotalsBEPS(5) * ort->sourceFactorSteam) / largeConversionFactor; // from other fuels | net source from electricity | district cooling | district heating | steam // show annual values @@ -7343,7 +7374,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteSubtitle(state, "Site and Source Energy"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -7396,104 +7427,104 @@ namespace EnergyPlus::OutputReportTabular { // tableBody(10,1) = TRIM(RealToStr(sourceFactorFuelOil2 ,3)) // tableBody(11,1) = TRIM(RealToStr(sourceFactorPropane ,3)) - if (!state.dataOutRptTab->ffSchedUsed(1)) { - tableBody(1, 1) = RealToStr(state.dataOutRptTab->sourceFactorElectric, 3); - } else if (state.dataOutRptTab->gatherTotalsBEPS(1) > SmallValue) { - tableBody(1, 1) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(1) / state.dataOutRptTab->gatherTotalsBEPS(1), 3) + - " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(1)) + "\")"; + if (!ort->ffSchedUsed(1)) { + tableBody(1, 1) = RealToStr(ort->sourceFactorElectric, 3); + } else if (ort->gatherTotalsBEPS(1) > SmallValue) { + tableBody(1, 1) = "Effective Factor = " + RealToStr(ort->gatherTotalsBySourceBEPS(1) / ort->gatherTotalsBEPS(1), 3) + + " (calculated using schedule \"" + GetScheduleName(state, ort->ffSchedIndex(1)) + "\")"; } else { tableBody(1, 1) = "N/A"; } - if (!state.dataOutRptTab->ffSchedUsed(2)) { - tableBody(1, 2) = RealToStr(state.dataOutRptTab->sourceFactorNaturalGas, 3); - } else if (state.dataOutRptTab->gatherTotalsBEPS(2) > SmallValue) { - tableBody(1, 2) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(2) / state.dataOutRptTab->gatherTotalsBEPS(2), 3) + - " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(2)) + "\")"; + if (!ort->ffSchedUsed(2)) { + tableBody(1, 2) = RealToStr(ort->sourceFactorNaturalGas, 3); + } else if (ort->gatherTotalsBEPS(2) > SmallValue) { + tableBody(1, 2) = "Effective Factor = " + RealToStr(ort->gatherTotalsBySourceBEPS(2) / ort->gatherTotalsBEPS(2), 3) + + " (calculated using schedule \"" + GetScheduleName(state, ort->ffSchedIndex(2)) + "\")"; } else { tableBody(1, 2) = "N/A"; } - tableBody(1, 3) = RealToStr(state.dataOutRptTab->sourceFactorElectric / state.dataOutRptTab->efficiencyDistrictCooling, 3); // District Cooling + tableBody(1, 3) = RealToStr(ort->sourceFactorElectric / ort->efficiencyDistrictCooling, 3); // District Cooling - tableBody(1, 4) = RealToStr(state.dataOutRptTab->sourceFactorNaturalGas / state.dataOutRptTab->efficiencyDistrictHeating, 3); // District Heating + tableBody(1, 4) = RealToStr(ort->sourceFactorNaturalGas / ort->efficiencyDistrictHeating, 3); // District Heating - tableBody(1, 5) = RealToStr(state.dataOutRptTab->sourceFactorSteam, 3); // Steam + tableBody(1, 5) = RealToStr(ort->sourceFactorSteam, 3); // Steam - if (!state.dataOutRptTab->ffSchedUsed(6)) { - tableBody(1, 6) = RealToStr(state.dataOutRptTab->sourceFactorGasoline, 3); - } else if (state.dataOutRptTab->gatherTotalsBEPS(6) > SmallValue) { - tableBody(1, 6) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(6) / state.dataOutRptTab->gatherTotalsBEPS(6), 3) + - " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(6)) + "\")"; + if (!ort->ffSchedUsed(6)) { + tableBody(1, 6) = RealToStr(ort->sourceFactorGasoline, 3); + } else if (ort->gatherTotalsBEPS(6) > SmallValue) { + tableBody(1, 6) = "Effective Factor = " + RealToStr(ort->gatherTotalsBySourceBEPS(6) / ort->gatherTotalsBEPS(6), 3) + + " (calculated using schedule \"" + GetScheduleName(state, ort->ffSchedIndex(6)) + "\")"; } else { tableBody(1, 6) = "N/A"; } - if (!state.dataOutRptTab->ffSchedUsed(8)) { - tableBody(1, 7) = RealToStr(state.dataOutRptTab->sourceFactorDiesel, 3); - } else if (state.dataOutRptTab->gatherTotalsBEPS(8) > SmallValue) { - tableBody(1, 7) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(8) / state.dataOutRptTab->gatherTotalsBEPS(8), 3) + - " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(8)) + "\")"; + if (!ort->ffSchedUsed(8)) { + tableBody(1, 7) = RealToStr(ort->sourceFactorDiesel, 3); + } else if (ort->gatherTotalsBEPS(8) > SmallValue) { + tableBody(1, 7) = "Effective Factor = " + RealToStr(ort->gatherTotalsBySourceBEPS(8) / ort->gatherTotalsBEPS(8), 3) + + " (calculated using schedule \"" + GetScheduleName(state, ort->ffSchedIndex(8)) + "\")"; } else { tableBody(1, 7) = "N/A"; } - if (!state.dataOutRptTab->ffSchedUsed(9)) { - tableBody(1, 8) = RealToStr(state.dataOutRptTab->sourceFactorCoal, 3); - } else if (state.dataOutRptTab->gatherTotalsBEPS(9) > SmallValue) { - tableBody(1, 8) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(9) / state.dataOutRptTab->gatherTotalsBEPS(9), 3) + - " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(9)) + "\")"; + if (!ort->ffSchedUsed(9)) { + tableBody(1, 8) = RealToStr(ort->sourceFactorCoal, 3); + } else if (ort->gatherTotalsBEPS(9) > SmallValue) { + tableBody(1, 8) = "Effective Factor = " + RealToStr(ort->gatherTotalsBySourceBEPS(9) / ort->gatherTotalsBEPS(9), 3) + + " (calculated using schedule \"" + GetScheduleName(state, ort->ffSchedIndex(9)) + "\")"; } else { tableBody(1, 8) = "N/A"; } - if (!state.dataOutRptTab->ffSchedUsed(10)) { - tableBody(1, 9) = RealToStr(state.dataOutRptTab->sourceFactorFuelOil1, 3); - } else if (state.dataOutRptTab->gatherTotalsBEPS(10) > SmallValue) { - tableBody(1, 9) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(10) / state.dataOutRptTab->gatherTotalsBEPS(10), 3) + - " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(10)) + "\")"; + if (!ort->ffSchedUsed(10)) { + tableBody(1, 9) = RealToStr(ort->sourceFactorFuelOil1, 3); + } else if (ort->gatherTotalsBEPS(10) > SmallValue) { + tableBody(1, 9) = "Effective Factor = " + RealToStr(ort->gatherTotalsBySourceBEPS(10) / ort->gatherTotalsBEPS(10), 3) + + " (calculated using schedule \"" + GetScheduleName(state, ort->ffSchedIndex(10)) + "\")"; } else { tableBody(1, 9) = "N/A"; } - if (!state.dataOutRptTab->ffSchedUsed(11)) { - tableBody(1, 10) = RealToStr(state.dataOutRptTab->sourceFactorFuelOil2, 3); - } else if (state.dataOutRptTab->gatherTotalsBEPS(11) > SmallValue) { - tableBody(1, 10) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(11) / state.dataOutRptTab->gatherTotalsBEPS(11), 3) + - " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(11)) + "\")"; + if (!ort->ffSchedUsed(11)) { + tableBody(1, 10) = RealToStr(ort->sourceFactorFuelOil2, 3); + } else if (ort->gatherTotalsBEPS(11) > SmallValue) { + tableBody(1, 10) = "Effective Factor = " + RealToStr(ort->gatherTotalsBySourceBEPS(11) / ort->gatherTotalsBEPS(11), 3) + + " (calculated using schedule \"" + GetScheduleName(state, ort->ffSchedIndex(11)) + "\")"; } else { tableBody(1, 10) = "N/A"; } - if (!state.dataOutRptTab->ffSchedUsed(12)) { - tableBody(1, 11) = RealToStr(state.dataOutRptTab->sourceFactorPropane, 3); - } else if (state.dataOutRptTab->gatherTotalsBEPS(12) > SmallValue) { - tableBody(1, 11) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(12) / state.dataOutRptTab->gatherTotalsBEPS(12), 3) + - " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(12)) + "\")"; + if (!ort->ffSchedUsed(12)) { + tableBody(1, 11) = RealToStr(ort->sourceFactorPropane, 3); + } else if (ort->gatherTotalsBEPS(12) > SmallValue) { + tableBody(1, 11) = "Effective Factor = " + RealToStr(ort->gatherTotalsBySourceBEPS(12) / ort->gatherTotalsBEPS(12), 3) + + " (calculated using schedule \"" + GetScheduleName(state, ort->ffSchedIndex(12)) + "\")"; } else { tableBody(1, 11) = "N/A"; } - if (!state.dataOutRptTab->ffSchedUsed(13)) { - tableBody(1, 12) = RealToStr(state.dataOutRptTab->sourceFactorOtherFuel1, 3); - } else if (state.dataOutRptTab->gatherTotalsBEPS(13) > SmallValue) { - tableBody(1, 12) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(13) / state.dataOutRptTab->gatherTotalsBEPS(13), 3) + - " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(13)) + "\")"; + if (!ort->ffSchedUsed(13)) { + tableBody(1, 12) = RealToStr(ort->sourceFactorOtherFuel1, 3); + } else if (ort->gatherTotalsBEPS(13) > SmallValue) { + tableBody(1, 12) = "Effective Factor = " + RealToStr(ort->gatherTotalsBySourceBEPS(13) / ort->gatherTotalsBEPS(13), 3) + + " (calculated using schedule \"" + GetScheduleName(state, ort->ffSchedIndex(13)) + "\")"; } else { tableBody(1, 12) = "N/A"; } - if (!state.dataOutRptTab->ffSchedUsed(14)) { - tableBody(1, 13) = RealToStr(state.dataOutRptTab->sourceFactorOtherFuel2, 3); - } else if (state.dataOutRptTab->gatherTotalsBEPS(14) > SmallValue) { - tableBody(1, 13) = "Effective Factor = " + RealToStr(state.dataOutRptTab->gatherTotalsBySourceBEPS(14) / state.dataOutRptTab->gatherTotalsBEPS(14), 3) + - " (calculated using schedule \"" + GetScheduleName(state, state.dataOutRptTab->ffSchedIndex(14)) + "\")"; + if (!ort->ffSchedUsed(14)) { + tableBody(1, 13) = RealToStr(ort->sourceFactorOtherFuel2, 3); + } else if (ort->gatherTotalsBEPS(14) > SmallValue) { + tableBody(1, 13) = "Effective Factor = " + RealToStr(ort->gatherTotalsBySourceBEPS(14) / ort->gatherTotalsBEPS(14), 3) + + " (calculated using schedule \"" + GetScheduleName(state, ort->ffSchedIndex(14)) + "\")"; } else { tableBody(1, 13) = "N/A"; } // heading for the entire sub-table - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteSubtitle(state, "Site to Source Energy Conversion Factors"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -7523,7 +7554,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody.allocate(1, 3); { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Area [m2]"; } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { @@ -7539,7 +7570,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody = ""; tableBody(1, 1) = RealToStr(convBldgGrossFloorArea, 2); - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "Total gross floor area [ft2]", RealToStr(convBldgGrossFloorArea, 2)); } else { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedGenData, "Total gross floor area [m2]", RealToStr(convBldgGrossFloorArea, 2)); @@ -7548,7 +7579,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 3) = RealToStr(convBldgGrossFloorArea - convBldgCondFloorArea, 2); // heading for the entire sub-table - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteSubtitle(state, "Building Area"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -7605,7 +7636,7 @@ namespace EnergyPlus::OutputReportTabular { rowHead(16) = "Total End Uses"; { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Electricity [kWh]"; columnHead(2) = "Natural Gas [kWh]"; @@ -7671,16 +7702,16 @@ namespace EnergyPlus::OutputReportTabular { unconvert = largeConversionFactor / 1000000000.0; // to avoid double converting, the values for the LEED report should be in GJ // Energy Use Intensities - Electricity - if (state.dataOutRptTab->buildingGrossFloorArea > 0) { + if (ort->buildingGrossFloorArea > 0) { PreDefTableEntry(state, - state.dataOutRptPredefined->pdchLeedEuiElec, "Interior Lighting (All)", unconvert * 1000 * useVal(colElectricity, 3) / state.dataOutRptTab->buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Space Heating", unconvert * 1000 * useVal(colElectricity, 1) / state.dataOutRptTab->buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Space Cooling", unconvert * 1000 * useVal(colElectricity, 2) / state.dataOutRptTab->buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Fans (All)", unconvert * 1000 * useVal(colElectricity, 7) / state.dataOutRptTab->buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Service Water Heating", unconvert * 1000 * useVal(colElectricity, 12) / state.dataOutRptTab->buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Receptacle Equipment", unconvert * 1000 * useVal(colElectricity, 5) / state.dataOutRptTab->buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Miscellaneous (All)", unconvert * 1000 * (useVal(colElectricity, 15)) / state.dataOutRptTab->buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Subtotal", unconvert * 1000 * useVal(colElectricity, 15) / state.dataOutRptTab->buildingGrossFloorArea, 2); + state.dataOutRptPredefined->pdchLeedEuiElec, "Interior Lighting (All)", unconvert * 1000 * useVal(colElectricity, 3) / ort->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Space Heating", unconvert * 1000 * useVal(colElectricity, 1) / ort->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Space Cooling", unconvert * 1000 * useVal(colElectricity, 2) / ort->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Fans (All)", unconvert * 1000 * useVal(colElectricity, 7) / ort->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Service Water Heating", unconvert * 1000 * useVal(colElectricity, 12) / ort->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Receptacle Equipment", unconvert * 1000 * useVal(colElectricity, 5) / ort->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Miscellaneous (All)", unconvert * 1000 * (useVal(colElectricity, 15)) / ort->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiElec, "Subtotal", unconvert * 1000 * useVal(colElectricity, 15) / ort->buildingGrossFloorArea, 2); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEusTotal, "Electricity", unconvert * useVal(colElectricity, 15), 2); @@ -7695,11 +7726,11 @@ namespace EnergyPlus::OutputReportTabular { addFootNoteSubTable(state, state.dataOutRptPredefined->pdstLeedEneCostSum, "Process energy cost based on ratio of process to total energy."); // Energy Use Intensities- Natural Gas - if (state.dataOutRptTab->buildingGrossFloorArea > 0) { - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Space Heating", unconvert * 1000 * useVal(colGas, 1) / state.dataOutRptTab->buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Service Water Heating", unconvert * 1000 * useVal(colGas, 12) / state.dataOutRptTab->buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Miscellaneous (All)", unconvert * 1000 * useVal(colGas, 15) / state.dataOutRptTab->buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Subtotal", unconvert * 1000 * useVal(colGas, 15) / state.dataOutRptTab->buildingGrossFloorArea, 2); + if (ort->buildingGrossFloorArea > 0) { + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Space Heating", unconvert * 1000 * useVal(colGas, 1) / ort->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Service Water Heating", unconvert * 1000 * useVal(colGas, 12) / ort->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Miscellaneous (All)", unconvert * 1000 * useVal(colGas, 15) / ort->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiNatG, "Subtotal", unconvert * 1000 * useVal(colGas, 15) / ort->buildingGrossFloorArea, 2); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEusTotal, "Natural Gas", unconvert * useVal(colGas, 15), 2); PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEusProc, "Natural Gas", unconvert * (useVal(colGas, 5) + useVal(colGas, 13)), 2); @@ -7718,9 +7749,9 @@ namespace EnergyPlus::OutputReportTabular { useVal(3, 5) + useVal(4, 5) + useVal(5, 5) + useVal(6, 5) + useVal(7, 5) + useVal(8, 5) + useVal(9, 5) + useVal(10, 5); useValColAddFuel13 = useVal(3, 13) + useVal(4, 13) + useVal(5, 13) + useVal(6, 13) + useVal(7, 13) + useVal(8, 13) + useVal(9, 13) + useVal(10, 13); - if (state.dataOutRptTab->buildingGrossFloorArea > 0) { - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiOthr, "Miscellaneous", unconvert * 1000 * useValColAddFuel15 / state.dataOutRptTab->buildingGrossFloorArea, 2); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiOthr, "Subtotal", unconvert * 1000 * useValColAddFuel15 / state.dataOutRptTab->buildingGrossFloorArea, 2); + if (ort->buildingGrossFloorArea > 0) { + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiOthr, "Miscellaneous", unconvert * 1000 * useValColAddFuel15 / ort->buildingGrossFloorArea, 2); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEuiOthr, "Subtotal", unconvert * 1000 * useValColAddFuel15 / ort->buildingGrossFloorArea, 2); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEusTotal, "Additional", unconvert * (useValColAddFuel15 + useVal(colPurchCool, 15) + useVal(colPurchHeat, 15)), 2); @@ -7804,7 +7835,7 @@ namespace EnergyPlus::OutputReportTabular { } } // heading for the entire sub-table - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteSubtitle(state, "End Uses"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth, false, footnote); if (sqlite) { @@ -7821,7 +7852,7 @@ namespace EnergyPlus::OutputReportTabular { // determine if subcategories add up to the total and // if not, determine the difference for the 'other' row - state.dataOutRptTab->needOtherRowLEED45 = false; // set array to all false assuming no other rows are needed + ort->needOtherRowLEED45 = false; // set array to all false assuming no other rows are needed for (iResource = 1; iResource <= 13; ++iResource) { for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { if (state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories > 0) { @@ -7833,7 +7864,7 @@ namespace EnergyPlus::OutputReportTabular { } // if just a small value remains set it to zero if (std::abs(endUseSubOther(iResource, jEndUse)) > 0.01) { - state.dataOutRptTab->needOtherRowLEED45(jEndUse) = true; + ort->needOtherRowLEED45(jEndUse) = true; } else { endUseSubOther(iResource, jEndUse) = 0.0; } @@ -7851,7 +7882,7 @@ namespace EnergyPlus::OutputReportTabular { ++numRows; } // check if an 'other' row is needed - if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { + if (ort->needOtherRowLEED45(jEndUse)) { ++numRows; } } else { @@ -7877,7 +7908,7 @@ namespace EnergyPlus::OutputReportTabular { ++i; } // check if an 'other' row is needed - if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { + if (ort->needOtherRowLEED45(jEndUse)) { tableBody(1, i) = "Other"; ++i; } @@ -7890,7 +7921,7 @@ namespace EnergyPlus::OutputReportTabular { columnHead(1) = "Subcategory"; { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(2) = "Electricity [kWh]"; columnHead(3) = "Natural Gas [kWh]"; @@ -7945,7 +7976,7 @@ namespace EnergyPlus::OutputReportTabular { ++i; } // put other - if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { + if (ort->needOtherRowLEED45(jEndUse)) { tableBody(iResource + 1, i) = RealToStr(endUseSubOther(iResource, jEndUse), 2); ++i; } @@ -7957,7 +7988,7 @@ namespace EnergyPlus::OutputReportTabular { } // heading for the entire sub-table - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteSubtitle(state, "End Uses By Subcategory"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); @@ -8024,7 +8055,7 @@ namespace EnergyPlus::OutputReportTabular { ++i; } // put other - if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { + if (ort->needOtherRowLEED45(jEndUse)) { PreDefTableEntry(state, resource_entry_map(iResource), state.dataOutputProcessor->EndUseCategory(jEndUse).DisplayName + " -- Other", unconvert * endUseSubOther(iResource, jEndUse)); @@ -8078,7 +8109,7 @@ namespace EnergyPlus::OutputReportTabular { rowHead(4) = "Total"; { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Electricity Intensity [kWh/m2]"; columnHead(2) = "Natural Gas Intensity [kWh/m2]"; @@ -8136,7 +8167,7 @@ namespace EnergyPlus::OutputReportTabular { } } // heading for the entire sub-table - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteSubtitle(state, "Utility Use Per Conditioned Floor Area"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -8166,7 +8197,7 @@ namespace EnergyPlus::OutputReportTabular { } } // heading for the entire sub-table - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteSubtitle(state, "Utility Use Per Total Floor Area"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -8195,7 +8226,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody.allocate(2, 14); { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Electricity [kWh]"; } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { @@ -8226,39 +8257,39 @@ namespace EnergyPlus::OutputReportTabular { // show annual values unconvert = largeConversionFactor / 1000000000.0; // to avoid double converting, the values for the LEED report should be in GJ - tableBody(1, 1) = RealToStr(state.dataOutRptTab->gatherPowerFuelFireGen, 3); - tableBody(1, 2) = RealToStr(state.dataOutRptTab->gatherPowerHTGeothermal, 3); - tableBody(1, 3) = RealToStr(state.dataOutRptTab->gatherPowerPV, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedRenAnGen, "Photovoltaic", unconvert * state.dataOutRptTab->gatherPowerPV, 2); - tableBody(1, 4) = RealToStr(state.dataOutRptTab->gatherPowerWind, 3); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedRenAnGen, "Wind", unconvert * state.dataOutRptTab->gatherPowerWind, 2); - tableBody(1, 5) = RealToStr(state.dataOutRptTab->gatherPowerConversion, 3); - tableBody(1, 6) = RealToStr(state.dataOutRptTab->OverallNetEnergyFromStorage, 3); - tableBody(1, 7) = RealToStr(state.dataOutRptTab->gatherElecProduced, 3); - tableBody(1, 9) = RealToStr(state.dataOutRptTab->gatherElecPurchased, 3); - tableBody(1, 10) = RealToStr(state.dataOutRptTab->gatherElecSurplusSold, 3); - tableBody(1, 11) = RealToStr(state.dataOutRptTab->gatherElecPurchased - state.dataOutRptTab->gatherElecSurplusSold, 3); - tableBody(1, 13) = RealToStr(state.dataOutRptTab->gatherElecProduced + (state.dataOutRptTab->gatherElecPurchased - state.dataOutRptTab->gatherElecSurplusSold), 3); + tableBody(1, 1) = RealToStr(ort->gatherPowerFuelFireGen, 3); + tableBody(1, 2) = RealToStr(ort->gatherPowerHTGeothermal, 3); + tableBody(1, 3) = RealToStr(ort->gatherPowerPV, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedRenAnGen, "Photovoltaic", unconvert * ort->gatherPowerPV, 2); + tableBody(1, 4) = RealToStr(ort->gatherPowerWind, 3); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedRenAnGen, "Wind", unconvert * ort->gatherPowerWind, 2); + tableBody(1, 5) = RealToStr(ort->gatherPowerConversion, 3); + tableBody(1, 6) = RealToStr(ort->OverallNetEnergyFromStorage, 3); + tableBody(1, 7) = RealToStr(ort->gatherElecProduced, 3); + tableBody(1, 9) = RealToStr(ort->gatherElecPurchased, 3); + tableBody(1, 10) = RealToStr(ort->gatherElecSurplusSold, 3); + tableBody(1, 11) = RealToStr(ort->gatherElecPurchased - ort->gatherElecSurplusSold, 3); + tableBody(1, 13) = RealToStr(ort->gatherElecProduced + (ort->gatherElecPurchased - ort->gatherElecSurplusSold), 3); tableBody(1, 14) = RealToStr(collapsedTotal(1), 3); // show annual percentages if (collapsedTotal(1) > 0) { - tableBody(2, 1) = RealToStr(100.0 * state.dataOutRptTab->gatherPowerFuelFireGen / collapsedTotal(1), 2); - tableBody(2, 2) = RealToStr(100.0 * state.dataOutRptTab->gatherPowerHTGeothermal / collapsedTotal(1), 2); - tableBody(2, 3) = RealToStr(100.0 * state.dataOutRptTab->gatherPowerPV / collapsedTotal(1), 2); - tableBody(2, 4) = RealToStr(100.0 * state.dataOutRptTab->gatherPowerWind / collapsedTotal(1), 2); - tableBody(2, 5) = RealToStr(100.0 * state.dataOutRptTab->gatherPowerConversion / collapsedTotal(1), 2); - tableBody(2, 6) = RealToStr(100.0 * state.dataOutRptTab->OverallNetEnergyFromStorage / collapsedTotal(1), 2); - tableBody(2, 7) = RealToStr(100.0 * state.dataOutRptTab->gatherElecProduced / collapsedTotal(1), 2); - tableBody(2, 9) = RealToStr(100.0 * state.dataOutRptTab->gatherElecPurchased / collapsedTotal(1), 2); - tableBody(2, 10) = RealToStr(100.0 * state.dataOutRptTab->gatherElecSurplusSold / collapsedTotal(1), 2); - tableBody(2, 11) = RealToStr(100.0 * (state.dataOutRptTab->gatherElecPurchased - state.dataOutRptTab->gatherElecSurplusSold) / collapsedTotal(1), 2); - tableBody(2, 13) = RealToStr(100.0 * (state.dataOutRptTab->gatherElecProduced + (state.dataOutRptTab->gatherElecPurchased - state.dataOutRptTab->gatherElecSurplusSold)) / collapsedTotal(1), 2); + tableBody(2, 1) = RealToStr(100.0 * ort->gatherPowerFuelFireGen / collapsedTotal(1), 2); + tableBody(2, 2) = RealToStr(100.0 * ort->gatherPowerHTGeothermal / collapsedTotal(1), 2); + tableBody(2, 3) = RealToStr(100.0 * ort->gatherPowerPV / collapsedTotal(1), 2); + tableBody(2, 4) = RealToStr(100.0 * ort->gatherPowerWind / collapsedTotal(1), 2); + tableBody(2, 5) = RealToStr(100.0 * ort->gatherPowerConversion / collapsedTotal(1), 2); + tableBody(2, 6) = RealToStr(100.0 * ort->OverallNetEnergyFromStorage / collapsedTotal(1), 2); + tableBody(2, 7) = RealToStr(100.0 * ort->gatherElecProduced / collapsedTotal(1), 2); + tableBody(2, 9) = RealToStr(100.0 * ort->gatherElecPurchased / collapsedTotal(1), 2); + tableBody(2, 10) = RealToStr(100.0 * ort->gatherElecSurplusSold / collapsedTotal(1), 2); + tableBody(2, 11) = RealToStr(100.0 * (ort->gatherElecPurchased - ort->gatherElecSurplusSold) / collapsedTotal(1), 2); + tableBody(2, 13) = RealToStr(100.0 * (ort->gatherElecProduced + (ort->gatherElecPurchased - ort->gatherElecSurplusSold)) / collapsedTotal(1), 2); tableBody(2, 14) = RealToStr(100.0, 2); } // heading for the entire sub-table - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteSubtitle(state, "Electric Loads Satisfied"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -8279,7 +8310,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody.allocate(2, 7); { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Heat [kWh]"; } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { @@ -8303,38 +8334,38 @@ namespace EnergyPlus::OutputReportTabular { // convert to GJ - state.dataOutRptTab->gatherWaterHeatRecovery /= largeConversionFactor; - state.dataOutRptTab->gatherAirHeatRecoveryCool /= largeConversionFactor; - state.dataOutRptTab->gatherAirHeatRecoveryHeat /= largeConversionFactor; - state.dataOutRptTab->gatherHeatHTGeothermal /= largeConversionFactor; - state.dataOutRptTab->gatherHeatSolarWater /= largeConversionFactor; - state.dataOutRptTab->gatherHeatSolarAir /= largeConversionFactor; + ort->gatherWaterHeatRecovery /= largeConversionFactor; + ort->gatherAirHeatRecoveryCool /= largeConversionFactor; + ort->gatherAirHeatRecoveryHeat /= largeConversionFactor; + ort->gatherHeatHTGeothermal /= largeConversionFactor; + ort->gatherHeatSolarWater /= largeConversionFactor; + ort->gatherHeatSolarAir /= largeConversionFactor; // determine total on site heat - totalOnsiteHeat = state.dataOutRptTab->gatherWaterHeatRecovery + state.dataOutRptTab->gatherAirHeatRecoveryCool + state.dataOutRptTab->gatherAirHeatRecoveryHeat + state.dataOutRptTab->gatherHeatHTGeothermal + - state.dataOutRptTab->gatherHeatSolarWater + state.dataOutRptTab->gatherHeatSolarAir; + totalOnsiteHeat = ort->gatherWaterHeatRecovery + ort->gatherAirHeatRecoveryCool + ort->gatherAirHeatRecoveryHeat + ort->gatherHeatHTGeothermal + + ort->gatherHeatSolarWater + ort->gatherHeatSolarAir; // show annual values - tableBody(1, 1) = RealToStr(state.dataOutRptTab->gatherWaterHeatRecovery, 2); - tableBody(1, 2) = RealToStr(state.dataOutRptTab->gatherAirHeatRecoveryCool, 2); - tableBody(1, 3) = RealToStr(state.dataOutRptTab->gatherAirHeatRecoveryHeat, 2); - tableBody(1, 4) = RealToStr(state.dataOutRptTab->gatherHeatHTGeothermal, 2); - tableBody(1, 5) = RealToStr(state.dataOutRptTab->gatherHeatSolarWater, 2); - tableBody(1, 6) = RealToStr(state.dataOutRptTab->gatherHeatSolarAir, 2); + tableBody(1, 1) = RealToStr(ort->gatherWaterHeatRecovery, 2); + tableBody(1, 2) = RealToStr(ort->gatherAirHeatRecoveryCool, 2); + tableBody(1, 3) = RealToStr(ort->gatherAirHeatRecoveryHeat, 2); + tableBody(1, 4) = RealToStr(ort->gatherHeatHTGeothermal, 2); + tableBody(1, 5) = RealToStr(ort->gatherHeatSolarWater, 2); + tableBody(1, 6) = RealToStr(ort->gatherHeatSolarAir, 2); tableBody(1, 7) = RealToStr(totalOnsiteHeat, 2); if (totalOnsiteHeat > 0) { - tableBody(2, 1) = RealToStr(100.0 * state.dataOutRptTab->gatherWaterHeatRecovery / totalOnsiteHeat, 2); - tableBody(2, 2) = RealToStr(100.0 * state.dataOutRptTab->gatherAirHeatRecoveryCool / totalOnsiteHeat, 2); - tableBody(2, 3) = RealToStr(100.0 * state.dataOutRptTab->gatherAirHeatRecoveryHeat / totalOnsiteHeat, 2); - tableBody(2, 4) = RealToStr(100.0 * state.dataOutRptTab->gatherHeatHTGeothermal / totalOnsiteHeat, 2); - tableBody(2, 5) = RealToStr(100.0 * state.dataOutRptTab->gatherHeatSolarWater / totalOnsiteHeat, 2); - tableBody(2, 6) = RealToStr(100.0 * state.dataOutRptTab->gatherHeatSolarAir / totalOnsiteHeat, 2); + tableBody(2, 1) = RealToStr(100.0 * ort->gatherWaterHeatRecovery / totalOnsiteHeat, 2); + tableBody(2, 2) = RealToStr(100.0 * ort->gatherAirHeatRecoveryCool / totalOnsiteHeat, 2); + tableBody(2, 3) = RealToStr(100.0 * ort->gatherAirHeatRecoveryHeat / totalOnsiteHeat, 2); + tableBody(2, 4) = RealToStr(100.0 * ort->gatherHeatHTGeothermal / totalOnsiteHeat, 2); + tableBody(2, 5) = RealToStr(100.0 * ort->gatherHeatSolarWater / totalOnsiteHeat, 2); + tableBody(2, 6) = RealToStr(100.0 * ort->gatherHeatSolarAir / totalOnsiteHeat, 2); tableBody(2, 7) = RealToStr(100.0, 2); } // heading for the entire sub-table - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteSubtitle(state, "On-Site Thermal Sources"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -8361,7 +8392,7 @@ namespace EnergyPlus::OutputReportTabular { columnWidth = 14; // array assignment - same for all columns tableBody.allocate(2, 13); { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Water [m3]"; } else if (SELECT_CASE_var == iUnitsStyle::InchPound) { @@ -8386,12 +8417,12 @@ namespace EnergyPlus::OutputReportTabular { rowHead(13) = "Total Water End Uses"; tableBody = "-"; - totalOnsiteWater = state.dataOutRptTab->gatherRainWater + state.dataOutRptTab->gatherCondensate + state.dataOutRptTab->gatherWellwater; + totalOnsiteWater = ort->gatherRainWater + ort->gatherCondensate + ort->gatherWellwater; // ! show annual values - tableBody(1, 1) = RealToStr(state.dataOutRptTab->gatherRainWater / waterConversionFactor, 2); - tableBody(1, 2) = RealToStr(state.dataOutRptTab->gatherCondensate / waterConversionFactor, 2); - tableBody(1, 3) = RealToStr(state.dataOutRptTab->gatherWellwater / waterConversionFactor, 2); + tableBody(1, 1) = RealToStr(ort->gatherRainWater / waterConversionFactor, 2); + tableBody(1, 2) = RealToStr(ort->gatherCondensate / waterConversionFactor, 2); + tableBody(1, 3) = RealToStr(ort->gatherWellwater / waterConversionFactor, 2); tableBody(1, 4) = RealToStr(totalOnsiteWater / waterConversionFactor, 2); if (allocated(state.dataWaterData->WaterStorage)) { @@ -8407,29 +8438,29 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 7) = RealToStr(finalStorage / waterConversionFactor, 2); tableBody(1, 8) = RealToStr(StorageChange / waterConversionFactor, 2); - totalWater = totalOnsiteWater + state.dataOutRptTab->gatherMains + StorageChange; + totalWater = totalOnsiteWater + ort->gatherMains + StorageChange; - tableBody(1, 10) = RealToStr(state.dataOutRptTab->gatherMains / waterConversionFactor, 2); + tableBody(1, 10) = RealToStr(ort->gatherMains / waterConversionFactor, 2); tableBody(1, 12) = RealToStr(totalWater / waterConversionFactor, 2); - tableBody(1, 13) = RealToStr(state.dataOutRptTab->gatherWaterEndUseTotal / waterConversionFactor, 2); + tableBody(1, 13) = RealToStr(ort->gatherWaterEndUseTotal / waterConversionFactor, 2); - if (state.dataOutRptTab->gatherWaterEndUseTotal > 0) { - tableBody(2, 1) = RealToStr(100.0 * state.dataOutRptTab->gatherRainWater / state.dataOutRptTab->gatherWaterEndUseTotal, 2); - tableBody(2, 2) = RealToStr(100.0 * state.dataOutRptTab->gatherCondensate / state.dataOutRptTab->gatherWaterEndUseTotal, 2); - tableBody(2, 3) = RealToStr(100.0 * state.dataOutRptTab->gatherWellwater / state.dataOutRptTab->gatherWaterEndUseTotal, 2); - tableBody(2, 4) = RealToStr(100.0 * totalOnsiteWater / state.dataOutRptTab->gatherWaterEndUseTotal, 2); - tableBody(2, 6) = RealToStr(100.0 * initialStorage / state.dataOutRptTab->gatherWaterEndUseTotal, 2); - tableBody(2, 7) = RealToStr(100.0 * finalStorage / state.dataOutRptTab->gatherWaterEndUseTotal, 2); - tableBody(2, 8) = RealToStr(100.0 * StorageChange / state.dataOutRptTab->gatherWaterEndUseTotal, 2); + if (ort->gatherWaterEndUseTotal > 0) { + tableBody(2, 1) = RealToStr(100.0 * ort->gatherRainWater / ort->gatherWaterEndUseTotal, 2); + tableBody(2, 2) = RealToStr(100.0 * ort->gatherCondensate / ort->gatherWaterEndUseTotal, 2); + tableBody(2, 3) = RealToStr(100.0 * ort->gatherWellwater / ort->gatherWaterEndUseTotal, 2); + tableBody(2, 4) = RealToStr(100.0 * totalOnsiteWater / ort->gatherWaterEndUseTotal, 2); + tableBody(2, 6) = RealToStr(100.0 * initialStorage / ort->gatherWaterEndUseTotal, 2); + tableBody(2, 7) = RealToStr(100.0 * finalStorage / ort->gatherWaterEndUseTotal, 2); + tableBody(2, 8) = RealToStr(100.0 * StorageChange / ort->gatherWaterEndUseTotal, 2); - tableBody(2, 10) = RealToStr(100.0 * state.dataOutRptTab->gatherMains / state.dataOutRptTab->gatherWaterEndUseTotal, 2); + tableBody(2, 10) = RealToStr(100.0 * ort->gatherMains / ort->gatherWaterEndUseTotal, 2); - tableBody(2, 12) = RealToStr(100.0 * totalWater / state.dataOutRptTab->gatherWaterEndUseTotal, 2); + tableBody(2, 12) = RealToStr(100.0 * totalWater / ort->gatherWaterEndUseTotal, 2); tableBody(2, 13) = RealToStr(100.0, 2); } // ! heading for the entire sub-table - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteSubtitle(state, "Water Source Summary"); WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { @@ -8443,7 +8474,7 @@ namespace EnergyPlus::OutputReportTabular { } //---- Comfort and Setpoint Not Met Sub-Table - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { rowHead.allocate(2); columnHead.allocate(1); columnWidth.allocate(1); @@ -8454,7 +8485,7 @@ namespace EnergyPlus::OutputReportTabular { curNameWithSIUnits = "Degrees [deltaC]"; curNameAndUnits = curNameWithSIUnits; - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, curNameWithSIUnits, indexUnitConv, curNameAndUnits); } columnHead(1) = curNameAndUnits; @@ -8462,7 +8493,7 @@ namespace EnergyPlus::OutputReportTabular { rowHead(1) = "Tolerance for Zone Heating Setpoint Not Met Time"; rowHead(2) = "Tolerance for Zone Cooling Setpoint Not Met Time"; - if (state.dataOutRptTab->unitsStyle != iUnitsStyle::InchPound) { + if (ort->unitsStyle != iUnitsStyle::InchPound) { tableBody(1, 1) = RealToStr(std::abs(deviationFromSetPtThresholdHtg), 2); tableBody(1, 2) = RealToStr(deviationFromSetPtThresholdClg, 2); } else { @@ -8491,7 +8522,7 @@ namespace EnergyPlus::OutputReportTabular { columnWidth = 14; // array assignment - same for all columns tableBody.allocate(1, 3); - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteSubtitle(state, "Comfort and Setpoint Not Met Summary"); } @@ -8508,7 +8539,7 @@ namespace EnergyPlus::OutputReportTabular { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedAmData, "Number of hours not met", RealToStr(state.dataOutRptPredefined->TotalNotMetOccupiedForABUPS, 2)); tableBody(1, 3) = RealToStr(state.dataOutRptPredefined->TotalTimeNotSimpleASH55EitherForABUPS, 2); - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteTable(state, tableBody, rowHead, columnHead, columnWidth); if (sqlite) { sqlite->createSQLiteTabularDataRecords(tableBody, @@ -8531,7 +8562,7 @@ namespace EnergyPlus::OutputReportTabular { //---- Control Summary Sub-Table //---- End Notes - if (state.dataOutRptTab->displayTabularBEPS) { + if (ort->displayTabularBEPS) { WriteTextLine(state, "Note 1: An asterisk (*) indicates that the feature is not yet implemented."); } // CALL WriteTextLine('Note 2: The source energy conversion factors used are: ') @@ -8578,13 +8609,14 @@ namespace EnergyPlus::OutputReportTabular { int iResource; Real64 largeConversionFactor; Real64 areaConversionFactor; + auto &ort(state.dataOutRptTab); - if (state.dataOutRptTab->displaySourceEnergyEndUseSummary) { + if (ort->displaySourceEnergyEndUseSummary) { // show the headers of the report WriteReportHeaders(state, "Source Energy End Use Components Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // show the number of hours that the table applies to - WriteTextLine(state, "Values gathered over " + RealToStr(state.dataOutRptTab->gatherElapsedTimeBEPS, 2) + " hours", true); - if (state.dataOutRptTab->gatherElapsedTimeBEPS < 8759.0) { // might not add up to 8760 exactly but can't be more than 1 hour diff. + WriteTextLine(state, "Values gathered over " + RealToStr(ort->gatherElapsedTimeBEPS, 2) + " hours", true); + if (ort->gatherElapsedTimeBEPS < 8759.0) { // might not add up to 8760 exactly but can't be more than 1 hour diff. WriteTextLine(state, "WARNING: THE REPORT DOES NOT REPRESENT A FULL ANNUAL SIMULATION.", true); } WriteTextLine(state, "", true); @@ -8592,40 +8624,40 @@ namespace EnergyPlus::OutputReportTabular { DetermineBuildingFloorArea(state); // collapse the gatherEndUseBEPS array to the resource groups displayed for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - collapsedEndUse(1, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(1, jEndUse); // electricity - collapsedEndUse(2, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(2, jEndUse); // natural gas - collapsedEndUse(3, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(6, jEndUse); // gasoline - collapsedEndUse(4, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(8, jEndUse); // diesel - collapsedEndUse(5, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(9, jEndUse); // coal - collapsedEndUse(6, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(10, jEndUse); // Fuel Oil No1 - collapsedEndUse(7, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(11, jEndUse); // Fuel Oil No2 - collapsedEndUse(8, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(12, jEndUse); // propane - collapsedEndUse(9, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(13, jEndUse); // otherfuel1 - collapsedEndUse(10, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(14, jEndUse); // otherfuel2 - collapsedEndUse(11, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(3, jEndUse); // district cooling <- purchased cooling + collapsedEndUse(1, jEndUse) = ort->gatherEndUseBySourceBEPS(1, jEndUse); // electricity + collapsedEndUse(2, jEndUse) = ort->gatherEndUseBySourceBEPS(2, jEndUse); // natural gas + collapsedEndUse(3, jEndUse) = ort->gatherEndUseBySourceBEPS(6, jEndUse); // gasoline + collapsedEndUse(4, jEndUse) = ort->gatherEndUseBySourceBEPS(8, jEndUse); // diesel + collapsedEndUse(5, jEndUse) = ort->gatherEndUseBySourceBEPS(9, jEndUse); // coal + collapsedEndUse(6, jEndUse) = ort->gatherEndUseBySourceBEPS(10, jEndUse); // Fuel Oil No1 + collapsedEndUse(7, jEndUse) = ort->gatherEndUseBySourceBEPS(11, jEndUse); // Fuel Oil No2 + collapsedEndUse(8, jEndUse) = ort->gatherEndUseBySourceBEPS(12, jEndUse); // propane + collapsedEndUse(9, jEndUse) = ort->gatherEndUseBySourceBEPS(13, jEndUse); // otherfuel1 + collapsedEndUse(10, jEndUse) = ort->gatherEndUseBySourceBEPS(14, jEndUse); // otherfuel2 + collapsedEndUse(11, jEndUse) = ort->gatherEndUseBySourceBEPS(3, jEndUse); // district cooling <- purchased cooling collapsedEndUse(12, jEndUse) = - state.dataOutRptTab->gatherEndUseBySourceBEPS(4, jEndUse) + state.dataOutRptTab->gatherEndUseBySourceBEPS(5, jEndUse); // district heating <- purchased heating | <- steam - collapsedEndUse(13, jEndUse) = state.dataOutRptTab->gatherEndUseBySourceBEPS(7, jEndUse); // water + ort->gatherEndUseBySourceBEPS(4, jEndUse) + ort->gatherEndUseBySourceBEPS(5, jEndUse); // district heating <- purchased heating | <- steam + collapsedEndUse(13, jEndUse) = ort->gatherEndUseBySourceBEPS(7, jEndUse); // water } // repeat with totals - collapsedTotal(1) = state.dataOutRptTab->gatherTotalsBySourceBEPS(1); // electricity - collapsedTotal(2) = state.dataOutRptTab->gatherTotalsBySourceBEPS(2); // natural gas - collapsedTotal(3) = state.dataOutRptTab->gatherTotalsBySourceBEPS(6); // gasoline - collapsedTotal(4) = state.dataOutRptTab->gatherTotalsBySourceBEPS(8); // diesel - collapsedTotal(5) = state.dataOutRptTab->gatherTotalsBySourceBEPS(9); // coal - collapsedTotal(6) = state.dataOutRptTab->gatherTotalsBySourceBEPS(10); // Fuel Oil No1 - collapsedTotal(7) = state.dataOutRptTab->gatherTotalsBySourceBEPS(11); // Fuel Oil No2 - collapsedTotal(8) = state.dataOutRptTab->gatherTotalsBySourceBEPS(12); // propane - collapsedTotal(9) = state.dataOutRptTab->gatherTotalsBySourceBEPS(13); // otherfuel1 - collapsedTotal(10) = state.dataOutRptTab->gatherTotalsBySourceBEPS(14); // otherfuel2 - collapsedTotal(11) = state.dataOutRptTab->gatherTotalsBySourceBEPS(3); // district cooling <- purchased cooling - collapsedTotal(12) = state.dataOutRptTab->gatherTotalsBySourceBEPS(4) + state.dataOutRptTab->gatherTotalsBySourceBEPS(5); // district heating <- purchased heating | <- steam - collapsedTotal(13) = state.dataOutRptTab->gatherTotalsBySourceBEPS(7); // water + collapsedTotal(1) = ort->gatherTotalsBySourceBEPS(1); // electricity + collapsedTotal(2) = ort->gatherTotalsBySourceBEPS(2); // natural gas + collapsedTotal(3) = ort->gatherTotalsBySourceBEPS(6); // gasoline + collapsedTotal(4) = ort->gatherTotalsBySourceBEPS(8); // diesel + collapsedTotal(5) = ort->gatherTotalsBySourceBEPS(9); // coal + collapsedTotal(6) = ort->gatherTotalsBySourceBEPS(10); // Fuel Oil No1 + collapsedTotal(7) = ort->gatherTotalsBySourceBEPS(11); // Fuel Oil No2 + collapsedTotal(8) = ort->gatherTotalsBySourceBEPS(12); // propane + collapsedTotal(9) = ort->gatherTotalsBySourceBEPS(13); // otherfuel1 + collapsedTotal(10) = ort->gatherTotalsBySourceBEPS(14); // otherfuel2 + collapsedTotal(11) = ort->gatherTotalsBySourceBEPS(3); // district cooling <- purchased cooling + collapsedTotal(12) = ort->gatherTotalsBySourceBEPS(4) + ort->gatherTotalsBySourceBEPS(5); // district heating <- purchased heating | <- steam + collapsedTotal(13) = ort->gatherTotalsBySourceBEPS(7); // water // unit conversion - all values are used as divisors { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { largeConversionFactor = 3600000.0; areaConversionFactor = 1.0; @@ -8690,7 +8722,7 @@ namespace EnergyPlus::OutputReportTabular { largeConversionFactor = 1.0; { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Source Electricity [kWh]"; columnHead(2) = "Source Natural Gas [kWh]"; @@ -8767,7 +8799,7 @@ namespace EnergyPlus::OutputReportTabular { // Normalized by Area tables { - auto const SELECT_CASE_var(state.dataOutRptTab->unitsStyle); + auto const SELECT_CASE_var(ort->unitsStyle); if (SELECT_CASE_var == iUnitsStyle::JtoKWH) { columnHead(1) = "Source Electricity [kWh/m2]"; columnHead(2) = "Source Natural Gas [kWh/m2]"; @@ -8814,7 +8846,7 @@ namespace EnergyPlus::OutputReportTabular { { tableBody = ""; // convert floor area - Real64 convBldgCondFloorArea = state.dataOutRptTab->buildingConditionedFloorArea / areaConversionFactor; + Real64 convBldgCondFloorArea = ort->buildingConditionedFloorArea / areaConversionFactor; if (convBldgCondFloorArea > 0) { for (iResource = 1; iResource <= 12; ++iResource) { for (size_t jEndUse = 1; jEndUse <= 14; ++jEndUse) { @@ -8851,7 +8883,7 @@ namespace EnergyPlus::OutputReportTabular { //---- Normalized by Total Area Sub-Table { tableBody = ""; - Real64 convBldgGrossFloorArea = state.dataOutRptTab->buildingGrossFloorArea / areaConversionFactor; + Real64 convBldgGrossFloorArea = ort->buildingGrossFloorArea / areaConversionFactor; if (convBldgGrossFloorArea > 0) { for (iResource = 1; iResource <= 12; ++iResource) { @@ -8931,41 +8963,42 @@ namespace EnergyPlus::OutputReportTabular { Real64 unconvert; std::string subCatName; + auto &ort(state.dataOutRptTab); - if (state.dataOutRptTab->displayDemandEndUse) { + if (ort->displayDemandEndUse) { // show the headers of the report WriteReportHeaders(state, "Demand End Use Components Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // totals - select which additional fuel to display and which other district heating collapsedTotal = 0.0; - collapsedTotal(1) = state.dataOutRptTab->gatherDemandTotal(1); // electricity - collapsedTimeStep(1) = state.dataOutRptTab->gatherDemandTimeStamp(1); - collapsedTotal(2) = state.dataOutRptTab->gatherDemandTotal(2); // natural gas - collapsedTimeStep(2) = state.dataOutRptTab->gatherDemandTimeStamp(2); - collapsedTotal(3) = state.dataOutRptTab->gatherDemandTotal(6); // gasoline - collapsedTimeStep(3) = state.dataOutRptTab->gatherDemandTimeStamp(6); - collapsedTotal(4) = state.dataOutRptTab->gatherDemandTotal(8); // diesel - collapsedTimeStep(4) = state.dataOutRptTab->gatherDemandTimeStamp(8); - collapsedTotal(5) = state.dataOutRptTab->gatherDemandTotal(9); // coal - collapsedTimeStep(5) = state.dataOutRptTab->gatherDemandTimeStamp(9); - collapsedTotal(6) = state.dataOutRptTab->gatherDemandTotal(10); // fuel oil no 1 - collapsedTimeStep(6) = state.dataOutRptTab->gatherDemandTimeStamp(10); - collapsedTotal(7) = state.dataOutRptTab->gatherDemandTotal(11); // fuel oil no 2 - collapsedTimeStep(7) = state.dataOutRptTab->gatherDemandTimeStamp(11); - collapsedTotal(8) = state.dataOutRptTab->gatherDemandTotal(12); // propane - collapsedTimeStep(8) = state.dataOutRptTab->gatherDemandTimeStamp(12); - collapsedTotal(9) = state.dataOutRptTab->gatherDemandTotal(13); // other fuel 1 - collapsedTimeStep(9) = state.dataOutRptTab->gatherDemandTimeStamp(13); - collapsedTotal(10) = state.dataOutRptTab->gatherDemandTotal(14); // other fuel 2 - collapsedTimeStep(10) = state.dataOutRptTab->gatherDemandTimeStamp(14); - collapsedTotal(11) = state.dataOutRptTab->gatherDemandTotal(3); // district cooling <- purchased cooling - collapsedTimeStep(11) = state.dataOutRptTab->gatherDemandTimeStamp(3); - collapsedTotal(13) = state.dataOutRptTab->gatherDemandTotal(7); // water - collapsedTimeStep(13) = state.dataOutRptTab->gatherDemandTimeStamp(7); + collapsedTotal(1) = ort->gatherDemandTotal(1); // electricity + collapsedTimeStep(1) = ort->gatherDemandTimeStamp(1); + collapsedTotal(2) = ort->gatherDemandTotal(2); // natural gas + collapsedTimeStep(2) = ort->gatherDemandTimeStamp(2); + collapsedTotal(3) = ort->gatherDemandTotal(6); // gasoline + collapsedTimeStep(3) = ort->gatherDemandTimeStamp(6); + collapsedTotal(4) = ort->gatherDemandTotal(8); // diesel + collapsedTimeStep(4) = ort->gatherDemandTimeStamp(8); + collapsedTotal(5) = ort->gatherDemandTotal(9); // coal + collapsedTimeStep(5) = ort->gatherDemandTimeStamp(9); + collapsedTotal(6) = ort->gatherDemandTotal(10); // fuel oil no 1 + collapsedTimeStep(6) = ort->gatherDemandTimeStamp(10); + collapsedTotal(7) = ort->gatherDemandTotal(11); // fuel oil no 2 + collapsedTimeStep(7) = ort->gatherDemandTimeStamp(11); + collapsedTotal(8) = ort->gatherDemandTotal(12); // propane + collapsedTimeStep(8) = ort->gatherDemandTimeStamp(12); + collapsedTotal(9) = ort->gatherDemandTotal(13); // other fuel 1 + collapsedTimeStep(9) = ort->gatherDemandTimeStamp(13); + collapsedTotal(10) = ort->gatherDemandTotal(14); // other fuel 2 + collapsedTimeStep(10) = ort->gatherDemandTimeStamp(14); + collapsedTotal(11) = ort->gatherDemandTotal(3); // district cooling <- purchased cooling + collapsedTimeStep(11) = ort->gatherDemandTimeStamp(3); + collapsedTotal(13) = ort->gatherDemandTotal(7); // water + collapsedTimeStep(13) = ort->gatherDemandTimeStamp(7); // set flag if both puchased heating and steam both have positive demand - bothDistrHeatNonZero = (state.dataOutRptTab->gatherDemandTotal(4) > 0.0) && (state.dataOutRptTab->gatherDemandTotal(5) > 0.0); + bothDistrHeatNonZero = (ort->gatherDemandTotal(4) > 0.0) && (ort->gatherDemandTotal(5) > 0.0); // select the district heating source that has a larger demand - if (state.dataOutRptTab->gatherDemandTotal(4) > state.dataOutRptTab->gatherDemandTotal(5)) { + if (ort->gatherDemandTotal(4) > ort->gatherDemandTotal(5)) { distrHeatSelected = 4; // purchased heating if (bothDistrHeatNonZero) { footnote += " Steam has non-zero demand but is not shown on this report."; @@ -8977,11 +9010,11 @@ namespace EnergyPlus::OutputReportTabular { } } // set the time of peak demand and total demand for the purchased heating/steam - collapsedTimeStep(12) = state.dataOutRptTab->gatherDemandTimeStamp(distrHeatSelected); - collapsedTotal(12) = state.dataOutRptTab->gatherDemandTotal(distrHeatSelected); + collapsedTimeStep(12) = ort->gatherDemandTimeStamp(distrHeatSelected); + collapsedTotal(12) = ort->gatherDemandTotal(distrHeatSelected); // establish unit conversion factors - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { powerConversion = getSpecificUnitMultiplier(state, "W", "kBtuh"); flowConversion = getSpecificUnitMultiplier(state, "m3/s", "gal/min"); } else { @@ -8992,36 +9025,36 @@ namespace EnergyPlus::OutputReportTabular { // collapse the gatherEndUseBEPS array to the resource groups displayed collapsedEndUse = 0.0; for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - collapsedEndUse(1, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(1, jEndUse) * powerConversion; // electricity - collapsedEndUse(2, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(2, jEndUse) * powerConversion; // natural gas - collapsedEndUse(3, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(6, jEndUse) * powerConversion; // gasoline - collapsedEndUse(4, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(8, jEndUse) * powerConversion; // diesel - collapsedEndUse(5, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(9, jEndUse) * powerConversion; // coal - collapsedEndUse(6, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(10, jEndUse) * powerConversion; // fuel oil no 1 - collapsedEndUse(7, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(11, jEndUse) * powerConversion; // fuel oil no 2 - collapsedEndUse(8, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(12, jEndUse) * powerConversion; // propane - collapsedEndUse(9, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(13, jEndUse) * powerConversion; // otherfuel1 - collapsedEndUse(10, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(14, jEndUse) * powerConversion; // otherfuel2 - collapsedEndUse(11, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(3, jEndUse) * powerConversion; // purchased cooling - collapsedEndUse(12, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(distrHeatSelected, jEndUse) * powerConversion; // district heating - collapsedEndUse(13, jEndUse) = state.dataOutRptTab->gatherDemandEndUse(7, jEndUse) * flowConversion; // water + collapsedEndUse(1, jEndUse) = ort->gatherDemandEndUse(1, jEndUse) * powerConversion; // electricity + collapsedEndUse(2, jEndUse) = ort->gatherDemandEndUse(2, jEndUse) * powerConversion; // natural gas + collapsedEndUse(3, jEndUse) = ort->gatherDemandEndUse(6, jEndUse) * powerConversion; // gasoline + collapsedEndUse(4, jEndUse) = ort->gatherDemandEndUse(8, jEndUse) * powerConversion; // diesel + collapsedEndUse(5, jEndUse) = ort->gatherDemandEndUse(9, jEndUse) * powerConversion; // coal + collapsedEndUse(6, jEndUse) = ort->gatherDemandEndUse(10, jEndUse) * powerConversion; // fuel oil no 1 + collapsedEndUse(7, jEndUse) = ort->gatherDemandEndUse(11, jEndUse) * powerConversion; // fuel oil no 2 + collapsedEndUse(8, jEndUse) = ort->gatherDemandEndUse(12, jEndUse) * powerConversion; // propane + collapsedEndUse(9, jEndUse) = ort->gatherDemandEndUse(13, jEndUse) * powerConversion; // otherfuel1 + collapsedEndUse(10, jEndUse) = ort->gatherDemandEndUse(14, jEndUse) * powerConversion; // otherfuel2 + collapsedEndUse(11, jEndUse) = ort->gatherDemandEndUse(3, jEndUse) * powerConversion; // purchased cooling + collapsedEndUse(12, jEndUse) = ort->gatherDemandEndUse(distrHeatSelected, jEndUse) * powerConversion; // district heating + collapsedEndUse(13, jEndUse) = ort->gatherDemandEndUse(7, jEndUse) * flowConversion; // water } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - collapsedEndUseSub(kEndUseSub, jEndUse, 1) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 1) * powerConversion; // electricity - collapsedEndUseSub(kEndUseSub, jEndUse, 2) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 2) * powerConversion; // natural gas - collapsedEndUseSub(kEndUseSub, jEndUse, 3) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 6) * powerConversion; // gasoline - collapsedEndUseSub(kEndUseSub, jEndUse, 4) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 8) * powerConversion; // diesel - collapsedEndUseSub(kEndUseSub, jEndUse, 5) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 9) * powerConversion; // coal - collapsedEndUseSub(kEndUseSub, jEndUse, 6) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 10) * powerConversion; // fuel oil no 1 - collapsedEndUseSub(kEndUseSub, jEndUse, 7) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 11) * powerConversion; // fuel oil no 2 - collapsedEndUseSub(kEndUseSub, jEndUse, 8) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 12) * powerConversion; // propane - collapsedEndUseSub(kEndUseSub, jEndUse, 9) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 13) * powerConversion; // otherfuel1 - collapsedEndUseSub(kEndUseSub, jEndUse, 10) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 14) * powerConversion; // otherfuel2 - collapsedEndUseSub(kEndUseSub, jEndUse, 11) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 3) * powerConversion; // purch cooling + collapsedEndUseSub(kEndUseSub, jEndUse, 1) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 1) * powerConversion; // electricity + collapsedEndUseSub(kEndUseSub, jEndUse, 2) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 2) * powerConversion; // natural gas + collapsedEndUseSub(kEndUseSub, jEndUse, 3) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 6) * powerConversion; // gasoline + collapsedEndUseSub(kEndUseSub, jEndUse, 4) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 8) * powerConversion; // diesel + collapsedEndUseSub(kEndUseSub, jEndUse, 5) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 9) * powerConversion; // coal + collapsedEndUseSub(kEndUseSub, jEndUse, 6) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 10) * powerConversion; // fuel oil no 1 + collapsedEndUseSub(kEndUseSub, jEndUse, 7) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 11) * powerConversion; // fuel oil no 2 + collapsedEndUseSub(kEndUseSub, jEndUse, 8) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 12) * powerConversion; // propane + collapsedEndUseSub(kEndUseSub, jEndUse, 9) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 13) * powerConversion; // otherfuel1 + collapsedEndUseSub(kEndUseSub, jEndUse, 10) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 14) * powerConversion; // otherfuel2 + collapsedEndUseSub(kEndUseSub, jEndUse, 11) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 3) * powerConversion; // purch cooling collapsedEndUseSub(kEndUseSub, jEndUse, 12) = - state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, distrHeatSelected) * powerConversion; // district heating - collapsedEndUseSub(kEndUseSub, jEndUse, 13) = state.dataOutRptTab->gatherDemandEndUseSub(kEndUseSub, jEndUse, 7) * flowConversion; // water + ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, distrHeatSelected) * powerConversion; // district heating + collapsedEndUseSub(kEndUseSub, jEndUse, 13) = ort->gatherDemandEndUseSub(kEndUseSub, jEndUse, 7) * flowConversion; // water } } // collapse the individual peaks for the end use subcategories for the LEED report @@ -9029,36 +9062,36 @@ namespace EnergyPlus::OutputReportTabular { // no unit conversion, it is done at the reporting stage if necessary collapsedIndEndUse = 0.0; for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - collapsedIndEndUse(1, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(1, jEndUse); // electricity - collapsedIndEndUse(2, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(2, jEndUse); // natural gas - collapsedIndEndUse(3, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(6, jEndUse); // gasoline - collapsedIndEndUse(4, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(8, jEndUse); // diesel - collapsedIndEndUse(5, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(9, jEndUse); // coal - collapsedIndEndUse(6, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(10, jEndUse); // fuel oil no 1 - collapsedIndEndUse(7, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(11, jEndUse); // fuel oil no 2 - collapsedIndEndUse(8, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(12, jEndUse); // propane - collapsedIndEndUse(9, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(13, jEndUse); // otherfuel1 - collapsedIndEndUse(10, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(14, jEndUse); // otherfuel2 - collapsedIndEndUse(11, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(3, jEndUse); // purchased cooling - collapsedIndEndUse(12, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(distrHeatSelected, jEndUse); // district heating - collapsedIndEndUse(13, jEndUse) = state.dataOutRptTab->gatherDemandIndEndUse(7, jEndUse); // water + collapsedIndEndUse(1, jEndUse) = ort->gatherDemandIndEndUse(1, jEndUse); // electricity + collapsedIndEndUse(2, jEndUse) = ort->gatherDemandIndEndUse(2, jEndUse); // natural gas + collapsedIndEndUse(3, jEndUse) = ort->gatherDemandIndEndUse(6, jEndUse); // gasoline + collapsedIndEndUse(4, jEndUse) = ort->gatherDemandIndEndUse(8, jEndUse); // diesel + collapsedIndEndUse(5, jEndUse) = ort->gatherDemandIndEndUse(9, jEndUse); // coal + collapsedIndEndUse(6, jEndUse) = ort->gatherDemandIndEndUse(10, jEndUse); // fuel oil no 1 + collapsedIndEndUse(7, jEndUse) = ort->gatherDemandIndEndUse(11, jEndUse); // fuel oil no 2 + collapsedIndEndUse(8, jEndUse) = ort->gatherDemandIndEndUse(12, jEndUse); // propane + collapsedIndEndUse(9, jEndUse) = ort->gatherDemandIndEndUse(13, jEndUse); // otherfuel1 + collapsedIndEndUse(10, jEndUse) = ort->gatherDemandIndEndUse(14, jEndUse); // otherfuel2 + collapsedIndEndUse(11, jEndUse) = ort->gatherDemandIndEndUse(3, jEndUse); // purchased cooling + collapsedIndEndUse(12, jEndUse) = ort->gatherDemandIndEndUse(distrHeatSelected, jEndUse); // district heating + collapsedIndEndUse(13, jEndUse) = ort->gatherDemandIndEndUse(7, jEndUse); // water } for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { for (kEndUseSub = 1; kEndUseSub <= state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { - collapsedIndEndUseSub(kEndUseSub, jEndUse, 1) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 1); // electricity - collapsedIndEndUseSub(kEndUseSub, jEndUse, 2) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 2); // natural gas - collapsedIndEndUseSub(kEndUseSub, jEndUse, 3) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 6); // gasoline - collapsedIndEndUseSub(kEndUseSub, jEndUse, 4) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 8); // diesel - collapsedIndEndUseSub(kEndUseSub, jEndUse, 5) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 9); // coal - collapsedIndEndUseSub(kEndUseSub, jEndUse, 6) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 10); // fuel oil no 1 - collapsedIndEndUseSub(kEndUseSub, jEndUse, 7) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 11); // fuel oil no 2 - collapsedIndEndUseSub(kEndUseSub, jEndUse, 8) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 12); // propane - collapsedIndEndUseSub(kEndUseSub, jEndUse, 9) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 13); // otherfuel1 - collapsedIndEndUseSub(kEndUseSub, jEndUse, 10) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 14); // otherfuel2 - collapsedIndEndUseSub(kEndUseSub, jEndUse, 11) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 3); // purch cooling + collapsedIndEndUseSub(kEndUseSub, jEndUse, 1) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 1); // electricity + collapsedIndEndUseSub(kEndUseSub, jEndUse, 2) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 2); // natural gas + collapsedIndEndUseSub(kEndUseSub, jEndUse, 3) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 6); // gasoline + collapsedIndEndUseSub(kEndUseSub, jEndUse, 4) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 8); // diesel + collapsedIndEndUseSub(kEndUseSub, jEndUse, 5) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 9); // coal + collapsedIndEndUseSub(kEndUseSub, jEndUse, 6) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 10); // fuel oil no 1 + collapsedIndEndUseSub(kEndUseSub, jEndUse, 7) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 11); // fuel oil no 2 + collapsedIndEndUseSub(kEndUseSub, jEndUse, 8) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 12); // propane + collapsedIndEndUseSub(kEndUseSub, jEndUse, 9) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 13); // otherfuel1 + collapsedIndEndUseSub(kEndUseSub, jEndUse, 10) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 14); // otherfuel2 + collapsedIndEndUseSub(kEndUseSub, jEndUse, 11) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 3); // purch cooling collapsedIndEndUseSub(kEndUseSub, jEndUse, 12) = - state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, distrHeatSelected); // district heating - collapsedIndEndUseSub(kEndUseSub, jEndUse, 13) = state.dataOutRptTab->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 7); // water + ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, distrHeatSelected); // district heating + collapsedIndEndUseSub(kEndUseSub, jEndUse, 13) = ort->gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 7); // water } } @@ -9118,7 +9151,7 @@ namespace EnergyPlus::OutputReportTabular { rowHead(16) = ""; rowHead(17) = "Total End Uses"; - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { columnHead(1) = "Electricity [kBtuh]"; columnHead(2) = "Natural Gas [kBtuh]"; columnHead(3) = "Gasoline [kBtuh]"; @@ -9221,7 +9254,7 @@ namespace EnergyPlus::OutputReportTabular { } } - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { columnHead(1) = "Subcategory"; columnHead(2) = "Electricity [kBtuh]"; columnHead(3) = "Natural Gas [kBtuh]"; @@ -9314,7 +9347,7 @@ namespace EnergyPlus::OutputReportTabular { // EAp2-4/5. Performance Rating Method Compliance for (iResource = 1; iResource <= 13; ++iResource) { for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { - if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { + if (ort->needOtherRowLEED45(jEndUse)) { if (state.dataOutputProcessor->EndUseCategory(jEndUse).NumSubcategories == 0) { endUseSubOther(iResource, jEndUse) = collapsedIndEndUse(iResource, jEndUse); // often the case that no subcategories are defined @@ -9358,7 +9391,7 @@ namespace EnergyPlus::OutputReportTabular { ++i; } // put other - if (state.dataOutRptTab->needOtherRowLEED45(jEndUse)) { + if (ort->needOtherRowLEED45(jEndUse)) { PreDefTableEntry(state, resource_entry_map(iResource), state.dataOutputProcessor->EndUseCategory(jEndUse).DisplayName + " -- Other", endUseSubOther(iResource, jEndUse)); ++i; @@ -9428,12 +9461,14 @@ namespace EnergyPlus::OutputReportTabular { Real64 IPsingleValue; Real64 IPvaluePer; + auto &ort(state.dataOutRptTab); + if (!state.dataCostEstimateManager->DoCostEstimate) return; WriteReportHeaders(state, "Component Cost Economics Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // compute floor area if no ABUPS - if (state.dataOutRptTab->buildingConditionedFloorArea == 0.0) { + if (ort->buildingConditionedFloorArea == 0.0) { DetermineBuildingFloorArea(state); } @@ -9457,7 +9492,7 @@ namespace EnergyPlus::OutputReportTabular { rowHead(7) = "Permits, Bonds, Insurance (~~$~~)"; rowHead(8) = "Commissioning (~~$~~)"; rowHead(9) = "Cost Estimate Total (~~$~~)"; - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { SIunit = "[m2]"; LookupSItoIP(state, SIunit, unitConvIndex, m2_unitName); m2_unitConv = ConvertIP(state, unitConvIndex, 1.0); @@ -9471,12 +9506,12 @@ namespace EnergyPlus::OutputReportTabular { TableBodyData(1, 1) = state.dataCostEstimateManager->RefrncBldg.LineItemTot; tableBody(1, 1) = RealToStr(TableBodyData(1, 1), 2); - TableBodyData(1, 2) = state.dataCostEstimateManager->RefrncBldg.MiscCostperSqMeter * state.dataOutRptTab->buildingConditionedFloorArea; + TableBodyData(1, 2) = state.dataCostEstimateManager->RefrncBldg.MiscCostperSqMeter * ort->buildingConditionedFloorArea; tableBody(1, 2) = RealToStr(TableBodyData(1, 2), 2); if (state.dataCostEstimateManager->RefrncBldg.RegionalModifier != 1.0) { TableBodyData(1, 3) = - (state.dataCostEstimateManager->RefrncBldg.LineItemTot + state.dataCostEstimateManager->RefrncBldg.MiscCostperSqMeter * state.dataOutRptTab->buildingConditionedFloorArea) * (state.dataCostEstimateManager->RefrncBldg.RegionalModifier - 1.0); + (state.dataCostEstimateManager->RefrncBldg.LineItemTot + state.dataCostEstimateManager->RefrncBldg.MiscCostperSqMeter * ort->buildingConditionedFloorArea) * (state.dataCostEstimateManager->RefrncBldg.RegionalModifier - 1.0); } else { TableBodyData(1, 3) = 0.0; } @@ -9497,18 +9532,18 @@ namespace EnergyPlus::OutputReportTabular { state.dataCostEstimateManager->RefrncBldg.GrandTotal = sum(TableBodyData(1, {1, 8})); TableBodyData(1, 9) = state.dataCostEstimateManager->RefrncBldg.GrandTotal; tableBody(1, 9) = RealToStr(TableBodyData(1, 9), 2); - if (state.dataOutRptTab->buildingConditionedFloorArea > 0.0) { - TableBodyData(1, 10) = TableBodyData(1, 9) / (state.dataOutRptTab->buildingConditionedFloorArea * m2_unitConv); + if (ort->buildingConditionedFloorArea > 0.0) { + TableBodyData(1, 10) = TableBodyData(1, 9) / (ort->buildingConditionedFloorArea * m2_unitConv); } tableBody(1, 10) = RealToStr(TableBodyData(1, 10), 2); TableBodyData(2, 1) = state.dataCostEstimateManager->CurntBldg.LineItemTot; tableBody(2, 1) = RealToStr(TableBodyData(2, 1), 2); - TableBodyData(2, 2) = state.dataCostEstimateManager->CurntBldg.MiscCostperSqMeter * state.dataOutRptTab->buildingConditionedFloorArea; + TableBodyData(2, 2) = state.dataCostEstimateManager->CurntBldg.MiscCostperSqMeter * ort->buildingConditionedFloorArea; tableBody(2, 2) = RealToStr(TableBodyData(2, 2), 2); if (state.dataCostEstimateManager->CurntBldg.RegionalModifier != 1.0) { TableBodyData(2, 3) = - (state.dataCostEstimateManager->CurntBldg.LineItemTot + state.dataCostEstimateManager->CurntBldg.MiscCostperSqMeter * state.dataOutRptTab->buildingConditionedFloorArea) * (state.dataCostEstimateManager->CurntBldg.RegionalModifier - 1.0); + (state.dataCostEstimateManager->CurntBldg.LineItemTot + state.dataCostEstimateManager->CurntBldg.MiscCostperSqMeter * ort->buildingConditionedFloorArea) * (state.dataCostEstimateManager->CurntBldg.RegionalModifier - 1.0); } else { TableBodyData(2, 3) = 0.0; } @@ -9531,8 +9566,8 @@ namespace EnergyPlus::OutputReportTabular { state.dataCostEstimateManager->CurntBldg.GrandTotal = sum(TableBodyData(2, {1, 8})); TableBodyData(2, 9) = state.dataCostEstimateManager->CurntBldg.GrandTotal; tableBody(2, 9) = RealToStr(TableBodyData(2, 9), 2); - if (state.dataOutRptTab->buildingConditionedFloorArea > 0) { - TableBodyData(2, 10) = TableBodyData(2, 9) / (state.dataOutRptTab->buildingConditionedFloorArea * m2_unitConv); + if (ort->buildingConditionedFloorArea > 0) { + TableBodyData(2, 10) = TableBodyData(2, 9) / (ort->buildingConditionedFloorArea * m2_unitConv); } tableBody(2, 10) = RealToStr(TableBodyData(2, 10), 2); @@ -9581,7 +9616,7 @@ namespace EnergyPlus::OutputReportTabular { for (item = 1; item <= state.dataCostEstimateManager->NumLineItems; ++item) { tableBody(1, item) = fmt::to_string(state.dataCostEstimateManager->CostLineItem(item).LineNumber); tableBody(2, item) = state.dataCostEstimateManager->CostLineItem(item).LineName; - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, state.dataCostEstimateManager->CostLineItem(item).Units, unitConvIndex, IPunitName); if (unitConvIndex != 0) { IPqty = ConvertIP(state, unitConvIndex, state.dataCostEstimateManager->CostLineItem(item).Qty); @@ -9800,14 +9835,15 @@ namespace EnergyPlus::OutputReportTabular { Array1D zoneGlassArea; zoneGlassArea.allocate(state.dataGlobal->NumOfZones); zoneGlassArea = 0.0; + auto &ort(state.dataOutRptTab); // all arrays are in the format: (row, columnm) - if (state.dataOutRptTab->displayTabularVeriSum) { + if (ort->displayTabularVeriSum) { // show the headers of the report WriteReportHeaders(state, "Input Verification and Results Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // do unit conversions if necessary - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { SIunit = "[m]"; LookupSItoIP(state, SIunit, unitConvIndex, m_unitName); m_unitConv = ConvertIP(state, unitConvIndex, 1.0); @@ -9864,7 +9900,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody(1, 7) = RealToStr(state.dataEnvrn->TimeZoneNumber, 2); // Time Zone tableBody(1, 8) = RealToStr(BuildingAzimuth, 2); // north axis angle tableBody(1, 9) = RealToStr(BuildingRotationAppendixG, 2); // Rotation for Appendix G - tableBody(1, 10) = RealToStr(state.dataOutRptTab->gatherElapsedTimeBEPS, 2); // hours simulated + tableBody(1, 10) = RealToStr(ort->gatherElapsedTimeBEPS, 2); // hours simulated // tableBody(9,1) = TRIM(fmt::to_string(state.dataOutRptPredefined->numTableEntry)) !number of table entries for predefined tables WriteSubtitle(state, "General"); @@ -10502,21 +10538,22 @@ namespace EnergyPlus::OutputReportTabular { Array2D_string tableBody; int i; Array1D_int peopleInd; // Index the relevant people + auto &ort(state.dataOutRptTab); // Should deallocate after writing table. - LKL - if (state.dataOutRptTab->displayAdaptiveComfort && TotPeople > 0) { + if (ort->displayAdaptiveComfort && TotPeople > 0) { peopleInd.allocate(TotPeople); for (i = 1; i <= TotPeople; ++i) { if (People(i).AdaptiveASH55 || People(i).AdaptiveCEN15251) { - ++state.dataOutRptTab->numPeopleAdaptive; - peopleInd(state.dataOutRptTab->numPeopleAdaptive) = i; + ++ort->numPeopleAdaptive; + peopleInd(ort->numPeopleAdaptive) = i; } } - rowHead.allocate(state.dataOutRptTab->numPeopleAdaptive); - tableBody.allocate(5, state.dataOutRptTab->numPeopleAdaptive); + rowHead.allocate(ort->numPeopleAdaptive); + tableBody.allocate(5, ort->numPeopleAdaptive); WriteReportHeaders(state, "Adaptive Comfort Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); WriteSubtitle(state, "Time Not Meeting the Adaptive Comfort Models during Occupied Hours"); @@ -10530,7 +10567,7 @@ namespace EnergyPlus::OutputReportTabular { columnHead(5) = "CEN15251 Category III Acceptability Limits [Hours]"; tableBody = ""; - for (i = 1; i <= state.dataOutRptTab->numPeopleAdaptive; ++i) { + for (i = 1; i <= ort->numPeopleAdaptive; ++i) { rowHead(i) = People(i).Name; if (People(i).AdaptiveASH55) { tableBody(1, i) = RealToStr(People(peopleInd(i)).TimeNotMetASH5590, 2); @@ -10626,6 +10663,7 @@ namespace EnergyPlus::OutputReportTabular { using DataHeatBalFanSys::ZoneHumidexOccuHourBins; using DataHeatBalFanSys::ZoneLowSETHours; using DataHeatBalFanSys::ZoneHighSETHours; + auto &ort(state.dataOutRptTab); if (state.dataGlobal->NumOfZones > 0) { int columnNum = 5; @@ -10660,7 +10698,7 @@ namespace EnergyPlus::OutputReportTabular { bool hasPierceSET = true; if (TotPeople == 0) { hasPierceSET = false; - if (state.dataOutRptTab->displayThermalResilienceSummaryExplicitly) { + if (ort->displayThermalResilienceSummaryExplicitly) { ShowWarningError(state, "Writing Annual Thermal Resilience Summary - SET Hours reports: " "Zone Thermal Comfort Pierce Model Standard Effective Temperature is required, " "but no People object is defined."); @@ -10669,7 +10707,7 @@ namespace EnergyPlus::OutputReportTabular { for (int iPeople = 1; iPeople <= TotPeople; ++iPeople) { if (!People(iPeople).Pierce) { hasPierceSET = false; - if (state.dataOutRptTab->displayThermalResilienceSummaryExplicitly) { + if (ort->displayThermalResilienceSummaryExplicitly) { ShowWarningError(state, "Writing Annual Thermal Resilience Summary - SET Hours reports: " "Zone Thermal Comfort Pierce Model Standard Effective Temperature is required, " "but no Pierce model is defined in " + People(iPeople).Name + " object."); @@ -10847,6 +10885,7 @@ namespace EnergyPlus::OutputReportTabular { int columnUnitConv; std::string repTableTag; Real64 IPvalue; + auto &ort(state.dataOutRptTab); // loop through the entries and associate them with the subtable and create // list of unique object names @@ -10938,10 +10977,10 @@ namespace EnergyPlus::OutputReportTabular { ++countColumn; // do the unit conversions colTagWithSI = state.dataOutRptPredefined->columnTag(kColumnTag).heading; - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, colTagWithSI, indexUnitConv, curColTag); colUnitConv(countColumn) = indexUnitConv; - } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { + } else if (ort->unitsStyle == iUnitsStyle::JtoKWH) { LookupJtokWH(state, colTagWithSI, indexUnitConv, curColTag); colUnitConv(countColumn) = indexUnitConv; } else { @@ -10973,10 +11012,10 @@ namespace EnergyPlus::OutputReportTabular { } } // finally assign the entry to the place in the table body - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound || state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { + if (ort->unitsStyle == iUnitsStyle::InchPound || ort->unitsStyle == iUnitsStyle::JtoKWH) { columnUnitConv = colUnitConv(colCurrent); if (UtilityRoutines::SameString(state.dataOutRptPredefined->subTable(jSubTable).name, "SizingPeriod:DesignDay") && - state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + ort->unitsStyle == iUnitsStyle::InchPound) { if (UtilityRoutines::SameString(columnHead(colCurrent), "Humidity Value")) { LookupSItoIP(state, state.dataOutRptPredefined->tableEntry(lTableEntry + 1).charEntry, columnUnitConv, repTableTag); state.dataOutRptPredefined->tableEntry(lTableEntry + 1).charEntry = repTableTag; @@ -11056,8 +11095,9 @@ namespace EnergyPlus::OutputReportTabular { static int indexUnitConv(0); static Real64 curValueSI(0.0); static Real64 curValue(0.0); + auto &ort(state.dataOutRptTab); - if (state.dataOutRptTab->displayComponentSizing) { + if (ort->displayComponentSizing) { WriteReportHeaders(state, "Component Sizing Summary", "Entire Facility", OutputProcessor::StoreType::Averaged); // The arrays that look for unique headers are dimensioned in the // running program since the size of the number of entries is @@ -11148,7 +11188,7 @@ namespace EnergyPlus::OutputReportTabular { for (jUnique = 1; jUnique <= numUniqueDesc; ++jUnique) { // do the unit conversions curColHeadWithSI = uniqueDesc(jUnique); - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, curColHeadWithSI, indexUnitConv, curColHead); colUnitConv(jUnique) = indexUnitConv; } else { @@ -11182,7 +11222,7 @@ namespace EnergyPlus::OutputReportTabular { } if ((foundDesc >= 1) && (foundObj >= 1)) { curValueSI = state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).valField; - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { if (colUnitConv(foundDesc) != 0) { curValue = ConvertIP(state, colUnitConv(foundDesc), curValueSI); } else { @@ -11290,9 +11330,10 @@ namespace EnergyPlus::OutputReportTabular { int numreceivingfields; int HTS; int NGSS; + auto &ort(state.dataOutRptTab); // displaySurfaceShadowing = false for debugging - if (state.dataOutRptTab->displaySurfaceShadowing) { + if (ort->displaySurfaceShadowing) { numreceivingfields = 0; for (HTS = 1; HTS <= TotSurfaces; ++HTS) { numreceivingfields += ShadowComb(HTS).NumGenSurf; @@ -11407,7 +11448,9 @@ namespace EnergyPlus::OutputReportTabular { void WriteEioTables(EnergyPlusData &state) { - if (state.dataOutRptTab->displayEioSummary) { + auto &ort(state.dataOutRptTab); + + if (ort->displayEioSummary) { Array1D_string columnHead; Array1D_int columnWidth; Array1D_string rowHead; @@ -11476,7 +11519,7 @@ namespace EnergyPlus::OutputReportTabular { std::vector dataFields = splitCommaString(bodyLine); rowHead(rowNum) = fmt::to_string(rowNum); for (int iCol = 1; iCol <= numCols && iCol < int(dataFields.size()); ++iCol) { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound || state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { + if (ort->unitsStyle == iUnitsStyle::InchPound || ort->unitsStyle == iUnitsStyle::JtoKWH) { if (isNumber(dataFields[iCol]) && colUnitConv(iCol) > 0) { // if it is a number that has a conversion int numDecimalDigits = digitsAferDecimal(dataFields[iCol]); Real64 convertedVal = ConvertIP(state, colUnitConv(iCol), StrToReal(dataFields[iCol])); @@ -11516,11 +11559,13 @@ namespace EnergyPlus::OutputReportTabular { // Glazer Nov 2016 int unitsFromHeading(EnergyPlusData &state, std::string &heading) { + auto &ort(state.dataOutRptTab); + std::string curHeading = ""; int unitConv = 0; - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + if (ort->unitsStyle == iUnitsStyle::InchPound) { LookupSItoIP(state, heading, unitConv, curHeading); - } else if (state.dataOutRptTab->unitsStyle == iUnitsStyle::JtoKWH) { + } else if (ort->unitsStyle == iUnitsStyle::JtoKWH) { LookupJtokWH(state, heading, unitConv, curHeading); } else { curHeading = heading; @@ -11583,19 +11628,21 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int iZone; + auto &ort(state.dataOutRptTab); + if (state.dataGlobal->CompLoadReportIsReq) { - if (state.dataOutRptTab->displayZoneComponentLoadSummary) { + if (ort->displayZoneComponentLoadSummary) { for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { if (!ZoneEquipConfig(iZone).IsControlled) continue; AddTOCEntry(state, "Zone Component Load Summary", Zone(iZone).Name); } } - if (state.dataOutRptTab->displayAirLoopComponentLoadSummary) { + if (ort->displayAirLoopComponentLoadSummary) { for (int AirLoopNum = 1; AirLoopNum <= DataHVACGlobals::NumPrimaryAirSys; ++AirLoopNum) { AddTOCEntry(state, "AirLoop Component Load Summary", DataSizing::FinalSysSizing(AirLoopNum).AirPriLoopName); } } - if (state.dataOutRptTab->displayFacilityComponentLoadSummary) { + if (ort->displayFacilityComponentLoadSummary) { AddTOCEntry(state, "Facility Component Load Summary", "Facility"); } } @@ -11637,82 +11684,83 @@ namespace EnergyPlus::OutputReportTabular { // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + auto &ort(state.dataOutRptTab); - if (state.dataOutRptTab->AllocateLoadComponentArraysDoAllocate) { + if (ort->AllocateLoadComponentArraysDoAllocate) { // For many of the following arrays the last dimension is the number of environments and is same as sizing arrays - state.dataOutRptTab->radiantPulseTimestep.allocate({0, state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays}, state.dataGlobal->NumOfZones); - state.dataOutRptTab->radiantPulseTimestep = 0; - state.dataOutRptTab->radiantPulseReceived.allocate({0, state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays}, TotSurfaces); - state.dataOutRptTab->radiantPulseReceived = 0.0; - state.dataOutRptTab->loadConvectedNormal.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, {0, state.dataGlobal->NumOfTimeStepInHour * 24}, TotSurfaces); - state.dataOutRptTab->loadConvectedNormal = 0.0; - state.dataOutRptTab->loadConvectedWithPulse.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, {0, state.dataGlobal->NumOfTimeStepInHour * 24}, TotSurfaces); - state.dataOutRptTab->loadConvectedWithPulse = 0.0; - state.dataOutRptTab->netSurfRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - state.dataOutRptTab->netSurfRadSeq = 0.0; - state.dataOutRptTab->decayCurveCool.allocate(state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - state.dataOutRptTab->decayCurveCool = 0.0; - state.dataOutRptTab->decayCurveHeat.allocate(state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - state.dataOutRptTab->decayCurveHeat = 0.0; - state.dataOutRptTab->ITABSFseq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - state.dataOutRptTab->ITABSFseq = 0.0; - state.dataOutRptTab->TMULTseq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->TMULTseq = 0.0; - state.dataOutRptTab->peopleInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->peopleInstantSeq = 0.0; - state.dataOutRptTab->peopleLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->peopleLatentSeq = 0.0; - state.dataOutRptTab->peopleRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->peopleRadSeq = 0.0; - state.dataOutRptTab->lightInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->lightInstantSeq = 0.0; - state.dataOutRptTab->lightRetAirSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->lightRetAirSeq = 0.0; - state.dataOutRptTab->lightLWRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->lightLWRadSeq = 0.0; - state.dataOutRptTab->lightSWRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - state.dataOutRptTab->lightSWRadSeq = 0.0; - state.dataOutRptTab->equipInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->equipInstantSeq = 0.0; - state.dataOutRptTab->equipLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->equipLatentSeq = 0.0; - state.dataOutRptTab->equipRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->equipRadSeq = 0.0; - state.dataOutRptTab->refrigInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->refrigInstantSeq = 0.0; - state.dataOutRptTab->refrigRetAirSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->refrigRetAirSeq = 0.0; - state.dataOutRptTab->refrigLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->refrigLatentSeq = 0.0; - state.dataOutRptTab->waterUseInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->waterUseInstantSeq = 0.0; - state.dataOutRptTab->waterUseLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->waterUseLatentSeq = 0.0; - state.dataOutRptTab->hvacLossInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->hvacLossInstantSeq = 0.0; - state.dataOutRptTab->hvacLossRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->hvacLossRadSeq = 0.0; - state.dataOutRptTab->powerGenInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->powerGenInstantSeq = 0.0; - state.dataOutRptTab->powerGenRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->powerGenRadSeq = 0.0; - state.dataOutRptTab->infilInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->infilInstantSeq = 0.0; - state.dataOutRptTab->infilLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->infilLatentSeq = 0.0; - state.dataOutRptTab->zoneVentInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->zoneVentInstantSeq = 0.0; - state.dataOutRptTab->zoneVentLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->zoneVentLatentSeq = 0.0; - state.dataOutRptTab->interZoneMixInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->interZoneMixInstantSeq = 0.0; - state.dataOutRptTab->interZoneMixLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->interZoneMixLatentSeq = 0.0; - state.dataOutRptTab->feneCondInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); - state.dataOutRptTab->feneCondInstantSeq = 0.0; - state.dataOutRptTab->feneSolarRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); - state.dataOutRptTab->feneSolarRadSeq = 0.0; - state.dataOutRptTab->AllocateLoadComponentArraysDoAllocate = false; + ort->radiantPulseTimestep.allocate({0, state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays}, state.dataGlobal->NumOfZones); + ort->radiantPulseTimestep = 0; + ort->radiantPulseReceived.allocate({0, state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays}, TotSurfaces); + ort->radiantPulseReceived = 0.0; + ort->loadConvectedNormal.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, {0, state.dataGlobal->NumOfTimeStepInHour * 24}, TotSurfaces); + ort->loadConvectedNormal = 0.0; + ort->loadConvectedWithPulse.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, {0, state.dataGlobal->NumOfTimeStepInHour * 24}, TotSurfaces); + ort->loadConvectedWithPulse = 0.0; + ort->netSurfRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + ort->netSurfRadSeq = 0.0; + ort->decayCurveCool.allocate(state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + ort->decayCurveCool = 0.0; + ort->decayCurveHeat.allocate(state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + ort->decayCurveHeat = 0.0; + ort->ITABSFseq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + ort->ITABSFseq = 0.0; + ort->TMULTseq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->TMULTseq = 0.0; + ort->peopleInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->peopleInstantSeq = 0.0; + ort->peopleLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->peopleLatentSeq = 0.0; + ort->peopleRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->peopleRadSeq = 0.0; + ort->lightInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->lightInstantSeq = 0.0; + ort->lightRetAirSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->lightRetAirSeq = 0.0; + ort->lightLWRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->lightLWRadSeq = 0.0; + ort->lightSWRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + ort->lightSWRadSeq = 0.0; + ort->equipInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->equipInstantSeq = 0.0; + ort->equipLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->equipLatentSeq = 0.0; + ort->equipRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->equipRadSeq = 0.0; + ort->refrigInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->refrigInstantSeq = 0.0; + ort->refrigRetAirSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->refrigRetAirSeq = 0.0; + ort->refrigLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->refrigLatentSeq = 0.0; + ort->waterUseInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->waterUseInstantSeq = 0.0; + ort->waterUseLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->waterUseLatentSeq = 0.0; + ort->hvacLossInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->hvacLossInstantSeq = 0.0; + ort->hvacLossRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->hvacLossRadSeq = 0.0; + ort->powerGenInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->powerGenInstantSeq = 0.0; + ort->powerGenRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->powerGenRadSeq = 0.0; + ort->infilInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->infilInstantSeq = 0.0; + ort->infilLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->infilLatentSeq = 0.0; + ort->zoneVentInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->zoneVentInstantSeq = 0.0; + ort->zoneVentLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->zoneVentLatentSeq = 0.0; + ort->interZoneMixInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->interZoneMixInstantSeq = 0.0; + ort->interZoneMixLatentSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->interZoneMixLatentSeq = 0.0; + ort->feneCondInstantSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); + ort->feneCondInstantSeq = 0.0; + ort->feneSolarRadSeq.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, TotSurfaces); + ort->feneSolarRadSeq = 0.0; + ort->AllocateLoadComponentArraysDoAllocate = false; } } @@ -11752,10 +11800,10 @@ namespace EnergyPlus::OutputReportTabular { // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - - state.dataOutRptTab->radiantPulseTimestep.deallocate(); - state.dataOutRptTab->radiantPulseReceived.deallocate(); - state.dataOutRptTab->loadConvectedWithPulse.deallocate(); + auto &ort(state.dataOutRptTab); + ort->radiantPulseTimestep.deallocate(); + ort->radiantPulseReceived.deallocate(); + ort->loadConvectedWithPulse.deallocate(); } void ComputeLoadComponentDecayCurve(EnergyPlusData &state) @@ -11805,6 +11853,7 @@ namespace EnergyPlus::OutputReportTabular { static int HeatDesSelected(0); // design day selected for heating int i; Real64 diff; + auto &ort(state.dataOutRptTab); for (SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { ZoneNum = Surface(SurfNum).Zone; @@ -11813,43 +11862,43 @@ namespace EnergyPlus::OutputReportTabular { CoolDesSelected = CalcFinalZoneSizing(ZoneNum).CoolDDNum; // loop over timesteps after pulse occurred if (CoolDesSelected != 0) { - TimeOfPulse = state.dataOutRptTab->radiantPulseTimestep(CoolDesSelected, ZoneNum); + TimeOfPulse = ort->radiantPulseTimestep(CoolDesSelected, ZoneNum); // if the CoolDesSelected time is on a different day than // when the pulse occurred, need to scan back and find when // the pulse occurred. if (TimeOfPulse == 0) { for (i = CoolDesSelected; i >= 1; --i) { - TimeOfPulse = state.dataOutRptTab->radiantPulseTimestep(i, ZoneNum); + TimeOfPulse = ort->radiantPulseTimestep(i, ZoneNum); if (TimeOfPulse != 0) break; } } if (TimeOfPulse == 0) TimeOfPulse = 1; for (TimeStep = TimeOfPulse; TimeStep <= state.dataGlobal->NumOfTimeStepInHour * 24; ++TimeStep) { - if (state.dataOutRptTab->radiantPulseReceived(CoolDesSelected, SurfNum) != 0.0) { - diff = state.dataOutRptTab->loadConvectedWithPulse(CoolDesSelected, TimeStep, SurfNum) - state.dataOutRptTab->loadConvectedNormal(CoolDesSelected, TimeStep, SurfNum); - state.dataOutRptTab->decayCurveCool(TimeStep - TimeOfPulse + 1, SurfNum) = -diff / state.dataOutRptTab->radiantPulseReceived(CoolDesSelected, SurfNum); + if (ort->radiantPulseReceived(CoolDesSelected, SurfNum) != 0.0) { + diff = ort->loadConvectedWithPulse(CoolDesSelected, TimeStep, SurfNum) - ort->loadConvectedNormal(CoolDesSelected, TimeStep, SurfNum); + ort->decayCurveCool(TimeStep - TimeOfPulse + 1, SurfNum) = -diff / ort->radiantPulseReceived(CoolDesSelected, SurfNum); } else { - state.dataOutRptTab->decayCurveCool(TimeStep - TimeOfPulse + 1, SurfNum) = 0.0; + ort->decayCurveCool(TimeStep - TimeOfPulse + 1, SurfNum) = 0.0; } } } HeatDesSelected = CalcFinalZoneSizing(ZoneNum).HeatDDNum; if (HeatDesSelected != 0) { - TimeOfPulse = state.dataOutRptTab->radiantPulseTimestep(HeatDesSelected, ZoneNum); + TimeOfPulse = ort->radiantPulseTimestep(HeatDesSelected, ZoneNum); // scan back to the day that the heating pulse occurs, if necessary if (TimeOfPulse == 0) { for (i = HeatDesSelected; i >= 1; --i) { - TimeOfPulse = state.dataOutRptTab->radiantPulseTimestep(i, ZoneNum); + TimeOfPulse = ort->radiantPulseTimestep(i, ZoneNum); if (TimeOfPulse != 0) break; } } if (TimeOfPulse == 0) TimeOfPulse = 1; for (TimeStep = TimeOfPulse; TimeStep <= state.dataGlobal->NumOfTimeStepInHour * 24; ++TimeStep) { - if (state.dataOutRptTab->radiantPulseReceived(HeatDesSelected, SurfNum) != 0.0) { - diff = state.dataOutRptTab->loadConvectedWithPulse(HeatDesSelected, TimeStep, SurfNum) - state.dataOutRptTab->loadConvectedNormal(HeatDesSelected, TimeStep, SurfNum); - state.dataOutRptTab->decayCurveHeat(TimeStep - TimeOfPulse + 1, SurfNum) = -diff / state.dataOutRptTab->radiantPulseReceived(HeatDesSelected, SurfNum); + if (ort->radiantPulseReceived(HeatDesSelected, SurfNum) != 0.0) { + diff = ort->loadConvectedWithPulse(HeatDesSelected, TimeStep, SurfNum) - ort->loadConvectedNormal(HeatDesSelected, TimeStep, SurfNum); + ort->decayCurveHeat(TimeStep - TimeOfPulse + 1, SurfNum) = -diff / ort->radiantPulseReceived(HeatDesSelected, SurfNum); } else { - state.dataOutRptTab->decayCurveHeat(TimeStep - TimeOfPulse + 1, SurfNum) = 0.0; + ort->decayCurveHeat(TimeStep - TimeOfPulse + 1, SurfNum) = 0.0; } } } @@ -11869,7 +11918,7 @@ namespace EnergyPlus::OutputReportTabular { if (Surface(kSurf).Zone != iZone) continue; print(state.files.eio, "{},{},{}", "Radiant to Convective Decay Curves for Cooling", Zone(iZone).Name, Surface(kSurf).Name); for (int jTime = 1; jTime <= min(state.dataGlobal->NumOfTimeStepInHour * 24, 36); ++jTime) { - print(state.files.eio, ",{:6.3F}", state.dataOutRptTab->decayCurveCool(jTime, kSurf)); + print(state.files.eio, ",{:6.3F}", ort->decayCurveCool(jTime, kSurf)); } // put a line feed at the end of the line print(state.files.eio, "\n"); @@ -11879,7 +11928,7 @@ namespace EnergyPlus::OutputReportTabular { if (Surface(kSurf).Zone != iZone) continue; print(state.files.eio, "{},{},{}", "Radiant to Convective Decay Curves for Heating", Zone(iZone).Name, Surface(kSurf).Name); for (int jTime = 1; jTime <= min(state.dataGlobal->NumOfTimeStepInHour * 24, 36); ++jTime) { - print(state.files.eio, ",{:6.3F}", state.dataOutRptTab->decayCurveHeat(jTime, kSurf)); + print(state.files.eio, ",{:6.3F}", ort->decayCurveHeat(jTime, kSurf)); } // put a line feed at the end of the line print(state.files.eio, "\n"); @@ -11935,16 +11984,17 @@ namespace EnergyPlus::OutputReportTabular { static int ZoneNum(0); static int TimeStepInDay(0); static Array1D_int IntGainTypesTubular(1, {IntGainTypeOf_DaylightingDeviceTubular}); + auto &ort(state.dataOutRptTab); if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; - state.dataOutRptTab->feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, _) = 0.0; + ort->feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, _) = 0.0; for (iSurf = 1; iSurf <= TotSurfaces; ++iSurf) { ZoneNum = Surface(iSurf).Zone; if (ZoneNum == 0) continue; if (Surface(iSurf).Class != DataSurfaces::SurfaceClass::Window) continue; // IF (.not. ZoneEquipConfig(ZoneNum)%IsControlled) CYCLE - state.dataOutRptTab->feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, ZoneNum) += + ort->feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, ZoneNum) += SurfWinGainConvGlazToZoneRep(iSurf) + SurfWinGainConvGlazShadGapToZoneRep(iSurf) + SurfWinGainConvShadeToZoneRep(iSurf) + SurfWinGainFrameDividerToZoneRep(iSurf); // for now assume zero instant solar - may change related @@ -11955,7 +12005,7 @@ namespace EnergyPlus::OutputReportTabular { for (int izone = 1; izone <= state.dataGlobal->NumOfZones; ++izone) { Real64 tubularGain = 0.0; InternalHeatGains::SumInternalConvectionGainsByTypes(izone, IntGainTypesTubular, tubularGain); - state.dataOutRptTab->feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, izone) += tubularGain; + ort->feneCondInstantSeq(CurOverallSimDay, TimeStepInDay, izone) += tubularGain; } } } @@ -12000,51 +12050,52 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static int iZone(0); static int TimeStepInDay(0); + auto &ort(state.dataOutRptTab); if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) { TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - state.dataOutRptTab->infilInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = + ort->infilInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).InfilHeatGain - ZnAirRpt(iZone).InfilHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone infiltration if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - state.dataOutRptTab->infilInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += + ort->infilInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneInfiSenGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneInfiSenLossW); // air flow network } - state.dataOutRptTab->infilLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = + ort->infilLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).InfilLatentGain - ZnAirRpt(iZone).InfilLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone infiltration if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - state.dataOutRptTab->infilLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) += + ort->infilLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneInfiLatGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneInfiLatLossW); // air flow network } - state.dataOutRptTab->zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = + ort->zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).VentilHeatGain - ZnAirRpt(iZone).VentilHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone ventilation if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - state.dataOutRptTab->zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += + ort->zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneVentSenGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneVentSenLossW); // air flow network } - state.dataOutRptTab->zoneVentLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = + ort->zoneVentLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).VentilLatentGain - ZnAirRpt(iZone).VentilLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone ventilation if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - state.dataOutRptTab->zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += + ort->zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneVentLatGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneVentLatLossW); // air flow network } - state.dataOutRptTab->interZoneMixInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = + ort->interZoneMixInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).MixHeatGain - ZnAirRpt(iZone).MixHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone mixing if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - state.dataOutRptTab->interZoneMixInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += + ort->interZoneMixInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneMixSenGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneMixSenLossW); // air flow network } - state.dataOutRptTab->interZoneMixLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = + ort->interZoneMixLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = ((ZnAirRpt(iZone).MixLatentGain - ZnAirRpt(iZone).MixLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour)); // zone mixing if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { - state.dataOutRptTab->interZoneMixLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) += + ort->interZoneMixLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneMixLatGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneMixLatLossW); // air flow network } @@ -12114,8 +12165,9 @@ namespace EnergyPlus::OutputReportTabular { using DataSizing::SysSizPeakDDNum; using DataSurfaces::TotSurfaces; using DataZoneEquipment::ZoneEquipConfig; + auto &ort(state.dataOutRptTab); - if (!((state.dataOutRptTab->displayZoneComponentLoadSummary || state.dataOutRptTab->displayAirLoopComponentLoadSummary || state.dataOutRptTab->displayFacilityComponentLoadSummary) && state.dataGlobal->CompLoadReportIsReq)) + if (!((ort->displayZoneComponentLoadSummary || ort->displayAirLoopComponentLoadSummary || ort->displayFacilityComponentLoadSummary) && state.dataGlobal->CompLoadReportIsReq)) return; int coolDesSelected; @@ -12186,7 +12238,7 @@ namespace EnergyPlus::OutputReportTabular { CompLoadTablesType curCompLoadTable; // active component load table // initialize arrays - if (state.dataOutRptTab->displayZoneComponentLoadSummary) { + if (ort->displayZoneComponentLoadSummary) { ZoneHeatCompLoadTables.allocate(state.dataGlobal->NumOfZones); for (auto &e : ZoneHeatCompLoadTables) { e.cells.allocate(cPerArea, rGrdTot); @@ -12202,7 +12254,7 @@ namespace EnergyPlus::OutputReportTabular { e.cellUsed = false; } } - if (state.dataOutRptTab->displayAirLoopComponentLoadSummary) { + if (ort->displayAirLoopComponentLoadSummary) { AirLoopHeatCompLoadTables.allocate(NumPrimaryAirSys); for (auto &e : AirLoopHeatCompLoadTables) { e.cells.allocate(cPerArea, rGrdTot); @@ -12236,7 +12288,7 @@ namespace EnergyPlus::OutputReportTabular { e.cellUsed = false; } } - if (state.dataOutRptTab->displayFacilityComponentLoadSummary) { + if (ort->displayFacilityComponentLoadSummary) { FacilityHeatCompLoadTables.cells.allocate(cPerArea, rGrdTot); FacilityHeatCompLoadTables.cells = 0.; FacilityHeatCompLoadTables.cellUsed.allocate(cPerArea, rGrdTot); @@ -12269,7 +12321,7 @@ namespace EnergyPlus::OutputReportTabular { GetZoneComponentAreas(state, ZoneComponentAreas); // ZoneComponentLoadSummary - if (state.dataOutRptTab->displayZoneComponentLoadSummary) { + if (ort->displayZoneComponentLoadSummary) { for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { if (!ZoneEquipConfig(iZone).IsControlled) continue; if (allocated(CalcFinalZoneSizing)) { @@ -12288,7 +12340,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqCool); ComputeTableBodyUsingMovingAvg(state, ZoneCoolCompLoadTables(iZone).cells, @@ -12302,7 +12354,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqCool); CollectPeakZoneConditions(state, ZoneCoolCompLoadTables(iZone), coolDesSelected, timeCoolMax, iZone, true); // send latent load info to coil summary report @@ -12323,7 +12375,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqHeat); ComputeTableBodyUsingMovingAvg(state, ZoneHeatCompLoadTables(iZone).cells, @@ -12337,7 +12389,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqHeat); CollectPeakZoneConditions(state, ZoneHeatCompLoadTables(iZone), heatDesSelected, timeHeatMax, iZone, false); @@ -12361,7 +12413,7 @@ namespace EnergyPlus::OutputReportTabular { } // AirLoopComponentLoadSummary - if (state.dataOutRptTab->displayAirLoopComponentLoadSummary && NumPrimaryAirSys > 0) { + if (ort->displayAirLoopComponentLoadSummary && NumPrimaryAirSys > 0) { Array1D_int zoneToAirLoopCool; zoneToAirLoopCool.dimension(state.dataGlobal->NumOfZones); Array1D_int zoneToAirLoopHeat; @@ -12426,7 +12478,7 @@ namespace EnergyPlus::OutputReportTabular { for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { if (!ZoneEquipConfig(iZone).IsControlled) continue; // The ZoneCoolCompLoadTables already hasn't gotten a potential IP conversion yet, so we won't convert it twice. - if (state.dataOutRptTab->displayZoneComponentLoadSummary && + if (ort->displayZoneComponentLoadSummary && (AirLoopZonesCoolCompLoadTables(iZone).desDayNum == ZoneCoolCompLoadTables(iZone).desDayNum) && (AirLoopZonesCoolCompLoadTables(iZone).timeStepMax == ZoneCoolCompLoadTables(iZone).timeStepMax)) { AirLoopZonesCoolCompLoadTables(iZone) = ZoneCoolCompLoadTables(iZone); @@ -12444,7 +12496,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqCool); ComputeTableBodyUsingMovingAvg(state, AirLoopZonesCoolCompLoadTables(iZone).cells, @@ -12458,12 +12510,12 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqCool); CollectPeakZoneConditions(state, AirLoopZonesCoolCompLoadTables(iZone), coolDesSelected, timeCoolMax, iZone, true); AddAreaColumnForZone(iZone, ZoneComponentAreas, AirLoopZonesCoolCompLoadTables(iZone)); } - if (state.dataOutRptTab->displayZoneComponentLoadSummary && + if (ort->displayZoneComponentLoadSummary && (AirLoopZonesHeatCompLoadTables(iZone).desDayNum == ZoneHeatCompLoadTables(iZone).desDayNum) && (AirLoopZonesHeatCompLoadTables(iZone).timeStepMax == ZoneHeatCompLoadTables(iZone).timeStepMax)) { AirLoopZonesHeatCompLoadTables(iZone) = ZoneHeatCompLoadTables(iZone); @@ -12481,7 +12533,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqHeat); ComputeTableBodyUsingMovingAvg(state, AirLoopZonesHeatCompLoadTables(iZone).cells, @@ -12495,7 +12547,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqHeat); CollectPeakZoneConditions(state, AirLoopZonesHeatCompLoadTables(iZone), heatDesSelected, timeHeatMax, iZone, false); AddAreaColumnForZone(iZone, ZoneComponentAreas, AirLoopZonesHeatCompLoadTables(iZone)); @@ -12536,7 +12588,7 @@ namespace EnergyPlus::OutputReportTabular { } // FacilityComponentLoadSummary - if (state.dataOutRptTab->displayFacilityComponentLoadSummary) { + if (ort->displayFacilityComponentLoadSummary) { coolDesSelected = CalcFinalFacilitySizing.CoolDDNum; timeCoolMax = CalcFinalFacilitySizing.TimeStepNumAtCoolMax; @@ -12549,7 +12601,7 @@ namespace EnergyPlus::OutputReportTabular { mult = Zone(iZone).Multiplier * Zone(iZone).ListMultiplier; if (mult == 0.0) mult = 1.0; // The ZoneCoolCompLoadTables already hasn't gotten a potential IP conversion yet, so we won't convert it twice. - if (state.dataOutRptTab->displayZoneComponentLoadSummary && (coolDesSelected == ZoneCoolCompLoadTables(iZone).desDayNum) && + if (ort->displayZoneComponentLoadSummary && (coolDesSelected == ZoneCoolCompLoadTables(iZone).desDayNum) && (timeCoolMax == ZoneCoolCompLoadTables(iZone).timeStepMax)) { FacilityZonesCoolCompLoadTables(iZone) = ZoneCoolCompLoadTables(iZone); } else { @@ -12563,7 +12615,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqCool); ComputeTableBodyUsingMovingAvg(state, FacilityZonesCoolCompLoadTables(iZone).cells, @@ -12577,7 +12629,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqCool, lightDelaySeqCool, feneSolarDelaySeqCool, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqCool); CollectPeakZoneConditions(state, FacilityZonesCoolCompLoadTables(iZone), coolDesSelected, timeCoolMax, iZone, true); AddAreaColumnForZone(iZone, ZoneComponentAreas, FacilityZonesCoolCompLoadTables(iZone)); @@ -12586,7 +12638,7 @@ namespace EnergyPlus::OutputReportTabular { FacilityZonesCoolCompLoadTables(iZone).desDayNum = coolDesSelected; CombineLoadCompResults(FacilityCoolCompLoadTables, FacilityZonesCoolCompLoadTables(iZone), mult); - if (state.dataOutRptTab->displayZoneComponentLoadSummary && (heatDesSelected == ZoneHeatCompLoadTables(iZone).desDayNum) && + if (ort->displayZoneComponentLoadSummary && (heatDesSelected == ZoneHeatCompLoadTables(iZone).desDayNum) && (timeHeatMax == ZoneHeatCompLoadTables(iZone).timeStepMax)) { FacilityZonesHeatCompLoadTables(iZone) = ZoneHeatCompLoadTables(iZone); } else { @@ -12600,7 +12652,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqHeat); ComputeTableBodyUsingMovingAvg(state, FacilityZonesHeatCompLoadTables(iZone).cells, @@ -12614,7 +12666,7 @@ namespace EnergyPlus::OutputReportTabular { powerGenDelaySeqHeat, lightDelaySeqHeat, feneSolarDelaySeqHeat, - state.dataOutRptTab->feneCondInstantSeq, + ort->feneCondInstantSeq, surfDelaySeqHeat); CollectPeakZoneConditions(state, FacilityZonesHeatCompLoadTables(iZone), heatDesSelected, timeHeatMax, iZone, false); AddAreaColumnForZone(iZone, ZoneComponentAreas, FacilityZonesHeatCompLoadTables(iZone)); @@ -12640,7 +12692,7 @@ namespace EnergyPlus::OutputReportTabular { } // ZoneComponentLoadSummary: Now we convert and Display - if (state.dataOutRptTab->displayZoneComponentLoadSummary) { + if (ort->displayZoneComponentLoadSummary) { for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { if (!ZoneEquipConfig(iZone).IsControlled) continue; if (allocated(CalcFinalZoneSizing)) { @@ -12696,11 +12748,12 @@ namespace EnergyPlus::OutputReportTabular { // static bool initAdjFenDone(false); moved to anonymous namespace for unit testing static Array3D_bool adjFenDone; + auto &ort(state.dataOutRptTab); - if (!state.dataOutRptTab->initAdjFenDone) { + if (!ort->initAdjFenDone) { adjFenDone.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays, state.dataGlobal->NumOfTimeStepInHour * 24, state.dataGlobal->NumOfZones); adjFenDone = false; - state.dataOutRptTab->initAdjFenDone = true; + ort->initAdjFenDone = true; } int radEnclosureNum = Zone(zoneIndex).RadiantEnclosureNum; @@ -12709,9 +12762,9 @@ namespace EnergyPlus::OutputReportTabular { Array2D decayCurve; if (isCooling) { - decayCurve = state.dataOutRptTab->decayCurveCool; + decayCurve = ort->decayCurveCool; } else { - decayCurve = state.dataOutRptTab->decayCurveHeat; + decayCurve = ort->decayCurveHeat; } for (int kTimeStep = 1; kTimeStep <= state.dataGlobal->NumOfTimeStepInHour * 24; ++kTimeStep) { @@ -12739,17 +12792,17 @@ namespace EnergyPlus::OutputReportTabular { for (int mStepBack = 1; mStepBack <= kTimeStep; ++mStepBack) { int sourceStep = kTimeStep - mStepBack + 1; - Real64 thisQRadThermInAbsMult = state.dataOutRptTab->TMULTseq(desDaySelected, sourceStep, radEnclosureNum) * - state.dataOutRptTab->ITABSFseq(desDaySelected, sourceStep, jSurf) * Surface(jSurf).Area * + Real64 thisQRadThermInAbsMult = ort->TMULTseq(desDaySelected, sourceStep, radEnclosureNum) * + ort->ITABSFseq(desDaySelected, sourceStep, jSurf) * Surface(jSurf).Area * decayCurve(mStepBack, jSurf); - peopleConvFromSurf += state.dataOutRptTab->peopleRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; - equipConvFromSurf += state.dataOutRptTab->equipRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; - hvacLossConvFromSurf += state.dataOutRptTab->hvacLossRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; - powerGenConvFromSurf += state.dataOutRptTab->powerGenRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; - lightLWConvFromSurf += state.dataOutRptTab->lightLWRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; + peopleConvFromSurf += ort->peopleRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; + equipConvFromSurf += ort->equipRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; + hvacLossConvFromSurf += ort->hvacLossRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; + powerGenConvFromSurf += ort->powerGenRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; + lightLWConvFromSurf += ort->lightLWRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; // short wave is already accumulated by surface - lightSWConvFromSurf += state.dataOutRptTab->lightSWRadSeq(desDaySelected, sourceStep, jSurf) * decayCurve(mStepBack, jSurf); - feneSolarConvFromSurf += state.dataOutRptTab->feneSolarRadSeq(desDaySelected, sourceStep, jSurf) * decayCurve(mStepBack, jSurf); + lightSWConvFromSurf += ort->lightSWRadSeq(desDaySelected, sourceStep, jSurf) * decayCurve(mStepBack, jSurf); + feneSolarConvFromSurf += ort->feneSolarRadSeq(desDaySelected, sourceStep, jSurf) * decayCurve(mStepBack, jSurf); } // for mStepBack peopleConvIntoZone += peopleConvFromSurf; @@ -12764,13 +12817,13 @@ namespace EnergyPlus::OutputReportTabular { // on any of these other loads // negative because heat from surface should be positive surfDelaySeq(kTimeStep, jSurf) = - -state.dataOutRptTab->loadConvectedNormal(desDaySelected, kTimeStep, jSurf) - state.dataOutRptTab->netSurfRadSeq(desDaySelected, kTimeStep, jSurf) - + -ort->loadConvectedNormal(desDaySelected, kTimeStep, jSurf) - ort->netSurfRadSeq(desDaySelected, kTimeStep, jSurf) - (peopleConvFromSurf + equipConvFromSurf + hvacLossConvFromSurf + powerGenConvFromSurf + lightLWConvFromSurf + lightSWConvFromSurf + feneSolarConvFromSurf); // remove net radiant for the surface // also remove the net radiant component on the instanteous conduction for fenestration if (Surface(jSurf).Class == DataSurfaces::SurfaceClass::Window) { - adjFeneSurfNetRadSeq += state.dataOutRptTab->netSurfRadSeq(desDaySelected, kTimeStep, jSurf); + adjFeneSurfNetRadSeq += ort->netSurfRadSeq(desDaySelected, kTimeStep, jSurf); } } // for jSurf peopleDelaySeq(kTimeStep) = peopleConvIntoZone; @@ -12841,6 +12894,7 @@ namespace EnergyPlus::OutputReportTabular { Array1D delayOpaque; // hold values for report for delayed opaque int curExtBoundCond; Real64 singleSurfDelay; + auto &ort(state.dataOutRptTab); int NumOfTimeStepInDay = state.dataGlobal->NumOfTimeStepInHour * 24; @@ -12854,51 +12908,51 @@ namespace EnergyPlus::OutputReportTabular { if (desDaySelected != 0 && timeOfMax != 0) { // PEOPLE - resultCells(cSensInst, rPeople) = MovingAvgAtMaxTime(state.dataOutRptTab->peopleInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rPeople) = MovingAvgAtMaxTime(ort->peopleInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rPeople) = true; - resultCells(cLatent, rPeople) = MovingAvgAtMaxTime(state.dataOutRptTab->peopleLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rPeople) = MovingAvgAtMaxTime(ort->peopleLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rPeople) = true; resultCells(cSensDelay, rPeople) = MovingAvgAtMaxTime(peopleDelaySeq(_), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensDelay, rPeople) = true; // LIGHTS - resultCells(cSensInst, rLights) = MovingAvgAtMaxTime(state.dataOutRptTab->lightInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rLights) = MovingAvgAtMaxTime(ort->lightInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rLights) = true; - resultCells(cSensRA, rLights) = MovingAvgAtMaxTime(state.dataOutRptTab->lightRetAirSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensRA, rLights) = MovingAvgAtMaxTime(ort->lightRetAirSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensRA, rLights) = true; resultCells(cSensDelay, rLights) = MovingAvgAtMaxTime(lightDelaySeq(_), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensDelay, rLights) = true; // EQUIPMENT - resultCells(cSensInst, rEquip) = MovingAvgAtMaxTime(state.dataOutRptTab->equipInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rEquip) = MovingAvgAtMaxTime(ort->equipInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rEquip) = true; - resultCells(cLatent, rEquip) = MovingAvgAtMaxTime(state.dataOutRptTab->equipLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rEquip) = MovingAvgAtMaxTime(ort->equipLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rEquip) = true; resultCells(cSensDelay, rEquip) = MovingAvgAtMaxTime(equipDelaySeq(_), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensDelay, rEquip) = true; // REFRIGERATION EQUIPMENT - resultCells(cSensInst, rRefrig) = MovingAvgAtMaxTime(state.dataOutRptTab->refrigInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rRefrig) = MovingAvgAtMaxTime(ort->refrigInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rRefrig) = true; - resultCells(cSensRA, rRefrig) = MovingAvgAtMaxTime(state.dataOutRptTab->refrigRetAirSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensRA, rRefrig) = MovingAvgAtMaxTime(ort->refrigRetAirSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensRA, rRefrig) = true; - resultCells(cLatent, rRefrig) = MovingAvgAtMaxTime(state.dataOutRptTab->refrigLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rRefrig) = MovingAvgAtMaxTime(ort->refrigLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rRefrig) = true; // WATER USE EQUIPMENT - resultCells(cSensInst, rWaterUse) = MovingAvgAtMaxTime(state.dataOutRptTab->waterUseInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rWaterUse) = MovingAvgAtMaxTime(ort->waterUseInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rWaterUse) = true; - resultCells(cLatent, rWaterUse) = MovingAvgAtMaxTime(state.dataOutRptTab->waterUseLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rWaterUse) = MovingAvgAtMaxTime(ort->waterUseLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rWaterUse) = true; // HVAC EQUIPMENT LOSSES - resultCells(cSensInst, rHvacLoss) = MovingAvgAtMaxTime(state.dataOutRptTab->hvacLossInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rHvacLoss) = MovingAvgAtMaxTime(ort->hvacLossInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rHvacLoss) = true; resultCells(cSensDelay, rHvacLoss) = MovingAvgAtMaxTime(hvacLossDelaySeq(_), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensDelay, rHvacLoss) = true; // POWER GENERATION EQUIPMENT - resultCells(cSensInst, rPowerGen) = MovingAvgAtMaxTime(state.dataOutRptTab->powerGenInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rPowerGen) = MovingAvgAtMaxTime(ort->powerGenInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rPowerGen) = true; resultCells(cSensDelay, rPowerGen) = MovingAvgAtMaxTime(powerGenDelaySeq(_), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensDelay, rPowerGen) = true; @@ -12910,22 +12964,22 @@ namespace EnergyPlus::OutputReportTabular { resCellsUsd(cLatent, rDOAS) = true; // INFILTRATION - resultCells(cSensInst, rInfil) = MovingAvgAtMaxTime(state.dataOutRptTab->infilInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rInfil) = MovingAvgAtMaxTime(ort->infilInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rInfil) = true; - resultCells(cLatent, rInfil) = MovingAvgAtMaxTime(state.dataOutRptTab->infilLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rInfil) = MovingAvgAtMaxTime(ort->infilLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rInfil) = true; // ZONE VENTILATION - resultCells(cSensInst, rZoneVent) = MovingAvgAtMaxTime(state.dataOutRptTab->zoneVentInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cSensInst, rZoneVent) = MovingAvgAtMaxTime(ort->zoneVentInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rZoneVent) = true; - resultCells(cLatent, rZoneVent) = MovingAvgAtMaxTime(state.dataOutRptTab->zoneVentLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rZoneVent) = MovingAvgAtMaxTime(ort->zoneVentLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rZoneVent) = true; // INTERZONE MIXING resultCells(cSensInst, rIntZonMix) = - MovingAvgAtMaxTime(state.dataOutRptTab->interZoneMixInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + MovingAvgAtMaxTime(ort->interZoneMixInstantSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cSensInst, rIntZonMix) = true; - resultCells(cLatent, rIntZonMix) = MovingAvgAtMaxTime(state.dataOutRptTab->interZoneMixLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); + resultCells(cLatent, rIntZonMix) = MovingAvgAtMaxTime(ort->interZoneMixLatentSeq(desDaySelected, _, zoneIndex), NumOfTimeStepInDay, timeOfMax); resCellsUsd(cLatent, rIntZonMix) = true; // FENESTRATION CONDUCTION @@ -13405,7 +13459,9 @@ namespace EnergyPlus::OutputReportTabular { // apply unit conversions to the load components summary tables void LoadSummaryUnitConversion(EnergyPlusData &state, CompLoadTablesType &compLoadTotal) { - if (state.dataOutRptTab->unitsStyle == iUnitsStyle::InchPound) { + auto &ort(state.dataOutRptTab); + + if (ort->unitsStyle == iUnitsStyle::InchPound) { Real64 powerConversion = getSpecificUnitMultiplier(state, "W", "Btu/h"); Real64 areaConversion = getSpecificUnitMultiplier(state, "m2", "ft2"); Real64 powerPerAreaConversion = getSpecificUnitMultiplier(state, "W/m2", "Btu/h-ft2"); @@ -13486,15 +13542,17 @@ namespace EnergyPlus::OutputReportTabular { std::string reportName; std::string zoneAirLoopFacilityName; - if (kind == iOutputType::zoneOutput && state.dataOutRptTab->displayZoneComponentLoadSummary) { + auto &ort(state.dataOutRptTab); + + if (kind == iOutputType::zoneOutput && ort->displayZoneComponentLoadSummary) { reportName = "Zone Component Load Summary"; zoneAirLoopFacilityName = Zone(zoneOrAirLoopIndex).Name; writeOutput = true; - } else if (kind == iOutputType::airLoopOutput && state.dataOutRptTab->displayAirLoopComponentLoadSummary) { + } else if (kind == iOutputType::airLoopOutput && ort->displayAirLoopComponentLoadSummary) { reportName = "AirLoop Component Load Summary"; zoneAirLoopFacilityName = DataSizing::FinalSysSizing(zoneOrAirLoopIndex).AirPriLoopName; writeOutput = true; - } else if (kind == iOutputType::facilityOutput && state.dataOutRptTab->displayFacilityComponentLoadSummary) { + } else if (kind == iOutputType::facilityOutput && ort->displayFacilityComponentLoadSummary) { reportName = "Facility Component Load Summary"; zoneAirLoopFacilityName = "Facility"; writeOutput = true; @@ -13565,7 +13623,7 @@ namespace EnergyPlus::OutputReportTabular { rowHead(rGrdTot) = "Grand Total"; columnHead.allocate(cPerArea); - if (state.dataOutRptTab->unitsStyle != iUnitsStyle::InchPound) { + if (ort->unitsStyle != iUnitsStyle::InchPound) { columnHead(cSensInst) = "Sensible - Instant [W]"; columnHead(cSensDelay) = "Sensible - Delayed [W]"; columnHead(cSensRA) = "Sensible - Return Air [W]"; @@ -13608,7 +13666,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody = ""; columnHead(1) = "Value"; - if (state.dataOutRptTab->unitsStyle != iUnitsStyle::InchPound) { + if (ort->unitsStyle != iUnitsStyle::InchPound) { rowHead(1) = "Time of Peak Load"; rowHead(2) = "Outside Dry Bulb Temperature [C]"; rowHead(3) = "Outside Wet Bulb Temperature [C]"; @@ -13690,7 +13748,7 @@ namespace EnergyPlus::OutputReportTabular { tableBody = ""; columnHead(1) = "Value"; - if (state.dataOutRptTab->unitsStyle != iUnitsStyle::InchPound) { + if (ort->unitsStyle != iUnitsStyle::InchPound) { rowHead(1) = "Outside Air Fraction [fraction]"; rowHead(2) = "Airflow per Floor Area [m3/s-m2]"; rowHead(3) = "Airflow per Total Capacity [m3/s-W]"; @@ -13795,11 +13853,12 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: std::string const modifiedReportName(reportName + (averageOrSum == OutputProcessor::StoreType::Summed ? " per second" : "")); + auto &ort(state.dataOutRptTab); - for (int iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { - std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); - std::string const &curDel(state.dataOutRptTab->del(iStyle)); - auto const style(state.dataOutRptTab->TableStyle(iStyle)); + for (int iStyle = 1; iStyle <= ort->numStyles; ++iStyle) { + std::ostream &tbl_stream(*ort->TabularOutputFile(iStyle)); + std::string const &curDel(ort->del(iStyle)); + auto const style(ort->TableStyle(iStyle)); if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab)) { tbl_stream << "----------------------------------------------------------------------------------------------------\n"; tbl_stream << "REPORT:" << curDel << modifiedReportName << '\n'; @@ -13814,25 +13873,25 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << "\n"; tbl_stream << "

Report:" << curDel << modifiedReportName << "

\n"; tbl_stream << "

For:" << curDel << objectName << "

\n"; - tbl_stream << "

Timestamp: " << std::setw(4) << state.dataOutRptTab->td(1) << '-' << std::setfill('0') << std::setw(2) << state.dataOutRptTab->td(2) << '-' << std::setw(2) - << state.dataOutRptTab->td(3) << '\n'; - tbl_stream << " " << std::setw(2) << state.dataOutRptTab->td(5) << ':' << std::setw(2) << state.dataOutRptTab->td(6) << ':' << std::setw(2) << state.dataOutRptTab->td(7) << std::setfill(' ') + tbl_stream << "

Timestamp: " << std::setw(4) << ort->td(1) << '-' << std::setfill('0') << std::setw(2) << ort->td(2) << '-' << std::setw(2) + << ort->td(3) << '\n'; + tbl_stream << " " << std::setw(2) << ort->td(5) << ':' << std::setw(2) << ort->td(6) << ':' << std::setw(2) << ort->td(7) << std::setfill(' ') << "

\n"; } else if (style == iTableStyle::XML) { - if (len(state.dataOutRptTab->prevReportName) != 0) { - tbl_stream << "prevReportName << ">\n"; // close the last element if it was used. + if (len(ort->prevReportName) != 0) { + tbl_stream << "prevReportName << ">\n"; // close the last element if it was used. } tbl_stream << "<" << ConvertToElementTag(modifiedReportName) << ">\n"; tbl_stream << " " << objectName << "\n"; - state.dataOutRptTab->prevReportName = ConvertToElementTag(modifiedReportName); // save the name for next time + ort->prevReportName = ConvertToElementTag(modifiedReportName); // save the name for next time } } // clear the active subtable name for the XML reporting - state.dataOutRptTab->activeSubTableName = ""; + ort->activeSubTableName = ""; // save the report name if the subtable name is not available during XML processing - state.dataOutRptTab->activeReportName = modifiedReportName; + ort->activeReportName = modifiedReportName; // save the "for" which is the object name in the report for HTML comment that contains the report, for, and subtable - state.dataOutRptTab->activeForName = objectName; + ort->activeForName = objectName; } void WriteSubtitle(EnergyPlusData &state, std::string const &subtitle) @@ -13859,19 +13918,20 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int iStyle; + auto &ort(state.dataOutRptTab); - for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { - auto const style(state.dataOutRptTab->TableStyle(iStyle)); + for (iStyle = 1; iStyle <= ort->numStyles; ++iStyle) { + auto const style(ort->TableStyle(iStyle)); if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab) || (style == iTableStyle::Fixed)) { - std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); + std::ostream &tbl_stream(*ort->TabularOutputFile(iStyle)); tbl_stream << subtitle << "\n\n"; } else if (style == iTableStyle::HTML) { - std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); + std::ostream &tbl_stream(*ort->TabularOutputFile(iStyle)); tbl_stream << "" << subtitle << "

\n"; - tbl_stream << "\n"; + tbl_stream << "\n"; } else if (style == iTableStyle::XML) { // save the active subtable name for the XML reporting - state.dataOutRptTab->activeSubTableName = subtitle; + ort->activeSubTableName = subtitle; // no other output is needed since WriteTable uses the subtable name for each record. } } @@ -13902,6 +13962,7 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int iStyle; bool useBold; + auto &ort(state.dataOutRptTab); if (present(isBold)) { useBold = isBold; @@ -13909,20 +13970,20 @@ namespace EnergyPlus::OutputReportTabular { useBold = false; } - for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { - auto const style(state.dataOutRptTab->TableStyle(iStyle)); + for (iStyle = 1; iStyle <= ort->numStyles; ++iStyle) { + auto const style(ort->TableStyle(iStyle)); if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab) || (style == iTableStyle::Fixed)) { - std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); + std::ostream &tbl_stream(*ort->TabularOutputFile(iStyle)); tbl_stream << lineOfText << '\n'; } else if (style == iTableStyle::HTML) { - std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); + std::ostream &tbl_stream(*ort->TabularOutputFile(iStyle)); if (useBold) { tbl_stream << "" << lineOfText << "

\n"; } else { tbl_stream << lineOfText << "
\n"; } } else if (style == iTableStyle::XML) { - std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); + std::ostream &tbl_stream(*ort->TabularOutputFile(iStyle)); if (!lineOfText.empty()) { tbl_stream << "" << lineOfText << "\n"; } @@ -14005,6 +14066,7 @@ namespace EnergyPlus::OutputReportTabular { bool doTransposeXML; bool isTableBlank; bool isRecordBlank; + auto &ort(state.dataOutRptTab); if (present(transposeXML)) { doTransposeXML = transposeXML; @@ -14044,9 +14106,9 @@ namespace EnergyPlus::OutputReportTabular { numColLabelRows = 0; // default value maxNumColLabelRows = 0; - for (iStyle = 1; iStyle <= state.dataOutRptTab->numStyles; ++iStyle) { - std::ostream &tbl_stream(*state.dataOutRptTab->TabularOutputFile(iStyle)); - curDel = state.dataOutRptTab->del(iStyle); + for (iStyle = 1; iStyle <= ort->numStyles; ++iStyle) { + std::ostream &tbl_stream(*ort->TabularOutputFile(iStyle)); + curDel = ort->del(iStyle); // go through the columns and break them into multiple lines // if bar '|' is found in a row then break into two lines // if longer than the column width break into two lines for fixed style only @@ -14071,7 +14133,7 @@ namespace EnergyPlus::OutputReportTabular { } } // extra preprocessing for fixed style reports - if (state.dataOutRptTab->TableStyle(iStyle) == iTableStyle::Fixed) { + if (ort->TableStyle(iStyle) == iTableStyle::Fixed) { // break column headings into multiple rows if long (for fixed) or contain two spaces in a row. for (iCol = 1; iCol <= colsColumnLabels; ++iCol) { colWidthLimit = widthColumn(iCol); @@ -14089,7 +14151,7 @@ namespace EnergyPlus::OutputReportTabular { } // output depending on style of format - auto const style(state.dataOutRptTab->TableStyle(iStyle)); + auto const style(ort->TableStyle(iStyle)); if ((style == iTableStyle::Comma) || (style == iTableStyle::Tab)) { // column headers for (jRow = 1; jRow <= maxNumColLabelRows; ++jRow) { @@ -14204,14 +14266,14 @@ namespace EnergyPlus::OutputReportTabular { // if non-blank cells in the table body were found create the table. if (!isTableBlank) { // if report name and subtable name the same add "record" to the end - state.dataOutRptTab->activeSubTableName = ConvertToElementTag(state.dataOutRptTab->activeSubTableName); - state.dataOutRptTab->activeReportNameNoSpace = ConvertToElementTag(state.dataOutRptTab->activeReportName); - if (UtilityRoutines::SameString(state.dataOutRptTab->activeSubTableName, state.dataOutRptTab->activeReportNameNoSpace)) { - state.dataOutRptTab->activeSubTableName += "Record"; + ort->activeSubTableName = ConvertToElementTag(ort->activeSubTableName); + ort->activeReportNameNoSpace = ConvertToElementTag(ort->activeReportName); + if (UtilityRoutines::SameString(ort->activeSubTableName, ort->activeReportNameNoSpace)) { + ort->activeSubTableName += "Record"; } // if no subtable name use the report name and add "record" to the end - if (len(state.dataOutRptTab->activeSubTableName) == 0) { - state.dataOutRptTab->activeSubTableName = state.dataOutRptTab->activeReportNameNoSpace + "Record"; + if (len(ort->activeSubTableName) == 0) { + ort->activeSubTableName = ort->activeReportNameNoSpace + "Record"; } // if a single column table, transpose it automatically if ((colsBody == 1) && (rowsBody > 1)) { @@ -14256,7 +14318,7 @@ namespace EnergyPlus::OutputReportTabular { } } if (!isRecordBlank) { - tbl_stream << " <" << state.dataOutRptTab->activeSubTableName << ">\n"; + tbl_stream << " <" << ort->activeSubTableName << ">\n"; if (len(rowLabelTags(jRow)) > 0) { tbl_stream << " " << rowLabelTags(jRow) << "\n"; } @@ -14273,7 +14335,7 @@ namespace EnergyPlus::OutputReportTabular { << ">\n"; } } - tbl_stream << " activeSubTableName << ">\n"; + tbl_stream << " activeSubTableName << ">\n"; } } } else { // transpose XML table @@ -14288,7 +14350,7 @@ namespace EnergyPlus::OutputReportTabular { } } if (!isRecordBlank) { - tbl_stream << " <" << state.dataOutRptTab->activeSubTableName << ">\n"; + tbl_stream << " <" << ort->activeSubTableName << ">\n"; // if the column has units put them into the name tag if (len(columnLabelTags(iCol)) > 0) { if (len(columnUnitStrings(iCol)) > 0) { @@ -14310,7 +14372,7 @@ namespace EnergyPlus::OutputReportTabular { tbl_stream << " " << tagWithAttrib << stripped(bodyEsc(iCol, jRow)) << "\n"; } } - tbl_stream << " activeSubTableName << ">\n"; + tbl_stream << " activeSubTableName << ">\n"; } } } @@ -14629,10 +14691,10 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 curZoneArea; int iZone; - // INTEGER :: found + auto &ort(state.dataOutRptTab); - state.dataOutRptTab->buildingGrossFloorArea = 0.0; - state.dataOutRptTab->buildingConditionedFloorArea = 0.0; + ort->buildingGrossFloorArea = 0.0; + ort->buildingConditionedFloorArea = 0.0; for (iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { curZoneArea = Zone(iZone).FloorArea * Zone(iZone).Multiplier * Zone(iZone).ListMultiplier; @@ -14650,12 +14712,12 @@ namespace EnergyPlus::OutputReportTabular { // IF (found /= 0) curZoneArea = 0.0d0 if (Zone(iZone).isPartOfTotalArea) { - state.dataOutRptTab->buildingGrossFloorArea += curZoneArea; + ort->buildingGrossFloorArea += curZoneArea; // If a ZoneHVAC:EquipmentConnections is used for a zone then // it is considered conditioned. Also ZONE SUPPLY PLENUM and ZONE RETURN PLENUM are // also is considered conditioned. if (Zone(iZone).SystemZoneNodeNumber > 0) { - state.dataOutRptTab->buildingConditionedFloorArea += curZoneArea; + ort->buildingConditionedFloorArea += curZoneArea; } } } @@ -14714,20 +14776,21 @@ namespace EnergyPlus::OutputReportTabular { int curTable; int curCol; static Real64 BigNum(0.0); - - for (iInput = 1; iInput <= state.dataOutRptTab->MonthlyInputCount; ++iInput) { - for (jTable = 1; jTable <= state.dataOutRptTab->MonthlyInput(iInput).numTables; ++jTable) { - curTable = jTable + state.dataOutRptTab->MonthlyInput(iInput).firstTable - 1; - for (kColumn = 1; kColumn <= state.dataOutRptTab->MonthlyTables(curTable).numColumns; ++kColumn) { - curCol = kColumn + state.dataOutRptTab->MonthlyTables(curTable).firstColumn - 1; - state.dataOutRptTab->MonthlyColumns(curCol).timeStamp = 0; - state.dataOutRptTab->MonthlyColumns(curCol).duration = 0.0; - if (state.dataOutRptTab->MonthlyColumns(curCol).aggType == iAggType::Maximum || state.dataOutRptTab->MonthlyColumns(curCol).aggType == iAggType::MaximumDuringHoursShown) { - state.dataOutRptTab->MonthlyColumns(curCol).reslt = -HUGE_(BigNum); - } else if (state.dataOutRptTab->MonthlyColumns(curCol).aggType == iAggType::Minimum || state.dataOutRptTab->MonthlyColumns(curCol).aggType == iAggType::MinimumDuringHoursShown) { - state.dataOutRptTab->MonthlyColumns(curCol).reslt = HUGE_(BigNum); + auto &ort(state.dataOutRptTab); + + for (iInput = 1; iInput <= ort->MonthlyInputCount; ++iInput) { + for (jTable = 1; jTable <= ort->MonthlyInput(iInput).numTables; ++jTable) { + curTable = jTable + ort->MonthlyInput(iInput).firstTable - 1; + for (kColumn = 1; kColumn <= ort->MonthlyTables(curTable).numColumns; ++kColumn) { + curCol = kColumn + ort->MonthlyTables(curTable).firstColumn - 1; + ort->MonthlyColumns(curCol).timeStamp = 0; + ort->MonthlyColumns(curCol).duration = 0.0; + if (ort->MonthlyColumns(curCol).aggType == iAggType::Maximum || ort->MonthlyColumns(curCol).aggType == iAggType::MaximumDuringHoursShown) { + ort->MonthlyColumns(curCol).reslt = -HUGE_(BigNum); + } else if (ort->MonthlyColumns(curCol).aggType == iAggType::Minimum || ort->MonthlyColumns(curCol).aggType == iAggType::MinimumDuringHoursShown) { + ort->MonthlyColumns(curCol).reslt = HUGE_(BigNum); } else { - state.dataOutRptTab->MonthlyColumns(curCol).reslt = 0.0; + ort->MonthlyColumns(curCol).reslt = 0.0; } } } @@ -14740,23 +14803,24 @@ namespace EnergyPlus::OutputReportTabular { // Reset all timebins gathering arrays to zero for multi-year simulations // so that only last year is reported in tabular reports Real64 const bigVal(0.0); // used with HUGE: Value doesn't matter, only type: Initialize so compiler doesn't warn about use uninitialized + auto &ort(state.dataOutRptTab); // clear the binning arrays to zeros - for (auto &e : state.dataOutRptTab->BinResults) { + for (auto &e : ort->BinResults) { e.mnth = 0.0; e.hrly = 0.0; } - for (auto &e : state.dataOutRptTab->BinResultsBelow) { + for (auto &e : ort->BinResultsBelow) { e.mnth = 0.0; e.hrly = 0.0; } - for (auto &e : state.dataOutRptTab->BinResultsAbove) { + for (auto &e : ort->BinResultsAbove) { e.mnth = 0.0; e.hrly = 0.0; } // re-initialize statistics counters - for (auto &e : state.dataOutRptTab->BinStatistics) { + for (auto &e : ort->BinStatistics) { e.minimum = HUGE_(bigVal); e.maximum = -HUGE_(bigVal); e.n = 0; @@ -14770,31 +14834,32 @@ namespace EnergyPlus::OutputReportTabular { // Jason Glazer - October 2015 // Reset all ABUPS gathering arrays to zero for multi-year simulations // so that only last year is reported in tabular reports - state.dataOutRptTab->gatherTotalsBEPS = 0.0; - state.dataOutRptTab->gatherEndUseBEPS = 0.0; - state.dataOutRptTab->gatherEndUseSubBEPS = 0.0; - state.dataOutRptTab->gatherTotalsSource = 0.0; + auto &ort(state.dataOutRptTab); + ort->gatherTotalsBEPS = 0.0; + ort->gatherEndUseBEPS = 0.0; + ort->gatherEndUseSubBEPS = 0.0; + ort->gatherTotalsSource = 0.0; // reset the specific components being gathered - state.dataOutRptTab->gatherPowerFuelFireGen = 0.0; - state.dataOutRptTab->gatherPowerPV = 0.0; - state.dataOutRptTab->gatherPowerWind = 0.0; - state.dataOutRptTab->gatherPowerHTGeothermal = 0.0; - state.dataOutRptTab->gatherElecProduced = 0.0; - state.dataOutRptTab->gatherElecPurchased = 0.0; - state.dataOutRptTab->gatherElecSurplusSold = 0.0; - state.dataOutRptTab->gatherElecStorage = 0.0; - state.dataOutRptTab->gatherPowerConversion = 0.0; - state.dataOutRptTab->gatherWaterHeatRecovery = 0.0; - state.dataOutRptTab->gatherAirHeatRecoveryCool = 0.0; - state.dataOutRptTab->gatherAirHeatRecoveryHeat = 0.0; - state.dataOutRptTab->gatherHeatHTGeothermal = 0.0; - state.dataOutRptTab->gatherHeatSolarWater = 0.0; - state.dataOutRptTab->gatherHeatSolarAir = 0.0; - state.dataOutRptTab->gatherRainWater = 0.0; - state.dataOutRptTab->gatherCondensate = 0.0; - state.dataOutRptTab->gatherWellwater = 0.0; - state.dataOutRptTab->gatherMains = 0.0; - state.dataOutRptTab->gatherWaterEndUseTotal = 0.0; + ort->gatherPowerFuelFireGen = 0.0; + ort->gatherPowerPV = 0.0; + ort->gatherPowerWind = 0.0; + ort->gatherPowerHTGeothermal = 0.0; + ort->gatherElecProduced = 0.0; + ort->gatherElecPurchased = 0.0; + ort->gatherElecSurplusSold = 0.0; + ort->gatherElecStorage = 0.0; + ort->gatherPowerConversion = 0.0; + ort->gatherWaterHeatRecovery = 0.0; + ort->gatherAirHeatRecoveryCool = 0.0; + ort->gatherAirHeatRecoveryHeat = 0.0; + ort->gatherHeatHTGeothermal = 0.0; + ort->gatherHeatSolarWater = 0.0; + ort->gatherHeatSolarAir = 0.0; + ort->gatherRainWater = 0.0; + ort->gatherCondensate = 0.0; + ort->gatherWellwater = 0.0; + ort->gatherMains = 0.0; + ort->gatherWaterEndUseTotal = 0.0; } void ResetSourceEnergyEndUseGathering(EnergyPlusData &state) @@ -14802,8 +14867,9 @@ namespace EnergyPlus::OutputReportTabular { // Jason Glazer - October 2015 // Reset all source energy end use table gathering arrays to zero for multi-year simulations // so that only last year is reported in tabular reports - state.dataOutRptTab->gatherTotalsBySourceBEPS = 0.0; - state.dataOutRptTab->gatherEndUseBySourceBEPS = 0.0; + auto &ort(state.dataOutRptTab); + ort->gatherTotalsBySourceBEPS = 0.0; + ort->gatherEndUseBySourceBEPS = 0.0; } void ResetPeakDemandGathering(EnergyPlusData &state) @@ -14811,10 +14877,11 @@ namespace EnergyPlus::OutputReportTabular { // Jason Glazer - October 2015 // Reset all demand end use components table gathering arrays to zero for multi-year simulations // so that only last year is reported in tabular reports - state.dataOutRptTab->gatherDemandTotal = 0.0; - state.dataOutRptTab->gatherDemandTimeStamp = 0; - state.dataOutRptTab->gatherDemandEndUse = 0.0; - state.dataOutRptTab->gatherDemandEndUseSub = 0.0; + auto &ort(state.dataOutRptTab); + ort->gatherDemandTotal = 0.0; + ort->gatherDemandTimeStamp = 0; + ort->gatherDemandEndUse = 0.0; + ort->gatherDemandEndUseSub = 0.0; } void ResetHeatGainGathering(EnergyPlusData &state) @@ -14973,7 +15040,8 @@ namespace EnergyPlus::OutputReportTabular { using DataHeatBalance::People; using DataHeatBalance::TotPeople; int i; - if (state.dataOutRptTab->displayAdaptiveComfort && TotPeople > 0) { + auto &ort(state.dataOutRptTab); + if (ort->displayAdaptiveComfort && TotPeople > 0) { for (i = 1; i <= TotPeople; ++i) { if (People(i).AdaptiveASH55) { People(i).TimeNotMetASH5590 = 0.; @@ -15339,20 +15407,21 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na + auto &ort(state.dataOutRptTab); - if (!allocated(state.dataOutRptTab->TOCEntries)) { - state.dataOutRptTab->TOCEntriesSize = 20; - state.dataOutRptTab->TOCEntries.allocate(state.dataOutRptTab->TOCEntriesSize); - state.dataOutRptTab->TOCEntriesCount = 1; + if (!allocated(ort->TOCEntries)) { + ort->TOCEntriesSize = 20; + ort->TOCEntries.allocate(ort->TOCEntriesSize); + ort->TOCEntriesCount = 1; } else { - ++state.dataOutRptTab->TOCEntriesCount; + ++ort->TOCEntriesCount; // if larger than current size grow the array - if (state.dataOutRptTab->TOCEntriesCount > state.dataOutRptTab->TOCEntriesSize) { - state.dataOutRptTab->TOCEntries.redimension(state.dataOutRptTab->TOCEntriesSize += 20); + if (ort->TOCEntriesCount > ort->TOCEntriesSize) { + ort->TOCEntries.redimension(ort->TOCEntriesSize += 20); } } - state.dataOutRptTab->TOCEntries(state.dataOutRptTab->TOCEntriesCount).reportName = nameReport; - state.dataOutRptTab->TOCEntries(state.dataOutRptTab->TOCEntriesCount).sectionName = nameSection; + ort->TOCEntries(ort->TOCEntriesCount).reportName = nameReport; + ort->TOCEntries(ort->TOCEntriesCount).sectionName = nameSection; } void SetupUnitConversions(EnergyPlusData &state) @@ -15388,427 +15457,429 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na - state.dataOutRptTab->UnitConvSize = 115; - state.dataOutRptTab->UnitConv.allocate(state.dataOutRptTab->UnitConvSize); - state.dataOutRptTab->UnitConv(1).siName = "%"; - state.dataOutRptTab->UnitConv(2).siName = "°C"; - state.dataOutRptTab->UnitConv(3).siName = "0=OFF 1=ON"; - state.dataOutRptTab->UnitConv(4).siName = "0-NO 1-YES"; - state.dataOutRptTab->UnitConv(5).siName = "1-YES 0-NO"; - state.dataOutRptTab->UnitConv(6).siName = "A"; - state.dataOutRptTab->UnitConv(7).siName = "ACH"; - state.dataOutRptTab->UnitConv(8).siName = "ACH"; - state.dataOutRptTab->UnitConv(9).siName = "BASE 10C"; - state.dataOutRptTab->UnitConv(10).siName = "BASE 18C"; - state.dataOutRptTab->UnitConv(11).siName = "C"; - state.dataOutRptTab->UnitConv(12).siName = "CD/M2"; - state.dataOutRptTab->UnitConv(13).siName = "DEG"; - state.dataOutRptTab->UnitConv(14).siName = "FRAC"; - state.dataOutRptTab->UnitConv(15).siName = "HOUR"; - state.dataOutRptTab->UnitConv(16).siName = "HOURS"; - state.dataOutRptTab->UnitConv(17).siName = "HR"; - state.dataOutRptTab->UnitConv(18).siName = "HRS"; - state.dataOutRptTab->UnitConv(19).siName = "J"; - state.dataOutRptTab->UnitConv(20).siName = "J"; - state.dataOutRptTab->UnitConv(21).siName = "J"; - state.dataOutRptTab->UnitConv(22).siName = "J"; - state.dataOutRptTab->UnitConv(23).siName = "J"; - state.dataOutRptTab->UnitConv(24).siName = "J"; - state.dataOutRptTab->UnitConv(25).siName = "J/KG"; - state.dataOutRptTab->UnitConv(26).siName = "J/KGWATER"; - state.dataOutRptTab->UnitConv(27).siName = "J/M2"; - state.dataOutRptTab->UnitConv(28).siName = "K/M"; - state.dataOutRptTab->UnitConv(29).siName = "KG"; - state.dataOutRptTab->UnitConv(30).siName = "KG/KG"; - state.dataOutRptTab->UnitConv(31).siName = "KG/M3"; - state.dataOutRptTab->UnitConv(32).siName = "KG/S"; - state.dataOutRptTab->UnitConv(33).siName = "KGWATER/KGDRYAIR"; - state.dataOutRptTab->UnitConv(34).siName = "KGWATER/SEC"; - state.dataOutRptTab->UnitConv(35).siName = "KMOL/S"; - state.dataOutRptTab->UnitConv(36).siName = "KMOL/SEC"; - state.dataOutRptTab->UnitConv(37).siName = "KWH"; - state.dataOutRptTab->UnitConv(38).siName = "L"; - state.dataOutRptTab->UnitConv(39).siName = "L"; - state.dataOutRptTab->UnitConv(40).siName = "LUM/W"; - state.dataOutRptTab->UnitConv(41).siName = "LUX"; - state.dataOutRptTab->UnitConv(42).siName = "M"; - state.dataOutRptTab->UnitConv(43).siName = "M"; - state.dataOutRptTab->UnitConv(44).siName = "M/S"; - state.dataOutRptTab->UnitConv(45).siName = "M/S"; - state.dataOutRptTab->UnitConv(46).siName = "M2"; - state.dataOutRptTab->UnitConv(47).siName = "M2/PERSON"; - state.dataOutRptTab->UnitConv(48).siName = "M3"; - state.dataOutRptTab->UnitConv(49).siName = "M3"; - state.dataOutRptTab->UnitConv(50).siName = "M3/M2"; - state.dataOutRptTab->UnitConv(51).siName = "M3/S"; - state.dataOutRptTab->UnitConv(52).siName = "M3/S"; - state.dataOutRptTab->UnitConv(53).siName = "M3/S-M2"; - state.dataOutRptTab->UnitConv(54).siName = "M3/S-PERSON"; - state.dataOutRptTab->UnitConv(55).siName = "M3/S-PERSON"; - state.dataOutRptTab->UnitConv(56).siName = "PA"; - state.dataOutRptTab->UnitConv(57).siName = "PA"; - state.dataOutRptTab->UnitConv(58).siName = "PA"; - state.dataOutRptTab->UnitConv(59).siName = "PA"; - state.dataOutRptTab->UnitConv(60).siName = "PA"; - state.dataOutRptTab->UnitConv(61).siName = "PA"; - state.dataOutRptTab->UnitConv(62).siName = "PA"; - state.dataOutRptTab->UnitConv(63).siName = "PA"; - state.dataOutRptTab->UnitConv(64).siName = "S"; - state.dataOutRptTab->UnitConv(65).siName = "V"; - state.dataOutRptTab->UnitConv(66).siName = "W"; - state.dataOutRptTab->UnitConv(67).siName = "W"; - state.dataOutRptTab->UnitConv(68).siName = "W"; - state.dataOutRptTab->UnitConv(69).siName = "W"; - state.dataOutRptTab->UnitConv(70).siName = "W"; - state.dataOutRptTab->UnitConv(71).siName = "W/KG"; - state.dataOutRptTab->UnitConv(72).siName = "W/KG H2O"; // TODO: replace with W/kgWater? or rather just remove - state.dataOutRptTab->UnitConv(73).siName = "W/K"; - state.dataOutRptTab->UnitConv(74).siName = "W/M2"; - state.dataOutRptTab->UnitConv(75).siName = "W/M2"; - state.dataOutRptTab->UnitConv(76).siName = "W/M2-C"; - state.dataOutRptTab->UnitConv(77).siName = "W/M2-K"; - state.dataOutRptTab->UnitConv(78).siName = "W/W"; - state.dataOutRptTab->UnitConv(79).siName = "W/W"; - state.dataOutRptTab->UnitConv(80).siName = "deltaC"; - state.dataOutRptTab->UnitConv(81).siName = "KJ/KG"; - state.dataOutRptTab->UnitConv(82).siName = "W-S/M3"; - state.dataOutRptTab->UnitConv(83).siName = "W-S/M3"; - state.dataOutRptTab->UnitConv(84).siName = "~~$~~/m2"; - state.dataOutRptTab->UnitConv(85).siName = "GJ"; - state.dataOutRptTab->UnitConv(86).siName = "GJ"; - state.dataOutRptTab->UnitConv(87).siName = "GJ"; - state.dataOutRptTab->UnitConv(88).siName = "GJ"; - state.dataOutRptTab->UnitConv(89).siName = "GJ"; - state.dataOutRptTab->UnitConv(90).siName = "GJ"; - state.dataOutRptTab->UnitConv(91).siName = "GJ"; - state.dataOutRptTab->UnitConv(92).siName = "MJ/m2"; - state.dataOutRptTab->UnitConv(93).siName = "MJ/m2"; - state.dataOutRptTab->UnitConv(94).siName = "MJ/m2"; - state.dataOutRptTab->UnitConv(95).siName = "MJ/m2"; - state.dataOutRptTab->UnitConv(96).siName = "Invalid/Undefined"; - state.dataOutRptTab->UnitConv(97).siName = ""; - state.dataOutRptTab->UnitConv(98).siName = "W/C"; - state.dataOutRptTab->UnitConv(99).siName = "DAY"; - state.dataOutRptTab->UnitConv(100).siName = "MIN"; - state.dataOutRptTab->UnitConv(101).siName = "HR/WK"; - state.dataOutRptTab->UnitConv(102).siName = "$"; - state.dataOutRptTab->UnitConv(103).siName = "$/UNIT ENERGY"; - state.dataOutRptTab->UnitConv(104).siName = "KW"; - state.dataOutRptTab->UnitConv(105).siName = " "; - state.dataOutRptTab->UnitConv(106).siName = "AH"; - state.dataOutRptTab->UnitConv(107).siName = "CLO"; - state.dataOutRptTab->UnitConv(108).siName = "J/KG-K"; - state.dataOutRptTab->UnitConv(109).siName = "KGWATER/S"; - state.dataOutRptTab->UnitConv(110).siName = "PPM"; - state.dataOutRptTab->UnitConv(111).siName = "RAD"; - state.dataOutRptTab->UnitConv(112).siName = "REV/MIN"; - state.dataOutRptTab->UnitConv(113).siName = "NM"; - state.dataOutRptTab->UnitConv(114).siName = "BTU/W-H"; // Used for AHRI rating metrics (e.g. SEER) - state.dataOutRptTab->UnitConv(115).siName = "PERSON/M2"; - - state.dataOutRptTab->UnitConv(1).ipName = "%"; - state.dataOutRptTab->UnitConv(2).ipName = "F"; - state.dataOutRptTab->UnitConv(3).ipName = "0=Off 1=On"; - state.dataOutRptTab->UnitConv(4).ipName = "0-No 1-Yes"; - state.dataOutRptTab->UnitConv(5).ipName = "1-Yes 0-No"; - state.dataOutRptTab->UnitConv(6).ipName = "A"; - state.dataOutRptTab->UnitConv(7).ipName = "ACH"; - state.dataOutRptTab->UnitConv(8).ipName = "ach"; - state.dataOutRptTab->UnitConv(9).ipName = "base 50F"; - state.dataOutRptTab->UnitConv(10).ipName = "base 65F"; - state.dataOutRptTab->UnitConv(11).ipName = "F"; - state.dataOutRptTab->UnitConv(12).ipName = "cd/in2"; - state.dataOutRptTab->UnitConv(13).ipName = "deg"; - state.dataOutRptTab->UnitConv(14).ipName = "Frac"; - state.dataOutRptTab->UnitConv(15).ipName = "Hour"; - state.dataOutRptTab->UnitConv(16).ipName = "Hours"; - state.dataOutRptTab->UnitConv(17).ipName = "hr"; - state.dataOutRptTab->UnitConv(18).ipName = "hrs"; - state.dataOutRptTab->UnitConv(19).ipName = "kBtu"; - state.dataOutRptTab->UnitConv(20).ipName = "kWh"; - state.dataOutRptTab->UnitConv(21).ipName = "therm"; - state.dataOutRptTab->UnitConv(22).ipName = "MMBtu"; - state.dataOutRptTab->UnitConv(23).ipName = "Wh"; - state.dataOutRptTab->UnitConv(24).ipName = "ton-hrs"; - state.dataOutRptTab->UnitConv(25).ipName = "Btu/lb"; - state.dataOutRptTab->UnitConv(26).ipName = "Btu/lbWater"; - state.dataOutRptTab->UnitConv(27).ipName = "kBtu/sqft"; - state.dataOutRptTab->UnitConv(28).ipName = "F/ft"; - state.dataOutRptTab->UnitConv(29).ipName = "lb"; - state.dataOutRptTab->UnitConv(30).ipName = "lb/lb"; - state.dataOutRptTab->UnitConv(31).ipName = "lb/ft3"; - state.dataOutRptTab->UnitConv(32).ipName = "lb/s"; - state.dataOutRptTab->UnitConv(33).ipName = "lbWater/lbDryAir"; - state.dataOutRptTab->UnitConv(34).ipName = "lbWater/s"; - state.dataOutRptTab->UnitConv(35).ipName = "kmol/s"; - state.dataOutRptTab->UnitConv(36).ipName = "kmol/sec"; - state.dataOutRptTab->UnitConv(37).ipName = "kWh"; - state.dataOutRptTab->UnitConv(38).ipName = "gal"; - state.dataOutRptTab->UnitConv(39).ipName = "ft3"; - state.dataOutRptTab->UnitConv(40).ipName = "lum/W"; - state.dataOutRptTab->UnitConv(41).ipName = "foot-candles"; - state.dataOutRptTab->UnitConv(42).ipName = "ft"; - state.dataOutRptTab->UnitConv(43).ipName = "in"; - state.dataOutRptTab->UnitConv(44).ipName = "ft/min"; - state.dataOutRptTab->UnitConv(45).ipName = "miles/hr"; - state.dataOutRptTab->UnitConv(46).ipName = "ft2"; - state.dataOutRptTab->UnitConv(47).ipName = "ft2/person"; - state.dataOutRptTab->UnitConv(48).ipName = "ft3"; - state.dataOutRptTab->UnitConv(49).ipName = "gal"; - state.dataOutRptTab->UnitConv(50).ipName = "f3/f2"; - state.dataOutRptTab->UnitConv(51).ipName = "ft3/min"; - state.dataOutRptTab->UnitConv(52).ipName = "gal/min"; - state.dataOutRptTab->UnitConv(53).ipName = "ft3/min-ft2"; - state.dataOutRptTab->UnitConv(54).ipName = "ft3/min-person"; - state.dataOutRptTab->UnitConv(55).ipName = "gal/min-person"; - state.dataOutRptTab->UnitConv(56).ipName = "psi"; - state.dataOutRptTab->UnitConv(57).ipName = "inHg"; - state.dataOutRptTab->UnitConv(58).ipName = "inH2O"; - state.dataOutRptTab->UnitConv(59).ipName = "ftH2O"; - state.dataOutRptTab->UnitConv(60).ipName = "psi"; - state.dataOutRptTab->UnitConv(61).ipName = "inHg"; - state.dataOutRptTab->UnitConv(62).ipName = "inH2O"; - state.dataOutRptTab->UnitConv(63).ipName = "ftH2O"; - state.dataOutRptTab->UnitConv(64).ipName = "s"; - state.dataOutRptTab->UnitConv(65).ipName = "V"; - state.dataOutRptTab->UnitConv(66).ipName = "Btu/h"; - state.dataOutRptTab->UnitConv(67).ipName = "W"; - state.dataOutRptTab->UnitConv(68).ipName = "kW"; - state.dataOutRptTab->UnitConv(69).ipName = "kBtuh"; - state.dataOutRptTab->UnitConv(70).ipName = "ton"; - state.dataOutRptTab->UnitConv(71).ipName = "kBtuh/lb"; - state.dataOutRptTab->UnitConv(72).ipName = "kBtuh/lb"; - state.dataOutRptTab->UnitConv(73).ipName = "Btu/h-F"; - state.dataOutRptTab->UnitConv(74).ipName = "Btu/h-ft2"; - state.dataOutRptTab->UnitConv(75).ipName = "kBtuh/ft2"; - state.dataOutRptTab->UnitConv(76).ipName = "Btu/h-ft2-F"; - state.dataOutRptTab->UnitConv(77).ipName = "Btu/h-ft2-F"; - state.dataOutRptTab->UnitConv(78).ipName = "Btuh/Btuh"; - state.dataOutRptTab->UnitConv(79).ipName = "W/W"; - state.dataOutRptTab->UnitConv(80).ipName = "deltaF"; - state.dataOutRptTab->UnitConv(81).ipName = "Btu/lb"; - state.dataOutRptTab->UnitConv(82).ipName = "W-min/ft3"; - state.dataOutRptTab->UnitConv(83).ipName = "W-min/gal"; - state.dataOutRptTab->UnitConv(84).ipName = "~~$~~/ft2"; - state.dataOutRptTab->UnitConv(85).ipName = "kBtu"; - state.dataOutRptTab->UnitConv(86).ipName = "kWh"; - state.dataOutRptTab->UnitConv(87).ipName = "kWh"; - state.dataOutRptTab->UnitConv(88).ipName = "therm"; - state.dataOutRptTab->UnitConv(89).ipName = "MMBtu"; - state.dataOutRptTab->UnitConv(90).ipName = "Wh"; - state.dataOutRptTab->UnitConv(91).ipName = "ton-hrs"; - state.dataOutRptTab->UnitConv(92).ipName = "kWh/ft2"; - state.dataOutRptTab->UnitConv(93).ipName = "kBtu/ft2"; - state.dataOutRptTab->UnitConv(94).ipName = "kBtu/ft2"; - state.dataOutRptTab->UnitConv(95).ipName = "kWh/m2"; - state.dataOutRptTab->UnitConv(96).ipName = "Invalid/Undefined"; - state.dataOutRptTab->UnitConv(97).ipName = ""; - state.dataOutRptTab->UnitConv(98).ipName = "Btu/h-F"; - state.dataOutRptTab->UnitConv(99).ipName = "day"; - state.dataOutRptTab->UnitConv(100).ipName = "min"; - state.dataOutRptTab->UnitConv(101).ipName = "hr/wk"; - state.dataOutRptTab->UnitConv(102).ipName = "$"; - state.dataOutRptTab->UnitConv(103).ipName = "$/unit energy"; - state.dataOutRptTab->UnitConv(104).ipName = "kW"; - state.dataOutRptTab->UnitConv(105).ipName = " "; - state.dataOutRptTab->UnitConv(106).ipName = "Ah"; - state.dataOutRptTab->UnitConv(107).ipName = "clo"; - state.dataOutRptTab->UnitConv(108).ipName = "Btu/lbm-R"; - state.dataOutRptTab->UnitConv(109).ipName = "lbWater/s"; - state.dataOutRptTab->UnitConv(110).ipName = "ppm"; - state.dataOutRptTab->UnitConv(111).ipName = "rad"; - state.dataOutRptTab->UnitConv(112).ipName = "rev/min"; - state.dataOutRptTab->UnitConv(113).ipName = "lbf-ft"; - state.dataOutRptTab->UnitConv(114).ipName = "Btu/W-h"; - state.dataOutRptTab->UnitConv(115).ipName = "person/ft2"; - - state.dataOutRptTab->UnitConv(1).mult = 1.0; - state.dataOutRptTab->UnitConv(2).mult = 1.8; - state.dataOutRptTab->UnitConv(3).mult = 1.0; - state.dataOutRptTab->UnitConv(4).mult = 1.0; - state.dataOutRptTab->UnitConv(5).mult = 1.0; - state.dataOutRptTab->UnitConv(6).mult = 1.0; - state.dataOutRptTab->UnitConv(7).mult = 1.0; - state.dataOutRptTab->UnitConv(8).mult = 1.0; - state.dataOutRptTab->UnitConv(9).mult = 1.8; - state.dataOutRptTab->UnitConv(10).mult = 1.8; - state.dataOutRptTab->UnitConv(11).mult = 1.8; - state.dataOutRptTab->UnitConv(12).mult = 0.000645160041625726; - state.dataOutRptTab->UnitConv(13).mult = 1.0; - state.dataOutRptTab->UnitConv(14).mult = 1.0; - state.dataOutRptTab->UnitConv(15).mult = 1.0; - state.dataOutRptTab->UnitConv(16).mult = 1.0; - state.dataOutRptTab->UnitConv(17).mult = 1.0; - state.dataOutRptTab->UnitConv(18).mult = 1.0; - state.dataOutRptTab->UnitConv(19).mult = 0.00000094845; - state.dataOutRptTab->UnitConv(20).mult = 0.000000277778; - state.dataOutRptTab->UnitConv(21).mult = 0.0000000094845; - state.dataOutRptTab->UnitConv(22).mult = 0.00000000094845; - state.dataOutRptTab->UnitConv(23).mult = 0.000277777777777778; - state.dataOutRptTab->UnitConv(24).mult = 0.0000000789847; - state.dataOutRptTab->UnitConv(25).mult = 0.00042956; - state.dataOutRptTab->UnitConv(26).mult = 0.0000004302105; - state.dataOutRptTab->UnitConv(27).mult = 0.00000008811404; - state.dataOutRptTab->UnitConv(28).mult = 0.54861322767449; - state.dataOutRptTab->UnitConv(29).mult = 2.2046; - state.dataOutRptTab->UnitConv(30).mult = 1.0; - state.dataOutRptTab->UnitConv(31).mult = 0.062428; - state.dataOutRptTab->UnitConv(32).mult = 2.2046; - state.dataOutRptTab->UnitConv(33).mult = 1.0; - state.dataOutRptTab->UnitConv(34).mult = 2.2046; - state.dataOutRptTab->UnitConv(35).mult = 1.0; - state.dataOutRptTab->UnitConv(36).mult = 1.0; - state.dataOutRptTab->UnitConv(37).mult = 1.0; - state.dataOutRptTab->UnitConv(38).mult = 0.264172037284185; - state.dataOutRptTab->UnitConv(39).mult = 0.0353146624712848; - state.dataOutRptTab->UnitConv(40).mult = 1.0; - state.dataOutRptTab->UnitConv(41).mult = 0.092902267; - state.dataOutRptTab->UnitConv(42).mult = 3.281; - state.dataOutRptTab->UnitConv(43).mult = 39.37; - state.dataOutRptTab->UnitConv(44).mult = 196.86; - state.dataOutRptTab->UnitConv(45).mult = 2.2369; - state.dataOutRptTab->UnitConv(46).mult = 10.764961; - state.dataOutRptTab->UnitConv(47).mult = 10.764961; - state.dataOutRptTab->UnitConv(48).mult = 35.319837041; - state.dataOutRptTab->UnitConv(49).mult = 264.172; - state.dataOutRptTab->UnitConv(50).mult = 3.281; - state.dataOutRptTab->UnitConv(51).mult = 2118.6438; - state.dataOutRptTab->UnitConv(52).mult = 15852.0; - state.dataOutRptTab->UnitConv(53).mult = 196.85; - state.dataOutRptTab->UnitConv(54).mult = 2118.6438; - state.dataOutRptTab->UnitConv(55).mult = 15852.0; - state.dataOutRptTab->UnitConv(56).mult = 0.0001450377; - state.dataOutRptTab->UnitConv(57).mult = 0.00029613; - state.dataOutRptTab->UnitConv(58).mult = 0.00401463; - state.dataOutRptTab->UnitConv(59).mult = 0.00033455; - state.dataOutRptTab->UnitConv(60).mult = 0.0001450377; - state.dataOutRptTab->UnitConv(61).mult = 0.00029613; - state.dataOutRptTab->UnitConv(62).mult = 0.00401463; - state.dataOutRptTab->UnitConv(63).mult = 0.00033455; - state.dataOutRptTab->UnitConv(64).mult = 1.0; - state.dataOutRptTab->UnitConv(65).mult = 1.0; - state.dataOutRptTab->UnitConv(66).mult = 3.412; - state.dataOutRptTab->UnitConv(67).mult = 1.0; - state.dataOutRptTab->UnitConv(68).mult = 0.001; - state.dataOutRptTab->UnitConv(69).mult = 0.00341442; - state.dataOutRptTab->UnitConv(70).mult = 0.0002843333; - state.dataOutRptTab->UnitConv(71).mult = 0.001547673; - state.dataOutRptTab->UnitConv(72).mult = 0.001547673; - state.dataOutRptTab->UnitConv(73).mult = 1.8987; - state.dataOutRptTab->UnitConv(74).mult = 0.316954237; - state.dataOutRptTab->UnitConv(75).mult = 0.000316954237; - state.dataOutRptTab->UnitConv(76).mult = 0.176085687; - state.dataOutRptTab->UnitConv(77).mult = 0.176085687; - state.dataOutRptTab->UnitConv(78).mult = 1.0; - state.dataOutRptTab->UnitConv(79).mult = 1.0; - state.dataOutRptTab->UnitConv(80).mult = 1.8; - state.dataOutRptTab->UnitConv(81).mult = 0.42956; - state.dataOutRptTab->UnitConv(82).mult = 1.0 / 2118.6438; - state.dataOutRptTab->UnitConv(83).mult = 1.0 / 15852; - state.dataOutRptTab->UnitConv(84).mult = 1.0 / 10.764961; - state.dataOutRptTab->UnitConv(85).mult = 0.00000094845 * 1000000000; - state.dataOutRptTab->UnitConv(86).mult = 0.000000277778 * 1000000000; - state.dataOutRptTab->UnitConv(87).mult = 0.000000277778 * 1000000000; - state.dataOutRptTab->UnitConv(88).mult = 0.0000000094845 * 1000000000; - state.dataOutRptTab->UnitConv(89).mult = 0.00000000094845 * 1000000000; - state.dataOutRptTab->UnitConv(90).mult = 0.000277777777777778 * 1000000000; - state.dataOutRptTab->UnitConv(91).mult = 0.0000000789847 * 1000000000; - state.dataOutRptTab->UnitConv(92).mult = 0.277777777777778 / 10.764961; - state.dataOutRptTab->UnitConv(93).mult = 0.94708628903179 / 10.764961; - state.dataOutRptTab->UnitConv(94).mult = 0.94708628903179 / 10.764961; - state.dataOutRptTab->UnitConv(95).mult = 0.27777777777778; - state.dataOutRptTab->UnitConv(96).mult = 1.0; - state.dataOutRptTab->UnitConv(97).mult = 1.0; - state.dataOutRptTab->UnitConv(98).mult = 1.8987; - state.dataOutRptTab->UnitConv(99).mult = 1.0; - state.dataOutRptTab->UnitConv(100).mult = 1.0; - state.dataOutRptTab->UnitConv(101).mult = 1.0; - state.dataOutRptTab->UnitConv(102).mult = 1.0; - state.dataOutRptTab->UnitConv(103).mult = 1.0; - state.dataOutRptTab->UnitConv(104).mult = 1.0; - state.dataOutRptTab->UnitConv(105).mult = 1.0; - state.dataOutRptTab->UnitConv(106).mult = 1.0; - state.dataOutRptTab->UnitConv(107).mult = 1.0; - state.dataOutRptTab->UnitConv(108).mult = 0.000238845896627; - state.dataOutRptTab->UnitConv(109).mult = 2.2046; - state.dataOutRptTab->UnitConv(110).mult = 1.0; - state.dataOutRptTab->UnitConv(111).mult = 1.0; - state.dataOutRptTab->UnitConv(112).mult = 1.0; - state.dataOutRptTab->UnitConv(113).mult = 0.737562149277; - state.dataOutRptTab->UnitConv(114).mult = 1.0; - state.dataOutRptTab->UnitConv(115).mult = 0.09290304; - - state.dataOutRptTab->UnitConv(2).offset = 32.0; - state.dataOutRptTab->UnitConv(11).offset = 32.0; - state.dataOutRptTab->UnitConv(25).offset = 7.6736; - state.dataOutRptTab->UnitConv(81).offset = 7.6736; // 80 is KJ/KG -- should this be multiplied by 1000? - - state.dataOutRptTab->UnitConv(20).hint = "ELEC"; - state.dataOutRptTab->UnitConv(21).hint = "GAS"; - state.dataOutRptTab->UnitConv(24).hint = "COOL"; - state.dataOutRptTab->UnitConv(38).hint = "WATER"; - state.dataOutRptTab->UnitConv(49).hint = "WATER"; - state.dataOutRptTab->UnitConv(52).hint = "WATER"; - state.dataOutRptTab->UnitConv(67).hint = "ELEC"; - state.dataOutRptTab->UnitConv(70).hint = "COOL"; - state.dataOutRptTab->UnitConv(79).hint = "SI"; - state.dataOutRptTab->UnitConv(83).hint = "WATER"; - state.dataOutRptTab->UnitConv(86).hint = "CONSUMP"; - state.dataOutRptTab->UnitConv(87).hint = "ELEC"; - state.dataOutRptTab->UnitConv(88).hint = "GAS"; - state.dataOutRptTab->UnitConv(91).hint = "COOL"; - state.dataOutRptTab->UnitConv(92).hint = "ELEC"; - state.dataOutRptTab->UnitConv(93).hint = "GAS"; - state.dataOutRptTab->UnitConv(93).hint = "ADDITIONAL"; - - state.dataOutRptTab->UnitConv(19).several = true; - state.dataOutRptTab->UnitConv(20).several = true; - state.dataOutRptTab->UnitConv(21).several = true; - state.dataOutRptTab->UnitConv(22).several = true; - state.dataOutRptTab->UnitConv(23).several = true; - state.dataOutRptTab->UnitConv(24).several = true; - state.dataOutRptTab->UnitConv(38).several = true; - state.dataOutRptTab->UnitConv(39).several = true; - state.dataOutRptTab->UnitConv(42).several = true; - state.dataOutRptTab->UnitConv(43).several = true; - state.dataOutRptTab->UnitConv(44).several = true; - state.dataOutRptTab->UnitConv(45).several = true; - state.dataOutRptTab->UnitConv(48).several = true; - state.dataOutRptTab->UnitConv(49).several = true; - state.dataOutRptTab->UnitConv(51).several = true; - state.dataOutRptTab->UnitConv(52).several = true; - state.dataOutRptTab->UnitConv(54).several = true; - state.dataOutRptTab->UnitConv(55).several = true; - state.dataOutRptTab->UnitConv(56).several = true; - state.dataOutRptTab->UnitConv(57).several = true; - state.dataOutRptTab->UnitConv(58).several = true; - state.dataOutRptTab->UnitConv(59).several = true; - state.dataOutRptTab->UnitConv(60).several = true; - state.dataOutRptTab->UnitConv(61).several = true; - state.dataOutRptTab->UnitConv(62).several = true; - state.dataOutRptTab->UnitConv(63).several = true; - state.dataOutRptTab->UnitConv(66).several = true; - state.dataOutRptTab->UnitConv(67).several = true; - state.dataOutRptTab->UnitConv(68).several = true; - state.dataOutRptTab->UnitConv(69).several = true; - state.dataOutRptTab->UnitConv(70).several = true; - state.dataOutRptTab->UnitConv(74).several = true; - state.dataOutRptTab->UnitConv(75).several = true; - state.dataOutRptTab->UnitConv(78).several = true; - state.dataOutRptTab->UnitConv(79).several = true; - state.dataOutRptTab->UnitConv(82).several = true; - state.dataOutRptTab->UnitConv(83).several = true; - state.dataOutRptTab->UnitConv(85).several = true; - state.dataOutRptTab->UnitConv(86).several = true; - state.dataOutRptTab->UnitConv(87).several = true; - state.dataOutRptTab->UnitConv(88).several = true; - state.dataOutRptTab->UnitConv(89).several = true; - state.dataOutRptTab->UnitConv(90).several = true; - state.dataOutRptTab->UnitConv(91).several = true; - state.dataOutRptTab->UnitConv(92).several = true; - state.dataOutRptTab->UnitConv(93).several = true; - state.dataOutRptTab->UnitConv(94).several = true; - state.dataOutRptTab->UnitConv(95).several = true; + auto &ort(state.dataOutRptTab); + + ort->UnitConvSize = 115; + ort->UnitConv.allocate(ort->UnitConvSize); + ort->UnitConv(1).siName = "%"; + ort->UnitConv(2).siName = "°C"; + ort->UnitConv(3).siName = "0=OFF 1=ON"; + ort->UnitConv(4).siName = "0-NO 1-YES"; + ort->UnitConv(5).siName = "1-YES 0-NO"; + ort->UnitConv(6).siName = "A"; + ort->UnitConv(7).siName = "ACH"; + ort->UnitConv(8).siName = "ACH"; + ort->UnitConv(9).siName = "BASE 10C"; + ort->UnitConv(10).siName = "BASE 18C"; + ort->UnitConv(11).siName = "C"; + ort->UnitConv(12).siName = "CD/M2"; + ort->UnitConv(13).siName = "DEG"; + ort->UnitConv(14).siName = "FRAC"; + ort->UnitConv(15).siName = "HOUR"; + ort->UnitConv(16).siName = "HOURS"; + ort->UnitConv(17).siName = "HR"; + ort->UnitConv(18).siName = "HRS"; + ort->UnitConv(19).siName = "J"; + ort->UnitConv(20).siName = "J"; + ort->UnitConv(21).siName = "J"; + ort->UnitConv(22).siName = "J"; + ort->UnitConv(23).siName = "J"; + ort->UnitConv(24).siName = "J"; + ort->UnitConv(25).siName = "J/KG"; + ort->UnitConv(26).siName = "J/KGWATER"; + ort->UnitConv(27).siName = "J/M2"; + ort->UnitConv(28).siName = "K/M"; + ort->UnitConv(29).siName = "KG"; + ort->UnitConv(30).siName = "KG/KG"; + ort->UnitConv(31).siName = "KG/M3"; + ort->UnitConv(32).siName = "KG/S"; + ort->UnitConv(33).siName = "KGWATER/KGDRYAIR"; + ort->UnitConv(34).siName = "KGWATER/SEC"; + ort->UnitConv(35).siName = "KMOL/S"; + ort->UnitConv(36).siName = "KMOL/SEC"; + ort->UnitConv(37).siName = "KWH"; + ort->UnitConv(38).siName = "L"; + ort->UnitConv(39).siName = "L"; + ort->UnitConv(40).siName = "LUM/W"; + ort->UnitConv(41).siName = "LUX"; + ort->UnitConv(42).siName = "M"; + ort->UnitConv(43).siName = "M"; + ort->UnitConv(44).siName = "M/S"; + ort->UnitConv(45).siName = "M/S"; + ort->UnitConv(46).siName = "M2"; + ort->UnitConv(47).siName = "M2/PERSON"; + ort->UnitConv(48).siName = "M3"; + ort->UnitConv(49).siName = "M3"; + ort->UnitConv(50).siName = "M3/M2"; + ort->UnitConv(51).siName = "M3/S"; + ort->UnitConv(52).siName = "M3/S"; + ort->UnitConv(53).siName = "M3/S-M2"; + ort->UnitConv(54).siName = "M3/S-PERSON"; + ort->UnitConv(55).siName = "M3/S-PERSON"; + ort->UnitConv(56).siName = "PA"; + ort->UnitConv(57).siName = "PA"; + ort->UnitConv(58).siName = "PA"; + ort->UnitConv(59).siName = "PA"; + ort->UnitConv(60).siName = "PA"; + ort->UnitConv(61).siName = "PA"; + ort->UnitConv(62).siName = "PA"; + ort->UnitConv(63).siName = "PA"; + ort->UnitConv(64).siName = "S"; + ort->UnitConv(65).siName = "V"; + ort->UnitConv(66).siName = "W"; + ort->UnitConv(67).siName = "W"; + ort->UnitConv(68).siName = "W"; + ort->UnitConv(69).siName = "W"; + ort->UnitConv(70).siName = "W"; + ort->UnitConv(71).siName = "W/KG"; + ort->UnitConv(72).siName = "W/KG H2O"; // TODO: replace with W/kgWater? or rather just remove + ort->UnitConv(73).siName = "W/K"; + ort->UnitConv(74).siName = "W/M2"; + ort->UnitConv(75).siName = "W/M2"; + ort->UnitConv(76).siName = "W/M2-C"; + ort->UnitConv(77).siName = "W/M2-K"; + ort->UnitConv(78).siName = "W/W"; + ort->UnitConv(79).siName = "W/W"; + ort->UnitConv(80).siName = "deltaC"; + ort->UnitConv(81).siName = "KJ/KG"; + ort->UnitConv(82).siName = "W-S/M3"; + ort->UnitConv(83).siName = "W-S/M3"; + ort->UnitConv(84).siName = "~~$~~/m2"; + ort->UnitConv(85).siName = "GJ"; + ort->UnitConv(86).siName = "GJ"; + ort->UnitConv(87).siName = "GJ"; + ort->UnitConv(88).siName = "GJ"; + ort->UnitConv(89).siName = "GJ"; + ort->UnitConv(90).siName = "GJ"; + ort->UnitConv(91).siName = "GJ"; + ort->UnitConv(92).siName = "MJ/m2"; + ort->UnitConv(93).siName = "MJ/m2"; + ort->UnitConv(94).siName = "MJ/m2"; + ort->UnitConv(95).siName = "MJ/m2"; + ort->UnitConv(96).siName = "Invalid/Undefined"; + ort->UnitConv(97).siName = ""; + ort->UnitConv(98).siName = "W/C"; + ort->UnitConv(99).siName = "DAY"; + ort->UnitConv(100).siName = "MIN"; + ort->UnitConv(101).siName = "HR/WK"; + ort->UnitConv(102).siName = "$"; + ort->UnitConv(103).siName = "$/UNIT ENERGY"; + ort->UnitConv(104).siName = "KW"; + ort->UnitConv(105).siName = " "; + ort->UnitConv(106).siName = "AH"; + ort->UnitConv(107).siName = "CLO"; + ort->UnitConv(108).siName = "J/KG-K"; + ort->UnitConv(109).siName = "KGWATER/S"; + ort->UnitConv(110).siName = "PPM"; + ort->UnitConv(111).siName = "RAD"; + ort->UnitConv(112).siName = "REV/MIN"; + ort->UnitConv(113).siName = "NM"; + ort->UnitConv(114).siName = "BTU/W-H"; // Used for AHRI rating metrics (e.g. SEER) + ort->UnitConv(115).siName = "PERSON/M2"; + + ort->UnitConv(1).ipName = "%"; + ort->UnitConv(2).ipName = "F"; + ort->UnitConv(3).ipName = "0=Off 1=On"; + ort->UnitConv(4).ipName = "0-No 1-Yes"; + ort->UnitConv(5).ipName = "1-Yes 0-No"; + ort->UnitConv(6).ipName = "A"; + ort->UnitConv(7).ipName = "ACH"; + ort->UnitConv(8).ipName = "ach"; + ort->UnitConv(9).ipName = "base 50F"; + ort->UnitConv(10).ipName = "base 65F"; + ort->UnitConv(11).ipName = "F"; + ort->UnitConv(12).ipName = "cd/in2"; + ort->UnitConv(13).ipName = "deg"; + ort->UnitConv(14).ipName = "Frac"; + ort->UnitConv(15).ipName = "Hour"; + ort->UnitConv(16).ipName = "Hours"; + ort->UnitConv(17).ipName = "hr"; + ort->UnitConv(18).ipName = "hrs"; + ort->UnitConv(19).ipName = "kBtu"; + ort->UnitConv(20).ipName = "kWh"; + ort->UnitConv(21).ipName = "therm"; + ort->UnitConv(22).ipName = "MMBtu"; + ort->UnitConv(23).ipName = "Wh"; + ort->UnitConv(24).ipName = "ton-hrs"; + ort->UnitConv(25).ipName = "Btu/lb"; + ort->UnitConv(26).ipName = "Btu/lbWater"; + ort->UnitConv(27).ipName = "kBtu/sqft"; + ort->UnitConv(28).ipName = "F/ft"; + ort->UnitConv(29).ipName = "lb"; + ort->UnitConv(30).ipName = "lb/lb"; + ort->UnitConv(31).ipName = "lb/ft3"; + ort->UnitConv(32).ipName = "lb/s"; + ort->UnitConv(33).ipName = "lbWater/lbDryAir"; + ort->UnitConv(34).ipName = "lbWater/s"; + ort->UnitConv(35).ipName = "kmol/s"; + ort->UnitConv(36).ipName = "kmol/sec"; + ort->UnitConv(37).ipName = "kWh"; + ort->UnitConv(38).ipName = "gal"; + ort->UnitConv(39).ipName = "ft3"; + ort->UnitConv(40).ipName = "lum/W"; + ort->UnitConv(41).ipName = "foot-candles"; + ort->UnitConv(42).ipName = "ft"; + ort->UnitConv(43).ipName = "in"; + ort->UnitConv(44).ipName = "ft/min"; + ort->UnitConv(45).ipName = "miles/hr"; + ort->UnitConv(46).ipName = "ft2"; + ort->UnitConv(47).ipName = "ft2/person"; + ort->UnitConv(48).ipName = "ft3"; + ort->UnitConv(49).ipName = "gal"; + ort->UnitConv(50).ipName = "f3/f2"; + ort->UnitConv(51).ipName = "ft3/min"; + ort->UnitConv(52).ipName = "gal/min"; + ort->UnitConv(53).ipName = "ft3/min-ft2"; + ort->UnitConv(54).ipName = "ft3/min-person"; + ort->UnitConv(55).ipName = "gal/min-person"; + ort->UnitConv(56).ipName = "psi"; + ort->UnitConv(57).ipName = "inHg"; + ort->UnitConv(58).ipName = "inH2O"; + ort->UnitConv(59).ipName = "ftH2O"; + ort->UnitConv(60).ipName = "psi"; + ort->UnitConv(61).ipName = "inHg"; + ort->UnitConv(62).ipName = "inH2O"; + ort->UnitConv(63).ipName = "ftH2O"; + ort->UnitConv(64).ipName = "s"; + ort->UnitConv(65).ipName = "V"; + ort->UnitConv(66).ipName = "Btu/h"; + ort->UnitConv(67).ipName = "W"; + ort->UnitConv(68).ipName = "kW"; + ort->UnitConv(69).ipName = "kBtuh"; + ort->UnitConv(70).ipName = "ton"; + ort->UnitConv(71).ipName = "kBtuh/lb"; + ort->UnitConv(72).ipName = "kBtuh/lb"; + ort->UnitConv(73).ipName = "Btu/h-F"; + ort->UnitConv(74).ipName = "Btu/h-ft2"; + ort->UnitConv(75).ipName = "kBtuh/ft2"; + ort->UnitConv(76).ipName = "Btu/h-ft2-F"; + ort->UnitConv(77).ipName = "Btu/h-ft2-F"; + ort->UnitConv(78).ipName = "Btuh/Btuh"; + ort->UnitConv(79).ipName = "W/W"; + ort->UnitConv(80).ipName = "deltaF"; + ort->UnitConv(81).ipName = "Btu/lb"; + ort->UnitConv(82).ipName = "W-min/ft3"; + ort->UnitConv(83).ipName = "W-min/gal"; + ort->UnitConv(84).ipName = "~~$~~/ft2"; + ort->UnitConv(85).ipName = "kBtu"; + ort->UnitConv(86).ipName = "kWh"; + ort->UnitConv(87).ipName = "kWh"; + ort->UnitConv(88).ipName = "therm"; + ort->UnitConv(89).ipName = "MMBtu"; + ort->UnitConv(90).ipName = "Wh"; + ort->UnitConv(91).ipName = "ton-hrs"; + ort->UnitConv(92).ipName = "kWh/ft2"; + ort->UnitConv(93).ipName = "kBtu/ft2"; + ort->UnitConv(94).ipName = "kBtu/ft2"; + ort->UnitConv(95).ipName = "kWh/m2"; + ort->UnitConv(96).ipName = "Invalid/Undefined"; + ort->UnitConv(97).ipName = ""; + ort->UnitConv(98).ipName = "Btu/h-F"; + ort->UnitConv(99).ipName = "day"; + ort->UnitConv(100).ipName = "min"; + ort->UnitConv(101).ipName = "hr/wk"; + ort->UnitConv(102).ipName = "$"; + ort->UnitConv(103).ipName = "$/unit energy"; + ort->UnitConv(104).ipName = "kW"; + ort->UnitConv(105).ipName = " "; + ort->UnitConv(106).ipName = "Ah"; + ort->UnitConv(107).ipName = "clo"; + ort->UnitConv(108).ipName = "Btu/lbm-R"; + ort->UnitConv(109).ipName = "lbWater/s"; + ort->UnitConv(110).ipName = "ppm"; + ort->UnitConv(111).ipName = "rad"; + ort->UnitConv(112).ipName = "rev/min"; + ort->UnitConv(113).ipName = "lbf-ft"; + ort->UnitConv(114).ipName = "Btu/W-h"; + ort->UnitConv(115).ipName = "person/ft2"; + + ort->UnitConv(1).mult = 1.0; + ort->UnitConv(2).mult = 1.8; + ort->UnitConv(3).mult = 1.0; + ort->UnitConv(4).mult = 1.0; + ort->UnitConv(5).mult = 1.0; + ort->UnitConv(6).mult = 1.0; + ort->UnitConv(7).mult = 1.0; + ort->UnitConv(8).mult = 1.0; + ort->UnitConv(9).mult = 1.8; + ort->UnitConv(10).mult = 1.8; + ort->UnitConv(11).mult = 1.8; + ort->UnitConv(12).mult = 0.000645160041625726; + ort->UnitConv(13).mult = 1.0; + ort->UnitConv(14).mult = 1.0; + ort->UnitConv(15).mult = 1.0; + ort->UnitConv(16).mult = 1.0; + ort->UnitConv(17).mult = 1.0; + ort->UnitConv(18).mult = 1.0; + ort->UnitConv(19).mult = 0.00000094845; + ort->UnitConv(20).mult = 0.000000277778; + ort->UnitConv(21).mult = 0.0000000094845; + ort->UnitConv(22).mult = 0.00000000094845; + ort->UnitConv(23).mult = 0.000277777777777778; + ort->UnitConv(24).mult = 0.0000000789847; + ort->UnitConv(25).mult = 0.00042956; + ort->UnitConv(26).mult = 0.0000004302105; + ort->UnitConv(27).mult = 0.00000008811404; + ort->UnitConv(28).mult = 0.54861322767449; + ort->UnitConv(29).mult = 2.2046; + ort->UnitConv(30).mult = 1.0; + ort->UnitConv(31).mult = 0.062428; + ort->UnitConv(32).mult = 2.2046; + ort->UnitConv(33).mult = 1.0; + ort->UnitConv(34).mult = 2.2046; + ort->UnitConv(35).mult = 1.0; + ort->UnitConv(36).mult = 1.0; + ort->UnitConv(37).mult = 1.0; + ort->UnitConv(38).mult = 0.264172037284185; + ort->UnitConv(39).mult = 0.0353146624712848; + ort->UnitConv(40).mult = 1.0; + ort->UnitConv(41).mult = 0.092902267; + ort->UnitConv(42).mult = 3.281; + ort->UnitConv(43).mult = 39.37; + ort->UnitConv(44).mult = 196.86; + ort->UnitConv(45).mult = 2.2369; + ort->UnitConv(46).mult = 10.764961; + ort->UnitConv(47).mult = 10.764961; + ort->UnitConv(48).mult = 35.319837041; + ort->UnitConv(49).mult = 264.172; + ort->UnitConv(50).mult = 3.281; + ort->UnitConv(51).mult = 2118.6438; + ort->UnitConv(52).mult = 15852.0; + ort->UnitConv(53).mult = 196.85; + ort->UnitConv(54).mult = 2118.6438; + ort->UnitConv(55).mult = 15852.0; + ort->UnitConv(56).mult = 0.0001450377; + ort->UnitConv(57).mult = 0.00029613; + ort->UnitConv(58).mult = 0.00401463; + ort->UnitConv(59).mult = 0.00033455; + ort->UnitConv(60).mult = 0.0001450377; + ort->UnitConv(61).mult = 0.00029613; + ort->UnitConv(62).mult = 0.00401463; + ort->UnitConv(63).mult = 0.00033455; + ort->UnitConv(64).mult = 1.0; + ort->UnitConv(65).mult = 1.0; + ort->UnitConv(66).mult = 3.412; + ort->UnitConv(67).mult = 1.0; + ort->UnitConv(68).mult = 0.001; + ort->UnitConv(69).mult = 0.00341442; + ort->UnitConv(70).mult = 0.0002843333; + ort->UnitConv(71).mult = 0.001547673; + ort->UnitConv(72).mult = 0.001547673; + ort->UnitConv(73).mult = 1.8987; + ort->UnitConv(74).mult = 0.316954237; + ort->UnitConv(75).mult = 0.000316954237; + ort->UnitConv(76).mult = 0.176085687; + ort->UnitConv(77).mult = 0.176085687; + ort->UnitConv(78).mult = 1.0; + ort->UnitConv(79).mult = 1.0; + ort->UnitConv(80).mult = 1.8; + ort->UnitConv(81).mult = 0.42956; + ort->UnitConv(82).mult = 1.0 / 2118.6438; + ort->UnitConv(83).mult = 1.0 / 15852; + ort->UnitConv(84).mult = 1.0 / 10.764961; + ort->UnitConv(85).mult = 0.00000094845 * 1000000000; + ort->UnitConv(86).mult = 0.000000277778 * 1000000000; + ort->UnitConv(87).mult = 0.000000277778 * 1000000000; + ort->UnitConv(88).mult = 0.0000000094845 * 1000000000; + ort->UnitConv(89).mult = 0.00000000094845 * 1000000000; + ort->UnitConv(90).mult = 0.000277777777777778 * 1000000000; + ort->UnitConv(91).mult = 0.0000000789847 * 1000000000; + ort->UnitConv(92).mult = 0.277777777777778 / 10.764961; + ort->UnitConv(93).mult = 0.94708628903179 / 10.764961; + ort->UnitConv(94).mult = 0.94708628903179 / 10.764961; + ort->UnitConv(95).mult = 0.27777777777778; + ort->UnitConv(96).mult = 1.0; + ort->UnitConv(97).mult = 1.0; + ort->UnitConv(98).mult = 1.8987; + ort->UnitConv(99).mult = 1.0; + ort->UnitConv(100).mult = 1.0; + ort->UnitConv(101).mult = 1.0; + ort->UnitConv(102).mult = 1.0; + ort->UnitConv(103).mult = 1.0; + ort->UnitConv(104).mult = 1.0; + ort->UnitConv(105).mult = 1.0; + ort->UnitConv(106).mult = 1.0; + ort->UnitConv(107).mult = 1.0; + ort->UnitConv(108).mult = 0.000238845896627; + ort->UnitConv(109).mult = 2.2046; + ort->UnitConv(110).mult = 1.0; + ort->UnitConv(111).mult = 1.0; + ort->UnitConv(112).mult = 1.0; + ort->UnitConv(113).mult = 0.737562149277; + ort->UnitConv(114).mult = 1.0; + ort->UnitConv(115).mult = 0.09290304; + + ort->UnitConv(2).offset = 32.0; + ort->UnitConv(11).offset = 32.0; + ort->UnitConv(25).offset = 7.6736; + ort->UnitConv(81).offset = 7.6736; // 80 is KJ/KG -- should this be multiplied by 1000? + + ort->UnitConv(20).hint = "ELEC"; + ort->UnitConv(21).hint = "GAS"; + ort->UnitConv(24).hint = "COOL"; + ort->UnitConv(38).hint = "WATER"; + ort->UnitConv(49).hint = "WATER"; + ort->UnitConv(52).hint = "WATER"; + ort->UnitConv(67).hint = "ELEC"; + ort->UnitConv(70).hint = "COOL"; + ort->UnitConv(79).hint = "SI"; + ort->UnitConv(83).hint = "WATER"; + ort->UnitConv(86).hint = "CONSUMP"; + ort->UnitConv(87).hint = "ELEC"; + ort->UnitConv(88).hint = "GAS"; + ort->UnitConv(91).hint = "COOL"; + ort->UnitConv(92).hint = "ELEC"; + ort->UnitConv(93).hint = "GAS"; + ort->UnitConv(93).hint = "ADDITIONAL"; + + ort->UnitConv(19).several = true; + ort->UnitConv(20).several = true; + ort->UnitConv(21).several = true; + ort->UnitConv(22).several = true; + ort->UnitConv(23).several = true; + ort->UnitConv(24).several = true; + ort->UnitConv(38).several = true; + ort->UnitConv(39).several = true; + ort->UnitConv(42).several = true; + ort->UnitConv(43).several = true; + ort->UnitConv(44).several = true; + ort->UnitConv(45).several = true; + ort->UnitConv(48).several = true; + ort->UnitConv(49).several = true; + ort->UnitConv(51).several = true; + ort->UnitConv(52).several = true; + ort->UnitConv(54).several = true; + ort->UnitConv(55).several = true; + ort->UnitConv(56).several = true; + ort->UnitConv(57).several = true; + ort->UnitConv(58).several = true; + ort->UnitConv(59).several = true; + ort->UnitConv(60).several = true; + ort->UnitConv(61).several = true; + ort->UnitConv(62).several = true; + ort->UnitConv(63).several = true; + ort->UnitConv(66).several = true; + ort->UnitConv(67).several = true; + ort->UnitConv(68).several = true; + ort->UnitConv(69).several = true; + ort->UnitConv(70).several = true; + ort->UnitConv(74).several = true; + ort->UnitConv(75).several = true; + ort->UnitConv(78).several = true; + ort->UnitConv(79).several = true; + ort->UnitConv(82).several = true; + ort->UnitConv(83).several = true; + ort->UnitConv(85).several = true; + ort->UnitConv(86).several = true; + ort->UnitConv(87).several = true; + ort->UnitConv(88).several = true; + ort->UnitConv(89).several = true; + ort->UnitConv(90).several = true; + ort->UnitConv(91).several = true; + ort->UnitConv(92).several = true; + ort->UnitConv(93).several = true; + ort->UnitConv(94).several = true; + ort->UnitConv(95).several = true; } std::string GetUnitSubString(std::string const &inString) // Input String @@ -15879,6 +15950,7 @@ namespace EnergyPlus::OutputReportTabular { int const misBrce(3); int const misNoHint(4); std::string const stringInUpper(UtilityRoutines::MakeUPPERCase(stringInWithSI)); + auto &ort(state.dataOutRptTab); stringOutWithIP = ""; // check if string has brackets or parentheses @@ -15908,14 +15980,14 @@ namespace EnergyPlus::OutputReportTabular { int defaultConv = 0; int foundConv = 0; int firstOfSeveral = 0; - for (int iUnit = 1; iUnit <= state.dataOutRptTab->UnitConvSize; ++iUnit) { - if (UtilityRoutines::SameString(state.dataOutRptTab->UnitConv(iUnit).siName, unitSIOnly)) { - if (state.dataOutRptTab->UnitConv(iUnit).several) { + for (int iUnit = 1; iUnit <= ort->UnitConvSize; ++iUnit) { + if (UtilityRoutines::SameString(ort->UnitConv(iUnit).siName, unitSIOnly)) { + if (ort->UnitConv(iUnit).several) { if (firstOfSeveral == 0) firstOfSeveral = iUnit; - if (state.dataOutRptTab->UnitConv(iUnit).is_default) defaultConv = iUnit; + if (ort->UnitConv(iUnit).is_default) defaultConv = iUnit; // look for the hint string - if (len(state.dataOutRptTab->UnitConv(iUnit).hint) > 0) { - if (has(stringInUpper, state.dataOutRptTab->UnitConv(iUnit).hint)) { + if (len(ort->UnitConv(iUnit).hint) > 0) { + if (has(stringInUpper, ort->UnitConv(iUnit).hint)) { foundConv = iUnit; break; } @@ -15947,13 +16019,13 @@ namespace EnergyPlus::OutputReportTabular { // if one was selected substitute the units into the output string if (selectedConv > 0) { if (modeInString == misBrac) { - stringOutWithIP = stringInWithSI.substr(0, posLBrac + 1) + state.dataOutRptTab->UnitConv(selectedConv).ipName + stringInWithSI.substr(posRBrac); + stringOutWithIP = stringInWithSI.substr(0, posLBrac + 1) + ort->UnitConv(selectedConv).ipName + stringInWithSI.substr(posRBrac); } else if (modeInString == misParen) { - stringOutWithIP = stringInWithSI.substr(0, posLParen + 1) + state.dataOutRptTab->UnitConv(selectedConv).ipName + stringInWithSI.substr(posRParen); + stringOutWithIP = stringInWithSI.substr(0, posLParen + 1) + ort->UnitConv(selectedConv).ipName + stringInWithSI.substr(posRParen); } else if (modeInString == misBrce) { - stringOutWithIP = stringInWithSI.substr(0, posLBrce + 1) + state.dataOutRptTab->UnitConv(selectedConv).ipName + stringInWithSI.substr(posRBrce); + stringOutWithIP = stringInWithSI.substr(0, posLBrce + 1) + ort->UnitConv(selectedConv).ipName + stringInWithSI.substr(posRBrce); } else if (modeInString == misNoHint) { - stringOutWithIP = state.dataOutRptTab->UnitConv(selectedConv).ipName; + stringOutWithIP = ort->UnitConv(selectedConv).ipName; } } else { // if no conversion just output the input string @@ -16033,10 +16105,13 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na + + auto &ort(state.dataOutRptTab); + if (unitConvIndex == 0 || SIvalue == -999.0 || SIvalue == -99999.0) { // don't convert unknown data to IP ConvertIP = SIvalue; - } else if ((unitConvIndex > 0) && (unitConvIndex <= state.dataOutRptTab->UnitConvSize)) { - ConvertIP = (SIvalue * state.dataOutRptTab->UnitConv(unitConvIndex).mult) + state.dataOutRptTab->UnitConv(unitConvIndex).offset; + } else if ((unitConvIndex > 0) && (unitConvIndex <= ort->UnitConvSize)) { + ConvertIP = (SIvalue * ort->UnitConv(unitConvIndex).mult) + ort->UnitConv(unitConvIndex).offset; } else { ConvertIP = SIvalue; } @@ -16083,10 +16158,12 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na + auto &ort(state.dataOutRptTab); + if (unitConvIndex == 0) { ConvertIPdelta = SIvalue; - } else if ((unitConvIndex > 0) && (unitConvIndex <= state.dataOutRptTab->UnitConvSize)) { - ConvertIPdelta = SIvalue * state.dataOutRptTab->UnitConv(unitConvIndex).mult; + } else if ((unitConvIndex > 0) && (unitConvIndex <= ort->UnitConvSize)) { + ConvertIPdelta = SIvalue * ort->UnitConv(unitConvIndex).mult; } else { ConvertIPdelta = SIvalue; } @@ -16130,10 +16207,13 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na - if ((unitConvIndex > 0) && (unitConvIndex <= state.dataOutRptTab->UnitConvSize)) { - multiplier = state.dataOutRptTab->UnitConv(unitConvIndex).mult; - offset = state.dataOutRptTab->UnitConv(unitConvIndex).offset; - IPunit = state.dataOutRptTab->UnitConv(unitConvIndex).ipName; + + auto &ort(state.dataOutRptTab); + + if ((unitConvIndex > 0) && (unitConvIndex <= ort->UnitConvSize)) { + multiplier = ort->UnitConv(unitConvIndex).mult; + offset = ort->UnitConv(unitConvIndex).offset; + IPunit = ort->UnitConv(unitConvIndex).ipName; } else { multiplier = 1.0; offset = 0.0; @@ -16185,17 +16265,18 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static int found(0); static int iUnit(0); + auto &ort(state.dataOutRptTab); - for (iUnit = 1; iUnit <= state.dataOutRptTab->UnitConvSize; ++iUnit) { - if (UtilityRoutines::SameString(state.dataOutRptTab->UnitConv(iUnit).siName, SIunit)) { - if (UtilityRoutines::SameString(state.dataOutRptTab->UnitConv(iUnit).ipName, IPunit)) { + for (iUnit = 1; iUnit <= ort->UnitConvSize; ++iUnit) { + if (UtilityRoutines::SameString(ort->UnitConv(iUnit).siName, SIunit)) { + if (UtilityRoutines::SameString(ort->UnitConv(iUnit).ipName, IPunit)) { found = iUnit; break; } } } if (found != 0) { - getSpecificUnitMultiplier = state.dataOutRptTab->UnitConv(found).mult; + getSpecificUnitMultiplier = ort->UnitConv(found).mult; } else { ShowWarningError(state, "Unable to find a unit conversion from " + SIunit + " to " + IPunit); ShowContinueError(state, "Applying default conversion factor of 1.0"); @@ -16300,10 +16381,11 @@ namespace EnergyPlus::OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static int found(0); static int iUnit(0); + auto &ort(state.dataOutRptTab); - for (iUnit = 1; iUnit <= state.dataOutRptTab->UnitConvSize; ++iUnit) { - if (UtilityRoutines::SameString(state.dataOutRptTab->UnitConv(iUnit).siName, SIunit)) { - if (UtilityRoutines::SameString(state.dataOutRptTab->UnitConv(iUnit).ipName, IPunit)) { + for (iUnit = 1; iUnit <= ort->UnitConvSize; ++iUnit) { + if (UtilityRoutines::SameString(ort->UnitConv(iUnit).siName, SIunit)) { + if (UtilityRoutines::SameString(ort->UnitConv(iUnit).ipName, IPunit)) { found = iUnit; break; } From e832cda37b5af30e121c539f377fa16f28ca06db Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 22 Dec 2020 18:37:44 -0700 Subject: [PATCH 13/14] statics cleanup, bump CI --- src/EnergyPlus/ChillerAbsorption.cc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index 795443f2281..b8b1acfb543 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -76,9 +76,7 @@ #include #include -namespace EnergyPlus { - -namespace ChillerAbsorption { +namespace EnergyPlus::ChillerAbsorption { // MODULE INFORMATION: // AUTHOR Dan Fisher @@ -231,7 +229,7 @@ namespace ChillerAbsorption { // METHODOLOGY EMPLOYED: // EnergyPlus input processor - static std::string const RoutineName("GetBLASTAbsorberInput: "); // include trailing blank space + constexpr const char * RoutineName("GetBLASTAbsorberInput: "); // include trailing blank space int AbsorberNum; // Absorber counter int NumAlphas; // Number of elements in the alpha array @@ -602,7 +600,7 @@ namespace ChillerAbsorption { // METHODOLOGY EMPLOYED: // Uses the status flags to trigger initializations. - static std::string const RoutineName("InitBLASTAbsorberModel"); + constexpr const char * RoutineName("InitBLASTAbsorberModel"); // Init more variables if (this->MyOneTimeFlag) { @@ -870,8 +868,8 @@ namespace ChillerAbsorption { // Real64 SteamMassFlowRate; // steam mass flow rate through generator - static std::string const RoutineName("SizeAbsorpChiller"); - static std::string const RoutineNameLong("SizeAbsorptionChiller"); + constexpr const char * RoutineName("SizeAbsorpChiller"); + constexpr const char * RoutineNameLong("SizeAbsorptionChiller"); int PltSizSteamNum(0); // Plant Sizing index for steam heating loop int PltSizHeatingNum(0); // Plant Sizing index for how water heating loop @@ -1371,7 +1369,7 @@ namespace ChillerAbsorption { // 1. BLAST User Manual // 2. Absorber User Manual - static std::string const RoutineName("CalcBLASTAbsorberModel"); + constexpr const char * RoutineName("CalcBLASTAbsorberModel"); Real64 EvapDeltaTemp(0.0); // C - evaporator temperature difference, water side @@ -1802,6 +1800,4 @@ namespace ChillerAbsorption { } } -} // namespace ChillerAbsorption - } // namespace EnergyPlus From 890fd55d26356a38537c1669e1b3aaece84bde6c Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 24 Dec 2020 08:01:09 -0700 Subject: [PATCH 14/14] fix unit test --- tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc b/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc index f116a990743..7e1aaef771d 100644 --- a/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc +++ b/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc @@ -411,6 +411,9 @@ TEST_F(EnergyPlusFixture, Test_UnitaryHybridAirConditioner_Unittest) state->dataSysRpts->ZoneMechACH.allocate(state->dataGlobal->NumOfZones); MAT.allocate(state->dataGlobal->NumOfZones); ZoneAirHumRatAvg.allocate(state->dataGlobal->NumOfZones); + state->dataSysRpts->MaxHeatingLoadMetByVent.allocate(state->dataGlobal->NumOfZones); + state->dataSysRpts->MaxOverheatingByVent.allocate(state->dataGlobal->NumOfZones); + state->dataSysRpts->MaxCoolingLoadMetByVent.allocate(state->dataGlobal->NumOfZones); state->dataSysRpts->MaxOvercoolingByVent.allocate(state->dataGlobal->NumOfZones); ZoneSysEnergyDemand(1).TotalOutputRequired = 58469.99445; DeadBandOrSetback(1) = false;