LCOV - code coverage report
Current view: top level - EnergyPlus - OutputReportTabular.hh (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 100.0 % 292 292
Test Date: 2025-05-22 16:09:37 Functions: 100.0 % 14 14

            Line data    Source code
       1              : // EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
       2              : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3              : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4              : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5              : // contributors. All rights reserved.
       6              : //
       7              : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8              : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9              : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10              : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11              : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12              : //
      13              : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14              : // provided that the following conditions are met:
      15              : //
      16              : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17              : //     conditions and the following disclaimer.
      18              : //
      19              : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20              : //     conditions and the following disclaimer in the documentation and/or other materials
      21              : //     provided with the distribution.
      22              : //
      23              : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24              : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25              : //     used to endorse or promote products derived from this software without specific prior
      26              : //     written permission.
      27              : //
      28              : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29              : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30              : //     reference solely to the software portion of its product, Licensee must refer to the
      31              : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32              : //     obtained under this License and may not use a different name for the software. Except as
      33              : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34              : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35              : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36              : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37              : //
      38              : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39              : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40              : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41              : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42              : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43              : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44              : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45              : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46              : // POSSIBILITY OF SUCH DAMAGE.
      47              : 
      48              : #ifndef OutputReportTabular_hh_INCLUDED
      49              : #define OutputReportTabular_hh_INCLUDED
      50              : 
      51              : // C++ Headers
      52              : #include <fstream>
      53              : #include <string>
      54              : 
      55              : // ObjexxFCL Headers
      56              : #include <ObjexxFCL/Array1D.hh>
      57              : #include <ObjexxFCL/Array1S.hh>
      58              : #include <ObjexxFCL/Array2D.hh>
      59              : #include <ObjexxFCL/Array2S.hh>
      60              : #include <ObjexxFCL/Array3D.hh>
      61              : #include <ObjexxFCL/Optional.hh>
      62              : 
      63              : // EnergyPlus Headers
      64              : #include <EnergyPlus/Data/BaseData.hh>
      65              : #include <EnergyPlus/DataGlobalConstants.hh>
      66              : #include <EnergyPlus/DataGlobals.hh>
      67              : #include <EnergyPlus/DataHeatBalance.hh>
      68              : #include <EnergyPlus/DataSizing.hh>
      69              : #include <EnergyPlus/EnergyPlus.hh>
      70              : #include <EnergyPlus/FileSystem.hh>
      71              : #include <EnergyPlus/OutputProcessor.hh>
      72              : #include <EnergyPlus/WeatherManager.hh>
      73              : 
      74              : namespace EnergyPlus {
      75              : 
      76              : // Forward declarations
      77              : struct EnergyPlusData;
      78              : 
      79              : namespace OutputReportTabular {
      80              : 
      81              :     // Using/Aliasing
      82              : 
      83              :     // Data
      84              :     // MODULE PARAMETER DEFINITIONS:
      85              : 
      86              :     enum class AggType
      87              :     {
      88              :         Invalid = -1,
      89              :         SumOrAvg,
      90              :         Maximum,
      91              :         Minimum,
      92              :         ValueWhenMaxMin,
      93              :         HoursZero,
      94              :         HoursNonZero,
      95              :         HoursPositive,
      96              :         HoursNonPositive,
      97              :         HoursNegative,
      98              :         HoursNonNegative,
      99              :         SumOrAverageHoursShown,
     100              :         MaximumDuringHoursShown,
     101              :         MinimumDuringHoursShown,
     102              :         Num
     103              :     };
     104              : 
     105              :     enum class TableStyle
     106              :     {
     107              :         Invalid = -1,
     108              :         Comma,
     109              :         Tab,
     110              :         Fixed,
     111              :         HTML,
     112              :         XML,
     113              :         Num
     114              :     };
     115              : 
     116              :     enum class UnitsStyle
     117              :     {
     118              :         Invalid = -1,
     119              :         None,
     120              :         JtoKWH,
     121              :         JtoMJ,
     122              :         JtoGJ,
     123              :         InchPound,
     124              :         InchPoundExceptElectricity,
     125              :         NotFound,
     126              :         Num
     127              :     };
     128              :     constexpr std::array<std::string_view, static_cast<int>(UnitsStyle::Num) - 1> UnitsStyleNamesUC{
     129              :         "NONE", "JTOKWH", "JTOMJ", "JTOGJ", "INCHPOUND", "INCHPOUNDEXCEPTELECTRICITY"};
     130              : 
     131              :     enum class EndUseSubTableType
     132              :     {
     133              :         Invalid = -1,
     134              :         BySubCategory,
     135              :         BySpaceType,
     136              :         Num
     137              :     };
     138              : 
     139              :     enum LoadCompCol // These correspond to the columns in the load component table
     140              :     {
     141              :         // Invalid is not necessary since this is not specified by the user in the IDF
     142              :         SensInst = 1,
     143              :         SensDelay,
     144              :         SensRA,
     145              :         Latent,
     146              :         Total,
     147              :         Perc,
     148              :         Area,
     149              :         PerArea
     150              :     };
     151              : 
     152              :     enum LoadCompRow
     153              :     {
     154              :         // Invalid is not necessary since this is not specified by the user in the IDF
     155              :         // internal gains
     156              :         People = 1,
     157              :         Lights,
     158              :         Equip,
     159              :         Refrig,
     160              :         WaterUse,
     161              :         HvacLoss,
     162              :         PowerGen,
     163              : 
     164              :         // misc
     165              :         DOAS,
     166              :         Infil,
     167              :         ZoneVent,
     168              :         IntZonMix,
     169              : 
     170              :         // opaque surfaces
     171              :         Roof,
     172              :         IntZonCeil,
     173              :         OtherRoof,
     174              :         ExtWall,
     175              :         IntZonWall,
     176              :         GrdWall,
     177              :         OtherWall,
     178              :         ExtFlr,
     179              :         IntZonFlr,
     180              :         GrdFlr,
     181              :         OtherFlr,
     182              : 
     183              :         // subsurfaces
     184              :         FeneCond,
     185              :         FeneSolr,
     186              :         OpqDoor,
     187              : 
     188              :         // total
     189              :         GrdTot
     190              :     };
     191              : 
     192              :     // BEPS Report Related Variables
     193              :     // From Report:Table:Predefined - BEPS
     194              :     constexpr int numResourceTypes(14);
     195              :     constexpr int numSourceTypes(12);
     196              : 
     197              :     constexpr const char *validChars("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_:.");
     198              : 
     199              :     enum class OutputType
     200              :     {
     201              :         Invalid = -1,
     202              :         Space,
     203              :         Zone,
     204              :         AirLoop,
     205              :         Facility,
     206              :         Num
     207              :     };
     208              : 
     209              :     // MODULE VARIABLE DECLARATIONS:
     210              : 
     211              :     // The Binned table type is different and only references one variable and its structure is very
     212              :     // different from the others so it is has its own type.
     213              : 
     214              :     constexpr int numNamedMonthly(63);
     215              :     // These reports are detailed/named in routine InitializePredefinedMonthlyTitles
     216              : 
     217              :     // Allow up to five output files to be created
     218              :     constexpr int maxNumStyles(5);
     219              : 
     220              :     // LineTypes for reading the stat file
     221              :     enum class StatLineType
     222              :     {
     223              :         Invalid = -1,
     224              :         Initialized, // used as a dummy placeholder
     225              :         StatisticsLine,
     226              :         LocationLine,
     227              :         LatLongLine,
     228              :         ElevationLine,
     229              :         StdPressureLine,
     230              :         DataSourceLine,
     231              :         WMOStationLine,
     232              :         DesignConditionsLine,
     233              :         HeatingConditionsLine,
     234              :         CoolingConditionsLine,
     235              :         StdHDDLine,
     236              :         StdCDDLine,
     237              :         MaxDryBulbLine,
     238              :         MinDryBulbLine,
     239              :         MaxDewPointLine,
     240              :         MinDewPointLine,
     241              :         WithHDDLine,
     242              :         WithCDDLine,
     243              :         MaxHourlyPrec,
     244              :         MonthlyPrec,
     245              :         KoppenLine,
     246              :         KoppenDes1Line,
     247              :         KoppenDes2Line,
     248              :         AshStdLine,
     249              :         AshStdDes1Line,
     250              :         AshStdDes2Line,
     251              :         AshStdDes3Line,
     252              :         Num
     253              :     };
     254              : 
     255              :     static constexpr std::array<DataHeatBalance::IntGainType, 1> IntGainTypesTubularGCLS = {DataHeatBalance::IntGainType::DaylightingDeviceTubular};
     256              : 
     257              :     // Types
     258              : 
     259              :     struct OutputTableBinnedType
     260              :     {
     261              :         // Members
     262              :         std::string keyValue;       // the key value (usually an asterisk to indicate all variables
     263              :         std::string varOrMeter;     // the name of the variable or meter
     264              :         Real64 intervalStart = 0.0; // The lowest value for the intervals being binned into.
     265              :         Real64 intervalSize = 0.0;  // The size of the bins starting with Interval start.
     266              :         int intervalCount = 0;      // The number of bins used. The number of hours below the start of
     267              :         // the lowest bin and above the value of the last bin are also shown.
     268              :         int resIndex = 0; // result index - pointer to BinResults array
     269              :         int numTables = 0;
     270              :         OutputProcessor::VariableType typeOfVar = OutputProcessor::VariableType::Invalid; // Was NotFound
     271              :         OutputProcessor::StoreType avgSum = OutputProcessor::StoreType::Average;          // Variable  is Averaged=1 or Summed=2
     272              :         OutputProcessor::TimeStepType stepType = OutputProcessor::TimeStepType::Zone;     // Variable time step is Zone=1 or HVAC=2
     273              :         Constant::Units units = Constant::Units::Invalid;                                 // the units enumeration
     274              :         Sched::Schedule *sched = nullptr;                                                 // index to the schedule specified - if no schedule use zero
     275              :     };
     276              : 
     277              :     struct BinResultsType
     278              :     {
     279              :         // Members
     280              :         Array1D<Real64> mnth; // monthly bins
     281              :         Array1D<Real64> hrly; // hourly bins
     282              : 
     283              :         // Default Constructor
     284            7 :         BinResultsType() : mnth(12, 0.0), hrly(24, 0.0)
     285              :         {
     286            7 :         }
     287              :     };
     288              : 
     289              :     struct BinObjVarIDType
     290              :     {
     291              :         // Members
     292              :         std::string namesOfObj; // name of the object
     293              :         int varMeterNum;        // variable or meter number
     294              : 
     295              :         // Default Constructor
     296            1 :         BinObjVarIDType() : varMeterNum(0)
     297              :         {
     298            1 :         }
     299              :     };
     300              : 
     301              :     struct BinStatisticsType
     302              :     {
     303              :         // Members
     304              :         Real64 sum;     // sum of the variable
     305              :         Real64 sum2;    // sum of the variable squared
     306              :         int n;          // number of items in sum
     307              :         Real64 minimum; // minimum value
     308              :         Real64 maximum; // maximum value
     309              : 
     310              :         // Default Constructor
     311            1 :         BinStatisticsType() : sum(0.0), sum2(0.0), n(0), minimum(0.0), maximum(0.0)
     312              :         {
     313            1 :         }
     314              :     };
     315              : 
     316              :     struct NamedMonthlyType
     317              :     {
     318              :         // Members
     319              :         std::string title; // report title
     320              :         bool show;         // if report should be shown
     321              : 
     322              :         // Default Constructor
     323         2961 :         NamedMonthlyType() : show(false)
     324              :         {
     325         2961 :         }
     326              :     };
     327              : 
     328              :     struct MonthlyInputType
     329              :     {
     330              :         // Members
     331              :         std::string name;      // identifier
     332              :         int numFieldSet = 0;   // number of monthly field sets
     333              :         int firstFieldSet = 0; // pointer to the first field set
     334              :         int numTables = 0;     // number of tables
     335              :         int firstTable = 0;    // pointer to the first table
     336              :         int showDigits = 0;    // the number of digits to be shown
     337              :         bool isNamedMonthly = false;
     338              :     };
     339              : 
     340              :     struct MonthlyFieldSetInputType
     341              :     {
     342              :         // Members
     343              :         std::string variMeter;      // the name of the variable or meter
     344              :         std::string colHead;        // the column header to use instead of the variable name (only for predefined)
     345              :         AggType aggregate;          // the type of aggregation for the variable (see aggType parameters)
     346              :         Constant::Units varUnits;   // Units enumeration
     347              :         std::string variMeterUpper; // the name of the variable or meter uppercased
     348              :         OutputProcessor::VariableType typeOfVar;
     349              :         int keyCount;                              // noel
     350              :         OutputProcessor::StoreType varAvgSum;      // Variable  is Averaged=1 or Summed=2
     351              :         OutputProcessor::TimeStepType varStepType; // Variable time step is Zone=1 or HVAC=2
     352              :         Array1D_string NamesOfKeys;                // keyNames !noel
     353              :         Array1D_int IndexesForKeyVar;              // keyVarIndexes !noel
     354              : 
     355              :         // Default Constructor
     356         5200 :         MonthlyFieldSetInputType()
     357        15600 :             : aggregate(AggType::Invalid), varUnits(Constant::Units::None), typeOfVar(OutputProcessor::VariableType::Invalid), keyCount(0),
     358         5200 :               varAvgSum(OutputProcessor::StoreType::Average), varStepType(OutputProcessor::TimeStepType::Zone)
     359              :         {
     360         5200 :         }
     361              :     };
     362              : 
     363              :     struct MonthlyTablesType
     364              :     {
     365              :         // Members
     366              :         std::string keyValue; // the key value - the object names that result in the variable
     367              :         int firstColumn;      // pointer to the monthly column array for the first item
     368              :         int numColumns;       // number of columns for the table
     369              : 
     370              :         // Default Constructor
     371           40 :         MonthlyTablesType() : firstColumn(0), numColumns(0)
     372              :         {
     373           40 :         }
     374              :     };
     375              : 
     376              :     struct MonthlyColumnsType
     377              :     {
     378              :         // Members
     379              :         std::string varName;                     // name of variable
     380              :         std::string colHead;                     // column header (not used for user defined monthly)
     381              :         int varNum;                              // variable or meter number
     382              :         OutputProcessor::VariableType typeOfVar; // 0=not found, 1=integer, 2=real, 3=meter
     383              :         OutputProcessor::StoreType avgSum;       // Variable  is Averaged=1 or Summed=2
     384              :         OutputProcessor::TimeStepType stepType;  // Variable time step is Zone=1 or HVAC=2
     385              :         Constant::Units units;                   // the units string, may be blank
     386              :         AggType aggType;                         // index to the type of aggregation (see list of parameters)
     387              :         Array1D<Real64> reslt;                   // monthly results
     388              :         Array1D<Real64> duration;                // the time during which results are summed for use in averages
     389              :         Array1D_int timeStamp;                   // encoded timestamp of max or min
     390              :         Real64 aggForStep;                       // holds the aggregation for the HVAC time steps when smaller than
     391              :         // the zone timestep
     392              : 
     393              :         // Default Constructor
     394          244 :         MonthlyColumnsType()
     395          488 :             : varNum(0), typeOfVar(OutputProcessor::VariableType::Invalid), avgSum(OutputProcessor::StoreType::Average),
     396          244 :               stepType(OutputProcessor::TimeStepType::Zone), units(Constant::Units::None), aggType(AggType::Invalid), reslt(12, 0.0),
     397          488 :               duration(12, 0.0), timeStamp(12, 0), aggForStep(0.0)
     398              :         {
     399          244 :         }
     400              :     };
     401              : 
     402              :     struct TOCEntriesType
     403              :     {
     404              :         // Members
     405              :         std::string reportName;  // the name of the individual report
     406              :         std::string sectionName; // the name of the section containing individual reports
     407              :         bool isWritten;          // flag if the entry has been written to TOC
     408              : 
     409              :         // Default Constructor
     410           80 :         TOCEntriesType() : isWritten(false)
     411              :         {
     412           80 :         }
     413              :     };
     414              : 
     415              :     struct UnitConvType
     416              :     {
     417              :         // Members
     418              :         std::string siName; // the name abbreviation or symbol of the SI units
     419              :         std::string ipName; // the name abbreviation or symbol of the IP units
     420              :         Real64 mult;        // the multiplier used to convert from SI to IP in IP = (SI * mult) + offset
     421              :         Real64 offset;      // the offset used to convert from SI to IP in IP = (SI * mult) + offset
     422              :         std::string hint;   // the string used when multiple SI units match
     423              :         bool several;       // several different options for the SI unit to be converted into IP
     424              :         bool is_default;    // if part of a set of "several" this should be used as default
     425              : 
     426              :         // Default Constructor
     427        11092 :         UnitConvType() : mult(1.0), offset(0.0), several(false), is_default(false)
     428              :         {
     429        11092 :         }
     430              :     };
     431              : 
     432              :     struct CompLoadTablesType
     433              :     {
     434              :         // members
     435              :         int desDayNum = 0;              // design day number
     436              :         int timeStepMax = 0;            // times step of the day that the maximum occurs
     437              :         Array2D<Real64> cells;          // main component table results (column, row)
     438              :         Array2D_bool cellUsed;          // flag if the cell is used for the table of results (column, row)
     439              :         std::string peakDateHrMin = ""; // string containing peak timestamp
     440              :         Real64 outsideDryBulb = 0.0;    // outside dry bulb temperature at peak
     441              :         Real64 outsideWetBulb = 0.0;    // outside wet bulb temperature at peak
     442              :         Real64 outsideHumRatio = 0.0;   // outside humidity ratio at peak
     443              :         Real64 zoneDryBulb = 0.0;       // zone dry bulb temperature at peak
     444              :         Real64 zoneRelHum = 0.0;        // zone relative humidity at peak
     445              :         Real64 zoneHumRatio = 0.0;      // zone humidity ratio at peak
     446              : 
     447              :         Real64 supAirTemp = 0.0;     // supply air temperature
     448              :         Real64 mixAirTemp = 0.0;     // mixed air temperature
     449              :         Real64 mainFanAirFlow = 0.0; // main fan air flow
     450              :         Real64 outsideAirFlow = 0.0; // outside air flow
     451              :         Real64 designPeakLoad = 0.0; // design peak load
     452              :         Real64 diffDesignPeak = 0.0; // difference between Design and Peak Load
     453              : 
     454              :         Real64 peakDesSensLoad = 0.0;    // peak design sensible load
     455              :         Real64 estInstDelSensLoad = 0.0; // estimated instant plus delayed sensible load
     456              :         Real64 diffPeakEst = 0.0;        // difference between the peak design sensible load and the estimated instant plus delayed sensible load
     457              :         Array1D_int zoneIndices;         // the zone numbers covered by the report
     458              : 
     459              :         Real64 outsideAirRatio = 0.0;   // outside Air
     460              :         Real64 floorArea = 0.0;         // floor area
     461              :         Real64 airflowPerFlrArea = 0.0; // airflow per floor area
     462              :         Real64 airflowPerTotCap = 0.0;  // airflow per total capacity
     463              :         Real64 areaPerTotCap = 0.0;     // area per total capacity
     464              :         Real64 totCapPerArea = 0.0;     // total capacity per area
     465              :         Real64 chlPumpPerFlow = 0.0;    // chiller pump power per flow
     466              :         Real64 cndPumpPerFlow = 0.0;    // condenser pump power per flow
     467              :         Real64 numPeople = 0.0;         // number of people
     468              :     };
     469              : 
     470              :     struct ZompComponentAreasType
     471              :     {
     472              :         // members
     473              :         Real64 floor;
     474              :         Real64 roof;
     475              :         Real64 ceiling;
     476              :         Real64 extWall;
     477              :         Real64 intZoneWall;
     478              :         Real64 grndCntWall;
     479              :         Real64 extFloor;
     480              :         Real64 intZoneFloor;
     481              :         Real64 grndCntFloor;
     482              :         Real64 fenestration;
     483              :         Real64 door;
     484              : 
     485              :         // default constructor
     486            7 :         ZompComponentAreasType()
     487            7 :             : floor(0.), roof(0.), ceiling(0.), extWall(0.), intZoneWall(0.), grndCntWall(0.), extFloor(0.), intZoneFloor(0.), grndCntFloor(0.),
     488            7 :               fenestration(0.), door(0.)
     489              :         {
     490            7 :         }
     491              :     };
     492              : 
     493              :     struct compLoadsSurface
     494              :     {
     495              :         Real64 loadConvectedNormal = 0.0;
     496              :         Real64 loadConvectedWithPulse = 0.0;
     497              :         Real64 netSurfRadSeq = 0.0;
     498              :         Real64 ITABSFseq = 0.0;     // used for determining the radiant fraction on each surface
     499              :         Real64 TMULTseq = 0.0;      // used for determining the radiant fraction on each surface
     500              :         Real64 lightSWRadSeq = 0.0; // short wave visible radiation
     501              :         Real64 feneSolarRadSeq = 0.0;
     502              :     };
     503              : 
     504              :     struct compLoadsTimeStepSurfaces
     505              :     {
     506              :         std::vector<compLoadsSurface> surf;
     507              :     };
     508              : 
     509              :     struct componentLoadsSurf
     510              :     {
     511              :         std::vector<compLoadsTimeStepSurfaces> ts;
     512              :     };
     513              : 
     514              :     struct compLoadsSpaceZone
     515              :     {
     516              :         Real64 peopleInstantSeq = 0.0;
     517              :         Real64 peopleLatentSeq = 0.0;
     518              : 
     519              :         Real64 lightInstantSeq = 0.0;
     520              :         Real64 lightRetAirSeq = 0.0;
     521              : 
     522              :         Real64 equipInstantSeq = 0.0;
     523              :         Real64 equipLatentSeq = 0.0;
     524              : 
     525              :         Real64 refrigInstantSeq = 0.0;
     526              :         Real64 refrigRetAirSeq = 0.0;
     527              :         Real64 refrigLatentSeq = 0.0;
     528              : 
     529              :         Real64 waterUseInstantSeq = 0.0;
     530              :         Real64 waterUseLatentSeq = 0.0;
     531              : 
     532              :         Real64 hvacLossInstantSeq = 0.0;
     533              : 
     534              :         Real64 powerGenInstantSeq = 0.0;
     535              :         Real64 powerGenRadSeq = 0.0;
     536              :         Real64 infilInstantSeq = 0.0;
     537              :         Real64 infilLatentSeq = 0.0;
     538              : 
     539              :         Real64 zoneVentInstantSeq = 0.0;
     540              :         Real64 zoneVentLatentSeq = 0.0;
     541              : 
     542              :         Real64 interZoneMixInstantSeq = 0.0;
     543              :         Real64 interZoneMixLatentSeq = 0.0;
     544              : 
     545              :         Real64 feneCondInstantSeq = 0.0;
     546              :         bool adjFenDone = false;
     547              :     };
     548              :     struct compLoadsTimeStepSpZn
     549              :     {
     550              :         std::vector<compLoadsSpaceZone> spacezone;
     551              :     };
     552              :     struct componentLoadsSpZn
     553              :     {
     554              :         std::vector<compLoadsTimeStepSpZn> ts;
     555              :     };
     556              : 
     557              :     struct compLoadsEnclosure
     558              :     {
     559              :         Real64 peopleRadSeq = 0.0;
     560              :         Real64 lightLWRadSeq = 0.0; // long wave thermal radiation
     561              :         Real64 equipRadSeq = 0.0;
     562              :         Real64 hvacLossRadSeq = 0.0;
     563              :         Real64 powerGenRadSeq = 0.0;
     564              :     };
     565              :     struct compLoadsTimeStepEncl
     566              :     {
     567              :         std::vector<compLoadsEnclosure> encl;
     568              :     };
     569              :     struct componentLoadsEncl
     570              :     {
     571              :         std::vector<compLoadsTimeStepEncl> ts;
     572              :     };
     573              :     // Functions
     574              : 
     575              :     std::ofstream &open_tbl_stream(EnergyPlusData &state, int const iStyle, fs::path const &filePath, bool output_to_file = true);
     576              : 
     577              :     void UpdateTabularReports(EnergyPlusData &state, OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC)
     578              : 
     579              :     //======================================================================================================================
     580              :     //======================================================================================================================
     581              : 
     582              :     //    GET INPUT ROUTINES
     583              : 
     584              :     //======================================================================================================================
     585              :     //======================================================================================================================
     586              : 
     587              :     void GetInputTabularMonthly(EnergyPlusData &state);
     588              : 
     589              :     int AddMonthlyReport(EnergyPlusData &state, std::string const &inReportName, int const inNumDigitsShown, bool isNamedMonthly = false);
     590              : 
     591              :     void AddMonthlyFieldSetInput(
     592              :         EnergyPlusData &state, int const inMonthReport, std::string const &inVariMeter, std::string const &inColHead, AggType const inAggregate);
     593              : 
     594              :     void InitializeTabularMonthly(EnergyPlusData &state);
     595              : 
     596              :     bool isInvalidAggregationOrder(EnergyPlusData &state);
     597              : 
     598              :     void GetInputTabularTimeBins(EnergyPlusData &state);
     599              : 
     600              :     bool warningAboutKeyNotFound(EnergyPlusData &state, int foundIndex, int inObjIndex, std::string const &moduleName);
     601              : 
     602              :     void GetInputTabularStyle(EnergyPlusData &state);
     603              : 
     604              :     UnitsStyle SetUnitsStyleFromString(std::string const &unitStringIn);
     605              : 
     606              :     void GetInputOutputTableSummaryReports(EnergyPlusData &state);
     607              : 
     608              :     bool isCompLoadRepReq(EnergyPlusData &state);
     609              : 
     610              :     bool hasSizingPeriodsDays(EnergyPlusData &state);
     611              : 
     612              :     void InitializePredefinedMonthlyTitles(EnergyPlusData &state);
     613              : 
     614              :     void CreatePredefinedMonthlyReports(EnergyPlusData &state);
     615              : 
     616              :     void GetInputFuelAndPollutionFactors(EnergyPlusData &state);
     617              : 
     618              :     //======================================================================================================================
     619              :     //======================================================================================================================
     620              : 
     621              :     //    OTHER INITIALIZATION ROUTINES
     622              : 
     623              :     //======================================================================================================================
     624              :     //======================================================================================================================
     625              : 
     626              :     void OpenOutputTabularFile(EnergyPlusData &state);
     627              : 
     628              :     void CloseOutputTabularFile(EnergyPlusData &state);
     629              : 
     630              :     void WriteTableOfContents(EnergyPlusData &state);
     631              : 
     632              :     void AddTOCReportPeriod(const int nReportPeriods,
     633              :                             const std::string &kw,
     634              :                             const Array1D<Weather::ReportPeriodData> &ReportPeriodInputData,
     635              :                             std::ostream &tbl_stream);
     636              : 
     637              :     //======================================================================================================================
     638              :     //======================================================================================================================
     639              : 
     640              :     //    GATHER DATA EACH TIME STEP ROUTINES
     641              : 
     642              :     //======================================================================================================================
     643              :     //======================================================================================================================
     644              : 
     645              :     void GatherBinResultsForTimestep(EnergyPlusData &state, OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC)
     646              : 
     647              :     void GatherMonthlyResultsForTimestep(EnergyPlusData &state,
     648              :                                          OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC)
     649              : 
     650              :     void GatherBEPSResultsForTimestep(EnergyPlusData &state,
     651              :                                       OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC)
     652              : 
     653              :     void GatherSourceEnergyEndUseResultsForTimestep(EnergyPlusData &state,
     654              :                                                     OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC)
     655              : 
     656              :     void GatherPeakDemandForTimestep(EnergyPlusData &state, OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC)
     657              : 
     658              :     void GatherHeatGainReport(EnergyPlusData &state, OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC)
     659              : 
     660              :     void GatherHeatEmissionReport(EnergyPlusData &state, OutputProcessor::TimeStepType t_timeStepType);
     661              : 
     662              :     void CalcHeatEmissionReport(EnergyPlusData &state);
     663              : 
     664              :     //======================================================================================================================
     665              :     //======================================================================================================================
     666              : 
     667              :     //    WRITE OUTPUT FILE ROUTINES
     668              : 
     669              :     //======================================================================================================================
     670              :     //======================================================================================================================
     671              : 
     672              :     void WriteTabularReports(EnergyPlusData &state);
     673              : 
     674              :     void parseStatLine(const std::string &lineIn,
     675              :                        StatLineType &lineType,
     676              :                        bool &desConditionlinepassed,
     677              :                        bool &heatingDesignlinepassed,
     678              :                        bool &coolingDesignlinepassed,
     679              :                        bool isKoppen,
     680              :                        bool &insideLiquidPrecipitation);
     681              : 
     682              :     void FillWeatherPredefinedEntries(EnergyPlusData &state);
     683              : 
     684              :     std::string GetColumnUsingTabs(std::string const &inString, // Input String
     685              :                                    int const colNum             // Column number
     686              :     );
     687              : 
     688              :     void FillRemainingPredefinedEntries(EnergyPlusData &state);
     689              : 
     690              :     void WriteMonthlyTables(EnergyPlusData &state);
     691              : 
     692              :     void WriteTimeBinTables(EnergyPlusData &state);
     693              : 
     694              :     void WriteBEPSTable(EnergyPlusData &state);
     695              : 
     696              :     void writeBEPSEndUseBySubCatOrSpaceType(EnergyPlusData &state,
     697              :                                             EndUseSubTableType tableType,
     698              :                                             Array2D<Real64> &endUseSubOther,
     699              :                                             Array2D<Real64> &collapsedEndUse,
     700              :                                             Array3D<Real64> &collapsedEndUseSub,
     701              :                                             Array1D_bool &needOtherRow,
     702              :                                             const UnitsStyle unitsStyle_cur,
     703              :                                             const bool produceTabular,
     704              :                                             const bool produceSQLite);
     705              : 
     706              :     std::string ResourceWarningMessage(std::string const &resource);
     707              : 
     708              :     Real64 WaterConversionFunct(Real64 WaterTotal, Real64 ConversionFactor);
     709              : 
     710              :     void WriteSourceEnergyEndUseSummary(EnergyPlusData &state);
     711              : 
     712              :     void WriteDemandEndUseSummary(EnergyPlusData &state);
     713              : 
     714              :     void WriteCompCostTable(EnergyPlusData &state);
     715              : 
     716              :     void writeRowReportPeriodInputVeri(const std::string &reportType,
     717              :                                        Array2D_string &tableBody,
     718              :                                        const int rowid,
     719              :                                        const int periodIdx,
     720              :                                        const Array1D<Weather::ReportPeriodData> &ReportPeriodInputData);
     721              : 
     722              :     void WriteVeriSumTable(EnergyPlusData &state);
     723              : 
     724              :     void writeVeriSumSpaceTables(EnergyPlusData &state, bool produceTabular, bool produceSQLite);
     725              : 
     726              :     void WriteAdaptiveComfortTable(EnergyPlusData &state);
     727              : 
     728              :     std::string formatReportPeriodTimestamp(const int year, const int month, const int day, const int hour);
     729              : 
     730              :     void WriteReportHeaderReportingPeriod(EnergyPlusData &state,
     731              :                                           const std::string &reportKeyWord,
     732              :                                           const int periodIdx,
     733              :                                           const Array1D<Weather::ReportPeriodData> &ReportPeriodInputData);
     734              : 
     735              :     void WriteReportPeriodTimeConsumption(EnergyPlusData &state);
     736              : 
     737              :     void WriteThermalResilienceTablesRepPeriod(EnergyPlusData &state, int const periodIdx);
     738              : 
     739              :     void WriteThermalResilienceTables(EnergyPlusData &state);
     740              : 
     741              :     void WriteCO2ResilienceTables(EnergyPlusData &state);
     742              : 
     743              :     void WriteCO2ResilienceTablesRepPeriod(EnergyPlusData &state, const int periodIdx);
     744              : 
     745              :     void WriteVisualResilienceTables(EnergyPlusData &state);
     746              : 
     747              :     void WriteVisualResilienceTablesRepPeriod(EnergyPlusData &state, const int periodIdx);
     748              : 
     749              :     template <int columnNum>
     750              :     void WriteResilienceBinsTable(EnergyPlusData &state,
     751              :                                   std::array<int, columnNum> const &columnHead,
     752              :                                   const std::array<Real64, columnNum> DataHeatBalance::ZoneResilience::*memberPtr,
     753              :                                   Real64 const unitConvMultiplier = 1.0);
     754              : 
     755              :     template <int columnNum>
     756              :     void WriteResilienceBinsTableNonPreDefUseZoneData(EnergyPlusData &state,
     757              :                                                       const std::string &tableName,
     758              :                                                       Array1D_string const &columnHead,
     759              :                                                       Array1D_int &columnWidth,
     760              :                                                       const std::array<Real64, columnNum> DataHeatBalance::ZoneResilience::*memberPtr,
     761              :                                                       Array1D_string &rowHead,
     762              :                                                       Array2D_string &tableBody,
     763              :                                                       Real64 const unitConvMultiplier = 1.0);
     764              : 
     765              :     void WriteResilienceBinsTableReportingPeriod(EnergyPlusData &state,
     766              :                                                  const std::string &tableType,
     767              :                                                  int const columnNum,
     768              :                                                  int const periodIdx,
     769              :                                                  const std::string &periodTitle,
     770              :                                                  const std::string &tableName,
     771              :                                                  Array1D_string const &columnHead,
     772              :                                                  Array1D_int &columnWidth,
     773              :                                                  Array2D<std::vector<Real64>> const &ZoneBins,
     774              :                                                  Array1D_string &rowHead,
     775              :                                                  Array2D_string &tableBody,
     776              :                                                  Real64 const unitConvMultiplier = 1.0);
     777              : 
     778              :     void WriteSETHoursTableNonPreDefUseZoneData(EnergyPlusData &state,
     779              :                                                 int const columnNum,
     780              :                                                 const std::string &tableName,
     781              :                                                 Array1D_string const &columnHead,
     782              :                                                 Array1D_int &columnWidth,
     783              :                                                 const std::array<Real64, 5> DataHeatBalance::ZoneResilience::*memberPtr,
     784              :                                                 Array1D_string &rowHead,
     785              :                                                 Array2D_string &tableBody,
     786              :                                                 Real64 const unitConvMultiplier = 1.0);
     787              : 
     788              :     void WriteSETHoursTableReportingPeriod(EnergyPlusData &state,
     789              :                                            int const columnNum,
     790              :                                            int const periodIdx,
     791              :                                            const std::string &periodTitle,
     792              :                                            const std::string &tableName,
     793              :                                            Array1D_string const &columnHead,
     794              :                                            Array1D_int &columnWidth,
     795              :                                            Array2D<std::vector<Real64>> const &ZoneBins,
     796              :                                            Array1D_string &rowHead,
     797              :                                            Array2D_string &tableBody,
     798              :                                            Real64 const unitConvMultiplier = 1.0);
     799              : 
     800              :     // return the table entry of the rowIndex-th row and columnIndex-th col
     801              :     std::string RetrieveEntryFromTableBody(Array2D_string const &tableBody, int const rowIndex, int const columnIndex);
     802              : 
     803              :     void WriteHourOfSafetyTable(EnergyPlusData &state,
     804              :                                 int const columnNum,
     805              :                                 std::vector<int> const &columnHead,
     806              :                                 Array1D<std::vector<Real64>> const &ZoneBins,
     807              :                                 int const dateColIdx);
     808              : 
     809              :     void WriteHourOfSafetyTableNonPreDefUseZoneData(EnergyPlusData &state,
     810              :                                                     int const columnNum,
     811              :                                                     const std::string &tableName,
     812              :                                                     Array1D_string const &columnHead,
     813              :                                                     Array1D_int &columnWidth,
     814              :                                                     const std::array<Real64, 5> DataHeatBalance::ZoneResilience::*memberPtr,
     815              :                                                     Array1D_string &rowHead,
     816              :                                                     Array2D_string &tableBody,
     817              :                                                     int const dateColIdx);
     818              : 
     819              :     void WriteHourOfSafetyTableReportingPeriod(EnergyPlusData &state,
     820              :                                                int const columnNum,
     821              :                                                int const periodIdx,
     822              :                                                const std::string &periodTitle,
     823              :                                                const std::string &tableName,
     824              :                                                Array1D_string const &columnHead,
     825              :                                                Array1D_int &columnWidth,
     826              :                                                Array2D<std::vector<Real64>> const &ZoneBins,
     827              :                                                Array1D_string &rowHead,
     828              :                                                Array2D_string &tableBody,
     829              :                                                int const dateColIdx);
     830              : 
     831              :     void WriteHeatEmissionTable(EnergyPlusData &state);
     832              : 
     833              :     void WritePredefinedTables(EnergyPlusData &state);
     834              : 
     835              :     void WriteComponentSizing(EnergyPlusData &state);
     836              : 
     837              :     void WriteSurfaceShadowing(EnergyPlusData &state);
     838              : 
     839              :     void WriteEioTables(EnergyPlusData &state);
     840              : 
     841              :     int unitsFromHeading(EnergyPlusData &state, std::string &heading);
     842              : 
     843              :     int unitsFromHeading(EnergyPlusData &state, std::string &heading, UnitsStyle unitsStyle_para);
     844              : 
     845              :     std::vector<std::string> splitCommaString(std::string const &inputString);
     846              : 
     847              :     void AddTOCLoadComponentTableSummaries(EnergyPlusData &state);
     848              : 
     849              :     void AllocateLoadComponentArrays(EnergyPlusData &state);
     850              : 
     851              :     void DeallocateLoadComponentArrays(EnergyPlusData const &state);
     852              : 
     853              :     void ComputeLoadComponentDecayCurve(EnergyPlusData &state);
     854              : 
     855              :     void GatherComponentLoadsSurface(EnergyPlusData &state);
     856              : 
     857              :     void GatherComponentLoadsHVAC(EnergyPlusData &state);
     858              : 
     859              :     void gatherSpaceZoneCompLoadsHVAC(OutputReportTabular::compLoadsSpaceZone &compLoadDayTS,
     860              :                                       DataHeatBalance::AirReportVars const &szAirRpt,
     861              :                                       Real64 const timeStepSysSec);
     862              : 
     863              :     void WriteLoadComponentSummaryTables(EnergyPlusData &state);
     864              : 
     865              :     void computeSpaceZoneCompLoads(EnergyPlusData &state,
     866              :                                    DataSizing::ZoneSizingData const &calcFinalSizing,
     867              :                                    CompLoadTablesType &coolCompLoadTables,
     868              :                                    CompLoadTablesType &heatCompLoadTables,
     869              :                                    Array1D<Real64> &peopleDelaySeq,
     870              :                                    Array1D<Real64> &equipDelaySeq,
     871              :                                    Array1D<Real64> &hvacLossDelaySeq,
     872              :                                    Array1D<Real64> &powerGenDelaySeq,
     873              :                                    Array1D<Real64> &lightDelaySeq,
     874              :                                    Array1D<Real64> &feneSolarDelaySeq,
     875              :                                    std::vector<OutputReportTabular::componentLoadsSpZn> &szCompLoadLoc,
     876              :                                    Array2D<Real64> &surfDelaySeq,
     877              :                                    ZompComponentAreasType &componentAreas,
     878              :                                    int const iZone,
     879              :                                    int const iSpace = 0);
     880              : 
     881              :     void GetDelaySequences(EnergyPlusData &state,
     882              :                            int desDaySelected,
     883              :                            bool isCooling,
     884              :                            int zoneIndex,
     885              :                            Array1D<Real64> &peopleDelaySeq,
     886              :                            Array1D<Real64> &equipDelaySeq,
     887              :                            Array1D<Real64> &hvacLossDelaySeq,
     888              :                            Array1D<Real64> &powerGenDelaySeq,
     889              :                            Array1D<Real64> &lightDelaySeq,
     890              :                            Array1D<Real64> &feneSolarDelaySeq,
     891              :                            std::vector<OutputReportTabular::componentLoadsSpZn> &szCompLoadLoc,
     892              :                            Array2D<Real64> &surfDelaySeq,
     893              :                            int const iSpace = 0);
     894              : 
     895              :     void ComputeTableBodyUsingMovingAvg(EnergyPlusData &state,
     896              :                                         Array2D<Real64> &resultCells,
     897              :                                         Array2D_bool &resultCellsUsed,
     898              :                                         int desDaySelected,
     899              :                                         int timeOfMax,
     900              :                                         int zoneIndex,
     901              :                                         Array1D<Real64> const &peopleDelaySeq,
     902              :                                         Array1D<Real64> const &equipDelaySeq,
     903              :                                         Array1D<Real64> const &hvacLossDelaySeq,
     904              :                                         Array1D<Real64> const &powerGenDelaySeq,
     905              :                                         Array1D<Real64> const &lightDelaySeq,
     906              :                                         Array1D<Real64> const &feneSolarDelaySeq,
     907              :                                         std::vector<OutputReportTabular::componentLoadsSpZn> &szCompLoadLoc,
     908              :                                         Array2D<Real64> const &surfDelaySeq,
     909              :                                         int const iSpace = 0);
     910              : 
     911              :     void CollectPeakZoneConditions(
     912              :         EnergyPlusData &state, CompLoadTablesType &compLoad, int desDaySelected, int timeOfMax, int zoneIndex, bool isCooling, int spaceIndex = 0);
     913              : 
     914              :     void ComputeEngineeringChecks(CompLoadTablesType &compLoad);
     915              : 
     916              :     void GetZoneComponentAreas(EnergyPlusData &state, Array1D<ZompComponentAreasType> &znAreas, Array1D<ZompComponentAreasType> &spAreas);
     917              : 
     918              :     void addSurfaceArea(DataSurfaces::SurfaceData const &curSurface, Array1D<ZompComponentAreasType> &areas, bool isZone);
     919              : 
     920              :     void AddAreaColumnForZone(ZompComponentAreasType const &compAreas, CompLoadTablesType &compLoadTotal);
     921              : 
     922              :     void CombineLoadCompResults(CompLoadTablesType &compLoadTotal, CompLoadTablesType const &compLoadPartial, Real64 multiplier);
     923              : 
     924              :     void AddTotalRowsForLoadSummary(CompLoadTablesType &compLoadTotal);
     925              : 
     926              :     void ComputePeakDifference(CompLoadTablesType &compLoad);
     927              : 
     928              :     void LoadSummaryUnitConversion(EnergyPlusData &state, CompLoadTablesType &compLoadTotal);
     929              : 
     930              :     void LoadSummaryUnitConversion(EnergyPlusData &state, CompLoadTablesType &compLoadTotal, UnitsStyle unitsStyle_para);
     931              : 
     932              :     void CreateListOfZonesForAirLoop(EnergyPlusData const &state, CompLoadTablesType &compLoad, Array1D_int const &zoneToAirLoop, int curAirLoop);
     933              : 
     934              :     void OutputCompLoadSummary(EnergyPlusData &state,
     935              :                                EnergyPlus::OutputReportTabular::OutputType kind,
     936              :                                CompLoadTablesType const &compLoadCool,
     937              :                                CompLoadTablesType const &compLoadHeat,
     938              :                                int zoneOrAirLoopIndex,
     939              :                                UnitsStyle unitsStyle_para,
     940              :                                bool produceTabular_para,
     941              :                                bool produceSQLite_para);
     942              : 
     943              :     void WriteReportHeaders(EnergyPlusData &state,
     944              :                             std::string const &reportName,
     945              :                             std::string const &objectName,
     946              :                             OutputProcessor::StoreType const averageOrSum);
     947              : 
     948              :     void WriteSubtitle(EnergyPlusData &state, std::string const &subtitle);
     949              : 
     950              :     void WriteTextLine(EnergyPlusData &state, std::string const &lineOfText, bool const useBold = false);
     951              : 
     952              :     void WriteTable(EnergyPlusData &state,
     953              :                     Array2S_string const body, // row,column
     954              :                     const Array1D_string &rowLabels,
     955              :                     const Array1D_string &columnLabels,
     956              :                     Array1D_int &widthColumn,
     957              :                     bool transposeXML = false,
     958              :                     std::string_view const footnoteText = {});
     959              : 
     960              :     bool produceDualUnitsFlags(int iUnit_Sys,
     961              :                                EnergyPlus::OutputReportTabular::UnitsStyle unitsStyle_Tab,
     962              :                                EnergyPlus::OutputReportTabular::UnitsStyle unitsStyle_Sql,
     963              :                                UnitsStyle &unitsStyle_Cur,
     964              :                                bool &produce_Tab,
     965              :                                bool &produce_Sql);
     966              : 
     967              :     std::string MakeAnchorName(std::string const &reportString, std::string const &objectString);
     968              : 
     969              :     std::string InsertCurrencySymbol(EnergyPlusData &state,
     970              :                                      std::string const &inString, // Input String
     971              :                                      bool const isHTML            // True if an HTML string
     972              :     );
     973              : 
     974              :     std::string ConvertToElementTag(std::string const &inString); // Input String
     975              : 
     976              :     std::string ConvertUnicodeToUTF8(unsigned long const codepoint);
     977              : 
     978              :     std::string ConvertToEscaped(std::string const &inString, // Input String
     979              :                                  bool isXML = true);          // isXML if false assumes HTML and will not convert quotes and apostrophes, for HTML4
     980              : 
     981              :     void DetermineBuildingFloorArea(EnergyPlusData &state);
     982              : 
     983              :     // Tables with Subcategories in particular have a blank for rowHead for display in the HTML output.
     984              :     // This routine will fill up the blanks for output to Sql in particular
     985              :     void FillRowHead(Array1D_string &rowHead);
     986              : 
     987              :     //======================================================================================================================
     988              :     //======================================================================================================================
     989              : 
     990              :     //    ROUTINES TO RESET GATHERED VALUES TO ZERO
     991              : 
     992              :     //======================================================================================================================
     993              :     //======================================================================================================================
     994              : 
     995              :     void ResetTabularReports(EnergyPlusData &state);
     996              : 
     997              :     void ResetMonthlyGathering(EnergyPlusData &state);
     998              : 
     999              :     void ResetBinGathering(EnergyPlusData const &state);
    1000              : 
    1001              :     void ResetBEPSGathering(EnergyPlusData const &state);
    1002              : 
    1003              :     void ResetSourceEnergyEndUseGathering(EnergyPlusData const &state);
    1004              : 
    1005              :     void ResetPeakDemandGathering(EnergyPlusData const &state);
    1006              : 
    1007              :     void ResetHeatGainGathering(EnergyPlusData &state);
    1008              : 
    1009              :     void ResetRemainingPredefinedEntries(EnergyPlusData &state);
    1010              : 
    1011              :     void ResetAdaptiveComfort(EnergyPlusData &state);
    1012              : 
    1013              :     //======================================================================================================================
    1014              :     //======================================================================================================================
    1015              : 
    1016              :     //    ROUTINES RELATED TO IF VALUE IS IN A RANGE
    1017              : 
    1018              :     //======================================================================================================================
    1019              :     //======================================================================================================================
    1020              : 
    1021              :     bool isInTriangle(
    1022              :         Real64 const qx, Real64 const qy, Real64 const x1, Real64 const y1, Real64 const x2, Real64 const y2, Real64 const x3, Real64 const y3);
    1023              : 
    1024              :     bool isInQuadrilateral(Real64 const qx,
    1025              :                            Real64 const qy,
    1026              :                            Real64 const ax,
    1027              :                            Real64 const ay,
    1028              :                            Real64 const bx,
    1029              :                            Real64 const by,
    1030              :                            Real64 const cx,
    1031              :                            Real64 const cy,
    1032              :                            Real64 const dx,
    1033              :                            Real64 const dy);
    1034              : 
    1035              :     //======================================================================================================================
    1036              :     //======================================================================================================================
    1037              : 
    1038              :     //    SUPPORT ROUTINES
    1039              : 
    1040              :     //======================================================================================================================
    1041              :     //======================================================================================================================
    1042              : 
    1043              :     std::string RealToStr(Real64 const RealIn, int const numDigits);
    1044              : 
    1045              :     Real64 StrToReal(std::string_view stringIn);
    1046              : 
    1047              :     std::string DateToString(int const codedDate); // word containing encoded month, day, hour, minute
    1048              : 
    1049              :     bool isNumber(std::string const &s);
    1050              : 
    1051              :     int digitsAferDecimal(std::string const &s);
    1052              : 
    1053              :     void AddTOCEntry(EnergyPlusData &state, std::string const &nameSection, std::string const &nameReport);
    1054              : 
    1055              :     void SetupUnitConversions(EnergyPlusData &state);
    1056              : 
    1057              :     std::string GetUnitSubString(std::string const &inString); // Input String
    1058              : 
    1059              :     void LookupSItoIP(EnergyPlusData &state, std::string const &stringInWithSI, int &unitConvIndex, std::string &stringOutWithIP);
    1060              : 
    1061              :     void LookupJtokWH(EnergyPlusData &state, std::string const &stringInWithJ, int &unitConvIndex, std::string &stringOutWithKWH);
    1062              : 
    1063              :     Real64 ConvertIP(EnergyPlusData &state, int const unitConvIndex, Real64 const SIvalue);
    1064              : 
    1065              :     Real64 ConvertIPdelta(EnergyPlusData &state, int const unitConvIndex, Real64 const SIvalue);
    1066              : 
    1067              :     void GetUnitConversion(EnergyPlusData &state, int const unitConvIndex, Real64 &multiplier, Real64 &offset, std::string &IPunit);
    1068              : 
    1069              :     Real64 getSpecificUnitMultiplier(EnergyPlusData &state, std::string const &SIunit, std::string const &IPunit);
    1070              : 
    1071              :     Real64 getSpecificUnitDivider(EnergyPlusData &state, std::string const &SIunit, std::string const &IPunit);
    1072              : 
    1073              :     Real64 getSpecificUnitIndex(EnergyPlusData &state, std::string const &SIunit, std::string const &IPunit);
    1074              : 
    1075              : } // namespace OutputReportTabular
    1076              : 
    1077              : struct OutputReportTabularData : BaseGlobalStruct
    1078              : {
    1079              : 
    1080              :     OutputReportTabular::UnitsStyle unitsStyle = OutputReportTabular::UnitsStyle::None;
    1081          272 :     bool ip() const
    1082              :     {
    1083          530 :         return this->unitsStyle == OutputReportTabular::UnitsStyle::InchPound ||
    1084          530 :                this->unitsStyle == OutputReportTabular::UnitsStyle::InchPoundExceptElectricity;
    1085              :     }
    1086              :     OutputReportTabular::UnitsStyle unitsStyle_SQLite = OutputReportTabular::UnitsStyle::NotFound;
    1087              :     int OutputTableBinnedCount = 0;
    1088              :     int BinResultsTableCount = 0;
    1089              :     int BinResultsIntervalCount = 0;
    1090              :     int MonthlyInputCount = 0;
    1091              :     int sizeMonthlyInput = 0;
    1092              :     int MonthlyFieldSetInputCount = 0;
    1093              :     int sizeMonthlyFieldSetInput = 0;
    1094              :     int MonthlyTablesCount = 0;
    1095              :     int MonthlyColumnsCount = 0;
    1096              :     Array1D_bool IsMonthGathered = Array1D_bool(12, false); // shown as true for any month used
    1097              :     int TOCEntriesCount = 0;
    1098              :     int TOCEntriesSize = 0;
    1099              :     int UnitConvSize = 0;
    1100              :     bool WriteTabularFiles = false;
    1101              :     bool GetInput = true;
    1102              : 
    1103              :     // From Report:Table:Style
    1104              :     int numStyles = 0;
    1105              :     std::ofstream csv_stream; // CSV table stream
    1106              :     std::ofstream tab_stream; // Tab table stream
    1107              :     std::ofstream fix_stream; // Fixed table stream
    1108              :     std::ofstream htm_stream; // HTML table stream
    1109              :     std::ofstream xml_stream; // XML table stream
    1110              :     Array1D<std::ofstream *> TabularOutputFile = Array1D<std::ofstream *>(
    1111              :         OutputReportTabular::maxNumStyles, {&csv_stream, &tab_stream, &fix_stream, &htm_stream, &xml_stream}); // Table stream array
    1112              :     Array1D_string del = Array1D_string(OutputReportTabular::maxNumStyles);                                    // the delimiter to use
    1113              :     Array1D<OutputReportTabular::TableStyle> TableStyle = Array1D<OutputReportTabular::TableStyle>(
    1114              :         OutputReportTabular::maxNumStyles, OutputReportTabular::TableStyle::Invalid); // see list of parameters
    1115              : 
    1116              :     Real64 timeInYear = 0.0;
    1117              : 
    1118              :     // Flags for predefined tabular reports
    1119              :     bool displayTabularBEPS = false;
    1120              :     bool displayLEEDSummary = false;
    1121              :     bool displayTabularCompCosts = false;
    1122              :     bool displayTabularVeriSum = false;
    1123              :     bool displayComponentSizing = false;
    1124              :     bool displaySurfaceShadowing = false;
    1125              :     bool displayDemandEndUse = false;
    1126              :     bool displayAdaptiveComfort = false;
    1127              :     bool displaySourceEnergyEndUseSummary = false;
    1128              :     bool displayZoneComponentLoadSummary = false;
    1129              :     bool displayAirLoopComponentLoadSummary = false;
    1130              :     bool displayFacilityComponentLoadSummary = false;
    1131              :     bool displayLifeCycleCostReport = false;
    1132              :     bool displayTariffReport = false;
    1133              :     bool displayEconomicResultSummary = false;
    1134              :     bool displayHeatEmissionsSummary = false;
    1135              :     bool displayEioSummary = false;
    1136              :     bool displayThermalResilienceSummary = false;
    1137              :     bool displayCO2ResilienceSummary = false;
    1138              :     bool displayVisualResilienceSummary = false;
    1139              :     bool displayThermalResilienceSummaryExplicitly = false;
    1140              :     bool displayCO2ResilienceSummaryExplicitly = false;
    1141              :     bool displayVisualResilienceSummaryExplicitly = false;
    1142              :     // BEPS Report Related Variables
    1143              :     // From Report:Table:Predefined - BEPS
    1144              :     // arrays that hold the meter numbers that are initialized at get input
    1145              : 
    1146              :     Array1D_int meterNumTotalsBEPS = Array1D_int(OutputReportTabular::numResourceTypes, -1);
    1147              :     Array1D_int meterNumTotalsSource = Array1D_int(OutputReportTabular::numSourceTypes, -1);
    1148              :     Array1D_bool fuelfactorsused = Array1D_bool(OutputReportTabular::numSourceTypes, false);
    1149              :     Array1D_bool ffUsed = Array1D_bool(OutputReportTabular::numResourceTypes, false);
    1150              :     Array1D<Real64> SourceFactors = Array1D<Real64>(OutputReportTabular::numResourceTypes, 0.0);
    1151              :     Array1D_bool ffSchedUsed = Array1D_bool(OutputReportTabular::numResourceTypes, false);
    1152              :     Array1D<Sched::Schedule *> ffScheds = Array1D<Sched::Schedule *>(OutputReportTabular::numResourceTypes, nullptr);
    1153              :     Array2D_int meterNumEndUseBEPS = Array2D_int(OutputReportTabular::numResourceTypes, static_cast<int>(Constant::EndUse::Num), -1);
    1154              :     Array3D_int meterNumEndUseSubBEPS;
    1155              :     Array3D_int meterNumEndUseSpTypeBEPS;
    1156              :     // arrays that hold the names of the resource and end uses
    1157              :     Array1D_string resourceTypeNames = Array1D_string(OutputReportTabular::numResourceTypes);
    1158              :     Array1D_string sourceTypeNames = Array1D_string(OutputReportTabular::numSourceTypes);
    1159              :     Array1D_string endUseNames = Array1D_string(static_cast<int>(Constant::EndUse::Num));
    1160              :     // arrays that hold the actual values for the year
    1161              :     Array1D<Real64> gatherTotalsBEPS = Array1D<Real64>(OutputReportTabular::numResourceTypes, 0.0);
    1162              :     Array1D<Real64> gatherTotalsBySourceBEPS = Array1D<Real64>(OutputReportTabular::numResourceTypes, 0.0);
    1163              :     Array1D<Real64> gatherTotalsSource = Array1D<Real64>(OutputReportTabular::numSourceTypes, 0.0);
    1164              :     Array1D<Real64> gatherTotalsBySource = Array1D<Real64>(OutputReportTabular::numSourceTypes, 0.0);
    1165              :     Array2D<Real64> gatherEndUseBEPS = Array2D<Real64>(OutputReportTabular::numResourceTypes, static_cast<int>(Constant::EndUse::Num), 0.0);
    1166              :     Array2D<Real64> gatherEndUseBySourceBEPS = Array2D<Real64>(OutputReportTabular::numResourceTypes, static_cast<int>(Constant::EndUse::Num), 0.0);
    1167              :     Array3D<Real64> gatherEndUseSubBEPS;
    1168              :     Array3D<Real64> gatherEndUseSpTypeBEPS;
    1169              :     Array1D_bool needOtherRowLEED45 = Array1D_bool(static_cast<int>(Constant::EndUse::Num));
    1170              :     Array1D_bool needOtherRowEndUse = Array1D_bool(static_cast<int>(Constant::EndUse::Num));
    1171              : 
    1172              :     // arrays the hold the demand values
    1173              :     Array1D<Real64> gatherDemandTotal = Array1D<Real64>(OutputReportTabular::numResourceTypes, 0.0);
    1174              :     Array2D<Real64> gatherDemandEndUse = Array2D<Real64>(OutputReportTabular::numResourceTypes, static_cast<int>(Constant::EndUse::Num), 0.0);
    1175              :     Array2D<Real64> gatherDemandIndEndUse = Array2D<Real64>(OutputReportTabular::numResourceTypes, static_cast<int>(Constant::EndUse::Num), 0.0);
    1176              :     Array3D<Real64> gatherDemandEndUseSub;
    1177              :     Array3D<Real64> gatherDemandIndEndUseSub;
    1178              :     Array1D_int gatherDemandTimeStamp = Array1D_int(OutputReportTabular::numResourceTypes, 0);
    1179              : 
    1180              :     // to keep track of hours for the BEPS report gathering
    1181              :     Real64 gatherElapsedTimeBEPS = 0.0;
    1182              :     // for normalization of results
    1183              :     Real64 buildingGrossFloorArea = 0.0;
    1184              :     Real64 buildingConditionedFloorArea = 0.0;
    1185              :     // keep track if schedules are used in fuel factors
    1186              :     bool fuelFactorSchedulesUsed = false;
    1187              :     // for electric load components on BEPS report
    1188              :     int meterNumPowerFuelFireGen = 0;
    1189              :     Real64 gatherPowerFuelFireGen = 0.0;
    1190              :     int meterNumPowerPV = 0;
    1191              :     Real64 gatherPowerPV = 0.0;
    1192              :     int meterNumPowerWind = 0;
    1193              :     Real64 gatherPowerWind = 0.0;
    1194              :     Real64 OverallNetEnergyFromStorage = 0.0;
    1195              :     int meterNumPowerHTGeothermal = 0;
    1196              :     Real64 gatherPowerHTGeothermal = 0.0;
    1197              :     int meterNumElecProduced = 0;
    1198              :     Real64 gatherElecProduced = 0.0;
    1199              :     int meterNumElecPurchased = 0;
    1200              :     Real64 gatherElecPurchased = 0.0;
    1201              :     int meterNumElecSurplusSold = 0;
    1202              :     Real64 gatherElecSurplusSold = 0.0;
    1203              :     int meterNumElecStorage = 0;
    1204              :     Real64 gatherElecStorage = 0.0;
    1205              :     int meterNumPowerConversion = 0;
    1206              :     Real64 gatherPowerConversion = 0.0;
    1207              :     // for on site thermal source components on BEPS report
    1208              :     int meterNumWaterHeatRecovery = 0;
    1209              :     Real64 gatherWaterHeatRecovery = 0.0;
    1210              :     int meterNumAirHeatRecoveryCool = 0;
    1211              :     Real64 gatherAirHeatRecoveryCool = 0.0;
    1212              :     int meterNumAirHeatRecoveryHeat = 0;
    1213              :     Real64 gatherAirHeatRecoveryHeat = 0.0;
    1214              :     int meterNumHeatHTGeothermal = 0;
    1215              :     Real64 gatherHeatHTGeothermal = 0.0;
    1216              :     int meterNumHeatSolarWater = 0;
    1217              :     Real64 gatherHeatSolarWater = 0.0;
    1218              :     int meterNumHeatSolarAir = 0;
    1219              :     Real64 gatherHeatSolarAir = 0.0;
    1220              :     // for on site water components on BEPS report
    1221              :     int meterNumRainWater = 0;
    1222              :     Real64 gatherRainWater = 0.0;
    1223              :     int meterNumCondensate = 0;
    1224              :     Real64 gatherCondensate = 0.0;
    1225              :     int meterNumGroundwater = 0;
    1226              :     Real64 gatherWellwater = 0.0;
    1227              :     int meterNumMains = 0;
    1228              :     Real64 gatherMains = 0.0;
    1229              :     int meterNumWaterEndUseTotal = 0;
    1230              :     Real64 gatherWaterEndUseTotal = 0.0;
    1231              :     // for source energy conversion factors on BEPS report
    1232              :     Real64 sourceFactorElectric = 0.0;
    1233              :     Real64 sourceFactorNaturalGas = 0.0;
    1234              :     Real64 efficiencyDistrictCooling = 0.0;
    1235              :     Real64 efficiencyDistrictHeatingWater = 0.0;
    1236              :     Real64 sourceFactorDistrictHeatingSteam = 0.0;
    1237              :     Real64 sourceFactorGasoline = 0.0;
    1238              :     Real64 sourceFactorDiesel = 0.0;
    1239              :     Real64 sourceFactorCoal = 0.0;
    1240              :     Real64 sourceFactorFuelOil1 = 0.0;
    1241              :     Real64 sourceFactorFuelOil2 = 0.0;
    1242              :     Real64 sourceFactorPropane = 0.0;
    1243              :     Real64 sourceFactorOtherFuel1 = 0.0;
    1244              :     Real64 sourceFactorOtherFuel2 = 0.0;
    1245              : 
    1246              :     Array1D_int td = Array1D_int(8);
    1247              :     //(1)   Current year
    1248              :     //(2)   Current month
    1249              :     //(3)   Current day
    1250              :     //(4)   Time difference with respect to UTC in minutes (0-59)
    1251              :     //(5)   Hour of the day (0-23)
    1252              :     //(6)   Minutes (0-59)
    1253              :     //(7)   Seconds (0-59)
    1254              :     //(8)   Milliseconds (0-999)
    1255              : 
    1256              :     // Design day name storage
    1257              :     Array1D_string DesignDayName;
    1258              :     int DesignDayCount = 0;
    1259              : 
    1260              :     // arrays related to pulse and load component reporting
    1261              :     Array2D_int radiantPulseTimestep;
    1262              :     Array2D<Real64> radiantPulseReceived;
    1263              :     Array2D<Real64> decayCurveCool;
    1264              :     Array2D<Real64> decayCurveHeat;
    1265              : 
    1266              :     std::vector<OutputReportTabular::componentLoadsSurf> surfCompLoads; // Surface component loads by day, timestep, then surface
    1267              :     std::vector<OutputReportTabular::componentLoadsSpZn> znCompLoads;   // Zone component loads by day, timestep, then zone
    1268              :     std::vector<OutputReportTabular::componentLoadsSpZn> spCompLoads;   // Space component loads by day, timestep, then space
    1269              :     std::vector<OutputReportTabular::componentLoadsEncl> enclCompLoads; // Enclosure component loads by day, timestep, then enclsoure
    1270              : 
    1271              :     int maxUniqueKeyCount = 0;
    1272              : 
    1273              :     // for the XML report must keep track fo the active sub-table name and report set by other routines
    1274              :     std::string activeSubTableName;
    1275              :     std::string activeReportNameNoSpace;
    1276              :     std::string activeReportName;
    1277              :     std::string activeForName;
    1278              :     std::string prevReportName;
    1279              : 
    1280              :     // Object Data
    1281              :     Array1D<OutputReportTabular::OutputTableBinnedType> OutputTableBinned;
    1282              :     Array2D<OutputReportTabular::BinResultsType> BinResults;      // table number, number of intervals
    1283              :     Array1D<OutputReportTabular::BinResultsType> BinResultsBelow; // time below the lowest defined bin
    1284              :     Array1D<OutputReportTabular::BinResultsType> BinResultsAbove; // time above the highest defined bin
    1285              :     Array1D<OutputReportTabular::BinObjVarIDType> BinObjVarID;
    1286              :     Array1D<OutputReportTabular::BinStatisticsType> BinStatistics;
    1287              :     Array1D<OutputReportTabular::NamedMonthlyType> namedMonthly; // for predefined monthly report titles
    1288              :     Array1D<OutputReportTabular::MonthlyFieldSetInputType> MonthlyFieldSetInput;
    1289              :     Array1D<OutputReportTabular::MonthlyInputType> MonthlyInput;
    1290              :     Array1D<OutputReportTabular::MonthlyTablesType> MonthlyTables;
    1291              :     Array1D<OutputReportTabular::MonthlyColumnsType> MonthlyColumns;
    1292              :     Array1D<OutputReportTabular::TOCEntriesType> TOCEntries;
    1293              :     Array1D<OutputReportTabular::UnitConvType> UnitConv;
    1294              : 
    1295              :     bool GatherMonthlyResultsForTimestepRunOnce = true;
    1296              :     bool UpdateTabularReportsGetInput = true;
    1297              :     bool GatherHeatGainReportfirstTime = true;
    1298              :     bool AllocateLoadComponentArraysDoAllocate = true;
    1299              :     bool initAdjFenDone = false;
    1300              :     int numPeopleAdaptive = 0;
    1301              : 
    1302              :     Real64 BigNum = 0.0;
    1303              :     int ErrCount1 = 0;
    1304              :     Array1D<OutputProcessor::VariableType> MonthlyColumnsTypeOfVar;
    1305              :     Array1D<OutputProcessor::TimeStepType> MonthlyColumnsStepType;
    1306              :     Array1D<OutputReportTabular::AggType> MonthlyColumnsAggType;
    1307              :     Array1D_int MonthlyColumnsVarNum;
    1308              :     Array1D_int MonthlyTablesNumColumns;
    1309              :     int curFirstColumn = 0;
    1310              :     int iZoneGHGR = 0;
    1311              :     int iRadiantGHGR = 0;
    1312              :     int iunitGHGR = 0;
    1313              :     int curZoneGHGR = 0;
    1314              :     Real64 eqpSensGHGR = 0.0;
    1315              :     Real64 totalGHGR = 0.0; // the following arrays store the radiant total for each timestep
    1316              :     Array1D<Real64> radiantHeat;
    1317              :     Array1D<Real64> radiantCool;
    1318              :     Array1D<Real64> ATUHeat;
    1319              :     Array1D<Real64> ATUCool;
    1320              :     int timestepTimeStampGHGR = 0;
    1321              :     Real64 bldgHtPk = 0.0;
    1322              :     Real64 bldgClPk = 0.0;
    1323              :     Real64 timeStepRatio = 0.0;
    1324              :     Real64 totalVolume = 0.0;
    1325              :     int numUncondZones = 0;
    1326              :     int numCondZones = 0;
    1327              :     Real64 HrsPerWeek = 0.0; // sensible heat gain report totals
    1328              :     Real64 totalZoneEqHt = 0.0;
    1329              :     Real64 totalZoneEqCl = 0.0;
    1330              :     Real64 totalHvacATUHt = 0.0;
    1331              :     Real64 totalHvacATUCl = 0.0;
    1332              :     Real64 totalSurfHt = 0.0;
    1333              :     Real64 totalSurfCl = 0.0;
    1334              :     Real64 totalPeoplAdd = 0.0;
    1335              :     Real64 totalLiteAdd = 0.0;
    1336              :     Real64 totalEquipAdd = 0.0;
    1337              :     Real64 totalWindAdd = 0.0;
    1338              :     Real64 totalIzaAdd = 0.0;
    1339              :     Real64 totalInfilAdd = 0.0;
    1340              :     Real64 totalOtherAdd = 0.0;
    1341              :     Real64 totalEquipRem = 0.0;
    1342              :     Real64 totalWindRem = 0.0;
    1343              :     Real64 totalIzaRem = 0.0;
    1344              :     Real64 totalInfilRem = 0.0;
    1345              :     Real64 totalOtherRem = 0.0;
    1346              :     Real64 curConversionOffset = 0.0;
    1347              :     Real64 leedSiteIntLite = 0.0;
    1348              :     Real64 leedSiteSpHeat = 0.0;
    1349              :     Real64 leedSiteSpCool = 0.0;
    1350              :     Real64 leedSiteFanInt = 0.0;
    1351              :     Real64 leedSiteSrvWatr = 0.0;
    1352              :     Real64 leedSiteRecept = 0.0;
    1353              :     Real64 leedSiteTotal = 0.0;
    1354              :     Real64 m2_unitConv = 0.0;
    1355              :     int unitConvIndexWCCT = 0;
    1356              :     int grandTotal = 1;
    1357              :     int condTotal = 2;
    1358              :     int uncondTotal = 3;
    1359              :     int notpartTotal = 4;
    1360              :     int unitConvIndexWVST = 0;
    1361              :     Real64 m_unitConv = 0.0;
    1362              :     Real64 m2_unitConvWVST = 0.0;
    1363              :     Real64 m3_unitConv = 0.0;
    1364              :     Real64 Wm2_unitConv = 0.0;
    1365              :     Array1D<Real64> zstArea = Array1D<Real64>(4);
    1366              :     Array1D<Real64> zstVolume = Array1D<Real64>(4);
    1367              :     Array1D<Real64> zstWallArea = Array1D<Real64>(4);
    1368              :     Array1D<Real64> zstUndWallArea = Array1D<Real64>(4);
    1369              :     Array1D<Real64> zstWindowArea = Array1D<Real64>(4);
    1370              :     Array1D<Real64> zstOpeningArea = Array1D<Real64>(4);
    1371              :     Array1D<Real64> zstLight = Array1D<Real64>(4);
    1372              :     Array1D<Real64> zstPeople = Array1D<Real64>(4);
    1373              :     Array1D<Real64> zstPlug = Array1D<Real64>(4);
    1374              :     int indexUnitConvWCS = 0;
    1375              :     Real64 curValueSIWCS = 0.0;
    1376              :     Real64 curValueWCS = 0.0;
    1377              :     Real64 BigNumRMG = 0.0;
    1378              :     int foundGsui = 0;
    1379              :     int iUnitGsui = 0;
    1380              :     int foundGsum = 0;
    1381              :     int iUnitGsum = 0;
    1382              :     std::string footnote;
    1383              :     std::string m_unitName;
    1384              :     std::string m2_unitName;
    1385              :     std::string m3_unitName;
    1386              :     std::string Wm2_unitName;
    1387              :     std::string curColHeadWithSI;
    1388              :     std::string curColHead;
    1389              : 
    1390         2126 :     void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
    1391              :     {
    1392         2126 :     }
    1393              : 
    1394         1152 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
    1395              :     {
    1396         1152 :     }
    1397              : 
    1398         2100 :     void clear_state() override
    1399              :     {
    1400         2100 :         this->unitsStyle = OutputReportTabular::UnitsStyle::None;
    1401         2100 :         this->unitsStyle_SQLite = OutputReportTabular::UnitsStyle::NotFound;
    1402         2100 :         this->OutputTableBinnedCount = 0;
    1403         2100 :         this->BinResultsTableCount = 0;
    1404         2100 :         this->BinResultsIntervalCount = 0;
    1405         2100 :         this->MonthlyInputCount = 0;
    1406         2100 :         this->sizeMonthlyInput = 0;
    1407         2100 :         this->MonthlyFieldSetInputCount = 0;
    1408         2100 :         this->sizeMonthlyFieldSetInput = 0;
    1409         2100 :         this->MonthlyTablesCount = 0;
    1410         2100 :         this->MonthlyColumnsCount = 0;
    1411         2100 :         this->IsMonthGathered = Array1D_bool(12, false);
    1412         2100 :         this->TOCEntriesCount = 0;
    1413         2100 :         this->TOCEntriesSize = 0;
    1414         2100 :         this->UnitConvSize = 0;
    1415         2100 :         this->WriteTabularFiles = false;
    1416         2100 :         this->GetInput = true;
    1417         2100 :         this->numStyles = 0;
    1418         4200 :         this->TabularOutputFile = Array1D<std::ofstream *>(
    1419         4200 :             OutputReportTabular::maxNumStyles, {&this->csv_stream, &this->tab_stream, &this->fix_stream, &this->htm_stream, &this->xml_stream});
    1420         2100 :         this->del = Array1D_string(OutputReportTabular::maxNumStyles);
    1421         2100 :         this->TableStyle = Array1D<OutputReportTabular::TableStyle>(OutputReportTabular::maxNumStyles, OutputReportTabular::TableStyle::Invalid);
    1422         2100 :         this->timeInYear = 0.0;
    1423         2100 :         this->displayTabularBEPS = false;
    1424         2100 :         this->displayLEEDSummary = false;
    1425         2100 :         this->displayTabularCompCosts = false;
    1426         2100 :         this->displayTabularVeriSum = false;
    1427         2100 :         this->displayComponentSizing = false;
    1428         2100 :         this->displaySurfaceShadowing = false;
    1429         2100 :         this->displayDemandEndUse = false;
    1430         2100 :         this->displayAdaptiveComfort = false;
    1431         2100 :         this->displaySourceEnergyEndUseSummary = false;
    1432         2100 :         this->displayZoneComponentLoadSummary = false;
    1433         2100 :         this->displayAirLoopComponentLoadSummary = false;
    1434         2100 :         this->displayFacilityComponentLoadSummary = false;
    1435         2100 :         this->displayLifeCycleCostReport = false;
    1436         2100 :         this->displayTariffReport = false;
    1437         2100 :         this->displayEconomicResultSummary = false;
    1438         2100 :         this->displayHeatEmissionsSummary = false;
    1439         2100 :         this->displayEioSummary = false;
    1440         2100 :         this->displayThermalResilienceSummary = false;
    1441         2100 :         this->displayCO2ResilienceSummary = false;
    1442         2100 :         this->displayVisualResilienceSummary = false;
    1443         2100 :         this->displayThermalResilienceSummaryExplicitly = false;
    1444         2100 :         this->displayCO2ResilienceSummaryExplicitly = false;
    1445         2100 :         this->displayVisualResilienceSummaryExplicitly = false;
    1446         2100 :         this->meterNumTotalsBEPS = Array1D_int(OutputReportTabular::numResourceTypes, 0);
    1447         2100 :         this->meterNumTotalsSource = Array1D_int(OutputReportTabular::numSourceTypes, 0);
    1448         2100 :         this->fuelfactorsused = Array1D_bool(OutputReportTabular::numSourceTypes, false);
    1449         2100 :         this->ffUsed = Array1D_bool(OutputReportTabular::numResourceTypes, false);
    1450         2100 :         this->SourceFactors = Array1D<Real64>(OutputReportTabular::numResourceTypes, 0.0);
    1451         2100 :         this->ffSchedUsed = Array1D_bool(OutputReportTabular::numResourceTypes, false);
    1452         2100 :         this->ffScheds = Array1D<Sched::Schedule *>(OutputReportTabular::numResourceTypes, nullptr);
    1453         2100 :         this->meterNumEndUseBEPS = Array2D_int(OutputReportTabular::numResourceTypes, static_cast<int>(Constant::EndUse::Num), 0);
    1454         2100 :         this->meterNumEndUseSubBEPS.deallocate();
    1455         2100 :         this->meterNumEndUseSpTypeBEPS.deallocate();
    1456         2100 :         this->resourceTypeNames = Array1D_string(OutputReportTabular::numResourceTypes);
    1457         2100 :         this->sourceTypeNames = Array1D_string(OutputReportTabular::numSourceTypes);
    1458         2100 :         this->endUseNames = Array1D_string(static_cast<int>(Constant::EndUse::Num));
    1459         2100 :         this->gatherTotalsBEPS = Array1D<Real64>(OutputReportTabular::numResourceTypes, 0.0);
    1460         2100 :         this->gatherTotalsBySourceBEPS = Array1D<Real64>(OutputReportTabular::numResourceTypes, 0.0);
    1461         2100 :         this->gatherTotalsSource = Array1D<Real64>(OutputReportTabular::numSourceTypes, 0.0);
    1462         2100 :         this->gatherTotalsBySource = Array1D<Real64>(OutputReportTabular::numSourceTypes, 0.0);
    1463         2100 :         this->gatherEndUseBEPS = Array2D<Real64>(OutputReportTabular::numResourceTypes, static_cast<int>(Constant::EndUse::Num), 0.0);
    1464         2100 :         this->gatherEndUseBySourceBEPS = Array2D<Real64>(OutputReportTabular::numResourceTypes, static_cast<int>(Constant::EndUse::Num), 0.0);
    1465         2100 :         this->gatherEndUseSubBEPS.deallocate();
    1466         2100 :         this->gatherEndUseSpTypeBEPS.deallocate();
    1467         2100 :         this->needOtherRowLEED45 = Array1D_bool(static_cast<int>(Constant::EndUse::Num));
    1468         2100 :         this->needOtherRowEndUse = Array1D_bool(static_cast<int>(Constant::EndUse::Num));
    1469         2100 :         this->gatherDemandTotal = Array1D<Real64>(OutputReportTabular::numResourceTypes, 0.0);
    1470         2100 :         this->gatherDemandEndUse = Array2D<Real64>(OutputReportTabular::numResourceTypes, static_cast<int>(Constant::EndUse::Num), 0.0);
    1471         2100 :         this->gatherDemandIndEndUse = Array2D<Real64>(OutputReportTabular::numResourceTypes, static_cast<int>(Constant::EndUse::Num), 0.0);
    1472         2100 :         this->gatherDemandEndUseSub.deallocate();
    1473         2100 :         this->gatherDemandIndEndUseSub.deallocate();
    1474         2100 :         this->gatherDemandTimeStamp = Array1D_int(OutputReportTabular::numResourceTypes, 0);
    1475         2100 :         this->gatherElapsedTimeBEPS = 0.0;
    1476         2100 :         this->buildingGrossFloorArea = 0.0;
    1477         2100 :         this->buildingConditionedFloorArea = 0.0;
    1478         2100 :         this->fuelFactorSchedulesUsed = false;
    1479         2100 :         this->meterNumPowerFuelFireGen = 0;
    1480         2100 :         this->gatherPowerFuelFireGen = 0.0;
    1481         2100 :         this->meterNumPowerPV = 0;
    1482         2100 :         this->gatherPowerPV = 0.0;
    1483         2100 :         this->meterNumPowerWind = 0;
    1484         2100 :         this->gatherPowerWind = 0.0;
    1485         2100 :         this->OverallNetEnergyFromStorage = 0.0;
    1486         2100 :         this->meterNumPowerHTGeothermal = 0;
    1487         2100 :         this->gatherPowerHTGeothermal = 0.0;
    1488         2100 :         this->meterNumElecProduced = 0;
    1489         2100 :         this->gatherElecProduced = 0.0;
    1490         2100 :         this->meterNumElecPurchased = 0;
    1491         2100 :         this->gatherElecPurchased = 0.0;
    1492         2100 :         this->meterNumElecSurplusSold = 0;
    1493         2100 :         this->gatherElecSurplusSold = 0.0;
    1494         2100 :         this->meterNumElecStorage = 0;
    1495         2100 :         this->gatherElecStorage = 0.0;
    1496         2100 :         this->meterNumPowerConversion = 0;
    1497         2100 :         this->gatherPowerConversion = 0.0;
    1498         2100 :         this->meterNumWaterHeatRecovery = 0;
    1499         2100 :         this->gatherWaterHeatRecovery = 0.0;
    1500         2100 :         this->meterNumAirHeatRecoveryCool = 0;
    1501         2100 :         this->gatherAirHeatRecoveryCool = 0.0;
    1502         2100 :         this->meterNumAirHeatRecoveryHeat = 0;
    1503         2100 :         this->gatherAirHeatRecoveryHeat = 0.0;
    1504         2100 :         this->meterNumHeatHTGeothermal = 0;
    1505         2100 :         this->gatherHeatHTGeothermal = 0.0;
    1506         2100 :         this->meterNumHeatSolarWater = 0;
    1507         2100 :         this->gatherHeatSolarWater = 0.0;
    1508         2100 :         this->meterNumHeatSolarAir = 0;
    1509         2100 :         this->gatherHeatSolarAir = 0.0;
    1510         2100 :         this->meterNumRainWater = 0;
    1511         2100 :         this->gatherRainWater = 0.0;
    1512         2100 :         this->meterNumCondensate = 0;
    1513         2100 :         this->gatherCondensate = 0.0;
    1514         2100 :         this->meterNumGroundwater = 0;
    1515         2100 :         this->gatherWellwater = 0.0;
    1516         2100 :         this->meterNumMains = 0;
    1517         2100 :         this->gatherMains = 0.0;
    1518         2100 :         this->meterNumWaterEndUseTotal = 0;
    1519         2100 :         this->gatherWaterEndUseTotal = 0.0;
    1520         2100 :         this->sourceFactorElectric = 0.0;
    1521         2100 :         this->sourceFactorNaturalGas = 0.0;
    1522         2100 :         this->efficiencyDistrictCooling = 0.0;
    1523         2100 :         this->efficiencyDistrictHeatingWater = 0.0;
    1524         2100 :         this->sourceFactorDistrictHeatingSteam = 0.0;
    1525         2100 :         this->sourceFactorGasoline = 0.0;
    1526         2100 :         this->sourceFactorDiesel = 0.0;
    1527         2100 :         this->sourceFactorCoal = 0.0;
    1528         2100 :         this->sourceFactorFuelOil1 = 0.0;
    1529         2100 :         this->sourceFactorFuelOil2 = 0.0;
    1530         2100 :         this->sourceFactorPropane = 0.0;
    1531         2100 :         this->sourceFactorOtherFuel1 = 0.0;
    1532         2100 :         this->sourceFactorOtherFuel2 = 0.0;
    1533         2100 :         this->td = Array1D_int(8);
    1534         2100 :         this->DesignDayName.deallocate();
    1535         2100 :         this->DesignDayCount = 0;
    1536         2100 :         this->radiantPulseTimestep.deallocate();
    1537         2100 :         this->radiantPulseReceived.deallocate();
    1538         2100 :         this->decayCurveCool.deallocate();
    1539         2100 :         this->decayCurveHeat.deallocate();
    1540         2100 :         this->surfCompLoads.clear();
    1541         2100 :         this->znCompLoads.clear();
    1542         2100 :         this->spCompLoads.clear();
    1543         2100 :         this->enclCompLoads.clear();
    1544              : 
    1545         2100 :         this->maxUniqueKeyCount = 0;
    1546         2100 :         this->activeSubTableName.clear();
    1547         2100 :         this->activeReportNameNoSpace.clear();
    1548         2100 :         this->activeReportName.clear();
    1549         2100 :         this->activeForName.clear();
    1550         2100 :         this->prevReportName.clear();
    1551         2100 :         this->OutputTableBinned.deallocate();
    1552         2100 :         this->BinResults.deallocate();
    1553         2100 :         this->BinResultsBelow.deallocate();
    1554         2100 :         this->BinResultsAbove.deallocate();
    1555         2100 :         this->BinObjVarID.deallocate();
    1556         2100 :         this->BinStatistics.deallocate();
    1557         2100 :         this->namedMonthly.deallocate();
    1558         2100 :         this->MonthlyFieldSetInput.deallocate();
    1559         2100 :         this->MonthlyInput.deallocate();
    1560         2100 :         this->MonthlyTables.deallocate();
    1561         2100 :         this->MonthlyColumns.deallocate();
    1562         2100 :         this->TOCEntries.deallocate();
    1563         2100 :         this->UnitConv.deallocate();
    1564         2100 :         this->GatherMonthlyResultsForTimestepRunOnce = true;
    1565         2100 :         this->UpdateTabularReportsGetInput = true;
    1566         2100 :         this->GatherHeatGainReportfirstTime = true;
    1567         2100 :         this->AllocateLoadComponentArraysDoAllocate = true;
    1568         2100 :         this->initAdjFenDone = false;
    1569         2100 :         this->numPeopleAdaptive = 0;
    1570              : 
    1571         2100 :         this->BigNum = 0.0;
    1572         2100 :         this->ErrCount1 = 0;
    1573         2100 :         this->MonthlyColumnsTypeOfVar.clear();
    1574         2100 :         this->MonthlyColumnsStepType.clear();
    1575         2100 :         this->MonthlyColumnsAggType.clear();
    1576         2100 :         this->MonthlyColumnsVarNum.clear();
    1577         2100 :         this->MonthlyTablesNumColumns.clear();
    1578         2100 :         this->curFirstColumn = 0;
    1579         2100 :         this->iZoneGHGR = 0;
    1580         2100 :         this->iRadiantGHGR = 0;
    1581         2100 :         this->iunitGHGR = 0;
    1582         2100 :         this->curZoneGHGR = 0;
    1583         2100 :         this->eqpSensGHGR = 0.0;
    1584         2100 :         this->totalGHGR = 0.0;
    1585              :         // the following arrays store the radiant total for each timestep
    1586         2100 :         this->radiantHeat.clear();
    1587         2100 :         this->radiantCool.clear();
    1588         2100 :         this->ATUHeat.clear();
    1589         2100 :         this->ATUCool.clear();
    1590         2100 :         this->timestepTimeStampGHGR = 0;
    1591         2100 :         this->bldgHtPk = 0.0;
    1592         2100 :         this->bldgClPk = 0.0;
    1593         2100 :         this->timeStepRatio = 0.0;
    1594         2100 :         this->totalVolume = 0.0;
    1595         2100 :         this->numUncondZones = 0;
    1596         2100 :         this->numCondZones = 0;
    1597         2100 :         this->HrsPerWeek = 0.0;
    1598              :         // sensible heat gain report totals
    1599         2100 :         this->totalZoneEqHt = 0.0;
    1600         2100 :         this->totalZoneEqCl = 0.0;
    1601         2100 :         this->totalHvacATUHt = 0.0;
    1602         2100 :         this->totalHvacATUCl = 0.0;
    1603         2100 :         this->totalSurfHt = 0.0;
    1604         2100 :         this->totalSurfCl = 0.0;
    1605         2100 :         this->totalPeoplAdd = 0.0;
    1606         2100 :         this->totalLiteAdd = 0.0;
    1607         2100 :         this->totalEquipAdd = 0.0;
    1608         2100 :         this->totalWindAdd = 0.0;
    1609         2100 :         this->totalIzaAdd = 0.0;
    1610         2100 :         this->totalInfilAdd = 0.0;
    1611         2100 :         this->totalOtherAdd = 0.0;
    1612         2100 :         this->totalEquipRem = 0.0;
    1613         2100 :         this->totalWindRem = 0.0;
    1614         2100 :         this->totalIzaRem = 0.0;
    1615         2100 :         this->totalInfilRem = 0.0;
    1616         2100 :         this->totalOtherRem = 0.0;
    1617         2100 :         this->curConversionOffset = 0.0;
    1618         2100 :         this->leedSiteIntLite = 0.0;
    1619         2100 :         this->leedSiteSpHeat = 0.0;
    1620         2100 :         this->leedSiteSpCool = 0.0;
    1621         2100 :         this->leedSiteFanInt = 0.0;
    1622         2100 :         this->leedSiteSrvWatr = 0.0;
    1623         2100 :         this->leedSiteRecept = 0.0;
    1624         2100 :         this->leedSiteTotal = 0.0;
    1625         2100 :         this->m2_unitConv = 0.0;
    1626         2100 :         this->unitConvIndexWCCT = 0;
    1627         2100 :         this->grandTotal = 1;
    1628         2100 :         this->condTotal = 2;
    1629         2100 :         this->uncondTotal = 3;
    1630         2100 :         this->notpartTotal = 4;
    1631         2100 :         this->unitConvIndexWVST = 0;
    1632         2100 :         this->m_unitConv = 0.0;
    1633         2100 :         this->m2_unitConvWVST = 0.0;
    1634         2100 :         this->m3_unitConv = 0.0;
    1635         2100 :         this->Wm2_unitConv = 0.0;
    1636         2100 :         this->zstArea = Array1D<Real64>(4);
    1637         2100 :         this->zstVolume = Array1D<Real64>(4);
    1638         2100 :         this->zstWallArea = Array1D<Real64>(4);
    1639         2100 :         this->zstUndWallArea = Array1D<Real64>(4);
    1640         2100 :         this->zstWindowArea = Array1D<Real64>(4);
    1641         2100 :         this->zstOpeningArea = Array1D<Real64>(4);
    1642         2100 :         this->zstLight = Array1D<Real64>(4);
    1643         2100 :         this->zstPeople = Array1D<Real64>(4);
    1644         2100 :         this->zstPlug = Array1D<Real64>(4);
    1645         2100 :         this->indexUnitConvWCS = 0;
    1646         2100 :         this->curValueSIWCS = 0.0;
    1647         2100 :         this->curValueWCS = 0.0;
    1648         2100 :         this->BigNumRMG = 0.0;
    1649         2100 :         this->foundGsui = 0;
    1650         2100 :         this->iUnitGsui = 0;
    1651         2100 :         this->foundGsum = 0;
    1652         2100 :         this->iUnitGsum = 0;
    1653         2100 :         this->footnote.clear();
    1654         2100 :         this->m_unitName.clear();
    1655         2100 :         this->m2_unitName.clear();
    1656         2100 :         this->m3_unitName.clear();
    1657         2100 :         this->Wm2_unitName.clear();
    1658         2100 :         this->curColHeadWithSI.clear();
    1659         2100 :         this->curColHead.clear();
    1660         2100 :     }
    1661              : };
    1662              : 
    1663              : } // namespace EnergyPlus
    1664              : 
    1665              : #endif
        

Generated by: LCOV version 2.0-1