LCOV - code coverage report
Current view: top level - EnergyPlus - InternalHeatGains.cc (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 3898 4873 80.0 %
Date: 2024-08-23 23:50:59 Functions: 35 35 100.0 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2024, 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             : // C++ Headers
      49             : #include <cmath>
      50             : #include <map>
      51             : #include <string>
      52             : 
      53             : // ObjexxFCL Headers
      54             : #include <ObjexxFCL/Array.functions.hh>
      55             : #include <ObjexxFCL/Array1D.hh>
      56             : #include <ObjexxFCL/Fmath.hh>
      57             : 
      58             : // EnergyPlus Headers
      59             : #include <EnergyPlus/CurveManager.hh>
      60             : #include <EnergyPlus/Data/EnergyPlusData.hh>
      61             : #include <EnergyPlus/DataContaminantBalance.hh>
      62             : #include <EnergyPlus/DataEnvironment.hh>
      63             : #include <EnergyPlus/DataGlobalConstants.hh>
      64             : #include <EnergyPlus/DataHVACGlobals.hh>
      65             : #include <EnergyPlus/DataHeatBalSurface.hh>
      66             : #include <EnergyPlus/DataHeatBalance.hh>
      67             : #include <EnergyPlus/DataIPShortCuts.hh>
      68             : #include <EnergyPlus/DataLoopNode.hh>
      69             : #include <EnergyPlus/DataPrecisionGlobals.hh>
      70             : #include <EnergyPlus/DataRoomAirModel.hh>
      71             : #include <EnergyPlus/DataViewFactorInformation.hh>
      72             : #include <EnergyPlus/DataZoneEquipment.hh>
      73             : #include <EnergyPlus/DaylightingDevices.hh>
      74             : #include <EnergyPlus/DaylightingManager.hh>
      75             : #include <EnergyPlus/EMSManager.hh>
      76             : #include <EnergyPlus/ElectricPowerServiceManager.hh>
      77             : #include <EnergyPlus/FuelCellElectricGenerator.hh>
      78             : #include <EnergyPlus/General.hh>
      79             : #include <EnergyPlus/HeatBalanceIntRadExchange.hh>
      80             : #include <EnergyPlus/HeatBalanceInternalHeatGains.hh>
      81             : #include <EnergyPlus/HybridModel.hh>
      82             : #include <EnergyPlus/InputProcessing/InputProcessor.hh>
      83             : #include <EnergyPlus/InternalHeatGains.hh>
      84             : #include <EnergyPlus/MicroCHPElectricGenerator.hh>
      85             : #include <EnergyPlus/NodeInputManager.hh>
      86             : #include <EnergyPlus/OutputProcessor.hh>
      87             : #include <EnergyPlus/OutputReportPredefined.hh>
      88             : #include <EnergyPlus/OutputReportTabular.hh>
      89             : #include <EnergyPlus/PipeHeatTransfer.hh>
      90             : #include <EnergyPlus/Psychrometrics.hh>
      91             : #include <EnergyPlus/RefrigeratedCase.hh>
      92             : #include <EnergyPlus/ScheduleManager.hh>
      93             : #include <EnergyPlus/SetPointManager.hh>
      94             : #include <EnergyPlus/UtilityRoutines.hh>
      95             : #include <EnergyPlus/WaterThermalTanks.hh>
      96             : #include <EnergyPlus/WaterUse.hh>
      97             : #include <EnergyPlus/ZonePlenum.hh>
      98             : #include <EnergyPlus/ZoneTempPredictorCorrector.hh>
      99             : 
     100             : namespace EnergyPlus {
     101             : 
     102             : namespace InternalHeatGains {
     103             :     // Module containing the routines dealing with the internal heat gains
     104             : 
     105             :     // MODULE INFORMATION:
     106             :     //       AUTHOR         Rick Strand
     107             :     //       DATE WRITTEN   August 2000
     108             :     //       MODIFIED       Aug 2005, PGE (Added object names and report variables)
     109             :     //                      Feb 2006, PGE (Added end-use subcategories)
     110             :     //       RE-ENGINEERED  na
     111             : 
     112             :     // PURPOSE OF THIS MODULE:
     113             :     // Part of the heat balance modularization/re-engineering.  Purpose of this
     114             :     // module is to contain the internal heat gain routines in a single location.
     115             : 
     116             :     // METHODOLOGY EMPLOYED:
     117             :     // Routines are called as subroutines to supply the data-only module structures
     118             :     // with the proper values.
     119             : 
     120             :     // REFERENCES:
     121             :     // Legacy BLAST code
     122             : 
     123             :     // OTHER NOTES: none
     124             : 
     125             :     // Using/Aliasing
     126             :     using namespace DataEnvironment;
     127             :     using namespace DataHeatBalance;
     128             :     using namespace DataSurfaces;
     129             : 
     130     2805474 :     void ManageInternalHeatGains(EnergyPlusData &state,
     131             :                                  ObjexxFCL::Optional_bool_const InitOnly) // when true, just calls the get input, if appropriate and returns.
     132             :     {
     133             : 
     134             :         // SUBROUTINE INFORMATION:
     135             :         //       AUTHOR         Rick Strand
     136             :         //       DATE WRITTEN   May 2000
     137             :         //       MODIFIED       Mar 2004, FCW: move call to DayltgElecLightingControl from InitSurfaceHeatBalance
     138             :         //       RE-ENGINEERED  na
     139             : 
     140             :         // PURPOSE OF THIS SUBROUTINE:
     141             :         // This is the main driver subroutine for the internal heat gains.
     142             : 
     143     2805474 :         if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) {
     144         796 :             GetInternalHeatGainsInput(state);
     145         796 :             state.dataInternalHeatGains->GetInternalHeatGainsInputFlag = false;
     146             :         }
     147             : 
     148     2805474 :         if (present(InitOnly)) {
     149     2805474 :             if (InitOnly) return;
     150             :         }
     151             : 
     152     2804678 :         InitInternalHeatGains(state);
     153             : 
     154     2804678 :         ReportInternalHeatGains(state);
     155             : 
     156     2804678 :         CheckReturnAirHeatGain(state);
     157             : 
     158             :         // for the load component report, gather the load components for each timestep but not when doing pulse
     159     2804678 :         if (state.dataGlobal->ZoneSizingCalc) GatherComponentLoadsIntGain(state);
     160             :     }
     161             : 
     162         796 :     void GetInternalHeatGainsInput(EnergyPlusData &state)
     163             :     {
     164             : 
     165             :         // SUBROUTINE INFORMATION:
     166             :         //       AUTHOR         Linda K. Lawrie
     167             :         //       DATE WRITTEN   September 1997
     168             :         //       MODIFIED       September 1998, FW
     169             :         //                      May 2009, BG: added calls to setup for possible EMS override
     170             :         //       RE-ENGINEERED  August 2000, RKS
     171             : 
     172             :         // PURPOSE OF THIS SUBROUTINE:
     173             :         // This subroutine gets the Internal Heat Gain Data for the Zones.
     174             :         // Sets up the various data that will be used later with the
     175             :         // schedulemanager to determine the actual values.
     176             : 
     177             :         // METHODOLOGY EMPLOYED:
     178             :         // The GetObjectItem routines are employed to retrieve the data.
     179             : 
     180             :         // REFERENCES:
     181             :         // IDD Objects:
     182             :         // People
     183             :         // Lights
     184             :         // ElectricEquipment
     185             :         // GasEquipment
     186             :         // SteamEquipment
     187             :         // HotWaterEquipment
     188             :         // OtherEquipment
     189             :         // ElectricEquipment:ITE:AirCooled
     190             :         // ZoneBaseboard:OutdoorTemperatureControlled
     191             : 
     192             :         // Using/Aliasing
     193             :         using namespace ScheduleManager;
     194             : 
     195             :         using namespace OutputReportPredefined;
     196             :         using namespace DataLoopNode;
     197             :         using Curve::GetCurveIndex;
     198             :         using NodeInputManager::GetOnlySingleNode;
     199             : 
     200             :         // SUBROUTINE PARAMETER DEFINITIONS:
     201             :         static constexpr std::string_view RoutineName("GetInternalHeatGains: ");
     202             : 
     203             :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
     204             :         int IOStat;
     205             : 
     206             :         //   Variables for reporting nominal internal gains
     207             :         Real64 LightTot;       // Total Lights for calculating lights per square meter
     208             :         Real64 ElecTot;        // Total Electric Load for calculating electric per square meter
     209             :         Real64 GasTot;         // Total Gas load for calculating gas per square meter
     210             :         Real64 OthTot;         // Total Other load for calculating other load per square meter
     211             :         Real64 HWETot;         // Total Hot Water Equipment for calculating HWE per square meter
     212             :         Real64 StmTot;         // Total Steam for calculating Steam per square meter
     213         796 :         std::string BBHeatInd; // Yes if BBHeat in zone, no if not.
     214             :         Real64 SchMin;
     215             :         Real64 SchMax;
     216         796 :         std::string liteName;
     217             : 
     218             :         // Formats
     219             :         static constexpr std::string_view Format_720(" Zone Internal Gains Nominal, {},{:.2R},{:.1R},");
     220             :         static constexpr std::string_view Format_722(" {} Internal Gains Nominal, {},{},{},{:.2R},{:.1R},");
     221             :         static constexpr std::string_view Format_723(
     222             :             "! <{} Internal Gains Nominal>,Name,Schedule Name,Zone Name,Zone Floor Area {{m2}},# Zone Occupants,{}");
     223             :         static constexpr std::string_view Format_724(" {}, {}\n");
     224             : 
     225       31021 :         auto print_and_divide_if_greater_than_zero = [&](const Real64 numerator, const Real64 denominator) {
     226       31021 :             if (denominator > 0.0) {
     227       29328 :                 print(state.files.eio, "{:.3R},", numerator / denominator);
     228             :             } else {
     229        1693 :                 print(state.files.eio, "N/A,");
     230             :             }
     231       31021 :         };
     232             : 
     233         796 :         auto &ErrorsFound(state.dataInternalHeatGains->ErrorsFound);
     234             : 
     235             :         // TODO MJW: Punt for now, sometimes unit test need these to be allocated in AllocateZoneHeatBalArrays, but simulations need them here
     236         796 :         if (!state.dataHeatBal->ZoneIntGain.allocated()) {
     237         796 :             DataHeatBalance::AllocateIntGains(state);
     238             :         }
     239         796 :         state.dataHeatBal->ZoneRpt.allocate(state.dataGlobal->NumOfZones);
     240         796 :         state.dataHeatBal->spaceRpt.allocate(state.dataGlobal->numSpaces);
     241         796 :         state.dataHeatBal->ZoneIntEEuse.allocate(state.dataGlobal->NumOfZones);
     242         796 :         state.dataHeatBal->RefrigCaseCredit.allocate(state.dataGlobal->NumOfZones);
     243             : 
     244         796 :         Array1D_bool RepVarSet;
     245         796 :         RepVarSet.allocate(state.dataGlobal->NumOfZones);
     246        5852 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
     247        5056 :             RepVarSet(zoneNum) = true;
     248             :         }
     249             : 
     250         796 :         const std::string peopleModuleObject = "People";
     251         796 :         const std::string lightsModuleObject = "Lights";
     252         796 :         const std::string elecEqModuleObject = "ElectricEquipment";
     253         796 :         const std::string gasEqModuleObject = "GasEquipment";
     254         796 :         const std::string hwEqModuleObject = "HotWaterEquipment";
     255         796 :         const std::string stmEqModuleObject = "SteamEquipment";
     256         796 :         const std::string othEqModuleObject = "OtherEquipment";
     257         796 :         const std::string itEqModuleObject = "ElectricEquipment:ITE:AirCooled";
     258         796 :         const std::string bbModuleObject = "ZoneBaseboard:OutdoorTemperatureControlled";
     259         796 :         const std::string contamSSModuleObject = "ZoneContaminantSourceAndSink:CarbonDioxide";
     260             : 
     261             :         // Because there are occassions where getObjectItem will be called a second time within the routine (#9680)
     262             :         // We should use local arrays instead of state.dataIPShortCut
     263         796 :         int IHGNumAlphas = 0;
     264         796 :         int IHGNumNumbers = 0;
     265         796 :         Array1D<Real64> IHGNumbers;
     266         796 :         Array1D_string IHGAlphas;
     267         796 :         Array1D_bool IHGNumericFieldBlanks;
     268         796 :         Array1D_bool IHGAlphaFieldBlanks;
     269         796 :         Array1D_string IHGAlphaFieldNames;
     270         796 :         Array1D_string IHGNumericFieldNames;
     271             : 
     272             :         {
     273         796 :             int MaxAlphas = 0;
     274         796 :             int MaxNums = 0;
     275         796 :             int NumParams = 0;
     276         796 :             for (const auto &moduleName : {peopleModuleObject,
     277             :                                            lightsModuleObject,
     278             :                                            elecEqModuleObject,
     279             :                                            gasEqModuleObject,
     280             :                                            hwEqModuleObject,
     281             :                                            stmEqModuleObject,
     282             :                                            othEqModuleObject,
     283             :                                            itEqModuleObject,
     284             :                                            bbModuleObject,
     285       17512 :                                            contamSSModuleObject}) {
     286        7960 :                 state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, moduleName, NumParams, IHGNumAlphas, IHGNumNumbers);
     287        7960 :                 MaxAlphas = std::max(MaxAlphas, IHGNumAlphas);
     288        7960 :                 MaxNums = std::max(MaxNums, IHGNumNumbers);
     289        8756 :             }
     290         796 :             IHGAlphas.allocate(MaxAlphas);
     291         796 :             IHGAlphaFieldNames.allocate(MaxAlphas);
     292         796 :             IHGAlphaFieldBlanks.dimension(MaxAlphas, true);
     293             : 
     294         796 :             IHGNumbers.dimension(MaxNums, 0.0);
     295         796 :             IHGNumericFieldNames.allocate(MaxNums);
     296         796 :             IHGNumericFieldBlanks.dimension(MaxNums, true);
     297         796 :             IHGNumAlphas = 0;
     298         796 :             IHGNumNumbers = 0;
     299             :         }
     300             : 
     301             :         // PEOPLE: Includes both information related to the heat balance and thermal comfort
     302         796 :         EPVector<InternalHeatGains::GlobalInternalGainMiscObject> peopleObjects;
     303         796 :         int numPeopleStatements = 0;
     304         796 :         setupIHGZonesAndSpaces(state, peopleModuleObject, peopleObjects, numPeopleStatements, state.dataHeatBal->TotPeople, ErrorsFound);
     305             : 
     306         796 :         if (state.dataHeatBal->TotPeople > 0) {
     307         663 :             state.dataHeatBal->People.allocate(state.dataHeatBal->TotPeople);
     308         663 :             int peopleNum = 0;
     309        4653 :             for (int peopleInputNum = 1; peopleInputNum <= numPeopleStatements; ++peopleInputNum) {
     310        3990 :                 state.dataInputProcessing->inputProcessor->getObjectItem(state,
     311             :                                                                          peopleModuleObject,
     312             :                                                                          peopleInputNum,
     313             :                                                                          IHGAlphas,
     314             :                                                                          IHGNumAlphas,
     315             :                                                                          IHGNumbers,
     316             :                                                                          IHGNumNumbers,
     317             :                                                                          IOStat,
     318             :                                                                          IHGNumericFieldBlanks,
     319             :                                                                          IHGAlphaFieldBlanks,
     320             :                                                                          IHGAlphaFieldNames,
     321             :                                                                          IHGNumericFieldNames);
     322             : 
     323             :                 // Create one People instance for every space associated with this People input object
     324        3990 :                 auto &thisPeopleInput = peopleObjects(peopleInputNum);
     325        8104 :                 for (int Item1 = 1; Item1 <= thisPeopleInput.numOfSpaces; ++Item1) {
     326        4114 :                     ++peopleNum;
     327        4114 :                     auto &thisPeople = state.dataHeatBal->People(peopleNum);
     328        4114 :                     int const spaceNum = thisPeopleInput.spaceNums(Item1);
     329        4114 :                     int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
     330        4114 :                     thisPeople.Name = thisPeopleInput.names(Item1);
     331        4114 :                     thisPeople.spaceIndex = spaceNum;
     332        4114 :                     thisPeople.ZonePtr = zoneNum;
     333             : 
     334        4114 :                     thisPeople.NumberOfPeoplePtr = GetScheduleIndex(state, IHGAlphas(3));
     335        4114 :                     SchMin = 0.0;
     336        4114 :                     SchMax = 0.0;
     337        4114 :                     if (thisPeople.NumberOfPeoplePtr == 0) {
     338           0 :                         if (Item1 == 1) { // only show error on first one
     339           0 :                             if (IHGAlphaFieldBlanks(3)) {
     340           0 :                                 ShowSevereError(
     341             :                                     state,
     342           0 :                                     format("{}{}=\"{}\", {} is required.", RoutineName, peopleModuleObject, IHGAlphas(1), IHGAlphaFieldNames(3)));
     343             :                             } else {
     344           0 :                                 ShowSevereError(state,
     345           0 :                                                 format("{}{}=\"{}\", invalid {} entered={}",
     346             :                                                        RoutineName,
     347             :                                                        peopleModuleObject,
     348             :                                                        IHGAlphas(1),
     349             :                                                        IHGAlphaFieldNames(3),
     350             :                                                        IHGAlphas(3)));
     351             :                             }
     352           0 :                             ErrorsFound = true;
     353             :                         }
     354             :                     } else { // check min/max on schedule
     355        4114 :                         SchMin = GetScheduleMinValue(state, thisPeople.NumberOfPeoplePtr);
     356        4114 :                         SchMax = GetScheduleMaxValue(state, thisPeople.NumberOfPeoplePtr);
     357        4114 :                         if (SchMin < 0.0 || SchMax < 0.0) {
     358           0 :                             if (Item1 == 1) {
     359           0 :                                 if (SchMin < 0.0) {
     360           0 :                                     ShowSevereError(state,
     361           0 :                                                     format("{}{}=\"{}\", {}, minimum is < 0.0",
     362             :                                                            RoutineName,
     363             :                                                            peopleModuleObject,
     364             :                                                            IHGAlphas(1),
     365             :                                                            IHGAlphaFieldNames(3)));
     366           0 :                                     ShowContinueError(state,
     367           0 :                                                       format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMin));
     368           0 :                                     ErrorsFound = true;
     369             :                                 }
     370             :                             }
     371           0 :                             if (Item1 == 1) {
     372           0 :                                 if (SchMax < 0.0) {
     373           0 :                                     ShowSevereError(state,
     374           0 :                                                     format("{}{}=\"{}\", {}, maximum is < 0.0",
     375             :                                                            RoutineName,
     376             :                                                            peopleModuleObject,
     377             :                                                            IHGAlphas(1),
     378             :                                                            IHGAlphaFieldNames(3)));
     379           0 :                                     ShowContinueError(state,
     380           0 :                                                       format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMax));
     381           0 :                                     ErrorsFound = true;
     382             :                                 }
     383             :                             }
     384             :                         }
     385             :                     }
     386             : 
     387             :                     // Number of people calculation method.
     388             :                     {
     389        4114 :                         std::string const &peopleMethod = IHGAlphas(4);
     390        4114 :                         if (peopleMethod == "PEOPLE") {
     391             :                             // Set space load fraction
     392        2826 :                             Real64 spaceFrac = 1.0;
     393        2826 :                             if (thisPeopleInput.numOfSpaces > 1) {
     394          18 :                                 Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
     395          18 :                                 if (zoneArea > 0.0) {
     396          18 :                                     spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
     397             :                                 } else {
     398           0 :                                     ShowSevereError(state, format("{}Zone floor area is zero when allocating People loads to Spaces.", RoutineName));
     399           0 :                                     ShowContinueError(state,
     400           0 :                                                       format("Occurs for People object ={} in Zone={}",
     401           0 :                                                              thisPeopleInput.Name,
     402           0 :                                                              state.dataHeatBal->Zone(zoneNum).Name));
     403           0 :                                     ErrorsFound = true;
     404             :                                 }
     405             :                             }
     406        2826 :                             thisPeople.NumberOfPeople = IHGNumbers(1) * spaceFrac;
     407        2826 :                             if (IHGNumericFieldBlanks(1)) {
     408          40 :                                 ShowWarningError(state,
     409          60 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 People will result.",
     410             :                                                         RoutineName,
     411             :                                                         peopleModuleObject,
     412          20 :                                                         thisPeople.Name,
     413             :                                                         IHGNumericFieldNames(1)));
     414             :                             }
     415             : 
     416        1288 :                         } else if (peopleMethod == "PEOPLE/AREA") {
     417         143 :                             if (spaceNum != 0) {
     418         143 :                                 if (IHGNumbers(2) >= 0.0) {
     419         143 :                                     thisPeople.NumberOfPeople = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
     420         146 :                                     if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
     421           3 :                                         !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
     422           0 :                                         ShowWarningError(state,
     423           0 :                                                          format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0.  0 People will result.",
     424             :                                                                 RoutineName,
     425             :                                                                 peopleModuleObject,
     426           0 :                                                                 thisPeople.Name,
     427             :                                                                 IHGNumericFieldNames(2)));
     428             :                                     }
     429             :                                 } else {
     430           0 :                                     ShowSevereError(state,
     431           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
     432             :                                                            RoutineName,
     433             :                                                            peopleModuleObject,
     434           0 :                                                            thisPeople.Name,
     435             :                                                            IHGNumericFieldNames(2),
     436             :                                                            IHGNumbers(2)));
     437           0 :                                     ErrorsFound = true;
     438             :                                 }
     439             :                             }
     440         143 :                             if (IHGNumericFieldBlanks(2)) {
     441           0 :                                 ShowWarningError(state,
     442           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 People will result.",
     443             :                                                         RoutineName,
     444             :                                                         peopleModuleObject,
     445           0 :                                                         thisPeople.Name,
     446             :                                                         IHGNumericFieldNames(2)));
     447             :                             }
     448             : 
     449        1145 :                         } else if (peopleMethod == "AREA/PERSON") {
     450        1145 :                             if (spaceNum != 0) {
     451        1145 :                                 if (IHGNumbers(3) > 0.0) {
     452        1145 :                                     thisPeople.NumberOfPeople = state.dataHeatBal->space(spaceNum).FloorArea / IHGNumbers(3);
     453        1145 :                                     if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
     454           0 :                                         !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
     455           0 :                                         ShowWarningError(state,
     456           0 :                                                          format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0.  0 People will result.",
     457             :                                                                 RoutineName,
     458             :                                                                 peopleModuleObject,
     459           0 :                                                                 thisPeople.Name,
     460             :                                                                 IHGNumericFieldNames(3)));
     461             :                                     }
     462             :                                 } else {
     463           0 :                                     ShowSevereError(state,
     464           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
     465             :                                                            RoutineName,
     466             :                                                            peopleModuleObject,
     467           0 :                                                            thisPeople.Name,
     468             :                                                            IHGNumericFieldNames(3),
     469             :                                                            IHGNumbers(3)));
     470           0 :                                     ErrorsFound = true;
     471             :                                 }
     472             :                             }
     473        1145 :                             if (IHGNumericFieldBlanks(3)) {
     474           0 :                                 ShowWarningError(state,
     475           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 People will result.",
     476             :                                                         RoutineName,
     477             :                                                         peopleModuleObject,
     478           0 :                                                         thisPeople.Name,
     479             :                                                         IHGNumericFieldNames(3)));
     480             :                             }
     481             : 
     482             :                         } else {
     483           0 :                             if (Item1 == 1) {
     484           0 :                                 ShowSevereError(state,
     485           0 :                                                 format("{}{}=\"{}\", invalid {}, value  ={}",
     486             :                                                        RoutineName,
     487             :                                                        peopleModuleObject,
     488             :                                                        IHGAlphas(1),
     489             :                                                        IHGAlphaFieldNames(4),
     490             :                                                        IHGAlphas(4)));
     491           0 :                                 ShowContinueError(state, "...Valid values are \"People\", \"People/Area\", \"Area/Person\".");
     492           0 :                                 ErrorsFound = true;
     493             :                             }
     494             :                         }
     495             :                     }
     496             : 
     497             :                     // Calculate nominal min/max people
     498        4114 :                     thisPeople.NomMinNumberPeople = thisPeople.NumberOfPeople * SchMin;
     499        4114 :                     thisPeople.NomMaxNumberPeople = thisPeople.NumberOfPeople * SchMax;
     500             : 
     501        4114 :                     if (zoneNum > 0) {
     502        4114 :                         state.dataHeatBal->Zone(zoneNum).TotOccupants += thisPeople.NumberOfPeople;
     503             :                         // Note that min/max occupants are non-coincident
     504        4114 :                         state.dataHeatBal->Zone(zoneNum).minOccupants += thisPeople.NomMinNumberPeople;
     505        4114 :                         state.dataHeatBal->Zone(zoneNum).maxOccupants += thisPeople.NomMaxNumberPeople;
     506             :                     }
     507             : 
     508        4114 :                     if (spaceNum > 0) {
     509        4114 :                         state.dataHeatBal->space(spaceNum).TotOccupants += thisPeople.NumberOfPeople;
     510             :                         // Note that min/max occupants are non-coincident
     511        4114 :                         state.dataHeatBal->space(spaceNum).minOccupants += thisPeople.NomMinNumberPeople;
     512        4114 :                         state.dataHeatBal->space(spaceNum).maxOccupants += thisPeople.NomMaxNumberPeople;
     513             :                     }
     514        4114 :                     thisPeople.FractionRadiant = IHGNumbers(4);
     515        4114 :                     thisPeople.FractionConvected = 1.0 - thisPeople.FractionRadiant;
     516        4114 :                     if (Item1 == 1) {
     517        3990 :                         if (thisPeople.FractionConvected < 0.0) {
     518           0 :                             ShowSevereError(state,
     519           0 :                                             format("{}{}=\"{}\", {} < 0.0, value ={:.2R}",
     520             :                                                    RoutineName,
     521             :                                                    peopleModuleObject,
     522             :                                                    IHGAlphas(1),
     523             :                                                    IHGNumericFieldNames(4),
     524             :                                                    IHGNumbers(4)));
     525           0 :                             ErrorsFound = true;
     526             :                         }
     527             :                     }
     528             : 
     529        4114 :                     if (IHGNumNumbers >= 5 && !IHGNumericFieldBlanks(5)) {
     530        2135 :                         thisPeople.UserSpecSensFrac = IHGNumbers(5);
     531             :                     } else {
     532        1979 :                         thisPeople.UserSpecSensFrac = Constant::AutoCalculate;
     533             :                     }
     534             : 
     535        4114 :                     if (IHGNumNumbers >= 6 && !IHGNumericFieldBlanks(6)) {
     536        1153 :                         thisPeople.CO2RateFactor = IHGNumbers(6);
     537             :                     } else {
     538        2961 :                         thisPeople.CO2RateFactor = 3.82e-8; // m3/s-W
     539             :                     }
     540             : 
     541        4114 :                     if (IHGNumNumbers >= 7 && !IHGNumericFieldBlanks(7)) {
     542           6 :                         thisPeople.ColdStressTempThresh = IHGNumbers(7);
     543             :                     } else {
     544        4108 :                         thisPeople.ColdStressTempThresh = 15.56; // degree C
     545             :                     }
     546             : 
     547        4114 :                     if (IHGNumNumbers == 8 && !IHGNumericFieldBlanks(8)) {
     548           6 :                         thisPeople.HeatStressTempThresh = IHGNumbers(8);
     549             :                     } else {
     550        4108 :                         thisPeople.HeatStressTempThresh = 30.0; // degree C
     551             :                     }
     552             : 
     553        4114 :                     if (thisPeople.CO2RateFactor < 0.0) {
     554           0 :                         ShowSevereError(state,
     555           0 :                                         format("{}{}=\"{}\", {} < 0.0, value ={:.2R}",
     556             :                                                RoutineName,
     557             :                                                peopleModuleObject,
     558             :                                                IHGAlphas(1),
     559             :                                                IHGNumericFieldNames(6),
     560             :                                                IHGNumbers(6)));
     561           0 :                         ErrorsFound = true;
     562             :                     }
     563             : 
     564        4114 :                     thisPeople.ActivityLevelPtr = GetScheduleIndex(state, IHGAlphas(5));
     565        4114 :                     if (thisPeople.ActivityLevelPtr == 0) {
     566           0 :                         if (Item1 == 1) {
     567           0 :                             if (IHGAlphaFieldBlanks(5)) {
     568           0 :                                 ShowSevereError(
     569             :                                     state,
     570           0 :                                     format("{}{}=\"{}\", {} is required.", RoutineName, peopleModuleObject, IHGAlphas(1), IHGAlphaFieldNames(5)));
     571             :                             } else {
     572           0 :                                 ShowSevereError(state,
     573           0 :                                                 format("{}{}=\"{}\", invalid {} entered={}",
     574             :                                                        RoutineName,
     575             :                                                        peopleModuleObject,
     576             :                                                        IHGAlphas(1),
     577             :                                                        IHGAlphaFieldNames(5),
     578             :                                                        IHGAlphas(5)));
     579             :                             }
     580           0 :                             ErrorsFound = true;
     581             :                         }
     582             :                     } else { // Check values in Schedule
     583        4114 :                         SchMin = GetScheduleMinValue(state, thisPeople.ActivityLevelPtr);
     584        4114 :                         SchMax = GetScheduleMaxValue(state, thisPeople.ActivityLevelPtr);
     585        4114 :                         if (SchMin < 0.0 || SchMax < 0.0) {
     586           0 :                             if (Item1 == 1) {
     587           0 :                                 if (SchMin < 0.0) {
     588           0 :                                     ShowSevereError(state,
     589           0 :                                                     format("{}{}=\"{}\", {} minimum is < 0.0",
     590             :                                                            RoutineName,
     591             :                                                            peopleModuleObject,
     592             :                                                            IHGAlphas(1),
     593             :                                                            IHGAlphaFieldNames(5)));
     594           0 :                                     ShowContinueError(state,
     595           0 :                                                       format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(5), SchMin));
     596           0 :                                     ErrorsFound = true;
     597             :                                 }
     598             :                             }
     599           0 :                             if (Item1 == 1) {
     600           0 :                                 if (SchMax < 0.0) {
     601           0 :                                     ShowSevereError(state,
     602           0 :                                                     format("{}{}=\"{}\", {} maximum is < 0.0",
     603             :                                                            RoutineName,
     604             :                                                            peopleModuleObject,
     605             :                                                            IHGAlphas(1),
     606             :                                                            IHGAlphaFieldNames(5)));
     607           0 :                                     ShowContinueError(state,
     608           0 :                                                       format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(5), SchMax));
     609           0 :                                     ErrorsFound = true;
     610             :                                 }
     611             :                             }
     612        4114 :                         } else if (SchMin < 70.0 || SchMax > 1000.0) {
     613           0 :                             if (Item1 == 1) {
     614           0 :                                 ShowWarningError(
     615           0 :                                     state, format("{}{}=\"{}\", {} values", RoutineName, peopleModuleObject, IHGAlphas(1), IHGAlphaFieldNames(5)));
     616           0 :                                 ShowContinueError(state, "fall outside typical range [70,1000] W/person for Thermal Comfort Reporting.");
     617           0 :                                 ShowContinueError(state, format("Odd comfort values may result; Schedule=\"{}\".", IHGAlphas(5)));
     618           0 :                                 ShowContinueError(state, format("Entered min/max range=[{:.1R},] W/person.{:.1R}", SchMin, SchMax));
     619             :                             }
     620             :                         }
     621             :                     }
     622             : 
     623             :                     // Following is an optional parameter (ASHRAE 55 warnings
     624        4114 :                     if (IHGNumAlphas >= 6) {
     625        2704 :                         if (Util::SameString(IHGAlphas(6), "Yes")) {
     626           0 :                             thisPeople.Show55Warning = true;
     627        2704 :                         } else if (!Util::SameString(IHGAlphas(6), "No") && !IHGAlphaFieldBlanks(6)) {
     628           0 :                             if (Item1 == 1) {
     629           0 :                                 ShowSevereError(state,
     630           0 :                                                 format("{}{}=\"{}\", {} field should be Yes or No",
     631             :                                                        RoutineName,
     632             :                                                        peopleModuleObject,
     633             :                                                        IHGAlphas(1),
     634             :                                                        IHGAlphaFieldNames(6)));
     635           0 :                                 ShowContinueError(state, format("...Field value=\"{}\" is invalid.", IHGAlphas(6)));
     636           0 :                                 ErrorsFound = true;
     637             :                             }
     638             :                         }
     639             :                     }
     640             : 
     641        4114 :                     if (IHGNumAlphas > 6) { // Optional parameters present--thermal comfort data follows...
     642        2704 :                         int lastOption = 0;
     643        2704 :                         state.dataInternalHeatGains->UsingThermalComfort = false;
     644        2704 :                         if (IHGNumAlphas > 20) {
     645           7 :                             lastOption = 20;
     646             :                         } else {
     647        2697 :                             lastOption = IHGNumAlphas;
     648             :                         }
     649             : 
     650             :                         // check to see if the user has specified schedules for air velocity, clothing insulation, and/or work efficiency
     651             :                         // but have NOT made a selection for a thermal comfort model.  If so, then the schedules are reported as unused
     652             :                         // which could cause confusion.  The solution is for the user to either remove those schedules or pick a thermal
     653             :                         // comfort model.
     654        2704 :                         int constexpr NumFirstTCModel = 14;
     655        2704 :                         if (IHGNumAlphas < NumFirstTCModel) {
     656         146 :                             bool NoTCModelSelectedWithSchedules = false;
     657             :                             NoTCModelSelectedWithSchedules =
     658         146 :                                 CheckThermalComfortSchedules(IHGAlphaFieldBlanks(9), IHGAlphaFieldBlanks(12), IHGAlphaFieldBlanks(13));
     659         146 :                             if (NoTCModelSelectedWithSchedules) {
     660          68 :                                 ShowWarningError(state,
     661          68 :                                                  format("{}{}=\"{}\" has comfort related schedules but no thermal comfort model selected.",
     662             :                                                         RoutineName,
     663             :                                                         peopleModuleObject,
     664             :                                                         IHGAlphas(1)));
     665          34 :                                 ShowContinueError(state,
     666             :                                                   "If schedules are specified for air velocity, clothing insulation, and/or work efficiency but no "
     667             :                                                   "thermal comfort");
     668          34 :                                 ShowContinueError(
     669             :                                     state, "thermal comfort model is selected, the schedules will be listed as unused schedules in the .err file.");
     670          34 :                                 ShowContinueError(
     671             :                                     state,
     672             :                                     "To avoid these errors, select a valid thermal comfort model or eliminate these schedules in the PEOPLE input.");
     673             :                             }
     674             :                         }
     675             : 
     676        5316 :                         for (int OptionNum = NumFirstTCModel; OptionNum <= lastOption; ++OptionNum) {
     677             : 
     678             :                             {
     679        2612 :                                 std::string const &thermalComfortType = IHGAlphas(OptionNum);
     680             : 
     681        2612 :                                 if (thermalComfortType == "FANGER") {
     682        2547 :                                     thisPeople.Fanger = true;
     683        2547 :                                     state.dataInternalHeatGains->UsingThermalComfort = true;
     684             : 
     685          65 :                                 } else if (thermalComfortType == "PIERCE") {
     686          11 :                                     thisPeople.Pierce = true;
     687          11 :                                     state.dataHeatBal->AnyThermalComfortPierceModel = true;
     688          11 :                                     state.dataInternalHeatGains->UsingThermalComfort = true;
     689             : 
     690          54 :                                 } else if (thermalComfortType == "KSU") {
     691           6 :                                     thisPeople.KSU = true;
     692           6 :                                     state.dataHeatBal->AnyThermalComfortKSUModel = true;
     693           6 :                                     state.dataInternalHeatGains->UsingThermalComfort = true;
     694             : 
     695          48 :                                 } else if (thermalComfortType == "ADAPTIVEASH55") {
     696           6 :                                     thisPeople.AdaptiveASH55 = true;
     697           6 :                                     state.dataHeatBal->AdaptiveComfortRequested_ASH55 = true;
     698           6 :                                     state.dataInternalHeatGains->UsingThermalComfort = true;
     699             : 
     700          42 :                                 } else if (thermalComfortType == "ADAPTIVECEN15251") {
     701           1 :                                     thisPeople.AdaptiveCEN15251 = true;
     702           1 :                                     state.dataHeatBal->AdaptiveComfortRequested_CEN15251 = true;
     703           1 :                                     state.dataInternalHeatGains->UsingThermalComfort = true;
     704             : 
     705          41 :                                 } else if (thermalComfortType == "COOLINGEFFECTASH55") {
     706           1 :                                     thisPeople.CoolingEffectASH55 = true;
     707           1 :                                     state.dataHeatBal->AnyThermalComfortCoolingEffectModel = true;
     708           1 :                                     state.dataInternalHeatGains->UsingThermalComfort = true;
     709             : 
     710          40 :                                 } else if (thermalComfortType == "ANKLEDRAFTASH55") {
     711           1 :                                     thisPeople.AnkleDraftASH55 = true;
     712           1 :                                     state.dataHeatBal->AnyThermalComfortAnkleDraftModel = true;
     713           1 :                                     state.dataInternalHeatGains->UsingThermalComfort = true;
     714             : 
     715          39 :                                 } else if (thermalComfortType == "") { // Blank input field--just ignore this
     716             : 
     717             :                                 } else { // An invalid keyword was entered--warn but ignore
     718           0 :                                     if (Item1 == 1) {
     719           0 :                                         ShowWarningError(state,
     720           0 :                                                          format("{}{}=\"{}\", invalid {} Option={}",
     721             :                                                                 RoutineName,
     722             :                                                                 peopleModuleObject,
     723             :                                                                 IHGAlphas(1),
     724             :                                                                 IHGAlphaFieldNames(OptionNum),
     725             :                                                                 IHGAlphas(OptionNum)));
     726           0 :                                         ShowContinueError(state,
     727             :                                                           "Valid Values are \"Fanger\", \"Pierce\", \"KSU\", \"AdaptiveASH55\", "
     728             :                                                           "\"AdaptiveCEN15251\", \"CoolingEffectASH55\", \"AnkleDraftASH55\"");
     729             :                                     }
     730             :                                 }
     731             :                             }
     732             :                         }
     733             : 
     734        2704 :                         if (state.dataInternalHeatGains->UsingThermalComfort) {
     735             : 
     736             :                             // Set the default value of MRTCalcType as 'EnclosureAveraged'
     737        2558 :                             thisPeople.MRTCalcType = DataHeatBalance::CalcMRT::EnclosureAveraged;
     738             : 
     739          11 :                             bool ModelWithAdditionalInputs = thisPeople.Fanger || thisPeople.Pierce || thisPeople.KSU ||
     740        2569 :                                                              thisPeople.CoolingEffectASH55 || thisPeople.AnkleDraftASH55;
     741             : 
     742             :                             // MRT Calculation Type and Surface Name
     743        2558 :                             thisPeople.MRTCalcType = static_cast<CalcMRT>(getEnumValue(CalcMRTTypeNamesUC, IHGAlphas(7)));
     744             : 
     745        2558 :                             switch (thisPeople.MRTCalcType) {
     746        2549 :                             case DataHeatBalance::CalcMRT::EnclosureAveraged: {
     747             :                                 // nothing to do here
     748        2549 :                             } break;
     749           6 :                             case DataHeatBalance::CalcMRT::SurfaceWeighted: {
     750           6 :                                 thisPeople.SurfacePtr = Util::FindItemInList(IHGAlphas(8), state.dataSurface->Surface);
     751           6 :                                 if (thisPeople.SurfacePtr == 0 && ModelWithAdditionalInputs) {
     752           0 :                                     if (Item1 == 1) {
     753           0 :                                         ShowSevereError(state,
     754           0 :                                                         format("{}{}=\"{}\", {}={} invalid Surface Name={}",
     755             :                                                                RoutineName,
     756             :                                                                peopleModuleObject,
     757             :                                                                IHGAlphas(1),
     758             :                                                                IHGAlphaFieldNames(7),
     759             :                                                                IHGAlphas(7),
     760             :                                                                IHGAlphas(8)));
     761           0 :                                         ErrorsFound = true;
     762             :                                     }
     763             :                                 } else {
     764           6 :                                     int const surfRadEnclNum = state.dataSurface->Surface(thisPeople.SurfacePtr).RadEnclIndex;
     765           6 :                                     int const thisPeopleRadEnclNum = state.dataHeatBal->space(thisPeople.spaceIndex).radiantEnclosureNum;
     766           6 :                                     if (surfRadEnclNum != thisPeopleRadEnclNum && ModelWithAdditionalInputs) {
     767           0 :                                         ShowSevereError(state,
     768           0 :                                                         format("{}{}=\"{}\", Surface referenced in {}={} in different enclosure.",
     769             :                                                                RoutineName,
     770             :                                                                peopleModuleObject,
     771             :                                                                IHGAlphas(1),
     772             :                                                                IHGAlphaFieldNames(7),
     773             :                                                                IHGAlphas(7)));
     774           0 :                                         ShowContinueError(state,
     775           0 :                                                           format("Surface is in Enclosure={} and {} is in Enclosure={}",
     776           0 :                                                                  state.dataViewFactor->EnclRadInfo(surfRadEnclNum).Name,
     777             :                                                                  peopleModuleObject,
     778           0 :                                                                  state.dataViewFactor->EnclRadInfo(thisPeopleRadEnclNum).Name));
     779           0 :                                         ErrorsFound = true;
     780             :                                     }
     781             :                                 }
     782             : 
     783           6 :                             } break;
     784           3 :                             case DataHeatBalance::CalcMRT::AngleFactor: {
     785           3 :                                 thisPeople.AngleFactorListName = IHGAlphas(8);
     786             : 
     787           3 :                             } break;
     788           0 :                             default: { // An invalid keyword was entered--warn but ignore
     789           0 :                                 if (Item1 == 1 && ModelWithAdditionalInputs) {
     790           0 :                                     ShowWarningError(state,
     791           0 :                                                      format("{}{}=\"{}\", invalid {}={}",
     792             :                                                             RoutineName,
     793             :                                                             peopleModuleObject,
     794             :                                                             IHGAlphas(1),
     795             :                                                             IHGAlphaFieldNames(7),
     796             :                                                             IHGAlphas(7)));
     797           0 :                                     ShowContinueError(state, "...Valid values are \"EnclosureAveraged\", \"SurfaceWeighted\", \"AngleFactor\".");
     798             :                                 }
     799           0 :                             } break;
     800             :                             }
     801             : 
     802        2558 :                             if (!IHGAlphaFieldBlanks(9)) {
     803        2558 :                                 thisPeople.WorkEffPtr = GetScheduleIndex(state, IHGAlphas(9));
     804        2558 :                                 if (thisPeople.WorkEffPtr == 0) {
     805           0 :                                     if (Item1 == 1) {
     806           0 :                                         ShowSevereError(state,
     807           0 :                                                         format("{}{}=\"{}\", invalid {} entered={}",
     808             :                                                                RoutineName,
     809             :                                                                peopleModuleObject,
     810             :                                                                IHGAlphas(1),
     811             :                                                                IHGAlphaFieldNames(9),
     812             :                                                                IHGAlphas(9)));
     813           0 :                                         ErrorsFound = true;
     814             :                                     }
     815             :                                 } else { // check min/max on schedule
     816        2558 :                                     SchMin = GetScheduleMinValue(state, thisPeople.WorkEffPtr);
     817        2558 :                                     SchMax = GetScheduleMaxValue(state, thisPeople.WorkEffPtr);
     818        2558 :                                     if (SchMin < 0.0 || SchMax < 0.0) {
     819           0 :                                         if (SchMin < 0.0) {
     820           0 :                                             if (Item1 == 1) {
     821           0 :                                                 ShowSevereError(state,
     822           0 :                                                                 format("{}{}=\"{}\", {}, minimum is < 0.0",
     823             :                                                                        RoutineName,
     824             :                                                                        peopleModuleObject,
     825             :                                                                        IHGAlphas(1),
     826             :                                                                        IHGAlphaFieldNames(9)));
     827           0 :                                                 ShowContinueError(
     828             :                                                     state,
     829           0 :                                                     format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(9), SchMin));
     830           0 :                                                 ErrorsFound = true;
     831             :                                             }
     832             :                                         }
     833           0 :                                         if (SchMax < 0.0) {
     834           0 :                                             if (Item1 == 1) {
     835           0 :                                                 ShowSevereError(state,
     836           0 :                                                                 format("{}{}=\"{}\", {}, maximum is < 0.0",
     837             :                                                                        RoutineName,
     838             :                                                                        peopleModuleObject,
     839             :                                                                        IHGAlphas(1),
     840             :                                                                        IHGAlphaFieldNames(9)));
     841           0 :                                                 ShowContinueError(
     842             :                                                     state,
     843           0 :                                                     format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(9), SchMax));
     844           0 :                                                 ErrorsFound = true;
     845             :                                             }
     846             :                                         }
     847             :                                     }
     848        2558 :                                     if (SchMax > 1.0) {
     849           0 :                                         if (Item1 == 1) {
     850           0 :                                             ShowWarningError(state,
     851           0 :                                                              format("{}{}=\"{}\", {}, maximum is > 1.0",
     852             :                                                                     RoutineName,
     853             :                                                                     peopleModuleObject,
     854             :                                                                     IHGAlphas(1),
     855             :                                                                     IHGAlphaFieldNames(9)));
     856           0 :                                             ShowContinueError(state,
     857           0 :                                                               format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Work Efficiency.",
     858             :                                                                      IHGAlphas(9),
     859             :                                                                      SchMin,
     860             :                                                                      SchMax));
     861             :                                         }
     862             :                                     }
     863             :                                 }
     864           0 :                             } else if (ModelWithAdditionalInputs) {
     865           0 :                                 if (Item1 == 1) {
     866           0 :                                     ShowSevereError(state,
     867           0 :                                                     format("{}{}=\"{}\", blank {}. {} is required when Thermal Comfort Model Type is one of "
     868             :                                                            "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\"",
     869             :                                                            RoutineName,
     870             :                                                            peopleModuleObject,
     871             :                                                            IHGAlphas(1),
     872             :                                                            IHGAlphaFieldNames(9),
     873             :                                                            IHGAlphaFieldNames(9)));
     874           0 :                                     ErrorsFound = true;
     875             :                                 }
     876             :                             }
     877             : 
     878        2558 :                             if (!IHGAlphaFieldBlanks(10) || !IHGAlphas(10).empty()) {
     879        2558 :                                 thisPeople.clothingType = static_cast<ClothingType>(getEnumValue(clothingTypeNamesUC, IHGAlphas(10)));
     880        2558 :                                 if (thisPeople.clothingType == ClothingType::Invalid) {
     881           0 :                                     ShowSevereError(state,
     882           0 :                                                     format("{}{}=\"{}\", invalid {}, value  ={}",
     883             :                                                            RoutineName,
     884             :                                                            peopleModuleObject,
     885           0 :                                                            thisPeople.Name,
     886             :                                                            IHGAlphaFieldNames(10),
     887             :                                                            IHGAlphas(10)));
     888           0 :                                     ShowContinueError(state,
     889           0 :                                                       format(R"(...Valid values are "{}", "{}", "{}")",
     890           0 :                                                              clothingTypeNamesUC[0],
     891           0 :                                                              clothingTypeNamesUC[1],
     892           0 :                                                              clothingTypeNamesUC[2]));
     893           0 :                                     ErrorsFound = true;
     894             :                                 }
     895        2558 :                                 switch (thisPeople.clothingType) {
     896        2555 :                                 case ClothingType::InsulationSchedule:
     897        2555 :                                     thisPeople.clothingType = ClothingType::InsulationSchedule;
     898        2555 :                                     thisPeople.ClothingPtr = GetScheduleIndex(state, IHGAlphas(12));
     899        2555 :                                     if (thisPeople.ClothingPtr == 0 && ModelWithAdditionalInputs) {
     900           0 :                                         if (Item1 == 1) {
     901           0 :                                             ShowSevereError(state,
     902           0 :                                                             format("{}{}=\"{}\", invalid {} entered=\"{}\".",
     903             :                                                                    RoutineName,
     904             :                                                                    peopleModuleObject,
     905             :                                                                    IHGAlphas(1),
     906             :                                                                    IHGAlphaFieldNames(12),
     907             :                                                                    IHGAlphas(12)));
     908           0 :                                             ErrorsFound = true;
     909             :                                         }
     910             :                                     } else { // check min/max on schedule
     911        2555 :                                         SchMin = GetScheduleMinValue(state, thisPeople.ClothingPtr);
     912        2555 :                                         SchMax = GetScheduleMaxValue(state, thisPeople.ClothingPtr);
     913        2555 :                                         if (SchMin < 0.0 || SchMax < 0.0) {
     914           0 :                                             if (SchMin < 0.0) {
     915           0 :                                                 if (Item1 == 1) {
     916           0 :                                                     ShowSevereError(state,
     917           0 :                                                                     format("{}{}=\"{}\", {}, minimum is < 0.0",
     918             :                                                                            RoutineName,
     919             :                                                                            peopleModuleObject,
     920             :                                                                            IHGAlphas(1),
     921             :                                                                            IHGAlphaFieldNames(12)));
     922           0 :                                                     ShowContinueError(state,
     923           0 :                                                                       format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.",
     924             :                                                                              IHGAlphas(12),
     925             :                                                                              SchMin));
     926           0 :                                                     ErrorsFound = true;
     927             :                                                 }
     928             :                                             }
     929           0 :                                             if (SchMax < 0.0) {
     930           0 :                                                 if (Item1 == 1) {
     931           0 :                                                     ShowSevereError(state,
     932           0 :                                                                     format("{}{}=\"{}\", {}, maximum is < 0.0",
     933             :                                                                            RoutineName,
     934             :                                                                            peopleModuleObject,
     935             :                                                                            IHGAlphas(1),
     936             :                                                                            IHGAlphaFieldNames(12)));
     937           0 :                                                     ShowContinueError(state,
     938           0 :                                                                       format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.",
     939             :                                                                              IHGAlphas(12),
     940             :                                                                              SchMax));
     941           0 :                                                     ErrorsFound = true;
     942             :                                                 }
     943             :                                             }
     944             :                                         }
     945        2555 :                                         if (SchMax > 2.0) {
     946           0 :                                             if (Item1 == 1) {
     947           0 :                                                 ShowWarningError(state,
     948           0 :                                                                  format("{}{}=\"{}\", {}, maximum is > 2.0",
     949             :                                                                         RoutineName,
     950             :                                                                         peopleModuleObject,
     951             :                                                                         IHGAlphas(1),
     952             :                                                                         IHGAlphaFieldNames(12)));
     953           0 :                                                 ShowContinueError(state,
     954           0 :                                                                   format("Schedule=\"{}\"; Entered min/max range=[{:.1R},{:.1R}] Clothing.",
     955             :                                                                          IHGAlphas(12),
     956             :                                                                          SchMin,
     957             :                                                                          SchMax));
     958             :                                             }
     959             :                                         }
     960             :                                     }
     961        2555 :                                     break;
     962             : 
     963           2 :                                 case ClothingType::DynamicAshrae55:
     964           2 :                                     break; // nothing extra to do, at least for now
     965             : 
     966           1 :                                 case ClothingType::CalculationSchedule:
     967           1 :                                     thisPeople.ClothingMethodPtr = GetScheduleIndex(state, IHGAlphas(11));
     968           1 :                                     if (thisPeople.ClothingMethodPtr == 0) {
     969           0 :                                         if (Item1 == 1) {
     970           0 :                                             ShowSevereError(state,
     971           0 :                                                             format("{}{}=\"{}\", invalid {} entered=\"{}\".",
     972             :                                                                    RoutineName,
     973             :                                                                    peopleModuleObject,
     974             :                                                                    IHGAlphas(1),
     975             :                                                                    IHGAlphaFieldNames(11),
     976             :                                                                    IHGAlphas(11)));
     977           0 :                                             ErrorsFound = true;
     978             :                                         }
     979             :                                     }
     980           1 :                                     if (CheckScheduleValue(state, thisPeople.ClothingMethodPtr, 1)) {
     981           1 :                                         thisPeople.ClothingPtr = GetScheduleIndex(state, IHGAlphas(12));
     982           1 :                                         if (thisPeople.ClothingPtr == 0) {
     983           0 :                                             if (Item1 == 1) {
     984           0 :                                                 ShowSevereError(state,
     985           0 :                                                                 format("{}{}=\"{}\", invalid {} entered=\"{}\".",
     986             :                                                                        RoutineName,
     987             :                                                                        peopleModuleObject,
     988             :                                                                        IHGAlphas(1),
     989             :                                                                        IHGAlphaFieldNames(12),
     990             :                                                                        IHGAlphas(12)));
     991           0 :                                                 ErrorsFound = true;
     992             :                                             }
     993             :                                         }
     994             :                                     }
     995           1 :                                     break;
     996           0 :                                 default:
     997           0 :                                     break; // nothing to do for the other cases
     998             :                                 }
     999             :                             }
    1000             : 
    1001        2558 :                             if (!IHGAlphaFieldBlanks(13)) {
    1002        2558 :                                 thisPeople.AirVelocityPtr = GetScheduleIndex(state, IHGAlphas(13));
    1003        2558 :                                 if (thisPeople.AirVelocityPtr == 0) {
    1004           0 :                                     if (Item1 == 1) {
    1005           0 :                                         ShowSevereError(state,
    1006           0 :                                                         format("{}{}=\"{}\", invalid {} entered=\"{}\".",
    1007             :                                                                RoutineName,
    1008             :                                                                peopleModuleObject,
    1009             :                                                                IHGAlphas(1),
    1010             :                                                                IHGAlphaFieldNames(13),
    1011             :                                                                IHGAlphas(13)));
    1012           0 :                                         ErrorsFound = true;
    1013             :                                     }
    1014             :                                 } else { // check min/max on schedule
    1015        2558 :                                     SchMin = GetScheduleMinValue(state, thisPeople.AirVelocityPtr);
    1016        2558 :                                     SchMax = GetScheduleMaxValue(state, thisPeople.AirVelocityPtr);
    1017        2558 :                                     if (SchMin < 0.0 || SchMax < 0.0) {
    1018           0 :                                         if (SchMin < 0.0) {
    1019           0 :                                             if (Item1 == 1) {
    1020           0 :                                                 ShowSevereError(state,
    1021           0 :                                                                 format("{}{}=\"{}\", {}, minimum is < 0.0",
    1022             :                                                                        RoutineName,
    1023             :                                                                        peopleModuleObject,
    1024             :                                                                        IHGAlphas(1),
    1025             :                                                                        IHGAlphaFieldNames(13)));
    1026           0 :                                                 ShowContinueError(
    1027             :                                                     state,
    1028           0 :                                                     format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(13), SchMin));
    1029           0 :                                                 ErrorsFound = true;
    1030             :                                             }
    1031             :                                         }
    1032           0 :                                         if (SchMax < 0.0) {
    1033           0 :                                             if (Item1 == 1) {
    1034           0 :                                                 ShowSevereError(state,
    1035           0 :                                                                 format("{}{}=\"{}\", {}, maximum is < 0.0",
    1036             :                                                                        RoutineName,
    1037             :                                                                        peopleModuleObject,
    1038             :                                                                        IHGAlphas(1),
    1039             :                                                                        IHGAlphaFieldNames(13)));
    1040           0 :                                                 ShowContinueError(
    1041             :                                                     state,
    1042           0 :                                                     format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(13), SchMax));
    1043           0 :                                                 ErrorsFound = true;
    1044             :                                             }
    1045             :                                         }
    1046             :                                     }
    1047             :                                 }
    1048           0 :                             } else if (ModelWithAdditionalInputs) {
    1049           0 :                                 if (Item1 == 1) {
    1050           0 :                                     ShowSevereError(state,
    1051           0 :                                                     format("{}{}=\"{}\", blank {}. {} is required when Thermal Comfort Model Type is one of "
    1052             :                                                            "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\"",
    1053             :                                                            RoutineName,
    1054             :                                                            peopleModuleObject,
    1055             :                                                            IHGAlphas(1),
    1056             :                                                            IHGAlphaFieldNames(13),
    1057             :                                                            IHGAlphaFieldNames(13)));
    1058           0 :                                     ErrorsFound = true;
    1059             :                                 }
    1060             :                             }
    1061             : 
    1062        2558 :                             int indexAnkleAirVelPtr = 21;
    1063        2558 :                             if (!IHGAlphaFieldBlanks(indexAnkleAirVelPtr) || !IHGAlphas(indexAnkleAirVelPtr).empty()) {
    1064           1 :                                 thisPeople.AnkleAirVelocityPtr = GetScheduleIndex(state, IHGAlphas(indexAnkleAirVelPtr));
    1065           1 :                                 if (thisPeople.AnkleAirVelocityPtr == 0) {
    1066           0 :                                     if (Item1 == 1) {
    1067           0 :                                         ShowSevereError(state,
    1068           0 :                                                         format("{}{}=\"{}\", invalid {} entered=\"{}\".",
    1069             :                                                                RoutineName,
    1070             :                                                                peopleModuleObject,
    1071             :                                                                IHGAlphas(1),
    1072             :                                                                IHGAlphaFieldNames(indexAnkleAirVelPtr),
    1073             :                                                                IHGAlphas(indexAnkleAirVelPtr)));
    1074           0 :                                         ErrorsFound = true;
    1075             :                                     }
    1076             :                                 }
    1077        2557 :                             } else if (thisPeople.AnkleDraftASH55) {
    1078           0 :                                 if (Item1 == 1) {
    1079           0 :                                     ShowSevereError(state,
    1080           0 :                                                     format("{}{}=\"{}\", blank {}. {} is required when Thermal Comfort Model Type is one of "
    1081             :                                                            "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\"",
    1082             :                                                            RoutineName,
    1083             :                                                            peopleModuleObject,
    1084             :                                                            IHGAlphas(1),
    1085             :                                                            IHGAlphaFieldNames(indexAnkleAirVelPtr),
    1086             :                                                            IHGAlphaFieldNames(indexAnkleAirVelPtr)));
    1087           0 :                                     ErrorsFound = true;
    1088             :                                 }
    1089             :                             }
    1090             : 
    1091             :                         } // usingthermalcomfort block
    1092             : 
    1093             :                     } // ...end of thermal comfort data IF-THEN block  (IHGNumAlphass > 6)
    1094             : 
    1095        4114 :                     if (thisPeople.ZonePtr <= 0) continue; // Error, will be caught and terminated later
    1096             :                 }
    1097             :             }
    1098             : 
    1099        4777 :             for (int peopleNum = 1; peopleNum <= state.dataHeatBal->TotPeople; ++peopleNum) {
    1100        4114 :                 if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
    1101        1864 :                     SetupEMSActuator(state,
    1102             :                                      "People",
    1103         932 :                                      state.dataHeatBal->People(peopleNum).Name,
    1104             :                                      "Number of People",
    1105             :                                      "[each]",
    1106         932 :                                      state.dataHeatBal->People(peopleNum).EMSPeopleOn,
    1107         932 :                                      state.dataHeatBal->People(peopleNum).EMSNumberOfPeople);
    1108         932 :                     SetupEMSInternalVariable(state,
    1109             :                                              "People Count Design Level",
    1110         932 :                                              state.dataHeatBal->People(peopleNum).Name,
    1111             :                                              "[each]",
    1112         932 :                                              state.dataHeatBal->People(peopleNum).NumberOfPeople);
    1113             :                 }
    1114             : 
    1115             :                 // setup internal gains
    1116        4114 :                 if (!ErrorsFound) {
    1117       24684 :                     SetupSpaceInternalGain(state,
    1118        4114 :                                            state.dataHeatBal->People(peopleNum).spaceIndex,
    1119             :                                            1.0,
    1120        4114 :                                            state.dataHeatBal->People(peopleNum).Name,
    1121             :                                            DataHeatBalance::IntGainType::People,
    1122        4114 :                                            &state.dataHeatBal->People(peopleNum).ConGainRate,
    1123             :                                            nullptr,
    1124        4114 :                                            &state.dataHeatBal->People(peopleNum).RadGainRate,
    1125        4114 :                                            &state.dataHeatBal->People(peopleNum).LatGainRate,
    1126             :                                            nullptr,
    1127        4114 :                                            &state.dataHeatBal->People(peopleNum).CO2GainRate);
    1128             :                 }
    1129             :             }
    1130             : 
    1131             :             // transfer the nominal number of people in a zone to the tabular reporting
    1132        5478 :             for (int Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) {
    1133        4815 :                 if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) {
    1134        8020 :                     if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 &&
    1135        4010 :                         state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants < 0.1) {
    1136           0 :                         ShowWarningError(
    1137           0 :                             state, format("{}Zone=\"{}\" occupant density is extremely high.", RoutineName, state.dataHeatBal->Zone(Loop).Name));
    1138           0 :                         if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) {
    1139           0 :                             ShowContinueError(state,
    1140           0 :                                               format("Occupant Density=[{:.0R}] person/m2.",
    1141           0 :                                                      state.dataHeatBal->Zone(Loop).TotOccupants / state.dataHeatBal->Zone(Loop).FloorArea));
    1142             :                         }
    1143           0 :                         ShowContinueError(state,
    1144           0 :                                           format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.",
    1145           0 :                                                  state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants));
    1146             :                     }
    1147        4010 :                     Real64 maxOccupLoad = 0.0;
    1148        4010 :                     int OptionNum = 0;
    1149       89867 :                     for (int Loop1 = 1; Loop1 <= state.dataHeatBal->TotPeople; ++Loop1) {
    1150       85857 :                         if (state.dataHeatBal->People(Loop1).ZonePtr != Loop) continue;
    1151        4055 :                         if (maxOccupLoad < GetScheduleMaxValue(state, state.dataHeatBal->People(Loop1).NumberOfPeoplePtr) *
    1152        4055 :                                                state.dataHeatBal->People(Loop1).NumberOfPeople) {
    1153        4018 :                             maxOccupLoad = GetScheduleMaxValue(state, state.dataHeatBal->People(Loop1).NumberOfPeoplePtr) *
    1154        4018 :                                            state.dataHeatBal->People(Loop1).NumberOfPeople;
    1155        4018 :                             OptionNum = Loop1;
    1156             :                         }
    1157             :                     }
    1158        4010 :                     if (maxOccupLoad > state.dataHeatBal->Zone(Loop).TotOccupants) {
    1159           0 :                         if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 && state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad < 0.1) {
    1160           0 :                             ShowWarningError(state,
    1161           0 :                                              format("{}Zone=\"{}\" occupant density at a maximum schedule value is extremely high.",
    1162             :                                                     RoutineName,
    1163           0 :                                                     state.dataHeatBal->Zone(Loop).Name));
    1164           0 :                             if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) {
    1165           0 :                                 ShowContinueError(
    1166           0 :                                     state, format("Occupant Density=[{:.0R}] person/m2.", maxOccupLoad / state.dataHeatBal->Zone(Loop).FloorArea));
    1167             :                             }
    1168           0 :                             ShowContinueError(state,
    1169           0 :                                               format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.",
    1170           0 :                                                      state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad));
    1171           0 :                             ShowContinueError(state,
    1172           0 :                                               format("Check values in People={}, Number of People Schedule={}",
    1173           0 :                                                      state.dataHeatBal->People(OptionNum).Name,
    1174           0 :                                                      GetScheduleName(state, state.dataHeatBal->People(OptionNum).NumberOfPeoplePtr)));
    1175             :                         }
    1176             :                     }
    1177             :                 }
    1178             : 
    1179        4815 :                 if (state.dataHeatBal->Zone(Loop).isNominalControlled) { // conditioned zones only
    1180        4190 :                     if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) {
    1181        3928 :                         state.dataHeatBal->Zone(Loop).isNominalOccupied = true;
    1182        7856 :                         PreDefTableEntry(state,
    1183        3928 :                                          state.dataOutRptPredefined->pdchOaoNomNumOcc1,
    1184        3928 :                                          state.dataHeatBal->Zone(Loop).Name,
    1185        3928 :                                          state.dataHeatBal->Zone(Loop).TotOccupants);
    1186        7856 :                         PreDefTableEntry(state,
    1187        3928 :                                          state.dataOutRptPredefined->pdchOaoNomNumOcc2,
    1188        3928 :                                          state.dataHeatBal->Zone(Loop).Name,
    1189        3928 :                                          state.dataHeatBal->Zone(Loop).TotOccupants);
    1190             :                     }
    1191             :                 }
    1192             :             }
    1193             :         } // TotPeople > 0
    1194             : 
    1195             :         // Lights
    1196             :         // Declared in state because the lights inputs are needed for demand manager
    1197         796 :         int numLightsStatements = 0;
    1198         796 :         setupIHGZonesAndSpaces(
    1199         796 :             state, lightsModuleObject, state.dataInternalHeatGains->lightsObjects, numLightsStatements, state.dataHeatBal->TotLights, ErrorsFound);
    1200             : 
    1201         796 :         if (state.dataHeatBal->TotLights > 0) {
    1202         662 :             state.dataHeatBal->Lights.allocate(state.dataHeatBal->TotLights);
    1203         662 :             bool CheckSharedExhaustFlag = false;
    1204         662 :             int lightsNum = 0;
    1205        4897 :             for (int lightsInputNum = 1; lightsInputNum <= numLightsStatements; ++lightsInputNum) {
    1206             : 
    1207        4235 :                 state.dataInputProcessing->inputProcessor->getObjectItem(state,
    1208             :                                                                          lightsModuleObject,
    1209             :                                                                          lightsInputNum,
    1210             :                                                                          IHGAlphas,
    1211             :                                                                          IHGNumAlphas,
    1212             :                                                                          IHGNumbers,
    1213             :                                                                          IHGNumNumbers,
    1214             :                                                                          IOStat,
    1215             :                                                                          IHGNumericFieldBlanks,
    1216             :                                                                          IHGAlphaFieldBlanks,
    1217             :                                                                          IHGAlphaFieldNames,
    1218             :                                                                          IHGNumericFieldNames);
    1219             : 
    1220        4235 :                 auto &thisLightsInput = state.dataInternalHeatGains->lightsObjects(lightsInputNum);
    1221             :                 // Create one Lights instance for every space associated with this Lights input object
    1222        8564 :                 for (int Item1 = 1; Item1 <= thisLightsInput.numOfSpaces; ++Item1) {
    1223        4329 :                     ++lightsNum;
    1224        4329 :                     auto &thisLights = state.dataHeatBal->Lights(lightsNum);
    1225        4329 :                     int const spaceNum = thisLightsInput.spaceNums(Item1);
    1226        4329 :                     int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
    1227        4329 :                     thisLights.Name = thisLightsInput.names(Item1);
    1228        4329 :                     thisLights.spaceIndex = spaceNum;
    1229        4329 :                     thisLights.ZonePtr = zoneNum;
    1230             : 
    1231        4329 :                     thisLights.SchedPtr = GetScheduleIndex(state, IHGAlphas(3));
    1232        4329 :                     SchMin = 0.0;
    1233        4329 :                     SchMax = 0.0;
    1234        4329 :                     if (thisLights.SchedPtr == 0) {
    1235           0 :                         if (Item1 == 1) {
    1236           0 :                             if (IHGAlphaFieldBlanks(3)) {
    1237           0 :                                 ShowSevereError(
    1238             :                                     state,
    1239           0 :                                     format("{}{}=\"{}\", {} is required.", RoutineName, lightsModuleObject, IHGAlphas(1), IHGAlphaFieldNames(3)));
    1240             :                             } else {
    1241           0 :                                 ShowSevereError(state,
    1242           0 :                                                 format("{}{}=\"{}\", invalid {} entered={}",
    1243             :                                                        RoutineName,
    1244             :                                                        lightsModuleObject,
    1245             :                                                        IHGAlphas(1),
    1246             :                                                        IHGAlphaFieldNames(3),
    1247             :                                                        IHGAlphas(3)));
    1248             :                             }
    1249           0 :                             ErrorsFound = true;
    1250             :                         }
    1251             :                     } else { // check min/max on schedule
    1252        4329 :                         SchMin = GetScheduleMinValue(state, thisLights.SchedPtr);
    1253        4329 :                         SchMax = GetScheduleMaxValue(state, thisLights.SchedPtr);
    1254        4329 :                         if (SchMin < 0.0 || SchMax < 0.0) {
    1255           0 :                             if (Item1 == 1) {
    1256           0 :                                 if (SchMin < 0.0) {
    1257           0 :                                     ShowSevereError(state,
    1258           0 :                                                     format("{}{}=\"{}\", {}, minimum is < 0.0",
    1259             :                                                            RoutineName,
    1260             :                                                            lightsModuleObject,
    1261             :                                                            IHGAlphas(1),
    1262             :                                                            IHGAlphaFieldNames(3)));
    1263           0 :                                     ShowContinueError(state,
    1264           0 :                                                       format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMin));
    1265           0 :                                     ErrorsFound = true;
    1266             :                                 }
    1267             :                             }
    1268           0 :                             if (Item1 == 1) {
    1269           0 :                                 if (SchMax < 0.0) {
    1270           0 :                                     ShowSevereError(state,
    1271           0 :                                                     format("{}{}=\"{}\", {}, maximum is < 0.0",
    1272             :                                                            RoutineName,
    1273             :                                                            lightsModuleObject,
    1274             :                                                            IHGAlphas(1),
    1275             :                                                            IHGAlphaFieldNames(3)));
    1276           0 :                                     ShowContinueError(state,
    1277           0 :                                                       format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMax));
    1278           0 :                                     ErrorsFound = true;
    1279             :                                 }
    1280             :                             }
    1281             :                         }
    1282             :                     }
    1283             : 
    1284             :                     // Lights Design Level calculation method.
    1285             :                     {
    1286             :                         // Set space load fraction
    1287        4329 :                         std::string const &lightingLevel = IHGAlphas(4);
    1288        4329 :                         if (lightingLevel == "LIGHTINGLEVEL") {
    1289        2313 :                             Real64 spaceFrac = 1.0;
    1290        2313 :                             if (thisLightsInput.numOfSpaces > 1) {
    1291           9 :                                 Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
    1292           9 :                                 if (zoneArea > 0.0) {
    1293           9 :                                     spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
    1294             :                                 } else {
    1295           0 :                                     ShowSevereError(state, format("{}Zone floor area is zero when allocating Lights loads to Spaces.", RoutineName));
    1296           0 :                                     ShowContinueError(
    1297             :                                         state,
    1298           0 :                                         format("Occurs for Lights object ={} in Zone={}", IHGAlphas(1), state.dataHeatBal->Zone(zoneNum).Name));
    1299           0 :                                     ErrorsFound = true;
    1300             :                                 }
    1301             :                             }
    1302             : 
    1303        2313 :                             thisLights.DesignLevel = IHGNumbers(1) * spaceFrac;
    1304        2313 :                             if (IHGNumericFieldBlanks(1)) {
    1305           0 :                                 ShowWarningError(state,
    1306           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Lights will result.",
    1307             :                                                         RoutineName,
    1308             :                                                         lightsModuleObject,
    1309             :                                                         IHGAlphas(1),
    1310             :                                                         IHGNumericFieldNames(1)));
    1311             :                             }
    1312        2016 :                         } else if (lightingLevel == "WATTS/AREA") {
    1313        2014 :                             if (spaceNum != 0) {
    1314        2014 :                                 if (IHGNumbers(2) >= 0.0) {
    1315        2014 :                                     thisLights.DesignLevel = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
    1316        2014 :                                     if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
    1317           0 :                                         !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
    1318           0 :                                         ShowWarningError(state,
    1319           0 :                                                          format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0.  0 Lights will result.",
    1320             :                                                                 RoutineName,
    1321             :                                                                 lightsModuleObject,
    1322           0 :                                                                 thisLights.Name,
    1323             :                                                                 IHGNumericFieldNames(2)));
    1324             :                                     }
    1325             :                                 } else {
    1326           0 :                                     ShowSevereError(state,
    1327           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
    1328             :                                                            RoutineName,
    1329             :                                                            lightsModuleObject,
    1330           0 :                                                            thisLights.Name,
    1331             :                                                            IHGNumericFieldNames(2),
    1332             :                                                            IHGNumbers(2)));
    1333           0 :                                     ErrorsFound = true;
    1334             :                                 }
    1335             :                             }
    1336        2014 :                             if (IHGNumericFieldBlanks(2)) {
    1337           2 :                                 ShowWarningError(state,
    1338           2 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Lights will result.",
    1339             :                                                         RoutineName,
    1340             :                                                         lightsModuleObject,
    1341             :                                                         IHGAlphas(1),
    1342             :                                                         IHGNumericFieldNames(2)));
    1343             :                             }
    1344           2 :                         } else if (lightingLevel == "WATTS/PERSON") {
    1345           2 :                             if (spaceNum != 0) {
    1346           2 :                                 if (IHGNumbers(3) >= 0.0) {
    1347           2 :                                     thisLights.DesignLevel = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).TotOccupants;
    1348           2 :                                     if (state.dataHeatBal->space(spaceNum).TotOccupants <= 0.0) {
    1349           0 :                                         ShowWarningError(state,
    1350           0 :                                                          format("{}{}=\"{}\", specifies {}, but Total Occupants = 0.  0 Lights will result.",
    1351             :                                                                 RoutineName,
    1352             :                                                                 lightsModuleObject,
    1353           0 :                                                                 thisLights.Name,
    1354             :                                                                 IHGNumericFieldNames(2)));
    1355             :                                     }
    1356             :                                 } else {
    1357           0 :                                     ShowSevereError(state,
    1358           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
    1359             :                                                            RoutineName,
    1360             :                                                            lightsModuleObject,
    1361           0 :                                                            thisLights.Name,
    1362             :                                                            IHGNumericFieldNames(3),
    1363             :                                                            IHGNumbers(3)));
    1364           0 :                                     ErrorsFound = true;
    1365             :                                 }
    1366             :                             }
    1367           2 :                             if (IHGNumericFieldBlanks(3)) {
    1368           0 :                                 ShowWarningError(state,
    1369           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Lights will result.",
    1370             :                                                         RoutineName,
    1371             :                                                         lightsModuleObject,
    1372             :                                                         IHGAlphas(1),
    1373             :                                                         IHGNumericFieldNames(3)));
    1374             :                             }
    1375             :                         } else {
    1376           0 :                             if (Item1 == 1) {
    1377           0 :                                 ShowSevereError(state,
    1378           0 :                                                 format("{}{}=\"{}\", invalid {}, value  ={}",
    1379             :                                                        RoutineName,
    1380             :                                                        lightsModuleObject,
    1381             :                                                        IHGAlphas(1),
    1382             :                                                        IHGAlphaFieldNames(4),
    1383             :                                                        IHGAlphas(4)));
    1384           0 :                                 ShowContinueError(state, R"(...Valid values are "LightingLevel", "Watts/Area", "Watts/Person".)");
    1385           0 :                                 ErrorsFound = true;
    1386             :                             }
    1387             :                         }
    1388             :                     }
    1389             : 
    1390             :                     // Calculate nominal min/max lighting level
    1391        4329 :                     thisLights.NomMinDesignLevel = thisLights.DesignLevel * SchMin;
    1392        4329 :                     thisLights.NomMaxDesignLevel = thisLights.DesignLevel * SchMax;
    1393             : 
    1394        4329 :                     thisLights.FractionReturnAir = IHGNumbers(4);
    1395        4329 :                     thisLights.FractionRadiant = IHGNumbers(5);
    1396        4329 :                     thisLights.FractionShortWave = IHGNumbers(6);
    1397        4329 :                     thisLights.FractionReplaceable = IHGNumbers(7);
    1398        4329 :                     thisLights.FractionReturnAirPlenTempCoeff1 = IHGNumbers(8);
    1399        4329 :                     thisLights.FractionReturnAirPlenTempCoeff2 = IHGNumbers(9);
    1400             : 
    1401        4329 :                     thisLights.FractionConvected = 1.0 - (thisLights.FractionReturnAir + thisLights.FractionRadiant + thisLights.FractionShortWave);
    1402        4329 :                     if (std::abs(thisLights.FractionConvected) <= 0.001) thisLights.FractionConvected = 0.0;
    1403        4329 :                     if (thisLights.FractionConvected < 0.0) {
    1404           0 :                         if (Item1 == 1) {
    1405           0 :                             ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, lightsModuleObject, thisLights.Name));
    1406           0 :                             ErrorsFound = true;
    1407             :                         }
    1408             :                     }
    1409             : 
    1410             :                     // Note: if FractionReturnAirIsCalculated = Yes and there is a return-air plenum:
    1411             :                     // (1) The input values of FractionReturnAir, FractionRadiant and FractionShortWave, and the
    1412             :                     // value of FractionConvected calculated from these are used in the zone sizing calculations;
    1413             :                     // (2) in the regular calculation, FractionReturnAir is calculated each time step in
    1414             :                     // Subr. InitInternalHeatGains as a function of the zone's return plenum air temperature
    1415             :                     // using FractionReturnAirPlenTempCoeff1 and FractionReturnAirPlenTempCoeff2; then
    1416             :                     // FractionRadiant and FractionConvected are adjusted from their input values such that
    1417             :                     // FractionReturnAir + FractionRadiant + FractionShortWave + FractionConvected = 1.0, assuming
    1418             :                     // FractionShortWave is constant and equal to its input value.
    1419             : 
    1420        4329 :                     if (IHGNumAlphas > 4) {
    1421        4307 :                         thisLights.EndUseSubcategory = IHGAlphas(5);
    1422             :                     } else {
    1423          22 :                         thisLights.EndUseSubcategory = "General";
    1424             :                     }
    1425             : 
    1426        4329 :                     if (IHGAlphaFieldBlanks(6)) {
    1427        2144 :                         thisLights.FractionReturnAirIsCalculated = false;
    1428        2185 :                     } else if (IHGAlphas(6) != "YES" && IHGAlphas(6) != "NO") {
    1429           0 :                         if (Item1 == 1) {
    1430           0 :                             ShowWarningError(state,
    1431           0 :                                              format("{}{}=\"{}\", invalid {}, value  ={}",
    1432             :                                                     RoutineName,
    1433             :                                                     lightsModuleObject,
    1434           0 :                                                     thisLightsInput.Name,
    1435             :                                                     IHGAlphaFieldNames(6),
    1436             :                                                     IHGAlphas(6)));
    1437           0 :                             ShowContinueError(state, ".. Return Air Fraction from Plenum will NOT be calculated.");
    1438             :                         }
    1439           0 :                         thisLights.FractionReturnAirIsCalculated = false;
    1440             :                     } else {
    1441        2185 :                         thisLights.FractionReturnAirIsCalculated = (IHGAlphas(6) == "YES");
    1442             :                     }
    1443             : 
    1444             :                     // Set return air node number
    1445        4329 :                     thisLights.ZoneReturnNum = 0;
    1446        4329 :                     thisLights.RetNodeName = "";
    1447        4329 :                     if (!IHGAlphaFieldBlanks(7)) {
    1448           1 :                         if (thisLightsInput.ZoneListActive) {
    1449           0 :                             ShowSevereError(state,
    1450           0 :                                             format("{}{}=\"{}\": {} must be blank when using a ZoneList.",
    1451             :                                                    RoutineName,
    1452             :                                                    lightsModuleObject,
    1453           0 :                                                    thisLightsInput.Name,
    1454             :                                                    IHGAlphaFieldNames(7)));
    1455           0 :                             ErrorsFound = true;
    1456             :                         } else {
    1457           1 :                             thisLights.RetNodeName = IHGAlphas(7);
    1458             :                         }
    1459             :                     }
    1460        4329 :                     if (thisLights.ZonePtr > 0) {
    1461        4329 :                         thisLights.ZoneReturnNum = DataZoneEquipment::GetReturnNumForZone(state, thisLights.ZonePtr, thisLights.RetNodeName);
    1462             :                     }
    1463             : 
    1464        4329 :                     if ((thisLights.ZoneReturnNum == 0) && (thisLights.FractionReturnAir > 0.0) && (!IHGAlphaFieldBlanks(7))) {
    1465           0 :                         ShowSevereError(
    1466             :                             state,
    1467           0 :                             format(
    1468             :                                 "{}{}=\"{}\", invalid {} ={}", RoutineName, lightsModuleObject, IHGAlphas(1), IHGAlphaFieldNames(7), IHGAlphas(7)));
    1469           0 :                         ShowContinueError(state, "No matching Zone Return Air Node found.");
    1470           0 :                         ErrorsFound = true;
    1471             :                     }
    1472             :                     // Set exhaust air node number
    1473        4329 :                     thisLights.ZoneExhaustNodeNum = 0;
    1474        4329 :                     if (!IHGAlphaFieldBlanks(8)) {
    1475           1 :                         if (thisLightsInput.ZoneListActive) {
    1476           0 :                             ShowSevereError(state,
    1477           0 :                                             format("{}{}=\"{}\": {} must be blank when using a ZoneList.",
    1478             :                                                    RoutineName,
    1479             :                                                    lightsModuleObject,
    1480           0 :                                                    thisLightsInput.Name,
    1481             :                                                    IHGAlphaFieldNames(8)));
    1482           0 :                             ErrorsFound = true;
    1483             :                         } else {
    1484           1 :                             bool exhaustNodeError = false;
    1485           1 :                             thisLights.ZoneExhaustNodeNum = GetOnlySingleNode(state,
    1486           1 :                                                                               IHGAlphas(8),
    1487             :                                                                               exhaustNodeError,
    1488             :                                                                               DataLoopNode::ConnectionObjectType::Lights,
    1489           1 :                                                                               thisLights.Name,
    1490             :                                                                               DataLoopNode::NodeFluidType::Air,
    1491             :                                                                               DataLoopNode::ConnectionType::ZoneExhaust,
    1492             :                                                                               NodeInputManager::CompFluidStream::Primary,
    1493             :                                                                               ObjectIsNotParent);
    1494           1 :                             if (!exhaustNodeError) { // GetOnlySingleNode will throw error messages if this is a NodeList Name and for other issues
    1495           1 :                                 exhaustNodeError =
    1496           1 :                                     DataZoneEquipment::VerifyLightsExhaustNodeForZone(state, thisLights.ZonePtr, thisLights.ZoneExhaustNodeNum);
    1497             :                             }
    1498           1 :                             if (exhaustNodeError) {
    1499           0 :                                 ShowSevereError(state,
    1500           0 :                                                 format("{}{}=\"{}\", invalid {} = {}",
    1501             :                                                        RoutineName,
    1502             :                                                        lightsModuleObject,
    1503             :                                                        IHGAlphas(1),
    1504             :                                                        IHGAlphaFieldNames(8),
    1505             :                                                        IHGAlphas(8)));
    1506           0 :                                 ShowContinueError(state, "No matching Zone Exhaust Air Node found.");
    1507           0 :                                 ErrorsFound = true;
    1508             :                             } else {
    1509           1 :                                 if (thisLights.ZoneReturnNum > 0) {
    1510           1 :                                     state.dataZoneEquip->ZoneEquipConfig(thisLights.ZonePtr).ReturnNodeExhaustNodeNum(thisLights.ZoneReturnNum) =
    1511           1 :                                         thisLights.ZoneExhaustNodeNum;
    1512           1 :                                     CheckSharedExhaustFlag = true;
    1513             :                                 } else {
    1514           0 :                                     ShowSevereError(state,
    1515           0 :                                                     format("{}{}=\"{}\", {} ={} is not used",
    1516             :                                                            RoutineName,
    1517             :                                                            lightsModuleObject,
    1518             :                                                            IHGAlphas(1),
    1519             :                                                            IHGAlphaFieldNames(8),
    1520             :                                                            IHGAlphas(8)));
    1521           0 :                                     ShowContinueError(
    1522             :                                         state, "No matching Zone Return Air Node found. The Exhaust Node requires Return Node to work together");
    1523           0 :                                     ErrorsFound = true;
    1524             :                                 }
    1525             :                             }
    1526             :                         }
    1527             : 
    1528           1 :                         if (thisLights.ZonePtr <= 0) continue; // Error, will be caught and terminated later
    1529             :                     }
    1530             :                 }
    1531             :             }
    1532         662 :             if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
    1533        1217 :                 for (int lightsNum = 1; lightsNum <= state.dataHeatBal->TotLights; ++lightsNum) {
    1534        2298 :                     SetupEMSActuator(state,
    1535             :                                      "Lights",
    1536        1149 :                                      state.dataHeatBal->Lights(lightsNum).Name,
    1537             :                                      "Electricity Rate",
    1538             :                                      "[W]",
    1539        1149 :                                      state.dataHeatBal->Lights(lightsNum).EMSLightsOn,
    1540        1149 :                                      state.dataHeatBal->Lights(lightsNum).EMSLightingPower);
    1541        1149 :                     SetupEMSInternalVariable(state,
    1542             :                                              "Lighting Power Design Level",
    1543        1149 :                                              state.dataHeatBal->Lights(lightsNum).Name,
    1544             :                                              "[W]",
    1545        1149 :                                              state.dataHeatBal->Lights(lightsNum).DesignLevel);
    1546             :                 } // EMS
    1547             :             }
    1548        4991 :             for (int lightsNum = 1; lightsNum <= state.dataHeatBal->TotLights; ++lightsNum) {
    1549        4329 :                 int spaceNum = state.dataHeatBal->Lights(lightsNum).spaceIndex;
    1550        4329 :                 int zoneNum = state.dataHeatBal->Lights(lightsNum).ZonePtr;
    1551             :                 // setup internal gains
    1552        4329 :                 int returnNodeNum = 0;
    1553        8524 :                 if ((state.dataHeatBal->Lights(lightsNum).ZoneReturnNum > 0) &&
    1554        4195 :                     (state.dataHeatBal->Lights(lightsNum).ZoneReturnNum <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumReturnNodes)) {
    1555        4194 :                     returnNodeNum = state.dataZoneEquip->ZoneEquipConfig(zoneNum).ReturnNode(state.dataHeatBal->Lights(lightsNum).ZoneReturnNum);
    1556             :                 }
    1557        4329 :                 if (!ErrorsFound) {
    1558       21645 :                     SetupSpaceInternalGain(state,
    1559        4329 :                                            state.dataHeatBal->Lights(lightsNum).spaceIndex,
    1560             :                                            1.0,
    1561        4329 :                                            state.dataHeatBal->Lights(lightsNum).Name,
    1562             :                                            DataHeatBalance::IntGainType::Lights,
    1563        4329 :                                            &state.dataHeatBal->Lights(lightsNum).ConGainRate,
    1564        4329 :                                            &state.dataHeatBal->Lights(lightsNum).RetAirGainRate,
    1565        4329 :                                            &state.dataHeatBal->Lights(lightsNum).RadGainRate,
    1566             :                                            nullptr,
    1567             :                                            nullptr,
    1568             :                                            nullptr,
    1569             :                                            nullptr,
    1570             :                                            returnNodeNum);
    1571             :                 }
    1572             : 
    1573        4329 :                 if (state.dataHeatBal->Lights(lightsNum).FractionReturnAir > 0)
    1574        1052 :                     state.dataHeatBal->Zone(state.dataHeatBal->Lights(lightsNum).ZonePtr).HasLtsRetAirGain = true;
    1575             :                 // send values to predefined lighting summary report
    1576        4329 :                 liteName = state.dataHeatBal->Lights(lightsNum).Name;
    1577        4329 :                 Real64 mult = state.dataHeatBal->Zone(zoneNum).Multiplier * state.dataHeatBal->Zone(zoneNum).ListMultiplier;
    1578        4329 :                 Real64 spaceArea = state.dataHeatBal->space(spaceNum).FloorArea;
    1579        4329 :                 state.dataInternalHeatGains->sumArea += spaceArea * mult;
    1580        4329 :                 state.dataInternalHeatGains->sumPower += state.dataHeatBal->Lights(lightsNum).DesignLevel * mult;
    1581        4329 :                 PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtZone, liteName, state.dataHeatBal->Zone(zoneNum).Name);
    1582        4329 :                 PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtSpace, liteName, state.dataHeatBal->space(spaceNum).Name);
    1583        4329 :                 PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtSpaceType, liteName, state.dataHeatBal->space(spaceNum).spaceType);
    1584        4329 :                 if (spaceArea > 0.0) {
    1585        4326 :                     PreDefTableEntry(
    1586        8652 :                         state, state.dataOutRptPredefined->pdchInLtDens, liteName, state.dataHeatBal->Lights(lightsNum).DesignLevel / spaceArea, 4);
    1587             :                 } else {
    1588           3 :                     PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, liteName, DataPrecisionGlobals::constant_zero, 4);
    1589             :                 }
    1590        4329 :                 PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, liteName, spaceArea * mult);
    1591        4329 :                 PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtPower, liteName, state.dataHeatBal->Lights(lightsNum).DesignLevel * mult);
    1592        4329 :                 PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtEndUse, liteName, state.dataHeatBal->Lights(lightsNum).EndUseSubcategory);
    1593        8658 :                 PreDefTableEntry(
    1594       12987 :                     state, state.dataOutRptPredefined->pdchInLtSchd, liteName, GetScheduleName(state, state.dataHeatBal->Lights(lightsNum).SchedPtr));
    1595        4329 :                 PreDefTableEntry(
    1596        8658 :                     state, state.dataOutRptPredefined->pdchInLtRetAir, liteName, state.dataHeatBal->Lights(lightsNum).FractionReturnAir, 4);
    1597             :             } // Item1 - Number of Lights instances
    1598         662 :             if (CheckSharedExhaustFlag) {
    1599           1 :                 DataZoneEquipment::CheckSharedExhaust(state);
    1600           1 :                 Array1D_bool ReturnNodeShared; // zone supply air inlet nodes
    1601           1 :                 ReturnNodeShared.allocate(state.dataHeatBal->TotLights);
    1602           1 :                 ReturnNodeShared = false;
    1603           6 :                 for (int Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
    1604           5 :                     int ZoneNum = state.dataHeatBal->Lights(Loop).ZonePtr;
    1605           5 :                     int ReturnNum = state.dataHeatBal->Lights(Loop).ZoneReturnNum;
    1606           5 :                     int ExhaustNodeNum = state.dataHeatBal->Lights(Loop).ZoneExhaustNodeNum;
    1607           5 :                     if (ReturnNum == 0 || ExhaustNodeNum == 0) continue;
    1608           5 :                     for (int Loop1 = Loop + 1; Loop1 <= state.dataHeatBal->TotLights; ++Loop1) {
    1609           4 :                         if (ZoneNum != state.dataHeatBal->Lights(Loop1).ZonePtr) continue;
    1610           0 :                         if (ReturnNodeShared(Loop1)) continue;
    1611           0 :                         if (ReturnNum == state.dataHeatBal->Lights(Loop1).ZoneReturnNum &&
    1612           0 :                             ExhaustNodeNum != state.dataHeatBal->Lights(Loop1).ZoneExhaustNodeNum) {
    1613           0 :                             ShowSevereError(state,
    1614           0 :                                             format("{}{}: Duplicated Return Air Node = {} is found, ",
    1615             :                                                    RoutineName,
    1616             :                                                    lightsModuleObject,
    1617           0 :                                                    state.dataHeatBal->Lights(Loop1).RetNodeName));
    1618           0 :                             ShowContinueError(state,
    1619           0 :                                               format(" in both Lights objects = {} and {}.",
    1620           0 :                                                      state.dataHeatBal->Lights(Loop).Name,
    1621           0 :                                                      state.dataHeatBal->Lights(Loop1).Name));
    1622           0 :                             ErrorsFound = true;
    1623           0 :                             ReturnNodeShared(Loop1) = true;
    1624             :                         }
    1625             :                     }
    1626             :                 }
    1627           1 :                 ReturnNodeShared.deallocate();
    1628           1 :             }
    1629             :         } // TotLights > 0 check
    1630             :         // add total line to lighting summary table
    1631         796 :         if (state.dataInternalHeatGains->sumArea > 0.0) {
    1632         662 :             PreDefTableEntry(state,
    1633         662 :                              state.dataOutRptPredefined->pdchInLtDens,
    1634             :                              "Interior Lighting Total",
    1635         662 :                              state.dataInternalHeatGains->sumPower / state.dataInternalHeatGains->sumArea,
    1636        1324 :                              4); // line 792
    1637             :         } else {
    1638         134 :             PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, "Interior Lighting Total", DataPrecisionGlobals::constant_zero, 4);
    1639             :         }
    1640         796 :         PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, "Interior Lighting Total", state.dataInternalHeatGains->sumArea);
    1641         796 :         PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtPower, "Interior Lighting Total", state.dataInternalHeatGains->sumPower);
    1642             : 
    1643             :         // ElectricEquipment
    1644             :         // Declared in state because the lights inputs are needed for demand manager
    1645         796 :         int numZoneElectricStatements = 0;
    1646         796 :         setupIHGZonesAndSpaces(state,
    1647             :                                elecEqModuleObject,
    1648         796 :                                state.dataInternalHeatGains->zoneElectricObjects,
    1649             :                                numZoneElectricStatements,
    1650         796 :                                state.dataHeatBal->TotElecEquip,
    1651             :                                ErrorsFound);
    1652             : 
    1653         796 :         if (state.dataHeatBal->TotElecEquip > 0) {
    1654         650 :             state.dataHeatBal->ZoneElectric.allocate(state.dataHeatBal->TotElecEquip);
    1655         650 :             int elecEqNum = 0;
    1656        4940 :             for (int elecEqInputNum = 1; elecEqInputNum <= numZoneElectricStatements; ++elecEqInputNum) {
    1657             : 
    1658        4290 :                 state.dataInputProcessing->inputProcessor->getObjectItem(state,
    1659             :                                                                          elecEqModuleObject,
    1660             :                                                                          elecEqInputNum,
    1661             :                                                                          IHGAlphas,
    1662             :                                                                          IHGNumAlphas,
    1663             :                                                                          IHGNumbers,
    1664             :                                                                          IHGNumNumbers,
    1665             :                                                                          IOStat,
    1666             :                                                                          IHGNumericFieldBlanks,
    1667             :                                                                          IHGAlphaFieldBlanks,
    1668             :                                                                          IHGAlphaFieldNames,
    1669             :                                                                          IHGNumericFieldNames);
    1670             : 
    1671        4290 :                 auto &thisElecEqInput = state.dataInternalHeatGains->zoneElectricObjects(elecEqInputNum);
    1672        8689 :                 for (int Item1 = 1; Item1 <= thisElecEqInput.numOfSpaces; ++Item1) {
    1673        4399 :                     ++elecEqNum;
    1674        4399 :                     auto &thisZoneElectric = state.dataHeatBal->ZoneElectric(elecEqNum);
    1675        4399 :                     int const spaceNum = thisElecEqInput.spaceNums(Item1);
    1676        4399 :                     int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
    1677        4399 :                     thisZoneElectric.Name = thisElecEqInput.names(Item1);
    1678        4399 :                     thisZoneElectric.spaceIndex = spaceNum;
    1679        4399 :                     thisZoneElectric.ZonePtr = zoneNum;
    1680             : 
    1681        4399 :                     thisZoneElectric.SchedPtr = GetScheduleIndex(state, IHGAlphas(3));
    1682        4399 :                     SchMin = 0.0;
    1683        4399 :                     SchMax = 0.0;
    1684        4399 :                     if (thisZoneElectric.SchedPtr == 0) {
    1685           0 :                         if (IHGAlphaFieldBlanks(3)) {
    1686           0 :                             ShowSevereError(
    1687           0 :                                 state, format("{}{}=\"{}\", {} is required.", RoutineName, elecEqModuleObject, IHGAlphas(1), IHGAlphaFieldNames(3)));
    1688             :                         } else {
    1689           0 :                             ShowSevereError(state,
    1690           0 :                                             format("{}{}=\"{}\", invalid {} entered={}",
    1691             :                                                    RoutineName,
    1692             :                                                    elecEqModuleObject,
    1693             :                                                    IHGAlphas(1),
    1694             :                                                    IHGAlphaFieldNames(3),
    1695             :                                                    IHGAlphas(3)));
    1696             :                         }
    1697           0 :                         ErrorsFound = true;
    1698             :                     } else { // check min/max on schedule
    1699        4399 :                         SchMin = GetScheduleMinValue(state, thisZoneElectric.SchedPtr);
    1700        4399 :                         SchMax = GetScheduleMaxValue(state, thisZoneElectric.SchedPtr);
    1701        4399 :                         if (SchMin < 0.0 || SchMax < 0.0) {
    1702           0 :                             if (SchMin < 0.0) {
    1703           0 :                                 ShowSevereError(
    1704             :                                     state,
    1705           0 :                                     format(
    1706             :                                         "{}{}=\"{}\", {}, minimum is < 0.0", RoutineName, elecEqModuleObject, IHGAlphas(1), IHGAlphaFieldNames(3)));
    1707           0 :                                 ShowContinueError(state,
    1708           0 :                                                   format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMin));
    1709           0 :                                 ErrorsFound = true;
    1710             :                             }
    1711           0 :                             if (SchMax < 0.0) {
    1712           0 :                                 ShowSevereError(
    1713             :                                     state,
    1714           0 :                                     format(
    1715             :                                         "{}{}=\"{}\", {}, maximum is < 0.0", RoutineName, elecEqModuleObject, IHGAlphas(1), IHGAlphaFieldNames(3)));
    1716           0 :                                 ShowContinueError(state,
    1717           0 :                                                   format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMax));
    1718           0 :                                 ErrorsFound = true;
    1719             :                             }
    1720             :                         }
    1721             :                     }
    1722             : 
    1723             :                     // Electric equipment design level calculation method.
    1724             :                     {
    1725        4399 :                         std::string const &equipmentLevel = IHGAlphas(4);
    1726        4399 :                         if (equipmentLevel == "EQUIPMENTLEVEL") {
    1727        3089 :                             Real64 spaceFrac = 1.0;
    1728        3089 :                             if (thisElecEqInput.numOfSpaces > 1) {
    1729           0 :                                 Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
    1730           0 :                                 if (zoneArea > 0.0) {
    1731           0 :                                     spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
    1732             :                                 } else {
    1733           0 :                                     ShowSevereError(
    1734           0 :                                         state, format("{}Zone floor area is zero when allocating ElectricEquipment loads to Spaces.", RoutineName));
    1735           0 :                                     ShowContinueError(state,
    1736           0 :                                                       format("Occurs for ElectricEquipment object ={} in Zone={}",
    1737           0 :                                                              thisElecEqInput.Name,
    1738           0 :                                                              state.dataHeatBal->Zone(thisZoneElectric.ZonePtr).Name));
    1739           0 :                                     ErrorsFound = true;
    1740             :                                 }
    1741             :                             }
    1742        3089 :                             thisZoneElectric.DesignLevel = IHGNumbers(1) * spaceFrac;
    1743        3089 :                             if (IHGNumericFieldBlanks(1)) {
    1744           0 :                                 ShowWarningError(state,
    1745           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Electric Equipment will result.",
    1746             :                                                         RoutineName,
    1747             :                                                         elecEqModuleObject,
    1748           0 :                                                         thisElecEqInput.Name,
    1749             :                                                         IHGNumericFieldNames(1)));
    1750             :                             }
    1751        1310 :                         } else if (equipmentLevel == "WATTS/AREA") {
    1752        1278 :                             if (spaceNum != 0) {
    1753        1278 :                                 if (IHGNumbers(2) >= 0.0) {
    1754        1278 :                                     thisZoneElectric.DesignLevel = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
    1755        1278 :                                     if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
    1756           0 :                                         !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
    1757           0 :                                         ShowWarningError(
    1758             :                                             state,
    1759           0 :                                             format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0.  0 Electric Equipment will result.",
    1760             :                                                    RoutineName,
    1761             :                                                    elecEqModuleObject,
    1762           0 :                                                    thisZoneElectric.Name,
    1763             :                                                    IHGNumericFieldNames(2)));
    1764             :                                     }
    1765             :                                 } else {
    1766           0 :                                     ShowSevereError(state,
    1767           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
    1768             :                                                            RoutineName,
    1769             :                                                            elecEqModuleObject,
    1770           0 :                                                            thisZoneElectric.Name,
    1771             :                                                            IHGNumericFieldNames(2),
    1772             :                                                            IHGNumbers(2)));
    1773           0 :                                     ErrorsFound = true;
    1774             :                                 }
    1775             :                             }
    1776        1278 :                             if (IHGNumericFieldBlanks(2)) {
    1777           0 :                                 ShowWarningError(state,
    1778           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Electric Equipment will result.",
    1779             :                                                         RoutineName,
    1780             :                                                         elecEqModuleObject,
    1781           0 :                                                         thisElecEqInput.Name,
    1782             :                                                         IHGNumericFieldNames(2)));
    1783             :                             }
    1784             : 
    1785          32 :                         } else if (equipmentLevel == "WATTS/PERSON") {
    1786          32 :                             if (spaceNum != 0) {
    1787          32 :                                 if (IHGNumbers(3) >= 0.0) {
    1788          32 :                                     thisZoneElectric.DesignLevel = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).TotOccupants;
    1789          32 :                                     if (state.dataHeatBal->space(spaceNum).TotOccupants <= 0.0) {
    1790           0 :                                         ShowWarningError(
    1791             :                                             state,
    1792           0 :                                             format("{}{}=\"{}\", specifies {}, but Total Occupants = 0.  0 Electric Equipment will result.",
    1793             :                                                    RoutineName,
    1794             :                                                    elecEqModuleObject,
    1795           0 :                                                    thisZoneElectric.Name,
    1796             :                                                    IHGNumericFieldNames(2)));
    1797             :                                     }
    1798             :                                 } else {
    1799           0 :                                     ShowSevereError(state,
    1800           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
    1801             :                                                            RoutineName,
    1802             :                                                            elecEqModuleObject,
    1803           0 :                                                            thisZoneElectric.Name,
    1804             :                                                            IHGNumericFieldNames(3),
    1805             :                                                            IHGNumbers(3)));
    1806           0 :                                     ErrorsFound = true;
    1807             :                                 }
    1808             :                             }
    1809          32 :                             if (IHGNumericFieldBlanks(3)) {
    1810           0 :                                 ShowWarningError(state,
    1811           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Electric Equipment will result.",
    1812             :                                                         RoutineName,
    1813             :                                                         elecEqModuleObject,
    1814           0 :                                                         thisElecEqInput.Name,
    1815             :                                                         IHGNumericFieldNames(3)));
    1816             :                             }
    1817             : 
    1818             :                         } else {
    1819           0 :                             if (Item1 == 1) {
    1820           0 :                                 ShowSevereError(state,
    1821           0 :                                                 format("{}{}=\"{}\", invalid {}, value  ={}",
    1822             :                                                        RoutineName,
    1823             :                                                        elecEqModuleObject,
    1824           0 :                                                        thisElecEqInput.Name,
    1825             :                                                        IHGAlphaFieldNames(4),
    1826             :                                                        IHGAlphas(4)));
    1827           0 :                                 ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\".");
    1828           0 :                                 ErrorsFound = true;
    1829             :                             }
    1830             :                         }
    1831             :                     }
    1832             : 
    1833             :                     // Calculate nominal min/max equipment level
    1834        4399 :                     thisZoneElectric.NomMinDesignLevel = thisZoneElectric.DesignLevel * SchMin;
    1835        4399 :                     thisZoneElectric.NomMaxDesignLevel = thisZoneElectric.DesignLevel * SchMax;
    1836             : 
    1837        4399 :                     thisZoneElectric.FractionLatent = IHGNumbers(4);
    1838        4399 :                     thisZoneElectric.FractionRadiant = IHGNumbers(5);
    1839        4399 :                     thisZoneElectric.FractionLost = IHGNumbers(6);
    1840             :                     // FractionConvected is a calculated field
    1841        4399 :                     thisZoneElectric.FractionConvected =
    1842        4399 :                         1.0 - (thisZoneElectric.FractionLatent + thisZoneElectric.FractionRadiant + thisZoneElectric.FractionLost);
    1843        4399 :                     if (std::abs(thisZoneElectric.FractionConvected) <= 0.001) thisZoneElectric.FractionConvected = 0.0;
    1844        4399 :                     if (thisZoneElectric.FractionConvected < 0.0) {
    1845           0 :                         ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, elecEqModuleObject, thisElecEqInput.Name));
    1846           0 :                         ErrorsFound = true;
    1847             :                     }
    1848             : 
    1849        4399 :                     if (IHGNumAlphas > 4) {
    1850        2386 :                         thisZoneElectric.EndUseSubcategory = IHGAlphas(5);
    1851             :                     } else {
    1852        2013 :                         thisZoneElectric.EndUseSubcategory = "General";
    1853             :                     }
    1854        4399 :                     if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
    1855        1073 :                         SetupEMSActuator(state,
    1856             :                                          "ElectricEquipment",
    1857             :                                          thisZoneElectric.Name,
    1858             :                                          "Electricity Rate",
    1859             :                                          "[W]",
    1860        1073 :                                          thisZoneElectric.EMSZoneEquipOverrideOn,
    1861        1073 :                                          thisZoneElectric.EMSEquipPower);
    1862        1073 :                         SetupEMSInternalVariable(
    1863        1073 :                             state, "Plug and Process Power Design Level", thisZoneElectric.Name, "[W]", thisZoneElectric.DesignLevel);
    1864             :                     } // EMS
    1865        4399 :                     if (!ErrorsFound) {
    1866        4399 :                         SetupSpaceInternalGain(state,
    1867             :                                                thisZoneElectric.spaceIndex,
    1868             :                                                1.0,
    1869             :                                                thisZoneElectric.Name,
    1870             :                                                DataHeatBalance::IntGainType::ElectricEquipment,
    1871             :                                                &thisZoneElectric.ConGainRate,
    1872             :                                                nullptr,
    1873             :                                                &thisZoneElectric.RadGainRate,
    1874             :                                                &thisZoneElectric.LatGainRate);
    1875             :                     }
    1876             :                 } // for elecEqInputNum.NumOfSpaces
    1877             :             }     // for elecEqInputNum
    1878             :         }         // TotElecEquip > 0
    1879             : 
    1880             :         // GasEquipment
    1881        1592 :         EPVector<InternalHeatGains::GlobalInternalGainMiscObject> zoneGasObjects;
    1882         796 :         int numZoneGasStatements = 0;
    1883         796 :         setupIHGZonesAndSpaces(state, gasEqModuleObject, zoneGasObjects, numZoneGasStatements, state.dataHeatBal->TotGasEquip, ErrorsFound);
    1884             : 
    1885         796 :         if (state.dataHeatBal->TotGasEquip > 0) {
    1886          37 :             state.dataHeatBal->ZoneGas.allocate(state.dataHeatBal->TotGasEquip);
    1887          37 :             int gasEqNum = 0;
    1888         114 :             for (int gasEqInputNum = 1; gasEqInputNum <= numZoneGasStatements; ++gasEqInputNum) {
    1889             : 
    1890          77 :                 state.dataInputProcessing->inputProcessor->getObjectItem(state,
    1891             :                                                                          gasEqModuleObject,
    1892             :                                                                          gasEqInputNum,
    1893             :                                                                          IHGAlphas,
    1894             :                                                                          IHGNumAlphas,
    1895             :                                                                          IHGNumbers,
    1896             :                                                                          IHGNumNumbers,
    1897             :                                                                          IOStat,
    1898             :                                                                          IHGNumericFieldBlanks,
    1899             :                                                                          IHGAlphaFieldBlanks,
    1900             :                                                                          IHGAlphaFieldNames,
    1901             :                                                                          IHGNumericFieldNames);
    1902             : 
    1903          77 :                 auto &thisGasEqInput = zoneGasObjects(gasEqInputNum);
    1904         156 :                 for (int Item1 = 1; Item1 <= thisGasEqInput.numOfSpaces; ++Item1) {
    1905          79 :                     ++gasEqNum;
    1906          79 :                     auto &thisZoneGas = state.dataHeatBal->ZoneGas(gasEqNum);
    1907          79 :                     int const spaceNum = thisGasEqInput.spaceNums(Item1);
    1908          79 :                     int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
    1909          79 :                     thisZoneGas.Name = thisGasEqInput.names(Item1);
    1910          79 :                     thisZoneGas.spaceIndex = spaceNum;
    1911          79 :                     thisZoneGas.ZonePtr = zoneNum;
    1912             : 
    1913          79 :                     thisZoneGas.SchedPtr = GetScheduleIndex(state, IHGAlphas(3));
    1914          79 :                     SchMin = 0.0;
    1915          79 :                     SchMax = 0.0;
    1916          79 :                     if (thisZoneGas.SchedPtr == 0) {
    1917           0 :                         if (Item1 == 1) {
    1918           0 :                             if (IHGAlphaFieldBlanks(3)) {
    1919           0 :                                 ShowSevereError(
    1920             :                                     state,
    1921           0 :                                     format(
    1922           0 :                                         "{}{}=\"{}\", {} is required.", RoutineName, gasEqModuleObject, thisGasEqInput.Name, IHGAlphaFieldNames(3)));
    1923             :                             } else {
    1924           0 :                                 ShowSevereError(state,
    1925           0 :                                                 format("{}{}=\"{}\", invalid {} entered={}",
    1926             :                                                        RoutineName,
    1927             :                                                        gasEqModuleObject,
    1928           0 :                                                        thisGasEqInput.Name,
    1929             :                                                        IHGAlphaFieldNames(3),
    1930             :                                                        IHGAlphas(3)));
    1931             :                             }
    1932           0 :                             ErrorsFound = true;
    1933             :                         }
    1934             :                     } else { // check min/max on schedule
    1935          79 :                         SchMin = GetScheduleMinValue(state, thisZoneGas.SchedPtr);
    1936          79 :                         SchMax = GetScheduleMaxValue(state, thisZoneGas.SchedPtr);
    1937          79 :                         if (SchMin < 0.0 || SchMax < 0.0) {
    1938           0 :                             if (Item1 == 1) {
    1939           0 :                                 if (SchMin < 0.0) {
    1940           0 :                                     ShowSevereError(state,
    1941           0 :                                                     format("{}{}=\"{}\", {}, minimum is < 0.0",
    1942             :                                                            RoutineName,
    1943             :                                                            gasEqModuleObject,
    1944           0 :                                                            thisGasEqInput.Name,
    1945             :                                                            IHGAlphaFieldNames(3)));
    1946           0 :                                     ShowContinueError(state,
    1947           0 :                                                       format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMin));
    1948           0 :                                     ErrorsFound = true;
    1949             :                                 }
    1950             :                             }
    1951           0 :                             if (Item1 == 1) {
    1952           0 :                                 if (SchMax < 0.0) {
    1953           0 :                                     ShowSevereError(state,
    1954           0 :                                                     format("{}{}=\"{}\", {}, maximum is < 0.0",
    1955             :                                                            RoutineName,
    1956             :                                                            gasEqModuleObject,
    1957           0 :                                                            thisGasEqInput.Name,
    1958             :                                                            IHGAlphaFieldNames(3)));
    1959           0 :                                     ShowContinueError(state,
    1960           0 :                                                       format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMax));
    1961           0 :                                     ErrorsFound = true;
    1962             :                                 }
    1963             :                             }
    1964             :                         }
    1965             :                     }
    1966             : 
    1967             :                     // Gas equipment design level calculation method.
    1968             :                     {
    1969          79 :                         std::string const &equipmentLevel = IHGAlphas(4);
    1970          79 :                         if (equipmentLevel == "EQUIPMENTLEVEL") {
    1971          71 :                             Real64 spaceFrac = 1.0;
    1972          71 :                             if (thisGasEqInput.numOfSpaces > 1) {
    1973           0 :                                 Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
    1974           0 :                                 if (zoneArea > 0.0) {
    1975           0 :                                     spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
    1976             :                                 } else {
    1977           0 :                                     ShowSevereError(state,
    1978           0 :                                                     format("{}Zone floor area is zero when allocating GasEquipment loads to Spaces.", RoutineName));
    1979           0 :                                     ShowContinueError(state,
    1980           0 :                                                       format("Occurs for GasEquipment object ={} in Zone={}",
    1981           0 :                                                              thisGasEqInput.Name,
    1982           0 :                                                              state.dataHeatBal->Zone(thisZoneGas.ZonePtr).Name));
    1983           0 :                                     ErrorsFound = true;
    1984             :                                 }
    1985             :                             }
    1986          71 :                             thisZoneGas.DesignLevel = IHGNumbers(1) * spaceFrac;
    1987          71 :                             if (IHGNumericFieldBlanks(1)) {
    1988           0 :                                 ShowWarningError(state,
    1989           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Gas Equipment will result.",
    1990             :                                                         RoutineName,
    1991             :                                                         gasEqModuleObject,
    1992           0 :                                                         thisGasEqInput.Name,
    1993             :                                                         IHGNumericFieldNames(1)));
    1994             :                             }
    1995           8 :                         } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") {
    1996           8 :                             if (spaceNum != 0) {
    1997           8 :                                 if (IHGNumbers(2) >= 0.0) {
    1998           8 :                                     thisZoneGas.DesignLevel = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
    1999           8 :                                     if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
    2000           0 :                                         !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
    2001           0 :                                         ShowWarningError(state,
    2002           0 :                                                          format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0.  0 Gas Equipment will result.",
    2003             :                                                                 RoutineName,
    2004             :                                                                 gasEqModuleObject,
    2005           0 :                                                                 thisZoneGas.Name,
    2006             :                                                                 IHGNumericFieldNames(2)));
    2007             :                                     }
    2008             :                                 } else {
    2009           0 :                                     ShowSevereError(state,
    2010           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
    2011             :                                                            RoutineName,
    2012             :                                                            gasEqModuleObject,
    2013           0 :                                                            thisGasEqInput.Name,
    2014             :                                                            IHGNumericFieldNames(2),
    2015             :                                                            IHGNumbers(2)));
    2016           0 :                                     ErrorsFound = true;
    2017             :                                 }
    2018             :                             }
    2019           8 :                             if (IHGNumericFieldBlanks(2)) {
    2020           0 :                                 ShowWarningError(state,
    2021           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Gas Equipment will result.",
    2022             :                                                         RoutineName,
    2023             :                                                         gasEqModuleObject,
    2024           0 :                                                         thisGasEqInput.Name,
    2025             :                                                         IHGNumericFieldNames(2)));
    2026             :                             }
    2027             : 
    2028           0 :                         } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") {
    2029           0 :                             if (spaceNum != 0) {
    2030           0 :                                 if (IHGNumbers(3) >= 0.0) {
    2031           0 :                                     thisZoneGas.DesignLevel = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).TotOccupants;
    2032           0 :                                     if (state.dataHeatBal->space(spaceNum).TotOccupants <= 0.0) {
    2033           0 :                                         ShowWarningError(state,
    2034           0 :                                                          format("{}{}=\"{}\", specifies {}, but Total Occupants = 0.  0 Gas Equipment will result.",
    2035             :                                                                 RoutineName,
    2036             :                                                                 gasEqModuleObject,
    2037           0 :                                                                 thisZoneGas.Name,
    2038             :                                                                 IHGNumericFieldNames(2)));
    2039             :                                     }
    2040             :                                 } else {
    2041           0 :                                     ShowSevereError(state,
    2042           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
    2043             :                                                            RoutineName,
    2044             :                                                            gasEqModuleObject,
    2045           0 :                                                            thisGasEqInput.Name,
    2046             :                                                            IHGNumericFieldNames(3),
    2047             :                                                            IHGNumbers(3)));
    2048           0 :                                     ErrorsFound = true;
    2049             :                                 }
    2050             :                             }
    2051           0 :                             if (IHGNumericFieldBlanks(3)) {
    2052           0 :                                 ShowWarningError(state,
    2053           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Gas Equipment will result.",
    2054             :                                                         RoutineName,
    2055             :                                                         gasEqModuleObject,
    2056           0 :                                                         thisGasEqInput.Name,
    2057             :                                                         IHGNumericFieldNames(3)));
    2058             :                             }
    2059             : 
    2060             :                         } else {
    2061           0 :                             if (Item1 == 1) {
    2062           0 :                                 ShowSevereError(state,
    2063           0 :                                                 format("{}{}=\"{}\", invalid {}, value  ={}",
    2064             :                                                        RoutineName,
    2065             :                                                        gasEqModuleObject,
    2066           0 :                                                        thisGasEqInput.Name,
    2067             :                                                        IHGAlphaFieldNames(4),
    2068             :                                                        IHGAlphas(4)));
    2069           0 :                                 ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\".");
    2070           0 :                                 ErrorsFound = true;
    2071             :                             }
    2072             :                         }
    2073             :                     }
    2074             : 
    2075             :                     // Calculate nominal min/max equipment level
    2076          79 :                     thisZoneGas.NomMinDesignLevel = thisZoneGas.DesignLevel * SchMin;
    2077          79 :                     thisZoneGas.NomMaxDesignLevel = thisZoneGas.DesignLevel * SchMax;
    2078             : 
    2079          79 :                     thisZoneGas.FractionLatent = IHGNumbers(4);
    2080          79 :                     thisZoneGas.FractionRadiant = IHGNumbers(5);
    2081          79 :                     thisZoneGas.FractionLost = IHGNumbers(6);
    2082             : 
    2083          79 :                     if ((IHGNumNumbers == 7) || (!IHGNumericFieldBlanks(7))) {
    2084          71 :                         thisZoneGas.CO2RateFactor = IHGNumbers(7);
    2085             :                     }
    2086          79 :                     if (thisZoneGas.CO2RateFactor < 0.0) {
    2087           0 :                         ShowSevereError(state,
    2088           0 :                                         format("{}{}=\"{}\", {} < 0.0, value ={:.2R}",
    2089             :                                                RoutineName,
    2090             :                                                gasEqModuleObject,
    2091           0 :                                                thisGasEqInput.Name,
    2092             :                                                IHGNumericFieldNames(7),
    2093             :                                                IHGNumbers(7)));
    2094           0 :                         ErrorsFound = true;
    2095             :                     }
    2096          79 :                     if (thisZoneGas.CO2RateFactor > 4.0e-7) {
    2097           0 :                         ShowSevereError(state,
    2098           0 :                                         format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}",
    2099             :                                                RoutineName,
    2100             :                                                gasEqModuleObject,
    2101           0 :                                                thisGasEqInput.Name,
    2102             :                                                IHGNumericFieldNames(7),
    2103             :                                                IHGNumbers(7)));
    2104           0 :                         ErrorsFound = true;
    2105             :                     }
    2106             :                     // FractionConvected is a calculated field
    2107          79 :                     thisZoneGas.FractionConvected = 1.0 - (thisZoneGas.FractionLatent + thisZoneGas.FractionRadiant + thisZoneGas.FractionLost);
    2108          79 :                     if (std::abs(thisZoneGas.FractionConvected) <= 0.001) thisZoneGas.FractionConvected = 0.0;
    2109          79 :                     if (thisZoneGas.FractionConvected < 0.0) {
    2110           0 :                         if (Item1 == 1) {
    2111           0 :                             ShowSevereError(state,
    2112           0 :                                             format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, gasEqModuleObject, thisGasEqInput.Name));
    2113           0 :                             ErrorsFound = true;
    2114             :                         }
    2115             :                     }
    2116             : 
    2117          79 :                     if (IHGNumAlphas > 4) {
    2118          71 :                         thisZoneGas.EndUseSubcategory = IHGAlphas(5);
    2119             :                     } else {
    2120           8 :                         thisZoneGas.EndUseSubcategory = "General";
    2121             :                     }
    2122             : 
    2123          79 :                     if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
    2124          16 :                         SetupEMSActuator(state,
    2125             :                                          "GasEquipment",
    2126             :                                          thisZoneGas.Name,
    2127             :                                          "NaturalGas Rate",
    2128             :                                          "[W]",
    2129          16 :                                          thisZoneGas.EMSZoneEquipOverrideOn,
    2130          16 :                                          thisZoneGas.EMSEquipPower);
    2131          16 :                         SetupEMSInternalVariable(state, "Gas Process Power Design Level", thisZoneGas.Name, "[W]", thisZoneGas.DesignLevel);
    2132             :                     } // EMS
    2133             : 
    2134          79 :                     if (!ErrorsFound)
    2135          79 :                         SetupSpaceInternalGain(state,
    2136             :                                                thisZoneGas.spaceIndex,
    2137             :                                                1.0,
    2138             :                                                thisZoneGas.Name,
    2139             :                                                DataHeatBalance::IntGainType::GasEquipment,
    2140             :                                                &thisZoneGas.ConGainRate,
    2141             :                                                nullptr,
    2142             :                                                &thisZoneGas.RadGainRate,
    2143             :                                                &thisZoneGas.LatGainRate,
    2144             :                                                nullptr,
    2145             :                                                &thisZoneGas.CO2GainRate);
    2146             : 
    2147             :                 } // for gasEqInputNum.NumOfSpaces
    2148             :             }     // for gasEqInputNum
    2149             :         }         // TotGasEquip > 0
    2150             : 
    2151             :         // HotWaterEquipment
    2152        1592 :         EPVector<InternalHeatGains::GlobalInternalGainMiscObject> hotWaterEqObjects;
    2153         796 :         int numHotWaterEqStatements = 0;
    2154         796 :         setupIHGZonesAndSpaces(state, hwEqModuleObject, hotWaterEqObjects, numHotWaterEqStatements, state.dataHeatBal->TotHWEquip, ErrorsFound);
    2155             : 
    2156         796 :         if (state.dataHeatBal->TotHWEquip > 0) {
    2157           6 :             state.dataHeatBal->ZoneHWEq.allocate(state.dataHeatBal->TotHWEquip);
    2158           6 :             int hwEqNum = 0;
    2159          12 :             for (int hwEqInputNum = 1; hwEqInputNum <= numHotWaterEqStatements; ++hwEqInputNum) {
    2160             : 
    2161           6 :                 state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2162             :                                                                          hwEqModuleObject,
    2163             :                                                                          hwEqInputNum,
    2164             :                                                                          IHGAlphas,
    2165             :                                                                          IHGNumAlphas,
    2166             :                                                                          IHGNumbers,
    2167             :                                                                          IHGNumNumbers,
    2168             :                                                                          IOStat,
    2169             :                                                                          IHGNumericFieldBlanks,
    2170             :                                                                          IHGAlphaFieldBlanks,
    2171             :                                                                          IHGAlphaFieldNames,
    2172             :                                                                          IHGNumericFieldNames);
    2173             : 
    2174           6 :                 auto &thisHWEqInput = hotWaterEqObjects(hwEqInputNum);
    2175          20 :                 for (int Item1 = 1; Item1 <= thisHWEqInput.numOfSpaces; ++Item1) {
    2176          14 :                     ++hwEqNum;
    2177          14 :                     auto &thisZoneHWEq = state.dataHeatBal->ZoneHWEq(hwEqNum);
    2178          14 :                     int const spaceNum = thisHWEqInput.spaceNums(Item1);
    2179          14 :                     int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
    2180          14 :                     thisZoneHWEq.Name = thisHWEqInput.names(Item1);
    2181          14 :                     thisZoneHWEq.spaceIndex = spaceNum;
    2182          14 :                     thisZoneHWEq.ZonePtr = zoneNum;
    2183             : 
    2184          14 :                     thisZoneHWEq.SchedPtr = GetScheduleIndex(state, IHGAlphas(3));
    2185          14 :                     SchMin = 0.0;
    2186          14 :                     SchMax = 0.0;
    2187          14 :                     if (thisZoneHWEq.SchedPtr == 0) {
    2188           0 :                         if (IHGAlphaFieldBlanks(3)) {
    2189           0 :                             ShowSevereError(
    2190             :                                 state,
    2191           0 :                                 format("{}{}=\"{}\", {} is required.", RoutineName, hwEqModuleObject, thisHWEqInput.Name, IHGAlphaFieldNames(3)));
    2192             :                         } else {
    2193           0 :                             ShowSevereError(state,
    2194           0 :                                             format("{}{}=\"{}\", invalid {} entered={}",
    2195             :                                                    RoutineName,
    2196             :                                                    hwEqModuleObject,
    2197           0 :                                                    thisHWEqInput.Name,
    2198             :                                                    IHGAlphaFieldNames(3),
    2199             :                                                    IHGAlphas(3)));
    2200             :                         }
    2201           0 :                         ErrorsFound = true;
    2202             :                     } else { // check min/max on schedule
    2203          14 :                         SchMin = GetScheduleMinValue(state, thisZoneHWEq.SchedPtr);
    2204          14 :                         SchMax = GetScheduleMaxValue(state, thisZoneHWEq.SchedPtr);
    2205          14 :                         if (SchMin < 0.0 || SchMax < 0.0) {
    2206           0 :                             if (SchMin < 0.0) {
    2207           0 :                                 ShowSevereError(state,
    2208           0 :                                                 format("{}{}=\"{}\", {}, minimum is < 0.0",
    2209             :                                                        RoutineName,
    2210             :                                                        hwEqModuleObject,
    2211           0 :                                                        thisHWEqInput.Name,
    2212             :                                                        IHGAlphaFieldNames(3)));
    2213           0 :                                 ShowContinueError(state,
    2214           0 :                                                   format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMin));
    2215           0 :                                 ErrorsFound = true;
    2216             :                             }
    2217           0 :                             if (SchMax < 0.0) {
    2218           0 :                                 ShowSevereError(state,
    2219           0 :                                                 format("{}{}=\"{}\", {}, maximum is < 0.0",
    2220             :                                                        RoutineName,
    2221             :                                                        hwEqModuleObject,
    2222           0 :                                                        thisHWEqInput.Name,
    2223             :                                                        IHGAlphaFieldNames(3)));
    2224           0 :                                 ShowContinueError(state,
    2225           0 :                                                   format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMax));
    2226           0 :                                 ErrorsFound = true;
    2227             :                             }
    2228             :                         }
    2229             :                     }
    2230             : 
    2231             :                     // Hot Water equipment design level calculation method.
    2232             :                     {
    2233          14 :                         std::string const &equipmentLevel = IHGAlphas(4);
    2234          14 :                         if (equipmentLevel == "EQUIPMENTLEVEL") {
    2235           5 :                             Real64 spaceFrac = 1.0;
    2236           5 :                             if (thisHWEqInput.numOfSpaces > 1) {
    2237           0 :                                 Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
    2238           0 :                                 if (zoneArea > 0.0) {
    2239           0 :                                     spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
    2240             :                                 } else {
    2241           0 :                                     ShowSevereError(
    2242           0 :                                         state, format("{}Zone floor area is zero when allocating HotWaterEquipment loads to Spaces.", RoutineName));
    2243           0 :                                     ShowContinueError(state,
    2244           0 :                                                       format("Occurs for HotWaterEquipment object ={} in Zone={}",
    2245           0 :                                                              thisHWEqInput.Name,
    2246           0 :                                                              state.dataHeatBal->Zone(zoneNum).Name));
    2247           0 :                                     ErrorsFound = true;
    2248             :                                 }
    2249             :                             }
    2250           5 :                             thisZoneHWEq.DesignLevel = IHGNumbers(1) * spaceFrac;
    2251           5 :                             if (IHGNumericFieldBlanks(1)) {
    2252           0 :                                 ShowWarningError(state,
    2253           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Hot Water Equipment will result.",
    2254             :                                                         RoutineName,
    2255             :                                                         hwEqModuleObject,
    2256           0 :                                                         thisHWEqInput.Name,
    2257             :                                                         IHGNumericFieldNames(1)));
    2258             :                             }
    2259           9 :                         } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") {
    2260           0 :                             if (spaceNum != 0) {
    2261           0 :                                 if (IHGNumbers(2) >= 0.0) {
    2262           0 :                                     thisZoneHWEq.DesignLevel = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
    2263           0 :                                     if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
    2264           0 :                                         !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
    2265           0 :                                         ShowWarningError(
    2266             :                                             state,
    2267           0 :                                             format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0.  0 Hot Water Equipment will result.",
    2268             :                                                    RoutineName,
    2269             :                                                    hwEqModuleObject,
    2270           0 :                                                    thisZoneHWEq.Name,
    2271             :                                                    IHGNumericFieldNames(2)));
    2272             :                                     }
    2273             :                                 } else {
    2274           0 :                                     ShowSevereError(state,
    2275           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
    2276             :                                                            RoutineName,
    2277             :                                                            hwEqModuleObject,
    2278           0 :                                                            thisHWEqInput.Name,
    2279             :                                                            IHGNumericFieldNames(2),
    2280             :                                                            IHGNumbers(2)));
    2281           0 :                                     ErrorsFound = true;
    2282             :                                 }
    2283             :                             }
    2284           0 :                             if (IHGNumericFieldBlanks(2)) {
    2285           0 :                                 ShowWarningError(state,
    2286           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Hot Water Equipment will result.",
    2287             :                                                         RoutineName,
    2288             :                                                         hwEqModuleObject,
    2289           0 :                                                         thisHWEqInput.Name,
    2290             :                                                         IHGNumericFieldNames(2)));
    2291             :                             }
    2292             : 
    2293           9 :                         } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") {
    2294           9 :                             if (spaceNum != 0) {
    2295           9 :                                 if (IHGNumbers(3) >= 0.0) {
    2296           9 :                                     thisZoneHWEq.DesignLevel = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).TotOccupants;
    2297           9 :                                     if (state.dataHeatBal->space(spaceNum).TotOccupants <= 0.0) {
    2298           0 :                                         ShowWarningError(
    2299             :                                             state,
    2300           0 :                                             format("{}{}=\"{}\", specifies {}, but Total Occupants = 0.  0 Hot Water Equipment will result.",
    2301             :                                                    RoutineName,
    2302             :                                                    hwEqModuleObject,
    2303           0 :                                                    thisZoneHWEq.Name,
    2304             :                                                    IHGNumericFieldNames(2)));
    2305             :                                     }
    2306             :                                 } else {
    2307           0 :                                     ShowSevereError(state,
    2308           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
    2309             :                                                            RoutineName,
    2310             :                                                            hwEqModuleObject,
    2311           0 :                                                            thisHWEqInput.Name,
    2312             :                                                            IHGNumericFieldNames(3),
    2313             :                                                            IHGNumbers(3)));
    2314           0 :                                     ErrorsFound = true;
    2315             :                                 }
    2316             :                             }
    2317           9 :                             if (IHGNumericFieldBlanks(3)) {
    2318           0 :                                 ShowWarningError(state,
    2319           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Hot Water Equipment will result.",
    2320             :                                                         RoutineName,
    2321             :                                                         hwEqModuleObject,
    2322           0 :                                                         thisHWEqInput.Name,
    2323             :                                                         IHGNumericFieldNames(3)));
    2324             :                             }
    2325             : 
    2326             :                         } else {
    2327           0 :                             if (Item1 == 1) {
    2328           0 :                                 ShowSevereError(state,
    2329           0 :                                                 format("{}{}=\"{}\", invalid {}, value  ={}",
    2330             :                                                        RoutineName,
    2331             :                                                        hwEqModuleObject,
    2332           0 :                                                        thisHWEqInput.Name,
    2333             :                                                        IHGAlphaFieldNames(4),
    2334             :                                                        IHGAlphas(4)));
    2335           0 :                                 ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\".");
    2336           0 :                                 ErrorsFound = true;
    2337             :                             }
    2338             :                         }
    2339             :                     }
    2340             : 
    2341             :                     // Calculate nominal min/max equipment level
    2342          14 :                     thisZoneHWEq.NomMinDesignLevel = thisZoneHWEq.DesignLevel * SchMin;
    2343          14 :                     thisZoneHWEq.NomMaxDesignLevel = thisZoneHWEq.DesignLevel * SchMax;
    2344             : 
    2345          14 :                     thisZoneHWEq.FractionLatent = IHGNumbers(4);
    2346          14 :                     thisZoneHWEq.FractionRadiant = IHGNumbers(5);
    2347          14 :                     thisZoneHWEq.FractionLost = IHGNumbers(6);
    2348             :                     // FractionConvected is a calculated field
    2349          14 :                     thisZoneHWEq.FractionConvected = 1.0 - (thisZoneHWEq.FractionLatent + thisZoneHWEq.FractionRadiant + thisZoneHWEq.FractionLost);
    2350          14 :                     if (std::abs(thisZoneHWEq.FractionConvected) <= 0.001) thisZoneHWEq.FractionConvected = 0.0;
    2351          14 :                     if (thisZoneHWEq.FractionConvected < 0.0) {
    2352           0 :                         ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, hwEqModuleObject, thisHWEqInput.Name));
    2353           0 :                         ErrorsFound = true;
    2354             :                     }
    2355             : 
    2356          14 :                     if (IHGNumAlphas > 4) {
    2357          14 :                         thisZoneHWEq.EndUseSubcategory = IHGAlphas(5);
    2358             :                     } else {
    2359           0 :                         thisZoneHWEq.EndUseSubcategory = "General";
    2360             :                     }
    2361             : 
    2362          14 :                     if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
    2363           0 :                         SetupEMSActuator(state,
    2364             :                                          "HotWaterEquipment",
    2365             :                                          thisZoneHWEq.Name,
    2366             :                                          "District Heating Power Level",
    2367             :                                          "[W]",
    2368           0 :                                          thisZoneHWEq.EMSZoneEquipOverrideOn,
    2369           0 :                                          thisZoneHWEq.EMSEquipPower);
    2370           0 :                         SetupEMSInternalVariable(state, "Process District Heat Design Level", thisZoneHWEq.Name, "[W]", thisZoneHWEq.DesignLevel);
    2371             :                     } // EMS
    2372             : 
    2373          14 :                     if (!ErrorsFound)
    2374          14 :                         SetupSpaceInternalGain(state,
    2375             :                                                thisZoneHWEq.spaceIndex,
    2376             :                                                1.0,
    2377             :                                                thisZoneHWEq.Name,
    2378             :                                                DataHeatBalance::IntGainType::HotWaterEquipment,
    2379             :                                                &thisZoneHWEq.ConGainRate,
    2380             :                                                nullptr,
    2381             :                                                &thisZoneHWEq.RadGainRate,
    2382             :                                                &thisZoneHWEq.LatGainRate);
    2383             : 
    2384             :                 } // for hwEqInputNum.NumOfSpaces
    2385             :             }     // for hwEqInputNum
    2386             :         }         // TotHWEquip > 0
    2387             : 
    2388             :         // SteamEquipment
    2389        1592 :         EPVector<InternalHeatGains::GlobalInternalGainMiscObject> steamEqObjects;
    2390         796 :         int numSteamEqStatements = 0;
    2391         796 :         setupIHGZonesAndSpaces(state, stmEqModuleObject, steamEqObjects, numSteamEqStatements, state.dataHeatBal->TotStmEquip, ErrorsFound);
    2392             : 
    2393         796 :         if (state.dataHeatBal->TotStmEquip > 0) {
    2394           5 :             state.dataHeatBal->ZoneSteamEq.allocate(state.dataHeatBal->TotStmEquip);
    2395           5 :             int stmEqNum = 0;
    2396          10 :             for (int stmEqInputNum = 1; stmEqInputNum <= numSteamEqStatements; ++stmEqInputNum) {
    2397           5 :                 state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2398             :                                                                          stmEqModuleObject,
    2399             :                                                                          stmEqInputNum,
    2400             :                                                                          IHGAlphas,
    2401             :                                                                          IHGNumAlphas,
    2402             :                                                                          IHGNumbers,
    2403             :                                                                          IHGNumNumbers,
    2404             :                                                                          IOStat,
    2405             :                                                                          IHGNumericFieldBlanks,
    2406             :                                                                          IHGAlphaFieldBlanks,
    2407             :                                                                          IHGAlphaFieldNames,
    2408             :                                                                          IHGNumericFieldNames);
    2409             : 
    2410           5 :                 auto &thisStmEqInput = steamEqObjects(stmEqInputNum);
    2411          10 :                 for (int Item1 = 1; Item1 <= thisStmEqInput.numOfSpaces; ++Item1) {
    2412           5 :                     ++stmEqNum;
    2413           5 :                     auto &thisZoneStmEq = state.dataHeatBal->ZoneSteamEq(stmEqNum);
    2414           5 :                     int const spaceNum = thisStmEqInput.spaceNums(Item1);
    2415           5 :                     int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
    2416           5 :                     thisZoneStmEq.Name = thisStmEqInput.names(Item1);
    2417           5 :                     thisZoneStmEq.spaceIndex = spaceNum;
    2418           5 :                     thisZoneStmEq.ZonePtr = zoneNum;
    2419             : 
    2420           5 :                     thisZoneStmEq.SchedPtr = GetScheduleIndex(state, IHGAlphas(3));
    2421           5 :                     SchMin = 0.0;
    2422           5 :                     SchMax = 0.0;
    2423           5 :                     if (thisZoneStmEq.SchedPtr == 0) {
    2424           0 :                         if (IHGAlphaFieldBlanks(3)) {
    2425           0 :                             ShowSevereError(
    2426             :                                 state,
    2427           0 :                                 format("{}{}=\"{}\", {} is required.", RoutineName, stmEqModuleObject, thisStmEqInput.Name, IHGAlphaFieldNames(3)));
    2428             :                         } else {
    2429           0 :                             ShowSevereError(state,
    2430           0 :                                             format("{}{}=\"{}\", invalid {} entered={}",
    2431             :                                                    RoutineName,
    2432             :                                                    stmEqModuleObject,
    2433           0 :                                                    thisStmEqInput.Name,
    2434             :                                                    IHGAlphaFieldNames(3),
    2435             :                                                    IHGAlphas(3)));
    2436             :                         }
    2437           0 :                         ErrorsFound = true;
    2438             :                     } else { // check min/max on schedule
    2439           5 :                         SchMin = GetScheduleMinValue(state, thisZoneStmEq.SchedPtr);
    2440           5 :                         SchMax = GetScheduleMaxValue(state, thisZoneStmEq.SchedPtr);
    2441           5 :                         if (SchMin < 0.0 || SchMax < 0.0) {
    2442           0 :                             if (SchMin < 0.0) {
    2443           0 :                                 ShowSevereError(state,
    2444           0 :                                                 format("{}{}=\"{}\", {}, minimum is < 0.0",
    2445             :                                                        RoutineName,
    2446             :                                                        stmEqModuleObject,
    2447           0 :                                                        thisStmEqInput.Name,
    2448             :                                                        IHGAlphaFieldNames(3)));
    2449           0 :                                 ShowContinueError(state,
    2450           0 :                                                   format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMin));
    2451           0 :                                 ErrorsFound = true;
    2452             :                             }
    2453           0 :                             if (SchMax < 0.0) {
    2454           0 :                                 ShowSevereError(state,
    2455           0 :                                                 format("{}{}=\"{}\", {}, maximum is < 0.0",
    2456             :                                                        RoutineName,
    2457             :                                                        stmEqModuleObject,
    2458           0 :                                                        thisStmEqInput.Name,
    2459             :                                                        IHGAlphaFieldNames(3)));
    2460           0 :                                 ShowContinueError(state,
    2461           0 :                                                   format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMax));
    2462           0 :                                 ErrorsFound = true;
    2463             :                             }
    2464             :                         }
    2465             :                     }
    2466             : 
    2467             :                     // Steam equipment design level calculation method.
    2468             :                     {
    2469           5 :                         std::string const &equipmentLevel = IHGAlphas(4);
    2470           5 :                         if (equipmentLevel == "EQUIPMENTLEVEL") {
    2471           5 :                             Real64 spaceFrac = 1.0;
    2472           5 :                             if (thisStmEqInput.numOfSpaces > 1) {
    2473           0 :                                 Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
    2474           0 :                                 if (zoneArea > 0.0) {
    2475           0 :                                     spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
    2476             :                                 } else {
    2477           0 :                                     ShowSevereError(state,
    2478           0 :                                                     format("{}Zone floor area is zero when allocating SteamEquipment loads to Spaces.", RoutineName));
    2479           0 :                                     ShowContinueError(state,
    2480           0 :                                                       format("Occurs for SteamEquipment object ={} in Zone={}",
    2481           0 :                                                              thisStmEqInput.Name,
    2482           0 :                                                              state.dataHeatBal->Zone(zoneNum).Name));
    2483           0 :                                     ErrorsFound = true;
    2484             :                                 }
    2485             :                             }
    2486           5 :                             thisZoneStmEq.DesignLevel = IHGNumbers(1) * spaceFrac;
    2487           5 :                             if (IHGNumericFieldBlanks(1)) {
    2488           0 :                                 ShowWarningError(state,
    2489           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Steam Equipment will result.",
    2490             :                                                         RoutineName,
    2491             :                                                         hwEqModuleObject,
    2492           0 :                                                         thisStmEqInput.Name,
    2493             :                                                         IHGNumericFieldNames(1)));
    2494             :                             }
    2495           0 :                         } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") {
    2496           0 :                             if (spaceNum > 0) {
    2497           0 :                                 if (IHGNumbers(2) >= 0.0) {
    2498           0 :                                     thisZoneStmEq.DesignLevel = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
    2499           0 :                                     if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
    2500           0 :                                         !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
    2501           0 :                                         ShowWarningError(
    2502             :                                             state,
    2503           0 :                                             format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0.  0 Steam Equipment will result.",
    2504             :                                                    RoutineName,
    2505             :                                                    stmEqModuleObject,
    2506           0 :                                                    thisZoneStmEq.Name,
    2507             :                                                    IHGNumericFieldNames(2)));
    2508             :                                     }
    2509             :                                 } else {
    2510           0 :                                     ShowSevereError(state,
    2511           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
    2512             :                                                            RoutineName,
    2513             :                                                            stmEqModuleObject,
    2514             :                                                            IHGAlphas(1),
    2515             :                                                            IHGNumericFieldNames(2),
    2516             :                                                            IHGNumbers(2)));
    2517           0 :                                     ErrorsFound = true;
    2518             :                                 }
    2519             :                             }
    2520           0 :                             if (IHGNumericFieldBlanks(2)) {
    2521           0 :                                 ShowWarningError(state,
    2522           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Steam Equipment will result.",
    2523             :                                                         RoutineName,
    2524             :                                                         stmEqModuleObject,
    2525           0 :                                                         thisStmEqInput.Name,
    2526             :                                                         IHGNumericFieldNames(2)));
    2527             :                             }
    2528             : 
    2529           0 :                         } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") {
    2530           0 :                             if (spaceNum != 0) {
    2531           0 :                                 if (IHGNumbers(3) >= 0.0) {
    2532           0 :                                     thisZoneStmEq.DesignLevel = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).TotOccupants;
    2533           0 :                                     if (state.dataHeatBal->space(spaceNum).TotOccupants <= 0.0) {
    2534           0 :                                         ShowWarningError(state,
    2535           0 :                                                          format("{}{}=\"{}\", specifies {}, but Total Occupants = 0.  0 Steam Equipment will result.",
    2536             :                                                                 RoutineName,
    2537             :                                                                 stmEqModuleObject,
    2538           0 :                                                                 thisZoneStmEq.Name,
    2539             :                                                                 IHGNumericFieldNames(2)));
    2540             :                                     }
    2541             :                                 } else {
    2542           0 :                                     ShowSevereError(state,
    2543           0 :                                                     format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
    2544             :                                                            RoutineName,
    2545             :                                                            stmEqModuleObject,
    2546             :                                                            IHGAlphas(1),
    2547             :                                                            IHGNumericFieldNames(3),
    2548             :                                                            IHGNumbers(3)));
    2549           0 :                                     ErrorsFound = true;
    2550             :                                 }
    2551             :                             }
    2552           0 :                             if (IHGNumericFieldBlanks(3)) {
    2553           0 :                                 ShowWarningError(state,
    2554           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Steam Equipment will result.",
    2555             :                                                         RoutineName,
    2556             :                                                         stmEqModuleObject,
    2557             :                                                         IHGAlphas(1),
    2558             :                                                         IHGNumericFieldNames(3)));
    2559             :                             }
    2560             : 
    2561             :                         } else {
    2562           0 :                             if (Item1 == 1) {
    2563           0 :                                 ShowSevereError(state,
    2564           0 :                                                 format("{}{}=\"{}\", invalid {}, value  ={}",
    2565             :                                                        RoutineName,
    2566             :                                                        stmEqModuleObject,
    2567             :                                                        IHGAlphas(1),
    2568             :                                                        IHGAlphaFieldNames(4),
    2569             :                                                        IHGAlphas(4)));
    2570           0 :                                 ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\".");
    2571           0 :                                 ErrorsFound = true;
    2572             :                             }
    2573             :                         }
    2574             :                     }
    2575             : 
    2576             :                     // Calculate nominal min/max equipment level
    2577           5 :                     thisZoneStmEq.NomMinDesignLevel = thisZoneStmEq.DesignLevel * SchMin;
    2578           5 :                     thisZoneStmEq.NomMaxDesignLevel = thisZoneStmEq.DesignLevel * SchMax;
    2579             : 
    2580           5 :                     thisZoneStmEq.FractionLatent = IHGNumbers(4);
    2581           5 :                     thisZoneStmEq.FractionRadiant = IHGNumbers(5);
    2582           5 :                     thisZoneStmEq.FractionLost = IHGNumbers(6);
    2583             :                     // FractionConvected is a calculated field
    2584           5 :                     thisZoneStmEq.FractionConvected =
    2585           5 :                         1.0 - (thisZoneStmEq.FractionLatent + thisZoneStmEq.FractionRadiant + thisZoneStmEq.FractionLost);
    2586           5 :                     if (std::abs(thisZoneStmEq.FractionConvected) <= 0.001) thisZoneStmEq.FractionConvected = 0.0;
    2587           5 :                     if (thisZoneStmEq.FractionConvected < 0.0) {
    2588           0 :                         ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, stmEqModuleObject, IHGAlphas(1)));
    2589           0 :                         ErrorsFound = true;
    2590             :                     }
    2591             : 
    2592           5 :                     if (IHGNumAlphas > 4) {
    2593           5 :                         thisZoneStmEq.EndUseSubcategory = IHGAlphas(5);
    2594             :                     } else {
    2595           0 :                         thisZoneStmEq.EndUseSubcategory = "General";
    2596             :                     }
    2597             : 
    2598           5 :                     if (thisZoneStmEq.ZonePtr <= 0) continue; // Error, will be caught and terminated later
    2599             : 
    2600           5 :                     if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
    2601           0 :                         SetupEMSActuator(state,
    2602             :                                          "SteamEquipment",
    2603             :                                          thisZoneStmEq.Name,
    2604             :                                          "District Heating Power Level",
    2605             :                                          "[W]",
    2606           0 :                                          thisZoneStmEq.EMSZoneEquipOverrideOn,
    2607           0 :                                          thisZoneStmEq.EMSEquipPower);
    2608           0 :                         SetupEMSInternalVariable(
    2609           0 :                             state, "Process Steam District Heat Design Level", thisZoneStmEq.Name, "[W]", thisZoneStmEq.DesignLevel);
    2610             :                     } // EMS
    2611             : 
    2612           5 :                     if (!ErrorsFound)
    2613           5 :                         SetupSpaceInternalGain(state,
    2614             :                                                thisZoneStmEq.spaceIndex,
    2615             :                                                1.0,
    2616             :                                                thisZoneStmEq.Name,
    2617             :                                                DataHeatBalance::IntGainType::SteamEquipment,
    2618             :                                                &thisZoneStmEq.ConGainRate,
    2619             :                                                nullptr,
    2620             :                                                &thisZoneStmEq.RadGainRate,
    2621             :                                                &thisZoneStmEq.LatGainRate);
    2622             : 
    2623             :                 } // for stmEqInputNum.NumOfSpaces
    2624             :             }     // for stmEqInputNum
    2625             :         }         // TotStmEquip > 0
    2626             : 
    2627             :         // OtherEquipment
    2628        1592 :         EPVector<InternalHeatGains::GlobalInternalGainMiscObject> otherEqObjects;
    2629         796 :         int numOtherEqStatements = 0;
    2630         796 :         setupIHGZonesAndSpaces(state, othEqModuleObject, otherEqObjects, numOtherEqStatements, state.dataHeatBal->TotOthEquip, ErrorsFound);
    2631             : 
    2632         796 :         if (state.dataHeatBal->TotOthEquip > 0) {
    2633          31 :             state.dataHeatBal->ZoneOtherEq.allocate(state.dataHeatBal->TotOthEquip);
    2634          31 :             int othEqNum = 0;
    2635         100 :             for (int othEqInputNum = 1; othEqInputNum <= numOtherEqStatements; ++othEqInputNum) {
    2636             : 
    2637          69 :                 state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2638             :                                                                          othEqModuleObject,
    2639             :                                                                          othEqInputNum,
    2640             :                                                                          IHGAlphas,
    2641             :                                                                          IHGNumAlphas,
    2642             :                                                                          IHGNumbers,
    2643             :                                                                          IHGNumNumbers,
    2644             :                                                                          IOStat,
    2645             :                                                                          IHGNumericFieldBlanks,
    2646             :                                                                          IHGAlphaFieldBlanks,
    2647             :                                                                          IHGAlphaFieldNames,
    2648             :                                                                          IHGNumericFieldNames);
    2649             : 
    2650          69 :                 auto &thisOthEqInput = otherEqObjects(othEqInputNum);
    2651         138 :                 for (int Item1 = 1; Item1 <= thisOthEqInput.numOfSpaces; ++Item1) {
    2652          69 :                     ++othEqNum;
    2653          69 :                     auto &thisZoneOthEq = state.dataHeatBal->ZoneOtherEq(othEqNum);
    2654          69 :                     int const spaceNum = thisOthEqInput.spaceNums(Item1);
    2655          69 :                     int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
    2656          69 :                     thisZoneOthEq.Name = thisOthEqInput.names(Item1);
    2657          69 :                     thisZoneOthEq.spaceIndex = spaceNum;
    2658          69 :                     thisZoneOthEq.ZonePtr = zoneNum;
    2659             : 
    2660          69 :                     if (IHGAlphas(2) == "NONE") {
    2661          67 :                         thisZoneOthEq.OtherEquipFuelType = Constant::eFuel::None;
    2662             :                     } else {
    2663           2 :                         thisZoneOthEq.OtherEquipFuelType = static_cast<Constant::eFuel>(getEnumValue(Constant::eFuelNamesUC, IHGAlphas(2)));
    2664           2 :                         if (thisZoneOthEq.OtherEquipFuelType == Constant::eFuel::Invalid ||
    2665           2 :                             thisZoneOthEq.OtherEquipFuelType == Constant::eFuel::Water) {
    2666           0 :                             ShowSevereError(state,
    2667           0 :                                             format("{}{}: invalid {} entered={} for {}={}",
    2668             :                                                    RoutineName,
    2669             :                                                    othEqModuleObject,
    2670             :                                                    IHGAlphaFieldNames(2),
    2671             :                                                    IHGAlphas(2),
    2672             :                                                    IHGAlphaFieldNames(1),
    2673           0 :                                                    thisOthEqInput.Name));
    2674           0 :                             ErrorsFound = true;
    2675             :                         }
    2676             : 
    2677             :                         // Build list of fuel types used in each zone and space (excluding Water)
    2678             : 
    2679           2 :                         bool found = false;
    2680           2 :                         for (Constant::eFuel fuelType : state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums) {
    2681           0 :                             if (thisZoneOthEq.OtherEquipFuelType == fuelType) {
    2682           0 :                                 found = true;
    2683           0 :                                 break;
    2684             :                             }
    2685           2 :                         }
    2686           2 :                         if (!found) {
    2687           2 :                             state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums.emplace_back(thisZoneOthEq.OtherEquipFuelType);
    2688             :                             // state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNames.emplace_back(FuelTypeString);
    2689             :                         }
    2690           2 :                         found = false;
    2691           2 :                         for (Constant::eFuel fuelType : state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNums) {
    2692           0 :                             if (thisZoneOthEq.OtherEquipFuelType == fuelType) {
    2693           0 :                                 found = true;
    2694           0 :                                 break;
    2695             :                             }
    2696           2 :                         }
    2697           2 :                         if (!found) {
    2698           2 :                             state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNums.emplace_back(thisZoneOthEq.OtherEquipFuelType);
    2699             :                             // state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNames.emplace_back(FuelTypeString);
    2700             :                         }
    2701             :                     }
    2702             : 
    2703          69 :                     thisZoneOthEq.SchedPtr = GetScheduleIndex(state, IHGAlphas(4));
    2704          69 :                     SchMin = 0.0;
    2705          69 :                     SchMax = 0.0;
    2706          69 :                     if (thisZoneOthEq.SchedPtr == 0) {
    2707           0 :                         if (IHGAlphaFieldBlanks(4)) {
    2708           0 :                             ShowSevereError(
    2709             :                                 state,
    2710           0 :                                 format("{}{}=\"{}\", {} is required.", RoutineName, othEqModuleObject, thisOthEqInput.Name, IHGAlphaFieldNames(4)));
    2711             :                         } else {
    2712           0 :                             ShowSevereError(state,
    2713           0 :                                             format("{}{}=\"{}\", invalid {} entered={}",
    2714             :                                                    RoutineName,
    2715             :                                                    othEqModuleObject,
    2716           0 :                                                    thisOthEqInput.Name,
    2717             :                                                    IHGAlphaFieldNames(4),
    2718             :                                                    IHGAlphas(4)));
    2719             :                         }
    2720           0 :                         ErrorsFound = true;
    2721             :                     } else { // check min/max on schedule
    2722          69 :                         SchMin = GetScheduleMinValue(state, thisZoneOthEq.SchedPtr);
    2723          69 :                         SchMax = GetScheduleMaxValue(state, thisZoneOthEq.SchedPtr);
    2724             :                     }
    2725             : 
    2726             :                     // equipment design level calculation method.
    2727             :                     unsigned int DesignLevelFieldNumber;
    2728             :                     {
    2729          69 :                         std::string const &equipmentLevel = IHGAlphas(5);
    2730          69 :                         if (equipmentLevel == "EQUIPMENTLEVEL") {
    2731          69 :                             DesignLevelFieldNumber = 1;
    2732          69 :                             Real64 spaceFrac = 1.0;
    2733          69 :                             if (thisOthEqInput.numOfSpaces > 1) {
    2734           0 :                                 Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
    2735           0 :                                 if (zoneArea > 0.0) {
    2736           0 :                                     spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
    2737             :                                 } else {
    2738           0 :                                     ShowSevereError(state,
    2739           0 :                                                     format("{}Zone floor area is zero when allocating OtherEquipment loads to Spaces.", RoutineName));
    2740           0 :                                     ShowContinueError(state,
    2741           0 :                                                       format("Occurs for OtherEquipment object ={} in Zone={}",
    2742           0 :                                                              thisOthEqInput.Name,
    2743           0 :                                                              state.dataHeatBal->Zone(zoneNum).Name));
    2744           0 :                                     ErrorsFound = true;
    2745             :                                 }
    2746             :                             }
    2747          69 :                             thisZoneOthEq.DesignLevel = IHGNumbers(1) * spaceFrac;
    2748          69 :                             if (IHGNumericFieldBlanks(DesignLevelFieldNumber)) {
    2749           0 :                                 ShowWarningError(state,
    2750           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Other Equipment will result.",
    2751             :                                                         RoutineName,
    2752             :                                                         othEqModuleObject,
    2753           0 :                                                         thisOthEqInput.Name,
    2754             :                                                         IHGNumericFieldNames(DesignLevelFieldNumber)));
    2755             :                             }
    2756             : 
    2757           0 :                         } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") {
    2758           0 :                             DesignLevelFieldNumber = 2;
    2759           0 :                             if (spaceNum > 0) {
    2760           0 :                                 thisZoneOthEq.DesignLevel = IHGNumbers(DesignLevelFieldNumber) * state.dataHeatBal->space(spaceNum).FloorArea;
    2761           0 :                                 if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) && !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
    2762           0 :                                     ShowWarningError(state,
    2763           0 :                                                      format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0.  0 Other Equipment will result.",
    2764             :                                                             RoutineName,
    2765             :                                                             othEqModuleObject,
    2766           0 :                                                             thisZoneOthEq.Name,
    2767             :                                                             IHGNumericFieldNames(DesignLevelFieldNumber)));
    2768             :                                 }
    2769             :                             }
    2770           0 :                             if (IHGNumericFieldBlanks(DesignLevelFieldNumber)) {
    2771           0 :                                 ShowWarningError(state,
    2772           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Other Equipment will result.",
    2773             :                                                         RoutineName,
    2774             :                                                         othEqModuleObject,
    2775             :                                                         IHGAlphas(1),
    2776             :                                                         IHGNumericFieldNames(DesignLevelFieldNumber)));
    2777             :                             }
    2778             : 
    2779           0 :                         } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") {
    2780           0 :                             DesignLevelFieldNumber = 3;
    2781           0 :                             if (thisZoneOthEq.ZonePtr != 0) {
    2782           0 :                                 thisZoneOthEq.DesignLevel = IHGNumbers(3) * state.dataHeatBal->Zone(thisZoneOthEq.ZonePtr).TotOccupants;
    2783           0 :                                 if (state.dataHeatBal->Zone(thisZoneOthEq.ZonePtr).TotOccupants <= 0.0) {
    2784           0 :                                     ShowWarningError(state,
    2785           0 :                                                      format("{}{}=\"{}\", specifies {}, but Total Occupants = 0.  0 Other Equipment will result.",
    2786             :                                                             RoutineName,
    2787             :                                                             othEqModuleObject,
    2788           0 :                                                             thisZoneOthEq.Name,
    2789             :                                                             IHGNumericFieldNames(DesignLevelFieldNumber)));
    2790             :                                 }
    2791             :                             }
    2792           0 :                             if (IHGNumericFieldBlanks(DesignLevelFieldNumber)) {
    2793           0 :                                 ShowWarningError(state,
    2794           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 Other Equipment will result.",
    2795             :                                                         RoutineName,
    2796             :                                                         othEqModuleObject,
    2797           0 :                                                         thisOthEqInput.Name,
    2798             :                                                         IHGNumericFieldNames(DesignLevelFieldNumber)));
    2799             :                             }
    2800             : 
    2801             :                         } else {
    2802           0 :                             if (Item1 == 1) {
    2803           0 :                                 ShowSevereError(state,
    2804           0 :                                                 format("{}{}=\"{}\", invalid {}, value  ={}",
    2805             :                                                        RoutineName,
    2806             :                                                        othEqModuleObject,
    2807           0 :                                                        thisOthEqInput.Name,
    2808             :                                                        IHGAlphaFieldNames(5),
    2809             :                                                        IHGAlphas(5)));
    2810           0 :                                 ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\".");
    2811           0 :                                 ErrorsFound = true;
    2812             :                             }
    2813             :                         }
    2814             :                     }
    2815             : 
    2816             :                     // Throw an error if the design level is negative and we have a fuel type
    2817          69 :                     if (thisZoneOthEq.DesignLevel < 0.0 && thisZoneOthEq.OtherEquipFuelType != Constant::eFuel::Invalid &&
    2818          18 :                         thisZoneOthEq.OtherEquipFuelType != Constant::eFuel::None) {
    2819           0 :                         ShowSevereError(state,
    2820           0 :                                         format("{}{}=\"{}\", {} is not allowed to be negative",
    2821             :                                                RoutineName,
    2822             :                                                othEqModuleObject,
    2823           0 :                                                thisOthEqInput.Name,
    2824             :                                                IHGNumericFieldNames(DesignLevelFieldNumber)));
    2825           0 :                         ShowContinueError(
    2826           0 :                             state, format("... when a fuel type of {} is specified.", Constant::eFuelNames[(int)thisZoneOthEq.OtherEquipFuelType]));
    2827           0 :                         ErrorsFound = true;
    2828             :                     }
    2829             : 
    2830             :                     // Calculate nominal min/max equipment level
    2831          69 :                     thisZoneOthEq.NomMinDesignLevel = thisZoneOthEq.DesignLevel * SchMin;
    2832          69 :                     thisZoneOthEq.NomMaxDesignLevel = thisZoneOthEq.DesignLevel * SchMax;
    2833             : 
    2834          69 :                     thisZoneOthEq.FractionLatent = IHGNumbers(4);
    2835          69 :                     thisZoneOthEq.FractionRadiant = IHGNumbers(5);
    2836          69 :                     thisZoneOthEq.FractionLost = IHGNumbers(6);
    2837             : 
    2838          69 :                     if ((IHGNumNumbers == 7) || (!IHGNumericFieldBlanks(7))) {
    2839          15 :                         thisZoneOthEq.CO2RateFactor = IHGNumbers(7);
    2840             :                     }
    2841          69 :                     if (thisZoneOthEq.CO2RateFactor < 0.0) {
    2842           0 :                         ShowSevereError(state,
    2843           0 :                                         format("{}{}=\"{}\", {} < 0.0, value ={:.2R}",
    2844             :                                                RoutineName,
    2845             :                                                othEqModuleObject,
    2846           0 :                                                thisOthEqInput.Name,
    2847             :                                                IHGNumericFieldNames(7),
    2848             :                                                IHGNumbers(7)));
    2849           0 :                         ErrorsFound = true;
    2850             :                     }
    2851          69 :                     if (thisZoneOthEq.CO2RateFactor > 4.0e-7) {
    2852           0 :                         ShowSevereError(state,
    2853           0 :                                         format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}",
    2854             :                                                RoutineName,
    2855             :                                                othEqModuleObject,
    2856           0 :                                                thisOthEqInput.Name,
    2857             :                                                IHGNumericFieldNames(7),
    2858             :                                                IHGNumbers(7)));
    2859           0 :                         ErrorsFound = true;
    2860             :                     }
    2861             : 
    2862             :                     // FractionConvected is a calculated field
    2863          69 :                     thisZoneOthEq.FractionConvected =
    2864          69 :                         1.0 - (thisZoneOthEq.FractionLatent + thisZoneOthEq.FractionRadiant + thisZoneOthEq.FractionLost);
    2865          69 :                     if (std::abs(thisZoneOthEq.FractionConvected) <= 0.001) thisZoneOthEq.FractionConvected = 0.0;
    2866          69 :                     if (thisZoneOthEq.FractionConvected < 0.0) {
    2867           0 :                         ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, othEqModuleObject, thisOthEqInput.Name));
    2868           0 :                         ErrorsFound = true;
    2869             :                     }
    2870             : 
    2871          69 :                     if (IHGNumAlphas > 5) {
    2872          15 :                         thisZoneOthEq.EndUseSubcategory = IHGAlphas(6);
    2873             :                     } else {
    2874          54 :                         thisZoneOthEq.EndUseSubcategory = "General";
    2875             :                     }
    2876             : 
    2877          69 :                     if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
    2878          19 :                         SetupEMSActuator(state,
    2879             :                                          "OtherEquipment",
    2880             :                                          thisZoneOthEq.Name,
    2881             :                                          "Power Level",
    2882             :                                          "[W]",
    2883          19 :                                          thisZoneOthEq.EMSZoneEquipOverrideOn,
    2884          19 :                                          thisZoneOthEq.EMSEquipPower);
    2885          19 :                         SetupEMSInternalVariable(state, "Other Equipment Design Level", thisZoneOthEq.Name, "[W]", thisZoneOthEq.DesignLevel);
    2886             :                     } // EMS
    2887             : 
    2888          69 :                     if (!ErrorsFound)
    2889          69 :                         SetupSpaceInternalGain(state,
    2890             :                                                thisZoneOthEq.spaceIndex,
    2891             :                                                1.0,
    2892             :                                                thisZoneOthEq.Name,
    2893             :                                                DataHeatBalance::IntGainType::OtherEquipment,
    2894             :                                                &thisZoneOthEq.ConGainRate,
    2895             :                                                nullptr,
    2896             :                                                &thisZoneOthEq.RadGainRate,
    2897             :                                                &thisZoneOthEq.LatGainRate);
    2898             : 
    2899             :                 } // for othEqInputNum.NumOfSpaces
    2900             :             }     // for othEqInputNum
    2901             :         }         // TotOtherEquip > 0
    2902             : 
    2903             :         // ElectricEquipment:ITE:AirCooled
    2904        1592 :         EPVector<InternalHeatGains::GlobalInternalGainMiscObject> iTEqObjects;
    2905         796 :         int numZoneITEqStatements = 0;
    2906             :         // Note that this object type does not support ZoneList due to node names in input fields
    2907         796 :         bool zoneListNotAllowed = true;
    2908        1592 :         setupIHGZonesAndSpaces(
    2909         796 :             state, itEqModuleObject, iTEqObjects, numZoneITEqStatements, state.dataHeatBal->TotITEquip, ErrorsFound, zoneListNotAllowed);
    2910             : 
    2911         796 :         if (state.dataHeatBal->TotITEquip > 0) {
    2912           5 :             state.dataHeatBal->ZoneITEq.allocate(state.dataHeatBal->TotITEquip);
    2913           5 :             int itEqNum = 0;
    2914          12 :             for (int itEqInputNum = 1; itEqInputNum <= numZoneITEqStatements; ++itEqInputNum) {
    2915             : 
    2916           7 :                 state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2917             :                                                                          itEqModuleObject,
    2918             :                                                                          itEqInputNum,
    2919             :                                                                          IHGAlphas,
    2920             :                                                                          IHGNumAlphas,
    2921             :                                                                          IHGNumbers,
    2922             :                                                                          IHGNumNumbers,
    2923             :                                                                          IOStat,
    2924             :                                                                          IHGNumericFieldBlanks,
    2925             :                                                                          IHGAlphaFieldBlanks,
    2926             :                                                                          IHGAlphaFieldNames,
    2927             :                                                                          IHGNumericFieldNames);
    2928             : 
    2929           7 :                 auto &thisITEqInput = iTEqObjects(itEqInputNum);
    2930          14 :                 for (int Item1 = 1; Item1 <= thisITEqInput.numOfSpaces; ++Item1) {
    2931           7 :                     ++itEqNum;
    2932           7 :                     auto &thisZoneITEq = state.dataHeatBal->ZoneITEq(itEqNum);
    2933           7 :                     int const spaceNum = thisITEqInput.spaceNums(Item1);
    2934           7 :                     int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
    2935           7 :                     thisZoneITEq.Name = thisITEqInput.names(Item1);
    2936           7 :                     thisZoneITEq.spaceIndex = spaceNum;
    2937           7 :                     thisZoneITEq.ZonePtr = zoneNum;
    2938             : 
    2939             :                     // IT equipment design level calculation method.
    2940           7 :                     if (IHGAlphaFieldBlanks(3)) {
    2941           0 :                         thisZoneITEq.FlowControlWithApproachTemps = false;
    2942             :                     } else {
    2943           7 :                         if (Util::SameString(IHGAlphas(3), "FlowFromSystem")) {
    2944           3 :                             thisZoneITEq.FlowControlWithApproachTemps = false;
    2945           4 :                         } else if (Util::SameString(IHGAlphas(3), "FlowControlWithApproachTemperatures")) {
    2946           4 :                             thisZoneITEq.FlowControlWithApproachTemps = true;
    2947           4 :                             state.dataHeatBal->Zone(thisZoneITEq.ZonePtr).HasAdjustedReturnTempByITE = true;
    2948           4 :                             state.dataHeatBal->Zone(thisZoneITEq.ZonePtr).NoHeatToReturnAir = false;
    2949             :                         } else {
    2950           0 :                             ShowSevereError(
    2951             :                                 state,
    2952           0 :                                 format("{}{}=\"{}\": invalid calculation method: {}", RoutineName, itEqModuleObject, IHGAlphas(1), IHGAlphas(3)));
    2953           0 :                             ErrorsFound = true;
    2954             :                         }
    2955             :                     }
    2956             : 
    2957             :                     {
    2958           7 :                         std::string const &equipmentLevel = IHGAlphas(4);
    2959           7 :                         if (equipmentLevel == "WATTS/UNIT") {
    2960           3 :                             Real64 spaceFrac = 1.0;
    2961           3 :                             if (thisITEqInput.numOfSpaces > 1) {
    2962           0 :                                 Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
    2963           0 :                                 if (zoneArea > 0.0) {
    2964           0 :                                     spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
    2965             :                                 } else {
    2966           0 :                                     ShowSevereError(
    2967             :                                         state,
    2968           0 :                                         format("{}Zone floor area is zero when allocating ElectricEquipment:ITE:AirCooled loads to Spaces.",
    2969             :                                                RoutineName));
    2970           0 :                                     ShowContinueError(state,
    2971           0 :                                                       format("Occurs for ElectricEquipment:ITE:AirCooled object ={} in Zone={}",
    2972           0 :                                                              thisITEqInput.Name,
    2973           0 :                                                              state.dataHeatBal->Zone(zoneNum).Name));
    2974           0 :                                     ErrorsFound = true;
    2975             :                                 }
    2976             :                             }
    2977           3 :                             thisZoneITEq.DesignTotalPower = IHGNumbers(1) * IHGNumbers(2) * spaceFrac;
    2978           3 :                             if (IHGNumericFieldBlanks(1)) {
    2979           0 :                                 ShowWarningError(state,
    2980           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 IT Equipment will result.",
    2981             :                                                         RoutineName,
    2982             :                                                         itEqModuleObject,
    2983             :                                                         IHGAlphas(1),
    2984             :                                                         IHGNumericFieldNames(1)));
    2985             :                             }
    2986           3 :                             if (IHGNumericFieldBlanks(2)) {
    2987           0 :                                 ShowWarningError(state,
    2988           0 :                                                  format("{}{}=\"{}\", specifies {}, but that field is blank.  0 IT Equipment will result.",
    2989             :                                                         RoutineName,
    2990             :                                                         itEqModuleObject,
    2991             :                                                         IHGAlphas(1),
    2992             :                                                         IHGNumericFieldNames(2)));
    2993             :                             }
    2994             : 
    2995           4 :                         } else if (equipmentLevel == "WATTS/AREA") {
    2996           4 :                             if (thisZoneITEq.ZonePtr != 0) {
    2997           4 :                                 if (IHGNumbers(3) >= 0.0) {
    2998           4 :                                     if (spaceNum > 0) {
    2999           4 :                                         thisZoneITEq.DesignTotalPower = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).FloorArea;
    3000           4 :                                         if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
    3001           0 :                                             !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
    3002           0 :                                             ShowWarningError(
    3003             :                                                 state,
    3004           0 :                                                 format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0.  0 IT Equipment will result.",
    3005             :                                                        RoutineName,
    3006             :                                                        itEqModuleObject,
    3007             :                                                        IHGAlphas(1),
    3008             :                                                        IHGNumericFieldNames(3)));
    3009             :                                         }
    3010             :                                     } else {
    3011           0 :                                         ShowSevereError(state,
    3012           0 :                                                         format("{}{}=\"{}\", invalid {}, value  [<0.0]={:.3R}",
    3013             :                                                                RoutineName,
    3014             :                                                                itEqModuleObject,
    3015             :                                                                IHGAlphas(1),
    3016             :                                                                IHGNumericFieldNames(3),
    3017             :                                                                IHGNumbers(3)));
    3018           0 :                                         ErrorsFound = true;
    3019             :                                     }
    3020             :                                 }
    3021           4 :                                 if (IHGNumericFieldBlanks(3)) {
    3022           0 :                                     ShowWarningError(state,
    3023           0 :                                                      format("{}{}=\"{}\", specifies {}, but that field is blank.  0 IT Equipment will result.",
    3024             :                                                             RoutineName,
    3025             :                                                             itEqModuleObject,
    3026             :                                                             IHGAlphas(1),
    3027             :                                                             IHGNumericFieldNames(3)));
    3028             :                                 }
    3029             : 
    3030             :                             } else {
    3031           0 :                                 ShowSevereError(state,
    3032           0 :                                                 format("{}{}=\"{}\", invalid {}, value  ={}",
    3033             :                                                        RoutineName,
    3034             :                                                        itEqModuleObject,
    3035             :                                                        IHGAlphas(1),
    3036             :                                                        IHGAlphaFieldNames(4),
    3037             :                                                        IHGAlphas(4)));
    3038           0 :                                 ShowContinueError(state, "...Valid values are \"Watts/Unit\" or \"Watts/Area\".");
    3039           0 :                                 ErrorsFound = true;
    3040             :                             }
    3041             :                         }
    3042             : 
    3043           7 :                         if (IHGAlphaFieldBlanks(5)) {
    3044           0 :                             thisZoneITEq.OperSchedPtr = ScheduleManager::ScheduleAlwaysOn;
    3045             :                         } else {
    3046           7 :                             thisZoneITEq.OperSchedPtr = GetScheduleIndex(state, IHGAlphas(5));
    3047             :                         }
    3048           7 :                         SchMin = 0.0;
    3049           7 :                         SchMax = 0.0;
    3050           7 :                         if (thisZoneITEq.OperSchedPtr == 0) {
    3051           0 :                             ShowSevereError(state,
    3052           0 :                                             format("{}{}=\"{}\", invalid {} entered={}",
    3053             :                                                    RoutineName,
    3054             :                                                    itEqModuleObject,
    3055             :                                                    IHGAlphas(1),
    3056             :                                                    IHGAlphaFieldNames(5),
    3057             :                                                    IHGAlphas(5)));
    3058           0 :                             ErrorsFound = true;
    3059             :                         } else { // check min/max on schedule
    3060           7 :                             SchMin = GetScheduleMinValue(state, thisZoneITEq.OperSchedPtr);
    3061           7 :                             SchMax = GetScheduleMaxValue(state, thisZoneITEq.OperSchedPtr);
    3062           7 :                             if (SchMin < 0.0 || SchMax < 0.0) {
    3063           0 :                                 if (SchMin < 0.0) {
    3064           0 :                                     ShowSevereError(
    3065             :                                         state,
    3066           0 :                                         format(
    3067             :                                             "{}{}=\"{}\", {}, minimum is < 0.0", RoutineName, itEqModuleObject, IHGAlphas(1), IHGAlphaFieldNames(5)));
    3068           0 :                                     ShowContinueError(state,
    3069           0 :                                                       format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(5), SchMin));
    3070           0 :                                     ErrorsFound = true;
    3071             :                                 }
    3072           0 :                                 if (SchMax < 0.0) {
    3073           0 :                                     ShowSevereError(
    3074             :                                         state,
    3075           0 :                                         format(
    3076             :                                             "{}{}=\"{}\", {}, maximum is < 0.0", RoutineName, itEqModuleObject, IHGAlphas(1), IHGAlphaFieldNames(5)));
    3077           0 :                                     ShowContinueError(state,
    3078           0 :                                                       format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(5), SchMax));
    3079           0 :                                     ErrorsFound = true;
    3080             :                                 }
    3081             :                             }
    3082             :                         }
    3083             : 
    3084           7 :                         if (IHGAlphaFieldBlanks(6)) {
    3085           0 :                             thisZoneITEq.CPULoadSchedPtr = ScheduleManager::ScheduleAlwaysOn;
    3086             :                         } else {
    3087           7 :                             thisZoneITEq.CPULoadSchedPtr = GetScheduleIndex(state, IHGAlphas(6));
    3088             :                         }
    3089           7 :                         SchMin = 0.0;
    3090           7 :                         SchMax = 0.0;
    3091           7 :                         if (thisZoneITEq.CPULoadSchedPtr == 0) {
    3092           0 :                             ShowSevereError(state,
    3093           0 :                                             format("{}{}=\"{}\", invalid {} entered={}",
    3094             :                                                    RoutineName,
    3095             :                                                    itEqModuleObject,
    3096             :                                                    IHGAlphas(1),
    3097             :                                                    IHGAlphaFieldNames(6),
    3098             :                                                    IHGAlphas(6)));
    3099           0 :                             ErrorsFound = true;
    3100             :                         } else { // check min/max on schedule
    3101           7 :                             SchMin = GetScheduleMinValue(state, thisZoneITEq.CPULoadSchedPtr);
    3102           7 :                             SchMax = GetScheduleMaxValue(state, thisZoneITEq.CPULoadSchedPtr);
    3103           7 :                             if (SchMin < 0.0 || SchMax < 0.0) {
    3104           0 :                                 if (SchMin < 0.0) {
    3105           0 :                                     ShowSevereError(
    3106             :                                         state,
    3107           0 :                                         format(
    3108             :                                             "{}{}=\"{}\", {}, minimum is < 0.0", RoutineName, itEqModuleObject, IHGAlphas(1), IHGAlphaFieldNames(6)));
    3109           0 :                                     ShowContinueError(state,
    3110           0 :                                                       format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(6), SchMin));
    3111           0 :                                     ErrorsFound = true;
    3112             :                                 }
    3113           0 :                                 if (SchMax < 0.0) {
    3114           0 :                                     ShowSevereError(
    3115             :                                         state,
    3116           0 :                                         format(
    3117             :                                             "{}{}=\"{}\", {}, maximum is < 0.0", RoutineName, itEqModuleObject, IHGAlphas(1), IHGAlphaFieldNames(6)));
    3118           0 :                                     ShowContinueError(state,
    3119           0 :                                                       format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(6), SchMax));
    3120           0 :                                     ErrorsFound = true;
    3121             :                                 }
    3122             :                             }
    3123             :                         }
    3124             : 
    3125             :                         // Calculate nominal min/max equipment level
    3126           7 :                         thisZoneITEq.NomMinDesignLevel = thisZoneITEq.DesignTotalPower * SchMin;
    3127           7 :                         thisZoneITEq.NomMaxDesignLevel = thisZoneITEq.DesignTotalPower * SchMax;
    3128             : 
    3129           7 :                         thisZoneITEq.DesignFanPowerFrac = IHGNumbers(4);
    3130           7 :                         thisZoneITEq.DesignFanPower = thisZoneITEq.DesignFanPowerFrac * thisZoneITEq.DesignTotalPower;
    3131           7 :                         thisZoneITEq.DesignCPUPower = (1.0 - thisZoneITEq.DesignFanPowerFrac) * thisZoneITEq.DesignTotalPower;
    3132           7 :                         thisZoneITEq.DesignAirVolFlowRate = IHGNumbers(5) * thisZoneITEq.DesignTotalPower;
    3133           7 :                         thisZoneITEq.DesignTAirIn = IHGNumbers(6);
    3134           7 :                         thisZoneITEq.DesignRecircFrac = IHGNumbers(7);
    3135           7 :                         thisZoneITEq.DesignUPSEfficiency = IHGNumbers(8);
    3136           7 :                         thisZoneITEq.UPSLossToZoneFrac = IHGNumbers(9);
    3137           7 :                         thisZoneITEq.SupplyApproachTemp = IHGNumbers(10);
    3138           7 :                         thisZoneITEq.ReturnApproachTemp = IHGNumbers(11);
    3139             : 
    3140           7 :                         bool hasSupplyApproachTemp = !IHGNumericFieldBlanks(10);
    3141           7 :                         bool hasReturnApproachTemp = !IHGNumericFieldBlanks(11);
    3142             : 
    3143             :                         // Performance curves
    3144           7 :                         thisZoneITEq.CPUPowerFLTCurve = GetCurveIndex(state, IHGAlphas(7));
    3145           7 :                         if (thisZoneITEq.CPUPowerFLTCurve == 0) {
    3146           0 :                             ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
    3147           0 :                             ShowContinueError(state, format("Invalid {}={}", IHGAlphaFieldNames(7), IHGAlphas(7)));
    3148           0 :                             ErrorsFound = true;
    3149             :                         }
    3150             : 
    3151           7 :                         thisZoneITEq.AirFlowFLTCurve = GetCurveIndex(state, IHGAlphas(8));
    3152           7 :                         if (thisZoneITEq.AirFlowFLTCurve == 0) {
    3153           0 :                             ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
    3154           0 :                             ShowContinueError(state, format("Invalid {}={}", IHGAlphaFieldNames(8), IHGAlphas(8)));
    3155           0 :                             ErrorsFound = true;
    3156             :                         }
    3157             : 
    3158           7 :                         thisZoneITEq.FanPowerFFCurve = GetCurveIndex(state, IHGAlphas(9));
    3159           7 :                         if (thisZoneITEq.FanPowerFFCurve == 0) {
    3160           0 :                             ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
    3161           0 :                             ShowContinueError(state, format("Invalid {}={}", IHGAlphaFieldNames(9), IHGAlphas(9)));
    3162           0 :                             ErrorsFound = true;
    3163             :                         }
    3164             : 
    3165           7 :                         if (!IHGAlphaFieldBlanks(15)) {
    3166             :                             // If this field isn't blank, it must point to a valid curve
    3167           7 :                             thisZoneITEq.RecircFLTCurve = GetCurveIndex(state, IHGAlphas(15));
    3168           7 :                             if (thisZoneITEq.RecircFLTCurve == 0) {
    3169           0 :                                 ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
    3170           0 :                                 ShowContinueError(state, format("Invalid {}={}", IHGAlphaFieldNames(15), IHGAlphas(15)));
    3171           0 :                                 ErrorsFound = true;
    3172             :                             }
    3173             :                         } else {
    3174             :                             // If this curve is left blank, then the curve is assumed to always equal 1.0.
    3175           0 :                             thisZoneITEq.RecircFLTCurve = 0;
    3176             :                         }
    3177             : 
    3178           7 :                         if (!IHGAlphaFieldBlanks(16)) {
    3179             :                             // If this field isn't blank, it must point to a valid curve
    3180           7 :                             thisZoneITEq.UPSEfficFPLRCurve = GetCurveIndex(state, IHGAlphas(16));
    3181           7 :                             if (thisZoneITEq.UPSEfficFPLRCurve == 0) {
    3182           0 :                                 ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
    3183           0 :                                 ShowContinueError(state, format("Invalid {}={}", IHGAlphaFieldNames(16), IHGAlphas(16)));
    3184           0 :                                 ErrorsFound = true;
    3185             :                             }
    3186             :                         } else {
    3187             :                             // If this curve is left blank, then the curve is assumed to always equal 1.0.
    3188           0 :                             thisZoneITEq.UPSEfficFPLRCurve = 0;
    3189             :                         }
    3190             : 
    3191             :                         // Environmental class
    3192           7 :                         thisZoneITEq.Class = static_cast<ITEClass>(getEnumValue(ITEClassNamesUC, Util::makeUPPER(IHGAlphas(10))));
    3193           7 :                         ErrorsFound = ErrorsFound || (thisZoneITEq.Class == ITEClass::Invalid);
    3194             : 
    3195             :                         // Air and supply inlet connections
    3196           7 :                         thisZoneITEq.AirConnectionType =
    3197           7 :                             static_cast<ITEInletConnection>(getEnumValue(ITEInletConnectionNamesUC, Util::makeUPPER(IHGAlphas(11))));
    3198           7 :                         if (thisZoneITEq.AirConnectionType == ITEInletConnection::RoomAirModel) {
    3199             :                             // ZoneITEq(Loop).AirConnectionType = ITEInletConnection::RoomAirModel;
    3200           0 :                             ShowWarningError(state,
    3201           0 :                                              format("{}{}=\"{}Air Inlet Connection Type = RoomAirModel is not implemented yet, using ZoneAirNode",
    3202             :                                                     RoutineName,
    3203             :                                                     itEqModuleObject,
    3204             :                                                     IHGAlphas(1)));
    3205           0 :                             thisZoneITEq.AirConnectionType = ITEInletConnection::ZoneAirNode;
    3206             :                         }
    3207           7 :                         ErrorsFound = ErrorsFound || (thisZoneITEq.AirConnectionType == ITEInletConnection::Invalid);
    3208             : 
    3209           7 :                         if (IHGAlphaFieldBlanks(14)) {
    3210           0 :                             if (thisZoneITEq.AirConnectionType == ITEInletConnection::AdjustedSupply) {
    3211           0 :                                 ShowSevereError(state, format("{}{}: {}", RoutineName, itEqModuleObject, IHGAlphas(1)));
    3212           0 :                                 ShowContinueError(state,
    3213           0 :                                                   format("For {}= AdjustedSupply, {} is required, but this field is blank.",
    3214             :                                                          IHGAlphaFieldNames(11),
    3215             :                                                          IHGAlphaFieldNames(14)));
    3216           0 :                                 ErrorsFound = true;
    3217           0 :                             } else if (thisZoneITEq.FlowControlWithApproachTemps) {
    3218           0 :                                 ShowSevereError(state, format("{}{}: {}", RoutineName, itEqModuleObject, IHGAlphas(1)));
    3219           0 :                                 ShowContinueError(state,
    3220           0 :                                                   format("For {}= FlowControlWithApproachTemperatures, {} is required, but this field is blank.",
    3221             :                                                          IHGAlphaFieldNames(3),
    3222             :                                                          IHGAlphaFieldNames(14)));
    3223           0 :                                 ErrorsFound = true;
    3224             :                             }
    3225             :                         } else {
    3226          14 :                             thisZoneITEq.SupplyAirNodeNum = GetOnlySingleNode(state,
    3227           7 :                                                                               IHGAlphas(14),
    3228             :                                                                               ErrorsFound,
    3229             :                                                                               DataLoopNode::ConnectionObjectType::ElectricEquipmentITEAirCooled,
    3230           7 :                                                                               IHGAlphas(1),
    3231             :                                                                               DataLoopNode::NodeFluidType::Air,
    3232             :                                                                               DataLoopNode::ConnectionType::Sensor,
    3233             :                                                                               NodeInputManager::CompFluidStream::Primary,
    3234             :                                                                               ObjectIsNotParent);
    3235             :                         }
    3236             : 
    3237             :                         // check supply air node for matches with zone equipment supply air node
    3238           7 :                         int zoneEqIndex = DataZoneEquipment::GetControlledZoneIndex(state, state.dataHeatBal->Zone(thisZoneITEq.ZonePtr).Name);
    3239           7 :                         if (zoneEqIndex > 0) { // zoneEqIndex could be zero in the case of an uncontrolled zone
    3240           7 :                             auto itStart = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.begin();
    3241           7 :                             auto itEnd = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.end();
    3242           7 :                             int key = thisZoneITEq.SupplyAirNodeNum;
    3243           7 :                             thisZoneITEq.inControlledZone = true;
    3244           7 :                             bool supplyNodeFound = false;
    3245           7 :                             if (std::find(itStart, itEnd, key) != itEnd) {
    3246           7 :                                 supplyNodeFound = true;
    3247             :                             }
    3248             : 
    3249           7 :                             if (thisZoneITEq.AirConnectionType == ITEInletConnection::AdjustedSupply && !supplyNodeFound) {
    3250             :                                 // supply air node must match zone equipment supply air node for these conditions
    3251           0 :                                 ShowSevereError(state, format("{}: ElectricEquipment:ITE:AirCooled {}", RoutineName, thisZoneITEq.Name));
    3252           0 :                                 ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified.");
    3253           0 :                                 ErrorsFound = true;
    3254           7 :                             } else if (thisZoneITEq.FlowControlWithApproachTemps && !supplyNodeFound) {
    3255             :                                 // supply air node must match zone equipment supply air node for these conditions
    3256           0 :                                 ShowSevereError(state, format("{}: ElectricEquipment:ITE:AirCooled {}", RoutineName, thisZoneITEq.Name));
    3257           0 :                                 ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified.");
    3258           0 :                                 ErrorsFound = true;
    3259           7 :                             } else if (thisZoneITEq.SupplyAirNodeNum != 0 && !supplyNodeFound) {
    3260             :                                 // the given supply air node does not match any zone equipment supply air nodes
    3261           0 :                                 ShowWarningError(
    3262             :                                     state,
    3263           0 :                                     format("{}name: '{}. Supply Air Node Name '{}' does not match any ZoneHVAC:EquipmentConnections objects.",
    3264             :                                            itEqModuleObject,
    3265             :                                            IHGAlphas(1),
    3266             :                                            IHGAlphas(14)));
    3267             :                             }
    3268             :                         } // end of if block for zoneEqIndex > 0
    3269             : 
    3270             :                         // End-Use subcategories
    3271           7 :                         if (IHGNumAlphas > 16) {
    3272           7 :                             thisZoneITEq.EndUseSubcategoryCPU = IHGAlphas(17);
    3273             :                         } else {
    3274           0 :                             thisZoneITEq.EndUseSubcategoryCPU = "ITE-CPU";
    3275             :                         }
    3276             : 
    3277           7 :                         if (IHGNumAlphas > 17) {
    3278           7 :                             thisZoneITEq.EndUseSubcategoryFan = IHGAlphas(18);
    3279             :                         } else {
    3280           0 :                             thisZoneITEq.EndUseSubcategoryFan = "ITE-Fans";
    3281             :                         }
    3282           7 :                         if (thisZoneITEq.ZonePtr <= 0) continue; // Error, will be caught and terminated later
    3283             : 
    3284           7 :                         if (IHGNumAlphas > 18) {
    3285           7 :                             thisZoneITEq.EndUseSubcategoryUPS = IHGAlphas(19);
    3286             :                         } else {
    3287           0 :                             thisZoneITEq.EndUseSubcategoryUPS = "ITE-UPS";
    3288             :                         }
    3289           7 :                         if (thisZoneITEq.FlowControlWithApproachTemps) {
    3290           4 :                             if (!IHGAlphaFieldBlanks(20)) {
    3291           0 :                                 thisZoneITEq.SupplyApproachTempSch = GetScheduleIndex(state, IHGAlphas(20));
    3292           0 :                                 if (thisZoneITEq.SupplyApproachTempSch == 0) {
    3293           0 :                                     ShowSevereError(state,
    3294           0 :                                                     format("{}{}=\"{}\", invalid {} entered={}",
    3295             :                                                            RoutineName,
    3296             :                                                            itEqModuleObject,
    3297             :                                                            IHGAlphas(1),
    3298             :                                                            IHGAlphaFieldNames(20),
    3299             :                                                            IHGAlphas(20)));
    3300           0 :                                     ErrorsFound = true;
    3301             :                                 }
    3302             :                             } else {
    3303           4 :                                 if (!hasSupplyApproachTemp) {
    3304           0 :                                     ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
    3305           0 :                                     ShowContinueError(
    3306             :                                         state,
    3307           0 :                                         format("For {}= FlowControlWithApproachTemperatures, either {} or {} is required, but both are left blank.",
    3308             :                                                IHGAlphaFieldNames(3),
    3309             :                                                IHGNumericFieldNames(10),
    3310             :                                                IHGAlphaFieldNames(20)));
    3311           0 :                                     ErrorsFound = true;
    3312             :                                 }
    3313             :                             }
    3314             : 
    3315           4 :                             if (!IHGAlphaFieldBlanks(21)) {
    3316           0 :                                 thisZoneITEq.ReturnApproachTempSch = GetScheduleIndex(state, IHGAlphas(21));
    3317           0 :                                 if (thisZoneITEq.ReturnApproachTempSch == 0) {
    3318           0 :                                     ShowSevereError(state,
    3319           0 :                                                     format("{}{}=\"{}\", invalid {} entered={}",
    3320             :                                                            RoutineName,
    3321             :                                                            itEqModuleObject,
    3322             :                                                            IHGAlphas(1),
    3323             :                                                            IHGAlphaFieldNames(20),
    3324             :                                                            IHGAlphas(20)));
    3325           0 :                                     ErrorsFound = true;
    3326             :                                 }
    3327             :                             } else {
    3328           4 :                                 if (!hasReturnApproachTemp) {
    3329           0 :                                     ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
    3330           0 :                                     ShowContinueError(
    3331             :                                         state,
    3332           0 :                                         format("For {}= FlowControlWithApproachTemperatures, either {} or {} is required, but both are left blank.",
    3333             :                                                IHGAlphaFieldNames(3),
    3334             :                                                IHGNumericFieldNames(11),
    3335             :                                                IHGAlphaFieldNames(21)));
    3336           0 :                                     ErrorsFound = true;
    3337             :                                 }
    3338             :                             }
    3339             :                         }
    3340             : 
    3341           7 :                         if (thisZoneITEq.FlowControlWithApproachTemps) {
    3342           4 :                             Real64 TAirInSizing = 0.0;
    3343             :                             // Set the TAirInSizing to the maximun setpoint value to do sizing based on the maximum fan and cpu power of the ite
    3344             :                             // object
    3345           4 :                             SetPointManager::GetSetPointManagerInputs(state);
    3346          20 :                             for (auto *spm : state.dataSetPointManager->spms) {
    3347          16 :                                 if (spm->type != SetPointManager::SPMType::SZCooling) continue;
    3348           4 :                                 auto *spmSZC = dynamic_cast<SetPointManager::SPMSingleZoneTemp *>(spm);
    3349           4 :                                 assert(spmSZC != nullptr);
    3350           4 :                                 if (spmSZC->ctrlZoneNum == zoneNum) {
    3351           2 :                                     TAirInSizing = spmSZC->maxSetTemp;
    3352             :                                 }
    3353             :                             }
    3354             : 
    3355           4 :                             thisZoneITEq.SizingTAirIn = max(TAirInSizing, thisZoneITEq.DesignTAirIn);
    3356             :                         }
    3357             : 
    3358             :                         // MJW - EMS Not in place yet
    3359             :                         // if ( AnyEnergyManagementSystemInModel ) {
    3360             :                         // SetupEMSActuator( "ElectricEquipment", ZoneITEq( Loop ).Name, "Electric Power Level", "[W]", ZoneITEq( Loop
    3361             :                         // ).EMSZoneEquipOverrideOn, ZoneITEq( Loop ).EMSEquipPower ); SetupEMSInternalVariable( "Plug and Process Power Design
    3362             :                         // Level", ZoneITEq( Loop ).Name, "[W]", ZoneITEq( Loop ).DesignTotalPower ); } // EMS
    3363             : 
    3364           7 :                         if (!ErrorsFound)
    3365           7 :                             SetupSpaceInternalGain(state,
    3366             :                                                    thisZoneITEq.spaceIndex,
    3367             :                                                    1.0,
    3368             :                                                    thisZoneITEq.Name,
    3369             :                                                    DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled,
    3370           7 :                                                    &thisZoneITEq.PowerRpt[(int)PERptVars::ConGainToZone]);
    3371             :                     }
    3372             :                 } // for itEqInputNum.NumOfSpaces
    3373             :             }     // for itEqInputNum
    3374          12 :             for (int Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) {
    3375          11 :                 if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE &&
    3376           4 :                     (!state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps)) {
    3377           0 :                     ShowSevereError(state,
    3378           0 :                                     format("{}{}=\"{}\": invalid calculation method {} for Zone: {}",
    3379             :                                            RoutineName,
    3380             :                                            itEqModuleObject,
    3381             :                                            IHGAlphas(1),
    3382             :                                            IHGAlphas(3),
    3383             :                                            IHGAlphas(2)));
    3384           0 :                     ShowContinueError(state, "...Multiple flow control methods apply to one zone. ");
    3385           0 :                     ErrorsFound = true;
    3386             :                 }
    3387             :             }
    3388             :         } // TotITEquip > 0
    3389             : 
    3390             :         // ZoneBaseboard:OutdoorTemperatureControlled
    3391        1592 :         EPVector<InternalHeatGains::GlobalInternalGainMiscObject> zoneBBHeatObjects;
    3392         796 :         int numZoneBBHeatStatements = 0;
    3393         796 :         setupIHGZonesAndSpaces(state, bbModuleObject, zoneBBHeatObjects, numZoneBBHeatStatements, state.dataHeatBal->TotBBHeat, ErrorsFound);
    3394             : 
    3395         796 :         if (state.dataHeatBal->TotBBHeat > 0) {
    3396           3 :             state.dataHeatBal->ZoneBBHeat.allocate(state.dataHeatBal->TotBBHeat);
    3397           3 :             int bbHeatNum = 0;
    3398           6 :             for (int bbHeatInputNum = 1; bbHeatInputNum <= numZoneBBHeatStatements; ++bbHeatInputNum) {
    3399           3 :                 state.dataInputProcessing->inputProcessor->getObjectItem(state,
    3400             :                                                                          bbModuleObject,
    3401             :                                                                          bbHeatInputNum,
    3402             :                                                                          IHGAlphas,
    3403             :                                                                          IHGNumAlphas,
    3404             :                                                                          IHGNumbers,
    3405             :                                                                          IHGNumNumbers,
    3406             :                                                                          IOStat,
    3407             :                                                                          IHGNumericFieldBlanks,
    3408             :                                                                          IHGAlphaFieldBlanks,
    3409             :                                                                          IHGAlphaFieldNames,
    3410             :                                                                          IHGNumericFieldNames);
    3411             : 
    3412           3 :                 auto &thisBBHeatInput = zoneBBHeatObjects(bbHeatInputNum);
    3413           6 :                 for (int Item1 = 1; Item1 <= thisBBHeatInput.numOfSpaces; ++Item1) {
    3414           3 :                     ++bbHeatNum;
    3415           3 :                     auto &thisZoneBBHeat = state.dataHeatBal->ZoneBBHeat(bbHeatNum);
    3416           3 :                     int const spaceNum = thisBBHeatInput.spaceNums(Item1);
    3417           3 :                     int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
    3418           3 :                     thisZoneBBHeat.Name = thisBBHeatInput.names(Item1);
    3419           3 :                     thisZoneBBHeat.spaceIndex = spaceNum;
    3420           3 :                     thisZoneBBHeat.ZonePtr = zoneNum;
    3421             : 
    3422           3 :                     thisZoneBBHeat.SchedPtr = GetScheduleIndex(state, IHGAlphas(3));
    3423           3 :                     if (thisZoneBBHeat.SchedPtr == 0) {
    3424           0 :                         if (IHGAlphaFieldBlanks(3)) {
    3425           0 :                             ShowSevereError(
    3426             :                                 state,
    3427           0 :                                 format("{}{}=\"{}\", {} is required.", RoutineName, bbModuleObject, thisBBHeatInput.Name, IHGAlphaFieldNames(3)));
    3428             :                         } else {
    3429           0 :                             ShowSevereError(state,
    3430           0 :                                             format("{}{}=\"{}\", invalid {} entered={}",
    3431             :                                                    RoutineName,
    3432             :                                                    bbModuleObject,
    3433           0 :                                                    thisBBHeatInput.Name,
    3434             :                                                    IHGAlphaFieldNames(3),
    3435             :                                                    IHGAlphas(3)));
    3436             :                         }
    3437           0 :                         ErrorsFound = true;
    3438             :                     } else { // check min/max on schedule
    3439           3 :                         SchMin = GetScheduleMinValue(state, thisZoneBBHeat.SchedPtr);
    3440           3 :                         SchMax = GetScheduleMaxValue(state, thisZoneBBHeat.SchedPtr);
    3441           3 :                         if (SchMin < 0.0 || SchMax < 0.0) {
    3442           0 :                             if (SchMin < 0.0) {
    3443           0 :                                 ShowSevereError(state,
    3444           0 :                                                 format("{}{}=\"{}\", {}, minimum is < 0.0",
    3445             :                                                        RoutineName,
    3446             :                                                        bbModuleObject,
    3447           0 :                                                        thisBBHeatInput.Name,
    3448             :                                                        IHGAlphaFieldNames(3)));
    3449           0 :                                 ShowContinueError(state,
    3450           0 :                                                   format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMin));
    3451           0 :                                 ErrorsFound = true;
    3452             :                             }
    3453           0 :                             if (SchMax < 0.0) {
    3454           0 :                                 ShowSevereError(state,
    3455           0 :                                                 format("{}{}=\"{}\", {}, maximum is < 0.0",
    3456             :                                                        RoutineName,
    3457             :                                                        bbModuleObject,
    3458           0 :                                                        thisBBHeatInput.Name,
    3459             :                                                        IHGAlphaFieldNames(3)));
    3460           0 :                                 ShowContinueError(state,
    3461           0 :                                                   format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMax));
    3462           0 :                                 ErrorsFound = true;
    3463             :                             }
    3464             :                         }
    3465             :                     }
    3466             : 
    3467           3 :                     if (IHGNumAlphas > 3) {
    3468           3 :                         thisZoneBBHeat.EndUseSubcategory = IHGAlphas(4);
    3469             :                     } else {
    3470           0 :                         thisZoneBBHeat.EndUseSubcategory = "General";
    3471             :                     }
    3472             : 
    3473           3 :                     Real64 spaceFrac = 1.0;
    3474           3 :                     if (thisBBHeatInput.numOfSpaces > 1) {
    3475           0 :                         Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
    3476           0 :                         if (zoneArea > 0.0) {
    3477           0 :                             spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
    3478             :                         } else {
    3479           0 :                             ShowSevereError(
    3480             :                                 state,
    3481           0 :                                 format("{}Zone floor area is zero when allocating ZoneBaseboard:OutdoorTemperatureControlled loads to Spaces.",
    3482             :                                        RoutineName));
    3483           0 :                             ShowContinueError(state,
    3484           0 :                                               format("Occurs for ZoneBaseboard:OutdoorTemperatureControlled object ={} in Zone={}",
    3485           0 :                                                      thisBBHeatInput.Name,
    3486           0 :                                                      state.dataHeatBal->Zone(zoneNum).Name));
    3487           0 :                             ErrorsFound = true;
    3488             :                         }
    3489             :                     }
    3490           3 :                     thisZoneBBHeat.CapatLowTemperature = IHGNumbers(1) * spaceFrac;
    3491           3 :                     thisZoneBBHeat.LowTemperature = IHGNumbers(2);
    3492           3 :                     thisZoneBBHeat.CapatHighTemperature = IHGNumbers(3) * spaceFrac;
    3493           3 :                     thisZoneBBHeat.HighTemperature = IHGNumbers(4);
    3494           3 :                     thisZoneBBHeat.FractionRadiant = IHGNumbers(5);
    3495           3 :                     thisZoneBBHeat.FractionConvected = 1.0 - thisZoneBBHeat.FractionRadiant;
    3496           3 :                     if (thisZoneBBHeat.FractionConvected < 0.0) {
    3497           0 :                         ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, bbModuleObject, thisBBHeatInput.Name));
    3498           0 :                         ErrorsFound = true;
    3499             :                     }
    3500             : 
    3501           3 :                     if (thisZoneBBHeat.ZonePtr <= 0) continue; // Error, will be caught and terminated later
    3502             : 
    3503           3 :                     if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
    3504           0 :                         SetupEMSActuator(state,
    3505             :                                          "ZoneBaseboard:OutdoorTemperatureControlled",
    3506             :                                          thisZoneBBHeat.Name,
    3507             :                                          "Power Level",
    3508             :                                          "[W]",
    3509           0 :                                          thisZoneBBHeat.EMSZoneBaseboardOverrideOn,
    3510           0 :                                          thisZoneBBHeat.EMSZoneBaseboardPower);
    3511           0 :                         SetupEMSInternalVariable(state,
    3512             :                                                  "Simple Zone Baseboard Capacity At Low Temperature",
    3513             :                                                  thisZoneBBHeat.Name,
    3514             :                                                  "[W]",
    3515           0 :                                                  thisZoneBBHeat.CapatLowTemperature);
    3516           0 :                         SetupEMSInternalVariable(state,
    3517             :                                                  "Simple Zone Baseboard Capacity At High Temperature",
    3518             :                                                  thisZoneBBHeat.Name,
    3519             :                                                  "[W]",
    3520           0 :                                                  thisZoneBBHeat.CapatHighTemperature);
    3521             :                     } // EMS
    3522             : 
    3523           3 :                     SetupSpaceInternalGain(state,
    3524             :                                            thisZoneBBHeat.spaceIndex,
    3525             :                                            1.0,
    3526             :                                            thisZoneBBHeat.Name,
    3527             :                                            DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled,
    3528             :                                            &thisZoneBBHeat.ConGainRate,
    3529             :                                            nullptr,
    3530             :                                            &thisZoneBBHeat.RadGainRate);
    3531             :                 } // for bbHeatInputNum.NumOfSpaces
    3532             :             }     // for bbHeatInputNum
    3533             :         }         // TotBBHeat > 0
    3534             : 
    3535         796 :         state.dataHeatBal->TotCO2Gen = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, contamSSModuleObject);
    3536         796 :         state.dataHeatBal->ZoneCO2Gen.allocate(state.dataHeatBal->TotCO2Gen);
    3537             : 
    3538         801 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) {
    3539           5 :             IHGAlphas = "";
    3540           5 :             IHGNumbers = 0.0;
    3541           5 :             state.dataInputProcessing->inputProcessor->getObjectItem(state,
    3542             :                                                                      contamSSModuleObject,
    3543             :                                                                      Loop,
    3544             :                                                                      IHGAlphas,
    3545             :                                                                      IHGNumAlphas,
    3546             :                                                                      IHGNumbers,
    3547             :                                                                      IHGNumNumbers,
    3548             :                                                                      IOStat,
    3549             :                                                                      IHGNumericFieldBlanks,
    3550             :                                                                      IHGAlphaFieldBlanks,
    3551             :                                                                      IHGAlphaFieldNames,
    3552             :                                                                      IHGNumericFieldNames);
    3553           5 :             Util::IsNameEmpty(state, IHGAlphas(1), contamSSModuleObject, ErrorsFound);
    3554             : 
    3555           5 :             state.dataHeatBal->ZoneCO2Gen(Loop).Name = IHGAlphas(1);
    3556             : 
    3557           5 :             state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr = Util::FindItemInList(IHGAlphas(2), state.dataHeatBal->Zone);
    3558           5 :             if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr == 0) {
    3559           0 :                 ShowSevereError(
    3560             :                     state,
    3561           0 :                     format(
    3562             :                         "{}{}=\"{}\", invalid {} entered={}", RoutineName, contamSSModuleObject, IHGAlphas(1), IHGAlphaFieldNames(2), IHGAlphas(2)));
    3563           0 :                 ErrorsFound = true;
    3564             :             }
    3565             : 
    3566           5 :             state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr = GetScheduleIndex(state, IHGAlphas(3));
    3567           5 :             if (state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr == 0) {
    3568           0 :                 if (IHGAlphaFieldBlanks(3)) {
    3569           0 :                     ShowSevereError(state,
    3570           0 :                                     format("{}{}=\"{}\", {} is required.", RoutineName, contamSSModuleObject, IHGAlphas(1), IHGAlphaFieldNames(3)));
    3571             :                 } else {
    3572           0 :                     ShowSevereError(state,
    3573           0 :                                     format("{}{}=\"{}\", invalid {} entered={}",
    3574             :                                            RoutineName,
    3575             :                                            contamSSModuleObject,
    3576             :                                            IHGAlphas(1),
    3577             :                                            IHGAlphaFieldNames(3),
    3578             :                                            IHGAlphas(3)));
    3579             :                 }
    3580           0 :                 ErrorsFound = true;
    3581             :             } else { // check min/max on schedule
    3582           5 :                 SchMin = GetScheduleMinValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr);
    3583           5 :                 SchMax = GetScheduleMaxValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr);
    3584           5 :                 if (SchMin < 0.0 || SchMax < 0.0) {
    3585           0 :                     if (SchMin < 0.0) {
    3586           0 :                         ShowSevereError(
    3587             :                             state,
    3588           0 :                             format("{}{}=\"{}\", {}, minimum is < 0.0", RoutineName, contamSSModuleObject, IHGAlphas(1), IHGAlphaFieldNames(3)));
    3589           0 :                         ShowContinueError(state, format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMin));
    3590           0 :                         ErrorsFound = true;
    3591             :                     }
    3592           0 :                     if (SchMax < 0.0) {
    3593           0 :                         ShowSevereError(
    3594             :                             state,
    3595           0 :                             format("{}{}=\"{}\", {}, maximum is < 0.0", RoutineName, contamSSModuleObject, IHGAlphas(1), IHGAlphaFieldNames(3)));
    3596           0 :                         ShowContinueError(state, format("Schedule=\"{}\". Maximum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMax));
    3597           0 :                         ErrorsFound = true;
    3598             :                     }
    3599             :                 }
    3600             :             }
    3601             : 
    3602           5 :             state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate = IHGNumbers(1);
    3603             : 
    3604           5 :             if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later
    3605             : 
    3606             :             // Object report variables
    3607          10 :             SetupOutputVariable(state,
    3608             :                                 "Contaminant Source or Sink CO2 Gain Volume Flow Rate",
    3609             :                                 Constant::Units::m3_s,
    3610           5 :                                 state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate,
    3611             :                                 OutputProcessor::TimeStepType::Zone,
    3612             :                                 OutputProcessor::StoreType::Average,
    3613           5 :                                 state.dataHeatBal->ZoneCO2Gen(Loop).Name);
    3614             : 
    3615             :             // Zone total report variables
    3616           5 :             if (RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr)) {
    3617           5 :                 RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr) = false;
    3618             : 
    3619          10 :                 SetupOutputVariable(state,
    3620             :                                     "Zone Contaminant Source or Sink CO2 Gain Volume Flow Rate",
    3621             :                                     Constant::Units::m3_s,
    3622           5 :                                     state.dataHeatBal->ZoneRpt(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).CO2Rate,
    3623             :                                     OutputProcessor::TimeStepType::Zone,
    3624             :                                     OutputProcessor::StoreType::Average,
    3625           5 :                                     state.dataHeatBal->Zone(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).Name);
    3626             :             }
    3627             : 
    3628          15 :             SetupZoneInternalGain(state,
    3629           5 :                                   state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr,
    3630           5 :                                   state.dataHeatBal->ZoneCO2Gen(Loop).Name,
    3631             :                                   DataHeatBalance::IntGainType::ZoneContaminantSourceAndSinkCarbonDioxide,
    3632             :                                   nullptr,
    3633             :                                   nullptr,
    3634             :                                   nullptr,
    3635             :                                   nullptr,
    3636             :                                   nullptr,
    3637           5 :                                   &state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate);
    3638             :         }
    3639             : 
    3640         796 :         RepVarSet.deallocate();
    3641             : 
    3642         796 :         if (ErrorsFound) {
    3643           0 :             ShowFatalError(state, format("{}Errors found in Getting Internal Gains Input, Program Stopped", RoutineName));
    3644             :         }
    3645             : 
    3646         796 :         setupIHGOutputs(state);
    3647             : 
    3648             :         static constexpr std::string_view Format_721(
    3649             :             "! <Zone Internal Gains Nominal>,Zone Name, Floor Area {{m2}},# Occupants,Area per Occupant "
    3650             :             "{{m2/person}},Occupant per Area {{person/m2}},Interior Lighting {{W/m2}},Electric Load {{W/m2}},Gas Load {{W/m2}},Other "
    3651             :             "Load {{W/m2}},Hot Water Eq {{W/m2}},Steam Equipment {{W/m2}},Sum Loads per Area {{W/m2}},Outdoor Controlled Baseboard "
    3652             :             "Heat\n");
    3653             : 
    3654         796 :         print(state.files.eio, Format_721);
    3655        5852 :         for (int Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) {
    3656        5056 :             LightTot = 0.0;
    3657        5056 :             ElecTot = 0.0;
    3658        5056 :             GasTot = 0.0;
    3659        5056 :             OthTot = 0.0;
    3660        5056 :             HWETot = 0.0;
    3661        5056 :             StmTot = 0.0;
    3662        5056 :             BBHeatInd = "No";
    3663      146422 :             for (int Loop1 = 1; Loop1 <= state.dataHeatBal->TotLights; ++Loop1) {
    3664      141366 :                 if (state.dataHeatBal->Lights(Loop1).ZonePtr != Loop) continue;
    3665        4329 :                 LightTot += state.dataHeatBal->Lights(Loop1).DesignLevel;
    3666             :             }
    3667      136923 :             for (int Loop1 = 1; Loop1 <= state.dataHeatBal->TotElecEquip; ++Loop1) {
    3668      131867 :                 if (state.dataHeatBal->ZoneElectric(Loop1).ZonePtr != Loop) continue;
    3669        4399 :                 ElecTot += state.dataHeatBal->ZoneElectric(Loop1).DesignLevel;
    3670             :             }
    3671        5075 :             for (int Loop1 = 1; Loop1 <= state.dataHeatBal->TotITEquip; ++Loop1) {
    3672          19 :                 if (state.dataHeatBal->ZoneITEq(Loop1).ZonePtr != Loop) continue;
    3673           7 :                 ElecTot += state.dataHeatBal->ZoneITEq(Loop1).DesignTotalPower;
    3674             :             }
    3675        7692 :             for (int Loop1 = 1; Loop1 <= state.dataHeatBal->TotGasEquip; ++Loop1) {
    3676        2636 :                 if (state.dataHeatBal->ZoneGas(Loop1).ZonePtr != Loop) continue;
    3677          79 :                 GasTot += state.dataHeatBal->ZoneGas(Loop1).DesignLevel;
    3678             :             }
    3679        5231 :             for (int Loop1 = 1; Loop1 <= state.dataHeatBal->TotOthEquip; ++Loop1) {
    3680         175 :                 if (state.dataHeatBal->ZoneOtherEq(Loop1).ZonePtr != Loop) continue;
    3681          69 :                 OthTot += state.dataHeatBal->ZoneOtherEq(Loop1).DesignLevel;
    3682             :             }
    3683        5086 :             for (int Loop1 = 1; Loop1 <= state.dataHeatBal->TotStmEquip; ++Loop1) {
    3684          30 :                 if (state.dataHeatBal->ZoneSteamEq(Loop1).ZonePtr != Loop) continue;
    3685           5 :                 StmTot += state.dataHeatBal->ZoneSteamEq(Loop1).DesignLevel;
    3686             :             }
    3687        5167 :             for (int Loop1 = 1; Loop1 <= state.dataHeatBal->TotHWEquip; ++Loop1) {
    3688         111 :                 if (state.dataHeatBal->ZoneHWEq(Loop1).ZonePtr != Loop) continue;
    3689          14 :                 HWETot += state.dataHeatBal->ZoneHWEq(Loop1).DesignLevel;
    3690             :             }
    3691        5074 :             for (int Loop1 = 1; Loop1 <= state.dataHeatBal->TotBBHeat; ++Loop1) {
    3692          18 :                 if (state.dataHeatBal->ZoneBBHeat(Loop1).ZonePtr != Loop) continue;
    3693           3 :                 BBHeatInd = "Yes";
    3694             :             }
    3695        5056 :             state.dataHeatBal->Zone(Loop).InternalHeatGains = LightTot + ElecTot + GasTot + OthTot + HWETot + StmTot;
    3696        5056 :             if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) {
    3697        5054 :                 print(state.files.eio,
    3698             :                       Format_720,
    3699        5054 :                       state.dataHeatBal->Zone(Loop).Name,
    3700        5054 :                       state.dataHeatBal->Zone(Loop).FloorArea,
    3701        5054 :                       state.dataHeatBal->Zone(Loop).TotOccupants);
    3702        5054 :                 print_and_divide_if_greater_than_zero(state.dataHeatBal->Zone(Loop).FloorArea, state.dataHeatBal->Zone(Loop).TotOccupants);
    3703        5054 :                 print(state.files.eio, "{:.3R},", state.dataHeatBal->Zone(Loop).TotOccupants / state.dataHeatBal->Zone(Loop).FloorArea);
    3704        5054 :                 print(state.files.eio, "{:.3R},", LightTot / state.dataHeatBal->Zone(Loop).FloorArea);
    3705        5054 :                 print(state.files.eio, "{:.3R},", ElecTot / state.dataHeatBal->Zone(Loop).FloorArea);
    3706        5054 :                 print(state.files.eio, "{:.3R},", GasTot / state.dataHeatBal->Zone(Loop).FloorArea);
    3707        5054 :                 print(state.files.eio, "{:.3R},", OthTot / state.dataHeatBal->Zone(Loop).FloorArea);
    3708        5054 :                 print(state.files.eio, "{:.3R},", HWETot / state.dataHeatBal->Zone(Loop).FloorArea);
    3709        5054 :                 print(state.files.eio, "{:.3R},", StmTot / state.dataHeatBal->Zone(Loop).FloorArea);
    3710        5054 :                 print(state.files.eio,
    3711             :                       "{:.3R},{}\n",
    3712       10108 :                       state.dataHeatBal->Zone(Loop).InternalHeatGains / state.dataHeatBal->Zone(Loop).FloorArea,
    3713             :                       BBHeatInd);
    3714             :             } else {
    3715           2 :                 print(state.files.eio,
    3716             :                       Format_720,
    3717           2 :                       state.dataHeatBal->Zone(Loop).Name,
    3718           2 :                       state.dataHeatBal->Zone(Loop).FloorArea,
    3719           2 :                       state.dataHeatBal->Zone(Loop).TotOccupants);
    3720           2 :                 print(state.files.eio, "0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,{}\n", BBHeatInd);
    3721             :             }
    3722             :         }
    3723        4910 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) {
    3724        4114 :             if (Loop == 1) {
    3725         663 :                 print(state.files.eio,
    3726             :                       Format_723,
    3727             :                       "People",
    3728             :                       "Number of People {},People/Floor Area {person/m2},Floor Area per person {m2/person},Fraction Radiant,Fraction "
    3729             :                       "Convected,Sensible Fraction Calculation,Activity level,ASHRAE 55 Warnings,Carbon Dioxide Generation Rate,"
    3730             :                       "Minimum Number of People for All Day Types,Maximum Number of People for All Day Types,"
    3731             :                       "Minimum Number of People for Weekdays, Maximum Number of People for Weekdays, "
    3732             :                       "Minimum Number of People for Weekends/Holidays, Maximum Number of People for Weekends /Holidays,"
    3733             :                       "Minimum Number of People for Summer Design Days, Maximum Number of People for Summer Design Days,"
    3734             :                       "Minimum Number of People for Winter Design Days, Maximum Number of People for Winter Design Days");
    3735         952 :                 if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU ||
    3736         952 :                     state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) {
    3737         379 :                     print(state.files.eio,
    3738             :                           ",MRT Calculation Type,Work Efficiency, Clothing Insulation Calculation Method,Clothing "
    3739             :                           "Insulation Calculation Method Schedule,Clothing,Air Velocity,Fanger Calculation,Pierce "
    3740             :                           "Calculation,KSU Calculation,Cooling Effect Calculation,Ankle Draft Calculation\n");
    3741             :                 } else {
    3742         284 :                     print(state.files.eio, "\n");
    3743             :                 }
    3744             :             }
    3745             : 
    3746        4114 :             int ZoneNum = state.dataHeatBal->People(Loop).ZonePtr;
    3747             : 
    3748        4114 :             if (ZoneNum == 0) {
    3749           0 :                 print(state.files.eio, Format_724, "People-Illegal Zone specified", state.dataHeatBal->People(Loop).Name);
    3750           0 :                 continue;
    3751             :             }
    3752             : 
    3753        4114 :             print(state.files.eio,
    3754             :                   Format_722,
    3755             :                   "People",
    3756        4114 :                   state.dataHeatBal->People(Loop).Name,
    3757        8228 :                   GetScheduleName(state, state.dataHeatBal->People(Loop).NumberOfPeoplePtr),
    3758        4114 :                   state.dataHeatBal->Zone(ZoneNum).Name,
    3759        4114 :                   state.dataHeatBal->Zone(ZoneNum).FloorArea,
    3760        4114 :                   state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    3761             : 
    3762        4114 :             print(state.files.eio, "{:.1R},", state.dataHeatBal->People(Loop).NumberOfPeople);
    3763             : 
    3764        4114 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->People(Loop).NumberOfPeople, state.dataHeatBal->Zone(ZoneNum).FloorArea);
    3765             : 
    3766        4114 :             if (state.dataHeatBal->People(Loop).NumberOfPeople > 0.0) {
    3767        4049 :                 print_and_divide_if_greater_than_zero(state.dataHeatBal->Zone(ZoneNum).FloorArea, state.dataHeatBal->People(Loop).NumberOfPeople);
    3768             :             } else {
    3769          65 :                 print(state.files.eio, "N/A,");
    3770             :             }
    3771             : 
    3772        4114 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).FractionRadiant);
    3773        4114 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).FractionConvected);
    3774        4114 :             if (state.dataHeatBal->People(Loop).UserSpecSensFrac == Constant::AutoCalculate) {
    3775        4016 :                 print(state.files.eio, "AutoCalculate,");
    3776             :             } else {
    3777          98 :                 print(state.files.eio, "{:.3R},", state.dataHeatBal->People(Loop).UserSpecSensFrac);
    3778             :             }
    3779        4114 :             print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ActivityLevelPtr));
    3780             : 
    3781        4114 :             if (state.dataHeatBal->People(Loop).Show55Warning) {
    3782           0 :                 print(state.files.eio, "Yes,");
    3783             :             } else {
    3784        4114 :                 print(state.files.eio, "No,");
    3785             :             }
    3786        4114 :             print(state.files.eio, "{:.4R},", state.dataHeatBal->People(Loop).CO2RateFactor);
    3787        4114 :             print(state.files.eio, "{:.1R},", state.dataHeatBal->People(Loop).NomMinNumberPeople);
    3788        4114 :             print(state.files.eio, "{:.1R},", state.dataHeatBal->People(Loop).NomMaxNumberPeople);
    3789             : 
    3790        4114 :             auto &thisPeople = state.dataHeatBal->People(Loop);
    3791             :             // weekdays
    3792        4114 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, thisPeople.NumberOfPeoplePtr, DayTypeGroup::Weekday);
    3793        4114 :             print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMin);
    3794        4114 :             print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMax);
    3795             : 
    3796             :             // weekends/holidays
    3797        4114 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, thisPeople.NumberOfPeoplePtr, DayTypeGroup::WeekEndHoliday);
    3798        4114 :             print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMin);
    3799        4114 :             print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMax);
    3800             : 
    3801             :             // summer design days
    3802        4114 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, thisPeople.NumberOfPeoplePtr, DayTypeGroup::SummerDesignDay);
    3803        4114 :             print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMin);
    3804        4114 :             print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMax);
    3805             : 
    3806             :             // winter design days
    3807        4114 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, thisPeople.NumberOfPeoplePtr, DayTypeGroup::WinterDesignDay);
    3808        4114 :             print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMin);
    3809        4114 :             print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMax);
    3810             : 
    3811        5681 :             if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU ||
    3812        5681 :                 state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) {
    3813             : 
    3814        2554 :                 if (state.dataHeatBal->People(Loop).MRTCalcType == DataHeatBalance::CalcMRT::EnclosureAveraged) {
    3815        2545 :                     print(state.files.eio, "Zone Averaged,");
    3816           9 :                 } else if (state.dataHeatBal->People(Loop).MRTCalcType == DataHeatBalance::CalcMRT::SurfaceWeighted) {
    3817           6 :                     print(state.files.eio, "Surface Weighted,");
    3818           3 :                 } else if (state.dataHeatBal->People(Loop).MRTCalcType == DataHeatBalance::CalcMRT::AngleFactor) {
    3819           3 :                     print(state.files.eio, "Angle Factor,");
    3820             :                 } else {
    3821           0 :                     print(state.files.eio, "N/A,");
    3822             :                 }
    3823        2554 :                 print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).WorkEffPtr));
    3824             : 
    3825        2554 :                 print(state.files.eio, clothingTypeEIOStrings[static_cast<int>(state.dataHeatBal->People(Loop).clothingType)]);
    3826             : 
    3827        2554 :                 if (state.dataHeatBal->People(Loop).clothingType == ClothingType::CalculationSchedule) {
    3828           1 :                     print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ClothingMethodPtr));
    3829             :                 } else {
    3830        2553 :                     print(state.files.eio, "N/A,");
    3831             :                 }
    3832             : 
    3833        2554 :                 print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).ClothingPtr));
    3834        2554 :                 print(state.files.eio, "{},", GetScheduleName(state, state.dataHeatBal->People(Loop).AirVelocityPtr));
    3835             : 
    3836        2554 :                 if (state.dataHeatBal->People(Loop).Fanger) {
    3837        2547 :                     print(state.files.eio, "Yes,");
    3838             :                 } else {
    3839           7 :                     print(state.files.eio, "No,");
    3840             :                 }
    3841        2554 :                 if (state.dataHeatBal->People(Loop).Pierce) {
    3842          11 :                     print(state.files.eio, "Yes,");
    3843             :                 } else {
    3844        2543 :                     print(state.files.eio, "No,");
    3845             :                 }
    3846        2554 :                 if (state.dataHeatBal->People(Loop).KSU) {
    3847           6 :                     print(state.files.eio, "Yes,");
    3848             :                 } else {
    3849        2548 :                     print(state.files.eio, "No,");
    3850             :                 }
    3851        2554 :                 if (state.dataHeatBal->People(Loop).CoolingEffectASH55) {
    3852           1 :                     print(state.files.eio, "Yes,");
    3853             :                 } else {
    3854        2553 :                     print(state.files.eio, "No,");
    3855             :                 }
    3856        2554 :                 if (state.dataHeatBal->People(Loop).AnkleDraftASH55) {
    3857           1 :                     print(state.files.eio, "Yes\n");
    3858             :                 } else {
    3859        2553 :                     print(state.files.eio, "No\n");
    3860             :                 }
    3861             :             } else {
    3862        1560 :                 print(state.files.eio, "\n");
    3863             :             }
    3864             :         }
    3865        5125 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
    3866        4329 :             if (Loop == 1) {
    3867         662 :                 print(state.files.eio,
    3868             :                       Format_723,
    3869             :                       "Lights",
    3870             :                       "Lighting Level {W},Lights/Floor Area {W/m2},Lights per person {W/person},Fraction Return "
    3871             :                       "Air,Fraction Radiant,Fraction Short Wave,Fraction Convected,Fraction Replaceable,End-Use, "
    3872             :                       "Minimum Lighting Level for All Day Types {W},Maximum Lighting Level for All Day Types {W},"
    3873             :                       "Minimum Lighting Level for Weekdays {W}, Maximum Lighting Level for Weekdays {W},"
    3874             :                       "Minimum Lighting Level for Weekends/Holidays {W}, Maximum Lighting Level for Weekends /Holidays {W},"
    3875             :                       "Minimum Lighting Level for Summer Design Days {W}, Maximum Lighting Level for Summer Design Days {W},"
    3876             :                       "Minimum Lighting Level for Winter Design Days {W}, Maximum Lighting Level for Winter Design Days {W}\n");
    3877             :             }
    3878             : 
    3879        4329 :             int ZoneNum = state.dataHeatBal->Lights(Loop).ZonePtr;
    3880             : 
    3881        4329 :             if (ZoneNum == 0) {
    3882           0 :                 print(state.files.eio, "Lights-Illegal Zone specified", state.dataHeatBal->Lights(Loop).Name);
    3883           0 :                 continue;
    3884             :             }
    3885        4329 :             print(state.files.eio,
    3886             :                   Format_722,
    3887             :                   "Lights",
    3888        4329 :                   state.dataHeatBal->Lights(Loop).Name,
    3889        8658 :                   GetScheduleName(state, state.dataHeatBal->Lights(Loop).SchedPtr),
    3890        4329 :                   state.dataHeatBal->Zone(ZoneNum).Name,
    3891        4329 :                   state.dataHeatBal->Zone(ZoneNum).FloorArea,
    3892        4329 :                   state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    3893             : 
    3894        4329 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).DesignLevel);
    3895             : 
    3896        4329 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->Lights(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea);
    3897        4329 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->Lights(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    3898             : 
    3899        4329 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionReturnAir);
    3900        4329 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionRadiant);
    3901        4329 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionShortWave);
    3902        4329 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionConvected);
    3903        4329 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).FractionReplaceable);
    3904        4329 :             print(state.files.eio, "{},", state.dataHeatBal->Lights(Loop).EndUseSubcategory);
    3905        4329 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).NomMinDesignLevel);
    3906        4329 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->Lights(Loop).NomMaxDesignLevel);
    3907             : 
    3908        4329 :             auto &light = state.dataHeatBal->Lights(Loop);
    3909             :             // weekdays
    3910        4329 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, light.SchedPtr, DayTypeGroup::Weekday);
    3911        4329 :             print(state.files.eio, "{:.3R},", light.DesignLevel * SchMin);
    3912        4329 :             print(state.files.eio, "{:.1R},", light.DesignLevel * SchMax);
    3913             : 
    3914             :             // weekends/holidays
    3915        4329 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, light.SchedPtr, DayTypeGroup::WeekEndHoliday);
    3916        4329 :             print(state.files.eio, "{:.3R},", light.DesignLevel * SchMin);
    3917        4329 :             print(state.files.eio, "{:.3R},", light.DesignLevel * SchMax);
    3918             : 
    3919             :             // summer design days
    3920        4329 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, light.SchedPtr, DayTypeGroup::SummerDesignDay);
    3921        4329 :             print(state.files.eio, "{:.3R},", light.DesignLevel * SchMin);
    3922        4329 :             print(state.files.eio, "{:.3R},", light.DesignLevel * SchMax);
    3923             : 
    3924             :             // winter design days
    3925        4329 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, light.SchedPtr, DayTypeGroup::WinterDesignDay);
    3926        4329 :             print(state.files.eio, "{:.3R},", light.DesignLevel * SchMin);
    3927        4329 :             print(state.files.eio, "{:.3R}\n", light.DesignLevel * SchMax);
    3928             :         }
    3929        5195 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) {
    3930        4399 :             if (Loop == 1) {
    3931         650 :                 print(state.files.eio,
    3932             :                       Format_723,
    3933             :                       "ElectricEquipment",
    3934             :                       "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction "
    3935             :                       "Lost,Fraction Convected,End-Use SubCategory,"
    3936             :                       "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
    3937             :                       "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
    3938             :                       "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
    3939             :                       "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
    3940             :                       "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W}\n");
    3941             :             }
    3942             : 
    3943        4399 :             int ZoneNum = state.dataHeatBal->ZoneElectric(Loop).ZonePtr;
    3944             : 
    3945        4399 :             if (ZoneNum == 0) {
    3946           0 :                 print(state.files.eio, Format_724, "Electric Equipment-Illegal Zone specified", state.dataHeatBal->ZoneElectric(Loop).Name);
    3947           0 :                 continue;
    3948             :             }
    3949        4399 :             print(state.files.eio,
    3950             :                   Format_722,
    3951             :                   "ElectricEquipment",
    3952        4399 :                   state.dataHeatBal->ZoneElectric(Loop).Name,
    3953        8798 :                   GetScheduleName(state, state.dataHeatBal->ZoneElectric(Loop).SchedPtr),
    3954        4399 :                   state.dataHeatBal->Zone(ZoneNum).Name,
    3955        4399 :                   state.dataHeatBal->Zone(ZoneNum).FloorArea,
    3956        4399 :                   state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    3957             : 
    3958        4399 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).DesignLevel);
    3959             : 
    3960        4399 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneElectric(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea);
    3961        4399 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneElectric(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    3962             : 
    3963        4399 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionLatent);
    3964        4399 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionRadiant);
    3965        4399 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionLost);
    3966        4399 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).FractionConvected);
    3967        4399 :             print(state.files.eio, "{},", state.dataHeatBal->ZoneElectric(Loop).EndUseSubcategory);
    3968        4399 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).NomMinDesignLevel);
    3969        4399 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneElectric(Loop).NomMaxDesignLevel);
    3970             : 
    3971        4399 :             auto &electric = state.dataHeatBal->ZoneElectric(Loop);
    3972             :             // weekdays
    3973        4399 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, electric.SchedPtr, DayTypeGroup::Weekday);
    3974        4399 :             print(state.files.eio, "{:.3R},", electric.DesignLevel * SchMin);
    3975        4399 :             print(state.files.eio, "{:.3R},", electric.DesignLevel * SchMax);
    3976             : 
    3977             :             // weekends/holidays
    3978        4399 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, electric.SchedPtr, DayTypeGroup::WeekEndHoliday);
    3979        4399 :             print(state.files.eio, "{:.3R},", electric.DesignLevel * SchMin);
    3980        4399 :             print(state.files.eio, "{:.3R},", electric.DesignLevel * SchMax);
    3981             : 
    3982             :             // summer design days
    3983        4399 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, electric.SchedPtr, DayTypeGroup::SummerDesignDay);
    3984        4399 :             print(state.files.eio, "{:.3R},", electric.DesignLevel * SchMin);
    3985        4399 :             print(state.files.eio, "{:.3R},", electric.DesignLevel * SchMax);
    3986             : 
    3987             :             // winter design days
    3988        4399 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, electric.SchedPtr, DayTypeGroup::WinterDesignDay);
    3989        4399 :             print(state.files.eio, "{:.3R},", electric.DesignLevel * SchMin);
    3990        4399 :             print(state.files.eio, "{:.3R}\n", electric.DesignLevel * SchMax);
    3991             :         }
    3992         875 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) {
    3993          79 :             if (Loop == 1) {
    3994          37 :                 print(state.files.eio,
    3995             :                       Format_723,
    3996             :                       "GasEquipment",
    3997             :                       "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction "
    3998             :                       "Lost,Fraction Convected,End-Use SubCategory,"
    3999             :                       "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
    4000             :                       "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
    4001             :                       "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
    4002             :                       "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
    4003             :                       "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W}\n");
    4004             :             }
    4005             : 
    4006          79 :             int ZoneNum = state.dataHeatBal->ZoneGas(Loop).ZonePtr;
    4007             : 
    4008          79 :             if (ZoneNum == 0) {
    4009           0 :                 print(state.files.eio, Format_724, "Gas Equipment-Illegal Zone specified", state.dataHeatBal->ZoneGas(Loop).Name);
    4010           0 :                 continue;
    4011             :             }
    4012             : 
    4013          79 :             print(state.files.eio,
    4014             :                   Format_722,
    4015             :                   "GasEquipment",
    4016          79 :                   state.dataHeatBal->ZoneGas(Loop).Name,
    4017         158 :                   GetScheduleName(state, state.dataHeatBal->ZoneGas(Loop).SchedPtr),
    4018          79 :                   state.dataHeatBal->Zone(ZoneNum).Name,
    4019          79 :                   state.dataHeatBal->Zone(ZoneNum).FloorArea,
    4020          79 :                   state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    4021             : 
    4022          79 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).DesignLevel);
    4023             : 
    4024          79 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneGas(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea);
    4025          79 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneGas(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    4026             : 
    4027          79 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionLatent);
    4028          79 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionRadiant);
    4029          79 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionLost);
    4030          79 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).FractionConvected);
    4031          79 :             print(state.files.eio, "{},", state.dataHeatBal->ZoneGas(Loop).EndUseSubcategory);
    4032          79 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).NomMinDesignLevel);
    4033          79 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneGas(Loop).NomMaxDesignLevel);
    4034             : 
    4035          79 :             auto &gas = state.dataHeatBal->ZoneGas(Loop);
    4036             :             // weekdays
    4037          79 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, gas.SchedPtr, DayTypeGroup::Weekday);
    4038          79 :             print(state.files.eio, "{:.3R},", gas.DesignLevel * SchMin);
    4039          79 :             print(state.files.eio, "{:.3R},", gas.DesignLevel * SchMax);
    4040             : 
    4041             :             // weekends/holidays
    4042          79 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, gas.SchedPtr, DayTypeGroup::WeekEndHoliday);
    4043          79 :             print(state.files.eio, "{:.3R},", gas.DesignLevel * SchMin);
    4044          79 :             print(state.files.eio, "{:.3R},", gas.DesignLevel * SchMax);
    4045             : 
    4046             :             // summer design days
    4047          79 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, gas.SchedPtr, DayTypeGroup::SummerDesignDay);
    4048          79 :             print(state.files.eio, "{:.3R},", gas.DesignLevel * SchMin);
    4049          79 :             print(state.files.eio, "{:.3R},", gas.DesignLevel * SchMax);
    4050             : 
    4051             :             // winter design days
    4052          79 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, gas.SchedPtr, DayTypeGroup::WinterDesignDay);
    4053          79 :             print(state.files.eio, "{:.3R},", gas.DesignLevel * SchMin);
    4054          79 :             print(state.files.eio, "{:.3R}\n", gas.DesignLevel * SchMax);
    4055             :         }
    4056             : 
    4057         810 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) {
    4058          14 :             if (Loop == 1) {
    4059           6 :                 print(state.files.eio,
    4060             :                       Format_723,
    4061             :                       "HotWaterEquipment",
    4062             :                       "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction "
    4063             :                       "Lost,Fraction Convected,End-Use SubCategory,"
    4064             :                       "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
    4065             :                       "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
    4066             :                       "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
    4067             :                       "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
    4068             :                       "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W}\n");
    4069             :             }
    4070             : 
    4071          14 :             int ZoneNum = state.dataHeatBal->ZoneHWEq(Loop).ZonePtr;
    4072             : 
    4073          14 :             if (ZoneNum == 0) {
    4074           0 :                 print(state.files.eio, Format_724, "Hot Water Equipment-Illegal Zone specified", state.dataHeatBal->ZoneHWEq(Loop).Name);
    4075           0 :                 continue;
    4076             :             }
    4077             : 
    4078          14 :             print(state.files.eio,
    4079             :                   Format_722,
    4080             :                   "HotWaterEquipment",
    4081          14 :                   state.dataHeatBal->ZoneHWEq(Loop).Name,
    4082          28 :                   GetScheduleName(state, state.dataHeatBal->ZoneHWEq(Loop).SchedPtr),
    4083          14 :                   state.dataHeatBal->Zone(ZoneNum).Name,
    4084          14 :                   state.dataHeatBal->Zone(ZoneNum).FloorArea,
    4085          14 :                   state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    4086             : 
    4087          14 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).DesignLevel);
    4088             : 
    4089          14 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneHWEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea);
    4090          14 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneHWEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    4091             : 
    4092          14 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionLatent);
    4093          14 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionRadiant);
    4094          14 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionLost);
    4095          14 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).FractionConvected);
    4096          14 :             print(state.files.eio, "{},", state.dataHeatBal->ZoneHWEq(Loop).EndUseSubcategory);
    4097          14 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).NomMinDesignLevel);
    4098          14 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneHWEq(Loop).NomMaxDesignLevel);
    4099             : 
    4100          14 :             auto &hweq = state.dataHeatBal->ZoneHWEq(Loop);
    4101             :             // weekdays
    4102          14 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, hweq.SchedPtr, DayTypeGroup::Weekday);
    4103          14 :             print(state.files.eio, "{:.3R},", hweq.DesignLevel * SchMin);
    4104          14 :             print(state.files.eio, "{:.3R},", hweq.DesignLevel * SchMax);
    4105             : 
    4106             :             // weekends/holidays
    4107          14 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, hweq.SchedPtr, DayTypeGroup::WeekEndHoliday);
    4108          14 :             print(state.files.eio, "{:.3R},", hweq.DesignLevel * SchMin);
    4109          14 :             print(state.files.eio, "{:.3R},", hweq.DesignLevel * SchMax);
    4110             : 
    4111             :             // summer design days
    4112          14 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, hweq.SchedPtr, DayTypeGroup::SummerDesignDay);
    4113          14 :             print(state.files.eio, "{:.3R},", hweq.DesignLevel * SchMin);
    4114          14 :             print(state.files.eio, "{:.3R},", hweq.DesignLevel * SchMax);
    4115             : 
    4116             :             // winter design days
    4117          14 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, hweq.SchedPtr, DayTypeGroup::WinterDesignDay);
    4118          14 :             print(state.files.eio, "{:.3R},", hweq.DesignLevel * SchMin);
    4119          14 :             print(state.files.eio, "{:.3R}\n", hweq.DesignLevel * SchMax);
    4120             :         }
    4121             : 
    4122         801 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) {
    4123           5 :             if (Loop == 1) {
    4124           5 :                 print(state.files.eio,
    4125             :                       Format_723,
    4126             :                       "SteamEquipment",
    4127             :                       "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction "
    4128             :                       "Lost,Fraction Convected,End-Use SubCategory,"
    4129             :                       "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
    4130             :                       "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
    4131             :                       "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
    4132             :                       "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
    4133             :                       "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W}\n");
    4134             :             }
    4135             : 
    4136           5 :             int ZoneNum = state.dataHeatBal->ZoneSteamEq(Loop).ZonePtr;
    4137             : 
    4138           5 :             if (ZoneNum == 0) {
    4139           0 :                 print(state.files.eio, Format_724, "Steam Equipment-Illegal Zone specified", state.dataHeatBal->ZoneSteamEq(Loop).Name);
    4140           0 :                 continue;
    4141             :             }
    4142             : 
    4143           5 :             print(state.files.eio,
    4144             :                   Format_722,
    4145             :                   "SteamEquipment",
    4146           5 :                   state.dataHeatBal->ZoneSteamEq(Loop).Name,
    4147          10 :                   GetScheduleName(state, state.dataHeatBal->ZoneSteamEq(Loop).SchedPtr),
    4148           5 :                   state.dataHeatBal->Zone(ZoneNum).Name,
    4149           5 :                   state.dataHeatBal->Zone(ZoneNum).FloorArea,
    4150           5 :                   state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    4151             : 
    4152           5 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel);
    4153             : 
    4154           5 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea);
    4155           5 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneSteamEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    4156             : 
    4157           5 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionLatent);
    4158           5 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionRadiant);
    4159           5 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionLost);
    4160           5 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).FractionConvected);
    4161           5 :             print(state.files.eio, "{},", state.dataHeatBal->ZoneSteamEq(Loop).EndUseSubcategory);
    4162           5 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).NomMinDesignLevel);
    4163           5 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneSteamEq(Loop).NomMaxDesignLevel);
    4164             : 
    4165           5 :             auto &stmeq = state.dataHeatBal->ZoneSteamEq(Loop);
    4166             :             // weekdays
    4167           5 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, stmeq.SchedPtr, DayTypeGroup::Weekday);
    4168           5 :             print(state.files.eio, "{:.3R},", stmeq.DesignLevel * SchMin);
    4169           5 :             print(state.files.eio, "{:.3R},", stmeq.DesignLevel * SchMax);
    4170             : 
    4171             :             // weekends/holidays
    4172           5 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, stmeq.SchedPtr, DayTypeGroup::WeekEndHoliday);
    4173           5 :             print(state.files.eio, "{:.3R},", stmeq.DesignLevel * SchMin);
    4174           5 :             print(state.files.eio, "{:.3R},", stmeq.DesignLevel * SchMax);
    4175             : 
    4176             :             // summer design days
    4177           5 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, stmeq.SchedPtr, DayTypeGroup::SummerDesignDay);
    4178           5 :             print(state.files.eio, "{:.3R},", stmeq.DesignLevel * SchMin);
    4179           5 :             print(state.files.eio, "{:.3R},", stmeq.DesignLevel * SchMax);
    4180             : 
    4181             :             // winter design days
    4182           5 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, stmeq.SchedPtr, DayTypeGroup::WinterDesignDay);
    4183           5 :             print(state.files.eio, "{:.3R},", stmeq.DesignLevel * SchMin);
    4184           5 :             print(state.files.eio, "{:.3R}\n", stmeq.DesignLevel * SchMax);
    4185             :         }
    4186             : 
    4187         865 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) {
    4188          69 :             if (Loop == 1) {
    4189          31 :                 print(state.files.eio,
    4190             :                       Format_723,
    4191             :                       "OtherEquipment",
    4192             :                       "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction "
    4193             :                       "Lost,Fraction Convected,"
    4194             :                       "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
    4195             :                       "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
    4196             :                       "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
    4197             :                       "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
    4198             :                       "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W}\n");
    4199             :             }
    4200             : 
    4201          69 :             int ZoneNum = state.dataHeatBal->ZoneOtherEq(Loop).ZonePtr;
    4202             : 
    4203          69 :             if (ZoneNum == 0) {
    4204           0 :                 print(state.files.eio, Format_724, "Other Equipment-Illegal Zone specified", state.dataHeatBal->ZoneOtherEq(Loop).Name);
    4205           0 :                 continue;
    4206             :             }
    4207             : 
    4208          69 :             print(state.files.eio,
    4209             :                   Format_722,
    4210             :                   "OtherEquipment",
    4211          69 :                   state.dataHeatBal->ZoneOtherEq(Loop).Name,
    4212         138 :                   GetScheduleName(state, state.dataHeatBal->ZoneOtherEq(Loop).SchedPtr),
    4213          69 :                   state.dataHeatBal->Zone(ZoneNum).Name,
    4214          69 :                   state.dataHeatBal->Zone(ZoneNum).FloorArea,
    4215          69 :                   state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    4216             : 
    4217          69 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel);
    4218             : 
    4219          69 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).FloorArea);
    4220          69 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneOtherEq(Loop).DesignLevel, state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    4221             : 
    4222          69 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionLatent);
    4223          69 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionRadiant);
    4224          69 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionLost);
    4225          69 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).FractionConvected);
    4226          69 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).NomMinDesignLevel);
    4227          69 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneOtherEq(Loop).NomMaxDesignLevel);
    4228             : 
    4229          69 :             auto &other = state.dataHeatBal->ZoneOtherEq(Loop);
    4230             :             // weekdays
    4231          69 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, other.SchedPtr, DayTypeGroup::Weekday);
    4232          69 :             print(state.files.eio, "{:.3R},", other.DesignLevel * SchMin);
    4233          69 :             print(state.files.eio, "{:.3R},", other.DesignLevel * SchMax);
    4234             : 
    4235             :             // weekends/holidays
    4236          69 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, other.SchedPtr, DayTypeGroup::WeekEndHoliday);
    4237          69 :             print(state.files.eio, "{:.3R},", other.DesignLevel * SchMin);
    4238          69 :             print(state.files.eio, "{:.3R},", other.DesignLevel * SchMax);
    4239             : 
    4240             :             // summer design days
    4241          69 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, other.SchedPtr, DayTypeGroup::SummerDesignDay);
    4242          69 :             print(state.files.eio, "{:.3R},", other.DesignLevel * SchMin);
    4243          69 :             print(state.files.eio, "{:.3R},", other.DesignLevel * SchMax);
    4244             : 
    4245             :             // winter design days
    4246          69 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, other.SchedPtr, DayTypeGroup::WinterDesignDay);
    4247          69 :             print(state.files.eio, "{:.3R},", other.DesignLevel * SchMin);
    4248          69 :             print(state.files.eio, "{:.3R}\n", other.DesignLevel * SchMax);
    4249             :         }
    4250             : 
    4251         803 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) {
    4252           7 :             if (Loop == 1) {
    4253           5 :                 print(state.files.eio,
    4254             :                       Format_723,
    4255             :                       "ElectricEquipment:ITE:AirCooled",
    4256             :                       "Equipment Level {W},"
    4257             :                       "Equipment/Floor Area {W/m2},Equipment per person {W/person},"
    4258             :                       "Fraction Convected,CPU End-Use SubCategory,Fan End-Use SubCategory,UPS End-Use SubCategory,"
    4259             :                       "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
    4260             :                       "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
    4261             :                       "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
    4262             :                       "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
    4263             :                       "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W},"
    4264             :                       "Design Air Volume Flow Rate {m3/s}\n");
    4265             :             }
    4266             : 
    4267           7 :             int ZoneNum = state.dataHeatBal->ZoneITEq(Loop).ZonePtr;
    4268             : 
    4269           7 :             if (ZoneNum == 0) {
    4270           0 :                 print(state.files.eio, Format_724, "ElectricEquipment:ITE:AirCooled-Illegal Zone specified", state.dataHeatBal->ZoneITEq(Loop).Name);
    4271           0 :                 continue;
    4272             :             }
    4273           7 :             print(state.files.eio,
    4274             :                   Format_722,
    4275             :                   "ElectricEquipment:ITE:AirCooled",
    4276           7 :                   state.dataHeatBal->ZoneITEq(Loop).Name,
    4277          14 :                   GetScheduleName(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr),
    4278           7 :                   state.dataHeatBal->Zone(ZoneNum).Name,
    4279           7 :                   state.dataHeatBal->Zone(ZoneNum).FloorArea,
    4280           7 :                   state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    4281             : 
    4282           7 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower);
    4283             : 
    4284           7 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower, state.dataHeatBal->Zone(ZoneNum).FloorArea);
    4285           7 :             print_and_divide_if_greater_than_zero(state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower, state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    4286             : 
    4287             :             // ElectricEquipment:ITE:AirCooled is 100% convective
    4288           7 :             print(state.files.eio, "1.0,");
    4289             : 
    4290           7 :             print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryCPU);
    4291           7 :             print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryFan);
    4292           7 :             print(state.files.eio, "{},", state.dataHeatBal->ZoneITEq(Loop).EndUseSubcategoryUPS);
    4293           7 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).NomMinDesignLevel);
    4294           7 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneITEq(Loop).NomMaxDesignLevel);
    4295             : 
    4296           7 :             auto &iteq = state.dataHeatBal->ZoneITEq(Loop);
    4297             :             // weekdays
    4298           7 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, iteq.OperSchedPtr, DayTypeGroup::Weekday);
    4299           7 :             print(state.files.eio, "{:.3R},", iteq.DesignTotalPower * SchMin);
    4300           7 :             print(state.files.eio, "{:.3R},", iteq.DesignTotalPower * SchMax);
    4301             : 
    4302             :             // weekends/holidays
    4303           7 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, iteq.OperSchedPtr, DayTypeGroup::WeekEndHoliday);
    4304           7 :             print(state.files.eio, "{:.3R},", iteq.DesignTotalPower * SchMin);
    4305           7 :             print(state.files.eio, "{:.3R},", iteq.DesignTotalPower * SchMax);
    4306             : 
    4307             :             // summer design days
    4308           7 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, iteq.OperSchedPtr, DayTypeGroup::SummerDesignDay);
    4309           7 :             print(state.files.eio, "{:.3R},", iteq.DesignTotalPower * SchMin);
    4310           7 :             print(state.files.eio, "{:.3R},", iteq.DesignTotalPower * SchMax);
    4311             : 
    4312             :             // winter design days
    4313           7 :             std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, iteq.OperSchedPtr, DayTypeGroup::WinterDesignDay);
    4314           7 :             print(state.files.eio, "{:.3R},", iteq.DesignTotalPower * SchMin);
    4315           7 :             print(state.files.eio, "{:.3R},", iteq.DesignTotalPower * SchMax);
    4316             : 
    4317           7 :             print(state.files.eio, "{:.10R}\n", state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate);
    4318             :         }
    4319             : 
    4320         799 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) {
    4321           3 :             if (Loop == 1) {
    4322           3 :                 print(state.files.eio,
    4323             :                       Format_723,
    4324             :                       "Outdoor Controlled Baseboard Heat",
    4325             :                       "Capacity at Low Temperature {W},Low Temperature {C},Capacity at High Temperature "
    4326             :                       "{W},High Temperature {C},Fraction Radiant,Fraction Convected,End-Use Subcategory\n");
    4327             :             }
    4328             : 
    4329           3 :             int ZoneNum = state.dataHeatBal->ZoneBBHeat(Loop).ZonePtr;
    4330             : 
    4331           3 :             if (ZoneNum == 0) {
    4332           0 :                 print(state.files.eio,
    4333             :                       Format_724,
    4334             :                       "Outdoor Controlled Baseboard Heat-Illegal Zone specified",
    4335           0 :                       state.dataHeatBal->ZoneBBHeat(Loop).Name);
    4336           0 :                 continue;
    4337             :             }
    4338           3 :             print(state.files.eio,
    4339             :                   Format_722,
    4340             :                   "Outdoor Controlled Baseboard Heat",
    4341           3 :                   state.dataHeatBal->ZoneBBHeat(Loop).Name,
    4342           6 :                   GetScheduleName(state, state.dataHeatBal->ZoneBBHeat(Loop).SchedPtr),
    4343           3 :                   state.dataHeatBal->Zone(ZoneNum).Name,
    4344           3 :                   state.dataHeatBal->Zone(ZoneNum).FloorArea,
    4345           3 :                   state.dataHeatBal->Zone(ZoneNum).TotOccupants);
    4346             : 
    4347           3 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).CapatLowTemperature);
    4348           3 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).LowTemperature);
    4349           3 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).CapatHighTemperature);
    4350           3 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).HighTemperature);
    4351           3 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).FractionRadiant);
    4352           3 :             print(state.files.eio, "{:.3R},", state.dataHeatBal->ZoneBBHeat(Loop).FractionConvected);
    4353           3 :             print(state.files.eio, "{}\n", state.dataHeatBal->ZoneBBHeat(Loop).EndUseSubcategory);
    4354             :         }
    4355         796 :     }
    4356             : 
    4357       12736 :     void setupIHGZonesAndSpaces(EnergyPlusData &state,
    4358             :                                 const std::string &objectType,
    4359             :                                 EPVector<InternalHeatGains::GlobalInternalGainMiscObject> &inputObjects,
    4360             :                                 int &numInputObjects,
    4361             :                                 int &numGainInstances,
    4362             :                                 bool &errors,
    4363             :                                 const bool zoneListNotAllowed)
    4364             :     {
    4365             :         // This function pre-processes the input objects for objectType and determines the ultimate number
    4366             :         // of simulation instances for each input object after expansion for SpaceList, Zone, or ZoneList.
    4367             :         // inputObjects is allocated here and filled with data for further input processing.
    4368             : 
    4369       12736 :         constexpr std::string_view routineName = "setupIHGZonesAndSpaces: ";
    4370       12736 :         bool localErrFlag = false;
    4371             : 
    4372       12736 :         auto &ip = state.dataInputProcessing->inputProcessor;
    4373       12736 :         auto const instances = ip->epJSON.find(objectType);
    4374       12736 :         if (instances != ip->epJSON.end()) {
    4375       12736 :             auto const &objectSchemaProps = ip->getObjectSchemaProps(state, objectType);
    4376       12736 :             auto &instancesValue = instances.value();
    4377       12736 :             numInputObjects = int(instancesValue.size());
    4378       12736 :             inputObjects.allocate(numInputObjects);
    4379             : 
    4380       12736 :             numGainInstances = 0;
    4381       12736 :             int counter = 0;
    4382       29105 :             for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
    4383       16369 :                 auto const &objectFields = instance.value();
    4384       16369 :                 std::string const &thisObjectName = Util::makeUPPER(instance.key());
    4385       16369 :                 ip->markObjectAsUsed(objectType, instance.key());
    4386             : 
    4387             :                 // For incoming idf, maintain object order
    4388       16369 :                 ++counter;
    4389       16369 :                 int objNum = ip->getIDFObjNum(state, objectType, counter);
    4390       16369 :                 inputObjects(objNum).Name = thisObjectName;
    4391       16369 :                 std::string areaFieldName;
    4392       16369 :                 if (zoneListNotAllowed) {
    4393         206 :                     areaFieldName = "zone_or_space_name";
    4394             :                 } else {
    4395       16163 :                     areaFieldName = "zone_or_zonelist_or_space_or_spacelist_name";
    4396             :                 }
    4397       16369 :                 std::string areaName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, areaFieldName);
    4398             : 
    4399       16369 :                 int zoneNum = Util::FindItemInList(areaName, state.dataHeatBal->Zone);
    4400       16369 :                 if (zoneNum > 0) {
    4401       16317 :                     inputObjects(objNum).spaceStartPtr = numGainInstances + 1;
    4402       16317 :                     int numSpaces = state.dataHeatBal->Zone(zoneNum).numSpaces;
    4403       16317 :                     numGainInstances += numSpaces;
    4404       16317 :                     inputObjects(objNum).numOfSpaces = numSpaces;
    4405       16317 :                     inputObjects(objNum).ZoneListActive = false;
    4406       16317 :                     if (numSpaces == 1) {
    4407       16302 :                         inputObjects(objNum).spaceNums.emplace_back(state.dataHeatBal->Zone(zoneNum).spaceIndexes(1));
    4408       16302 :                         inputObjects(objNum).names.emplace_back(inputObjects(objNum).Name);
    4409             :                     } else {
    4410          60 :                         for (int const spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) {
    4411          45 :                             inputObjects(objNum).spaceNums.emplace_back(spaceNum);
    4412          45 :                             inputObjects(objNum).names.emplace_back(state.dataHeatBal->space(spaceNum).Name + ' ' + inputObjects(objNum).Name);
    4413          15 :                         }
    4414             :                     }
    4415       16317 :                     continue;
    4416       16317 :                 }
    4417          52 :                 int spaceNum = Util::FindItemInList(areaName, state.dataHeatBal->space);
    4418          52 :                 if (spaceNum > 0) {
    4419           9 :                     inputObjects(objNum).spaceStartPtr = numGainInstances + 1;
    4420           9 :                     ++numGainInstances;
    4421           9 :                     inputObjects(objNum).numOfSpaces = 1;
    4422           9 :                     inputObjects(objNum).spaceListActive = false;
    4423           9 :                     inputObjects(objNum).spaceOrSpaceListPtr = spaceNum;
    4424           9 :                     inputObjects(objNum).spaceNums.emplace_back(spaceNum);
    4425           9 :                     inputObjects(objNum).names.emplace_back(inputObjects(objNum).Name);
    4426           9 :                     continue;
    4427             :                 }
    4428          43 :                 int zoneListNum = Util::FindItemInList(areaName, state.dataHeatBal->ZoneList);
    4429          43 :                 if (zoneListNum > 0) {
    4430          39 :                     if (zoneListNotAllowed) {
    4431           0 :                         ShowSevereError(
    4432           0 :                             state, format("{}=\"{}\" ZoneList Name=\"{}\" not allowed for {}.", objectType, thisObjectName, areaName, objectType));
    4433           0 :                         errors = true;
    4434           0 :                         localErrFlag = true;
    4435             :                     } else {
    4436             : 
    4437          39 :                         inputObjects(objNum).spaceStartPtr = numGainInstances + 1;
    4438          39 :                         int numSpaces = 0;
    4439         422 :                         for (int const listZoneIdx : state.dataHeatBal->ZoneList(zoneListNum).Zone) {
    4440         383 :                             numSpaces += state.dataHeatBal->Zone(listZoneIdx).numSpaces;
    4441         778 :                             for (int const spaceNum : state.dataHeatBal->Zone(listZoneIdx).spaceIndexes) {
    4442         395 :                                 inputObjects(objNum).spaceNums.emplace_back(spaceNum);
    4443         395 :                                 inputObjects(objNum).names.emplace_back(state.dataHeatBal->space(spaceNum).Name + ' ' + inputObjects(objNum).Name);
    4444         383 :                             }
    4445             :                         }
    4446          39 :                         numGainInstances += numSpaces;
    4447          39 :                         inputObjects(objNum).numOfSpaces = numSpaces;
    4448          39 :                         inputObjects(objNum).ZoneListActive = true;
    4449             :                     }
    4450          39 :                     continue;
    4451          39 :                 }
    4452           4 :                 int spaceListNum = Util::FindItemInList(areaName, state.dataHeatBal->spaceList);
    4453           4 :                 if (spaceListNum > 0) {
    4454           4 :                     if (zoneListNotAllowed) {
    4455           0 :                         ShowSevereError(
    4456           0 :                             state, format("{}=\"{}\" SpaceList Name=\"{}\" not allowed for {}.", objectType, thisObjectName, areaName, objectType));
    4457           0 :                         errors = true;
    4458           0 :                         localErrFlag = true;
    4459             :                     } else {
    4460           4 :                         inputObjects(objNum).spaceStartPtr = numGainInstances + 1;
    4461           4 :                         int numSpaces = state.dataHeatBal->spaceList(spaceListNum).numListSpaces;
    4462           4 :                         numGainInstances += numSpaces;
    4463           4 :                         inputObjects(objNum).numOfSpaces = numSpaces;
    4464           4 :                         inputObjects(objNum).spaceListActive = true;
    4465           4 :                         inputObjects(objNum).spaceOrSpaceListPtr = spaceListNum;
    4466          29 :                         for (int const spaceNum : state.dataHeatBal->spaceList(spaceListNum).spaces) {
    4467          25 :                             inputObjects(objNum).spaceNums.emplace_back(spaceNum);
    4468          25 :                             inputObjects(objNum).names.emplace_back(state.dataHeatBal->space(spaceNum).Name + ' ' + inputObjects(objNum).Name);
    4469           4 :                         }
    4470             :                     }
    4471           4 :                     continue;
    4472           4 :                 }
    4473           0 :                 ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\" not found.", objectType, thisObjectName, areaFieldName, areaName));
    4474           0 :                 errors = true;
    4475           0 :                 localErrFlag = true;
    4476       61843 :             }
    4477       12736 :             if (localErrFlag) {
    4478           0 :                 ShowSevereError(state, format("{}Errors with invalid names in {} objects.", routineName, objectType));
    4479           0 :                 ShowContinueError(state, "...These will not be read in.  Other errors may occur.");
    4480           0 :                 numGainInstances = 0;
    4481             :             }
    4482             :         }
    4483       12736 :     }
    4484             : 
    4485         796 :     void setupIHGOutputs(EnergyPlusData &state)
    4486             :     {
    4487        5852 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
    4488             :             // Overall Zone Variables
    4489       10112 :             SetupOutputVariable(state,
    4490             :                                 "Zone Total Internal Radiant Heating Energy",
    4491             :                                 Constant::Units::J,
    4492        5056 :                                 state.dataHeatBal->ZoneRpt(zoneNum).TotRadiantGain,
    4493             :                                 OutputProcessor::TimeStepType::Zone,
    4494             :                                 OutputProcessor::StoreType::Sum,
    4495        5056 :                                 state.dataHeatBal->Zone(zoneNum).Name);
    4496       10112 :             SetupOutputVariable(state,
    4497             :                                 "Zone Total Internal Radiant Heating Rate",
    4498             :                                 Constant::Units::W,
    4499        5056 :                                 state.dataHeatBal->ZoneRpt(zoneNum).TotRadiantGainRate,
    4500             :                                 OutputProcessor::TimeStepType::Zone,
    4501             :                                 OutputProcessor::StoreType::Average,
    4502        5056 :                                 state.dataHeatBal->Zone(zoneNum).Name);
    4503       10112 :             SetupOutputVariable(state,
    4504             :                                 "Zone Total Internal Visible Radiation Heating Energy",
    4505             :                                 Constant::Units::J,
    4506        5056 :                                 state.dataHeatBal->ZoneRpt(zoneNum).TotVisHeatGain,
    4507             :                                 OutputProcessor::TimeStepType::Zone,
    4508             :                                 OutputProcessor::StoreType::Sum,
    4509        5056 :                                 state.dataHeatBal->Zone(zoneNum).Name);
    4510       10112 :             SetupOutputVariable(state,
    4511             :                                 "Zone Total Internal Visible Radiation Heating Rate",
    4512             :                                 Constant::Units::W,
    4513        5056 :                                 state.dataHeatBal->ZoneRpt(zoneNum).TotVisHeatGainRate,
    4514             :                                 OutputProcessor::TimeStepType::Zone,
    4515             :                                 OutputProcessor::StoreType::Average,
    4516        5056 :                                 state.dataHeatBal->Zone(zoneNum).Name);
    4517       10112 :             SetupOutputVariable(state,
    4518             :                                 "Zone Total Internal Convective Heating Energy",
    4519             :                                 Constant::Units::J,
    4520        5056 :                                 state.dataHeatBal->ZoneRpt(zoneNum).TotConvectiveGain,
    4521             :                                 OutputProcessor::TimeStepType::Zone,
    4522             :                                 OutputProcessor::StoreType::Sum,
    4523        5056 :                                 state.dataHeatBal->Zone(zoneNum).Name);
    4524       10112 :             SetupOutputVariable(state,
    4525             :                                 "Zone Total Internal Convective Heating Rate",
    4526             :                                 Constant::Units::W,
    4527        5056 :                                 state.dataHeatBal->ZoneRpt(zoneNum).TotConvectiveGainRate,
    4528             :                                 OutputProcessor::TimeStepType::Zone,
    4529             :                                 OutputProcessor::StoreType::Average,
    4530        5056 :                                 state.dataHeatBal->Zone(zoneNum).Name);
    4531       10112 :             SetupOutputVariable(state,
    4532             :                                 "Zone Total Internal Latent Gain Energy",
    4533             :                                 Constant::Units::J,
    4534        5056 :                                 state.dataHeatBal->ZoneRpt(zoneNum).TotLatentGain,
    4535             :                                 OutputProcessor::TimeStepType::Zone,
    4536             :                                 OutputProcessor::StoreType::Sum,
    4537        5056 :                                 state.dataHeatBal->Zone(zoneNum).Name);
    4538       10112 :             SetupOutputVariable(state,
    4539             :                                 "Zone Total Internal Latent Gain Rate",
    4540             :                                 Constant::Units::W,
    4541        5056 :                                 state.dataHeatBal->ZoneRpt(zoneNum).TotLatentGainRate,
    4542             :                                 OutputProcessor::TimeStepType::Zone,
    4543             :                                 OutputProcessor::StoreType::Average,
    4544        5056 :                                 state.dataHeatBal->Zone(zoneNum).Name);
    4545       10112 :             SetupOutputVariable(state,
    4546             :                                 "Zone Total Internal Total Heating Energy",
    4547             :                                 Constant::Units::J,
    4548        5056 :                                 state.dataHeatBal->ZoneRpt(zoneNum).TotTotalHeatGain,
    4549             :                                 OutputProcessor::TimeStepType::Zone,
    4550             :                                 OutputProcessor::StoreType::Sum,
    4551        5056 :                                 state.dataHeatBal->Zone(zoneNum).Name);
    4552       10112 :             SetupOutputVariable(state,
    4553             :                                 "Zone Total Internal Total Heating Rate",
    4554             :                                 Constant::Units::W,
    4555        5056 :                                 state.dataHeatBal->ZoneRpt(zoneNum).TotTotalHeatGainRate,
    4556             :                                 OutputProcessor::TimeStepType::Zone,
    4557             :                                 OutputProcessor::StoreType::Average,
    4558        5056 :                                 state.dataHeatBal->Zone(zoneNum).Name);
    4559             :         }
    4560             : 
    4561        5864 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    4562             :             // Overall Space Variables
    4563       10136 :             SetupOutputVariable(state,
    4564             :                                 "Space Total Internal Radiant Heating Energy",
    4565             :                                 Constant::Units::J,
    4566        5068 :                                 state.dataHeatBal->spaceRpt(spaceNum).TotRadiantGain,
    4567             :                                 OutputProcessor::TimeStepType::Zone,
    4568             :                                 OutputProcessor::StoreType::Sum,
    4569        5068 :                                 state.dataHeatBal->space(spaceNum).Name);
    4570       10136 :             SetupOutputVariable(state,
    4571             :                                 "Space Total Internal Radiant Heating Rate",
    4572             :                                 Constant::Units::W,
    4573        5068 :                                 state.dataHeatBal->spaceRpt(spaceNum).TotRadiantGainRate,
    4574             :                                 OutputProcessor::TimeStepType::Zone,
    4575             :                                 OutputProcessor::StoreType::Average,
    4576        5068 :                                 state.dataHeatBal->space(spaceNum).Name);
    4577       10136 :             SetupOutputVariable(state,
    4578             :                                 "Space Total Internal Visible Radiation Heating Energy",
    4579             :                                 Constant::Units::J,
    4580        5068 :                                 state.dataHeatBal->spaceRpt(spaceNum).TotVisHeatGain,
    4581             :                                 OutputProcessor::TimeStepType::Zone,
    4582             :                                 OutputProcessor::StoreType::Sum,
    4583        5068 :                                 state.dataHeatBal->space(spaceNum).Name);
    4584       10136 :             SetupOutputVariable(state,
    4585             :                                 "Space Total Internal Visible Radiation Heating Rate",
    4586             :                                 Constant::Units::W,
    4587        5068 :                                 state.dataHeatBal->spaceRpt(spaceNum).TotVisHeatGainRate,
    4588             :                                 OutputProcessor::TimeStepType::Zone,
    4589             :                                 OutputProcessor::StoreType::Average,
    4590        5068 :                                 state.dataHeatBal->space(spaceNum).Name);
    4591       10136 :             SetupOutputVariable(state,
    4592             :                                 "Space Total Internal Convective Heating Energy",
    4593             :                                 Constant::Units::J,
    4594        5068 :                                 state.dataHeatBal->spaceRpt(spaceNum).TotConvectiveGain,
    4595             :                                 OutputProcessor::TimeStepType::Zone,
    4596             :                                 OutputProcessor::StoreType::Sum,
    4597        5068 :                                 state.dataHeatBal->space(spaceNum).Name);
    4598       10136 :             SetupOutputVariable(state,
    4599             :                                 "Space Total Internal Convective Heating Rate",
    4600             :                                 Constant::Units::W,
    4601        5068 :                                 state.dataHeatBal->spaceRpt(spaceNum).TotConvectiveGainRate,
    4602             :                                 OutputProcessor::TimeStepType::Zone,
    4603             :                                 OutputProcessor::StoreType::Average,
    4604        5068 :                                 state.dataHeatBal->space(spaceNum).Name);
    4605       10136 :             SetupOutputVariable(state,
    4606             :                                 "Space Total Internal Latent Gain Energy",
    4607             :                                 Constant::Units::J,
    4608        5068 :                                 state.dataHeatBal->spaceRpt(spaceNum).TotLatentGain,
    4609             :                                 OutputProcessor::TimeStepType::Zone,
    4610             :                                 OutputProcessor::StoreType::Sum,
    4611        5068 :                                 state.dataHeatBal->space(spaceNum).Name);
    4612       10136 :             SetupOutputVariable(state,
    4613             :                                 "Space Total Internal Latent Gain Rate",
    4614             :                                 Constant::Units::W,
    4615        5068 :                                 state.dataHeatBal->spaceRpt(spaceNum).TotLatentGainRate,
    4616             :                                 OutputProcessor::TimeStepType::Zone,
    4617             :                                 OutputProcessor::StoreType::Average,
    4618        5068 :                                 state.dataHeatBal->space(spaceNum).Name);
    4619       10136 :             SetupOutputVariable(state,
    4620             :                                 "Space Total Internal Total Heating Energy",
    4621             :                                 Constant::Units::J,
    4622        5068 :                                 state.dataHeatBal->spaceRpt(spaceNum).TotTotalHeatGain,
    4623             :                                 OutputProcessor::TimeStepType::Zone,
    4624             :                                 OutputProcessor::StoreType::Sum,
    4625        5068 :                                 state.dataHeatBal->space(spaceNum).Name);
    4626       10136 :             SetupOutputVariable(state,
    4627             :                                 "Space Total Internal Total Heating Rate",
    4628             :                                 Constant::Units::W,
    4629        5068 :                                 state.dataHeatBal->spaceRpt(spaceNum).TotTotalHeatGainRate,
    4630             :                                 OutputProcessor::TimeStepType::Zone,
    4631             :                                 OutputProcessor::StoreType::Average,
    4632        5068 :                                 state.dataHeatBal->space(spaceNum).Name);
    4633             :         }
    4634             : 
    4635             :         // Add zone and space outputs only where the particular type of equipment is actually present
    4636         796 :         Array1D_bool addZoneOutputs;
    4637         796 :         addZoneOutputs.dimension(state.dataGlobal->NumOfZones, false);
    4638         796 :         Array1D_bool addSpaceOutputs;
    4639         796 :         addSpaceOutputs.dimension(state.dataGlobal->numSpaces, false);
    4640             : 
    4641        4910 :         for (int peopleNum = 1; peopleNum <= state.dataHeatBal->TotPeople; ++peopleNum) {
    4642             :             // Set flags for zone and space total report variables
    4643        4114 :             addZoneOutputs(state.dataHeatBal->People(peopleNum).ZonePtr) = true;
    4644        4114 :             addSpaceOutputs(state.dataHeatBal->People(peopleNum).spaceIndex) = true;
    4645             :             // Object report variables
    4646        8228 :             SetupOutputVariable(state,
    4647             :                                 "People Occupant Count",
    4648             :                                 Constant::Units::None,
    4649        4114 :                                 state.dataHeatBal->People(peopleNum).NumOcc,
    4650             :                                 OutputProcessor::TimeStepType::Zone,
    4651             :                                 OutputProcessor::StoreType::Average,
    4652        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4653        8228 :             SetupOutputVariable(state,
    4654             :                                 "People Radiant Heating Energy",
    4655             :                                 Constant::Units::J,
    4656        4114 :                                 state.dataHeatBal->People(peopleNum).RadGainEnergy,
    4657             :                                 OutputProcessor::TimeStepType::Zone,
    4658             :                                 OutputProcessor::StoreType::Sum,
    4659        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4660        8228 :             SetupOutputVariable(state,
    4661             :                                 "People Radiant Heating Rate",
    4662             :                                 Constant::Units::W,
    4663        4114 :                                 state.dataHeatBal->People(peopleNum).RadGainRate,
    4664             :                                 OutputProcessor::TimeStepType::Zone,
    4665             :                                 OutputProcessor::StoreType::Average,
    4666        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4667        8228 :             SetupOutputVariable(state,
    4668             :                                 "People Convective Heating Energy",
    4669             :                                 Constant::Units::J,
    4670        4114 :                                 state.dataHeatBal->People(peopleNum).ConGainEnergy,
    4671             :                                 OutputProcessor::TimeStepType::Zone,
    4672             :                                 OutputProcessor::StoreType::Sum,
    4673        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4674        8228 :             SetupOutputVariable(state,
    4675             :                                 "People Convective Heating Rate",
    4676             :                                 Constant::Units::W,
    4677        4114 :                                 state.dataHeatBal->People(peopleNum).ConGainRate,
    4678             :                                 OutputProcessor::TimeStepType::Zone,
    4679             :                                 OutputProcessor::StoreType::Average,
    4680        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4681        8228 :             SetupOutputVariable(state,
    4682             :                                 "People Sensible Heating Energy",
    4683             :                                 Constant::Units::J,
    4684        4114 :                                 state.dataHeatBal->People(peopleNum).SenGainEnergy,
    4685             :                                 OutputProcessor::TimeStepType::Zone,
    4686             :                                 OutputProcessor::StoreType::Sum,
    4687        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4688        8228 :             SetupOutputVariable(state,
    4689             :                                 "People Sensible Heating Rate",
    4690             :                                 Constant::Units::W,
    4691        4114 :                                 state.dataHeatBal->People(peopleNum).SenGainRate,
    4692             :                                 OutputProcessor::TimeStepType::Zone,
    4693             :                                 OutputProcessor::StoreType::Average,
    4694        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4695        8228 :             SetupOutputVariable(state,
    4696             :                                 "People Latent Gain Energy",
    4697             :                                 Constant::Units::J,
    4698        4114 :                                 state.dataHeatBal->People(peopleNum).LatGainEnergy,
    4699             :                                 OutputProcessor::TimeStepType::Zone,
    4700             :                                 OutputProcessor::StoreType::Sum,
    4701        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4702        8228 :             SetupOutputVariable(state,
    4703             :                                 "People Latent Gain Rate",
    4704             :                                 Constant::Units::W,
    4705        4114 :                                 state.dataHeatBal->People(peopleNum).LatGainRate,
    4706             :                                 OutputProcessor::TimeStepType::Zone,
    4707             :                                 OutputProcessor::StoreType::Average,
    4708        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4709        8228 :             SetupOutputVariable(state,
    4710             :                                 "People Total Heating Energy",
    4711             :                                 Constant::Units::J,
    4712        4114 :                                 state.dataHeatBal->People(peopleNum).TotGainEnergy,
    4713             :                                 OutputProcessor::TimeStepType::Zone,
    4714             :                                 OutputProcessor::StoreType::Sum,
    4715        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4716        8228 :             SetupOutputVariable(state,
    4717             :                                 "People Total Heating Rate",
    4718             :                                 Constant::Units::W,
    4719        4114 :                                 state.dataHeatBal->People(peopleNum).TotGainRate,
    4720             :                                 OutputProcessor::TimeStepType::Zone,
    4721             :                                 OutputProcessor::StoreType::Average,
    4722        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4723        8228 :             SetupOutputVariable(state,
    4724             :                                 "People Air Temperature",
    4725             :                                 Constant::Units::C,
    4726        4114 :                                 state.dataHeatBal->People(peopleNum).TemperatureInZone,
    4727             :                                 OutputProcessor::TimeStepType::Zone,
    4728             :                                 OutputProcessor::StoreType::Average,
    4729        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4730        8228 :             SetupOutputVariable(state,
    4731             :                                 "People Air Relative Humidity",
    4732             :                                 Constant::Units::Perc,
    4733        4114 :                                 state.dataHeatBal->People(peopleNum).RelativeHumidityInZone,
    4734             :                                 OutputProcessor::TimeStepType::Zone,
    4735             :                                 OutputProcessor::StoreType::Average,
    4736        4114 :                                 state.dataHeatBal->People(peopleNum).Name);
    4737             :         }
    4738             : 
    4739        5852 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
    4740        5056 :             if (addZoneOutputs(zoneNum)) {
    4741             :                 // Zone total report variables
    4742        8138 :                 SetupOutputVariable(state,
    4743             :                                     "Zone People Occupant Count",
    4744             :                                     Constant::Units::None,
    4745        4069 :                                     state.dataHeatBal->ZoneRpt(zoneNum).PeopleNumOcc,
    4746             :                                     OutputProcessor::TimeStepType::Zone,
    4747             :                                     OutputProcessor::StoreType::Average,
    4748        4069 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    4749        8138 :                 SetupOutputVariable(state,
    4750             :                                     "Zone People Radiant Heating Energy",
    4751             :                                     Constant::Units::J,
    4752        4069 :                                     state.dataHeatBal->ZoneRpt(zoneNum).PeopleRadGain,
    4753             :                                     OutputProcessor::TimeStepType::Zone,
    4754             :                                     OutputProcessor::StoreType::Sum,
    4755        4069 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    4756        8138 :                 SetupOutputVariable(state,
    4757             :                                     "Zone People Radiant Heating Rate",
    4758             :                                     Constant::Units::W,
    4759        4069 :                                     state.dataHeatBal->ZoneRpt(zoneNum).PeopleRadGainRate,
    4760             :                                     OutputProcessor::TimeStepType::Zone,
    4761             :                                     OutputProcessor::StoreType::Average,
    4762        4069 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    4763        8138 :                 SetupOutputVariable(state,
    4764             :                                     "Zone People Convective Heating Energy",
    4765             :                                     Constant::Units::J,
    4766        4069 :                                     state.dataHeatBal->ZoneRpt(zoneNum).PeopleConGain,
    4767             :                                     OutputProcessor::TimeStepType::Zone,
    4768             :                                     OutputProcessor::StoreType::Sum,
    4769        4069 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    4770        8138 :                 SetupOutputVariable(state,
    4771             :                                     "Zone People Convective Heating Rate",
    4772             :                                     Constant::Units::W,
    4773        4069 :                                     state.dataHeatBal->ZoneRpt(zoneNum).PeopleConGainRate,
    4774             :                                     OutputProcessor::TimeStepType::Zone,
    4775             :                                     OutputProcessor::StoreType::Average,
    4776        4069 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    4777        8138 :                 SetupOutputVariable(state,
    4778             :                                     "Zone People Sensible Heating Energy",
    4779             :                                     Constant::Units::J,
    4780        4069 :                                     state.dataHeatBal->ZoneRpt(zoneNum).PeopleSenGain,
    4781             :                                     OutputProcessor::TimeStepType::Zone,
    4782             :                                     OutputProcessor::StoreType::Sum,
    4783        4069 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    4784        8138 :                 SetupOutputVariable(state,
    4785             :                                     "Zone People Sensible Heating Rate",
    4786             :                                     Constant::Units::W,
    4787        4069 :                                     state.dataHeatBal->ZoneRpt(zoneNum).PeopleSenGainRate,
    4788             :                                     OutputProcessor::TimeStepType::Zone,
    4789             :                                     OutputProcessor::StoreType::Average,
    4790        4069 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    4791        8138 :                 SetupOutputVariable(state,
    4792             :                                     "Zone People Latent Gain Energy",
    4793             :                                     Constant::Units::J,
    4794        4069 :                                     state.dataHeatBal->ZoneRpt(zoneNum).PeopleLatGain,
    4795             :                                     OutputProcessor::TimeStepType::Zone,
    4796             :                                     OutputProcessor::StoreType::Sum,
    4797        4069 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    4798        8138 :                 SetupOutputVariable(state,
    4799             :                                     "Zone People Latent Gain Rate",
    4800             :                                     Constant::Units::W,
    4801        4069 :                                     state.dataHeatBal->ZoneRpt(zoneNum).PeopleLatGainRate,
    4802             :                                     OutputProcessor::TimeStepType::Zone,
    4803             :                                     OutputProcessor::StoreType::Average,
    4804        4069 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    4805        8138 :                 SetupOutputVariable(state,
    4806             :                                     "Zone People Total Heating Energy",
    4807             :                                     Constant::Units::J,
    4808        4069 :                                     state.dataHeatBal->ZoneRpt(zoneNum).PeopleTotGain,
    4809             :                                     OutputProcessor::TimeStepType::Zone,
    4810             :                                     OutputProcessor::StoreType::Sum,
    4811        4069 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    4812        8138 :                 SetupOutputVariable(state,
    4813             :                                     "Zone People Total Heating Rate",
    4814             :                                     Constant::Units::W,
    4815        4069 :                                     state.dataHeatBal->ZoneRpt(zoneNum).PeopleTotGainRate,
    4816             :                                     OutputProcessor::TimeStepType::Zone,
    4817             :                                     OutputProcessor::StoreType::Average,
    4818        4069 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    4819             :             }
    4820             :             // Reset zone output flag
    4821        5056 :             addZoneOutputs(zoneNum) = false;
    4822             :         }
    4823             : 
    4824             :         // Space total report variables
    4825        5864 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    4826        5068 :             if (addSpaceOutputs(spaceNum)) {
    4827        8162 :                 SetupOutputVariable(state,
    4828             :                                     "Space People Occupant Count",
    4829             :                                     Constant::Units::None,
    4830        4081 :                                     state.dataHeatBal->spaceRpt(spaceNum).PeopleNumOcc,
    4831             :                                     OutputProcessor::TimeStepType::Zone,
    4832             :                                     OutputProcessor::StoreType::Average,
    4833        4081 :                                     state.dataHeatBal->space(spaceNum).Name);
    4834        8162 :                 SetupOutputVariable(state,
    4835             :                                     "Space People Radiant Heating Energy",
    4836             :                                     Constant::Units::J,
    4837        4081 :                                     state.dataHeatBal->spaceRpt(spaceNum).PeopleRadGain,
    4838             :                                     OutputProcessor::TimeStepType::Zone,
    4839             :                                     OutputProcessor::StoreType::Sum,
    4840        4081 :                                     state.dataHeatBal->space(spaceNum).Name);
    4841        8162 :                 SetupOutputVariable(state,
    4842             :                                     "Space People Radiant Heating Rate",
    4843             :                                     Constant::Units::W,
    4844        4081 :                                     state.dataHeatBal->spaceRpt(spaceNum).PeopleRadGainRate,
    4845             :                                     OutputProcessor::TimeStepType::Zone,
    4846             :                                     OutputProcessor::StoreType::Average,
    4847        4081 :                                     state.dataHeatBal->space(spaceNum).Name);
    4848        8162 :                 SetupOutputVariable(state,
    4849             :                                     "Space People Convective Heating Energy",
    4850             :                                     Constant::Units::J,
    4851        4081 :                                     state.dataHeatBal->spaceRpt(spaceNum).PeopleConGain,
    4852             :                                     OutputProcessor::TimeStepType::Zone,
    4853             :                                     OutputProcessor::StoreType::Sum,
    4854        4081 :                                     state.dataHeatBal->space(spaceNum).Name);
    4855        8162 :                 SetupOutputVariable(state,
    4856             :                                     "Space People Convective Heating Rate",
    4857             :                                     Constant::Units::W,
    4858        4081 :                                     state.dataHeatBal->spaceRpt(spaceNum).PeopleConGainRate,
    4859             :                                     OutputProcessor::TimeStepType::Zone,
    4860             :                                     OutputProcessor::StoreType::Average,
    4861        4081 :                                     state.dataHeatBal->space(spaceNum).Name);
    4862        8162 :                 SetupOutputVariable(state,
    4863             :                                     "Space People Sensible Heating Energy",
    4864             :                                     Constant::Units::J,
    4865        4081 :                                     state.dataHeatBal->spaceRpt(spaceNum).PeopleSenGain,
    4866             :                                     OutputProcessor::TimeStepType::Zone,
    4867             :                                     OutputProcessor::StoreType::Sum,
    4868        4081 :                                     state.dataHeatBal->space(spaceNum).Name);
    4869        8162 :                 SetupOutputVariable(state,
    4870             :                                     "Space People Sensible Heating Rate",
    4871             :                                     Constant::Units::W,
    4872        4081 :                                     state.dataHeatBal->spaceRpt(spaceNum).PeopleSenGainRate,
    4873             :                                     OutputProcessor::TimeStepType::Zone,
    4874             :                                     OutputProcessor::StoreType::Average,
    4875        4081 :                                     state.dataHeatBal->space(spaceNum).Name);
    4876        8162 :                 SetupOutputVariable(state,
    4877             :                                     "Space People Latent Gain Energy",
    4878             :                                     Constant::Units::J,
    4879        4081 :                                     state.dataHeatBal->spaceRpt(spaceNum).PeopleLatGain,
    4880             :                                     OutputProcessor::TimeStepType::Zone,
    4881             :                                     OutputProcessor::StoreType::Sum,
    4882        4081 :                                     state.dataHeatBal->space(spaceNum).Name);
    4883        8162 :                 SetupOutputVariable(state,
    4884             :                                     "Space People Latent Gain Rate",
    4885             :                                     Constant::Units::W,
    4886        4081 :                                     state.dataHeatBal->spaceRpt(spaceNum).PeopleLatGainRate,
    4887             :                                     OutputProcessor::TimeStepType::Zone,
    4888             :                                     OutputProcessor::StoreType::Average,
    4889        4081 :                                     state.dataHeatBal->space(spaceNum).Name);
    4890        8162 :                 SetupOutputVariable(state,
    4891             :                                     "Space People Total Heating Energy",
    4892             :                                     Constant::Units::J,
    4893        4081 :                                     state.dataHeatBal->spaceRpt(spaceNum).PeopleTotGain,
    4894             :                                     OutputProcessor::TimeStepType::Zone,
    4895             :                                     OutputProcessor::StoreType::Sum,
    4896        4081 :                                     state.dataHeatBal->space(spaceNum).Name);
    4897        8162 :                 SetupOutputVariable(state,
    4898             :                                     "Space People Total Heating Rate",
    4899             :                                     Constant::Units::W,
    4900        4081 :                                     state.dataHeatBal->spaceRpt(spaceNum).PeopleTotGainRate,
    4901             :                                     OutputProcessor::TimeStepType::Zone,
    4902             :                                     OutputProcessor::StoreType::Average,
    4903        4081 :                                     state.dataHeatBal->space(spaceNum).Name);
    4904             :             }
    4905             :             // Reset space output flag
    4906        5068 :             addSpaceOutputs(spaceNum) = false;
    4907             :         }
    4908             : 
    4909        5125 :         for (int lightsNum = 1; lightsNum <= state.dataHeatBal->TotLights; ++lightsNum) {
    4910             :             // Set flags for zone and space total report variables
    4911        4329 :             addZoneOutputs(state.dataHeatBal->Lights(lightsNum).ZonePtr) = true;
    4912        4329 :             addSpaceOutputs(state.dataHeatBal->Lights(lightsNum).spaceIndex) = true;
    4913             :             // Object report variables
    4914        8658 :             SetupOutputVariable(state,
    4915             :                                 "Lights Electricity Rate",
    4916             :                                 Constant::Units::W,
    4917        4329 :                                 state.dataHeatBal->Lights(lightsNum).Power,
    4918             :                                 OutputProcessor::TimeStepType::Zone,
    4919             :                                 OutputProcessor::StoreType::Average,
    4920        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name);
    4921             : 
    4922        8658 :             SetupOutputVariable(state,
    4923             :                                 "Lights Radiant Heating Energy",
    4924             :                                 Constant::Units::J,
    4925        4329 :                                 state.dataHeatBal->Lights(lightsNum).RadGainEnergy,
    4926             :                                 OutputProcessor::TimeStepType::Zone,
    4927             :                                 OutputProcessor::StoreType::Sum,
    4928        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name);
    4929        8658 :             SetupOutputVariable(state,
    4930             :                                 "Lights Radiant Heating Rate",
    4931             :                                 Constant::Units::W,
    4932        4329 :                                 state.dataHeatBal->Lights(lightsNum).RadGainRate,
    4933             :                                 OutputProcessor::TimeStepType::Zone,
    4934             :                                 OutputProcessor::StoreType::Average,
    4935        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name);
    4936        8658 :             SetupOutputVariable(state,
    4937             :                                 "Lights Visible Radiation Heating Energy",
    4938             :                                 Constant::Units::J,
    4939        4329 :                                 state.dataHeatBal->Lights(lightsNum).VisGainEnergy,
    4940             :                                 OutputProcessor::TimeStepType::Zone,
    4941             :                                 OutputProcessor::StoreType::Sum,
    4942        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name);
    4943             : 
    4944        8658 :             SetupOutputVariable(state,
    4945             :                                 "Lights Visible Radiation Heating Rate",
    4946             :                                 Constant::Units::W,
    4947        4329 :                                 state.dataHeatBal->Lights(lightsNum).VisGainRate,
    4948             :                                 OutputProcessor::TimeStepType::Zone,
    4949             :                                 OutputProcessor::StoreType::Average,
    4950        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name);
    4951        8658 :             SetupOutputVariable(state,
    4952             :                                 "Lights Convective Heating Energy",
    4953             :                                 Constant::Units::J,
    4954        4329 :                                 state.dataHeatBal->Lights(lightsNum).ConGainEnergy,
    4955             :                                 OutputProcessor::TimeStepType::Zone,
    4956             :                                 OutputProcessor::StoreType::Sum,
    4957        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name);
    4958        8658 :             SetupOutputVariable(state,
    4959             :                                 "Lights Convective Heating Rate",
    4960             :                                 Constant::Units::W,
    4961        4329 :                                 state.dataHeatBal->Lights(lightsNum).ConGainRate,
    4962             :                                 OutputProcessor::TimeStepType::Zone,
    4963             :                                 OutputProcessor::StoreType::Average,
    4964        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name);
    4965        8658 :             SetupOutputVariable(state,
    4966             :                                 "Lights Return Air Heating Energy",
    4967             :                                 Constant::Units::J,
    4968        4329 :                                 state.dataHeatBal->Lights(lightsNum).RetAirGainEnergy,
    4969             :                                 OutputProcessor::TimeStepType::Zone,
    4970             :                                 OutputProcessor::StoreType::Sum,
    4971        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name);
    4972        8658 :             SetupOutputVariable(state,
    4973             :                                 "Lights Return Air Heating Rate",
    4974             :                                 Constant::Units::W,
    4975        4329 :                                 state.dataHeatBal->Lights(lightsNum).RetAirGainRate,
    4976             :                                 OutputProcessor::TimeStepType::Zone,
    4977             :                                 OutputProcessor::StoreType::Average,
    4978        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name);
    4979        8658 :             SetupOutputVariable(state,
    4980             :                                 "Lights Total Heating Energy",
    4981             :                                 Constant::Units::J,
    4982        4329 :                                 state.dataHeatBal->Lights(lightsNum).TotGainEnergy,
    4983             :                                 OutputProcessor::TimeStepType::Zone,
    4984             :                                 OutputProcessor::StoreType::Sum,
    4985        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name);
    4986        8658 :             SetupOutputVariable(state,
    4987             :                                 "Lights Total Heating Rate",
    4988             :                                 Constant::Units::W,
    4989        4329 :                                 state.dataHeatBal->Lights(lightsNum).TotGainRate,
    4990             :                                 OutputProcessor::TimeStepType::Zone,
    4991             :                                 OutputProcessor::StoreType::Average,
    4992        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name);
    4993        8658 :             SetupOutputVariable(state,
    4994             :                                 "Lights Electricity Energy",
    4995             :                                 Constant::Units::J,
    4996        4329 :                                 state.dataHeatBal->Lights(lightsNum).Consumption,
    4997             :                                 OutputProcessor::TimeStepType::Zone,
    4998             :                                 OutputProcessor::StoreType::Sum,
    4999        4329 :                                 state.dataHeatBal->Lights(lightsNum).Name,
    5000             :                                 Constant::eResource::Electricity,
    5001             :                                 OutputProcessor::Group::Building,
    5002             :                                 OutputProcessor::EndUseCat::InteriorLights,
    5003        4329 :                                 state.dataHeatBal->Lights(lightsNum).EndUseSubcategory,
    5004        4329 :                                 state.dataHeatBal->Zone(state.dataHeatBal->Lights(lightsNum).ZonePtr).Name,
    5005        4329 :                                 state.dataHeatBal->Zone(state.dataHeatBal->Lights(lightsNum).ZonePtr).Multiplier,
    5006        4329 :                                 state.dataHeatBal->Zone(state.dataHeatBal->Lights(lightsNum).ZonePtr).ListMultiplier,
    5007        4329 :                                 state.dataHeatBal->space(state.dataHeatBal->Lights(lightsNum).spaceIndex).spaceType);
    5008             :         }
    5009             : 
    5010             :         // Zone total report variables
    5011        5852 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
    5012        5056 :             if (addZoneOutputs(zoneNum)) {
    5013        8242 :                 SetupOutputVariable(state,
    5014             :                                     "Zone Lights Electricity Rate",
    5015             :                                     Constant::Units::W,
    5016        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsPower,
    5017             :                                     OutputProcessor::TimeStepType::Zone,
    5018             :                                     OutputProcessor::StoreType::Average,
    5019        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5020        8242 :                 SetupOutputVariable(state,
    5021             :                                     "Zone Lights Electricity Energy",
    5022             :                                     Constant::Units::J,
    5023        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsElecConsump,
    5024             :                                     OutputProcessor::TimeStepType::Zone,
    5025             :                                     OutputProcessor::StoreType::Sum,
    5026        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5027        8242 :                 SetupOutputVariable(state,
    5028             :                                     "Zone Lights Radiant Heating Energy",
    5029             :                                     Constant::Units::J,
    5030        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsRadGain,
    5031             :                                     OutputProcessor::TimeStepType::Zone,
    5032             :                                     OutputProcessor::StoreType::Sum,
    5033        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5034        8242 :                 SetupOutputVariable(state,
    5035             :                                     "Zone Lights Radiant Heating Rate",
    5036             :                                     Constant::Units::W,
    5037        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsRadGainRate,
    5038             :                                     OutputProcessor::TimeStepType::Zone,
    5039             :                                     OutputProcessor::StoreType::Average,
    5040        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5041        8242 :                 SetupOutputVariable(state,
    5042             :                                     "Zone Lights Visible Radiation Heating Energy",
    5043             :                                     Constant::Units::J,
    5044        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsVisGain,
    5045             :                                     OutputProcessor::TimeStepType::Zone,
    5046             :                                     OutputProcessor::StoreType::Sum,
    5047        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5048        8242 :                 SetupOutputVariable(state,
    5049             :                                     "Zone Lights Visible Radiation Heating Rate",
    5050             :                                     Constant::Units::W,
    5051        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsVisGainRate,
    5052             :                                     OutputProcessor::TimeStepType::Zone,
    5053             :                                     OutputProcessor::StoreType::Average,
    5054        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5055        8242 :                 SetupOutputVariable(state,
    5056             :                                     "Zone Lights Convective Heating Energy",
    5057             :                                     Constant::Units::J,
    5058        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsConGain,
    5059             :                                     OutputProcessor::TimeStepType::Zone,
    5060             :                                     OutputProcessor::StoreType::Sum,
    5061        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5062        8242 :                 SetupOutputVariable(state,
    5063             :                                     "Zone Lights Convective Heating Rate",
    5064             :                                     Constant::Units::W,
    5065        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsConGainRate,
    5066             :                                     OutputProcessor::TimeStepType::Zone,
    5067             :                                     OutputProcessor::StoreType::Average,
    5068        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5069        8242 :                 SetupOutputVariable(state,
    5070             :                                     "Zone Lights Return Air Heating Energy",
    5071             :                                     Constant::Units::J,
    5072        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsRetAirGain,
    5073             :                                     OutputProcessor::TimeStepType::Zone,
    5074             :                                     OutputProcessor::StoreType::Sum,
    5075        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5076        8242 :                 SetupOutputVariable(state,
    5077             :                                     "Zone Lights Return Air Heating Rate",
    5078             :                                     Constant::Units::W,
    5079        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsRetAirGainRate,
    5080             :                                     OutputProcessor::TimeStepType::Zone,
    5081             :                                     OutputProcessor::StoreType::Average,
    5082        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5083        8242 :                 SetupOutputVariable(state,
    5084             :                                     "Zone Lights Total Heating Energy",
    5085             :                                     Constant::Units::J,
    5086        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsTotGain,
    5087             :                                     OutputProcessor::TimeStepType::Zone,
    5088             :                                     OutputProcessor::StoreType::Sum,
    5089        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5090        8242 :                 SetupOutputVariable(state,
    5091             :                                     "Zone Lights Total Heating Rate",
    5092             :                                     Constant::Units::W,
    5093        4121 :                                     state.dataHeatBal->ZoneRpt(zoneNum).LtsTotGainRate,
    5094             :                                     OutputProcessor::TimeStepType::Zone,
    5095             :                                     OutputProcessor::StoreType::Average,
    5096        4121 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5097             :             }
    5098             :             // Reset zone output flag
    5099        5056 :             addZoneOutputs(zoneNum) = false;
    5100             :         }
    5101             : 
    5102             :         // Space total report variables
    5103        5864 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    5104        5068 :             if (addSpaceOutputs(spaceNum)) {
    5105        8266 :                 SetupOutputVariable(state,
    5106             :                                     "Space Lights Electricity Rate",
    5107             :                                     Constant::Units::W,
    5108        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsPower,
    5109             :                                     OutputProcessor::TimeStepType::Zone,
    5110             :                                     OutputProcessor::StoreType::Average,
    5111        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5112        8266 :                 SetupOutputVariable(state,
    5113             :                                     "Space Lights Electricity Energy",
    5114             :                                     Constant::Units::J,
    5115        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsElecConsump,
    5116             :                                     OutputProcessor::TimeStepType::Zone,
    5117             :                                     OutputProcessor::StoreType::Sum,
    5118        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5119        8266 :                 SetupOutputVariable(state,
    5120             :                                     "Space Lights Radiant Heating Energy",
    5121             :                                     Constant::Units::J,
    5122        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsRadGain,
    5123             :                                     OutputProcessor::TimeStepType::Zone,
    5124             :                                     OutputProcessor::StoreType::Sum,
    5125        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5126        8266 :                 SetupOutputVariable(state,
    5127             :                                     "Space Lights Radiant Heating Rate",
    5128             :                                     Constant::Units::W,
    5129        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsRadGainRate,
    5130             :                                     OutputProcessor::TimeStepType::Zone,
    5131             :                                     OutputProcessor::StoreType::Average,
    5132        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5133        8266 :                 SetupOutputVariable(state,
    5134             :                                     "Space Lights Visible Radiation Heating Energy",
    5135             :                                     Constant::Units::J,
    5136        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsVisGain,
    5137             :                                     OutputProcessor::TimeStepType::Zone,
    5138             :                                     OutputProcessor::StoreType::Sum,
    5139        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5140        8266 :                 SetupOutputVariable(state,
    5141             :                                     "Space Lights Visible Radiation Heating Rate",
    5142             :                                     Constant::Units::W,
    5143        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsVisGainRate,
    5144             :                                     OutputProcessor::TimeStepType::Zone,
    5145             :                                     OutputProcessor::StoreType::Average,
    5146        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5147        8266 :                 SetupOutputVariable(state,
    5148             :                                     "Space Lights Convective Heating Energy",
    5149             :                                     Constant::Units::J,
    5150        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsConGain,
    5151             :                                     OutputProcessor::TimeStepType::Zone,
    5152             :                                     OutputProcessor::StoreType::Sum,
    5153        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5154        8266 :                 SetupOutputVariable(state,
    5155             :                                     "Space Lights Convective Heating Rate",
    5156             :                                     Constant::Units::W,
    5157        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsConGainRate,
    5158             :                                     OutputProcessor::TimeStepType::Zone,
    5159             :                                     OutputProcessor::StoreType::Average,
    5160        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5161        8266 :                 SetupOutputVariable(state,
    5162             :                                     "Space Lights Return Air Heating Energy",
    5163             :                                     Constant::Units::J,
    5164        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsRetAirGain,
    5165             :                                     OutputProcessor::TimeStepType::Zone,
    5166             :                                     OutputProcessor::StoreType::Sum,
    5167        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5168        8266 :                 SetupOutputVariable(state,
    5169             :                                     "Space Lights Return Air Heating Rate",
    5170             :                                     Constant::Units::W,
    5171        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsRetAirGainRate,
    5172             :                                     OutputProcessor::TimeStepType::Zone,
    5173             :                                     OutputProcessor::StoreType::Average,
    5174        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5175        8266 :                 SetupOutputVariable(state,
    5176             :                                     "Space Lights Total Heating Energy",
    5177             :                                     Constant::Units::J,
    5178        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsTotGain,
    5179             :                                     OutputProcessor::TimeStepType::Zone,
    5180             :                                     OutputProcessor::StoreType::Sum,
    5181        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5182        8266 :                 SetupOutputVariable(state,
    5183             :                                     "Space Lights Total Heating Rate",
    5184             :                                     Constant::Units::W,
    5185        4133 :                                     state.dataHeatBal->spaceRpt(spaceNum).LtsTotGainRate,
    5186             :                                     OutputProcessor::TimeStepType::Zone,
    5187             :                                     OutputProcessor::StoreType::Average,
    5188        4133 :                                     state.dataHeatBal->space(spaceNum).Name);
    5189             :             }
    5190             :             // Reset space output flag
    5191        5068 :             addSpaceOutputs(spaceNum) = false;
    5192             :         }
    5193        5195 :         for (int elecEqNum = 1; elecEqNum <= state.dataHeatBal->TotElecEquip; ++elecEqNum) {
    5194             :             // Set flags for zone and space total report variables
    5195        4399 :             addZoneOutputs(state.dataHeatBal->ZoneElectric(elecEqNum).ZonePtr) = true;
    5196        4399 :             addSpaceOutputs(state.dataHeatBal->ZoneElectric(elecEqNum).spaceIndex) = true;
    5197             :             // Object report variables
    5198        8798 :             SetupOutputVariable(state,
    5199             :                                 "Electric Equipment Electricity Rate",
    5200             :                                 Constant::Units::W,
    5201        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Power,
    5202             :                                 OutputProcessor::TimeStepType::Zone,
    5203             :                                 OutputProcessor::StoreType::Average,
    5204        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name);
    5205        8798 :             SetupOutputVariable(state,
    5206             :                                 "Electric Equipment Electricity Energy",
    5207             :                                 Constant::Units::J,
    5208        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Consumption,
    5209             :                                 OutputProcessor::TimeStepType::Zone,
    5210             :                                 OutputProcessor::StoreType::Sum,
    5211        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name,
    5212             :                                 Constant::eResource::Electricity,
    5213             :                                 OutputProcessor::Group::Building,
    5214             :                                 OutputProcessor::EndUseCat::InteriorEquipment,
    5215        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).EndUseSubcategory,
    5216        4399 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(elecEqNum).ZonePtr).Name,
    5217        4399 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(elecEqNum).ZonePtr).Multiplier,
    5218        4399 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(elecEqNum).ZonePtr).ListMultiplier,
    5219        4399 :                                 state.dataHeatBal->space(state.dataHeatBal->ZoneElectric(elecEqNum).spaceIndex).spaceType);
    5220             : 
    5221        8798 :             SetupOutputVariable(state,
    5222             :                                 "Electric Equipment Radiant Heating Energy",
    5223             :                                 Constant::Units::J,
    5224        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).RadGainEnergy,
    5225             :                                 OutputProcessor::TimeStepType::Zone,
    5226             :                                 OutputProcessor::StoreType::Sum,
    5227        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name);
    5228        8798 :             SetupOutputVariable(state,
    5229             :                                 "Electric Equipment Radiant Heating Rate",
    5230             :                                 Constant::Units::W,
    5231        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).RadGainRate,
    5232             :                                 OutputProcessor::TimeStepType::Zone,
    5233             :                                 OutputProcessor::StoreType::Average,
    5234        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name);
    5235        8798 :             SetupOutputVariable(state,
    5236             :                                 "Electric Equipment Convective Heating Energy",
    5237             :                                 Constant::Units::J,
    5238        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).ConGainEnergy,
    5239             :                                 OutputProcessor::TimeStepType::Zone,
    5240             :                                 OutputProcessor::StoreType::Sum,
    5241        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name);
    5242        8798 :             SetupOutputVariable(state,
    5243             :                                 "Electric Equipment Convective Heating Rate",
    5244             :                                 Constant::Units::W,
    5245        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).ConGainRate,
    5246             :                                 OutputProcessor::TimeStepType::Zone,
    5247             :                                 OutputProcessor::StoreType::Average,
    5248        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name);
    5249        8798 :             SetupOutputVariable(state,
    5250             :                                 "Electric Equipment Latent Gain Energy",
    5251             :                                 Constant::Units::J,
    5252        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).LatGainEnergy,
    5253             :                                 OutputProcessor::TimeStepType::Zone,
    5254             :                                 OutputProcessor::StoreType::Sum,
    5255        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name);
    5256        8798 :             SetupOutputVariable(state,
    5257             :                                 "Electric Equipment Latent Gain Rate",
    5258             :                                 Constant::Units::W,
    5259        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).LatGainRate,
    5260             :                                 OutputProcessor::TimeStepType::Zone,
    5261             :                                 OutputProcessor::StoreType::Average,
    5262        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name);
    5263        8798 :             SetupOutputVariable(state,
    5264             :                                 "Electric Equipment Lost Heat Energy",
    5265             :                                 Constant::Units::J,
    5266        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).LostEnergy,
    5267             :                                 OutputProcessor::TimeStepType::Zone,
    5268             :                                 OutputProcessor::StoreType::Sum,
    5269        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name);
    5270        8798 :             SetupOutputVariable(state,
    5271             :                                 "Electric Equipment Lost Heat Rate",
    5272             :                                 Constant::Units::W,
    5273        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).LostRate,
    5274             :                                 OutputProcessor::TimeStepType::Zone,
    5275             :                                 OutputProcessor::StoreType::Average,
    5276        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name);
    5277        8798 :             SetupOutputVariable(state,
    5278             :                                 "Electric Equipment Total Heating Energy",
    5279             :                                 Constant::Units::J,
    5280        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).TotGainEnergy,
    5281             :                                 OutputProcessor::TimeStepType::Zone,
    5282             :                                 OutputProcessor::StoreType::Sum,
    5283        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name);
    5284        8798 :             SetupOutputVariable(state,
    5285             :                                 "Electric Equipment Total Heating Rate",
    5286             :                                 Constant::Units::W,
    5287        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).TotGainRate,
    5288             :                                 OutputProcessor::TimeStepType::Zone,
    5289             :                                 OutputProcessor::StoreType::Average,
    5290        4399 :                                 state.dataHeatBal->ZoneElectric(elecEqNum).Name);
    5291             :         }
    5292             : 
    5293             :         // Zone total report variables
    5294        5852 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
    5295        5056 :             if (addZoneOutputs(zoneNum)) {
    5296        8368 :                 SetupOutputVariable(state,
    5297             :                                     "Zone Electric Equipment Electricity Rate",
    5298             :                                     Constant::Units::W,
    5299        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecPower,
    5300             :                                     OutputProcessor::TimeStepType::Zone,
    5301             :                                     OutputProcessor::StoreType::Average,
    5302        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5303        8368 :                 SetupOutputVariable(state,
    5304             :                                     "Zone Electric Equipment Electricity Energy",
    5305             :                                     Constant::Units::J,
    5306        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecConsump,
    5307             :                                     OutputProcessor::TimeStepType::Zone,
    5308             :                                     OutputProcessor::StoreType::Sum,
    5309        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5310             : 
    5311        8368 :                 SetupOutputVariable(state,
    5312             :                                     "Zone Electric Equipment Radiant Heating Energy",
    5313             :                                     Constant::Units::J,
    5314        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecRadGain,
    5315             :                                     OutputProcessor::TimeStepType::Zone,
    5316             :                                     OutputProcessor::StoreType::Sum,
    5317        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5318        8368 :                 SetupOutputVariable(state,
    5319             :                                     "Zone Electric Equipment Radiant Heating Rate",
    5320             :                                     Constant::Units::W,
    5321        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecRadGainRate,
    5322             :                                     OutputProcessor::TimeStepType::Zone,
    5323             :                                     OutputProcessor::StoreType::Average,
    5324        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5325        8368 :                 SetupOutputVariable(state,
    5326             :                                     "Zone Electric Equipment Convective Heating Energy",
    5327             :                                     Constant::Units::J,
    5328        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecConGain,
    5329             :                                     OutputProcessor::TimeStepType::Zone,
    5330             :                                     OutputProcessor::StoreType::Sum,
    5331        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5332        8368 :                 SetupOutputVariable(state,
    5333             :                                     "Zone Electric Equipment Convective Heating Rate",
    5334             :                                     Constant::Units::W,
    5335        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecConGainRate,
    5336             :                                     OutputProcessor::TimeStepType::Zone,
    5337             :                                     OutputProcessor::StoreType::Average,
    5338        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5339        8368 :                 SetupOutputVariable(state,
    5340             :                                     "Zone Electric Equipment Latent Gain Energy",
    5341             :                                     Constant::Units::J,
    5342        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecLatGain,
    5343             :                                     OutputProcessor::TimeStepType::Zone,
    5344             :                                     OutputProcessor::StoreType::Sum,
    5345        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5346        8368 :                 SetupOutputVariable(state,
    5347             :                                     "Zone Electric Equipment Latent Gain Rate",
    5348             :                                     Constant::Units::W,
    5349        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecLatGainRate,
    5350             :                                     OutputProcessor::TimeStepType::Zone,
    5351             :                                     OutputProcessor::StoreType::Average,
    5352        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5353        8368 :                 SetupOutputVariable(state,
    5354             :                                     "Zone Electric Equipment Lost Heat Energy",
    5355             :                                     Constant::Units::J,
    5356        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecLost,
    5357             :                                     OutputProcessor::TimeStepType::Zone,
    5358             :                                     OutputProcessor::StoreType::Sum,
    5359        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5360        8368 :                 SetupOutputVariable(state,
    5361             :                                     "Zone Electric Equipment Lost Heat Rate",
    5362             :                                     Constant::Units::W,
    5363        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecLostRate,
    5364             :                                     OutputProcessor::TimeStepType::Zone,
    5365             :                                     OutputProcessor::StoreType::Average,
    5366        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5367        8368 :                 SetupOutputVariable(state,
    5368             :                                     "Zone Electric Equipment Total Heating Energy",
    5369             :                                     Constant::Units::J,
    5370        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecTotGain,
    5371             :                                     OutputProcessor::TimeStepType::Zone,
    5372             :                                     OutputProcessor::StoreType::Sum,
    5373        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5374        8368 :                 SetupOutputVariable(state,
    5375             :                                     "Zone Electric Equipment Total Heating Rate",
    5376             :                                     Constant::Units::W,
    5377        4184 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ElecTotGainRate,
    5378             :                                     OutputProcessor::TimeStepType::Zone,
    5379             :                                     OutputProcessor::StoreType::Average,
    5380        4184 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5381             :             }
    5382             :             // Reset zone output flag
    5383        5056 :             addZoneOutputs(zoneNum) = false;
    5384             :         }
    5385             : 
    5386             :         // space total report variables
    5387        5864 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    5388        5068 :             if (addSpaceOutputs(spaceNum)) {
    5389        8386 :                 SetupOutputVariable(state,
    5390             :                                     "Space Electric Equipment Electricity Rate",
    5391             :                                     Constant::Units::W,
    5392        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecPower,
    5393             :                                     OutputProcessor::TimeStepType::Zone,
    5394             :                                     OutputProcessor::StoreType::Average,
    5395        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5396        8386 :                 SetupOutputVariable(state,
    5397             :                                     "Space Electric Equipment Electricity Energy",
    5398             :                                     Constant::Units::J,
    5399        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecConsump,
    5400             :                                     OutputProcessor::TimeStepType::Zone,
    5401             :                                     OutputProcessor::StoreType::Sum,
    5402        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5403             : 
    5404        8386 :                 SetupOutputVariable(state,
    5405             :                                     "Space Electric Equipment Radiant Heating Energy",
    5406             :                                     Constant::Units::J,
    5407        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecRadGain,
    5408             :                                     OutputProcessor::TimeStepType::Zone,
    5409             :                                     OutputProcessor::StoreType::Sum,
    5410        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5411        8386 :                 SetupOutputVariable(state,
    5412             :                                     "Space Electric Equipment Radiant Heating Rate",
    5413             :                                     Constant::Units::W,
    5414        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecRadGainRate,
    5415             :                                     OutputProcessor::TimeStepType::Zone,
    5416             :                                     OutputProcessor::StoreType::Average,
    5417        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5418        8386 :                 SetupOutputVariable(state,
    5419             :                                     "Space Electric Equipment Convective Heating Energy",
    5420             :                                     Constant::Units::J,
    5421        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecConGain,
    5422             :                                     OutputProcessor::TimeStepType::Zone,
    5423             :                                     OutputProcessor::StoreType::Sum,
    5424        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5425        8386 :                 SetupOutputVariable(state,
    5426             :                                     "Space Electric Equipment Convective Heating Rate",
    5427             :                                     Constant::Units::W,
    5428        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecConGainRate,
    5429             :                                     OutputProcessor::TimeStepType::Zone,
    5430             :                                     OutputProcessor::StoreType::Average,
    5431        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5432        8386 :                 SetupOutputVariable(state,
    5433             :                                     "Space Electric Equipment Latent Gain Energy",
    5434             :                                     Constant::Units::J,
    5435        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecLatGain,
    5436             :                                     OutputProcessor::TimeStepType::Zone,
    5437             :                                     OutputProcessor::StoreType::Sum,
    5438        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5439        8386 :                 SetupOutputVariable(state,
    5440             :                                     "Space Electric Equipment Latent Gain Rate",
    5441             :                                     Constant::Units::W,
    5442        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecLatGainRate,
    5443             :                                     OutputProcessor::TimeStepType::Zone,
    5444             :                                     OutputProcessor::StoreType::Average,
    5445        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5446        8386 :                 SetupOutputVariable(state,
    5447             :                                     "Space Electric Equipment Lost Heat Energy",
    5448             :                                     Constant::Units::J,
    5449        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecLost,
    5450             :                                     OutputProcessor::TimeStepType::Zone,
    5451             :                                     OutputProcessor::StoreType::Sum,
    5452        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5453        8386 :                 SetupOutputVariable(state,
    5454             :                                     "Space Electric Equipment Lost Heat Rate",
    5455             :                                     Constant::Units::W,
    5456        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecLostRate,
    5457             :                                     OutputProcessor::TimeStepType::Zone,
    5458             :                                     OutputProcessor::StoreType::Average,
    5459        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5460        8386 :                 SetupOutputVariable(state,
    5461             :                                     "Space Electric Equipment Total Heating Energy",
    5462             :                                     Constant::Units::J,
    5463        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecTotGain,
    5464             :                                     OutputProcessor::TimeStepType::Zone,
    5465             :                                     OutputProcessor::StoreType::Sum,
    5466        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5467        8386 :                 SetupOutputVariable(state,
    5468             :                                     "Space Electric Equipment Total Heating Rate",
    5469             :                                     Constant::Units::W,
    5470        4193 :                                     state.dataHeatBal->spaceRpt(spaceNum).ElecTotGainRate,
    5471             :                                     OutputProcessor::TimeStepType::Zone,
    5472             :                                     OutputProcessor::StoreType::Average,
    5473        4193 :                                     state.dataHeatBal->space(spaceNum).Name);
    5474             :             }
    5475             :             // Reset space output flag
    5476        5068 :             addSpaceOutputs(spaceNum) = false;
    5477             :         }
    5478             :         // Object report variables
    5479         875 :         for (int gasEqNum = 1; gasEqNum <= state.dataHeatBal->TotGasEquip; ++gasEqNum) {
    5480             :             // Set flags for zone and space total report variables
    5481          79 :             addZoneOutputs(state.dataHeatBal->ZoneGas(gasEqNum).ZonePtr) = true;
    5482          79 :             addSpaceOutputs(state.dataHeatBal->ZoneGas(gasEqNum).spaceIndex) = true;
    5483         158 :             SetupOutputVariable(state,
    5484             :                                 "Gas Equipment NaturalGas Rate",
    5485             :                                 Constant::Units::W,
    5486          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Power,
    5487             :                                 OutputProcessor::TimeStepType::Zone,
    5488             :                                 OutputProcessor::StoreType::Average,
    5489          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name);
    5490         158 :             SetupOutputVariable(state,
    5491             :                                 "Gas Equipment NaturalGas Energy",
    5492             :                                 Constant::Units::J,
    5493          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Consumption,
    5494             :                                 OutputProcessor::TimeStepType::Zone,
    5495             :                                 OutputProcessor::StoreType::Sum,
    5496          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name,
    5497             :                                 Constant::eResource::NaturalGas,
    5498             :                                 OutputProcessor::Group::Building,
    5499             :                                 OutputProcessor::EndUseCat::InteriorEquipment,
    5500          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).EndUseSubcategory,
    5501          79 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(gasEqNum).ZonePtr).Name,
    5502          79 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(gasEqNum).ZonePtr).Multiplier,
    5503          79 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(gasEqNum).ZonePtr).ListMultiplier,
    5504          79 :                                 state.dataHeatBal->space(state.dataHeatBal->ZoneGas(gasEqNum).spaceIndex).spaceType);
    5505             : 
    5506         158 :             SetupOutputVariable(state,
    5507             :                                 "Gas Equipment Radiant Heating Energy",
    5508             :                                 Constant::Units::J,
    5509          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).RadGainEnergy,
    5510             :                                 OutputProcessor::TimeStepType::Zone,
    5511             :                                 OutputProcessor::StoreType::Sum,
    5512          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name);
    5513         158 :             SetupOutputVariable(state,
    5514             :                                 "Gas Equipment Convective Heating Energy",
    5515             :                                 Constant::Units::J,
    5516          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).ConGainEnergy,
    5517             :                                 OutputProcessor::TimeStepType::Zone,
    5518             :                                 OutputProcessor::StoreType::Sum,
    5519          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name);
    5520         158 :             SetupOutputVariable(state,
    5521             :                                 "Gas Equipment Latent Gain Energy",
    5522             :                                 Constant::Units::J,
    5523          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).LatGainEnergy,
    5524             :                                 OutputProcessor::TimeStepType::Zone,
    5525             :                                 OutputProcessor::StoreType::Sum,
    5526          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name);
    5527         158 :             SetupOutputVariable(state,
    5528             :                                 "Gas Equipment Lost Heat Energy",
    5529             :                                 Constant::Units::J,
    5530          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).LostEnergy,
    5531             :                                 OutputProcessor::TimeStepType::Zone,
    5532             :                                 OutputProcessor::StoreType::Sum,
    5533          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name);
    5534         158 :             SetupOutputVariable(state,
    5535             :                                 "Gas Equipment Total Heating Energy",
    5536             :                                 Constant::Units::J,
    5537          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).TotGainEnergy,
    5538             :                                 OutputProcessor::TimeStepType::Zone,
    5539             :                                 OutputProcessor::StoreType::Sum,
    5540          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name);
    5541         158 :             SetupOutputVariable(state,
    5542             :                                 "Gas Equipment Radiant Heating Rate",
    5543             :                                 Constant::Units::W,
    5544          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).RadGainRate,
    5545             :                                 OutputProcessor::TimeStepType::Zone,
    5546             :                                 OutputProcessor::StoreType::Average,
    5547          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name);
    5548         158 :             SetupOutputVariable(state,
    5549             :                                 "Gas Equipment Convective Heating Rate",
    5550             :                                 Constant::Units::W,
    5551          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).ConGainRate,
    5552             :                                 OutputProcessor::TimeStepType::Zone,
    5553             :                                 OutputProcessor::StoreType::Average,
    5554          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name);
    5555         158 :             SetupOutputVariable(state,
    5556             :                                 "Gas Equipment Latent Gain Rate",
    5557             :                                 Constant::Units::W,
    5558          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).LatGainRate,
    5559             :                                 OutputProcessor::TimeStepType::Zone,
    5560             :                                 OutputProcessor::StoreType::Average,
    5561          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name);
    5562         158 :             SetupOutputVariable(state,
    5563             :                                 "Gas Equipment Lost Heat Rate",
    5564             :                                 Constant::Units::W,
    5565          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).LostRate,
    5566             :                                 OutputProcessor::TimeStepType::Zone,
    5567             :                                 OutputProcessor::StoreType::Average,
    5568          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name);
    5569         158 :             SetupOutputVariable(state,
    5570             :                                 "Gas Equipment Total Heating Rate",
    5571             :                                 Constant::Units::W,
    5572          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).TotGainRate,
    5573             :                                 OutputProcessor::TimeStepType::Zone,
    5574             :                                 OutputProcessor::StoreType::Average,
    5575          79 :                                 state.dataHeatBal->ZoneGas(gasEqNum).Name);
    5576             :         }
    5577             : 
    5578             :         // Zone total report variables
    5579        5852 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
    5580        5056 :             if (addZoneOutputs(zoneNum)) {
    5581             : 
    5582         158 :                 SetupOutputVariable(state,
    5583             :                                     "Zone Gas Equipment NaturalGas Rate",
    5584             :                                     Constant::Units::W,
    5585          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasPower,
    5586             :                                     OutputProcessor::TimeStepType::Zone,
    5587             :                                     OutputProcessor::StoreType::Average,
    5588          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5589         158 :                 SetupOutputVariable(state,
    5590             :                                     "Zone Gas Equipment NaturalGas Energy",
    5591             :                                     Constant::Units::J,
    5592          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasConsump,
    5593             :                                     OutputProcessor::TimeStepType::Zone,
    5594             :                                     OutputProcessor::StoreType::Sum,
    5595          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5596             : 
    5597         158 :                 SetupOutputVariable(state,
    5598             :                                     "Zone Gas Equipment Radiant Heating Energy",
    5599             :                                     Constant::Units::J,
    5600          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasRadGain,
    5601             :                                     OutputProcessor::TimeStepType::Zone,
    5602             :                                     OutputProcessor::StoreType::Sum,
    5603          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5604         158 :                 SetupOutputVariable(state,
    5605             :                                     "Zone Gas Equipment Radiant Heating Rate",
    5606             :                                     Constant::Units::W,
    5607          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasRadGainRate,
    5608             :                                     OutputProcessor::TimeStepType::Zone,
    5609             :                                     OutputProcessor::StoreType::Average,
    5610          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5611         158 :                 SetupOutputVariable(state,
    5612             :                                     "Zone Gas Equipment Convective Heating Energy",
    5613             :                                     Constant::Units::J,
    5614          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasConGain,
    5615             :                                     OutputProcessor::TimeStepType::Zone,
    5616             :                                     OutputProcessor::StoreType::Sum,
    5617          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5618         158 :                 SetupOutputVariable(state,
    5619             :                                     "Zone Gas Equipment Convective Heating Rate",
    5620             :                                     Constant::Units::W,
    5621          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasConGainRate,
    5622             :                                     OutputProcessor::TimeStepType::Zone,
    5623             :                                     OutputProcessor::StoreType::Average,
    5624          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5625         158 :                 SetupOutputVariable(state,
    5626             :                                     "Zone Gas Equipment Latent Gain Energy",
    5627             :                                     Constant::Units::J,
    5628          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasLatGain,
    5629             :                                     OutputProcessor::TimeStepType::Zone,
    5630             :                                     OutputProcessor::StoreType::Sum,
    5631          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5632         158 :                 SetupOutputVariable(state,
    5633             :                                     "Zone Gas Equipment Latent Gain Rate",
    5634             :                                     Constant::Units::W,
    5635          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasLatGainRate,
    5636             :                                     OutputProcessor::TimeStepType::Zone,
    5637             :                                     OutputProcessor::StoreType::Average,
    5638          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5639         158 :                 SetupOutputVariable(state,
    5640             :                                     "Zone Gas Equipment Lost Heat Energy",
    5641             :                                     Constant::Units::J,
    5642          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasLost,
    5643             :                                     OutputProcessor::TimeStepType::Zone,
    5644             :                                     OutputProcessor::StoreType::Sum,
    5645          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5646         158 :                 SetupOutputVariable(state,
    5647             :                                     "Zone Gas Equipment Lost Heat Rate",
    5648             :                                     Constant::Units::W,
    5649          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasLostRate,
    5650             :                                     OutputProcessor::TimeStepType::Zone,
    5651             :                                     OutputProcessor::StoreType::Average,
    5652          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5653         158 :                 SetupOutputVariable(state,
    5654             :                                     "Zone Gas Equipment Total Heating Energy",
    5655             :                                     Constant::Units::J,
    5656          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasTotGain,
    5657             :                                     OutputProcessor::TimeStepType::Zone,
    5658             :                                     OutputProcessor::StoreType::Sum,
    5659          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5660         158 :                 SetupOutputVariable(state,
    5661             :                                     "Zone Gas Equipment Total Heating Rate",
    5662             :                                     Constant::Units::W,
    5663          79 :                                     state.dataHeatBal->ZoneRpt(zoneNum).GasTotGainRate,
    5664             :                                     OutputProcessor::TimeStepType::Zone,
    5665             :                                     OutputProcessor::StoreType::Average,
    5666          79 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5667             :             }
    5668             :             // Reset zone output flag
    5669        5056 :             addZoneOutputs(zoneNum) = false;
    5670             :         }
    5671             : 
    5672             :         // Space total report variables
    5673        5864 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    5674        5068 :             if (addSpaceOutputs(spaceNum)) {
    5675             : 
    5676         158 :                 SetupOutputVariable(state,
    5677             :                                     "Space Gas Equipment NaturalGas Rate",
    5678             :                                     Constant::Units::W,
    5679          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasPower,
    5680             :                                     OutputProcessor::TimeStepType::Zone,
    5681             :                                     OutputProcessor::StoreType::Average,
    5682          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5683         158 :                 SetupOutputVariable(state,
    5684             :                                     "Space Gas Equipment NaturalGas Energy",
    5685             :                                     Constant::Units::J,
    5686          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasConsump,
    5687             :                                     OutputProcessor::TimeStepType::Zone,
    5688             :                                     OutputProcessor::StoreType::Sum,
    5689          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5690             : 
    5691         158 :                 SetupOutputVariable(state,
    5692             :                                     "Space Gas Equipment Radiant Heating Energy",
    5693             :                                     Constant::Units::J,
    5694          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasRadGain,
    5695             :                                     OutputProcessor::TimeStepType::Zone,
    5696             :                                     OutputProcessor::StoreType::Sum,
    5697          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5698         158 :                 SetupOutputVariable(state,
    5699             :                                     "Space Gas Equipment Radiant Heating Rate",
    5700             :                                     Constant::Units::W,
    5701          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasRadGainRate,
    5702             :                                     OutputProcessor::TimeStepType::Zone,
    5703             :                                     OutputProcessor::StoreType::Average,
    5704          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5705         158 :                 SetupOutputVariable(state,
    5706             :                                     "Space Gas Equipment Convective Heating Energy",
    5707             :                                     Constant::Units::J,
    5708          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasConGain,
    5709             :                                     OutputProcessor::TimeStepType::Zone,
    5710             :                                     OutputProcessor::StoreType::Sum,
    5711          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5712         158 :                 SetupOutputVariable(state,
    5713             :                                     "Space Gas Equipment Convective Heating Rate",
    5714             :                                     Constant::Units::W,
    5715          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasConGainRate,
    5716             :                                     OutputProcessor::TimeStepType::Zone,
    5717             :                                     OutputProcessor::StoreType::Average,
    5718          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5719         158 :                 SetupOutputVariable(state,
    5720             :                                     "Space Gas Equipment Latent Gain Energy",
    5721             :                                     Constant::Units::J,
    5722          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasLatGain,
    5723             :                                     OutputProcessor::TimeStepType::Zone,
    5724             :                                     OutputProcessor::StoreType::Sum,
    5725          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5726         158 :                 SetupOutputVariable(state,
    5727             :                                     "Space Gas Equipment Latent Gain Rate",
    5728             :                                     Constant::Units::W,
    5729          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasLatGainRate,
    5730             :                                     OutputProcessor::TimeStepType::Zone,
    5731             :                                     OutputProcessor::StoreType::Average,
    5732          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5733         158 :                 SetupOutputVariable(state,
    5734             :                                     "Space Gas Equipment Lost Heat Energy",
    5735             :                                     Constant::Units::J,
    5736          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasLost,
    5737             :                                     OutputProcessor::TimeStepType::Zone,
    5738             :                                     OutputProcessor::StoreType::Sum,
    5739          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5740         158 :                 SetupOutputVariable(state,
    5741             :                                     "Space Gas Equipment Lost Heat Rate",
    5742             :                                     Constant::Units::W,
    5743          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasLostRate,
    5744             :                                     OutputProcessor::TimeStepType::Zone,
    5745             :                                     OutputProcessor::StoreType::Average,
    5746          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5747         158 :                 SetupOutputVariable(state,
    5748             :                                     "Space Gas Equipment Total Heating Energy",
    5749             :                                     Constant::Units::J,
    5750          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasTotGain,
    5751             :                                     OutputProcessor::TimeStepType::Zone,
    5752             :                                     OutputProcessor::StoreType::Sum,
    5753          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5754         158 :                 SetupOutputVariable(state,
    5755             :                                     "Space Gas Equipment Total Heating Rate",
    5756             :                                     Constant::Units::W,
    5757          79 :                                     state.dataHeatBal->spaceRpt(spaceNum).GasTotGainRate,
    5758             :                                     OutputProcessor::TimeStepType::Zone,
    5759             :                                     OutputProcessor::StoreType::Average,
    5760          79 :                                     state.dataHeatBal->space(spaceNum).Name);
    5761             :             }
    5762             :             // Reset space output flag
    5763        5068 :             addSpaceOutputs(spaceNum) = false;
    5764             :         }
    5765             : 
    5766             :         // Object report variables
    5767         810 :         for (int hwEqNum = 1; hwEqNum <= state.dataHeatBal->TotHWEquip; ++hwEqNum) {
    5768             :             // Set flags for zone and space total report variables
    5769          14 :             addZoneOutputs(state.dataHeatBal->ZoneHWEq(hwEqNum).ZonePtr) = true;
    5770          14 :             addSpaceOutputs(state.dataHeatBal->ZoneHWEq(hwEqNum).spaceIndex) = true;
    5771          28 :             SetupOutputVariable(state,
    5772             :                                 "Hot Water Equipment District Heating Rate",
    5773             :                                 Constant::Units::W,
    5774          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Power,
    5775             :                                 OutputProcessor::TimeStepType::Zone,
    5776             :                                 OutputProcessor::StoreType::Average,
    5777          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
    5778          28 :             SetupOutputVariable(state,
    5779             :                                 "Hot Water Equipment District Heating Energy",
    5780             :                                 Constant::Units::J,
    5781          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Consumption,
    5782             :                                 OutputProcessor::TimeStepType::Zone,
    5783             :                                 OutputProcessor::StoreType::Sum,
    5784          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name,
    5785             :                                 Constant::eResource::DistrictHeatingWater,
    5786             :                                 OutputProcessor::Group::Building,
    5787             :                                 OutputProcessor::EndUseCat::InteriorEquipment,
    5788          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).EndUseSubcategory,
    5789          14 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(hwEqNum).ZonePtr).Name,
    5790          14 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(hwEqNum).ZonePtr).Multiplier,
    5791          14 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(hwEqNum).ZonePtr).ListMultiplier,
    5792          14 :                                 state.dataHeatBal->space(state.dataHeatBal->ZoneHWEq(hwEqNum).spaceIndex).spaceType);
    5793             : 
    5794          28 :             SetupOutputVariable(state,
    5795             :                                 "Hot Water Equipment Radiant Heating Energy",
    5796             :                                 Constant::Units::J,
    5797          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).RadGainEnergy,
    5798             :                                 OutputProcessor::TimeStepType::Zone,
    5799             :                                 OutputProcessor::StoreType::Sum,
    5800          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
    5801          28 :             SetupOutputVariable(state,
    5802             :                                 "Hot Water Equipment Radiant Heating Rate",
    5803             :                                 Constant::Units::W,
    5804          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).RadGainRate,
    5805             :                                 OutputProcessor::TimeStepType::Zone,
    5806             :                                 OutputProcessor::StoreType::Average,
    5807          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
    5808          28 :             SetupOutputVariable(state,
    5809             :                                 "Hot Water Equipment Convective Heating Energy",
    5810             :                                 Constant::Units::J,
    5811          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).ConGainEnergy,
    5812             :                                 OutputProcessor::TimeStepType::Zone,
    5813             :                                 OutputProcessor::StoreType::Sum,
    5814          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
    5815          28 :             SetupOutputVariable(state,
    5816             :                                 "Hot Water Equipment Convective Heating Rate",
    5817             :                                 Constant::Units::W,
    5818          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).ConGainRate,
    5819             :                                 OutputProcessor::TimeStepType::Zone,
    5820             :                                 OutputProcessor::StoreType::Average,
    5821          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
    5822          28 :             SetupOutputVariable(state,
    5823             :                                 "Hot Water Equipment Latent Gain Energy",
    5824             :                                 Constant::Units::J,
    5825          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).LatGainEnergy,
    5826             :                                 OutputProcessor::TimeStepType::Zone,
    5827             :                                 OutputProcessor::StoreType::Sum,
    5828          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
    5829          28 :             SetupOutputVariable(state,
    5830             :                                 "Hot Water Equipment Latent Gain Rate",
    5831             :                                 Constant::Units::W,
    5832          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).LatGainRate,
    5833             :                                 OutputProcessor::TimeStepType::Zone,
    5834             :                                 OutputProcessor::StoreType::Average,
    5835          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
    5836          28 :             SetupOutputVariable(state,
    5837             :                                 "Hot Water Equipment Lost Heat Energy",
    5838             :                                 Constant::Units::J,
    5839          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).LostEnergy,
    5840             :                                 OutputProcessor::TimeStepType::Zone,
    5841             :                                 OutputProcessor::StoreType::Sum,
    5842          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
    5843          28 :             SetupOutputVariable(state,
    5844             :                                 "Hot Water Equipment Lost Heat Rate",
    5845             :                                 Constant::Units::W,
    5846          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).LostRate,
    5847             :                                 OutputProcessor::TimeStepType::Zone,
    5848             :                                 OutputProcessor::StoreType::Average,
    5849          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
    5850          28 :             SetupOutputVariable(state,
    5851             :                                 "Hot Water Equipment Total Heating Energy",
    5852             :                                 Constant::Units::J,
    5853          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).TotGainEnergy,
    5854             :                                 OutputProcessor::TimeStepType::Zone,
    5855             :                                 OutputProcessor::StoreType::Sum,
    5856          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
    5857          28 :             SetupOutputVariable(state,
    5858             :                                 "Hot Water Equipment Total Heating Rate",
    5859             :                                 Constant::Units::W,
    5860          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).TotGainRate,
    5861             :                                 OutputProcessor::TimeStepType::Zone,
    5862             :                                 OutputProcessor::StoreType::Average,
    5863          14 :                                 state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
    5864             :         }
    5865             : 
    5866             :         // Zone total report variables
    5867        5852 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
    5868        5056 :             if (addZoneOutputs(zoneNum)) {
    5869          28 :                 SetupOutputVariable(state,
    5870             :                                     "Zone Hot Water Equipment District Heating Rate",
    5871             :                                     Constant::Units::W,
    5872          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWPower,
    5873             :                                     OutputProcessor::TimeStepType::Zone,
    5874             :                                     OutputProcessor::StoreType::Average,
    5875          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5876          28 :                 SetupOutputVariable(state,
    5877             :                                     "Zone Hot Water Equipment District Heating Energy",
    5878             :                                     Constant::Units::J,
    5879          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWConsump,
    5880             :                                     OutputProcessor::TimeStepType::Zone,
    5881             :                                     OutputProcessor::StoreType::Sum,
    5882          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5883             : 
    5884          28 :                 SetupOutputVariable(state,
    5885             :                                     "Zone Hot Water Equipment Radiant Heating Energy",
    5886             :                                     Constant::Units::J,
    5887          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWRadGain,
    5888             :                                     OutputProcessor::TimeStepType::Zone,
    5889             :                                     OutputProcessor::StoreType::Sum,
    5890          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5891          28 :                 SetupOutputVariable(state,
    5892             :                                     "Zone Hot Water Equipment Radiant Heating Rate",
    5893             :                                     Constant::Units::W,
    5894          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWRadGainRate,
    5895             :                                     OutputProcessor::TimeStepType::Zone,
    5896             :                                     OutputProcessor::StoreType::Average,
    5897          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5898          28 :                 SetupOutputVariable(state,
    5899             :                                     "Zone Hot Water Equipment Convective Heating Energy",
    5900             :                                     Constant::Units::J,
    5901          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWConGain,
    5902             :                                     OutputProcessor::TimeStepType::Zone,
    5903             :                                     OutputProcessor::StoreType::Sum,
    5904          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5905          28 :                 SetupOutputVariable(state,
    5906             :                                     "Zone Hot Water Equipment Convective Heating Rate",
    5907             :                                     Constant::Units::W,
    5908          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWConGainRate,
    5909             :                                     OutputProcessor::TimeStepType::Zone,
    5910             :                                     OutputProcessor::StoreType::Average,
    5911          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5912          28 :                 SetupOutputVariable(state,
    5913             :                                     "Zone Hot Water Equipment Latent Gain Energy",
    5914             :                                     Constant::Units::J,
    5915          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWLatGain,
    5916             :                                     OutputProcessor::TimeStepType::Zone,
    5917             :                                     OutputProcessor::StoreType::Sum,
    5918          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5919          28 :                 SetupOutputVariable(state,
    5920             :                                     "Zone Hot Water Equipment Latent Gain Rate",
    5921             :                                     Constant::Units::W,
    5922          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWLatGainRate,
    5923             :                                     OutputProcessor::TimeStepType::Zone,
    5924             :                                     OutputProcessor::StoreType::Average,
    5925          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5926          28 :                 SetupOutputVariable(state,
    5927             :                                     "Zone Hot Water Equipment Lost Heat Energy",
    5928             :                                     Constant::Units::J,
    5929          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWLost,
    5930             :                                     OutputProcessor::TimeStepType::Zone,
    5931             :                                     OutputProcessor::StoreType::Sum,
    5932          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5933          28 :                 SetupOutputVariable(state,
    5934             :                                     "Zone Hot Water Equipment Lost Heat Rate",
    5935             :                                     Constant::Units::W,
    5936          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWLostRate,
    5937             :                                     OutputProcessor::TimeStepType::Zone,
    5938             :                                     OutputProcessor::StoreType::Average,
    5939          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5940          28 :                 SetupOutputVariable(state,
    5941             :                                     "Zone Hot Water Equipment Total Heating Energy",
    5942             :                                     Constant::Units::J,
    5943          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWTotGain,
    5944             :                                     OutputProcessor::TimeStepType::Zone,
    5945             :                                     OutputProcessor::StoreType::Sum,
    5946          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5947          28 :                 SetupOutputVariable(state,
    5948             :                                     "Zone Hot Water Equipment Total Heating Rate",
    5949             :                                     Constant::Units::W,
    5950          14 :                                     state.dataHeatBal->ZoneRpt(zoneNum).HWTotGainRate,
    5951             :                                     OutputProcessor::TimeStepType::Zone,
    5952             :                                     OutputProcessor::StoreType::Average,
    5953          14 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    5954             :             }
    5955             :             // Reset zone output flag
    5956        5056 :             addZoneOutputs(zoneNum) = false;
    5957             :         }
    5958             : 
    5959             :         // Space total report variables
    5960        5864 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    5961        5068 :             if (addSpaceOutputs(spaceNum)) {
    5962          28 :                 SetupOutputVariable(state,
    5963             :                                     "Space Hot Water Equipment District Heating Rate",
    5964             :                                     Constant::Units::W,
    5965          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWPower,
    5966             :                                     OutputProcessor::TimeStepType::Zone,
    5967             :                                     OutputProcessor::StoreType::Average,
    5968          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    5969          28 :                 SetupOutputVariable(state,
    5970             :                                     "Space Hot Water Equipment District Heating Energy",
    5971             :                                     Constant::Units::J,
    5972          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWConsump,
    5973             :                                     OutputProcessor::TimeStepType::Zone,
    5974             :                                     OutputProcessor::StoreType::Sum,
    5975          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    5976             : 
    5977          28 :                 SetupOutputVariable(state,
    5978             :                                     "Space Hot Water Equipment Radiant Heating Energy",
    5979             :                                     Constant::Units::J,
    5980          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWRadGain,
    5981             :                                     OutputProcessor::TimeStepType::Zone,
    5982             :                                     OutputProcessor::StoreType::Sum,
    5983          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    5984          28 :                 SetupOutputVariable(state,
    5985             :                                     "Space Hot Water Equipment Radiant Heating Rate",
    5986             :                                     Constant::Units::W,
    5987          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWRadGainRate,
    5988             :                                     OutputProcessor::TimeStepType::Zone,
    5989             :                                     OutputProcessor::StoreType::Average,
    5990          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    5991          28 :                 SetupOutputVariable(state,
    5992             :                                     "Space Hot Water Equipment Convective Heating Energy",
    5993             :                                     Constant::Units::J,
    5994          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWConGain,
    5995             :                                     OutputProcessor::TimeStepType::Zone,
    5996             :                                     OutputProcessor::StoreType::Sum,
    5997          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    5998          28 :                 SetupOutputVariable(state,
    5999             :                                     "Space Hot Water Equipment Convective Heating Rate",
    6000             :                                     Constant::Units::W,
    6001          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWConGainRate,
    6002             :                                     OutputProcessor::TimeStepType::Zone,
    6003             :                                     OutputProcessor::StoreType::Average,
    6004          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    6005          28 :                 SetupOutputVariable(state,
    6006             :                                     "Space Hot Water Equipment Latent Gain Energy",
    6007             :                                     Constant::Units::J,
    6008          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWLatGain,
    6009             :                                     OutputProcessor::TimeStepType::Zone,
    6010             :                                     OutputProcessor::StoreType::Sum,
    6011          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    6012          28 :                 SetupOutputVariable(state,
    6013             :                                     "Space Hot Water Equipment Latent Gain Rate",
    6014             :                                     Constant::Units::W,
    6015          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWLatGainRate,
    6016             :                                     OutputProcessor::TimeStepType::Zone,
    6017             :                                     OutputProcessor::StoreType::Average,
    6018          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    6019          28 :                 SetupOutputVariable(state,
    6020             :                                     "Space Hot Water Equipment Lost Heat Energy",
    6021             :                                     Constant::Units::J,
    6022          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWLost,
    6023             :                                     OutputProcessor::TimeStepType::Zone,
    6024             :                                     OutputProcessor::StoreType::Sum,
    6025          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    6026          28 :                 SetupOutputVariable(state,
    6027             :                                     "Space Hot Water Equipment Lost Heat Rate",
    6028             :                                     Constant::Units::W,
    6029          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWLostRate,
    6030             :                                     OutputProcessor::TimeStepType::Zone,
    6031             :                                     OutputProcessor::StoreType::Average,
    6032          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    6033          28 :                 SetupOutputVariable(state,
    6034             :                                     "Space Hot Water Equipment Total Heating Energy",
    6035             :                                     Constant::Units::J,
    6036          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWTotGain,
    6037             :                                     OutputProcessor::TimeStepType::Zone,
    6038             :                                     OutputProcessor::StoreType::Sum,
    6039          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    6040          28 :                 SetupOutputVariable(state,
    6041             :                                     "Space Hot Water Equipment Total Heating Rate",
    6042             :                                     Constant::Units::W,
    6043          14 :                                     state.dataHeatBal->spaceRpt(spaceNum).HWTotGainRate,
    6044             :                                     OutputProcessor::TimeStepType::Zone,
    6045             :                                     OutputProcessor::StoreType::Average,
    6046          14 :                                     state.dataHeatBal->space(spaceNum).Name);
    6047             :             }
    6048             :             // Reset space output flag
    6049        5068 :             addSpaceOutputs(spaceNum) = false;
    6050             :         }
    6051             : 
    6052             :         // Object report variables
    6053         801 :         for (int stmEqNum = 1; stmEqNum <= state.dataHeatBal->TotStmEquip; ++stmEqNum) {
    6054             :             // Set flags for zone and space total report variables
    6055           5 :             addZoneOutputs(state.dataHeatBal->ZoneSteamEq(stmEqNum).ZonePtr) = true;
    6056           5 :             addSpaceOutputs(state.dataHeatBal->ZoneSteamEq(stmEqNum).spaceIndex) = true;
    6057          10 :             SetupOutputVariable(state,
    6058             :                                 "Steam Equipment District Heating Rate",
    6059             :                                 Constant::Units::W,
    6060           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Power,
    6061             :                                 OutputProcessor::TimeStepType::Zone,
    6062             :                                 OutputProcessor::StoreType::Average,
    6063           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
    6064          10 :             SetupOutputVariable(state,
    6065             :                                 "Steam Equipment District Heating Energy",
    6066             :                                 Constant::Units::J,
    6067           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Consumption,
    6068             :                                 OutputProcessor::TimeStepType::Zone,
    6069             :                                 OutputProcessor::StoreType::Sum,
    6070           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name,
    6071             :                                 Constant::eResource::DistrictHeatingSteam,
    6072             :                                 OutputProcessor::Group::Building,
    6073             :                                 OutputProcessor::EndUseCat::InteriorEquipment,
    6074           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).EndUseSubcategory,
    6075           5 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(stmEqNum).ZonePtr).Name,
    6076           5 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(stmEqNum).ZonePtr).Multiplier,
    6077           5 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(stmEqNum).ZonePtr).ListMultiplier,
    6078           5 :                                 state.dataHeatBal->space(state.dataHeatBal->ZoneSteamEq(stmEqNum).spaceIndex).spaceType);
    6079             : 
    6080          10 :             SetupOutputVariable(state,
    6081             :                                 "Steam Equipment Radiant Heating Energy",
    6082             :                                 Constant::Units::J,
    6083           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).RadGainEnergy,
    6084             :                                 OutputProcessor::TimeStepType::Zone,
    6085             :                                 OutputProcessor::StoreType::Sum,
    6086           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
    6087          10 :             SetupOutputVariable(state,
    6088             :                                 "Steam Equipment Radiant Heating Rate",
    6089             :                                 Constant::Units::W,
    6090           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).RadGainRate,
    6091             :                                 OutputProcessor::TimeStepType::Zone,
    6092             :                                 OutputProcessor::StoreType::Average,
    6093           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
    6094          10 :             SetupOutputVariable(state,
    6095             :                                 "Steam Equipment Convective Heating Energy",
    6096             :                                 Constant::Units::J,
    6097           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).ConGainEnergy,
    6098             :                                 OutputProcessor::TimeStepType::Zone,
    6099             :                                 OutputProcessor::StoreType::Sum,
    6100           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
    6101          10 :             SetupOutputVariable(state,
    6102             :                                 "Steam Equipment Convective Heating Rate",
    6103             :                                 Constant::Units::W,
    6104           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).ConGainRate,
    6105             :                                 OutputProcessor::TimeStepType::Zone,
    6106             :                                 OutputProcessor::StoreType::Average,
    6107           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
    6108          10 :             SetupOutputVariable(state,
    6109             :                                 "Steam Equipment Latent Gain Energy",
    6110             :                                 Constant::Units::J,
    6111           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).LatGainEnergy,
    6112             :                                 OutputProcessor::TimeStepType::Zone,
    6113             :                                 OutputProcessor::StoreType::Sum,
    6114           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
    6115          10 :             SetupOutputVariable(state,
    6116             :                                 "Steam Equipment Latent Gain Rate",
    6117             :                                 Constant::Units::W,
    6118           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).LatGainRate,
    6119             :                                 OutputProcessor::TimeStepType::Zone,
    6120             :                                 OutputProcessor::StoreType::Average,
    6121           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
    6122          10 :             SetupOutputVariable(state,
    6123             :                                 "Steam Equipment Lost Heat Energy",
    6124             :                                 Constant::Units::J,
    6125           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).LostEnergy,
    6126             :                                 OutputProcessor::TimeStepType::Zone,
    6127             :                                 OutputProcessor::StoreType::Sum,
    6128           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
    6129          10 :             SetupOutputVariable(state,
    6130             :                                 "Steam Equipment Lost Heat Rate",
    6131             :                                 Constant::Units::W,
    6132           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).LostRate,
    6133             :                                 OutputProcessor::TimeStepType::Zone,
    6134             :                                 OutputProcessor::StoreType::Average,
    6135           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
    6136          10 :             SetupOutputVariable(state,
    6137             :                                 "Steam Equipment Total Heating Energy",
    6138             :                                 Constant::Units::J,
    6139           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).TotGainEnergy,
    6140             :                                 OutputProcessor::TimeStepType::Zone,
    6141             :                                 OutputProcessor::StoreType::Sum,
    6142           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
    6143          10 :             SetupOutputVariable(state,
    6144             :                                 "Steam Equipment Total Heating Rate",
    6145             :                                 Constant::Units::W,
    6146           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).TotGainRate,
    6147             :                                 OutputProcessor::TimeStepType::Zone,
    6148             :                                 OutputProcessor::StoreType::Average,
    6149           5 :                                 state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
    6150             :         }
    6151             : 
    6152             :         // Zone total report variables
    6153        5852 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
    6154        5056 :             if (addZoneOutputs(zoneNum)) {
    6155          10 :                 SetupOutputVariable(state,
    6156             :                                     "Zone Steam Equipment District Heating Rate",
    6157             :                                     Constant::Units::W,
    6158           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamPower,
    6159             :                                     OutputProcessor::TimeStepType::Zone,
    6160             :                                     OutputProcessor::StoreType::Average,
    6161           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6162          10 :                 SetupOutputVariable(state,
    6163             :                                     "Zone Steam Equipment District Heating Energy",
    6164             :                                     Constant::Units::J,
    6165           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamConsump,
    6166             :                                     OutputProcessor::TimeStepType::Zone,
    6167             :                                     OutputProcessor::StoreType::Sum,
    6168           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6169             : 
    6170          10 :                 SetupOutputVariable(state,
    6171             :                                     "Zone Steam Equipment Radiant Heating Energy",
    6172             :                                     Constant::Units::J,
    6173           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamRadGain,
    6174             :                                     OutputProcessor::TimeStepType::Zone,
    6175             :                                     OutputProcessor::StoreType::Sum,
    6176           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6177          10 :                 SetupOutputVariable(state,
    6178             :                                     "Zone Steam Equipment Radiant Heating Rate",
    6179             :                                     Constant::Units::W,
    6180           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamRadGainRate,
    6181             :                                     OutputProcessor::TimeStepType::Zone,
    6182             :                                     OutputProcessor::StoreType::Average,
    6183           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6184          10 :                 SetupOutputVariable(state,
    6185             :                                     "Zone Steam Equipment Convective Heating Energy",
    6186             :                                     Constant::Units::J,
    6187           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamConGain,
    6188             :                                     OutputProcessor::TimeStepType::Zone,
    6189             :                                     OutputProcessor::StoreType::Sum,
    6190           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6191          10 :                 SetupOutputVariable(state,
    6192             :                                     "Zone Steam Equipment Convective Heating Rate",
    6193             :                                     Constant::Units::W,
    6194           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamConGainRate,
    6195             :                                     OutputProcessor::TimeStepType::Zone,
    6196             :                                     OutputProcessor::StoreType::Average,
    6197           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6198          10 :                 SetupOutputVariable(state,
    6199             :                                     "Zone Steam Equipment Latent Gain Energy",
    6200             :                                     Constant::Units::J,
    6201           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamLatGain,
    6202             :                                     OutputProcessor::TimeStepType::Zone,
    6203             :                                     OutputProcessor::StoreType::Sum,
    6204           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6205          10 :                 SetupOutputVariable(state,
    6206             :                                     "Zone Steam Equipment Latent Gain Rate",
    6207             :                                     Constant::Units::W,
    6208           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamLatGainRate,
    6209             :                                     OutputProcessor::TimeStepType::Zone,
    6210             :                                     OutputProcessor::StoreType::Average,
    6211           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6212          10 :                 SetupOutputVariable(state,
    6213             :                                     "Zone Steam Equipment Lost Heat Energy",
    6214             :                                     Constant::Units::J,
    6215           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamLost,
    6216             :                                     OutputProcessor::TimeStepType::Zone,
    6217             :                                     OutputProcessor::StoreType::Sum,
    6218           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6219          10 :                 SetupOutputVariable(state,
    6220             :                                     "Zone Steam Equipment Lost Heat Rate",
    6221             :                                     Constant::Units::W,
    6222           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamLostRate,
    6223             :                                     OutputProcessor::TimeStepType::Zone,
    6224             :                                     OutputProcessor::StoreType::Average,
    6225           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6226          10 :                 SetupOutputVariable(state,
    6227             :                                     "Zone Steam Equipment Total Heating Energy",
    6228             :                                     Constant::Units::J,
    6229           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamTotGain,
    6230             :                                     OutputProcessor::TimeStepType::Zone,
    6231             :                                     OutputProcessor::StoreType::Sum,
    6232           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6233          10 :                 SetupOutputVariable(state,
    6234             :                                     "Zone Steam Equipment Total Heating Rate",
    6235             :                                     Constant::Units::W,
    6236           5 :                                     state.dataHeatBal->ZoneRpt(zoneNum).SteamTotGainRate,
    6237             :                                     OutputProcessor::TimeStepType::Zone,
    6238             :                                     OutputProcessor::StoreType::Average,
    6239           5 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6240             :             }
    6241             :             // Reset zone output flag
    6242        5056 :             addZoneOutputs(zoneNum) = false;
    6243             :         }
    6244             : 
    6245             :         // Space total report variables
    6246        5864 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    6247        5068 :             if (addSpaceOutputs(spaceNum)) {
    6248          10 :                 SetupOutputVariable(state,
    6249             :                                     "Space Steam Equipment District Heating Rate",
    6250             :                                     Constant::Units::W,
    6251           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamPower,
    6252             :                                     OutputProcessor::TimeStepType::Zone,
    6253             :                                     OutputProcessor::StoreType::Average,
    6254           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6255          10 :                 SetupOutputVariable(state,
    6256             :                                     "Space Steam Equipment District Heating Energy",
    6257             :                                     Constant::Units::J,
    6258           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamConsump,
    6259             :                                     OutputProcessor::TimeStepType::Zone,
    6260             :                                     OutputProcessor::StoreType::Sum,
    6261           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6262             : 
    6263          10 :                 SetupOutputVariable(state,
    6264             :                                     "Space Steam Equipment Radiant Heating Energy",
    6265             :                                     Constant::Units::J,
    6266           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamRadGain,
    6267             :                                     OutputProcessor::TimeStepType::Zone,
    6268             :                                     OutputProcessor::StoreType::Sum,
    6269           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6270          10 :                 SetupOutputVariable(state,
    6271             :                                     "Space Steam Equipment Radiant Heating Rate",
    6272             :                                     Constant::Units::W,
    6273           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamRadGainRate,
    6274             :                                     OutputProcessor::TimeStepType::Zone,
    6275             :                                     OutputProcessor::StoreType::Average,
    6276           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6277          10 :                 SetupOutputVariable(state,
    6278             :                                     "Space Steam Equipment Convective Heating Energy",
    6279             :                                     Constant::Units::J,
    6280           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamConGain,
    6281             :                                     OutputProcessor::TimeStepType::Zone,
    6282             :                                     OutputProcessor::StoreType::Sum,
    6283           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6284          10 :                 SetupOutputVariable(state,
    6285             :                                     "Space Steam Equipment Convective Heating Rate",
    6286             :                                     Constant::Units::W,
    6287           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamConGainRate,
    6288             :                                     OutputProcessor::TimeStepType::Zone,
    6289             :                                     OutputProcessor::StoreType::Average,
    6290           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6291          10 :                 SetupOutputVariable(state,
    6292             :                                     "Space Steam Equipment Latent Gain Energy",
    6293             :                                     Constant::Units::J,
    6294           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamLatGain,
    6295             :                                     OutputProcessor::TimeStepType::Zone,
    6296             :                                     OutputProcessor::StoreType::Sum,
    6297           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6298          10 :                 SetupOutputVariable(state,
    6299             :                                     "Space Steam Equipment Latent Gain Rate",
    6300             :                                     Constant::Units::W,
    6301           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamLatGainRate,
    6302             :                                     OutputProcessor::TimeStepType::Zone,
    6303             :                                     OutputProcessor::StoreType::Average,
    6304           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6305          10 :                 SetupOutputVariable(state,
    6306             :                                     "Space Steam Equipment Lost Heat Energy",
    6307             :                                     Constant::Units::J,
    6308           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamLost,
    6309             :                                     OutputProcessor::TimeStepType::Zone,
    6310             :                                     OutputProcessor::StoreType::Sum,
    6311           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6312          10 :                 SetupOutputVariable(state,
    6313             :                                     "Space Steam Equipment Lost Heat Rate",
    6314             :                                     Constant::Units::W,
    6315           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamLostRate,
    6316             :                                     OutputProcessor::TimeStepType::Zone,
    6317             :                                     OutputProcessor::StoreType::Average,
    6318           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6319          10 :                 SetupOutputVariable(state,
    6320             :                                     "Space Steam Equipment Total Heating Energy",
    6321             :                                     Constant::Units::J,
    6322           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamTotGain,
    6323             :                                     OutputProcessor::TimeStepType::Zone,
    6324             :                                     OutputProcessor::StoreType::Sum,
    6325           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6326          10 :                 SetupOutputVariable(state,
    6327             :                                     "Space Steam Equipment Total Heating Rate",
    6328             :                                     Constant::Units::W,
    6329           5 :                                     state.dataHeatBal->spaceRpt(spaceNum).SteamTotGainRate,
    6330             :                                     OutputProcessor::TimeStepType::Zone,
    6331             :                                     OutputProcessor::StoreType::Average,
    6332           5 :                                     state.dataHeatBal->space(spaceNum).Name);
    6333             :             }
    6334             :             // Reset space output flag
    6335        5068 :             addSpaceOutputs(spaceNum) = false;
    6336             :         }
    6337             : 
    6338             :         // Object report variables
    6339         865 :         for (int othEqNum = 1; othEqNum <= state.dataHeatBal->TotOthEquip; ++othEqNum) {
    6340             :             // Set flags for zone and space total report variables
    6341          69 :             auto &zoneOtherEq = state.dataHeatBal->ZoneOtherEq(othEqNum);
    6342             : 
    6343          69 :             addZoneOutputs(zoneOtherEq.ZonePtr) = true;
    6344          69 :             addSpaceOutputs(zoneOtherEq.spaceIndex) = true;
    6345          69 :             if (zoneOtherEq.OtherEquipFuelType != Constant::eFuel::Invalid && zoneOtherEq.OtherEquipFuelType != Constant::eFuel::None) {
    6346           6 :                 SetupOutputVariable(state,
    6347           4 :                                     format("Other Equipment {} Rate", Constant::eFuelNames[(int)zoneOtherEq.OtherEquipFuelType]),
    6348             :                                     Constant::Units::W,
    6349           2 :                                     zoneOtherEq.Power,
    6350             :                                     OutputProcessor::TimeStepType::Zone,
    6351             :                                     OutputProcessor::StoreType::Average,
    6352           2 :                                     zoneOtherEq.Name);
    6353           4 :                 SetupOutputVariable(state,
    6354           4 :                                     format("Other Equipment {} Energy", Constant::eFuelNames[(int)zoneOtherEq.OtherEquipFuelType]),
    6355             :                                     Constant::Units::J,
    6356           2 :                                     zoneOtherEq.Consumption,
    6357             :                                     OutputProcessor::TimeStepType::Zone,
    6358             :                                     OutputProcessor::StoreType::Sum,
    6359           2 :                                     zoneOtherEq.Name,
    6360           2 :                                     Constant::eFuel2eResource[(int)zoneOtherEq.OtherEquipFuelType],
    6361             :                                     OutputProcessor::Group::Building,
    6362             :                                     OutputProcessor::EndUseCat::InteriorEquipment,
    6363             :                                     zoneOtherEq.EndUseSubcategory,
    6364           2 :                                     state.dataHeatBal->Zone(zoneOtherEq.ZonePtr).Name,
    6365           2 :                                     state.dataHeatBal->Zone(zoneOtherEq.ZonePtr).Multiplier,
    6366           2 :                                     state.dataHeatBal->Zone(zoneOtherEq.ZonePtr).ListMultiplier,
    6367           2 :                                     state.dataHeatBal->space(zoneOtherEq.spaceIndex).spaceType);
    6368             :             }
    6369             : 
    6370         138 :             SetupOutputVariable(state,
    6371             :                                 "Other Equipment Radiant Heating Energy",
    6372             :                                 Constant::Units::J,
    6373          69 :                                 zoneOtherEq.RadGainEnergy,
    6374             :                                 OutputProcessor::TimeStepType::Zone,
    6375             :                                 OutputProcessor::StoreType::Sum,
    6376          69 :                                 zoneOtherEq.Name);
    6377         138 :             SetupOutputVariable(state,
    6378             :                                 "Other Equipment Radiant Heating Rate",
    6379             :                                 Constant::Units::W,
    6380          69 :                                 zoneOtherEq.RadGainRate,
    6381             :                                 OutputProcessor::TimeStepType::Zone,
    6382             :                                 OutputProcessor::StoreType::Average,
    6383          69 :                                 zoneOtherEq.Name);
    6384         138 :             SetupOutputVariable(state,
    6385             :                                 "Other Equipment Convective Heating Energy",
    6386             :                                 Constant::Units::J,
    6387          69 :                                 zoneOtherEq.ConGainEnergy,
    6388             :                                 OutputProcessor::TimeStepType::Zone,
    6389             :                                 OutputProcessor::StoreType::Sum,
    6390          69 :                                 zoneOtherEq.Name);
    6391         138 :             SetupOutputVariable(state,
    6392             :                                 "Other Equipment Convective Heating Rate",
    6393             :                                 Constant::Units::W,
    6394          69 :                                 zoneOtherEq.ConGainRate,
    6395             :                                 OutputProcessor::TimeStepType::Zone,
    6396             :                                 OutputProcessor::StoreType::Average,
    6397          69 :                                 zoneOtherEq.Name);
    6398         138 :             SetupOutputVariable(state,
    6399             :                                 "Other Equipment Latent Gain Energy",
    6400             :                                 Constant::Units::J,
    6401          69 :                                 zoneOtherEq.LatGainEnergy,
    6402             :                                 OutputProcessor::TimeStepType::Zone,
    6403             :                                 OutputProcessor::StoreType::Sum,
    6404          69 :                                 zoneOtherEq.Name);
    6405         138 :             SetupOutputVariable(state,
    6406             :                                 "Other Equipment Latent Gain Rate",
    6407             :                                 Constant::Units::W,
    6408          69 :                                 zoneOtherEq.LatGainRate,
    6409             :                                 OutputProcessor::TimeStepType::Zone,
    6410             :                                 OutputProcessor::StoreType::Average,
    6411          69 :                                 zoneOtherEq.Name);
    6412         138 :             SetupOutputVariable(state,
    6413             :                                 "Other Equipment Lost Heat Energy",
    6414             :                                 Constant::Units::J,
    6415          69 :                                 zoneOtherEq.LostEnergy,
    6416             :                                 OutputProcessor::TimeStepType::Zone,
    6417             :                                 OutputProcessor::StoreType::Sum,
    6418          69 :                                 zoneOtherEq.Name);
    6419         138 :             SetupOutputVariable(state,
    6420             :                                 "Other Equipment Lost Heat Rate",
    6421             :                                 Constant::Units::W,
    6422          69 :                                 zoneOtherEq.LostRate,
    6423             :                                 OutputProcessor::TimeStepType::Zone,
    6424             :                                 OutputProcessor::StoreType::Average,
    6425          69 :                                 zoneOtherEq.Name);
    6426         138 :             SetupOutputVariable(state,
    6427             :                                 "Other Equipment Total Heating Energy",
    6428             :                                 Constant::Units::J,
    6429          69 :                                 zoneOtherEq.TotGainEnergy,
    6430             :                                 OutputProcessor::TimeStepType::Zone,
    6431             :                                 OutputProcessor::StoreType::Sum,
    6432          69 :                                 zoneOtherEq.Name);
    6433         138 :             SetupOutputVariable(state,
    6434             :                                 "Other Equipment Total Heating Rate",
    6435             :                                 Constant::Units::W,
    6436          69 :                                 zoneOtherEq.TotGainRate,
    6437             :                                 OutputProcessor::TimeStepType::Zone,
    6438             :                                 OutputProcessor::StoreType::Average,
    6439          69 :                                 zoneOtherEq.Name);
    6440             :         }
    6441             : 
    6442             :         // Zone total report variables
    6443        5852 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
    6444        5056 :             if (addZoneOutputs(zoneNum)) {
    6445          38 :                 for (size_t i = 0; i < state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums.size(); ++i) {
    6446           2 :                     Constant::eFuel fuelType = state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums[i];
    6447           2 :                     if (fuelType == Constant::eFuel::Invalid || fuelType == Constant::eFuel::None) continue;
    6448             : 
    6449           2 :                     std::string_view fuelName = Constant::eFuelNames[(int)state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums[i]];
    6450             : 
    6451           6 :                     SetupOutputVariable(state,
    6452           4 :                                         format("Zone Other Equipment {} Rate", fuelName),
    6453             :                                         Constant::Units::W,
    6454           2 :                                         state.dataHeatBal->ZoneRpt(zoneNum).OtherPower[(int)fuelType],
    6455             :                                         OutputProcessor::TimeStepType::Zone,
    6456             :                                         OutputProcessor::StoreType::Average,
    6457           2 :                                         state.dataHeatBal->Zone(zoneNum).Name);
    6458           6 :                     SetupOutputVariable(state,
    6459           4 :                                         format("Zone Other Equipment {} Energy", fuelName),
    6460             :                                         Constant::Units::J,
    6461           2 :                                         state.dataHeatBal->ZoneRpt(zoneNum).OtherConsump[(int)fuelType],
    6462             :                                         OutputProcessor::TimeStepType::Zone,
    6463             :                                         OutputProcessor::StoreType::Sum,
    6464           2 :                                         state.dataHeatBal->Zone(zoneNum).Name);
    6465             :                 }
    6466             : 
    6467          72 :                 SetupOutputVariable(state,
    6468             :                                     "Zone Other Equipment Radiant Heating Energy",
    6469             :                                     Constant::Units::J,
    6470          36 :                                     state.dataHeatBal->ZoneRpt(zoneNum).OtherRadGain,
    6471             :                                     OutputProcessor::TimeStepType::Zone,
    6472             :                                     OutputProcessor::StoreType::Sum,
    6473          36 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6474          72 :                 SetupOutputVariable(state,
    6475             :                                     "Zone Other Equipment Radiant Heating Rate",
    6476             :                                     Constant::Units::W,
    6477          36 :                                     state.dataHeatBal->ZoneRpt(zoneNum).OtherRadGainRate,
    6478             :                                     OutputProcessor::TimeStepType::Zone,
    6479             :                                     OutputProcessor::StoreType::Average,
    6480          36 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6481          72 :                 SetupOutputVariable(state,
    6482             :                                     "Zone Other Equipment Convective Heating Energy",
    6483             :                                     Constant::Units::J,
    6484          36 :                                     state.dataHeatBal->ZoneRpt(zoneNum).OtherConGain,
    6485             :                                     OutputProcessor::TimeStepType::Zone,
    6486             :                                     OutputProcessor::StoreType::Sum,
    6487          36 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6488          72 :                 SetupOutputVariable(state,
    6489             :                                     "Zone Other Equipment Convective Heating Rate",
    6490             :                                     Constant::Units::W,
    6491          36 :                                     state.dataHeatBal->ZoneRpt(zoneNum).OtherConGainRate,
    6492             :                                     OutputProcessor::TimeStepType::Zone,
    6493             :                                     OutputProcessor::StoreType::Average,
    6494          36 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6495          72 :                 SetupOutputVariable(state,
    6496             :                                     "Zone Other Equipment Latent Gain Energy",
    6497             :                                     Constant::Units::J,
    6498          36 :                                     state.dataHeatBal->ZoneRpt(zoneNum).OtherLatGain,
    6499             :                                     OutputProcessor::TimeStepType::Zone,
    6500             :                                     OutputProcessor::StoreType::Sum,
    6501          36 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6502          72 :                 SetupOutputVariable(state,
    6503             :                                     "Zone Other Equipment Latent Gain Rate",
    6504             :                                     Constant::Units::W,
    6505          36 :                                     state.dataHeatBal->ZoneRpt(zoneNum).OtherLatGainRate,
    6506             :                                     OutputProcessor::TimeStepType::Zone,
    6507             :                                     OutputProcessor::StoreType::Average,
    6508          36 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6509          72 :                 SetupOutputVariable(state,
    6510             :                                     "Zone Other Equipment Lost Heat Energy",
    6511             :                                     Constant::Units::J,
    6512          36 :                                     state.dataHeatBal->ZoneRpt(zoneNum).OtherLost,
    6513             :                                     OutputProcessor::TimeStepType::Zone,
    6514             :                                     OutputProcessor::StoreType::Sum,
    6515          36 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6516          72 :                 SetupOutputVariable(state,
    6517             :                                     "Zone Other Equipment Lost Heat Rate",
    6518             :                                     Constant::Units::W,
    6519          36 :                                     state.dataHeatBal->ZoneRpt(zoneNum).OtherLostRate,
    6520             :                                     OutputProcessor::TimeStepType::Zone,
    6521             :                                     OutputProcessor::StoreType::Average,
    6522          36 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6523          72 :                 SetupOutputVariable(state,
    6524             :                                     "Zone Other Equipment Total Heating Energy",
    6525             :                                     Constant::Units::J,
    6526          36 :                                     state.dataHeatBal->ZoneRpt(zoneNum).OtherTotGain,
    6527             :                                     OutputProcessor::TimeStepType::Zone,
    6528             :                                     OutputProcessor::StoreType::Sum,
    6529          36 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6530          72 :                 SetupOutputVariable(state,
    6531             :                                     "Zone Other Equipment Total Heating Rate",
    6532             :                                     Constant::Units::W,
    6533          36 :                                     state.dataHeatBal->ZoneRpt(zoneNum).OtherTotGainRate,
    6534             :                                     OutputProcessor::TimeStepType::Zone,
    6535             :                                     OutputProcessor::StoreType::Average,
    6536          36 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6537             :             }
    6538             :             // Reset zone output flag
    6539        5056 :             addZoneOutputs(zoneNum) = false;
    6540             :         }
    6541             : 
    6542             :         // Space total report variables
    6543        5864 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    6544        5068 :             if (addSpaceOutputs(spaceNum)) {
    6545          38 :                 for (size_t i = 0; i < state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNums.size(); ++i) {
    6546           2 :                     Constant::eFuel fuelType = state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNums[i];
    6547           2 :                     if (fuelType == Constant::eFuel::Invalid || fuelType == Constant::eFuel::None) continue;
    6548             : 
    6549           6 :                     SetupOutputVariable(state,
    6550           4 :                                         format("Space Other Equipment {} Rate", Constant::eFuelNames[(int)fuelType]),
    6551             :                                         Constant::Units::W,
    6552           2 :                                         state.dataHeatBal->spaceRpt(spaceNum).OtherPower[(int)fuelType],
    6553             :                                         OutputProcessor::TimeStepType::Zone,
    6554             :                                         OutputProcessor::StoreType::Average,
    6555           2 :                                         state.dataHeatBal->space(spaceNum).Name);
    6556           6 :                     SetupOutputVariable(state,
    6557           4 :                                         format("Space Other Equipment {} Energy", Constant::eFuelNames[(int)fuelType]),
    6558             :                                         Constant::Units::J,
    6559           2 :                                         state.dataHeatBal->spaceRpt(spaceNum).OtherConsump[(int)fuelType],
    6560             :                                         OutputProcessor::TimeStepType::Zone,
    6561             :                                         OutputProcessor::StoreType::Sum,
    6562           2 :                                         state.dataHeatBal->space(spaceNum).Name);
    6563             :                 }
    6564             : 
    6565          72 :                 SetupOutputVariable(state,
    6566             :                                     "Space Other Equipment Radiant Heating Energy",
    6567             :                                     Constant::Units::J,
    6568          36 :                                     state.dataHeatBal->spaceRpt(spaceNum).OtherRadGain,
    6569             :                                     OutputProcessor::TimeStepType::Zone,
    6570             :                                     OutputProcessor::StoreType::Sum,
    6571          36 :                                     state.dataHeatBal->space(spaceNum).Name);
    6572          72 :                 SetupOutputVariable(state,
    6573             :                                     "Space Other Equipment Radiant Heating Rate",
    6574             :                                     Constant::Units::W,
    6575          36 :                                     state.dataHeatBal->spaceRpt(spaceNum).OtherRadGainRate,
    6576             :                                     OutputProcessor::TimeStepType::Zone,
    6577             :                                     OutputProcessor::StoreType::Average,
    6578          36 :                                     state.dataHeatBal->space(spaceNum).Name);
    6579          72 :                 SetupOutputVariable(state,
    6580             :                                     "Space Other Equipment Convective Heating Energy",
    6581             :                                     Constant::Units::J,
    6582          36 :                                     state.dataHeatBal->spaceRpt(spaceNum).OtherConGain,
    6583             :                                     OutputProcessor::TimeStepType::Zone,
    6584             :                                     OutputProcessor::StoreType::Sum,
    6585          36 :                                     state.dataHeatBal->space(spaceNum).Name);
    6586          72 :                 SetupOutputVariable(state,
    6587             :                                     "Space Other Equipment Convective Heating Rate",
    6588             :                                     Constant::Units::W,
    6589          36 :                                     state.dataHeatBal->spaceRpt(spaceNum).OtherConGainRate,
    6590             :                                     OutputProcessor::TimeStepType::Zone,
    6591             :                                     OutputProcessor::StoreType::Average,
    6592          36 :                                     state.dataHeatBal->space(spaceNum).Name);
    6593          72 :                 SetupOutputVariable(state,
    6594             :                                     "Space Other Equipment Latent Gain Energy",
    6595             :                                     Constant::Units::J,
    6596          36 :                                     state.dataHeatBal->spaceRpt(spaceNum).OtherLatGain,
    6597             :                                     OutputProcessor::TimeStepType::Zone,
    6598             :                                     OutputProcessor::StoreType::Sum,
    6599          36 :                                     state.dataHeatBal->space(spaceNum).Name);
    6600          72 :                 SetupOutputVariable(state,
    6601             :                                     "Space Other Equipment Latent Gain Rate",
    6602             :                                     Constant::Units::W,
    6603          36 :                                     state.dataHeatBal->spaceRpt(spaceNum).OtherLatGainRate,
    6604             :                                     OutputProcessor::TimeStepType::Zone,
    6605             :                                     OutputProcessor::StoreType::Average,
    6606          36 :                                     state.dataHeatBal->space(spaceNum).Name);
    6607          72 :                 SetupOutputVariable(state,
    6608             :                                     "Space Other Equipment Lost Heat Energy",
    6609             :                                     Constant::Units::J,
    6610          36 :                                     state.dataHeatBal->spaceRpt(spaceNum).OtherLost,
    6611             :                                     OutputProcessor::TimeStepType::Zone,
    6612             :                                     OutputProcessor::StoreType::Sum,
    6613          36 :                                     state.dataHeatBal->space(spaceNum).Name);
    6614          72 :                 SetupOutputVariable(state,
    6615             :                                     "Space Other Equipment Lost Heat Rate",
    6616             :                                     Constant::Units::W,
    6617          36 :                                     state.dataHeatBal->spaceRpt(spaceNum).OtherLostRate,
    6618             :                                     OutputProcessor::TimeStepType::Zone,
    6619             :                                     OutputProcessor::StoreType::Average,
    6620          36 :                                     state.dataHeatBal->space(spaceNum).Name);
    6621          72 :                 SetupOutputVariable(state,
    6622             :                                     "Space Other Equipment Total Heating Energy",
    6623             :                                     Constant::Units::J,
    6624          36 :                                     state.dataHeatBal->spaceRpt(spaceNum).OtherTotGain,
    6625             :                                     OutputProcessor::TimeStepType::Zone,
    6626             :                                     OutputProcessor::StoreType::Sum,
    6627          36 :                                     state.dataHeatBal->space(spaceNum).Name);
    6628          72 :                 SetupOutputVariable(state,
    6629             :                                     "Space Other Equipment Total Heating Rate",
    6630             :                                     Constant::Units::W,
    6631          36 :                                     state.dataHeatBal->spaceRpt(spaceNum).OtherTotGainRate,
    6632             :                                     OutputProcessor::TimeStepType::Zone,
    6633             :                                     OutputProcessor::StoreType::Average,
    6634          36 :                                     state.dataHeatBal->space(spaceNum).Name);
    6635             :             }
    6636             :             // Reset space output flag
    6637        5068 :             addSpaceOutputs(spaceNum) = false;
    6638             :         }
    6639             :         // Object report variables
    6640         803 :         for (int itEqNum = 1; itEqNum <= state.dataHeatBal->TotITEquip; ++itEqNum) {
    6641             :             // Set flags for zone and space total report variables
    6642           7 :             addZoneOutputs(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr) = true;
    6643           7 :             addSpaceOutputs(state.dataHeatBal->ZoneITEq(itEqNum).spaceIndex) = true;
    6644             : 
    6645           7 :             constexpr std::array<std::string_view, (int)PERptVars::Num> PowerOutputVariableStrings = {
    6646             :                 "ITE CPU Electricity Rate",
    6647             :                 "ITE Fan Electricity Rate",
    6648             :                 "ITE UPS Electricity Rate",
    6649             :                 "ITE CPU Electricity Rate at Design Inlet Conditions",
    6650             :                 "ITE Fan Electricity Rate at Design Inlet Conditions",
    6651             :                 "ITE UPS Heat Gain to Zone Rate",
    6652             :                 "ITE Total Heat Gain to Zone Rate"};
    6653             : 
    6654          56 :             for (int i = 0; i < (int)PERptVars::Num; ++i) {
    6655          98 :                 SetupOutputVariable(state,
    6656          49 :                                     PowerOutputVariableStrings[i],
    6657             :                                     Constant::Units::W,
    6658          49 :                                     state.dataHeatBal->ZoneITEq(itEqNum).PowerRpt[i],
    6659             :                                     OutputProcessor::TimeStepType::Zone,
    6660             :                                     OutputProcessor::StoreType::Average,
    6661          49 :                                     state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6662             :             }
    6663             : 
    6664          14 :             SetupOutputVariable(state,
    6665             :                                 "ITE CPU Electricity Energy",
    6666             :                                 Constant::Units::J,
    6667           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::CPU],
    6668             :                                 OutputProcessor::TimeStepType::Zone,
    6669             :                                 OutputProcessor::StoreType::Sum,
    6670           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name,
    6671             :                                 Constant::eResource::Electricity,
    6672             :                                 OutputProcessor::Group::Building,
    6673             :                                 OutputProcessor::EndUseCat::InteriorEquipment,
    6674           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).EndUseSubcategoryCPU,
    6675           7 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Name,
    6676           7 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Multiplier,
    6677           7 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).ListMultiplier,
    6678           7 :                                 state.dataHeatBal->space(state.dataHeatBal->ZoneITEq(itEqNum).spaceIndex).spaceType);
    6679             : 
    6680          14 :             SetupOutputVariable(state,
    6681             :                                 "ITE Fan Electricity Energy",
    6682             :                                 Constant::Units::J,
    6683           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::Fan],
    6684             :                                 OutputProcessor::TimeStepType::Zone,
    6685             :                                 OutputProcessor::StoreType::Sum,
    6686           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name,
    6687             :                                 Constant::eResource::Electricity,
    6688             :                                 OutputProcessor::Group::Building,
    6689             :                                 OutputProcessor::EndUseCat::InteriorEquipment,
    6690           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).EndUseSubcategoryFan,
    6691           7 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Name,
    6692           7 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Multiplier,
    6693           7 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).ListMultiplier,
    6694           7 :                                 state.dataHeatBal->space(state.dataHeatBal->ZoneITEq(itEqNum).spaceIndex).spaceType);
    6695          14 :             SetupOutputVariable(state,
    6696             :                                 "ITE UPS Electricity Energy",
    6697             :                                 Constant::Units::J,
    6698           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::UPS],
    6699             :                                 OutputProcessor::TimeStepType::Zone,
    6700             :                                 OutputProcessor::StoreType::Sum,
    6701           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name,
    6702             :                                 Constant::eResource::Electricity,
    6703             :                                 OutputProcessor::Group::Building,
    6704             :                                 OutputProcessor::EndUseCat::InteriorEquipment,
    6705           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).EndUseSubcategoryUPS,
    6706           7 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Name,
    6707           7 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Multiplier,
    6708           7 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).ListMultiplier,
    6709           7 :                                 state.dataHeatBal->space(state.dataHeatBal->ZoneITEq(itEqNum).spaceIndex).spaceType);
    6710          14 :             SetupOutputVariable(state,
    6711             :                                 "ITE CPU Electricity Energy at Design Inlet Conditions",
    6712             :                                 Constant::Units::J,
    6713           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::CPUAtDesign],
    6714             :                                 OutputProcessor::TimeStepType::Zone,
    6715             :                                 OutputProcessor::StoreType::Sum,
    6716           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6717          14 :             SetupOutputVariable(state,
    6718             :                                 "ITE Fan Electricity Energy at Design Inlet Conditions",
    6719             :                                 Constant::Units::J,
    6720           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::FanAtDesign],
    6721             :                                 OutputProcessor::TimeStepType::Zone,
    6722             :                                 OutputProcessor::StoreType::Sum,
    6723           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6724          14 :             SetupOutputVariable(state,
    6725             :                                 "ITE UPS Heat Gain to Zone Energy",
    6726             :                                 Constant::Units::J,
    6727           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::UPSGainToZone],
    6728             :                                 OutputProcessor::TimeStepType::Zone,
    6729             :                                 OutputProcessor::StoreType::Sum,
    6730           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6731          14 :             SetupOutputVariable(state,
    6732             :                                 "ITE Total Heat Gain to Zone Energy",
    6733             :                                 Constant::Units::J,
    6734           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::ConGainToZone],
    6735             :                                 OutputProcessor::TimeStepType::Zone,
    6736             :                                 OutputProcessor::StoreType::Sum,
    6737           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6738             : 
    6739          14 :             SetupOutputVariable(state,
    6740             :                                 "ITE Standard Density Air Volume Flow Rate",
    6741             :                                 Constant::Units::m3_s,
    6742           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).AirVolFlowStdDensity,
    6743             :                                 OutputProcessor::TimeStepType::Zone,
    6744             :                                 OutputProcessor::StoreType::Average,
    6745           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6746          14 :             SetupOutputVariable(state,
    6747             :                                 "ITE Current Density Air Volume Flow Rate",
    6748             :                                 Constant::Units::m3_s,
    6749           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).AirVolFlowCurDensity,
    6750             :                                 OutputProcessor::TimeStepType::Zone,
    6751             :                                 OutputProcessor::StoreType::Average,
    6752           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6753          14 :             SetupOutputVariable(state,
    6754             :                                 "ITE Air Mass Flow Rate",
    6755             :                                 Constant::Units::kg_s,
    6756           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).AirMassFlow,
    6757             :                                 OutputProcessor::TimeStepType::Zone,
    6758             :                                 OutputProcessor::StoreType::Average,
    6759           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6760          14 :             SetupOutputVariable(state,
    6761             :                                 "ITE Air Inlet Dry-Bulb Temperature",
    6762             :                                 Constant::Units::C,
    6763           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).AirInletDryBulbT,
    6764             :                                 OutputProcessor::TimeStepType::Zone,
    6765             :                                 OutputProcessor::StoreType::Average,
    6766           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6767          14 :             SetupOutputVariable(state,
    6768             :                                 "ITE Air Inlet Dewpoint Temperature",
    6769             :                                 Constant::Units::C,
    6770           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).AirInletDewpointT,
    6771             :                                 OutputProcessor::TimeStepType::Zone,
    6772             :                                 OutputProcessor::StoreType::Average,
    6773           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6774          14 :             SetupOutputVariable(state,
    6775             :                                 "ITE Air Inlet Relative Humidity",
    6776             :                                 Constant::Units::Perc,
    6777           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).AirInletRelHum,
    6778             :                                 OutputProcessor::TimeStepType::Zone,
    6779             :                                 OutputProcessor::StoreType::Average,
    6780           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6781          14 :             SetupOutputVariable(state,
    6782             :                                 "ITE Air Outlet Dry-Bulb Temperature",
    6783             :                                 Constant::Units::C,
    6784           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).AirOutletDryBulbT,
    6785             :                                 OutputProcessor::TimeStepType::Zone,
    6786             :                                 OutputProcessor::StoreType::Average,
    6787           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6788           7 :             if (state.dataHeatBal->ZoneITEq(itEqNum).SupplyAirNodeNum != 0) {
    6789          14 :                 SetupOutputVariable(state,
    6790             :                                     "ITE Supply Heat Index",
    6791             :                                     Constant::Units::None,
    6792           7 :                                     state.dataHeatBal->ZoneITEq(itEqNum).SHI,
    6793             :                                     OutputProcessor::TimeStepType::Zone,
    6794             :                                     OutputProcessor::StoreType::Average,
    6795           7 :                                     state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6796             :             }
    6797          14 :             SetupOutputVariable(state,
    6798             :                                 "ITE Air Inlet Operating Range Exceeded Time",
    6799             :                                 Constant::Units::hr,
    6800           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).TimeOutOfOperRange,
    6801             :                                 OutputProcessor::TimeStepType::Zone,
    6802             :                                 OutputProcessor::StoreType::Sum,
    6803           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6804          14 :             SetupOutputVariable(state,
    6805             :                                 "ITE Air Inlet Dry-Bulb Temperature Above Operating Range Time",
    6806             :                                 Constant::Units::hr,
    6807           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).TimeAboveDryBulbT,
    6808             :                                 OutputProcessor::TimeStepType::Zone,
    6809             :                                 OutputProcessor::StoreType::Sum,
    6810           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6811          14 :             SetupOutputVariable(state,
    6812             :                                 "ITE Air Inlet Dry-Bulb Temperature Below Operating Range Time",
    6813             :                                 Constant::Units::hr,
    6814           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).TimeBelowDryBulbT,
    6815             :                                 OutputProcessor::TimeStepType::Zone,
    6816             :                                 OutputProcessor::StoreType::Sum,
    6817           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6818          14 :             SetupOutputVariable(state,
    6819             :                                 "ITE Air Inlet Dewpoint Temperature Above Operating Range Time",
    6820             :                                 Constant::Units::hr,
    6821           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).TimeAboveDewpointT,
    6822             :                                 OutputProcessor::TimeStepType::Zone,
    6823             :                                 OutputProcessor::StoreType::Sum,
    6824           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6825          14 :             SetupOutputVariable(state,
    6826             :                                 "ITE Air Inlet Dewpoint Temperature Below Operating Range Time",
    6827             :                                 Constant::Units::hr,
    6828           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).TimeBelowDewpointT,
    6829             :                                 OutputProcessor::TimeStepType::Zone,
    6830             :                                 OutputProcessor::StoreType::Sum,
    6831           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6832          14 :             SetupOutputVariable(state,
    6833             :                                 "ITE Air Inlet Relative Humidity Above Operating Range Time",
    6834             :                                 Constant::Units::hr,
    6835           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).TimeAboveRH,
    6836             :                                 OutputProcessor::TimeStepType::Zone,
    6837             :                                 OutputProcessor::StoreType::Sum,
    6838           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6839          14 :             SetupOutputVariable(state,
    6840             :                                 "ITE Air Inlet Relative Humidity Below Operating Range Time",
    6841             :                                 Constant::Units::hr,
    6842           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).TimeBelowRH,
    6843             :                                 OutputProcessor::TimeStepType::Zone,
    6844             :                                 OutputProcessor::StoreType::Sum,
    6845           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6846          14 :             SetupOutputVariable(state,
    6847             :                                 "ITE Air Inlet Dry-Bulb Temperature Difference Above Operating Range",
    6848             :                                 Constant::Units::deltaC,
    6849           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).DryBulbTAboveDeltaT,
    6850             :                                 OutputProcessor::TimeStepType::Zone,
    6851             :                                 OutputProcessor::StoreType::Average,
    6852           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6853          14 :             SetupOutputVariable(state,
    6854             :                                 "ITE Air Inlet Dry-Bulb Temperature Difference Below Operating Range",
    6855             :                                 Constant::Units::deltaC,
    6856           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).DryBulbTBelowDeltaT,
    6857             :                                 OutputProcessor::TimeStepType::Zone,
    6858             :                                 OutputProcessor::StoreType::Average,
    6859           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6860          14 :             SetupOutputVariable(state,
    6861             :                                 "ITE Air Inlet Dewpoint Temperature Difference Above Operating Range",
    6862             :                                 Constant::Units::deltaC,
    6863           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).DewpointTAboveDeltaT,
    6864             :                                 OutputProcessor::TimeStepType::Zone,
    6865             :                                 OutputProcessor::StoreType::Average,
    6866           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6867          14 :             SetupOutputVariable(state,
    6868             :                                 "ITE Air Inlet Dewpoint Temperature Difference Below Operating Range",
    6869             :                                 Constant::Units::deltaC,
    6870           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).DewpointTBelowDeltaT,
    6871             :                                 OutputProcessor::TimeStepType::Zone,
    6872             :                                 OutputProcessor::StoreType::Average,
    6873           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6874          14 :             SetupOutputVariable(state,
    6875             :                                 "ITE Air Inlet Relative Humidity Difference Above Operating Range",
    6876             :                                 Constant::Units::Perc,
    6877           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).RHAboveDeltaRH,
    6878             :                                 OutputProcessor::TimeStepType::Zone,
    6879             :                                 OutputProcessor::StoreType::Average,
    6880           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6881          14 :             SetupOutputVariable(state,
    6882             :                                 "ITE Air Inlet Relative Humidity Difference Below Operating Range",
    6883             :                                 Constant::Units::Perc,
    6884           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).RHBelowDeltaRH,
    6885             :                                 OutputProcessor::TimeStepType::Zone,
    6886             :                                 OutputProcessor::StoreType::Average,
    6887           7 :                                 state.dataHeatBal->ZoneITEq(itEqNum).Name);
    6888             :         }
    6889             : 
    6890             :         // Zone total report variables
    6891        5852 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
    6892        5056 :             if (addZoneOutputs(zoneNum)) {
    6893             : 
    6894           7 :                 constexpr std::array<std::string_view, (int)PERptVars::Num> PowerOutputVariableStrings = {
    6895             :                     "Zone ITE CPU Electricity Rate",
    6896             :                     "Zone ITE Fan Electricity Rate",
    6897             :                     "Zone ITE UPS Electricity Rate",
    6898             :                     "Zone ITE CPU Electricity Rate at Design Inlet Conditions",
    6899             :                     "Zone ITE Fan Electricity Rate at Design Inlet Conditions",
    6900             :                     "Zone ITE UPS Heat Gain to Zone Rate",
    6901             :                     "Zone ITE Total Heat Gain to Zone Rate"};
    6902             : 
    6903          56 :                 for (int i = 0; i < (int)PERptVars::Num; ++i) {
    6904          98 :                     SetupOutputVariable(state,
    6905          49 :                                         PowerOutputVariableStrings[i],
    6906             :                                         Constant::Units::W,
    6907          49 :                                         state.dataHeatBal->ZoneRpt(zoneNum).PowerRpt[i],
    6908             :                                         OutputProcessor::TimeStepType::Zone,
    6909             :                                         OutputProcessor::StoreType::Average,
    6910          49 :                                         state.dataHeatBal->Zone(zoneNum).Name);
    6911             :                 }
    6912             : 
    6913          14 :                 SetupOutputVariable(state,
    6914             :                                     "Zone ITE Adjusted Return Air Temperature",
    6915             :                                     Constant::Units::C,
    6916           7 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ITEAdjReturnTemp,
    6917             :                                     OutputProcessor::TimeStepType::Zone,
    6918             :                                     OutputProcessor::StoreType::Average,
    6919           7 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6920             : 
    6921           7 :                 constexpr std::array<std::string_view, (int)PERptVars::Num> EnergyOutputVariableStrings = {
    6922             :                     "Zone ITE CPU Electricity Energy",
    6923             :                     "Zone ITE Fan Electricity Energy",
    6924             :                     "Zone ITE UPS Electricity Energy",
    6925             :                     "Zone ITE CPU Electricity Energy at Design Inlet Conditions",
    6926             :                     "Zone ITE Fan Electricity Energy at Design Inlet Conditions",
    6927             :                     "Zone ITE UPS Heat Gain to Zone Energy",
    6928             :                     "Zone ITE Total Heat Gain to Zone Energy"};
    6929             : 
    6930          56 :                 for (int i = 0; i < (int)PERptVars::Num; ++i) {
    6931          98 :                     SetupOutputVariable(state,
    6932          49 :                                         EnergyOutputVariableStrings[i],
    6933             :                                         Constant::Units::J,
    6934          49 :                                         state.dataHeatBal->ZoneRpt(zoneNum).EnergyRpt[i],
    6935             :                                         OutputProcessor::TimeStepType::Zone,
    6936             :                                         OutputProcessor::StoreType::Sum,
    6937          49 :                                         state.dataHeatBal->Zone(zoneNum).Name);
    6938             :                 }
    6939             : 
    6940          14 :                 SetupOutputVariable(state,
    6941             :                                     "Zone ITE Standard Density Air Volume Flow Rate",
    6942             :                                     Constant::Units::m3_s,
    6943           7 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ITEqAirVolFlowStdDensity,
    6944             :                                     OutputProcessor::TimeStepType::Zone,
    6945             :                                     OutputProcessor::StoreType::Average,
    6946           7 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6947          14 :                 SetupOutputVariable(state,
    6948             :                                     "Zone ITE Air Mass Flow Rate",
    6949             :                                     Constant::Units::kg_s,
    6950           7 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ITEqAirMassFlow,
    6951             :                                     OutputProcessor::TimeStepType::Zone,
    6952             :                                     OutputProcessor::StoreType::Average,
    6953           7 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6954          14 :                 SetupOutputVariable(state,
    6955             :                                     "Zone ITE Average Supply Heat Index",
    6956             :                                     Constant::Units::None,
    6957           7 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ITEqSHI,
    6958             :                                     OutputProcessor::TimeStepType::Zone,
    6959             :                                     OutputProcessor::StoreType::Average,
    6960           7 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6961          14 :                 SetupOutputVariable(state,
    6962             :                                     "Zone ITE Any Air Inlet Operating Range Exceeded Time",
    6963             :                                     Constant::Units::hr,
    6964           7 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeOutOfOperRange,
    6965             :                                     OutputProcessor::TimeStepType::Zone,
    6966             :                                     OutputProcessor::StoreType::Sum,
    6967           7 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6968          14 :                 SetupOutputVariable(state,
    6969             :                                     "Zone ITE Any Air Inlet Dry-Bulb Temperature Above Operating Range Time",
    6970             :                                     Constant::Units::hr,
    6971           7 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeAboveDryBulbT,
    6972             :                                     OutputProcessor::TimeStepType::Zone,
    6973             :                                     OutputProcessor::StoreType::Sum,
    6974           7 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6975          14 :                 SetupOutputVariable(state,
    6976             :                                     "Zone ITE Any Air Inlet Dry-Bulb Temperature Below Operating Range Time",
    6977             :                                     Constant::Units::hr,
    6978           7 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeBelowDryBulbT,
    6979             :                                     OutputProcessor::TimeStepType::Zone,
    6980             :                                     OutputProcessor::StoreType::Sum,
    6981           7 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6982          14 :                 SetupOutputVariable(state,
    6983             :                                     "Zone ITE Any Air Inlet Dewpoint Temperature Above Operating Range Time",
    6984             :                                     Constant::Units::hr,
    6985           7 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeAboveDewpointT,
    6986             :                                     OutputProcessor::TimeStepType::Zone,
    6987             :                                     OutputProcessor::StoreType::Sum,
    6988           7 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6989          14 :                 SetupOutputVariable(state,
    6990             :                                     "Zone ITE Any Air Inlet Dewpoint Temperature Below Operating Range Time",
    6991             :                                     Constant::Units::hr,
    6992           7 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeBelowDewpointT,
    6993             :                                     OutputProcessor::TimeStepType::Zone,
    6994             :                                     OutputProcessor::StoreType::Sum,
    6995           7 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    6996          14 :                 SetupOutputVariable(state,
    6997             :                                     "Zone ITE Any Air Inlet Relative Humidity Above Operating Range Time",
    6998             :                                     Constant::Units::hr,
    6999           7 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeAboveRH,
    7000             :                                     OutputProcessor::TimeStepType::Zone,
    7001             :                                     OutputProcessor::StoreType::Sum,
    7002           7 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    7003          14 :                 SetupOutputVariable(state,
    7004             :                                     "Zone ITE Any Air Inlet Relative Humidity Below Operating Range Time",
    7005             :                                     Constant::Units::hr,
    7006           7 :                                     state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeBelowRH,
    7007             :                                     OutputProcessor::TimeStepType::Zone,
    7008             :                                     OutputProcessor::StoreType::Sum,
    7009           7 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    7010             :             }
    7011             :             // Reset zone output flag
    7012        5056 :             addZoneOutputs(zoneNum) = false;
    7013             :         }
    7014             : 
    7015             :         // Space total report variables
    7016        5864 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    7017        5068 :             if (addSpaceOutputs(spaceNum)) {
    7018           7 :                 constexpr std::array<std::string_view, (int)PERptVars::Num> PowerOutputVariableStrings = {
    7019             :                     "Space ITE CPU Electricity Rate",
    7020             :                     "Space ITE Fan Electricity Rate",
    7021             :                     "Space ITE UPS Electricity Rate",
    7022             :                     "Space ITE CPU Electricity Rate at Design Inlet Conditions",
    7023             :                     "Space ITE Fan Electricity Rate at Design Inlet Conditions",
    7024             :                     "Space ITE UPS Heat Gain to Zone Rate",
    7025             :                     "Space ITE Total Heat Gain to Zone Rate"};
    7026             : 
    7027          56 :                 for (int i = 0; i < (int)PERptVars::Num; ++i) {
    7028          98 :                     SetupOutputVariable(state,
    7029          49 :                                         PowerOutputVariableStrings[i],
    7030             :                                         Constant::Units::W,
    7031          49 :                                         state.dataHeatBal->spaceRpt(spaceNum).PowerRpt[i],
    7032             :                                         OutputProcessor::TimeStepType::Zone,
    7033             :                                         OutputProcessor::StoreType::Average,
    7034          49 :                                         state.dataHeatBal->space(spaceNum).Name);
    7035             :                 }
    7036             : 
    7037             :                 // Not applicable for space until space has it's own air temeratures
    7038             :                 // Setup Output Variable(state,
    7039             :                 //                    "Space ITE Adjusted Return Air Temperature",
    7040             :                 //                    Constant::Units::W,
    7041             :                 //                    state.dataHeatBal->spaceRpt(spaceNum).ITEAdjReturnTemp,
    7042             :                 //                    OutputProcessor::TimeStepType::Zone,
    7043             :                 //                    OutputProcessor::StoreType::Average,
    7044             :                 //                    state.dataHeatBal->space(spaceNum).Name);
    7045             : 
    7046           7 :                 constexpr std::array<std::string_view, (int)PERptVars::Num> EnergyOutputVariableStrings = {
    7047             :                     "Space ITE CPU Electricity Energy",
    7048             :                     "Space ITE Fan Electricity Energy",
    7049             :                     "Space ITE UPS Electricity Energy",
    7050             :                     "Space ITE CPU Electricity Energy at Design Inlet Conditions",
    7051             :                     "Space ITE Fan Electricity Energy at Design Inlet Conditions",
    7052             :                     "Space ITE UPS Heat Gain to Zone Energy",
    7053             :                     "Space ITE Total Heat Gain to Zone Energy"};
    7054             : 
    7055          56 :                 for (int i = 0; i < (int)PERptVars::Num; ++i) {
    7056          98 :                     SetupOutputVariable(state,
    7057          49 :                                         EnergyOutputVariableStrings[i],
    7058             :                                         Constant::Units::J,
    7059          49 :                                         state.dataHeatBal->spaceRpt(spaceNum).EnergyRpt[i],
    7060             :                                         OutputProcessor::TimeStepType::Zone,
    7061             :                                         OutputProcessor::StoreType::Sum,
    7062          49 :                                         state.dataHeatBal->space(spaceNum).Name);
    7063             :                 }
    7064             : 
    7065          14 :                 SetupOutputVariable(state,
    7066             :                                     "Space ITE Standard Density Air Volume Flow Rate",
    7067             :                                     Constant::Units::m3_s,
    7068           7 :                                     state.dataHeatBal->spaceRpt(spaceNum).ITEqAirVolFlowStdDensity,
    7069             :                                     OutputProcessor::TimeStepType::Zone,
    7070             :                                     OutputProcessor::StoreType::Average,
    7071           7 :                                     state.dataHeatBal->space(spaceNum).Name);
    7072          14 :                 SetupOutputVariable(state,
    7073             :                                     "Space ITE Air Mass Flow Rate",
    7074             :                                     Constant::Units::kg_s,
    7075           7 :                                     state.dataHeatBal->spaceRpt(spaceNum).ITEqAirMassFlow,
    7076             :                                     OutputProcessor::TimeStepType::Zone,
    7077             :                                     OutputProcessor::StoreType::Average,
    7078           7 :                                     state.dataHeatBal->space(spaceNum).Name);
    7079          14 :                 SetupOutputVariable(state,
    7080             :                                     "Space ITE Average Supply Heat Index",
    7081             :                                     Constant::Units::None,
    7082           7 :                                     state.dataHeatBal->spaceRpt(spaceNum).ITEqSHI,
    7083             :                                     OutputProcessor::TimeStepType::Zone,
    7084             :                                     OutputProcessor::StoreType::Average,
    7085           7 :                                     state.dataHeatBal->space(spaceNum).Name);
    7086          14 :                 SetupOutputVariable(state,
    7087             :                                     "Space ITE Any Air Inlet Operating Range Exceeded Time",
    7088             :                                     Constant::Units::hr,
    7089           7 :                                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange,
    7090             :                                     OutputProcessor::TimeStepType::Zone,
    7091             :                                     OutputProcessor::StoreType::Sum,
    7092           7 :                                     state.dataHeatBal->space(spaceNum).Name);
    7093          14 :                 SetupOutputVariable(state,
    7094             :                                     "Space ITE Any Air Inlet Dry-Bulb Temperature Above Operating Range Time",
    7095             :                                     Constant::Units::hr,
    7096           7 :                                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDryBulbT,
    7097             :                                     OutputProcessor::TimeStepType::Zone,
    7098             :                                     OutputProcessor::StoreType::Sum,
    7099           7 :                                     state.dataHeatBal->space(spaceNum).Name);
    7100          14 :                 SetupOutputVariable(state,
    7101             :                                     "Space ITE Any Air Inlet Dry-Bulb Temperature Below Operating Range Time",
    7102             :                                     Constant::Units::hr,
    7103           7 :                                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDryBulbT,
    7104             :                                     OutputProcessor::TimeStepType::Zone,
    7105             :                                     OutputProcessor::StoreType::Sum,
    7106           7 :                                     state.dataHeatBal->space(spaceNum).Name);
    7107          14 :                 SetupOutputVariable(state,
    7108             :                                     "Space ITE Any Air Inlet Dewpoint Temperature Above Operating Range Time",
    7109             :                                     Constant::Units::hr,
    7110           7 :                                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDewpointT,
    7111             :                                     OutputProcessor::TimeStepType::Zone,
    7112             :                                     OutputProcessor::StoreType::Sum,
    7113           7 :                                     state.dataHeatBal->space(spaceNum).Name);
    7114          14 :                 SetupOutputVariable(state,
    7115             :                                     "Space ITE Any Air Inlet Dewpoint Temperature Below Operating Range Time",
    7116             :                                     Constant::Units::hr,
    7117           7 :                                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDewpointT,
    7118             :                                     OutputProcessor::TimeStepType::Zone,
    7119             :                                     OutputProcessor::StoreType::Sum,
    7120           7 :                                     state.dataHeatBal->space(spaceNum).Name);
    7121          14 :                 SetupOutputVariable(state,
    7122             :                                     "Space ITE Any Air Inlet Relative Humidity Above Operating Range Time",
    7123             :                                     Constant::Units::hr,
    7124           7 :                                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveRH,
    7125             :                                     OutputProcessor::TimeStepType::Zone,
    7126             :                                     OutputProcessor::StoreType::Sum,
    7127           7 :                                     state.dataHeatBal->space(spaceNum).Name);
    7128          14 :                 SetupOutputVariable(state,
    7129             :                                     "Space ITE Any Air Inlet Relative Humidity Below Operating Range Time",
    7130             :                                     Constant::Units::hr,
    7131           7 :                                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowRH,
    7132             :                                     OutputProcessor::TimeStepType::Zone,
    7133             :                                     OutputProcessor::StoreType::Sum,
    7134           7 :                                     state.dataHeatBal->space(spaceNum).Name);
    7135             :             }
    7136             :             // Reset space output flag
    7137        5068 :             addSpaceOutputs(spaceNum) = false;
    7138             :         }
    7139             : 
    7140             :         // Object report variables
    7141         799 :         for (int bbHeatNum = 1; bbHeatNum <= state.dataHeatBal->TotBBHeat; ++bbHeatNum) {
    7142             :             // Set flags for zone and space total report variables
    7143           3 :             addZoneOutputs(state.dataHeatBal->ZoneBBHeat(bbHeatNum).ZonePtr) = true;
    7144           3 :             addSpaceOutputs(state.dataHeatBal->ZoneBBHeat(bbHeatNum).spaceIndex) = true;
    7145           6 :             SetupOutputVariable(state,
    7146             :                                 "Baseboard Electricity Rate",
    7147             :                                 Constant::Units::W,
    7148           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).Power,
    7149             :                                 OutputProcessor::TimeStepType::Zone,
    7150             :                                 OutputProcessor::StoreType::Average,
    7151           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
    7152           6 :             SetupOutputVariable(state,
    7153             :                                 "Baseboard Electricity Energy",
    7154             :                                 Constant::Units::J,
    7155           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).Consumption,
    7156             :                                 OutputProcessor::TimeStepType::Zone,
    7157             :                                 OutputProcessor::StoreType::Sum,
    7158           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name,
    7159             :                                 Constant::eResource::Electricity,
    7160             :                                 OutputProcessor::Group::Building,
    7161             :                                 OutputProcessor::EndUseCat::InteriorEquipment,
    7162           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).EndUseSubcategory,
    7163           3 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(bbHeatNum).ZonePtr).Name,
    7164           3 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(bbHeatNum).ZonePtr).Multiplier,
    7165           3 :                                 state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(bbHeatNum).ZonePtr).ListMultiplier,
    7166           3 :                                 state.dataHeatBal->space(state.dataHeatBal->ZoneBBHeat(bbHeatNum).spaceIndex).spaceType);
    7167             : 
    7168           6 :             SetupOutputVariable(state,
    7169             :                                 "Baseboard Radiant Heating Energy",
    7170             :                                 Constant::Units::J,
    7171           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).RadGainEnergy,
    7172             :                                 OutputProcessor::TimeStepType::Zone,
    7173             :                                 OutputProcessor::StoreType::Sum,
    7174           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
    7175           6 :             SetupOutputVariable(state,
    7176             :                                 "Baseboard Radiant Heating Rate",
    7177             :                                 Constant::Units::W,
    7178           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).RadGainRate,
    7179             :                                 OutputProcessor::TimeStepType::Zone,
    7180             :                                 OutputProcessor::StoreType::Average,
    7181           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
    7182           6 :             SetupOutputVariable(state,
    7183             :                                 "Baseboard Convective Heating Energy",
    7184             :                                 Constant::Units::J,
    7185           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).ConGainEnergy,
    7186             :                                 OutputProcessor::TimeStepType::Zone,
    7187             :                                 OutputProcessor::StoreType::Sum,
    7188           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
    7189           6 :             SetupOutputVariable(state,
    7190             :                                 "Baseboard Convective Heating Rate",
    7191             :                                 Constant::Units::W,
    7192           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).ConGainRate,
    7193             :                                 OutputProcessor::TimeStepType::Zone,
    7194             :                                 OutputProcessor::StoreType::Average,
    7195           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
    7196           6 :             SetupOutputVariable(state,
    7197             :                                 "Baseboard Total Heating Energy",
    7198             :                                 Constant::Units::J,
    7199           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).TotGainEnergy,
    7200             :                                 OutputProcessor::TimeStepType::Zone,
    7201             :                                 OutputProcessor::StoreType::Sum,
    7202           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
    7203           6 :             SetupOutputVariable(state,
    7204             :                                 "Baseboard Total Heating Rate",
    7205             :                                 Constant::Units::W,
    7206           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).TotGainRate,
    7207             :                                 OutputProcessor::TimeStepType::Zone,
    7208             :                                 OutputProcessor::StoreType::Average,
    7209           3 :                                 state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
    7210             :         }
    7211             : 
    7212             :         // Zone total report variables
    7213        5852 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
    7214        5056 :             if (addZoneOutputs(zoneNum)) {
    7215           6 :                 SetupOutputVariable(state,
    7216             :                                     "Zone Baseboard Electricity Rate",
    7217             :                                     Constant::Units::W,
    7218           3 :                                     state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatPower,
    7219             :                                     OutputProcessor::TimeStepType::Zone,
    7220             :                                     OutputProcessor::StoreType::Average,
    7221           3 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    7222           6 :                 SetupOutputVariable(state,
    7223             :                                     "Zone Baseboard Electricity Energy",
    7224             :                                     Constant::Units::J,
    7225           3 :                                     state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatElecCons,
    7226             :                                     OutputProcessor::TimeStepType::Zone,
    7227             :                                     OutputProcessor::StoreType::Sum,
    7228           3 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    7229             : 
    7230           6 :                 SetupOutputVariable(state,
    7231             :                                     "Zone Baseboard Radiant Heating Energy",
    7232             :                                     Constant::Units::J,
    7233           3 :                                     state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatRadGain,
    7234             :                                     OutputProcessor::TimeStepType::Zone,
    7235             :                                     OutputProcessor::StoreType::Sum,
    7236           3 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    7237           6 :                 SetupOutputVariable(state,
    7238             :                                     "Zone Baseboard Radiant Heating Rate",
    7239             :                                     Constant::Units::W,
    7240           3 :                                     state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatRadGainRate,
    7241             :                                     OutputProcessor::TimeStepType::Zone,
    7242             :                                     OutputProcessor::StoreType::Average,
    7243           3 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    7244           6 :                 SetupOutputVariable(state,
    7245             :                                     "Zone Baseboard Convective Heating Energy",
    7246             :                                     Constant::Units::J,
    7247           3 :                                     state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatConGain,
    7248             :                                     OutputProcessor::TimeStepType::Zone,
    7249             :                                     OutputProcessor::StoreType::Sum,
    7250           3 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    7251           6 :                 SetupOutputVariable(state,
    7252             :                                     "Zone Baseboard Convective Heating Rate",
    7253             :                                     Constant::Units::W,
    7254           3 :                                     state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatConGainRate,
    7255             :                                     OutputProcessor::TimeStepType::Zone,
    7256             :                                     OutputProcessor::StoreType::Average,
    7257           3 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    7258           6 :                 SetupOutputVariable(state,
    7259             :                                     "Zone Baseboard Total Heating Energy",
    7260             :                                     Constant::Units::J,
    7261           3 :                                     state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatTotGain,
    7262             :                                     OutputProcessor::TimeStepType::Zone,
    7263             :                                     OutputProcessor::StoreType::Sum,
    7264           3 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    7265           6 :                 SetupOutputVariable(state,
    7266             :                                     "Zone Baseboard Total Heating Rate",
    7267             :                                     Constant::Units::W,
    7268           3 :                                     state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatTotGainRate,
    7269             :                                     OutputProcessor::TimeStepType::Zone,
    7270             :                                     OutputProcessor::StoreType::Average,
    7271           3 :                                     state.dataHeatBal->Zone(zoneNum).Name);
    7272             :             }
    7273             :             // Reset zone output flag
    7274        5056 :             addZoneOutputs(zoneNum) = false;
    7275             :         }
    7276             : 
    7277             :         // Space total report variables
    7278        5864 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    7279        5068 :             if (addSpaceOutputs(spaceNum)) {
    7280           6 :                 SetupOutputVariable(state,
    7281             :                                     "Space Baseboard Electricity Rate",
    7282             :                                     Constant::Units::W,
    7283           3 :                                     state.dataHeatBal->spaceRpt(spaceNum).BaseHeatPower,
    7284             :                                     OutputProcessor::TimeStepType::Zone,
    7285             :                                     OutputProcessor::StoreType::Average,
    7286           3 :                                     state.dataHeatBal->space(spaceNum).Name);
    7287           6 :                 SetupOutputVariable(state,
    7288             :                                     "Space Baseboard Electricity Energy",
    7289             :                                     Constant::Units::J,
    7290           3 :                                     state.dataHeatBal->spaceRpt(spaceNum).BaseHeatElecCons,
    7291             :                                     OutputProcessor::TimeStepType::Zone,
    7292             :                                     OutputProcessor::StoreType::Sum,
    7293           3 :                                     state.dataHeatBal->space(spaceNum).Name);
    7294             : 
    7295           6 :                 SetupOutputVariable(state,
    7296             :                                     "Space Baseboard Radiant Heating Energy",
    7297             :                                     Constant::Units::J,
    7298           3 :                                     state.dataHeatBal->spaceRpt(spaceNum).BaseHeatRadGain,
    7299             :                                     OutputProcessor::TimeStepType::Zone,
    7300             :                                     OutputProcessor::StoreType::Sum,
    7301           3 :                                     state.dataHeatBal->space(spaceNum).Name);
    7302           6 :                 SetupOutputVariable(state,
    7303             :                                     "Space Baseboard Radiant Heating Rate",
    7304             :                                     Constant::Units::W,
    7305           3 :                                     state.dataHeatBal->spaceRpt(spaceNum).BaseHeatRadGainRate,
    7306             :                                     OutputProcessor::TimeStepType::Zone,
    7307             :                                     OutputProcessor::StoreType::Average,
    7308           3 :                                     state.dataHeatBal->space(spaceNum).Name);
    7309           6 :                 SetupOutputVariable(state,
    7310             :                                     "Space Baseboard Convective Heating Energy",
    7311             :                                     Constant::Units::J,
    7312           3 :                                     state.dataHeatBal->spaceRpt(spaceNum).BaseHeatConGain,
    7313             :                                     OutputProcessor::TimeStepType::Zone,
    7314             :                                     OutputProcessor::StoreType::Sum,
    7315           3 :                                     state.dataHeatBal->space(spaceNum).Name);
    7316           6 :                 SetupOutputVariable(state,
    7317             :                                     "Space Baseboard Convective Heating Rate",
    7318             :                                     Constant::Units::W,
    7319           3 :                                     state.dataHeatBal->spaceRpt(spaceNum).BaseHeatConGainRate,
    7320             :                                     OutputProcessor::TimeStepType::Zone,
    7321             :                                     OutputProcessor::StoreType::Average,
    7322           3 :                                     state.dataHeatBal->space(spaceNum).Name);
    7323           6 :                 SetupOutputVariable(state,
    7324             :                                     "Space Baseboard Total Heating Energy",
    7325             :                                     Constant::Units::J,
    7326           3 :                                     state.dataHeatBal->spaceRpt(spaceNum).BaseHeatTotGain,
    7327             :                                     OutputProcessor::TimeStepType::Zone,
    7328             :                                     OutputProcessor::StoreType::Sum,
    7329           3 :                                     state.dataHeatBal->space(spaceNum).Name);
    7330           6 :                 SetupOutputVariable(state,
    7331             :                                     "Space Baseboard Total Heating Rate",
    7332             :                                     Constant::Units::W,
    7333           3 :                                     state.dataHeatBal->spaceRpt(spaceNum).BaseHeatTotGainRate,
    7334             :                                     OutputProcessor::TimeStepType::Zone,
    7335             :                                     OutputProcessor::StoreType::Average,
    7336           3 :                                     state.dataHeatBal->space(spaceNum).Name);
    7337             :             }
    7338             :             // Reset space output flag
    7339        5068 :             addSpaceOutputs(spaceNum) = false;
    7340             :         }
    7341         796 :     }
    7342             : 
    7343     2804678 :     void InitInternalHeatGains(EnergyPlusData &state)
    7344             :     {
    7345             : 
    7346             :         // SUBROUTINE INFORMATION:
    7347             :         //       AUTHOR         Linda K. Lawrie
    7348             :         //       DATE WRITTEN   September 1997
    7349             :         //       MODIFIED       November 1998, FW: add adjustment to elec lights for dayltg controls
    7350             :         //                      August 2003, FCW: add optional calculation of light-to-return fraction
    7351             :         //                       as a function of return plenum air temperature.
    7352             :         //       RE-ENGINEERED  na
    7353             : 
    7354             :         // PURPOSE OF THIS SUBROUTINE:
    7355             :         // This subroutine sets up the zone internal heat gains
    7356             :         // that are independent of the zone air temperature.
    7357             : 
    7358             :         // Using/Aliasing
    7359             :         using namespace ScheduleManager;
    7360             :         using Dayltg::FigureTDDZoneGains;
    7361             :         using FuelCellElectricGenerator::FigureFuelCellZoneGains;
    7362             :         using MicroCHPElectricGenerator::FigureMicroCHPZoneGains;
    7363             :         using OutputReportTabular::AllocateLoadComponentArrays;
    7364             :         using Psychrometrics::PsyRhoAirFnPbTdbW;
    7365             :         using RefrigeratedCase::FigureRefrigerationZoneGains;
    7366             :         using WaterThermalTanks::CalcWaterThermalTankZoneGains;
    7367             :         using WaterUse::CalcWaterUseZoneGains;
    7368             : 
    7369             :         // SUBROUTINE PARAMETER DEFINITIONS:
    7370             :         static constexpr std::array<Real64, 9> C = {
    7371             :             6.4611027, 0.946892, 0.0000255737, 7.139322, -0.0627909, 0.0000589271, -0.198550, 0.000940018, -0.00000149532};
    7372     2804678 :         static ZoneCatEUseData const zeroZoneCatEUse; // For initialization
    7373             : 
    7374             :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    7375             :         Real64 ActivityLevel_WperPerson; // Units on Activity Level (Schedule)
    7376             :         Real64 NumberOccupants;          // Number of occupants
    7377             :         Real64 Q;                        // , QR
    7378             :         Real64 TotalPeopleGain;          // Total heat gain from people (intermediate calculational variable)
    7379             :         Real64 SensiblePeopleGain;       // Sensible heat gain from people (intermediate calculational variable)
    7380             :         Real64 FractionConvected;        // For general lighting, fraction of heat from lights convected to zone air
    7381             :         Real64 FractionReturnAir;        // For general lighting, fraction of heat from lights convected to zone's return air
    7382             :         Real64 FractionRadiant;          // For general lighting, fraction of heat from lights to zone that is long wave
    7383             :         Real64 ReturnPlenumTemp;         // Air temperature of a zone's return air plenum (C)
    7384             :         Real64 pulseMultipler;           // use to create a pulse for the load component report computations
    7385             : 
    7386             :         //  REAL(r64), ALLOCATABLE, SAVE, DIMENSION(:) :: QSA
    7387             : 
    7388             :         //  IF (.NOT. ALLOCATED(QSA)) ALLOCATE(QSA(NumOfZones))
    7389             : 
    7390             :         //  Zero out time step variables
    7391    22720622 :         for (auto &e : state.dataHeatBal->spaceIntGain) {
    7392    19915944 :             e.NOFOCC = 0.0;
    7393    19915944 :             e.QLTSW = 0.0;
    7394     2804678 :         }
    7395             : 
    7396     2804678 :         state.dataHeatBal->ZoneIntEEuse = zeroZoneCatEUse; // Set all member arrays to zeros
    7397             : 
    7398    22672022 :         for (auto &e : state.dataHeatBal->ZoneRpt) {
    7399    19867344 :             e.CO2Rate = 0.0;
    7400     2804678 :         }
    7401             : 
    7402    22720622 :         for (auto &e : state.dataHeatBal->spaceRpt) {
    7403             :             // People
    7404    19915944 :             e.PeopleRadGain = 0.0;
    7405    19915944 :             e.PeopleConGain = 0.0;
    7406    19915944 :             e.PeopleSenGain = 0.0;
    7407    19915944 :             e.PeopleNumOcc = 0.0;
    7408    19915944 :             e.PeopleLatGain = 0.0;
    7409    19915944 :             e.PeopleTotGain = 0.0;
    7410    19915944 :             e.PeopleRadGainRate = 0.0;
    7411    19915944 :             e.PeopleConGainRate = 0.0;
    7412    19915944 :             e.PeopleSenGainRate = 0.0;
    7413    19915944 :             e.PeopleLatGainRate = 0.0;
    7414    19915944 :             e.PeopleTotGainRate = 0.0;
    7415             :             // Lights
    7416    19915944 :             e.LtsPower = 0.0;
    7417    19915944 :             e.LtsElecConsump = 0.0;
    7418    19915944 :             e.LtsRadGain = 0.0;
    7419    19915944 :             e.LtsVisGain = 0.0;
    7420    19915944 :             e.LtsConGain = 0.0;
    7421    19915944 :             e.LtsRetAirGain = 0.0;
    7422    19915944 :             e.LtsTotGain = 0.0;
    7423    19915944 :             e.LtsRadGainRate = 0.0;
    7424    19915944 :             e.LtsVisGainRate = 0.0;
    7425    19915944 :             e.LtsConGainRate = 0.0;
    7426    19915944 :             e.LtsRetAirGainRate = 0.0;
    7427    19915944 :             e.LtsTotGainRate = 0.0;
    7428             :             // Baseboard Heat
    7429    19915944 :             e.BaseHeatPower = 0.0;
    7430    19915944 :             e.BaseHeatElecCons = 0.0;
    7431    19915944 :             e.BaseHeatRadGain = 0.0;
    7432    19915944 :             e.BaseHeatConGain = 0.0;
    7433    19915944 :             e.BaseHeatTotGain = 0.0;
    7434    19915944 :             e.BaseHeatRadGainRate = 0.0;
    7435    19915944 :             e.BaseHeatConGainRate = 0.0;
    7436    19915944 :             e.BaseHeatTotGainRate = 0.0;
    7437             :             // Electric Equipment
    7438    19915944 :             e.ElecPower = 0.0;
    7439    19915944 :             e.ElecConsump = 0.0;
    7440    19915944 :             e.ElecRadGain = 0.0;
    7441    19915944 :             e.ElecConGain = 0.0;
    7442    19915944 :             e.ElecLatGain = 0.0;
    7443    19915944 :             e.ElecLost = 0.0;
    7444    19915944 :             e.ElecTotGain = 0.0;
    7445    19915944 :             e.ElecRadGainRate = 0.0;
    7446    19915944 :             e.ElecConGainRate = 0.0;
    7447    19915944 :             e.ElecLatGainRate = 0.0;
    7448    19915944 :             e.ElecLostRate = 0.0;
    7449    19915944 :             e.ElecTotGainRate = 0.0;
    7450             :             // Gas Equipment
    7451    19915944 :             e.GasPower = 0.0;
    7452    19915944 :             e.GasConsump = 0.0;
    7453    19915944 :             e.GasRadGain = 0.0;
    7454    19915944 :             e.GasConGain = 0.0;
    7455    19915944 :             e.GasLatGain = 0.0;
    7456    19915944 :             e.GasLost = 0.0;
    7457    19915944 :             e.GasTotGain = 0.0;
    7458    19915944 :             e.GasRadGainRate = 0.0;
    7459    19915944 :             e.GasConGainRate = 0.0;
    7460    19915944 :             e.GasLatGainRate = 0.0;
    7461    19915944 :             e.GasLostRate = 0.0;
    7462    19915944 :             e.GasTotGainRate = 0.0;
    7463             :             // Hot Water Equipment
    7464    19915944 :             e.HWPower = 0.0;
    7465    19915944 :             e.HWConsump = 0.0;
    7466    19915944 :             e.HWRadGain = 0.0;
    7467    19915944 :             e.HWConGain = 0.0;
    7468    19915944 :             e.HWLatGain = 0.0;
    7469    19915944 :             e.HWLost = 0.0;
    7470    19915944 :             e.HWTotGain = 0.0;
    7471    19915944 :             e.HWRadGainRate = 0.0;
    7472    19915944 :             e.HWConGainRate = 0.0;
    7473    19915944 :             e.HWLatGainRate = 0.0;
    7474    19915944 :             e.HWLostRate = 0.0;
    7475    19915944 :             e.HWTotGainRate = 0.0;
    7476             :             // Steam Equipment
    7477    19915944 :             e.SteamPower = 0.0;
    7478    19915944 :             e.SteamConsump = 0.0;
    7479    19915944 :             e.SteamRadGain = 0.0;
    7480    19915944 :             e.SteamConGain = 0.0;
    7481    19915944 :             e.SteamLatGain = 0.0;
    7482    19915944 :             e.SteamLost = 0.0;
    7483    19915944 :             e.SteamTotGain = 0.0;
    7484    19915944 :             e.SteamRadGainRate = 0.0;
    7485    19915944 :             e.SteamConGainRate = 0.0;
    7486    19915944 :             e.SteamLatGainRate = 0.0;
    7487    19915944 :             e.SteamLostRate = 0.0;
    7488    19915944 :             e.SteamTotGainRate = 0.0;
    7489             :             // Other Equipment
    7490    19915944 :             e.OtherRadGain = 0.0;
    7491    19915944 :             e.OtherConGain = 0.0;
    7492    19915944 :             e.OtherLatGain = 0.0;
    7493    19915944 :             e.OtherLost = 0.0;
    7494    19915944 :             e.OtherTotGain = 0.0;
    7495    19915944 :             e.OtherRadGainRate = 0.0;
    7496    19915944 :             e.OtherConGainRate = 0.0;
    7497    19915944 :             e.OtherLatGainRate = 0.0;
    7498    19915944 :             e.OtherLostRate = 0.0;
    7499    19915944 :             e.OtherTotGainRate = 0.0;
    7500             :             // Overall Zone Variables
    7501    19915944 :             e.TotRadiantGain = 0.0;
    7502    19915944 :             e.TotVisHeatGain = 0.0;
    7503    19915944 :             e.TotConvectiveGain = 0.0;
    7504    19915944 :             e.TotLatentGain = 0.0;
    7505    19915944 :             e.TotTotalHeatGain = 0.0;
    7506    19915944 :             e.TotRadiantGainRate = 0.0;
    7507    19915944 :             e.TotVisHeatGainRate = 0.0;
    7508    19915944 :             e.TotConvectiveGainRate = 0.0;
    7509    19915944 :             e.TotLatentGainRate = 0.0;
    7510    19915944 :             e.TotTotalHeatGainRate = 0.0;
    7511             :             // Contaminant
    7512    19915944 :             e.CO2Rate = 0.0;
    7513    19915944 :             e.GCRate = 0.0;
    7514   318655104 :             for (int i = 0; i < (int)Constant::eFuel::Num; ++i) {
    7515   298739160 :                 e.OtherPower[i] = 0.0;
    7516   298739160 :                 e.OtherConsump[i] = 0.0;
    7517             :             }
    7518     2804678 :         }
    7519             : 
    7520    22672022 :         for (auto &e : state.dataHeatBal->ZonePreDefRep) {
    7521    19867344 :             e.NumOcc = 0.0;
    7522     2804678 :         }
    7523             : 
    7524             :         //  QSA = 0.0
    7525             : 
    7526             :         // Process Internal Heat Gains, People done below
    7527             :         // Occupant Stuff
    7528             :         //   METHOD:
    7529             :         //       The function is based on a curve fit to data presented in
    7530             :         //       Table 48 'Heat Gain From People' of Chapter 1 of the 'Carrier
    7531             :         //       Handbook of Air Conditioning System Design', 1965.  Values of
    7532             :         //       Sensible gain were obtained from the table at average adjusted
    7533             :         //       metabolic rates 350, 400, 450, 500, 750, 850, 1000, and
    7534             :         //       1450 Btu/hr each at temperatures 82, 80, 78, 75, and 70F.
    7535             :         //       Sensible gains of 0.0 at 96F and equal to the metabolic rate
    7536             :         //       at 30F were assumed in order to give reasonable values beyond
    7537             :         //       The reported temperature range.
    7538    19333575 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) {
    7539    16528897 :             auto &thisPeople = state.dataHeatBal->People(Loop);
    7540    16528897 :             int NZ = state.dataHeatBal->People(Loop).ZonePtr;
    7541    16528897 :             int spaceNum = thisPeople.spaceIndex;
    7542    16528897 :             auto &thisSpaceHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum);
    7543    16528897 :             NumberOccupants = thisPeople.NumberOfPeople * GetCurrentScheduleValue(state, thisPeople.NumberOfPeoplePtr);
    7544    16528897 :             if (thisPeople.EMSPeopleOn) NumberOccupants = thisPeople.EMSNumberOfPeople;
    7545             : 
    7546    16528897 :             TotalPeopleGain = 0.0;
    7547    16528897 :             SensiblePeopleGain = 0.0;
    7548             : 
    7549    16528897 :             auto &thisZoneRep = state.dataHeatBal->ZonePreDefRep(NZ);
    7550    16528897 :             if (NumberOccupants > 0.0) {
    7551     7381825 :                 ActivityLevel_WperPerson = GetCurrentScheduleValue(state, thisPeople.ActivityLevelPtr);
    7552     7381825 :                 TotalPeopleGain = NumberOccupants * ActivityLevel_WperPerson;
    7553             :                 // if the user did not specify a sensible fraction, calculate the sensible heat gain
    7554     7381825 :                 if (thisPeople.UserSpecSensFrac == Constant::AutoCalculate) {
    7555     7227290 :                     Real64 airTemp = thisSpaceHB.MAT;
    7556     7227290 :                     if (state.dataRoomAir->anyNonMixingRoomAirModel) {
    7557       39066 :                         if (state.dataRoomAir->IsZoneDispVent3Node(NZ) || state.dataRoomAir->IsZoneUFAD(NZ)) {
    7558       15024 :                             airTemp = state.dataRoomAir->TCMF(NZ);
    7559             :                         }
    7560             :                     }
    7561     7227290 :                     SensiblePeopleGain =
    7562     7227290 :                         NumberOccupants * (C[0] + ActivityLevel_WperPerson * (C[1] + ActivityLevel_WperPerson * C[2]) +
    7563     7227290 :                                            airTemp * ((C[3] + ActivityLevel_WperPerson * (C[4] + ActivityLevel_WperPerson * C[5])) +
    7564     7227290 :                                                       airTemp * (C[6] + ActivityLevel_WperPerson * (C[7] + ActivityLevel_WperPerson * C[8]))));
    7565             :                 } else { // if the user did specify a sensible fraction, use it
    7566      154535 :                     SensiblePeopleGain = TotalPeopleGain * thisPeople.UserSpecSensFrac;
    7567             :                 }
    7568             : 
    7569     7381825 :                 if (SensiblePeopleGain > TotalPeopleGain) SensiblePeopleGain = TotalPeopleGain;
    7570     7381825 :                 if (SensiblePeopleGain < 0.0) SensiblePeopleGain = 0.0;
    7571             : 
    7572             :                 // For predefined tabular reports related to outside air ventilation
    7573     7381825 :                 thisZoneRep.isOccupied = true; // set flag to occupied to be used in tabular reporting for ventilation
    7574     7381825 :                 thisZoneRep.NumOcc += NumberOccupants;
    7575     7381825 :                 thisZoneRep.NumOccAccum += NumberOccupants * state.dataGlobal->TimeStepZone;
    7576     7381825 :                 thisZoneRep.NumOccAccumTime += state.dataGlobal->TimeStepZone;
    7577             :             } else {
    7578     9147072 :                 state.dataHeatBal->ZonePreDefRep(NZ).isOccupied = false; // set flag to occupied to be used in tabular reporting for ventilation
    7579             :             }
    7580             : 
    7581    16528897 :             thisPeople.NumOcc = NumberOccupants;
    7582    16528897 :             thisPeople.RadGainRate = SensiblePeopleGain * thisPeople.FractionRadiant;
    7583    16528897 :             thisPeople.ConGainRate = SensiblePeopleGain * thisPeople.FractionConvected;
    7584    16528897 :             thisPeople.SenGainRate = SensiblePeopleGain;
    7585    16528897 :             thisPeople.LatGainRate = TotalPeopleGain - SensiblePeopleGain;
    7586    16528897 :             thisPeople.TotGainRate = TotalPeopleGain;
    7587    16528897 :             thisPeople.CO2GainRate = TotalPeopleGain * thisPeople.CO2RateFactor;
    7588             : 
    7589    16528897 :             auto &thisSpaceIntGain = state.dataHeatBal->spaceIntGain(spaceNum);
    7590    16528897 :             thisSpaceIntGain.NOFOCC += thisPeople.NumOcc;
    7591    16528897 :             auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(spaceNum);
    7592    16528897 :             thisSpaceRpt.PeopleRadGainRate += thisPeople.RadGainRate;
    7593    16528897 :             thisSpaceRpt.PeopleConGainRate += thisPeople.ConGainRate;
    7594    16528897 :             thisSpaceRpt.PeopleSenGainRate += thisPeople.SenGainRate;
    7595    16528897 :             thisSpaceRpt.PeopleLatGainRate += thisPeople.LatGainRate;
    7596    16528897 :             thisSpaceRpt.PeopleTotGainRate += thisPeople.TotGainRate;
    7597             :         }
    7598             : 
    7599    20282415 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
    7600    17477737 :             auto &thisLights = state.dataHeatBal->Lights(Loop);
    7601    17477737 :             int NZ = thisLights.ZonePtr;
    7602    17477737 :             int spaceNum = thisLights.spaceIndex;
    7603    17477737 :             Q = thisLights.DesignLevel * GetCurrentScheduleValue(state, thisLights.SchedPtr);
    7604             : 
    7605    17477737 :             if (state.dataDayltg->ZoneDaylight(NZ).totRefPts > 0) {
    7606     1466181 :                 if (thisLights.FractionReplaceable > 0.0) { // FractionReplaceable can only be 0 or 1 for these models
    7607     1456728 :                     Q *= state.dataDayltg->spacePowerReductionFactor(spaceNum);
    7608             :                 }
    7609             :             }
    7610             : 
    7611             :             // Reduce lighting power due to demand limiting
    7612    17477737 :             if (thisLights.ManageDemand && (Q > thisLights.DemandLimit)) Q = thisLights.DemandLimit;
    7613             : 
    7614             :             // Set Q to EMS override if being called for by EMs
    7615    17477737 :             if (thisLights.EMSLightsOn) Q = thisLights.EMSLightingPower;
    7616             : 
    7617    17477737 :             FractionConvected = thisLights.FractionConvected;
    7618    17477737 :             FractionReturnAir = thisLights.FractionReturnAir;
    7619    17477737 :             FractionRadiant = thisLights.FractionRadiant;
    7620    17477737 :             if (thisLights.FractionReturnAirIsCalculated && !state.dataGlobal->ZoneSizingCalc && state.dataGlobal->SimTimeSteps > 1) {
    7621             :                 // Calculate FractionReturnAir based on conditions in the zone's return air plenum, if there is one.
    7622           0 :                 if (state.dataHeatBal->Zone(NZ).IsControlled) {
    7623           0 :                     int retNum = thisLights.ZoneReturnNum;
    7624           0 :                     int ReturnZonePlenumCondNum = state.dataZoneEquip->ZoneEquipConfig(NZ).ReturnNodePlenumNum(retNum);
    7625           0 :                     if (ReturnZonePlenumCondNum > 0) {
    7626           0 :                         ReturnPlenumTemp = state.dataZonePlenum->ZoneRetPlenCond(ReturnZonePlenumCondNum).ZoneTemp;
    7627           0 :                         FractionReturnAir =
    7628           0 :                             thisLights.FractionReturnAirPlenTempCoeff1 - thisLights.FractionReturnAirPlenTempCoeff2 * ReturnPlenumTemp;
    7629           0 :                         FractionReturnAir = max(0.0, min(1.0, FractionReturnAir));
    7630           0 :                         if (FractionReturnAir >= (1.0 - thisLights.FractionShortWave)) {
    7631           0 :                             FractionReturnAir = 1.0 - thisLights.FractionShortWave;
    7632           0 :                             FractionRadiant = 0.0;
    7633           0 :                             FractionConvected = 0.0;
    7634             :                         } else {
    7635           0 :                             FractionRadiant = ((1.0 - FractionReturnAir - thisLights.FractionShortWave) /
    7636           0 :                                                (thisLights.FractionRadiant + thisLights.FractionConvected)) *
    7637           0 :                                               thisLights.FractionRadiant;
    7638           0 :                             FractionConvected = 1.0 - (FractionReturnAir + FractionRadiant + thisLights.FractionShortWave);
    7639             :                         }
    7640             :                     }
    7641             :                 }
    7642             :             }
    7643             : 
    7644    17477737 :             thisLights.Power = Q;
    7645    17477737 :             thisLights.RadGainRate = Q * FractionRadiant;
    7646    17477737 :             thisLights.VisGainRate = Q * thisLights.FractionShortWave;
    7647    17477737 :             thisLights.ConGainRate = Q * FractionConvected;
    7648    17477737 :             thisLights.RetAirGainRate = Q * FractionReturnAir;
    7649    17477737 :             thisLights.TotGainRate = Q;
    7650             : 
    7651    17477737 :             auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(spaceNum);
    7652    17477737 :             thisSpaceRpt.LtsPower += thisLights.Power;
    7653    17477737 :             thisSpaceRpt.LtsRadGainRate += thisLights.RadGainRate;
    7654    17477737 :             thisSpaceRpt.LtsVisGainRate += thisLights.VisGainRate;
    7655    17477737 :             state.dataHeatBal->spaceIntGain(spaceNum).QLTSW += thisLights.VisGainRate;
    7656    17477737 :             thisSpaceRpt.LtsConGainRate += thisLights.ConGainRate;
    7657    17477737 :             thisSpaceRpt.LtsRetAirGainRate += thisLights.RetAirGainRate;
    7658    17477737 :             thisSpaceRpt.LtsTotGainRate += thisLights.TotGainRate;
    7659             :         }
    7660             : 
    7661    20679411 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) {
    7662    17874733 :             auto &thisElecEq = state.dataHeatBal->ZoneElectric(Loop);
    7663    17874733 :             Q = thisElecEq.DesignLevel * GetCurrentScheduleValue(state, thisElecEq.SchedPtr);
    7664             : 
    7665             :             // Reduce equipment power due to demand limiting
    7666    17874733 :             if (thisElecEq.ManageDemand && (Q > thisElecEq.DemandLimit)) Q = thisElecEq.DemandLimit;
    7667             : 
    7668             :             // Set Q to EMS override if being called for by EMs
    7669    17874733 :             if (thisElecEq.EMSZoneEquipOverrideOn) Q = thisElecEq.EMSEquipPower;
    7670             : 
    7671    17874733 :             thisElecEq.Power = Q;
    7672    17874733 :             thisElecEq.RadGainRate = Q * thisElecEq.FractionRadiant;
    7673    17874733 :             thisElecEq.ConGainRate = Q * thisElecEq.FractionConvected;
    7674    17874733 :             thisElecEq.LatGainRate = Q * thisElecEq.FractionLatent;
    7675    17874733 :             thisElecEq.LostRate = Q * thisElecEq.FractionLost;
    7676    17874733 :             thisElecEq.TotGainRate = Q - thisElecEq.LostRate;
    7677             : 
    7678    17874733 :             auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisElecEq.spaceIndex);
    7679    17874733 :             thisSpaceRpt.ElecPower += thisElecEq.Power;
    7680    17874733 :             thisSpaceRpt.ElecRadGainRate += thisElecEq.RadGainRate;
    7681    17874733 :             thisSpaceRpt.ElecConGainRate += thisElecEq.ConGainRate;
    7682    17874733 :             thisSpaceRpt.ElecLatGainRate += thisElecEq.LatGainRate;
    7683    17874733 :             thisSpaceRpt.ElecLostRate += thisElecEq.LostRate;
    7684             :         }
    7685             : 
    7686     3130181 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) {
    7687      325503 :             auto &thisGasEq = state.dataHeatBal->ZoneGas(Loop);
    7688      325503 :             Q = thisGasEq.DesignLevel * GetCurrentScheduleValue(state, thisGasEq.SchedPtr);
    7689             : 
    7690             :             // Set Q to EMS override if being called for by EMs
    7691      325503 :             if (thisGasEq.EMSZoneEquipOverrideOn) Q = thisGasEq.EMSEquipPower;
    7692             : 
    7693      325503 :             thisGasEq.Power = Q;
    7694      325503 :             thisGasEq.RadGainRate = Q * thisGasEq.FractionRadiant;
    7695      325503 :             thisGasEq.ConGainRate = Q * thisGasEq.FractionConvected;
    7696      325503 :             thisGasEq.LatGainRate = Q * thisGasEq.FractionLatent;
    7697      325503 :             thisGasEq.LostRate = Q * thisGasEq.FractionLost;
    7698      325503 :             thisGasEq.TotGainRate = Q - thisGasEq.LostRate;
    7699      325503 :             thisGasEq.CO2GainRate = Q * thisGasEq.CO2RateFactor;
    7700             : 
    7701      325503 :             auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisGasEq.spaceIndex);
    7702      325503 :             thisSpaceRpt.GasPower += thisGasEq.Power;
    7703      325503 :             thisSpaceRpt.GasRadGainRate += thisGasEq.RadGainRate;
    7704      325503 :             thisSpaceRpt.GasConGainRate += thisGasEq.ConGainRate;
    7705      325503 :             thisSpaceRpt.GasLatGainRate += thisGasEq.LatGainRate;
    7706      325503 :             thisSpaceRpt.GasLostRate += thisGasEq.LostRate;
    7707             :         }
    7708             : 
    7709     3255899 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) {
    7710      451221 :             auto &thisOtherEq = state.dataHeatBal->ZoneOtherEq(Loop);
    7711      451221 :             Q = thisOtherEq.DesignLevel * GetCurrentScheduleValue(state, thisOtherEq.SchedPtr);
    7712             : 
    7713             :             // Set Q to EMS override if being called for by EMs
    7714      451221 :             if (thisOtherEq.EMSZoneEquipOverrideOn) Q = thisOtherEq.EMSEquipPower;
    7715             : 
    7716      451221 :             thisOtherEq.Power = Q;
    7717      451221 :             thisOtherEq.RadGainRate = Q * thisOtherEq.FractionRadiant;
    7718      451221 :             thisOtherEq.ConGainRate = Q * thisOtherEq.FractionConvected;
    7719      451221 :             thisOtherEq.LatGainRate = Q * thisOtherEq.FractionLatent;
    7720      451221 :             thisOtherEq.LostRate = Q * thisOtherEq.FractionLost;
    7721      451221 :             thisOtherEq.TotGainRate = Q - thisOtherEq.LostRate;
    7722             : 
    7723      451221 :             int fuelType = (int)thisOtherEq.OtherEquipFuelType;
    7724      451221 :             auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisOtherEq.spaceIndex);
    7725      451221 :             thisSpaceRpt.OtherPower[fuelType] += thisOtherEq.Power;
    7726      451221 :             thisSpaceRpt.OtherTotGainRate += thisOtherEq.TotGainRate;
    7727      451221 :             thisSpaceRpt.OtherRadGainRate += thisOtherEq.RadGainRate;
    7728      451221 :             thisSpaceRpt.OtherConGainRate += thisOtherEq.ConGainRate;
    7729      451221 :             thisSpaceRpt.OtherLatGainRate += thisOtherEq.LatGainRate;
    7730      451221 :             thisSpaceRpt.OtherLostRate += thisOtherEq.LostRate;
    7731             :         }
    7732             : 
    7733     2890958 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) {
    7734       86280 :             auto &thisHWEq = state.dataHeatBal->ZoneHWEq(Loop);
    7735       86280 :             Q = thisHWEq.DesignLevel * GetCurrentScheduleValue(state, thisHWEq.SchedPtr);
    7736             : 
    7737             :             // Set Q to EMS override if being called for by EMs
    7738       86280 :             if (thisHWEq.EMSZoneEquipOverrideOn) Q = thisHWEq.EMSEquipPower;
    7739             : 
    7740       86280 :             thisHWEq.Power = Q;
    7741       86280 :             thisHWEq.RadGainRate = Q * thisHWEq.FractionRadiant;
    7742       86280 :             thisHWEq.ConGainRate = Q * thisHWEq.FractionConvected;
    7743       86280 :             thisHWEq.LatGainRate = Q * thisHWEq.FractionLatent;
    7744       86280 :             thisHWEq.LostRate = Q * thisHWEq.FractionLost;
    7745       86280 :             thisHWEq.TotGainRate = Q - thisHWEq.LostRate;
    7746             : 
    7747       86280 :             auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisHWEq.spaceIndex);
    7748       86280 :             thisSpaceRpt.HWPower += thisHWEq.Power;
    7749       86280 :             thisSpaceRpt.HWRadGainRate += thisHWEq.RadGainRate;
    7750       86280 :             thisSpaceRpt.HWConGainRate += thisHWEq.ConGainRate;
    7751       86280 :             thisSpaceRpt.HWLatGainRate += thisHWEq.LatGainRate;
    7752       86280 :             thisSpaceRpt.HWLostRate += thisHWEq.LostRate;
    7753             :         }
    7754             : 
    7755     2818193 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) {
    7756       13515 :             auto &thisSteamEq = state.dataHeatBal->ZoneSteamEq(Loop);
    7757       13515 :             Q = thisSteamEq.DesignLevel * GetCurrentScheduleValue(state, thisSteamEq.SchedPtr);
    7758             : 
    7759             :             // Set Q to EMS override if being called for by EMs
    7760       13515 :             if (thisSteamEq.EMSZoneEquipOverrideOn) Q = thisSteamEq.EMSEquipPower;
    7761             : 
    7762       13515 :             thisSteamEq.Power = Q;
    7763       13515 :             thisSteamEq.RadGainRate = Q * thisSteamEq.FractionRadiant;
    7764       13515 :             thisSteamEq.ConGainRate = Q * thisSteamEq.FractionConvected;
    7765       13515 :             thisSteamEq.LatGainRate = Q * thisSteamEq.FractionLatent;
    7766       13515 :             thisSteamEq.LostRate = Q * thisSteamEq.FractionLost;
    7767       13515 :             thisSteamEq.TotGainRate = Q - thisSteamEq.LostRate;
    7768             : 
    7769       13515 :             auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisSteamEq.spaceIndex);
    7770       13515 :             thisSpaceRpt.SteamPower += thisSteamEq.Power;
    7771       13515 :             thisSpaceRpt.SteamRadGainRate += thisSteamEq.RadGainRate;
    7772       13515 :             thisSpaceRpt.SteamConGainRate += thisSteamEq.ConGainRate;
    7773       13515 :             thisSpaceRpt.SteamLatGainRate += thisSteamEq.LatGainRate;
    7774       13515 :             thisSpaceRpt.SteamLostRate += thisSteamEq.LostRate;
    7775             :         }
    7776             : 
    7777     2812787 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) {
    7778        8109 :             auto &thisBBHeat = state.dataHeatBal->ZoneBBHeat(Loop);
    7779        8109 :             int NZ = thisBBHeat.ZonePtr;
    7780        8109 :             if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp >= thisBBHeat.HighTemperature) {
    7781        4059 :                 Q = 0.0;
    7782        4050 :             } else if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp > thisBBHeat.LowTemperature) {
    7783        1350 :                 Q = (state.dataHeatBal->Zone(NZ).OutDryBulbTemp - thisBBHeat.LowTemperature) *
    7784        1350 :                         (thisBBHeat.CapatHighTemperature - thisBBHeat.CapatLowTemperature) /
    7785        1350 :                         (thisBBHeat.HighTemperature - thisBBHeat.LowTemperature) +
    7786        1350 :                     thisBBHeat.CapatLowTemperature;
    7787             :             } else {
    7788        2700 :                 Q = thisBBHeat.CapatLowTemperature;
    7789             :             }
    7790        8109 :             Q *= GetCurrentScheduleValue(state, thisBBHeat.SchedPtr);
    7791             : 
    7792             :             // set with EMS value if being called for.
    7793        8109 :             if (thisBBHeat.EMSZoneBaseboardOverrideOn) Q = thisBBHeat.EMSZoneBaseboardPower;
    7794             : 
    7795        8109 :             thisBBHeat.Power = Q;
    7796        8109 :             thisBBHeat.RadGainRate = Q * thisBBHeat.FractionRadiant;
    7797        8109 :             thisBBHeat.ConGainRate = Q * thisBBHeat.FractionConvected;
    7798        8109 :             thisBBHeat.TotGainRate = Q;
    7799             : 
    7800        8109 :             auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisBBHeat.spaceIndex);
    7801        8109 :             thisSpaceRpt.BaseHeatPower += thisBBHeat.Power;
    7802        8109 :             thisSpaceRpt.BaseHeatRadGainRate += thisBBHeat.RadGainRate;
    7803        8109 :             thisSpaceRpt.BaseHeatConGainRate += thisBBHeat.ConGainRate;
    7804             :         }
    7805             : 
    7806     2814947 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) {
    7807       10269 :             int NZ = state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr;
    7808       10269 :             state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate =
    7809       10269 :                 state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate * GetCurrentScheduleValue(state, state.dataHeatBal->ZoneCO2Gen(Loop).SchedPtr);
    7810       10269 :             state.dataHeatBal->ZoneRpt(NZ).CO2Rate += state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate;
    7811             :         }
    7812             : 
    7813     2804678 :         if (state.dataHeatBal->TotITEquip > 0) CalcZoneITEq(state);
    7814             : 
    7815     2804678 :         CalcWaterThermalTankZoneGains(state);
    7816     2804678 :         PipeHeatTransfer::PipeHTData::CalcZonePipesHeatGain(state);
    7817     2804678 :         CalcWaterUseZoneGains(state);
    7818     2804678 :         FigureFuelCellZoneGains(state);
    7819     2804678 :         FigureMicroCHPZoneGains(state);
    7820     2804678 :         initializeElectricPowerServiceZoneGains(state);
    7821     2804678 :         FigureTDDZoneGains(state);
    7822     2804678 :         FigureRefrigerationZoneGains(state);
    7823             : 
    7824             :         // store pointer values to hold generic internal gain values constant for entire timestep
    7825     2804678 :         UpdateInternalGainValues(state);
    7826             : 
    7827    22672022 :         for (int NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) {
    7828    19867344 :             InternalHeatGains::SumAllInternalLatentGains(state, NZ); // Sets zone and space latent gains
    7829             :             // Added for hybrid model
    7830    19867344 :             if (state.dataHybridModel->FlagHybridModel_PC) {
    7831        8096 :                 InternalHeatGains::SumAllInternalLatentGainsExceptPeople(state, NZ); // Also sets space gains
    7832             :             }
    7833             :         }
    7834             : 
    7835             :         // QL is per radiant enclosure (one or more spaces if grouped by air boundaries)
    7836    22667978 :         for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfRadiantEnclosures; ++enclosureNum) {
    7837    19863300 :             auto &thisEnclosure(state.dataViewFactor->EnclRadInfo(enclosureNum));
    7838    19863300 :             thisEnclosure.radQThermalRad = 0.0;
    7839    39779244 :             for (int const spaceNum : thisEnclosure.spaceNums) {
    7840    19915944 :                 Real64 spaceQL = SumAllSpaceInternalRadiationGains(state, spaceNum);
    7841    19915944 :                 thisEnclosure.radQThermalRad += spaceQL;
    7842    19863300 :             }
    7843             :         }
    7844             : 
    7845     2804678 :         pulseMultipler = 0.01; // the W/sqft pulse for the zone
    7846     2804678 :         if (state.dataGlobal->CompLoadReportIsReq) {
    7847      178743 :             AllocateLoadComponentArrays(state);
    7848             :         }
    7849    22672022 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { // Loop through all surfaces...
    7850    39783288 :             for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) {
    7851    19915944 :                 auto &thisSpace = state.dataHeatBal->space(spaceNum);
    7852    19915944 :                 int const firstSurf = thisSpace.HTSurfaceFirst;
    7853    19915944 :                 int const lastSurf = thisSpace.HTSurfaceLast;
    7854    19915944 :                 if (firstSurf <= 0) continue;
    7855   191536810 :                 for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) {
    7856   171620866 :                     auto &thisEnclosure = state.dataViewFactor->EnclRadInfo(state.dataSurface->Surface(SurfNum).RadEnclIndex);
    7857             : 
    7858   171620866 :                     if (!state.dataGlobal->doLoadComponentPulseNow) {
    7859   171617338 :                         state.dataHeatBal->SurfQdotRadIntGainsInPerArea(SurfNum) =
    7860   171617338 :                             thisEnclosure.radQThermalRad * thisEnclosure.radThermAbsMult * state.dataHeatBalSurf->SurfAbsThermalInt(SurfNum);
    7861             :                     } else {
    7862        3528 :                         state.dataInternalHeatGains->curQL = thisEnclosure.radQThermalRad;
    7863             :                         // for the loads component report during the special sizing run increase the radiant portion
    7864             :                         // a small amount to create a "pulse" of heat that is used for the delayed loads
    7865        3528 :                         state.dataInternalHeatGains->adjQL = state.dataInternalHeatGains->curQL + thisEnclosure.FloorArea * pulseMultipler;
    7866             :                         // ITABSF is the Inside Thermal Absorptance
    7867             :                         // EnclRadThermAbsMult is a multiplier for each zone
    7868             :                         // SurfQdotRadIntGainsInPerArea is the thermal radiation absorbed on inside surfaces
    7869        3528 :                         state.dataHeatBal->SurfQdotRadIntGainsInPerArea(SurfNum) =
    7870        3528 :                             state.dataInternalHeatGains->adjQL * thisEnclosure.radThermAbsMult * state.dataHeatBalSurf->SurfAbsThermalInt(SurfNum);
    7871             :                         // store the magnitude and time of the pulse
    7872        3528 :                         state.dataOutRptTab->radiantPulseTimestep(state.dataSize->CurOverallSimDay, zoneNum) =
    7873        3528 :                             (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep;
    7874        3528 :                         state.dataOutRptTab->radiantPulseReceived(state.dataSize->CurOverallSimDay, SurfNum) =
    7875        3528 :                             (state.dataInternalHeatGains->adjQL - state.dataInternalHeatGains->curQL) * thisEnclosure.radThermAbsMult *
    7876        3528 :                             state.dataHeatBalSurf->SurfAbsThermalInt(SurfNum) * state.dataSurface->Surface(SurfNum).Area;
    7877             :                     }
    7878             :                 }
    7879    19867344 :             }
    7880             :         }
    7881     2804678 :     }
    7882             : 
    7883     2804678 :     void CheckReturnAirHeatGain(EnergyPlusData &state)
    7884             :     {
    7885             :         // SUBROUTINE INFORMATION:
    7886             :         //       AUTHOR         Xuan Luo
    7887             :         //       DATE WRITTEN   Jan 2018
    7888             : 
    7889             :         // PURPOSE OF THIS SUBROUTINE:
    7890             :         // This subroutine currently creates the values for standard "zone loads" reporting
    7891             :         // from the heat balance module.
    7892             : 
    7893             :         // Using/Aliasing
    7894             : 
    7895    22672022 :         for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
    7896    19867344 :             if (state.dataHeatBal->Zone(ZoneNum).HasAdjustedReturnTempByITE && state.dataHeatBal->Zone(ZoneNum).HasLtsRetAirGain) {
    7897           0 :                 ShowFatalError(state,
    7898             :                                "Return air heat gains from lights are not allowed when Air Flow Calculation Method = "
    7899             :                                "FlowControlWithApproachTemperatures in zones with ITE objects.");
    7900             :             }
    7901    19867344 :             if (state.dataHeatBal->Zone(ZoneNum).HasAdjustedReturnTempByITE && state.dataHeatBal->Zone(ZoneNum).HasAirFlowWindowReturn) {
    7902           0 :                 ShowFatalError(state,
    7903             :                                "Return air heat gains from windows are not allowed when Air Flow Calculation Method = "
    7904             :                                "FlowControlWithApproachTemperatures in zones with ITE objects.");
    7905             :             }
    7906             :         }
    7907     2804678 :     }
    7908             : 
    7909       11508 :     void CalcZoneITEq(EnergyPlusData &state)
    7910             :     {
    7911             : 
    7912             :         // SUBROUTINE INFORMATION:
    7913             :         //       AUTHOR         M.J. Witte
    7914             :         //       DATE WRITTEN   October 2014
    7915             : 
    7916             :         // PURPOSE OF THIS SUBROUTINE:
    7917             :         // This subroutine calculates the gains and other results for ElectricEquipment:ITE:AirCooled.
    7918             :         // This broken into a separate subroutine, because the calculations are more detailed than the other
    7919             :         // types of internal gains.
    7920             : 
    7921             :         using ScheduleManager::GetCurrentScheduleValue;
    7922             :         using namespace Psychrometrics;
    7923             :         using Curve::CurveValue;
    7924             :         using HVAC::SmallAirVolFlow;
    7925             :         using HVAC::SmallTempDiff;
    7926             : 
    7927             :         // Operating Limits for environmental class: None, A1, A2, A3, A4, B, C, H1
    7928             :         // From ASHRAE 2021 Thermal Guidelines environmental classes for Air-Cooled ITE
    7929             :         static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> DBMin = {
    7930             :             -99.0, 15.0, 10.0, 5.0, 5.0, 5.0, 5.0, 5.0}; // Minimum dry-bulb temperature [C]
    7931             :         static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> DBMax = {
    7932             :             99.0, 32.0, 35.0, 40.0, 45.0, 35.0, 40.0, 25.0}; // Maximum dry-bulb temperature [C]
    7933             :         static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> DPMin = {
    7934             :             -99.0, -12.0, -12.0, -12.0, -12.0, -99.0, -99.0, -12.0}; // Minimum dewpoint temperature [C]
    7935             :         static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> DPMax = {
    7936             :             99.0, 17.0, 21.0, 24.0, 24.0, 28.0, 28.0, 17.0}; // Maximum dewpoint temperature [C]
    7937             :         static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> RHMin = {
    7938             :             0.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0}; // Minimum relative humidity [%]
    7939             :         static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> RHMax = {
    7940             :             99.0, 80.0, 80.0, 85.0, 90.0, 80.0, 80.0, 80.0}; // Maximum relative humidity [%]
    7941             : 
    7942             :         static constexpr std::string_view RoutineName("CalcZoneITEq");
    7943             :         int Loop;
    7944             :         int NZ;
    7945             :         int SupplyNodeNum;                // Supply air node number (if zero, then not specified)
    7946             :         Real64 OperSchedFrac;             // Operating schedule fraction
    7947             :         Real64 CPULoadSchedFrac;          // CPU loading schedule fraction
    7948             :         ITEInletConnection AirConnection; // Air connection type
    7949       11508 :         Real64 TSupply(0.0);              // Supply air temperature [C]
    7950             :         Real64 WSupply;                   // Supply air humidity ratio [kgWater/kgDryAir]
    7951             :         Real64 RecircFrac;                // Recirculation fraction - current
    7952             :         Real64 TRecirc;                   // Recirculation air temperature [C]
    7953             :         Real64 WRecirc;                   // Recirculation air humidity ratio [kgWater/kgDryAir]
    7954             :         Real64 TAirIn;                    // Entering air dry-bulb temperature [C]
    7955             :         Real64 TAirInDesign;              // Design entering air dry-bulb temperature [C]
    7956             :         Real64 WAirIn;                    // Entering air humidity ratio [kgWater/kgDryAir]
    7957             :         Real64 TDPAirIn;                  // Entering air dewpoint temperature [C]
    7958             :         Real64 RHAirIn;                   // Entering air relative humidity [%]
    7959             :         Real64 SupplyHeatIndex;           // Supply heat index
    7960             :         Real64 TAirOut;                   // Leaving air temperature [C]
    7961             :         Real64 AirVolFlowFrac;            // Air volume flow fraction
    7962             :         Real64 AirVolFlowFracDesignT;     // Air volume flow fraction at design entering air temperature
    7963             :         Real64 AirVolFlowRate;            // Air volume flow rate at current density [m3/s]
    7964             :         Real64 AirMassFlowRate;           // Air mass flow rate [kg/s]
    7965             :         Real64 CPUPower;                  // CPU power input [W]
    7966             :         Real64 FanPower;                  // Fan power input [W]
    7967             :         Real64 UPSPower;                  // UPS new power input (losses) [W]
    7968             :         Real64 UPSPartLoadRatio;          // UPS part load ratio (current total power input / design total power input)
    7969             :         Real64 UPSHeatGain;               // UPS convective heat gain to zone [W]
    7970             : 
    7971       11508 :         std::map<int, std::vector<int>> ZoneITEMap;
    7972             : 
    7973             :         //  Zero out time step variables
    7974             :         // Object report variables
    7975       28440 :         for (Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) {
    7976             : 
    7977      135456 :             for (int i = 0; i < (int)PERptVars::Num; ++i) {
    7978      118524 :                 state.dataHeatBal->ZoneITEq(Loop).PowerRpt[i] = 0.0;
    7979      118524 :                 state.dataHeatBal->ZoneITEq(Loop).EnergyRpt[i] = 0.0;
    7980             :             }
    7981             : 
    7982       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = 0.0;
    7983       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = 0.0;
    7984       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = 0.0;
    7985       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = 0.0;
    7986       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = 0.0;
    7987       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = 0.0;
    7988       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = 0.0;
    7989       16932 :             state.dataHeatBal->ZoneITEq(Loop).SHI = 0.0;
    7990       16932 :             state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = 0.0;
    7991       16932 :             state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = 0.0;
    7992       16932 :             state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = 0.0;
    7993       16932 :             state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = 0.0;
    7994       16932 :             state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = 0.0;
    7995       16932 :             state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = 0.0;
    7996       16932 :             state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = 0.0;
    7997       16932 :             state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = 0.0;
    7998       16932 :             state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = 0.0;
    7999       16932 :             state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = 0.0;
    8000       16932 :             state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = 0.0;
    8001       16932 :             state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = 0.0;
    8002       16932 :             state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = 0.0;
    8003             :         } // ZoneITEq init loop
    8004             : 
    8005             :         // Zone total report variables
    8006       39288 :         for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) {
    8007             : 
    8008      222240 :             for (int i = 0; i < (int)PERptVars::Num; ++i) {
    8009      194460 :                 state.dataHeatBal->ZoneRpt(Loop).PowerRpt[i] = 0.0;
    8010      194460 :                 state.dataHeatBal->ZoneRpt(Loop).EnergyRpt[i] = 0.0;
    8011             :             }
    8012             : 
    8013       27780 :             state.dataHeatBal->ZoneRpt(Loop).ITEAdjReturnTemp = 0.0;
    8014             : 
    8015       27780 :             state.dataHeatBal->ZoneRpt(Loop).ITEqAirVolFlowStdDensity = 0.0;
    8016       27780 :             state.dataHeatBal->ZoneRpt(Loop).ITEqAirMassFlow = 0.0;
    8017       27780 :             state.dataHeatBal->ZoneRpt(Loop).ITEqSHI = 0.0;
    8018       27780 :             state.dataHeatBal->ZoneRpt(Loop).ITEqTimeOutOfOperRange = 0.0;
    8019       27780 :             state.dataHeatBal->ZoneRpt(Loop).ITEqTimeAboveDryBulbT = 0.0;
    8020       27780 :             state.dataHeatBal->ZoneRpt(Loop).ITEqTimeBelowDryBulbT = 0.0;
    8021       27780 :             state.dataHeatBal->ZoneRpt(Loop).ITEqTimeAboveDewpointT = 0.0;
    8022       27780 :             state.dataHeatBal->ZoneRpt(Loop).ITEqTimeBelowDewpointT = 0.0;
    8023       27780 :             state.dataHeatBal->ZoneRpt(Loop).ITEqTimeAboveRH = 0.0;
    8024       27780 :             state.dataHeatBal->ZoneRpt(Loop).ITEqTimeBelowRH = 0.0;
    8025             : 
    8026       27780 :             state.dataHeatBal->ZoneRpt(Loop).SumTinMinusTSup = 0.0;
    8027       27780 :             state.dataHeatBal->ZoneRpt(Loop).SumToutMinusTSup = 0.0;
    8028             :         } // Zone init loop
    8029             : 
    8030             :         // Space total report variables
    8031       39288 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    8032             : 
    8033      222240 :             for (int i = 0; i < (int)PERptVars::Num; ++i) {
    8034      194460 :                 state.dataHeatBal->spaceRpt(spaceNum).PowerRpt[i] = 0.0;
    8035      194460 :                 state.dataHeatBal->spaceRpt(spaceNum).EnergyRpt[i] = 0.0;
    8036             :             }
    8037             : 
    8038       27780 :             state.dataHeatBal->spaceRpt(spaceNum).ITEAdjReturnTemp = 0.0;
    8039             : 
    8040       27780 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqAirVolFlowStdDensity = 0.0;
    8041       27780 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqAirMassFlow = 0.0;
    8042       27780 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqSHI = 0.0;
    8043       27780 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = 0.0;
    8044       27780 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDryBulbT = 0.0;
    8045       27780 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDryBulbT = 0.0;
    8046       27780 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDewpointT = 0.0;
    8047       27780 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDewpointT = 0.0;
    8048       27780 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveRH = 0.0;
    8049       27780 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowRH = 0.0;
    8050             : 
    8051       27780 :             state.dataHeatBal->spaceRpt(spaceNum).SumTinMinusTSup = 0.0;
    8052       27780 :             state.dataHeatBal->spaceRpt(spaceNum).SumToutMinusTSup = 0.0;
    8053             :         } // Space init spaceNum
    8054             : 
    8055       28440 :         for (Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) {
    8056             :             // Get schedules
    8057       16932 :             NZ = state.dataHeatBal->ZoneITEq(Loop).ZonePtr;
    8058       16932 :             auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(NZ);
    8059       16932 :             int spaceNum = state.dataHeatBal->ZoneITEq(Loop).spaceIndex;
    8060       16932 :             OperSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr);
    8061       16932 :             CPULoadSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr);
    8062             : 
    8063             :             // Determine inlet air temperature and humidity
    8064       16932 :             AirConnection = state.dataHeatBal->ZoneITEq(Loop).AirConnectionType;
    8065       16932 :             RecircFrac = 0.0;
    8066       16932 :             SupplyNodeNum = state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum;
    8067       16932 :             if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) {
    8068        9480 :                 TSupply = state.dataLoopNodes->Node(SupplyNodeNum).Temp;
    8069        9480 :                 WSupply = state.dataLoopNodes->Node(SupplyNodeNum).HumRat;
    8070        9480 :                 if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch != 0) {
    8071           0 :                     TAirIn = TSupply + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch);
    8072             :                 } else {
    8073        9480 :                     TAirIn = TSupply + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp;
    8074             :                 }
    8075        9480 :                 WAirIn = state.dataLoopNodes->Node(SupplyNodeNum).HumRat;
    8076             :             } else {
    8077        7452 :                 if (AirConnection == ITEInletConnection::AdjustedSupply) {
    8078        7452 :                     TSupply = state.dataLoopNodes->Node(SupplyNodeNum).Temp;
    8079        7452 :                     WSupply = state.dataLoopNodes->Node(SupplyNodeNum).HumRat;
    8080        7452 :                     if (state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve != 0) {
    8081        7452 :                         RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac *
    8082        7452 :                                      CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve, CPULoadSchedFrac, TSupply);
    8083             :                     } else {
    8084           0 :                         RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac;
    8085             :                     }
    8086        7452 :                     TRecirc = thisZoneHB.MAT;
    8087        7452 :                     WRecirc = thisZoneHB.airHumRat;
    8088        7452 :                     TAirIn = TRecirc * RecircFrac + TSupply * (1.0 - RecircFrac);
    8089        7452 :                     WAirIn = WRecirc * RecircFrac + WSupply * (1.0 - RecircFrac);
    8090           0 :                 } else if (AirConnection == ITEInletConnection::RoomAirModel) {
    8091             :                     // Room air model option: TAirIn=TAirZone, according to EngineeringRef 17.1.4
    8092           0 :                     TAirIn = thisZoneHB.MAT;
    8093           0 :                     TSupply = TAirIn;
    8094           0 :                     WAirIn = thisZoneHB.airHumRat;
    8095             :                 } else {
    8096             :                     // TAirIn = TRoomAirNodeIn, according to EngineeringRef 17.1.4
    8097           0 :                     if (state.dataHeatBal->ZoneITEq(Loop).inControlledZone) {
    8098           0 :                         int ZoneAirInletNode = state.dataZoneEquip->ZoneEquipConfig(NZ).InletNode(1);
    8099           0 :                         TSupply = state.dataLoopNodes->Node(ZoneAirInletNode).Temp;
    8100             :                     } else {
    8101           0 :                         TSupply = thisZoneHB.MAT;
    8102             :                     }
    8103           0 :                     TAirIn = thisZoneHB.MAT;
    8104           0 :                     WAirIn = thisZoneHB.airHumRat;
    8105             :                 }
    8106             :             }
    8107       16932 :             TDPAirIn = PsyTdpFnWPb(state, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName);
    8108       16932 :             RHAirIn = 100.0 * PsyRhFnTdbWPb(state, TAirIn, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName); // RHAirIn is %
    8109             : 
    8110             :             // Calculate power input and airflow
    8111       16932 :             TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn;
    8112             : 
    8113       16932 :             if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) {
    8114             : 
    8115        2700 :                 TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).SizingTAirIn;
    8116        2700 :                 if (state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch != 0) {
    8117           0 :                     TAirInDesign = TAirInDesign + GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTempSch);
    8118             :                 } else {
    8119        2700 :                     TAirInDesign = TAirInDesign + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp;
    8120             :                 }
    8121        2700 :                 OperSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).OperSchedPtr);
    8122        2700 :                 CPULoadSchedFrac = GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(Loop).CPULoadSchedPtr);
    8123             :             }
    8124             : 
    8125       16932 :             CPUPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac *
    8126       16932 :                                CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve, CPULoadSchedFrac, TAirIn),
    8127             :                            0.0);
    8128       16932 :             state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::CPUAtDesign] =
    8129       16932 :                 max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac *
    8130       16932 :                         CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve, CPULoadSchedFrac, TAirInDesign),
    8131             :                     0.0);
    8132             : 
    8133       16932 :             AirVolFlowFrac = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirIn), 0.0);
    8134       16932 :             AirVolFlowRate = state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate * OperSchedFrac * AirVolFlowFrac;
    8135       16932 :             if (AirVolFlowRate < SmallAirVolFlow) {
    8136          21 :                 AirVolFlowRate = 0.0;
    8137             :             }
    8138       16932 :             AirVolFlowFracDesignT = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirInDesign), 0.0);
    8139             : 
    8140       16932 :             FanPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac *
    8141       16932 :                                CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve, AirVolFlowFrac),
    8142             :                            0.0);
    8143       16932 :             state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::FanAtDesign] =
    8144       16932 :                 max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac *
    8145       16932 :                         CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve, AirVolFlowFracDesignT),
    8146             :                     0.0);
    8147             : 
    8148             :             // Calculate UPS net power input (power in less power to ITEquip) and UPS heat gain to zone
    8149       16932 :             if (state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower > 0.0) {
    8150       16932 :                 UPSPartLoadRatio = (CPUPower + FanPower) / state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower;
    8151             :             } else {
    8152           0 :                 UPSPartLoadRatio = 0.0;
    8153             :             }
    8154       16932 :             if (state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve != 0) {
    8155       16932 :                 UPSPower =
    8156       16932 :                     (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency *
    8157       16932 :                                                            CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve, UPSPartLoadRatio)),
    8158             :                                                 0.0);
    8159             :             } else {
    8160           0 :                 UPSPower = (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency), 0.0);
    8161             :             }
    8162       16932 :             UPSHeatGain = UPSPower * state.dataHeatBal->ZoneITEq(Loop).UPSLossToZoneFrac;
    8163             : 
    8164             :             // Calculate air outlet conditions and convective heat gain to zone
    8165             : 
    8166       16932 :             AirMassFlowRate = AirVolFlowRate * PsyRhoAirFnPbTdbW(state, state.dataEnvrn->StdBaroPress, TAirIn, WAirIn, RoutineName);
    8167       16932 :             if (AirMassFlowRate > 0.0) {
    8168       16911 :                 TAirOut = TAirIn + (CPUPower + FanPower) / AirMassFlowRate / PsyCpAirFnW(WAirIn);
    8169             :             } else {
    8170          21 :                 TAirOut = TAirIn;
    8171             :             }
    8172             : 
    8173       16932 :             if (std::abs(TAirOut - TSupply) < SmallTempDiff) {
    8174           0 :                 TAirOut = TSupply;
    8175             :             }
    8176             : 
    8177       16932 :             if ((SupplyNodeNum != 0) && (TAirOut != TSupply)) {
    8178       16932 :                 SupplyHeatIndex = (TAirIn - TSupply) / (TAirOut - TSupply);
    8179             :             } else {
    8180           0 :                 SupplyHeatIndex = 0.0;
    8181             :             }
    8182             : 
    8183       16932 :             if (AirConnection == ITEInletConnection::AdjustedSupply || AirConnection == ITEInletConnection::ZoneAirNode) {
    8184             :                 // If not a room air model, then all ITEquip power input is a convective heat gain to the zone heat balance, plus UPS heat gain
    8185       16932 :                 state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::ConGainToZone] = CPUPower + FanPower + UPSHeatGain;
    8186           0 :             } else if (AirConnection == ITEInletConnection::RoomAirModel) {
    8187             :                 // Room air model option not implemented yet - set room air model outlet node conditions here
    8188             :                 // If a room air model, then the only convective heat gain to the zone heat balance is the UPS heat gain
    8189           0 :                 state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::ConGainToZone] = UPSHeatGain;
    8190             :             }
    8191       16932 :             if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE) {
    8192        9480 :                 ZoneITEMap[state.dataHeatBal->ZoneITEq(Loop).ZonePtr].push_back(Loop);
    8193             :             }
    8194       16932 :             if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) {
    8195        2700 :                 if (state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::FanAtDesign] +
    8196        2700 :                         state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::CPUAtDesign] >
    8197        2700 :                     state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower) {
    8198        2700 :                     state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::ConGainToZone] =
    8199        5400 :                         state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::FanAtDesign] +
    8200        2700 :                         state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::CPUAtDesign];
    8201             :                 }
    8202             :             }
    8203             :             // Object report variables
    8204       16932 :             state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::CPU] = CPUPower;
    8205       16932 :             state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::Fan] = FanPower;
    8206       16932 :             state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::UPS] = UPSPower;
    8207             :             // ZoneITEq( Loop ).CPUPowerAtDesign = set above
    8208             :             // ZoneITEq( Loop ).FanPowerAtDesign = set above
    8209       16932 :             state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::UPSGainToZone] = UPSHeatGain; // UPSGainRateToZone = UPSHeatGain;
    8210             :             // ZoneITEq( Loop ).ConGainRateToZone = set above
    8211             : 
    8212      135456 :             for (int i = 0; i < (int)PERptVars::Num; ++i) {
    8213      118524 :                 state.dataHeatBal->ZoneRpt(NZ).PowerRpt[i] += state.dataHeatBal->ZoneITEq(Loop).PowerRpt[i];
    8214      118524 :                 state.dataHeatBal->spaceRpt(spaceNum).PowerRpt[i] += state.dataHeatBal->ZoneITEq(Loop).PowerRpt[i];
    8215      118524 :                 state.dataHeatBal->ZoneITEq(Loop).EnergyRpt[i] = state.dataHeatBal->ZoneITEq(Loop).PowerRpt[i] * state.dataGlobal->TimeStepZoneSec;
    8216      118524 :                 state.dataHeatBal->ZoneRpt(NZ).EnergyRpt[i] += state.dataHeatBal->ZoneITEq(Loop).EnergyRpt[i];
    8217      118524 :                 state.dataHeatBal->spaceRpt(spaceNum).EnergyRpt[i] += state.dataHeatBal->ZoneITEq(Loop).EnergyRpt[i];
    8218             :             }
    8219             : 
    8220       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = AirMassFlowRate / state.dataEnvrn->StdRhoAir;
    8221       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = AirVolFlowRate;
    8222       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = AirMassFlowRate;
    8223       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = TAirIn;
    8224       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = TDPAirIn;
    8225       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = RHAirIn;
    8226       16932 :             state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = TAirOut;
    8227       16932 :             state.dataHeatBal->ZoneITEq(Loop).SHI = SupplyHeatIndex;
    8228             : 
    8229       16932 :             state.dataHeatBal->ZoneRpt(NZ).ITEqAirVolFlowStdDensity += state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity;
    8230       16932 :             state.dataHeatBal->ZoneRpt(NZ).ITEqAirMassFlow += state.dataHeatBal->ZoneITEq(Loop).AirMassFlow;
    8231       16932 :             state.dataHeatBal->ZoneRpt(NZ).SumTinMinusTSup += (TAirIn - TSupply) * AirVolFlowRate;
    8232       16932 :             state.dataHeatBal->ZoneRpt(NZ).SumToutMinusTSup += (TAirOut - TSupply) * AirVolFlowRate;
    8233             : 
    8234       16932 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqAirVolFlowStdDensity += state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity;
    8235       16932 :             state.dataHeatBal->spaceRpt(spaceNum).ITEqAirMassFlow += state.dataHeatBal->ZoneITEq(Loop).AirMassFlow;
    8236       16932 :             state.dataHeatBal->spaceRpt(spaceNum).SumTinMinusTSup += (TAirIn - TSupply) * AirVolFlowRate;
    8237       16932 :             state.dataHeatBal->spaceRpt(spaceNum).SumToutMinusTSup += (TAirOut - TSupply) * AirVolFlowRate;
    8238             : 
    8239             :             // Check environmental class operating range limits (defined as parameters in this subroutine)
    8240             :             // Index for environmental class (None=0, A1=1, A2=2, A3=3, A4=4, B=5, C=6, H1=7)
    8241       16932 :             int EnvClass = static_cast<int>(state.dataHeatBal->ZoneITEq(Loop).Class);
    8242       16932 :             if (EnvClass > 0) {
    8243       16932 :                 if (TAirIn > DBMax[EnvClass]) {
    8244        2933 :                     state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = state.dataGlobal->TimeStepZone;
    8245        2933 :                     state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8246        2933 :                     state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = TAirIn - DBMax[EnvClass];
    8247        2933 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeAboveDryBulbT = state.dataGlobal->TimeStepZone;
    8248        2933 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8249        2933 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDryBulbT = state.dataGlobal->TimeStepZone;
    8250        2933 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8251             :                 }
    8252       16932 :                 if (TAirIn < DBMin[EnvClass]) {
    8253        1378 :                     state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = state.dataGlobal->TimeStepZone;
    8254        1378 :                     state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8255        1378 :                     state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = TAirIn - DBMin[EnvClass];
    8256        1378 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeBelowDryBulbT = state.dataGlobal->TimeStepZone;
    8257        1378 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8258        1378 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDryBulbT = state.dataGlobal->TimeStepZone;
    8259        1378 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8260             :                 }
    8261       16932 :                 if (TDPAirIn > DPMax[EnvClass]) {
    8262           6 :                     state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = state.dataGlobal->TimeStepZone;
    8263           6 :                     state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8264           6 :                     state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = TDPAirIn - DPMax[EnvClass];
    8265           6 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeAboveDewpointT = state.dataGlobal->TimeStepZone;
    8266           6 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8267           6 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDewpointT = state.dataGlobal->TimeStepZone;
    8268           6 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8269             :                 }
    8270       16932 :                 if (TDPAirIn < DPMin[EnvClass]) {
    8271        5219 :                     state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = state.dataGlobal->TimeStepZone;
    8272        5219 :                     state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8273        5219 :                     state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = TDPAirIn - DPMin[EnvClass];
    8274        5219 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeBelowDewpointT = state.dataGlobal->TimeStepZone;
    8275        5219 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8276        5219 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDewpointT = state.dataGlobal->TimeStepZone;
    8277        5219 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8278             :                 }
    8279       16932 :                 if (RHAirIn > RHMax[EnvClass]) {
    8280         697 :                     state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = state.dataGlobal->TimeStepZone;
    8281         697 :                     state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8282         697 :                     state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = RHAirIn - RHMax[EnvClass];
    8283         697 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeAboveRH = state.dataGlobal->TimeStepZone;
    8284         697 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8285         697 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveRH = state.dataGlobal->TimeStepZone;
    8286         697 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8287             :                 }
    8288       16932 :                 if (RHAirIn < RHMin[EnvClass]) {
    8289        5703 :                     state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = state.dataGlobal->TimeStepZone;
    8290        5703 :                     state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8291        5703 :                     state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = RHAirIn - RHMin[EnvClass];
    8292        5703 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeBelowRH = state.dataGlobal->TimeStepZone;
    8293        5703 :                     state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8294        5703 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowRH = state.dataGlobal->TimeStepZone;
    8295        5703 :                     state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
    8296             :                 }
    8297             :             }
    8298             : 
    8299             :         } // ZoneITEq calc loop
    8300             : 
    8301             :         // Zone and space-level sensible heat index
    8302       28440 :         for (Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) {
    8303       16932 :             int ZN = state.dataHeatBal->ZoneITEq(Loop).ZonePtr;
    8304       16932 :             int spaceNum = state.dataHeatBal->ZoneITEq(Loop).spaceIndex;
    8305       16932 :             if (state.dataHeatBal->ZoneRpt(ZN).SumToutMinusTSup != 0.0) {
    8306       16911 :                 state.dataHeatBal->ZoneRpt(ZN).ITEqSHI =
    8307       16911 :                     state.dataHeatBal->ZoneRpt(ZN).SumTinMinusTSup / state.dataHeatBal->ZoneRpt(ZN).SumToutMinusTSup;
    8308             :             }
    8309       16932 :             if (state.dataHeatBal->spaceRpt(spaceNum).SumToutMinusTSup != 0.0) {
    8310       16911 :                 state.dataHeatBal->spaceRpt(spaceNum).ITEqSHI =
    8311       16911 :                     state.dataHeatBal->spaceRpt(spaceNum).SumTinMinusTSup / state.dataHeatBal->spaceRpt(spaceNum).SumToutMinusTSup;
    8312             :             }
    8313             :         }
    8314             : 
    8315       11508 :         std::map<int, std::vector<int>>::iterator it = ZoneITEMap.begin();
    8316             :         Real64 totalGain;
    8317             :         Real64 totalRate;
    8318             :         Real64 TAirReturn;
    8319       20988 :         while (it != ZoneITEMap.end()) {
    8320        9480 :             if (state.dataHeatBal->Zone(it->first).HasAdjustedReturnTempByITE) {
    8321        9480 :                 totalGain = 0;
    8322        9480 :                 totalRate = 0;
    8323       18960 :                 for (int i : it->second) {
    8324        9480 :                     if (state.dataHeatBal->ZoneITEq(i).ReturnApproachTempSch != 0) {
    8325           0 :                         TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT +
    8326           0 :                                      GetCurrentScheduleValue(state, state.dataHeatBal->ZoneITEq(i).ReturnApproachTempSch);
    8327             :                     } else {
    8328        9480 :                         TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT + state.dataHeatBal->ZoneITEq(i).ReturnApproachTemp;
    8329             :                     }
    8330        9480 :                     totalRate += state.dataHeatBal->ZoneITEq(i).AirMassFlow;
    8331        9480 :                     totalGain += state.dataHeatBal->ZoneITEq(i).AirMassFlow * TAirReturn;
    8332        9480 :                 }
    8333        9480 :                 if (totalRate != 0) {
    8334        9468 :                     state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE = totalGain / totalRate;
    8335        9468 :                     state.dataHeatBal->ZoneRpt(it->first).ITEAdjReturnTemp = state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE;
    8336             :                 }
    8337             :             }
    8338        9480 :             ++it;
    8339             :         }
    8340             : 
    8341       11508 :     } // End CalcZoneITEq
    8342             : 
    8343     2804678 :     void ReportInternalHeatGains(EnergyPlusData &state)
    8344             :     {
    8345             : 
    8346             :         // SUBROUTINE INFORMATION:
    8347             :         //       AUTHOR         Richard Liesen
    8348             :         //       DATE WRITTEN   June 1997
    8349             :         //       MODIFIED       July 1997 RKS
    8350             :         //       RE-ENGINEERED  December 1998 LKL
    8351             : 
    8352             :         // PURPOSE OF THIS SUBROUTINE:
    8353             :         // This subroutine currently creates the values for standard "zone loads" reporting
    8354             :         // from the heat balance module.
    8355             : 
    8356             :         // METHODOLOGY EMPLOYED:
    8357             :         // The reporting methodology is described in the OutputDataStructure.doc
    8358             :         // as the "modified modular" format.
    8359             : 
    8360             :         // REFERENCES:
    8361             :         // OutputDataStructure.doc (EnergyPlus documentation)
    8362             : 
    8363             :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    8364             :         static constexpr std::array<DataHeatBalance::IntGainType, 8> TradIntGainTypes = {DataHeatBalance::IntGainType::People,
    8365             :                                                                                          DataHeatBalance::IntGainType::Lights,
    8366             :                                                                                          DataHeatBalance::IntGainType::ElectricEquipment,
    8367             :                                                                                          DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled,
    8368             :                                                                                          DataHeatBalance::IntGainType::GasEquipment,
    8369             :                                                                                          DataHeatBalance::IntGainType::HotWaterEquipment,
    8370             :                                                                                          DataHeatBalance::IntGainType::SteamEquipment,
    8371             :                                                                                          DataHeatBalance::IntGainType::OtherEquipment};
    8372             : 
    8373    19333575 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) {
    8374    16528897 :             auto &thisPeople = state.dataHeatBal->People(Loop);
    8375    16528897 :             thisPeople.RadGainEnergy = thisPeople.RadGainRate * state.dataGlobal->TimeStepZoneSec;
    8376    16528897 :             thisPeople.ConGainEnergy = thisPeople.ConGainRate * state.dataGlobal->TimeStepZoneSec;
    8377    16528897 :             thisPeople.SenGainEnergy = thisPeople.SenGainRate * state.dataGlobal->TimeStepZoneSec;
    8378    16528897 :             thisPeople.LatGainEnergy = thisPeople.LatGainRate * state.dataGlobal->TimeStepZoneSec;
    8379    16528897 :             thisPeople.TotGainEnergy = thisPeople.TotGainRate * state.dataGlobal->TimeStepZoneSec;
    8380             :         }
    8381             : 
    8382    20282415 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
    8383    17477737 :             auto &thisLights = state.dataHeatBal->Lights(Loop);
    8384    17477737 :             thisLights.Consumption = thisLights.Power * state.dataGlobal->TimeStepZoneSec;
    8385    17477737 :             thisLights.RadGainEnergy = thisLights.RadGainRate * state.dataGlobal->TimeStepZoneSec;
    8386    17477737 :             thisLights.VisGainEnergy = thisLights.VisGainRate * state.dataGlobal->TimeStepZoneSec;
    8387    17477737 :             thisLights.ConGainEnergy = thisLights.ConGainRate * state.dataGlobal->TimeStepZoneSec;
    8388    17477737 :             thisLights.RetAirGainEnergy = thisLights.RetAirGainRate * state.dataGlobal->TimeStepZoneSec;
    8389    17477737 :             thisLights.TotGainEnergy = thisLights.TotGainRate * state.dataGlobal->TimeStepZoneSec;
    8390    17477737 :             if (!state.dataGlobal->WarmupFlag) {
    8391     4933542 :                 if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles &&
    8392     1927474 :                     (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather)) { // for weather simulations only
    8393             :                     // for tabular report, accumulate the total electricity used for each Light object
    8394      736301 :                     thisLights.SumConsumption += thisLights.Consumption;
    8395             :                     // for tabular report, accumulate the time when each Light has consumption (using a very small threshold instead of zero)
    8396      736301 :                     if (thisLights.Power > 0.01 * thisLights.DesignLevel) {
    8397      736301 :                         thisLights.SumTimeNotZeroCons += state.dataGlobal->TimeStepZone;
    8398             :                     }
    8399             :                 }
    8400             :             }
    8401             :         }
    8402             : 
    8403    20679411 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) {
    8404    17874733 :             auto &thisElecEquip = state.dataHeatBal->ZoneElectric(Loop);
    8405    17874733 :             thisElecEquip.Consumption = thisElecEquip.Power * state.dataGlobal->TimeStepZoneSec;
    8406    17874733 :             thisElecEquip.RadGainEnergy = thisElecEquip.RadGainRate * state.dataGlobal->TimeStepZoneSec;
    8407    17874733 :             thisElecEquip.ConGainEnergy = thisElecEquip.ConGainRate * state.dataGlobal->TimeStepZoneSec;
    8408    17874733 :             thisElecEquip.LatGainEnergy = thisElecEquip.LatGainRate * state.dataGlobal->TimeStepZoneSec;
    8409    17874733 :             thisElecEquip.LostEnergy = thisElecEquip.LostRate * state.dataGlobal->TimeStepZoneSec;
    8410    17874733 :             thisElecEquip.TotGainEnergy = thisElecEquip.TotGainRate * state.dataGlobal->TimeStepZoneSec;
    8411             :         }
    8412             : 
    8413     3130181 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) {
    8414      325503 :             auto &thisGasEquip = state.dataHeatBal->ZoneGas(Loop);
    8415      325503 :             thisGasEquip.Consumption = thisGasEquip.Power * state.dataGlobal->TimeStepZoneSec;
    8416      325503 :             thisGasEquip.RadGainEnergy = thisGasEquip.RadGainRate * state.dataGlobal->TimeStepZoneSec;
    8417      325503 :             thisGasEquip.ConGainEnergy = thisGasEquip.ConGainRate * state.dataGlobal->TimeStepZoneSec;
    8418      325503 :             thisGasEquip.LatGainEnergy = thisGasEquip.LatGainRate * state.dataGlobal->TimeStepZoneSec;
    8419      325503 :             thisGasEquip.LostEnergy = thisGasEquip.LostRate * state.dataGlobal->TimeStepZoneSec;
    8420      325503 :             thisGasEquip.TotGainEnergy = thisGasEquip.TotGainRate * state.dataGlobal->TimeStepZoneSec;
    8421             :         }
    8422             : 
    8423     3255899 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) {
    8424      451221 :             auto &thisOtherEquip = state.dataHeatBal->ZoneOtherEq(Loop);
    8425      451221 :             thisOtherEquip.Consumption = thisOtherEquip.Power * state.dataGlobal->TimeStepZoneSec;
    8426      451221 :             thisOtherEquip.RadGainEnergy = thisOtherEquip.RadGainRate * state.dataGlobal->TimeStepZoneSec;
    8427      451221 :             thisOtherEquip.ConGainEnergy = thisOtherEquip.ConGainRate * state.dataGlobal->TimeStepZoneSec;
    8428      451221 :             thisOtherEquip.LatGainEnergy = thisOtherEquip.LatGainRate * state.dataGlobal->TimeStepZoneSec;
    8429      451221 :             thisOtherEquip.LostEnergy = thisOtherEquip.LostRate * state.dataGlobal->TimeStepZoneSec;
    8430      451221 :             thisOtherEquip.TotGainEnergy = thisOtherEquip.TotGainRate * state.dataGlobal->TimeStepZoneSec;
    8431             :         }
    8432             : 
    8433     2890958 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) {
    8434       86280 :             auto &thisHWEquip = state.dataHeatBal->ZoneHWEq(Loop);
    8435       86280 :             thisHWEquip.Consumption = thisHWEquip.Power * state.dataGlobal->TimeStepZoneSec;
    8436       86280 :             thisHWEquip.RadGainEnergy = thisHWEquip.RadGainRate * state.dataGlobal->TimeStepZoneSec;
    8437       86280 :             thisHWEquip.ConGainEnergy = thisHWEquip.ConGainRate * state.dataGlobal->TimeStepZoneSec;
    8438       86280 :             thisHWEquip.LatGainEnergy = thisHWEquip.LatGainRate * state.dataGlobal->TimeStepZoneSec;
    8439       86280 :             thisHWEquip.LostEnergy = thisHWEquip.LostRate * state.dataGlobal->TimeStepZoneSec;
    8440       86280 :             thisHWEquip.TotGainEnergy = thisHWEquip.TotGainRate * state.dataGlobal->TimeStepZoneSec;
    8441             :         }
    8442             : 
    8443     2818193 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) {
    8444       13515 :             auto &thisSteamEquip = state.dataHeatBal->ZoneSteamEq(Loop);
    8445       13515 :             thisSteamEquip.Consumption = thisSteamEquip.Power * state.dataGlobal->TimeStepZoneSec;
    8446       13515 :             thisSteamEquip.RadGainEnergy = thisSteamEquip.RadGainRate * state.dataGlobal->TimeStepZoneSec;
    8447       13515 :             thisSteamEquip.ConGainEnergy = thisSteamEquip.ConGainRate * state.dataGlobal->TimeStepZoneSec;
    8448       13515 :             thisSteamEquip.LatGainEnergy = thisSteamEquip.LatGainRate * state.dataGlobal->TimeStepZoneSec;
    8449       13515 :             thisSteamEquip.LostEnergy = thisSteamEquip.LostRate * state.dataGlobal->TimeStepZoneSec;
    8450       13515 :             thisSteamEquip.TotGainEnergy = thisSteamEquip.TotGainRate * state.dataGlobal->TimeStepZoneSec;
    8451             :         }
    8452             : 
    8453     2812787 :         for (int Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) {
    8454        8109 :             auto &thisBBHeat = state.dataHeatBal->ZoneBBHeat(Loop);
    8455        8109 :             thisBBHeat.Consumption = thisBBHeat.Power * state.dataGlobal->TimeStepZoneSec;
    8456        8109 :             thisBBHeat.RadGainEnergy = thisBBHeat.RadGainRate * state.dataGlobal->TimeStepZoneSec;
    8457        8109 :             thisBBHeat.ConGainEnergy = thisBBHeat.ConGainRate * state.dataGlobal->TimeStepZoneSec;
    8458        8109 :             thisBBHeat.TotGainEnergy = thisBBHeat.TotGainRate * state.dataGlobal->TimeStepZoneSec;
    8459             :         }
    8460             : 
    8461             :         // Zero zone-level values
    8462    22672022 :         for (auto &e : state.dataHeatBal->ZoneIntGain) {
    8463    19867344 :             e.NOFOCC = 0.0;
    8464    19867344 :             e.QLTSW = 0.0;
    8465     2804678 :         }
    8466             : 
    8467    22672022 :         for (auto &e : state.dataHeatBal->ZoneRpt) {
    8468             :             // People
    8469    19867344 :             e.PeopleRadGain = 0.0;
    8470    19867344 :             e.PeopleConGain = 0.0;
    8471    19867344 :             e.PeopleSenGain = 0.0;
    8472    19867344 :             e.PeopleNumOcc = 0.0;
    8473    19867344 :             e.PeopleLatGain = 0.0;
    8474    19867344 :             e.PeopleTotGain = 0.0;
    8475    19867344 :             e.PeopleRadGainRate = 0.0;
    8476    19867344 :             e.PeopleConGainRate = 0.0;
    8477    19867344 :             e.PeopleSenGainRate = 0.0;
    8478    19867344 :             e.PeopleLatGainRate = 0.0;
    8479    19867344 :             e.PeopleTotGainRate = 0.0;
    8480             :             // Lights
    8481    19867344 :             e.LtsPower = 0.0;
    8482    19867344 :             e.LtsElecConsump = 0.0;
    8483    19867344 :             e.LtsRadGain = 0.0;
    8484    19867344 :             e.LtsVisGain = 0.0;
    8485    19867344 :             e.LtsConGain = 0.0;
    8486    19867344 :             e.LtsRetAirGain = 0.0;
    8487    19867344 :             e.LtsTotGain = 0.0;
    8488    19867344 :             e.LtsRadGainRate = 0.0;
    8489    19867344 :             e.LtsVisGainRate = 0.0;
    8490    19867344 :             e.LtsConGainRate = 0.0;
    8491    19867344 :             e.LtsRetAirGainRate = 0.0;
    8492    19867344 :             e.LtsTotGainRate = 0.0;
    8493             :             // Baseboard Heat
    8494    19867344 :             e.BaseHeatPower = 0.0;
    8495    19867344 :             e.BaseHeatElecCons = 0.0;
    8496    19867344 :             e.BaseHeatRadGain = 0.0;
    8497    19867344 :             e.BaseHeatConGain = 0.0;
    8498    19867344 :             e.BaseHeatTotGain = 0.0;
    8499    19867344 :             e.BaseHeatRadGainRate = 0.0;
    8500    19867344 :             e.BaseHeatConGainRate = 0.0;
    8501    19867344 :             e.BaseHeatTotGainRate = 0.0;
    8502             :             // Electric Equipment
    8503    19867344 :             e.ElecPower = 0.0;
    8504    19867344 :             e.ElecConsump = 0.0;
    8505    19867344 :             e.ElecRadGain = 0.0;
    8506    19867344 :             e.ElecConGain = 0.0;
    8507    19867344 :             e.ElecLatGain = 0.0;
    8508    19867344 :             e.ElecLost = 0.0;
    8509    19867344 :             e.ElecTotGain = 0.0;
    8510    19867344 :             e.ElecRadGainRate = 0.0;
    8511    19867344 :             e.ElecConGainRate = 0.0;
    8512    19867344 :             e.ElecLatGainRate = 0.0;
    8513    19867344 :             e.ElecLostRate = 0.0;
    8514    19867344 :             e.ElecTotGainRate = 0.0;
    8515             :             // Gas Equipment
    8516    19867344 :             e.GasPower = 0.0;
    8517    19867344 :             e.GasConsump = 0.0;
    8518    19867344 :             e.GasRadGain = 0.0;
    8519    19867344 :             e.GasConGain = 0.0;
    8520    19867344 :             e.GasLatGain = 0.0;
    8521    19867344 :             e.GasLost = 0.0;
    8522    19867344 :             e.GasTotGain = 0.0;
    8523    19867344 :             e.GasRadGainRate = 0.0;
    8524    19867344 :             e.GasConGainRate = 0.0;
    8525    19867344 :             e.GasLatGainRate = 0.0;
    8526    19867344 :             e.GasLostRate = 0.0;
    8527    19867344 :             e.GasTotGainRate = 0.0;
    8528             :             // Hot Water Equipment
    8529    19867344 :             e.HWPower = 0.0;
    8530    19867344 :             e.HWConsump = 0.0;
    8531    19867344 :             e.HWRadGain = 0.0;
    8532    19867344 :             e.HWConGain = 0.0;
    8533    19867344 :             e.HWLatGain = 0.0;
    8534    19867344 :             e.HWLost = 0.0;
    8535    19867344 :             e.HWTotGain = 0.0;
    8536    19867344 :             e.HWRadGainRate = 0.0;
    8537    19867344 :             e.HWConGainRate = 0.0;
    8538    19867344 :             e.HWLatGainRate = 0.0;
    8539    19867344 :             e.HWLostRate = 0.0;
    8540    19867344 :             e.HWTotGainRate = 0.0;
    8541             :             // Steam Equipment
    8542    19867344 :             e.SteamPower = 0.0;
    8543    19867344 :             e.SteamConsump = 0.0;
    8544    19867344 :             e.SteamRadGain = 0.0;
    8545    19867344 :             e.SteamConGain = 0.0;
    8546    19867344 :             e.SteamLatGain = 0.0;
    8547    19867344 :             e.SteamLost = 0.0;
    8548    19867344 :             e.SteamTotGain = 0.0;
    8549    19867344 :             e.SteamRadGainRate = 0.0;
    8550    19867344 :             e.SteamConGainRate = 0.0;
    8551    19867344 :             e.SteamLatGainRate = 0.0;
    8552    19867344 :             e.SteamLostRate = 0.0;
    8553    19867344 :             e.SteamTotGainRate = 0.0;
    8554             :             // Other Equipment
    8555    19867344 :             e.OtherRadGain = 0.0;
    8556    19867344 :             e.OtherConGain = 0.0;
    8557    19867344 :             e.OtherLatGain = 0.0;
    8558    19867344 :             e.OtherLost = 0.0;
    8559    19867344 :             e.OtherTotGain = 0.0;
    8560    19867344 :             e.OtherRadGainRate = 0.0;
    8561    19867344 :             e.OtherConGainRate = 0.0;
    8562    19867344 :             e.OtherLatGainRate = 0.0;
    8563    19867344 :             e.OtherLostRate = 0.0;
    8564    19867344 :             e.OtherTotGainRate = 0.0;
    8565             :             // Overall Zone Variables
    8566    19867344 :             e.TotRadiantGain = 0.0;
    8567    19867344 :             e.TotVisHeatGain = 0.0;
    8568    19867344 :             e.TotConvectiveGain = 0.0;
    8569    19867344 :             e.TotLatentGain = 0.0;
    8570    19867344 :             e.TotTotalHeatGain = 0.0;
    8571    19867344 :             e.TotRadiantGainRate = 0.0;
    8572    19867344 :             e.TotVisHeatGainRate = 0.0;
    8573    19867344 :             e.TotConvectiveGainRate = 0.0;
    8574    19867344 :             e.TotLatentGainRate = 0.0;
    8575    19867344 :             e.TotTotalHeatGainRate = 0.0;
    8576             :             // Contaminant
    8577             :             // e.CO2Rate = 0.0; - cleared and accumulated in InitInternalHeatGains
    8578    19867344 :             e.GCRate = 0.0;
    8579   317877504 :             for (int i = 0; i < (int)Constant::eFuel::Num; ++i) {
    8580   298010160 :                 e.OtherPower[i] = 0.0;
    8581   298010160 :                 e.OtherConsump[i] = 0.0;
    8582             :             }
    8583     2804678 :         }
    8584             : 
    8585    22720622 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    8586    19915944 :             auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(spaceNum);
    8587    19915944 :             auto &thisSpaceIntGain = state.dataHeatBal->spaceIntGain(spaceNum);
    8588    19915944 :             int zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
    8589    19915944 :             auto &thisZoneRpt = state.dataHeatBal->ZoneRpt(zoneNum);
    8590    19915944 :             auto &thisZoneIntGain = state.dataHeatBal->ZoneIntGain(zoneNum);
    8591             :             // People
    8592    19915944 :             thisSpaceRpt.PeopleNumOcc = thisSpaceIntGain.NOFOCC;
    8593    19915944 :             thisSpaceRpt.PeopleRadGain = thisSpaceRpt.PeopleRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8594    19915944 :             thisSpaceRpt.PeopleConGain = thisSpaceRpt.PeopleConGainRate * state.dataGlobal->TimeStepZoneSec;
    8595    19915944 :             thisSpaceRpt.PeopleSenGain = thisSpaceRpt.PeopleSenGainRate * state.dataGlobal->TimeStepZoneSec;
    8596    19915944 :             thisSpaceRpt.PeopleLatGain = thisSpaceRpt.PeopleLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8597    19915944 :             thisSpaceRpt.PeopleTotGain = thisSpaceRpt.PeopleTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8598             : 
    8599    19915944 :             thisZoneIntGain.NOFOCC += thisSpaceIntGain.NOFOCC;
    8600    19915944 :             thisZoneRpt.PeopleRadGainRate += thisSpaceRpt.PeopleRadGainRate;
    8601    19915944 :             thisZoneRpt.PeopleConGainRate += thisSpaceRpt.PeopleConGainRate;
    8602    19915944 :             thisZoneRpt.PeopleSenGainRate += thisSpaceRpt.PeopleSenGainRate;
    8603    19915944 :             thisZoneRpt.PeopleLatGainRate += thisSpaceRpt.PeopleLatGainRate;
    8604    19915944 :             thisZoneRpt.PeopleTotGainRate += thisSpaceRpt.PeopleTotGainRate;
    8605             : 
    8606             :             // General Lights
    8607    19915944 :             thisSpaceRpt.LtsElecConsump = thisSpaceRpt.LtsPower * state.dataGlobal->TimeStepZoneSec;
    8608    19915944 :             thisSpaceRpt.LtsRetAirGain = thisSpaceRpt.LtsRetAirGainRate * state.dataGlobal->TimeStepZoneSec;
    8609    19915944 :             thisSpaceRpt.LtsRadGain = thisSpaceRpt.LtsRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8610    19915944 :             thisSpaceRpt.LtsTotGain = thisSpaceRpt.LtsTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8611    19915944 :             thisSpaceRpt.LtsConGain = thisSpaceRpt.LtsConGainRate * state.dataGlobal->TimeStepZoneSec;
    8612    19915944 :             thisSpaceRpt.LtsVisGain = thisSpaceRpt.LtsVisGainRate * state.dataGlobal->TimeStepZoneSec;
    8613             : 
    8614    19915944 :             thisZoneRpt.LtsPower += thisSpaceRpt.LtsPower;
    8615    19915944 :             thisZoneRpt.LtsRetAirGainRate += thisSpaceRpt.LtsRetAirGainRate;
    8616    19915944 :             thisZoneRpt.LtsRadGainRate += thisSpaceRpt.LtsRadGainRate;
    8617    19915944 :             thisZoneRpt.LtsTotGainRate += thisSpaceRpt.LtsTotGainRate;
    8618    19915944 :             thisZoneRpt.LtsConGainRate += thisSpaceRpt.LtsConGainRate;
    8619    19915944 :             thisZoneRpt.LtsVisGainRate += thisSpaceRpt.LtsVisGainRate;
    8620    19915944 :             thisZoneIntGain.QLTSW += thisSpaceIntGain.QLTSW;
    8621             : 
    8622             :             // Electric Equipment
    8623    19915944 :             thisSpaceRpt.ElecConsump = thisSpaceRpt.ElecPower * state.dataGlobal->TimeStepZoneSec;
    8624    19915944 :             thisSpaceRpt.ElecConGain = thisSpaceRpt.ElecConGainRate * state.dataGlobal->TimeStepZoneSec;
    8625    19915944 :             thisSpaceRpt.ElecRadGain = thisSpaceRpt.ElecRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8626    19915944 :             thisSpaceRpt.ElecLatGain = thisSpaceRpt.ElecLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8627    19915944 :             thisSpaceRpt.ElecLost = thisSpaceRpt.ElecLostRate * state.dataGlobal->TimeStepZoneSec;
    8628    19915944 :             thisSpaceRpt.ElecTotGainRate = thisSpaceRpt.ElecConGainRate + thisSpaceRpt.ElecRadGainRate + thisSpaceRpt.ElecLatGainRate;
    8629    19915944 :             thisSpaceRpt.ElecTotGain = thisSpaceRpt.ElecTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8630             : 
    8631    19915944 :             thisZoneRpt.ElecPower += thisSpaceRpt.ElecPower;
    8632    19915944 :             thisZoneRpt.ElecConGainRate += thisSpaceRpt.ElecConGainRate;
    8633    19915944 :             thisZoneRpt.ElecRadGainRate += thisSpaceRpt.ElecRadGainRate;
    8634    19915944 :             thisZoneRpt.ElecLatGainRate += thisSpaceRpt.ElecLatGainRate;
    8635    19915944 :             thisZoneRpt.ElecLostRate += thisSpaceRpt.ElecLostRate;
    8636    19915944 :             thisZoneRpt.ElecTotGainRate += thisSpaceRpt.ElecTotGainRate;
    8637             : 
    8638             :             // Gas Equipment
    8639    19915944 :             thisSpaceRpt.GasConsump = thisSpaceRpt.GasPower * state.dataGlobal->TimeStepZoneSec;
    8640    19915944 :             thisSpaceRpt.GasConGain = thisSpaceRpt.GasConGainRate * state.dataGlobal->TimeStepZoneSec;
    8641    19915944 :             thisSpaceRpt.GasRadGain = thisSpaceRpt.GasRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8642    19915944 :             thisSpaceRpt.GasLatGain = thisSpaceRpt.GasLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8643    19915944 :             thisSpaceRpt.GasLost = thisSpaceRpt.GasLostRate * state.dataGlobal->TimeStepZoneSec;
    8644    19915944 :             thisSpaceRpt.GasTotGainRate = thisSpaceRpt.GasConGainRate + thisSpaceRpt.GasRadGainRate + thisSpaceRpt.GasLatGainRate;
    8645    19915944 :             thisSpaceRpt.GasTotGain = thisSpaceRpt.GasTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8646             : 
    8647    19915944 :             thisZoneRpt.GasPower += thisSpaceRpt.GasPower;
    8648    19915944 :             thisZoneRpt.GasConGainRate += thisSpaceRpt.GasConGainRate;
    8649    19915944 :             thisZoneRpt.GasRadGainRate += thisSpaceRpt.GasRadGainRate;
    8650    19915944 :             thisZoneRpt.GasLatGainRate += thisSpaceRpt.GasLatGainRate;
    8651    19915944 :             thisZoneRpt.GasLostRate += thisSpaceRpt.GasLostRate;
    8652    19915944 :             thisZoneRpt.GasTotGainRate += thisSpaceRpt.GasTotGainRate;
    8653             : 
    8654             :             // Hot Water Equipment
    8655    19915944 :             thisSpaceRpt.HWConsump = thisSpaceRpt.HWPower * state.dataGlobal->TimeStepZoneSec;
    8656    19915944 :             thisSpaceRpt.HWConGain = thisSpaceRpt.HWConGainRate * state.dataGlobal->TimeStepZoneSec;
    8657    19915944 :             thisSpaceRpt.HWRadGain = thisSpaceRpt.HWRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8658    19915944 :             thisSpaceRpt.HWLatGain = thisSpaceRpt.HWLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8659    19915944 :             thisSpaceRpt.HWLost = thisSpaceRpt.HWLostRate * state.dataGlobal->TimeStepZoneSec;
    8660    19915944 :             thisSpaceRpt.HWTotGainRate = thisSpaceRpt.HWConGainRate + thisSpaceRpt.HWRadGainRate + thisSpaceRpt.HWLatGainRate;
    8661    19915944 :             thisSpaceRpt.HWTotGain = thisSpaceRpt.HWTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8662             : 
    8663    19915944 :             thisZoneRpt.HWPower += thisSpaceRpt.HWPower;
    8664    19915944 :             thisZoneRpt.HWConGainRate += thisSpaceRpt.HWConGainRate;
    8665    19915944 :             thisZoneRpt.HWRadGainRate += thisSpaceRpt.HWRadGainRate;
    8666    19915944 :             thisZoneRpt.HWLatGainRate += thisSpaceRpt.HWLatGainRate;
    8667    19915944 :             thisZoneRpt.HWLostRate += thisSpaceRpt.HWLostRate;
    8668    19915944 :             thisZoneRpt.HWTotGainRate += thisSpaceRpt.HWTotGainRate;
    8669             : 
    8670             :             // Steam Equipment
    8671    19915944 :             thisSpaceRpt.SteamConsump = thisSpaceRpt.SteamPower * state.dataGlobal->TimeStepZoneSec;
    8672    19915944 :             thisSpaceRpt.SteamConGain = thisSpaceRpt.SteamConGainRate * state.dataGlobal->TimeStepZoneSec;
    8673    19915944 :             thisSpaceRpt.SteamRadGain = thisSpaceRpt.SteamRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8674    19915944 :             thisSpaceRpt.SteamLatGain = thisSpaceRpt.SteamLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8675    19915944 :             thisSpaceRpt.SteamLost = thisSpaceRpt.SteamLostRate * state.dataGlobal->TimeStepZoneSec;
    8676    19915944 :             thisSpaceRpt.SteamTotGainRate = thisSpaceRpt.SteamConGainRate + thisSpaceRpt.SteamRadGainRate + thisSpaceRpt.SteamLatGainRate;
    8677    19915944 :             thisSpaceRpt.SteamTotGain = thisSpaceRpt.SteamTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8678             : 
    8679    19915944 :             thisZoneRpt.SteamPower += thisSpaceRpt.SteamPower;
    8680    19915944 :             thisZoneRpt.SteamConGainRate += thisSpaceRpt.SteamConGainRate;
    8681    19915944 :             thisZoneRpt.SteamRadGainRate += thisSpaceRpt.SteamRadGainRate;
    8682    19915944 :             thisZoneRpt.SteamLatGainRate += thisSpaceRpt.SteamLatGainRate;
    8683    19915944 :             thisZoneRpt.SteamLostRate += thisSpaceRpt.SteamLostRate;
    8684    19915944 :             thisZoneRpt.SteamTotGainRate += thisSpaceRpt.SteamTotGainRate;
    8685             : 
    8686             :             // Other Equipment
    8687    19915944 :             thisSpaceRpt.OtherConGain = thisSpaceRpt.OtherConGainRate * state.dataGlobal->TimeStepZoneSec;
    8688    19915944 :             thisSpaceRpt.OtherRadGain = thisSpaceRpt.OtherRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8689    19915944 :             thisSpaceRpt.OtherLatGain = thisSpaceRpt.OtherLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8690    19915944 :             thisSpaceRpt.OtherLost = thisSpaceRpt.OtherLostRate * state.dataGlobal->TimeStepZoneSec;
    8691    19915944 :             thisSpaceRpt.OtherTotGainRate = thisSpaceRpt.OtherConGainRate + thisSpaceRpt.OtherRadGainRate + thisSpaceRpt.OtherLatGainRate;
    8692    19915944 :             thisSpaceRpt.OtherTotGain = thisSpaceRpt.OtherTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8693             : 
    8694    19915944 :             thisZoneRpt.OtherConGainRate += thisSpaceRpt.OtherConGainRate;
    8695    19915944 :             thisZoneRpt.OtherRadGainRate += thisSpaceRpt.OtherRadGainRate;
    8696    19915944 :             thisZoneRpt.OtherLatGainRate += thisSpaceRpt.OtherLatGainRate;
    8697    19915944 :             thisZoneRpt.OtherLostRate += thisSpaceRpt.OtherLostRate;
    8698    19915944 :             thisZoneRpt.OtherTotGainRate += thisSpaceRpt.OtherTotGainRate;
    8699             : 
    8700    19920669 :             for (Constant::eFuel fuelTypeNum : state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNums) {
    8701        4725 :                 int fuelIdx = (int)fuelTypeNum;
    8702        4725 :                 thisSpaceRpt.OtherConsump[fuelIdx] = thisSpaceRpt.OtherPower[fuelIdx] * state.dataGlobal->TimeStepZoneSec;
    8703        4725 :                 thisZoneRpt.OtherPower[fuelIdx] += thisSpaceRpt.OtherPower[fuelIdx];
    8704    19915944 :             }
    8705             : 
    8706             :             // Baseboard Heat
    8707    19915944 :             thisSpaceRpt.BaseHeatElecCons = thisSpaceRpt.BaseHeatPower * state.dataGlobal->TimeStepZoneSec;
    8708    19915944 :             thisSpaceRpt.BaseHeatConGain = thisSpaceRpt.BaseHeatConGainRate * state.dataGlobal->TimeStepZoneSec;
    8709    19915944 :             thisSpaceRpt.BaseHeatRadGain = thisSpaceRpt.BaseHeatRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8710    19915944 :             thisSpaceRpt.BaseHeatTotGainRate = thisSpaceRpt.BaseHeatConGainRate + thisSpaceRpt.BaseHeatRadGainRate;
    8711    19915944 :             thisSpaceRpt.BaseHeatTotGain = thisSpaceRpt.BaseHeatTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8712             : 
    8713    19915944 :             thisZoneRpt.BaseHeatPower += thisSpaceRpt.BaseHeatPower;
    8714    19915944 :             thisZoneRpt.BaseHeatConGainRate += thisSpaceRpt.BaseHeatConGainRate;
    8715    19915944 :             thisZoneRpt.BaseHeatRadGainRate += thisSpaceRpt.BaseHeatRadGainRate;
    8716    19915944 :             thisZoneRpt.BaseHeatTotGainRate += thisSpaceRpt.BaseHeatTotGainRate;
    8717             : 
    8718             :             // Overall Space Variables
    8719             : 
    8720             :             // these overalls include component gains from devices like water heater, water use, and generators
    8721             :             //   working vars QFCConv QGenConv QFCRad QGenRad  WaterUseLatentGain WaterThermalTankGain WaterUseSensibleGain
    8722             : 
    8723    19915944 :             thisSpaceRpt.TotVisHeatGain = thisSpaceRpt.LtsVisGain;
    8724    19915944 :             thisSpaceRpt.TotVisHeatGainRate = thisSpaceRpt.LtsVisGainRate;
    8725             : 
    8726    19915944 :             thisSpaceRpt.TotRadiantGainRate = SumInternalRadiationGainsByTypes(state, zoneNum, TradIntGainTypes, spaceNum);
    8727    19915944 :             thisSpaceRpt.TotRadiantGain = thisSpaceRpt.TotRadiantGainRate * state.dataGlobal->TimeStepZoneSec;
    8728             : 
    8729    19915944 :             thisSpaceRpt.TotConvectiveGainRate = SumInternalConvectionGainsByTypes(state, zoneNum, TradIntGainTypes, spaceNum);
    8730    19915944 :             thisSpaceRpt.TotConvectiveGain = thisSpaceRpt.TotConvectiveGainRate * state.dataGlobal->TimeStepZoneSec;
    8731             : 
    8732    19915944 :             thisSpaceRpt.TotLatentGainRate = SumInternalLatentGainsByTypes(state, zoneNum, TradIntGainTypes, spaceNum);
    8733    19915944 :             thisSpaceRpt.TotLatentGain = thisSpaceRpt.TotLatentGainRate * state.dataGlobal->TimeStepZoneSec;
    8734             : 
    8735    19915944 :             thisSpaceRpt.TotTotalHeatGainRate = thisSpaceRpt.TotLatentGainRate + thisSpaceRpt.TotRadiantGainRate +
    8736    19915944 :                                                 thisSpaceRpt.TotConvectiveGainRate + thisSpaceRpt.TotVisHeatGainRate;
    8737    19915944 :             thisSpaceRpt.TotTotalHeatGain = thisSpaceRpt.TotTotalHeatGainRate * state.dataGlobal->TimeStepZoneSec;
    8738             :         }
    8739             : 
    8740    22672022 :         for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
    8741    19867344 :             auto &thisZoneRpt = state.dataHeatBal->ZoneRpt(zoneNum);
    8742    19867344 :             auto &thisZoneIntGain = state.dataHeatBal->ZoneIntGain(zoneNum);
    8743             : 
    8744             :             // People
    8745    19867344 :             thisZoneRpt.PeopleNumOcc = thisZoneIntGain.NOFOCC;
    8746    19867344 :             thisZoneRpt.PeopleRadGain = thisZoneRpt.PeopleRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8747    19867344 :             thisZoneRpt.PeopleConGain = thisZoneRpt.PeopleConGainRate * state.dataGlobal->TimeStepZoneSec;
    8748    19867344 :             thisZoneRpt.PeopleSenGain = thisZoneRpt.PeopleSenGainRate * state.dataGlobal->TimeStepZoneSec;
    8749    19867344 :             thisZoneRpt.PeopleLatGain = thisZoneRpt.PeopleLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8750    19867344 :             thisZoneRpt.PeopleTotGain = thisZoneRpt.PeopleTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8751             : 
    8752             :             // General Lights
    8753    19867344 :             thisZoneRpt.LtsRetAirGain = thisZoneRpt.LtsRetAirGainRate * state.dataGlobal->TimeStepZoneSec;
    8754    19867344 :             thisZoneRpt.LtsRadGain = thisZoneRpt.LtsRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8755    19867344 :             thisZoneRpt.LtsTotGain = thisZoneRpt.LtsTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8756    19867344 :             thisZoneRpt.LtsConGain = thisZoneRpt.LtsConGainRate * state.dataGlobal->TimeStepZoneSec;
    8757    19867344 :             thisZoneRpt.LtsVisGain = thisZoneRpt.LtsVisGainRate * state.dataGlobal->TimeStepZoneSec;
    8758    19867344 :             thisZoneRpt.LtsElecConsump = thisZoneRpt.LtsPower * state.dataGlobal->TimeStepZoneSec;
    8759             : 
    8760             :             // Electric Equipment
    8761    19867344 :             thisZoneRpt.ElecConGain = thisZoneRpt.ElecConGainRate * state.dataGlobal->TimeStepZoneSec;
    8762    19867344 :             thisZoneRpt.ElecRadGain = thisZoneRpt.ElecRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8763    19867344 :             thisZoneRpt.ElecLatGain = thisZoneRpt.ElecLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8764    19867344 :             thisZoneRpt.ElecLost = thisZoneRpt.ElecLostRate * state.dataGlobal->TimeStepZoneSec;
    8765    19867344 :             thisZoneRpt.ElecConsump = thisZoneRpt.ElecPower * state.dataGlobal->TimeStepZoneSec;
    8766    19867344 :             thisZoneRpt.ElecTotGain = thisZoneRpt.ElecTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8767             : 
    8768             :             // Gas Equipment
    8769    19867344 :             thisZoneRpt.GasConGain = thisZoneRpt.GasConGainRate * state.dataGlobal->TimeStepZoneSec;
    8770    19867344 :             thisZoneRpt.GasRadGain = thisZoneRpt.GasRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8771    19867344 :             thisZoneRpt.GasLatGain = thisZoneRpt.GasLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8772    19867344 :             thisZoneRpt.GasLost = thisZoneRpt.GasLostRate * state.dataGlobal->TimeStepZoneSec;
    8773    19867344 :             thisZoneRpt.GasConsump = thisZoneRpt.GasPower * state.dataGlobal->TimeStepZoneSec;
    8774    19867344 :             thisZoneRpt.GasTotGain = thisZoneRpt.GasTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8775             : 
    8776             :             // Hot Water Equipment
    8777    19867344 :             thisZoneRpt.HWConGain = thisZoneRpt.HWConGainRate * state.dataGlobal->TimeStepZoneSec;
    8778    19867344 :             thisZoneRpt.HWRadGain = thisZoneRpt.HWRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8779    19867344 :             thisZoneRpt.HWLatGain = thisZoneRpt.HWLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8780    19867344 :             thisZoneRpt.HWLost = thisZoneRpt.HWLostRate * state.dataGlobal->TimeStepZoneSec;
    8781    19867344 :             thisZoneRpt.HWConsump = thisZoneRpt.HWPower * state.dataGlobal->TimeStepZoneSec;
    8782    19867344 :             thisZoneRpt.HWTotGain = thisZoneRpt.HWTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8783             : 
    8784             :             // Steam Equipment
    8785    19867344 :             thisZoneRpt.SteamConGain = thisZoneRpt.SteamConGainRate * state.dataGlobal->TimeStepZoneSec;
    8786    19867344 :             thisZoneRpt.SteamRadGain = thisZoneRpt.SteamRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8787    19867344 :             thisZoneRpt.SteamLatGain = thisZoneRpt.SteamLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8788    19867344 :             thisZoneRpt.SteamLost = thisZoneRpt.SteamLostRate * state.dataGlobal->TimeStepZoneSec;
    8789    19867344 :             thisZoneRpt.SteamConsump = thisZoneRpt.SteamPower * state.dataGlobal->TimeStepZoneSec;
    8790    19867344 :             thisZoneRpt.SteamTotGain = thisZoneRpt.SteamTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8791             : 
    8792             :             // Other Equipment
    8793    19867344 :             thisZoneRpt.OtherConGain = thisZoneRpt.OtherConGainRate * state.dataGlobal->TimeStepZoneSec;
    8794    19867344 :             thisZoneRpt.OtherRadGain = thisZoneRpt.OtherRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8795    19867344 :             thisZoneRpt.OtherLatGain = thisZoneRpt.OtherLatGainRate * state.dataGlobal->TimeStepZoneSec;
    8796    19867344 :             thisZoneRpt.OtherLost = thisZoneRpt.OtherLostRate * state.dataGlobal->TimeStepZoneSec;
    8797    19867344 :             thisZoneRpt.OtherTotGain = thisZoneRpt.OtherTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8798    19872069 :             for (Constant::eFuel fuelTypeNum : state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums) {
    8799        4725 :                 int fuelIdx = (int)fuelTypeNum;
    8800        4725 :                 thisZoneRpt.OtherConsump[fuelIdx] = thisZoneRpt.OtherPower[fuelIdx] * state.dataGlobal->TimeStepZoneSec;
    8801    19867344 :             }
    8802             : 
    8803             :             // Baseboard Heat
    8804    19867344 :             thisZoneRpt.BaseHeatConGain = thisZoneRpt.BaseHeatConGainRate * state.dataGlobal->TimeStepZoneSec;
    8805    19867344 :             thisZoneRpt.BaseHeatRadGain = thisZoneRpt.BaseHeatRadGainRate * state.dataGlobal->TimeStepZoneSec;
    8806    19867344 :             thisZoneRpt.BaseHeatElecCons = thisZoneRpt.BaseHeatPower * state.dataGlobal->TimeStepZoneSec;
    8807    19867344 :             thisZoneRpt.BaseHeatTotGain = thisZoneRpt.BaseHeatTotGainRate * state.dataGlobal->TimeStepZoneSec;
    8808             : 
    8809             :             // Overall Zone Variables
    8810             : 
    8811             :             // these overalls include component gains from devices like water heater, water use, and generators
    8812             :             //   working vars QFCConv QGenConv QFCRad QGenRad  WaterUseLatentGain WaterThermalTankGain WaterUseSensibleGain
    8813             : 
    8814    19867344 :             thisZoneRpt.TotVisHeatGain = thisZoneRpt.LtsVisGain;
    8815    19867344 :             thisZoneRpt.TotVisHeatGainRate = thisZoneRpt.LtsVisGainRate;
    8816             : 
    8817    19867344 :             thisZoneRpt.TotRadiantGainRate = SumInternalRadiationGainsByTypes(state, zoneNum, TradIntGainTypes);
    8818    19867344 :             thisZoneRpt.TotRadiantGain = thisZoneRpt.TotRadiantGainRate * state.dataGlobal->TimeStepZoneSec;
    8819             : 
    8820    19867344 :             thisZoneRpt.TotConvectiveGainRate = SumInternalConvectionGainsByTypes(state, zoneNum, TradIntGainTypes);
    8821    19867344 :             thisZoneRpt.TotConvectiveGain = thisZoneRpt.TotConvectiveGainRate * state.dataGlobal->TimeStepZoneSec;
    8822             : 
    8823    19867344 :             thisZoneRpt.TotLatentGainRate = SumInternalLatentGainsByTypes(state, zoneNum, TradIntGainTypes);
    8824    19867344 :             thisZoneRpt.TotLatentGain = thisZoneRpt.TotLatentGainRate * state.dataGlobal->TimeStepZoneSec;
    8825             : 
    8826    19867344 :             thisZoneRpt.TotTotalHeatGainRate =
    8827    19867344 :                 thisZoneRpt.TotLatentGainRate + thisZoneRpt.TotRadiantGainRate + thisZoneRpt.TotConvectiveGainRate + thisZoneRpt.TotVisHeatGainRate;
    8828    19867344 :             thisZoneRpt.TotTotalHeatGain = thisZoneRpt.TotTotalHeatGainRate * state.dataGlobal->TimeStepZoneSec;
    8829             :         }
    8830     2804678 :     }
    8831             : 
    8832         293 :     Real64 GetDesignLightingLevelForZone(EnergyPlusData &state, int const WhichZone) // name of zone
    8833             :     {
    8834             : 
    8835             :         // FUNCTION INFORMATION:
    8836             :         //       AUTHOR         Linda Lawrie
    8837             :         //       DATE WRITTEN   April 2007; January 2008 - moved to InternalGains
    8838             :         //       MODIFIED       na
    8839             :         //       RE-ENGINEERED  na
    8840             : 
    8841             :         // PURPOSE OF THIS FUNCTION:
    8842             :         // This routine sums the Lighting Level for a zone.
    8843             :         // Will issue a severe error for illegal zone.
    8844             :         // Must be called after InternalHeatGains get input.
    8845             : 
    8846             :         // Using/Aliasing
    8847             :         using namespace DataHeatBalance;
    8848             :         // Return value
    8849             :         Real64 DesignLightingLevelSum; // Sum of design lighting level for this zone
    8850             : 
    8851             :         // FUNCTION LOCAL VARIABLE DECLARATIONS:
    8852             :         int Loop;
    8853             : 
    8854         293 :         if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) {
    8855           0 :             ShowFatalError(state, "GetDesignLightingLevelForZone: Function called prior to Getting Lights Input.");
    8856             :         }
    8857             : 
    8858         293 :         DesignLightingLevelSum = 0.0;
    8859             : 
    8860        7011 :         for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
    8861        6718 :             if (state.dataHeatBal->Lights(Loop).ZonePtr == WhichZone) {
    8862         295 :                 DesignLightingLevelSum += state.dataHeatBal->Lights(Loop).DesignLevel;
    8863             :             }
    8864             :         }
    8865             : 
    8866         293 :         return DesignLightingLevelSum;
    8867             :     }
    8868             : 
    8869         146 :     bool CheckThermalComfortSchedules(bool const WorkEffSch, // Blank work efficiency schedule = true
    8870             :                                       bool const CloInsSch,  // Blank clothing insulation schedule = true
    8871             :                                       bool const AirVeloSch) // Blank air velocity schedule = true
    8872             :     {
    8873         146 :         bool TCSchedsPresent = false;
    8874             : 
    8875         146 :         if (!WorkEffSch || !CloInsSch || !AirVeloSch) {
    8876          34 :             TCSchedsPresent = true;
    8877             :         }
    8878             : 
    8879         146 :         return TCSchedsPresent;
    8880             :     }
    8881             : 
    8882         293 :     void CheckLightsReplaceableMinMaxForZone(EnergyPlusData &state, int const WhichZone) // Zone Number
    8883             :     {
    8884             : 
    8885             :         // SUBROUTINE INFORMATION:
    8886             :         //       AUTHOR         Linda Lawrie
    8887             :         //       DATE WRITTEN   April 2007
    8888             :         //       MODIFIED       na
    8889             :         //       RE-ENGINEERED  na
    8890             : 
    8891             :         // PURPOSE OF THIS SUBROUTINE:
    8892             :         // Daylighting is not available unless Lights (replaceable) is 0.0 or 1.0.  No dimming will be done
    8893             :         // unless the lights replaceable fraction is 1.0.  This is documented in the InputOutputReference but
    8894             :         // not warned about.  Also, this will sum the Zone Design Lighting level, in case the calling routine
    8895             :         // would like to have an error if the lights is zero and daylighting is requested.
    8896             : 
    8897             :         // METHODOLOGY EMPLOYED:
    8898             :         // Traverse the LIGHTS structure and get fraction replaceable - min/max as well as lighting
    8899             :         // level for a zone.
    8900             : 
    8901             :         // Using/Aliasing
    8902             :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    8903             :         int Loop;
    8904             :         Real64 LightsRepMin; // Minimum Lighting replacement fraction for any lights statement for this zone
    8905             :         Real64 LightsRepMax; // Maximum Lighting replacement fraction for any lights statement for this zone
    8906             :         int NumLights;       // Number of Lights statement for that zone.
    8907             : 
    8908         293 :         if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) {
    8909           0 :             ShowFatalError(state, "CheckLightsReplaceableMinMaxForZone: Function called prior to Getting Lights Input.");
    8910             :         }
    8911             : 
    8912         293 :         LightsRepMin = 99999.0;
    8913         293 :         LightsRepMax = -99999.0;
    8914         293 :         NumLights = 0;
    8915             : 
    8916        7011 :         for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
    8917        6718 :             if (state.dataHeatBal->Lights(Loop).ZonePtr != WhichZone) continue;
    8918         295 :             LightsRepMin = min(LightsRepMin, state.dataHeatBal->Lights(Loop).FractionReplaceable);
    8919         295 :             LightsRepMax = max(LightsRepMax, state.dataHeatBal->Lights(Loop).FractionReplaceable);
    8920         295 :             ++NumLights;
    8921         590 :             if ((state.dataDayltg->ZoneDaylight(WhichZone).totRefPts > 0) &&
    8922         295 :                 (state.dataHeatBal->Lights(Loop).FractionReplaceable > 0.0 && state.dataHeatBal->Lights(Loop).FractionReplaceable < 1.0)) {
    8923           0 :                 ShowWarningError(state, "CheckLightsReplaceableMinMaxForZone: Fraction Replaceable must be 0.0 or 1.0 if used with daylighting.");
    8924           0 :                 ShowContinueError(state,
    8925           0 :                                   format("..Lights=\"{}\", Fraction Replaceable will be reset to 1.0 to allow dimming controls",
    8926           0 :                                          state.dataHeatBal->Lights(Loop).Name));
    8927           0 :                 ShowContinueError(state, format("..in Zone={}", state.dataHeatBal->Zone(WhichZone).Name));
    8928           0 :                 state.dataHeatBal->Lights(Loop).FractionReplaceable = 1.0;
    8929             :             }
    8930             :         }
    8931             : 
    8932         293 :         if (state.dataDayltg->ZoneDaylight(WhichZone).totRefPts > 0) {
    8933         293 :             if (LightsRepMax == 0.0) {
    8934           2 :                 ShowWarningError(state,
    8935           2 :                                  format("CheckLightsReplaceable: Zone \"{}\" has Daylighting:Controls.", state.dataHeatBal->Zone(WhichZone).Name));
    8936           1 :                 ShowContinueError(state, "but all of the LIGHTS object in that zone have zero Fraction Replaceable.");
    8937           1 :                 ShowContinueError(state, "The daylighting controls will have no effect.");
    8938             :             }
    8939         293 :             if (NumLights == 0) {
    8940           0 :                 ShowWarningError(state,
    8941           0 :                                  format("CheckLightsReplaceable: Zone \"{}\" has Daylighting:Controls.", state.dataHeatBal->Zone(WhichZone).Name));
    8942           0 :                 ShowContinueError(state, "but there are no LIGHTS objects in that zone.");
    8943           0 :                 ShowContinueError(state, "The daylighting controls will have no effect.");
    8944             :             }
    8945             :         }
    8946         293 :     }
    8947             : 
    8948     6671167 :     void UpdateInternalGainValues(EnergyPlusData &state, bool const SuppressRadiationUpdate, bool const SumLatentGains)
    8949             :     {
    8950             : 
    8951             :         // SUBROUTINE INFORMATION:
    8952             :         //       AUTHOR         B. Griffith
    8953             :         //       DATE WRITTEN   Dec. 2011
    8954     6671167 :         bool DoRadiationUpdate{!SuppressRadiationUpdate};
    8955             : 
    8956             :         // store pointer values to hold generic internal gain values constant for entire timestep
    8957    56567324 :         for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
    8958    49896157 :             auto &thisIntGain = state.dataHeatBal->spaceIntGainDevices(spaceNum);
    8959   187992297 :             for (int Loop = 1; Loop <= thisIntGain.numberOfDevices; ++Loop) {
    8960   138096140 :                 thisIntGain.device(Loop).ConvectGainRate = *thisIntGain.device(Loop).PtrConvectGainRate * thisIntGain.device(Loop).spaceGainFrac;
    8961   276192280 :                 thisIntGain.device(Loop).ReturnAirConvGainRate =
    8962   138096140 :                     *thisIntGain.device(Loop).PtrReturnAirConvGainRate * thisIntGain.device(Loop).spaceGainFrac;
    8963   138096140 :                 if (DoRadiationUpdate)
    8964    55758248 :                     thisIntGain.device(Loop).RadiantGainRate = *thisIntGain.device(Loop).PtrRadiantGainRate * thisIntGain.device(Loop).spaceGainFrac;
    8965   138096140 :                 thisIntGain.device(Loop).LatentGainRate = *thisIntGain.device(Loop).PtrLatentGainRate * thisIntGain.device(Loop).spaceGainFrac;
    8966   276192280 :                 thisIntGain.device(Loop).ReturnAirLatentGainRate =
    8967   138096140 :                     *thisIntGain.device(Loop).PtrReturnAirLatentGainRate * thisIntGain.device(Loop).spaceGainFrac;
    8968   276192280 :                 thisIntGain.device(Loop).CarbonDioxideGainRate =
    8969   138096140 :                     *thisIntGain.device(Loop).PtrCarbonDioxideGainRate * thisIntGain.device(Loop).spaceGainFrac;
    8970   138096140 :                 thisIntGain.device(Loop).GenericContamGainRate =
    8971   138096140 :                     *thisIntGain.device(Loop).PtrGenericContamGainRate * thisIntGain.device(Loop).spaceGainFrac;
    8972             :             }
    8973             :         }
    8974     6671167 :         if (SumLatentGains) {
    8975    33782838 :             for (int NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) {
    8976    29916349 :                 InternalHeatGains::SumAllInternalLatentGains(state, NZ);
    8977             :                 // Added for the hybrid model
    8978    29916349 :                 if (state.dataHybridModel->FlagHybridModel_PC) {
    8979        8212 :                     InternalHeatGains::SumAllInternalLatentGainsExceptPeople(state, NZ);
    8980             :                 }
    8981             :             }
    8982             :         }
    8983             : 
    8984     6671167 :         if (state.dataContaminantBalance->Contaminant.GenericContamSimulation && allocated(state.dataContaminantBalance->ZoneGCGain)) {
    8985      355534 :             for (int NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) {
    8986      324838 :                 state.dataContaminantBalance->ZoneGCGain(NZ) = InternalHeatGains::SumAllInternalGenericContamGains(state, NZ);
    8987      324838 :                 state.dataHeatBal->ZoneRpt(NZ).GCRate = state.dataContaminantBalance->ZoneGCGain(NZ);
    8988             :             }
    8989             :         }
    8990     6671167 :     }
    8991             : 
    8992    89857979 :     Real64 zoneSumAllInternalConvectionGains(EnergyPlusData &state,
    8993             :                                              int const zoneNum // zone index pointer to sum gains for
    8994             :     )
    8995             :     {
    8996    89857979 :         Real64 zoneSumConvGainRate(0.0);
    8997             :         // worker routine for summing all the internal gain types
    8998             : 
    8999   179975338 :         for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) {
    9000    90117359 :             if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) continue;
    9001    79987968 :             zoneSumConvGainRate += InternalHeatGains::spaceSumAllInternalConvectionGains(state, spaceNum);
    9002    89857979 :         }
    9003             : 
    9004    89857979 :         return zoneSumConvGainRate;
    9005             :     }
    9006             : 
    9007    80103532 :     Real64 spaceSumAllInternalConvectionGains(EnergyPlusData &state,
    9008             :                                               int const spaceNum // space index pointer to sum gains for
    9009             :     )
    9010             :     {
    9011             :         // SUBROUTINE INFORMATION:
    9012             :         //       AUTHOR         B. Griffith
    9013             :         //       DATE WRITTEN   Nov. 2011
    9014             : 
    9015             :         // PURPOSE OF THIS SUBROUTINE:
    9016             :         // worker routine for summing all the internal gain types
    9017             : 
    9018    80103532 :         Real64 spaceSumConvGainRate(0.0);
    9019             : 
    9020   328061149 :         for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9021   247957617 :             spaceSumConvGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ConvectGainRate;
    9022             :         }
    9023    80103532 :         return spaceSumConvGainRate;
    9024             :     }
    9025             : 
    9026             :     // For HybridModel
    9027       16424 :     Real64 SumAllInternalConvectionGainsExceptPeople(EnergyPlusData &state, int const ZoneNum)
    9028             :     {
    9029             :         // Return value
    9030       16424 :         Real64 SumConvGainRateExceptPeople = 0.0;
    9031             : 
    9032       32848 :         for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9033       16424 :             if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9034           0 :                 continue;
    9035             :             }
    9036       32848 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9037       16424 :                 if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType != DataHeatBalance::IntGainType::People) {
    9038           0 :                     SumConvGainRateExceptPeople += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ConvectGainRate;
    9039             :                 }
    9040             :             }
    9041       16424 :         }
    9042             : 
    9043       16424 :         return SumConvGainRateExceptPeople;
    9044             :     }
    9045             : 
    9046    42260532 :     Real64 SumInternalConvectionGainsByTypes(
    9047             :         EnergyPlusData &state,
    9048             :         int const ZoneNum,                                         // zone index pointer for which zone to sum gains for
    9049             :         gsl::span<const DataHeatBalance::IntGainType> GainTypeARR, // variable length 1-d array of enum valued gain types
    9050             :         int const spaceIndex)                                      // space index pointer, sum gains only for this space
    9051             :     {
    9052             : 
    9053             :         // SUBROUTINE INFORMATION:
    9054             :         //       AUTHOR         B. Griffith
    9055             :         //       DATE WRITTEN   Nov. 2011cl
    9056             : 
    9057             :         // PURPOSE OF THIS SUBROUTINE:
    9058             :         // worker routine for summing a subset of the internal gain types
    9059             : 
    9060             :         // Return value
    9061    42260532 :         Real64 SumConvGainRate = 0.0;
    9062             : 
    9063    42260532 :         int NumberOfTypes = GainTypeARR.size();
    9064             : 
    9065             :         // TODO MJW: This could be refactored to avoid duplicate code, but for now . . . .
    9066    42260532 :         if (spaceIndex > 0) {
    9067    75674192 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceIndex).numberOfDevices; ++DeviceNum) {
    9068   501824232 :                 for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
    9069   446065984 :                     if (state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
    9070    52789789 :                         SumConvGainRate += state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).ConvectGainRate;
    9071             :                     }
    9072             :                 }
    9073             :             }
    9074             :         } else {
    9075    44867376 :             for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9076    22522788 :                 if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9077     2434781 :                     continue;
    9078             :                 }
    9079    83736429 :                 for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9080   567199107 :                     for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
    9081   503550685 :                         if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
    9082    53874406 :                             SumConvGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ConvectGainRate;
    9083             :                         }
    9084             :                     }
    9085             :                 }
    9086    22344588 :             }
    9087             :         }
    9088             : 
    9089    42260532 :         return SumConvGainRate;
    9090             :     }
    9091             : 
    9092    61564780 :     Real64 zoneSumAllReturnAirConvectionGains(EnergyPlusData &state,
    9093             :                                               int const zoneNum,      // zone index pointer  to sum gains for
    9094             :                                               int const returnNodeNum // return air node number
    9095             :     )
    9096             :     {
    9097    61564780 :         Real64 zoneSumReturnAirGainRate = 0.0;
    9098   123225168 :         for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) {
    9099    61660388 :             if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) continue;
    9100    60788735 :             zoneSumReturnAirGainRate += InternalHeatGains::spaceSumAllReturnAirConvectionGains(state, spaceNum, returnNodeNum);
    9101    61564780 :         }
    9102             : 
    9103    61564780 :         return zoneSumReturnAirGainRate;
    9104             :     }
    9105             : 
    9106    60788735 :     Real64 spaceSumAllReturnAirConvectionGains(EnergyPlusData &state,
    9107             :                                                int const spaceNum,     // space index pointer to sum gains for
    9108             :                                                int const returnNodeNum // return air node number
    9109             :     )
    9110             :     {
    9111             : 
    9112             :         // SUBROUTINE INFORMATION:
    9113             :         //       AUTHOR         B. Griffith
    9114             :         //       DATE WRITTEN   Dec. 2011
    9115             : 
    9116             :         // PURPOSE OF THIS SUBROUTINE:
    9117             :         // worker routine for summing all the internal gain types
    9118             : 
    9119    60788735 :         Real64 spaceSumReturnAirGainRate = 0.0;
    9120             : 
    9121   253260508 :         for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9122             :             // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum
    9123   192471773 :             if ((returnNodeNum == 0) || (returnNodeNum == state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ReturnAirNodeNum)) {
    9124    82378139 :                 spaceSumReturnAirGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ReturnAirConvGainRate;
    9125             :             }
    9126             :         }
    9127             : 
    9128    60788735 :         return spaceSumReturnAirGainRate;
    9129             :     }
    9130             : 
    9131      603156 :     Real64 SumReturnAirConvectionGainsByTypes(
    9132             :         EnergyPlusData &state,
    9133             :         int const ZoneNum,                                        // zone index pointer for which zone to sum gains for
    9134             :         gsl::span<const DataHeatBalance::IntGainType> GainTypeARR // variable length 1-d array of integer valued gain types
    9135             :     )
    9136             :     {
    9137             : 
    9138             :         // SUBROUTINE INFORMATION:
    9139             :         //       AUTHOR         B. Griffith
    9140             :         //       DATE WRITTEN   Nov. 2011
    9141             : 
    9142             :         // PURPOSE OF THIS SUBROUTINE:
    9143             :         // worker routine for summing a subset of the internal gain types
    9144             : 
    9145             :         // Return value
    9146      603156 :         Real64 SumReturnAirGainRate(0.0);
    9147             : 
    9148      603156 :         int NumberOfTypes = GainTypeARR.size();
    9149             : 
    9150     1238712 :         for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9151      635556 :             if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9152       82536 :                 continue;
    9153             :             }
    9154             : 
    9155     2460000 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9156    12395370 :                 for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
    9157             : 
    9158    10488390 :                     if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
    9159      361320 :                         SumReturnAirGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ReturnAirConvGainRate;
    9160             :                     }
    9161             :                 }
    9162             :             }
    9163      603156 :         }
    9164             : 
    9165      603156 :         return SumReturnAirGainRate;
    9166             :     }
    9167             : 
    9168    19915944 :     Real64 SumAllSpaceInternalRadiationGains(EnergyPlusData &state,
    9169             :                                              int const spaceNum // space index pointer for which space to sum gains for
    9170             :     )
    9171             :     {
    9172             : 
    9173             :         // SUBROUTINE INFORMATION:
    9174             :         //       AUTHOR         B. Griffith
    9175             :         //       DATE WRITTEN   Nov. 2011
    9176             : 
    9177             :         // PURPOSE OF THIS SUBROUTINE:
    9178             :         // worker routine for summing all the internal gain types
    9179             : 
    9180             :         // Return value
    9181    19915944 :         Real64 sumRadGainRate(0.0);
    9182             : 
    9183    19915944 :         if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9184     2104637 :             sumRadGainRate = 0.0;
    9185     2104637 :             return sumRadGainRate;
    9186             :         }
    9187             : 
    9188    73569555 :         for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9189    55758248 :             sumRadGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).RadiantGainRate;
    9190             :         }
    9191             : 
    9192    17811307 :         return sumRadGainRate;
    9193             :     }
    9194             : 
    9195             :     Real64
    9196    41291178 :     SumInternalRadiationGainsByTypes(EnergyPlusData &state,
    9197             :                                      int const ZoneNum,                                         // zone index pointer for which zone to sum gains for
    9198             :                                      gsl::span<const DataHeatBalance::IntGainType> GainTypeARR, // variable length 1-d array of enum valued gain types
    9199             :                                      int const spaceIndex)                                      // space index pointer, sum gains only for this space
    9200             :     {
    9201             : 
    9202             :         // SUBROUTINE INFORMATION:
    9203             :         //       AUTHOR         B. Griffith
    9204             :         //       DATE WRITTEN   Dec. 2011
    9205             : 
    9206             :         // PURPOSE OF THIS SUBROUTINE:
    9207             :         // worker routine for summing a subset of the internal gain types
    9208             : 
    9209             :         // Return value
    9210    41291178 :         Real64 SumRadiationGainRate(0.0);
    9211             : 
    9212    41291178 :         int NumberOfTypes = GainTypeARR.size();
    9213             : 
    9214             :         // TODO MJW: This could be refactored to avoid duplicate code, but for now . . . .
    9215    41291178 :         if (spaceIndex > 0) {
    9216    75674192 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceIndex).numberOfDevices; ++DeviceNum) {
    9217   501824232 :                 for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
    9218   446065984 :                     if (state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
    9219    52789789 :                         SumRadiationGainRate += state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).RadiantGainRate;
    9220             :                     }
    9221             :                 }
    9222             :             }
    9223             :         } else {
    9224    42880068 :             for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9225    21504834 :                 if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9226     2310977 :                     continue;
    9227             :                 }
    9228    79719555 :                 for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9229   543777792 :                     for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
    9230   483252094 :                         if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
    9231    53743279 :                             SumRadiationGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).RadiantGainRate;
    9232             :                         }
    9233             :                     }
    9234             :                 }
    9235    21375234 :             }
    9236             :         }
    9237             : 
    9238    41291178 :         return SumRadiationGainRate;
    9239             :     }
    9240             : 
    9241    49783693 :     void SumAllInternalLatentGains(EnergyPlusData &state,
    9242             :                                    int const ZoneNum // zone index pointer for which zone to sum gains for
    9243             :     )
    9244             :     {
    9245             : 
    9246             :         // SUBROUTINE INFORMATION:
    9247             :         //       AUTHOR         B. Griffith
    9248             :         //       DATE WRITTEN   Nov. 2011
    9249             : 
    9250             :         // PURPOSE OF THIS SUBROUTINE:
    9251             :         // worker routine for summing all the internal gain types
    9252             : 
    9253    49783693 :         Real64 zoneLatentGainRate = 0.0;
    9254             : 
    9255    99679850 :         for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9256    49896157 :             if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9257     5477479 :                 state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum).latentGain = 0.0;
    9258     5477479 :                 continue;
    9259             :             }
    9260             : 
    9261    44418678 :             Real64 spaceLatentGainRate = 0.0;
    9262   182514818 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9263   138096140 :                 spaceLatentGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).LatentGainRate;
    9264             :             }
    9265    44418678 :             state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum).latentGain = spaceLatentGainRate;
    9266    44418678 :             zoneLatentGainRate += spaceLatentGainRate;
    9267    49783693 :         }
    9268             : 
    9269    49783693 :         state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).latentGain = zoneLatentGainRate;
    9270    49783693 :     }
    9271             : 
    9272             :     // Added for hybrid model -- calculate the latent gain from all sources except for people
    9273       16308 :     void SumAllInternalLatentGainsExceptPeople(EnergyPlusData &state,
    9274             :                                                int const ZoneNum // zone index pointer for which zone to sum gains for
    9275             :     )
    9276             :     {
    9277       16308 :         Real64 zoneLatentGainRateExceptPeople(0.0);
    9278             : 
    9279       32616 :         for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9280       16308 :             if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9281           0 :                 continue;
    9282             :             }
    9283             : 
    9284       16308 :             Real64 spaceLatentGainRateExceptPeople = 0.0;
    9285       32616 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9286       16308 :                 if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType != DataHeatBalance::IntGainType::People) {
    9287           0 :                     spaceLatentGainRateExceptPeople += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).LatentGainRate;
    9288             :                 }
    9289             :             }
    9290       16308 :             state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum).latentGainExceptPeople = spaceLatentGainRateExceptPeople;
    9291       16308 :             zoneLatentGainRateExceptPeople += spaceLatentGainRateExceptPeople;
    9292       16308 :         }
    9293             : 
    9294       16308 :         state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).latentGainExceptPeople = zoneLatentGainRateExceptPeople;
    9295       16308 :     }
    9296             : 
    9297             :     Real64
    9298    40989600 :     SumInternalLatentGainsByTypes(EnergyPlusData &state,
    9299             :                                   int const ZoneNum,                                         // zone index pointer for which zone to sum gains for
    9300             :                                   gsl::span<const DataHeatBalance::IntGainType> GainTypeARR, // variable length 1-d array of enum valued gain types
    9301             :                                   int const spaceIndex)                                      // space index pointer, sum gains only for this space
    9302             :     {
    9303             :         // SUBROUTINE INFORMATION:
    9304             :         //       AUTHOR         B. Griffith
    9305             :         //       DATE WRITTEN   Dec. 2011
    9306             : 
    9307             :         // PURPOSE OF THIS SUBROUTINE:
    9308             :         // worker routine for summing a subset of the internal gain types
    9309             : 
    9310             :         // Return value
    9311    40989600 :         Real64 SumLatentGainRate(0.0);
    9312             : 
    9313    40989600 :         int NumberOfTypes = GainTypeARR.size();
    9314             : 
    9315             :         // TODO MJW: This could be refactored to avoid duplicate code, but for now . . . .
    9316    40989600 :         if (spaceIndex > 0) {
    9317    75674192 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceIndex).numberOfDevices; ++DeviceNum) {
    9318   501824232 :                 for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
    9319   446065984 :                     if (state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
    9320    52789789 :                         SumLatentGainRate += state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).LatentGainRate;
    9321             :                     }
    9322             :                 }
    9323             :             }
    9324             :         } else {
    9325    42260712 :             for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9326    21187056 :                 if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9327     2269709 :                     continue;
    9328             :                 }
    9329    78489555 :                 for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9330   525661482 :                     for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
    9331   466089274 :                         if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
    9332    53381959 :                             SumLatentGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).LatentGainRate;
    9333             :                         }
    9334             :                     }
    9335             :                 }
    9336    21073656 :             }
    9337             :         }
    9338             : 
    9339    40989600 :         return SumLatentGainRate;
    9340             :     }
    9341             : 
    9342    50757160 :     Real64 SumAllReturnAirLatentGains(EnergyPlusData &state,
    9343             :                                       int const ZoneNum,      // zone index pointer for which zone to sum gains for
    9344             :                                       int const ReturnNodeNum // return air node number
    9345             :     )
    9346             :     {
    9347             : 
    9348             :         // SUBROUTINE INFORMATION:
    9349             :         //       AUTHOR         B. Griffith
    9350             :         //       DATE WRITTEN   Nov. 2011
    9351             : 
    9352             :         // PURPOSE OF THIS SUBROUTINE:
    9353             :         // worker routine for summing all the internal gain types
    9354             : 
    9355    50757160 :         Real64 SumRetAirLatentGainRate(0.0);
    9356             : 
    9357   101609928 :         for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9358    50852768 :             if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9359      380028 :                 continue;
    9360             :             }
    9361             : 
    9362   211557997 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9363             :                 // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum
    9364   161085257 :                 if ((ReturnNodeNum == 0) || (ReturnNodeNum == state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ReturnAirNodeNum)) {
    9365    50992343 :                     SumRetAirLatentGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ReturnAirLatentGainRate;
    9366             :                 }
    9367             :             }
    9368    50757160 :         }
    9369             : 
    9370    50757160 :         return SumRetAirLatentGainRate;
    9371             :     }
    9372             : 
    9373      144831 :     Real64 SumAllInternalCO2Gains(EnergyPlusData &state,
    9374             :                                   int const ZoneNum // zone index pointer for which zone to sum gains for
    9375             :     )
    9376             :     {
    9377             : 
    9378             :         // SUBROUTINE INFORMATION:
    9379             :         //       AUTHOR         B. Griffith
    9380             :         //       DATE WRITTEN   Dec. 2011
    9381             : 
    9382             :         // PURPOSE OF THIS SUBROUTINE:
    9383             :         // worker routine for summing all the internal gain types
    9384             : 
    9385             :         // Return value
    9386      144831 :         Real64 SumCO2GainRate(0.0);
    9387             : 
    9388      289662 :         for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9389      144831 :             if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9390        7440 :                 continue;
    9391             :             }
    9392             : 
    9393      553653 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9394      416262 :                 SumCO2GainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CarbonDioxideGainRate;
    9395             :             }
    9396      144831 :         }
    9397             : 
    9398      144831 :         return SumCO2GainRate;
    9399             :     }
    9400             : 
    9401             :     // Added for hybrid model -- function for calculating CO2 gains except people
    9402        8100 :     Real64 SumAllInternalCO2GainsExceptPeople(EnergyPlusData &state,
    9403             :                                               int const ZoneNum // zone index pointer for which zone to sum gains for
    9404             :     )
    9405             :     {
    9406             :         // Return value
    9407        8100 :         Real64 SumCO2GainRateExceptPeople(0.0);
    9408             : 
    9409       16200 :         for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9410        8100 :             if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9411           0 :                 continue;
    9412             :             }
    9413             : 
    9414       16200 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9415        8100 :                 if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType != DataHeatBalance::IntGainType::People) {
    9416           0 :                     SumCO2GainRateExceptPeople += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CarbonDioxideGainRate;
    9417             :                 }
    9418             :             }
    9419        8100 :         }
    9420             : 
    9421        8100 :         return SumCO2GainRateExceptPeople;
    9422             :     }
    9423             : 
    9424             :     Real64
    9425      144831 :     SumInternalCO2GainsByTypes(EnergyPlusData &state,
    9426             :                                int const ZoneNum,                                        // zone index pointer for which zone to sum gains for
    9427             :                                gsl::span<const DataHeatBalance::IntGainType> GainTypeARR // variable length 1-d array of integer valued gain types
    9428             :     )
    9429             :     {
    9430             : 
    9431             :         // SUBROUTINE INFORMATION:
    9432             :         //       AUTHOR         B. Griffith
    9433             :         //       DATE WRITTEN   Dec. 2011
    9434             : 
    9435             :         // PURPOSE OF THIS SUBROUTINE:
    9436             :         // worker routine for summing a subset of the internal gain types
    9437             : 
    9438             :         // Return value
    9439      144831 :         Real64 SumCO2GainRate(0.0);
    9440             : 
    9441      144831 :         int NumberOfTypes = GainTypeARR.size();
    9442             : 
    9443      289662 :         for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9444      144831 :             if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9445        7440 :                 continue;
    9446             :             }
    9447             : 
    9448      553653 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9449      832524 :                 for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
    9450             : 
    9451      416262 :                     if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
    9452      144519 :                         SumCO2GainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CarbonDioxideGainRate;
    9453             :                     }
    9454             :                 }
    9455             :             }
    9456      144831 :         }
    9457             : 
    9458      144831 :         return SumCO2GainRate;
    9459             :     }
    9460             : 
    9461      324838 :     Real64 SumAllInternalGenericContamGains(EnergyPlusData &state,
    9462             :                                             int const ZoneNum // zone index pointer for which zone to sum gains for
    9463             :     )
    9464             :     {
    9465             : 
    9466             :         // SUBROUTINE INFORMATION:
    9467             :         //       AUTHOR         L. Gu
    9468             :         //       DATE WRITTEN   Feb. 2012
    9469             : 
    9470             :         // PURPOSE OF THIS SUBROUTINE:
    9471             :         // worker routine for summing all the internal gain types based on the existing subrotine SumAllInternalCO2Gains
    9472             : 
    9473             :         // Return value
    9474      324838 :         Real64 SumGCGainRate(0.0);
    9475             : 
    9476      649676 :         for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
    9477      324838 :             if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9478        5039 :                 continue;
    9479             :             }
    9480             : 
    9481     1343956 :             for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9482     1024157 :                 SumGCGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).GenericContamGainRate;
    9483             :             }
    9484      324838 :         }
    9485             : 
    9486      324838 :         return SumGCGainRate;
    9487             :     }
    9488             : 
    9489      818667 :     void GatherComponentLoadsIntGain(EnergyPlusData &state)
    9490             :     {
    9491             :         // SUBROUTINE INFORMATION:
    9492             :         //       AUTHOR         Jason Glazer
    9493             :         //       DATE WRITTEN   September 2012
    9494             :         //       MODIFIED       na
    9495             :         //       RE-ENGINEERED  na
    9496             : 
    9497             :         // PURPOSE OF THIS SUBROUTINE:
    9498             :         //   Gather values during sizing used for loads component report.
    9499             : 
    9500             :         // METHODOLOGY EMPLOYED:
    9501             :         //   Save sequence of values for report during sizing.
    9502             : 
    9503             :         // Using/Aliasing
    9504             :         using namespace DataHeatBalance;
    9505             : 
    9506             :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    9507             :         static constexpr std::array<DataHeatBalance::IntGainType, 1> IntGainTypesPeople = {DataHeatBalance::IntGainType::People};
    9508             :         static constexpr std::array<DataHeatBalance::IntGainType, 1> IntGainTypesLight = {DataHeatBalance::IntGainType::Lights};
    9509             :         static constexpr std::array<DataHeatBalance::IntGainType, 7> IntGainTypesEquip = {DataHeatBalance::IntGainType::ElectricEquipment,
    9510             :                                                                                           DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled,
    9511             :                                                                                           DataHeatBalance::IntGainType::GasEquipment,
    9512             :                                                                                           DataHeatBalance::IntGainType::HotWaterEquipment,
    9513             :                                                                                           DataHeatBalance::IntGainType::SteamEquipment,
    9514             :                                                                                           DataHeatBalance::IntGainType::OtherEquipment,
    9515             :                                                                                           DataHeatBalance::IntGainType::IndoorGreen};
    9516             :         static constexpr std::array<DataHeatBalance::IntGainType, 10> IntGainTypesRefrig = {
    9517             :             DataHeatBalance::IntGainType::RefrigerationCase,
    9518             :             DataHeatBalance::IntGainType::RefrigerationCompressorRack,
    9519             :             DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser,
    9520             :             DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe,
    9521             :             DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver,
    9522             :             DataHeatBalance::IntGainType::RefrigerationSecondaryPipe,
    9523             :             DataHeatBalance::IntGainType::RefrigerationWalkIn,
    9524             :             DataHeatBalance::IntGainType::RefrigerationTransSysAirCooledGasCooler,
    9525             :             DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeMT,
    9526             :             DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeLT};
    9527             :         static constexpr std::array<DataHeatBalance::IntGainType, 3> IntGainTypesWaterUse = {DataHeatBalance::IntGainType::WaterUseEquipment,
    9528             :                                                                                              DataHeatBalance::IntGainType::WaterHeaterMixed,
    9529             :                                                                                              DataHeatBalance::IntGainType::WaterHeaterStratified};
    9530             :         static constexpr std::array<DataHeatBalance::IntGainType, 20> IntGainTypesHvacLoss = {
    9531             :             DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled,
    9532             :             DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed,
    9533             :             DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified,
    9534             :             DataHeatBalance::IntGainType::PipeIndoor,
    9535             :             DataHeatBalance::IntGainType::Pump_VarSpeed,
    9536             :             DataHeatBalance::IntGainType::Pump_ConSpeed,
    9537             :             DataHeatBalance::IntGainType::Pump_Cond,
    9538             :             DataHeatBalance::IntGainType::PumpBank_VarSpeed,
    9539             :             DataHeatBalance::IntGainType::PumpBank_ConSpeed,
    9540             :             DataHeatBalance::IntGainType::PlantComponentUserDefined,
    9541             :             DataHeatBalance::IntGainType::CoilUserDefined,
    9542             :             DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined,
    9543             :             DataHeatBalance::IntGainType::AirTerminalUserDefined,
    9544             :             DataHeatBalance::IntGainType::PackagedTESCoilTank,
    9545             :             DataHeatBalance::IntGainType::FanSystemModel,
    9546             :             DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed,
    9547             :             DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed,
    9548             :             DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed,
    9549             :             DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed,
    9550             :             DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed};
    9551             :         static constexpr std::array<DataHeatBalance::IntGainType, 10> IntGainTypesPowerGen = {
    9552             :             DataHeatBalance::IntGainType::GeneratorFuelCell,
    9553             :             DataHeatBalance::IntGainType::GeneratorMicroCHP,
    9554             :             DataHeatBalance::IntGainType::ElectricLoadCenterTransformer,
    9555             :             DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple,
    9556             :             DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower,
    9557             :             DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable,
    9558             :             DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery,
    9559             :             DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery,
    9560             :             DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple,
    9561             :             DataHeatBalance::IntGainType::ElectricLoadCenterConverter};
    9562             :         // Explicitly list internal gains not gathered here
    9563             :         static constexpr std::array<DataHeatBalance::IntGainType, 3> ExcludedIntGainTypes = {
    9564             :             DataHeatBalance::IntGainType::ZoneContaminantSourceAndSinkCarbonDioxide,
    9565             :             DataHeatBalance::IntGainType::DaylightingDeviceTubular,
    9566             :             DataHeatBalance::IntGainType::ZoneContaminantSourceAndSinkGenericContam};
    9567             : 
    9568             :         // Make sure all types of internal gains have been gathered
    9569      818667 :         assert((int)(size(IntGainTypesPeople) + size(IntGainTypesLight) + size(IntGainTypesEquip) + size(IntGainTypesRefrig) +
    9570             :                      size(IntGainTypesWaterUse) + size(IntGainTypesHvacLoss) + size(IntGainTypesPowerGen) + size(ExcludedIntGainTypes)) ==
    9571             :                (int)DataHeatBalance::IntGainType::Num);
    9572             : 
    9573      818667 :         if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) {
    9574       36642 :             int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep;
    9575      338220 :             for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) {
    9576      301578 :                 state.dataOutRptTab->peopleInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9577      301578 :                     SumInternalConvectionGainsByTypes(state, iZone, IntGainTypesPeople);
    9578      301578 :                 state.dataOutRptTab->peopleLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9579      301578 :                     SumInternalLatentGainsByTypes(state, iZone, IntGainTypesPeople);
    9580      301578 :                 state.dataOutRptTab->peopleRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9581      301578 :                     SumInternalRadiationGainsByTypes(state, iZone, IntGainTypesPeople);
    9582             : 
    9583      301578 :                 state.dataOutRptTab->lightInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9584      301578 :                     SumInternalConvectionGainsByTypes(state, iZone, IntGainTypesLight);
    9585      301578 :                 state.dataOutRptTab->lightRetAirSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9586      301578 :                     SumReturnAirConvectionGainsByTypes(state, iZone, IntGainTypesLight);
    9587      301578 :                 state.dataOutRptTab->lightLWRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9588      301578 :                     SumInternalRadiationGainsByTypes(state, iZone, IntGainTypesLight);
    9589             : 
    9590      301578 :                 state.dataOutRptTab->equipInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9591      301578 :                     SumInternalConvectionGainsByTypes(state, iZone, IntGainTypesEquip);
    9592      301578 :                 state.dataOutRptTab->equipLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9593      301578 :                     SumInternalLatentGainsByTypes(state, iZone, IntGainTypesEquip);
    9594      301578 :                 state.dataOutRptTab->equipRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9595      301578 :                     SumInternalRadiationGainsByTypes(state, iZone, IntGainTypesEquip);
    9596             : 
    9597      301578 :                 state.dataOutRptTab->refrigInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9598      301578 :                     SumInternalConvectionGainsByTypes(state, iZone, IntGainTypesRefrig);
    9599      301578 :                 state.dataOutRptTab->refrigRetAirSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9600      301578 :                     SumReturnAirConvectionGainsByTypes(state, iZone, IntGainTypesRefrig);
    9601      301578 :                 state.dataOutRptTab->refrigLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9602      301578 :                     SumInternalLatentGainsByTypes(state, iZone, IntGainTypesRefrig);
    9603             : 
    9604      301578 :                 state.dataOutRptTab->waterUseInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9605      301578 :                     SumInternalConvectionGainsByTypes(state, iZone, IntGainTypesWaterUse);
    9606      301578 :                 state.dataOutRptTab->waterUseLatentSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9607      301578 :                     SumInternalLatentGainsByTypes(state, iZone, IntGainTypesWaterUse);
    9608             : 
    9609      301578 :                 state.dataOutRptTab->hvacLossInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9610      301578 :                     SumInternalConvectionGainsByTypes(state, iZone, IntGainTypesHvacLoss);
    9611      301578 :                 state.dataOutRptTab->hvacLossRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9612      301578 :                     SumInternalRadiationGainsByTypes(state, iZone, IntGainTypesHvacLoss);
    9613             : 
    9614      301578 :                 state.dataOutRptTab->powerGenInstantSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9615      301578 :                     SumInternalConvectionGainsByTypes(state, iZone, IntGainTypesPowerGen);
    9616      301578 :                 state.dataOutRptTab->powerGenRadSeq(state.dataSize->CurOverallSimDay, TimeStepInDay, iZone) =
    9617      603156 :                     SumInternalRadiationGainsByTypes(state, iZone, IntGainTypesPowerGen);
    9618             :             }
    9619             :         }
    9620      818667 :     }
    9621             : 
    9622          18 :     int GetInternalGainDeviceIndex(EnergyPlusData &state,
    9623             :                                    int const spaceNum,                             // space index pointer for which space to sum gains for
    9624             :                                    DataHeatBalance::IntGainType const intGainType, // space internal gain type enum
    9625             :                                    std::string_view const intGainName)             // Internal gain name
    9626             :     {
    9627             : 
    9628             :         // SUBROUTINE INFORMATION:
    9629             :         //       AUTHOR         B. Griffith
    9630             :         //       DATE WRITTEN   June 2012
    9631             : 
    9632             :         // PURPOSE OF THIS SUBROUTINE:
    9633             :         // utility to retrieve index pointer to a specific internal gain
    9634             :         // the subroutine returns the index of matched internal gain device or -1 if no match found.
    9635             : 
    9636             :         int DeviceNum;
    9637             :         int DeviceIndex;
    9638          18 :         if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
    9639           0 :             DeviceIndex = -1;
    9640           0 :             return DeviceIndex;
    9641             :         }
    9642          36 :         for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
    9643          54 :             if ((Util::SameString(state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompObjectName, intGainName.data())) &&
    9644          18 :                 (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == intGainType)) {
    9645          18 :                 DeviceIndex = DeviceNum;
    9646          18 :                 break;
    9647             :             } else {
    9648          18 :                 DeviceIndex = -1;
    9649             :             }
    9650             :         }
    9651          18 :         return DeviceIndex;
    9652             :     }
    9653             : 
    9654       51891 :     Real64 SumInternalConvectionGainsByIndices(
    9655             :         EnergyPlusData &state,
    9656             :         int const numGains,                // number of device gains to sum
    9657             :         const Array1D_int &deviceSpaceARR, // variable length 1-d array of integer space index pointers to include in summation
    9658             :         const Array1D_int &deviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation
    9659             :         const Array1D<Real64> &fractionARR // array of fractional multipliers to apply to devices
    9660             :     )
    9661             :     {
    9662             : 
    9663             :         // SUBROUTINE INFORMATION:
    9664             :         //       AUTHOR         B. Griffith
    9665             :         //       DATE WRITTEN   June 2012
    9666             : 
    9667             :         // PURPOSE OF THIS SUBROUTINE:
    9668             :         // worker routine for summing a subset of the internal gains by index
    9669             : 
    9670             :         // Return value
    9671       51891 :         Real64 sumConvGainRate(0.0);
    9672             : 
    9673       51891 :         assert(numGains <= isize(deviceSpaceARR));
    9674       51891 :         assert(numGains <= isize(deviceIndexARR));
    9675       51891 :         assert(numGains <= isize(fractionARR));
    9676             : 
    9677      207564 :         for (int loop = 1; loop <= numGains; ++loop) {
    9678      155673 :             int spaceNum = deviceSpaceARR(loop);
    9679      155673 :             int deviceNum = deviceIndexARR(loop);
    9680      155673 :             Real64 deviceFraction = fractionARR(loop);
    9681      155673 :             sumConvGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(deviceNum).ConvectGainRate * deviceFraction;
    9682             :         }
    9683       51891 :         return sumConvGainRate;
    9684             :     }
    9685             : 
    9686       51891 :     Real64 SumInternalLatentGainsByIndices(
    9687             :         EnergyPlusData &state,
    9688             :         int const numGains,                // number of device gains to sum
    9689             :         const Array1D_int &deviceSpaceARR, // variable length 1-d array of integer space index pointers to include in summation
    9690             :         const Array1D_int &deviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation
    9691             :         const Array1D<Real64> &fractionARR // array of fractional multipliers to apply to devices
    9692             :     )
    9693             :     {
    9694             : 
    9695             :         // SUBROUTINE INFORMATION:
    9696             :         //       AUTHOR         B. Griffith
    9697             :         //       DATE WRITTEN   June 2012
    9698             : 
    9699             :         // PURPOSE OF THIS SUBROUTINE:
    9700             :         // worker routine for summing a subset of the internal gains by index
    9701             : 
    9702             :         // Return value
    9703       51891 :         Real64 sumLatentGainRate(0.0);
    9704             : 
    9705       51891 :         assert(numGains <= isize(deviceSpaceARR));
    9706       51891 :         assert(numGains <= isize(deviceIndexARR));
    9707       51891 :         assert(numGains <= isize(fractionARR));
    9708             : 
    9709      207564 :         for (int loop = 1; loop <= numGains; ++loop) {
    9710      155673 :             int spaceNum = deviceSpaceARR(loop);
    9711      155673 :             int deviceNum = deviceIndexARR(loop);
    9712      155673 :             Real64 deviceFraction = fractionARR(loop);
    9713      155673 :             sumLatentGainRate =
    9714      155673 :                 sumLatentGainRate + state.dataHeatBal->spaceIntGainDevices(spaceNum).device(deviceNum).LatentGainRate * deviceFraction;
    9715             :         }
    9716       51891 :         return sumLatentGainRate;
    9717             :     }
    9718             : 
    9719       25718 :     Real64 SumReturnAirConvectionGainsByIndices(
    9720             :         EnergyPlusData &state,
    9721             :         int const numGains,                // number of device gains to sum
    9722             :         const Array1D_int &deviceSpaceARR, // variable length 1-d array of integer space index pointers to include in summation
    9723             :         const Array1D_int &deviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation
    9724             :         const Array1D<Real64> &fractionARR // array of fractional multipliers to apply to devices
    9725             :     )
    9726             :     {
    9727             : 
    9728             :         // SUBROUTINE INFORMATION:
    9729             :         //       AUTHOR         B. Griffith
    9730             :         //       DATE WRITTEN   June 2012
    9731             : 
    9732             :         // PURPOSE OF THIS SUBROUTINE:
    9733             :         // worker routine for summing a subset of the internal gains by index
    9734             : 
    9735             :         // Return value
    9736       25718 :         Real64 sumReturnAirGainRate(0.0);
    9737             : 
    9738       25718 :         assert(numGains <= isize(deviceSpaceARR));
    9739       25718 :         assert(numGains <= isize(deviceIndexARR));
    9740       25718 :         assert(numGains <= isize(fractionARR));
    9741             : 
    9742      102872 :         for (int loop = 1; loop <= numGains; ++loop) {
    9743       77154 :             int spaceNum = deviceSpaceARR(loop);
    9744       77154 :             int deviceNum = deviceIndexARR(loop);
    9745       77154 :             Real64 deviceFraction = fractionARR(loop);
    9746       77154 :             sumReturnAirGainRate =
    9747       77154 :                 sumReturnAirGainRate + state.dataHeatBal->spaceIntGainDevices(spaceNum).device(deviceNum).ReturnAirConvGainRate * deviceFraction;
    9748             :         }
    9749       25718 :         return sumReturnAirGainRate;
    9750             :     }
    9751             : 
    9752             : } // namespace InternalHeatGains
    9753             : 
    9754             : } // namespace EnergyPlus

Generated by: LCOV version 1.14